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.

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

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 }
void init(const std::vector< double > &etaBounds, const std::vector< double > &coneSizes, const std::vector< double > &thresholds)
Definition: Cuts.cc:21

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

References init, and particleFlowZeroSuppressionECAL_cff::thresholds.

17  {
18  init(etaBounds, coneSizes, thresholds);
19 }
void init(const std::vector< double > &etaBounds, const std::vector< double > &coneSizes, const std::vector< double > &thresholds)
Definition: Cuts.cc:21

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.

References HLT_2022v14_cff::coneSize, PA_MinBiasSkim_cff::cut, mps_fire::i, razorScouting_cff::maxEta, EgHLTOffEleSelection_cfi::minEta, HLT_2022v14_cff::nEta, remoteMonitoring_LASER_era2018_cfg::threshold, and particleFlowZeroSuppressionECAL_cff::thresholds.

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 }
std::vector< CutSpec > theCuts
Definition: Cuts.h:46

◆ operator()()

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

Definition at line 41 of file Cuts.cc.

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

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 }
std::vector< CutSpec > theCuts
Definition: Cuts.h:46

◆ operator[]()

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

Definition at line 35 of file Cuts.h.

References mps_fire::i, and theCuts.

35 { return theCuts[i]; };
std::vector< CutSpec > theCuts
Definition: Cuts.h:46

◆ print()

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

Definition at line 54 of file Cuts.cc.

References mps_fire::result.

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

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 }
std::vector< LinkConnSpec >::const_iterator IT
std::vector< CutSpec > theCuts
Definition: Cuts.h:46

◆ size()

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

Definition at line 37 of file Cuts.h.

References theCuts.

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

37 { return theCuts.size(); };
std::vector< CutSpec > theCuts
Definition: Cuts.h:46

Member Data Documentation

◆ theCuts

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

Definition at line 46 of file Cuts.h.

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