Imperial Analysis
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Tau.cc
Go to the documentation of this file.
1 #include "../interface/Tau.hh"
2 #include "../interface/city.h"
3 // #include "boost/format.hpp"
4 
5 namespace ic {
6 
8  : ic::Candidate(),
9  decay_mode_(0),
10  lead_ecal_energy_(0.),
11  lead_hcal_energy_(0.),
12  lead_p_(0.),
13  lead_dxy_vertex_(0.),
14  lead_dz_vertex_(0.) {}
15 
17 
18 void Tau::Print() const { Candidate::Print(); }
19 
20 void Tau::SetTauID(std::string const& name, float const& value) {
21  tau_ids_[CityHash64(name)] = value;
22 }
23 
24 float Tau::GetTauID(std::string const& name) const {
25  UFmap::const_iterator iter = tau_ids_.find(CityHash64(name));
26  if (iter != tau_ids_.end()) {
27  return iter->second;
28  } else {
29  std::cerr << "Warning in <Tau::GetTauID>: Algorithm \"" << name
30  << "\" not found" << std::endl;
31  return 0.0;
32  }
33 }
34 
35 bool Tau::HasTauID(std::string const& name) const {
36  return tau_ids_.count(CityHash64(name)) > 0;
37 }
38 }
void SetTauID(std::string const &name, float const &value)
Add a new entry, overwriting any existing one with the same name.
Definition: Tau.cc:20
uint64 CityHash64(const char *buf, size_t len)
Definition: city.cc:200
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
virtual void Print() const
Definition: Tau.cc:18
bool HasTauID(std::string const &name) const
Check if a value with label name has already been defined.
Definition: Tau.cc:35
float GetTauID(std::string const &name) const
Get the value associated to a label.
Definition: Tau.cc:24
virtual void Print() const
Definition: Candidate.cc:9
virtual ~Tau()
Definition: Tau.cc:16
Tau()
Definition: Tau.cc:7