CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 54 of file NominalEfficiencyThresholds.h.

Definition at line 52 of file NominalEfficiencyThresholds.h.

Definition at line 53 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 98 of file NominalEfficiencyThresholds.cc.

References lowPtGsfElectronSeeds_cfi::thresholds().

Referenced by counter.Counter::register().

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

Definition at line 112 of file NominalEfficiencyThresholds.cc.

References gather_cfg::cout, and lowPtGsfElectronSeeds_cfi::thresholds().

112  {
113  MapType::iterator ploc;
114  for (ploc = thresholds.begin(); ploc != thresholds.end(); ploc++) {
115  cout << "eta: " << (*ploc).first.eta << " icone: " << (*ploc).first.cone << endl;
116  ThresholdConstituents::iterator it;
117  for (it = (*ploc).second.begin(); it != (*ploc).second.end(); it++) {
118  cout << " eff: " << (*it).first.eff << " eff_previous: " << (*it).first.eff_previous
119  << " cut value: " << (*it).second << endl;
120  }
121  }
122 }
tuple cout
Definition: gather_cfg.py:144
float NominalEfficiencyThresholds::thresholdValueForEfficiency ( ThresholdLocation  location,
float  eff_thr 
) const

Definition at line 124 of file NominalEfficiencyThresholds.cc.

References muonisolation::NominalEfficiencyThresholds::ThresholdLocation::cone, gather_cfg::cout, geometryDiff::epsilon, muonisolation::NominalEfficiencyThresholds::ThresholdLocation::eta, and lowPtGsfElectronSeeds_cfi::thresholds().

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

124  {
125  MapType::const_iterator ploc = thresholds.find(location);
126  if (ploc == thresholds.end()) {
127  cout << "NominalEfficiencyThresholds: Problem:can't find location in the map :( " << location.eta << " "
128  << location.cone << " " << eff_thr << endl;
129  return -1;
130  }
131 
132  const float epsilon = 1.e-6;
133  EfficiencyBin eb = {eff_thr, eff_thr - epsilon};
134  ThresholdConstituents::const_iterator it = (*ploc).second.find(eb);
135  if (it == (*ploc).second.end()) {
136  cout << "NominalEfficiencyThresholds: Problem:can't find threshold in the map :(" << endl;
137  return -1;
138  }
139 
140  return (*it).second;
141 }
tuple cout
Definition: gather_cfg.py:144

Member Data Documentation

EtaBounds muonisolation::NominalEfficiencyThresholds::etabounds
private

Definition at line 59 of file NominalEfficiencyThresholds.h.

MapType muonisolation::NominalEfficiencyThresholds::thresholds
private

Definition at line 57 of file NominalEfficiencyThresholds.h.