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.

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 }

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

Referenced by counter.Counter::register().

◆ bins()

vector< double > NominalEfficiencyThresholds::bins ( ) const

Definition at line 44 of file NominalEfficiencyThresholds.cc.

44  {
45  vector<double> result;
46  for (unsigned int i = 1; i <= EtaBounds::NumberOfTowers; i++)
47  result.push_back(etabounds(i));
48  return result;
49 }

References mps_fire::i, and mps_fire::result.

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

◆ dump()

void NominalEfficiencyThresholds::dump ( void  )

Definition at line 112 of file NominalEfficiencyThresholds.cc.

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 }

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

◆ thresholdValueForEfficiency()

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

Definition at line 124 of file NominalEfficiencyThresholds.cc.

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 }

References gather_cfg::cout, geometryDiff::epsilon, EcalCondDBWriter_cfi::location, and particleFlowZeroSuppressionECAL_cff::thresholds.

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

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.

mps_fire.i
i
Definition: mps_fire.py:428
muonisolation::NominalEfficiencyThresholds::EtaBounds::NumberOfTowers
Definition: NominalEfficiencyThresholds.h:37
gather_cfg.cout
cout
Definition: gather_cfg.py:144
geometryDiff.epsilon
int epsilon
Definition: geometryDiff.py:26
muonisolation::NominalEfficiencyThresholds::etabounds
EtaBounds etabounds
Definition: NominalEfficiencyThresholds.h:59
muonisolation::NominalEfficiencyThresholds::ThresholdConstituents
std::map< EfficiencyBin, float, EfficiencyBin > ThresholdConstituents
Definition: NominalEfficiencyThresholds.h:53
TtSemiLepEvtBuilder_cfi.mt
mt
Definition: TtSemiLepEvtBuilder_cfi.py:47
muonisolation::NominalEfficiencyThresholds::thresholds
MapType thresholds
Definition: NominalEfficiencyThresholds.h:57
EcalCondDBWriter_cfi.location
location
Definition: EcalCondDBWriter_cfi.py:63
mps_fire.result
result
Definition: mps_fire.py:311
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430