test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
muonisolation::NominalEfficiencyThresholds Class Reference

#include <NominalEfficiencyThresholds.h>

Classes

struct  EfficiencyBin
 compare to efficiencies More...
 
class  EtaBounds
 
struct  locless
 compare two locations More...
 
struct  ThresholdLocation
 threshold location More...
 

Public Member Functions

std::vector< double > bins () const
 
void dump ()
 
 NominalEfficiencyThresholds ()
 
 NominalEfficiencyThresholds (const std::string &infile)
 
float thresholdValueForEfficiency (ThresholdLocation location, float eff_thr) const
 
 ~NominalEfficiencyThresholds ()
 

Private Types

typedef std::map
< ThresholdLocation,
ThresholdConstituents, locless
MapType
 
typedef std::pair
< EfficiencyBin, float > 
ThresholdConstituent
 
typedef std::map
< EfficiencyBin, float,
EfficiencyBin
ThresholdConstituents
 

Private Member Functions

void add (ThresholdLocation location, ThresholdConstituent threshold)
 

Private Attributes

EtaBounds etabounds
 
MapType thresholds
 

Detailed Description

Definition at line 10 of file NominalEfficiencyThresholds.h.

Member Typedef Documentation

Definition at line 58 of file NominalEfficiencyThresholds.h.

Definition at line 56 of file NominalEfficiencyThresholds.h.

Definition at line 57 of file NominalEfficiencyThresholds.h.

Constructor & Destructor Documentation

muonisolation::NominalEfficiencyThresholds::NominalEfficiencyThresholds ( )
inline

Definition at line 12 of file NominalEfficiencyThresholds.h.

12 { }
muonisolation::NominalEfficiencyThresholds::NominalEfficiencyThresholds ( const std::string &  infile)
muonisolation::NominalEfficiencyThresholds::~NominalEfficiencyThresholds ( )
inline

Definition at line 14 of file NominalEfficiencyThresholds.h.

14 { }

Member Function Documentation

void NominalEfficiencyThresholds::add ( ThresholdLocation  location,
ThresholdConstituent  threshold 
)
private

Definition at line 100 of file NominalEfficiencyThresholds.cc.

Referenced by counter.Counter::register().

102 {
103  MapType::iterator ploc = thresholds.find(location);
104  if ( ploc == thresholds.end() ) {
106  mt.insert(threshold);
107  thresholds[location] = mt;
108  } else {
109 // cout << "insert element ("<<threshold.first.eff<<","
110 // <<threshold.first.eff_previous<<") to map "<<endl;
111  (*ploc).second.insert(threshold);
112 // cout << "new size is:"<< (*ploc).second.size() <<endl;
113  }
114 }
std::map< EfficiencyBin, float, EfficiencyBin > ThresholdConstituents
vector< double > NominalEfficiencyThresholds::bins ( ) const

Definition at line 43 of file NominalEfficiencyThresholds.cc.

References i, and mps_fire::result.

Referenced by muonisolation::IsolatorByNominalEfficiency::cuts().

44 {
45  vector<double> result;
46  for (unsigned int i=1; i <=EtaBounds::NumberOfTowers; i++) result.push_back(etabounds(i));
47  return result;
48 }
int i
Definition: DBlmapReader.cc:9
tuple result
Definition: mps_fire.py:84
void NominalEfficiencyThresholds::dump ( void  )

Definition at line 116 of file NominalEfficiencyThresholds.cc.

References gather_cfg::cout.

117 {
118  MapType::iterator ploc;
119  for (ploc = thresholds.begin(); ploc != thresholds.end(); ploc++) {
120  cout << "eta: "<< (*ploc).first.eta
121  << " icone: "<< (*ploc).first.cone<<endl;
122  ThresholdConstituents::iterator it;
123  for (it = (*ploc).second.begin(); it != (*ploc).second.end(); it++) {
124  cout << " eff: " << (*it).first.eff
125  << " eff_previous: "<< (*it).first.eff_previous
126  << " cut value: " << (*it).second <<endl;
127  }
128  }
129 }
tuple cout
Definition: gather_cfg.py:145
float NominalEfficiencyThresholds::thresholdValueForEfficiency ( ThresholdLocation  location,
float  eff_thr 
) const

Definition at line 131 of file NominalEfficiencyThresholds.cc.

References muonisolation::NominalEfficiencyThresholds::ThresholdLocation::cone, gather_cfg::cout, geometryDiff::epsilon, and muonisolation::NominalEfficiencyThresholds::ThresholdLocation::eta.

Referenced by muonisolation::IsolatorByNominalEfficiency::cuts(), and muonisolation::IsolatorByNominalEfficiency::result().

133 {
134  MapType::const_iterator ploc = thresholds.find(location);
135  if ( ploc == thresholds.end() ) {
136  cout << "NominalEfficiencyThresholds: Problem:can't find location in the map :( "
137  << location.eta << " " << location.cone << " " << eff_thr
138  <<endl;
139  return -1;
140  }
141 
142  const float epsilon=1.e-6;
143  EfficiencyBin eb = {eff_thr,eff_thr-epsilon};
144  ThresholdConstituents::const_iterator it = (*ploc).second.find(eb);
145  if (it == (*ploc).second.end()) {
146  cout << "NominalEfficiencyThresholds: Problem:can't find threshold in the map :("<<endl;
147  return -1;
148  }
149 
150  return (*it).second;
151 }
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

EtaBounds muonisolation::NominalEfficiencyThresholds::etabounds
private

Definition at line 63 of file NominalEfficiencyThresholds.h.

MapType muonisolation::NominalEfficiencyThresholds::thresholds
private

Definition at line 61 of file NominalEfficiencyThresholds.h.