CMS 3D CMS Logo

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, loclessMapType
 
typedef std::pair< EfficiencyBin, float > ThresholdConstituent
 
typedef std::map< EfficiencyBin, float, EfficiencyBinThresholdConstituents
 

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
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.

References TtSemiLepEvtBuilder_cfi::mt, and particleFlowZeroSuppressionECAL_cff::thresholds.

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
void NominalEfficiencyThresholds::dump ( void  )

Definition at line 116 of file NominalEfficiencyThresholds.cc.

References gather_cfg::cout, and particleFlowZeroSuppressionECAL_cff::thresholds.

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 }
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, muonisolation::NominalEfficiencyThresholds::ThresholdLocation::eta, and particleFlowZeroSuppressionECAL_cff::thresholds.

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 }

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.