CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
muonisolation::Cuts Class Reference

#include <Cuts.h>

Classes

struct  CutSpec
 

Public Member Functions

 Cuts ()
 dummy constructor More...
 
 Cuts (const edm::ParameterSet &pset)
 ctor by PSet More...
 
 Cuts (const std::vector< double > &etaBounds, const std::vector< double > &coneSizes, const std::vector< double > &thresholds)
 constructor from valid parameters More...
 
const CutSpecoperator() (double eta) const
 
const CutSpecoperator[] (unsigned int i) const
 
std::string print () const
 
unsigned int size ()
 

Private Member Functions

void init (const std::vector< double > &etaBounds, const std::vector< double > &coneSizes, const std::vector< double > &thresholds)
 

Private Attributes

std::vector< CutSpectheCuts
 

Detailed Description

Definition at line 14 of file Cuts.h.

Constructor & Destructor Documentation

◆ Cuts() [1/3]

muonisolation::Cuts::Cuts ( )
inline

dummy constructor

Definition at line 23 of file Cuts.h.

23 {}

◆ Cuts() [2/3]

Cuts::Cuts ( const edm::ParameterSet pset)

ctor by PSet

Definition at line 10 of file Cuts.cc.

10  {
11  vector<double> etaBounds = pset.getParameter<std::vector<double> >("EtaBounds");
12  vector<double> coneSizes = pset.getParameter<std::vector<double> >("ConeSizes");
13  vector<double> thresholds = pset.getParameter<std::vector<double> >("Thresholds");
14  init(etaBounds, coneSizes, thresholds);
15 }

References init, muonDTDigis_cfi::pset, and particleFlowZeroSuppressionECAL_cff::thresholds.

◆ Cuts() [3/3]

Cuts::Cuts ( const std::vector< double > &  etaBounds,
const std::vector< double > &  coneSizes,
const std::vector< double > &  thresholds 
)

constructor from valid parameters

Definition at line 17 of file Cuts.cc.

17  {
18  init(etaBounds, coneSizes, thresholds);
19 }

References init, and particleFlowZeroSuppressionECAL_cff::thresholds.

Member Function Documentation

◆ init()

void Cuts::init ( const std::vector< double > &  etaBounds,
const std::vector< double > &  coneSizes,
const std::vector< double > &  thresholds 
)
private

Definition at line 21 of file Cuts.cc.

21  {
22  double minEta = 0.;
23  double coneSize = 0;
24  double threshold = 0;
25  unsigned int nEta = etaBounds.size();
26  for (unsigned int i = 0; i < nEta; i++) {
27  if (i > 0)
28  minEta = etaBounds[i - 1];
29  double maxEta = etaBounds[i];
30  if (i < coneSizes.size())
31  coneSize = coneSizes[i];
32  if (i < thresholds.size())
34 
36 
37  theCuts.push_back(cut);
38  }
39 }

References HLT_FULL_cff::coneSize, TkAlMuonSelectors_cfi::cut, mps_fire::i, maxEta, EgHLTOffEleSelection_cfi::minEta, HLT_FULL_cff::nEta, remoteMonitoring_LED_IterMethod_cfg::threshold, and particleFlowZeroSuppressionECAL_cff::thresholds.

◆ operator()()

const Cuts::CutSpec & Cuts::operator() ( double  eta) const

Definition at line 41 of file Cuts.cc.

41  {
42  double absEta = fabs(eta);
43  unsigned int nCuts = theCuts.size();
44  unsigned int idx_eta = nCuts - 1;
45  for (unsigned int i = 0; i < nCuts; i++) {
46  if (absEta < theCuts[i].etaRange.max()) {
47  idx_eta = i;
48  break;
49  }
50  }
51  return theCuts[idx_eta];
52 }

References PVValHelper::eta, generateTowerEtThresholdLUT::etaRange, and mps_fire::i.

◆ operator[]()

const CutSpec& muonisolation::Cuts::operator[] ( unsigned int  i) const
inline

Definition at line 35 of file Cuts.h.

35 { return theCuts[i]; };

References mps_fire::i, and theCuts.

◆ print()

std::string Cuts::print ( void  ) const

Definition at line 54 of file Cuts.cc.

54  {
55  std::ostringstream result;
56  typedef std::vector<CutSpec>::const_iterator IT;
57  result << "Cuts : " << std::endl;
58  for (IT it = theCuts.begin(), itEnd = theCuts.end(); it < itEnd; ++it) {
59  result << "eta: " << (*it).etaRange << ", cone: " << (*it).conesize << ", cut: " << (*it).threshold << std::endl;
60  }
61  return result.str();
62 }

References mps_fire::result.

Referenced by L3MuonCombinedRelativeIsolationProducer::L3MuonCombinedRelativeIsolationProducer(), and L3MuonIsolationProducer::L3MuonIsolationProducer().

◆ size()

unsigned int muonisolation::Cuts::size ( void  )
inline

Definition at line 37 of file Cuts.h.

37 { return theCuts.size(); };

References theCuts.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

Member Data Documentation

◆ theCuts

std::vector<CutSpec> muonisolation::Cuts::theCuts
private

Definition at line 46 of file Cuts.h.

Referenced by operator[](), and size().

mps_fire.i
i
Definition: mps_fire.py:428
particleFlowZeroSuppressionECAL_cff.thresholds
thresholds
Definition: particleFlowZeroSuppressionECAL_cff.py:31
generateTowerEtThresholdLUT.etaRange
etaRange
Definition: generateTowerEtThresholdLUT.py:55
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
HLT_FULL_cff.nEta
nEta
Definition: HLT_FULL_cff.py:6596
PVValHelper::eta
Definition: PVValidationHelpers.h:69
maxEta
double maxEta
Definition: PFJetBenchmarkAnalyzer.cc:76
HLT_FULL_cff.coneSize
coneSize
Definition: HLT_FULL_cff.py:50911
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
muonisolation::Cuts::theCuts
std::vector< CutSpec > theCuts
Definition: Cuts.h:46
mps_fire.result
result
Definition: mps_fire.py:311
muonisolation::Cuts::init
void init(const std::vector< double > &etaBounds, const std::vector< double > &coneSizes, const std::vector< double > &thresholds)
Definition: Cuts.cc:21
muonisolation::Range< double >
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
EgHLTOffEleSelection_cfi.minEta
minEta
Definition: EgHLTOffEleSelection_cfi.py:11
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27