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

◆ MapType

Definition at line 54 of file NominalEfficiencyThresholds.h.

◆ ThresholdConstituent

Definition at line 52 of file NominalEfficiencyThresholds.h.

◆ ThresholdConstituents

Definition at line 53 of file NominalEfficiencyThresholds.h.

Constructor & Destructor Documentation

◆ NominalEfficiencyThresholds() [1/2]

muonisolation::NominalEfficiencyThresholds::NominalEfficiencyThresholds ( )
inline

Definition at line 12 of file NominalEfficiencyThresholds.h.

12 {}

◆ NominalEfficiencyThresholds() [2/2]

muonisolation::NominalEfficiencyThresholds::NominalEfficiencyThresholds ( const std::string &  infile)

◆ ~NominalEfficiencyThresholds()

muonisolation::NominalEfficiencyThresholds::~NominalEfficiencyThresholds ( )
inline

Definition at line 14 of file NominalEfficiencyThresholds.h.

14 {}

Member Function Documentation

◆ add()

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

Definition at line 98 of file NominalEfficiencyThresholds.cc.

References EcalCondDBWriter_cfi::location, TtSemiLepEvtBuilder_cfi::mt, DiMuonV_cfg::threshold, and particleFlowZeroSuppressionECAL_cff::thresholds.

Referenced by counter.Counter::register().

98  {
99  MapType::iterator ploc = thresholds.find(location);
100  if (ploc == thresholds.end()) {
102  mt.insert(threshold);
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

◆ bins()

vector< double > NominalEfficiencyThresholds::bins ( ) const

◆ dump()

void NominalEfficiencyThresholds::dump ( void  )

Definition at line 112 of file NominalEfficiencyThresholds.cc.

References gather_cfg::cout, and particleFlowZeroSuppressionECAL_cff::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 }

◆ thresholdValueForEfficiency()

float NominalEfficiencyThresholds::thresholdValueForEfficiency ( ThresholdLocation  location,
float  eff_thr 
) const

Definition at line 124 of file NominalEfficiencyThresholds.cc.

References gather_cfg::cout, geometryDiff::epsilon, EcalCondDBWriter_cfi::location, and particleFlowZeroSuppressionECAL_cff::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 }

Member Data Documentation

◆ etabounds

EtaBounds muonisolation::NominalEfficiencyThresholds::etabounds
private

Definition at line 59 of file NominalEfficiencyThresholds.h.

◆ thresholds

MapType muonisolation::NominalEfficiencyThresholds::thresholds
private

Definition at line 57 of file NominalEfficiencyThresholds.h.