CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

muonisolation::Cuts::Cuts ( )
inline

dummy constructor

Definition at line 23 of file Cuts.h.

23 {}
Cuts::Cuts ( const edm::ParameterSet pset)

ctor by PSet

Definition at line 10 of file Cuts.cc.

References edm::ParameterSet::getParameter(), init, and lowPtGsfElectronSeeds_cfi::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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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.

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

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_FULL_cff::coneSize, GOODCOLL_filter_cfg::cut, mps_fire::i, maxEta, HLT_FULL_cff::nEta, and dtDQMClient_cfg::threshold.

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())
33  threshold = thresholds[i];
34 
35  CutSpec cut = {muonisolation::Range<double>(minEta, maxEta), coneSize, threshold};
36 
37  theCuts.push_back(cut);
38  }
39 }
double maxEta
std::vector< CutSpec > theCuts
Definition: Cuts.h:46
const Cuts::CutSpec & Cuts::operator() ( double  eta) const

Definition at line 41 of file Cuts.cc.

References 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
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
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 }
tuple result
Definition: mps_fire.py:311
std::vector< LinkConnSpec >::const_iterator IT
std::vector< CutSpec > theCuts
Definition: Cuts.h:46
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

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

Definition at line 46 of file Cuts.h.

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