Imperial Analysis
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Electron.cc
Go to the documentation of this file.
1 #include "../interface/Electron.hh"
2 #include "../interface/city.h"
3 #include "boost/format.hpp"
4 
5 namespace ic {
6 
8  : Candidate::Candidate(),
9  dr03_tk_sum_pt_(0.),
10  dr03_ecal_rechit_sum_et_(0.),
11  dr03_hcal_tower_sum_et_(0.),
12  ecal_pf_cluster_iso_(0.),
13  hcal_pf_cluster_iso_(0.),
14  dr03_pfiso_charged_all_(0.),
15  dr03_pfiso_charged_(0.),
16  dr03_pfiso_neutral_(0.),
17  dr03_pfiso_gamma_(0.),
18  dr03_pfiso_pu_(0.),
19  dr04_pfiso_charged_all_(0.),
20  dr04_pfiso_charged_(0.),
21  dr04_pfiso_neutral_(0.),
22  dr04_pfiso_gamma_(0.),
23  dr04_pfiso_pu_(0.),
24  hadronic_over_em_(0.),
25  full5x5_sigma_IetaIeta_(0.),
26  sigma_IetaIeta_(0.),
27  dphi_sc_tk_at_vtx_(0.),
28  deta_sc_tk_at_vtx_(0.),
29  gsf_tk_nhits_(0),
30  conv_dist_(0.),
31  conv_dcot_(0.),
32  f_brem_(0.),
33  sc_eta_(0.),
34  sc_seed_eta_(0.),
35  sc_theta_(0.),
36  sc_e_over_p_(0.),
37  sc_energy_(0.),
38  r9_(0.),
39  hcal_sum_(0.),
40  ecal_energy_(0.),
41  has_matched_conversion_(false),
42  dxy_vertex_(0.),
43  dz_vertex_(0.),
44  dxy_beamspot_(0.) {}
45 
47 
48 void Electron::SetIdIso(std::string const& name, float const& value) {
49  elec_idiso_[CityHash64(name)] = value;
50 }
51 
52 bool Electron::HasIdIso(std::string const& name) const {
53  return elec_idiso_.count(CityHash64(name)) > 0;
54 }
55 
56 float Electron::GetIdIso(std::string const& name) const {
57  UFmap::const_iterator iter = elec_idiso_.find(CityHash64(name));
58  if (iter != elec_idiso_.end()) {
59  return iter->second;
60  } else {
61  std::cerr << "Warning in <Electron::GetIdIso>: Label \""
62  << name << "\" not found" << std::endl;
63  return 0.0;
64  }
65 }
66 
67 void Electron::Print() const {
68  std::cout << "-sc_eta: " << this->sc_eta() << std::endl;
69  std::cout << "-sigma_IetaIeta: " << this->sigma_IetaIeta() << std::endl;
70  std::cout << "-hadronic_over_em: " << this->hadronic_over_em() << std::endl;
71  std::cout << "-dphi_sc_tk_at_vtx: " << this->dphi_sc_tk_at_vtx() << std::endl;
72  std::cout << "-deta_sc_tk_at_vtx: " << this->deta_sc_tk_at_vtx() << std::endl;
73  std::cout << "-gsf_tk_nhits: " << this->gsf_tk_nhits() << std::endl;
74  std::cout << "-has_matched_conversion: " << this->has_matched_conversion()
75  << std::endl;
76  std::cout << "-dxy_vertex: " << this->dxy_vertex() << std::endl;
77  std::cout << "-dz_vertex: " << this->dz_vertex() << std::endl;
78  std::cout << "-hadronic_over_em: " << this->hadronic_over_em() << std::endl;
79  std::cout << "-dr04_pfiso_charged_all " << this->dr04_pfiso_charged_all()
80  << std::endl;
81  std::cout << "-dr04_pfiso_charged " << this->dr04_pfiso_charged()
82  << std::endl;
83  std::cout << "-dr04_pfiso_neutral " << this->dr04_pfiso_neutral()
84  << std::endl;
85  std::cout << "-dr04_pfiso_gamma " << this->dr04_pfiso_gamma() << std::endl;
86  std::cout << "-dr04_pfiso_pu " << this->dr04_pfiso_pu() << std::endl;
87 }
88 }
float sc_eta() const
Supercluster .
Definition: Electron.hh:146
float sigma_IetaIeta() const
Weighted cluster RMS in the -direction, measured in units of crystals in a 5x5 block centred on the s...
Definition: Electron.hh:121
double dxy_vertex() const
Transverse impact parameter of the GSF track with the primary vertex.
Definition: Electron.hh:184
uint64 CityHash64(const char *buf, size_t len)
Definition: city.cc:200
int gsf_tk_nhits() const
Number of tracker layers between the vertex and the first detected hit the electron should have trave...
Definition: Electron.hh:133
float dr04_pfiso_pu() const
PF isolation, using charged pileup in a cone with .
Definition: Electron.hh:109
void SetIdIso(std::string const &name, float const &value)
Add a new entry, overwriting any existing one with the same name.
Definition: Electron.cc:48
virtual void Print() const
Definition: Electron.cc:67
bool HasIdIso(std::string const &name) const
Check if a value with label name has already been defined.
Definition: Electron.cc:52
float dr04_pfiso_charged() const
PF isolation, using charged hadrons in a cone with .
Definition: Electron.hh:100
Stores a four-momentum, charge and identifier, and is the base class for most other physics objects...
Definition: Candidate.hh:13
float dr04_pfiso_gamma() const
PF isolation, using photons in a cone with .
Definition: Electron.hh:106
virtual ~Electron()
Definition: Electron.cc:46
Definition: CaloJet.hh:9
float dr04_pfiso_neutral() const
PF isolation, using neutral hadrons in a cone with .
Definition: Electron.hh:103
float deta_sc_tk_at_vtx() const
between the supercluster and track, where the latter is evaluated from the vertex position ...
Definition: Electron.hh:129
double dz_vertex() const
Longitudinal impact parameter of the GSF track with the primary vertex.
Definition: Electron.hh:187
float dr04_pfiso_charged_all() const
PF isolation, using all charged particles in a cone with .
Definition: Electron.hh:95
float dphi_sc_tk_at_vtx() const
between the supercluster and track, where the latter is evaluated from the vertex position ...
Definition: Electron.hh:125
float hadronic_over_em() const
Ratio of HCAL to supercluster energy in the region of the electron hit.
Definition: Electron.hh:112
bool has_matched_conversion() const
True if electron is matched to a conversion vertex.
Definition: Electron.hh:172
float GetIdIso(std::string const &name) const
Get the value associated to a label.
Definition: Electron.cc:56