Imperial Analysis
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Muon.cc
Go to the documentation of this file.
1 #include "../interface/Muon.hh"
2 #include "../interface/city.h"
3 
4 namespace ic {
5 
7  : Candidate::Candidate(),
8  dr03_tk_sum_pt_(0.),
9  dr03_ecal_rechit_sum_et_(0.),
10  dr03_hcal_tower_sum_et_(0.),
11  dr03_pfiso_charged_all_(0.),
12  dr03_pfiso_charged_(0.),
13  dr03_pfiso_neutral_(0.),
14  dr03_pfiso_gamma_(0.),
15  dr03_pfiso_pu_(0.),
16  dr04_pfiso_charged_all_(0.),
17  dr04_pfiso_charged_(0.),
18  dr04_pfiso_neutral_(0.),
19  dr04_pfiso_gamma_(0.),
20  dr04_pfiso_pu_(0.),
21  is_standalone_(false),
22  is_global_(false),
23  is_tracker_(false),
24  is_calo_(false),
25  is_pf_(false),
26  gt_normalized_chi2_(0.),
27  cq_chi2_localposition_(0.),
28  cq_trk_kink_(0.),
29  gt_valid_muon_hits_(0),
30  matched_stations_(0),
31  it_pixel_hits_(0),
32  it_tracker_hits_(0),
33  it_layers_with_measurement_(0),
34  it_valid_fraction_(0),
35  segment_compatibility_(0),
36  dxy_vertex_(0.),
37  dz_vertex_(0.),
38  dxy_beamspot_(0.) {}
39 
41 
42  void Muon::SetIdIso(std::string const& name, float const& value) {
43  muon_idiso_[CityHash64(name)] = value;
44  }
45 
46  bool Muon::HasIdIso(std::string const& name) const {
47  return muon_idiso_.count(CityHash64(name)) > 0;
48  }
49 
50  float Muon::GetIdIso(std::string const& name) const {
51  UFmap::const_iterator iter = muon_idiso_.find(CityHash64(name));
52  if (iter != muon_idiso_.end()) {
53  return iter->second;
54  } else {
55  std::cerr << "Warning in <Muon::GetIdIso>: Label \""
56  << name << "\" not found" << std::endl;
57  return 0.0;
58  }
59  }
60 
61  void Muon::Print() const {
63  }
64 }
virtual void Print() const
Definition: Muon.cc:61
uint64 CityHash64(const char *buf, size_t len)
Definition: city.cc:200
float GetIdIso(std::string const &name) const
Get the value associated to a label.
Definition: Muon.cc:50
Stores a four-momentum, charge and identifier, and is the base class for most other physics objects...
Definition: Candidate.hh:13
Definition: CaloJet.hh:9
bool HasIdIso(std::string const &name) const
Check if a value with label name has already been defined.
Definition: Muon.cc:46
virtual ~Muon()
Definition: Muon.cc:40
void SetIdIso(std::string const &name, float const &value)
Add a new entry, overwriting any existing one with the same name.
Definition: Muon.cc:42
Muon()
Definition: Muon.cc:6
virtual void Print() const
Definition: Candidate.cc:9