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 12 of file Cuts.h.

Constructor & Destructor Documentation

muonisolation::Cuts::Cuts ( )
inline

dummy constructor

Definition at line 18 of file Cuts.h.

References PVValHelper::eta, muonDTDigis_cfi::pset, and particleFlowZeroSuppressionECAL_cff::thresholds.

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

ctor by PSet

Definition at line 10 of file Cuts.cc.

References edm::ParameterSet::getParameter(), init, and particleFlowZeroSuppressionECAL_cff::thresholds.

11 {
12  vector<double> etaBounds = pset.getParameter<std::vector<double> >("EtaBounds");
13  vector<double> coneSizes = pset.getParameter<std::vector<double> >("ConeSizes");
14  vector<double> thresholds = pset.getParameter<std::vector<double> >("Thresholds");
15  init(etaBounds,coneSizes,thresholds);
16 }
T getParameter(std::string const &) const
void init(const std::vector< double > &etaBounds, const std::vector< double > &coneSizes, const std::vector< double > &thresholds)
Definition: Cuts.cc:25
Cuts::Cuts ( const std::vector< double > &  etaBounds,
const std::vector< double > &  coneSizes,
const std::vector< double > &  thresholds 
)

constructor from valid parameters

Definition at line 18 of file Cuts.cc.

References init.

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

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 25 of file Cuts.cc.

References highPtTrackIsolations_cff::coneSize, TkAlMuonSelectors_cfi::cut, mps_fire::i, maxEta, trackingPOGFilters_cfi::minEta, DetIdAssociatorESProducer_cff::nEta, and electronIdCutBased_cfi::threshold.

27 {
28  double minEta = 0.;
29  double coneSize = 0;
30  double threshold = 0;
31  unsigned int nEta = etaBounds.size();
32  for (unsigned int i=0; i< nEta; i++) {
33  if (i>0) minEta = etaBounds[i-1];
34  double maxEta = etaBounds[i];
35  if (i < coneSizes.size()) coneSize = coneSizes[i];
36  if (i < thresholds.size()) threshold = thresholds[i];
37 
38  CutSpec cut = {muonisolation::Range<double>(minEta,maxEta), coneSize, threshold };
39 
40  theCuts.push_back( cut );
41  }
42 }
double maxEta
std::vector< CutSpec > theCuts
Definition: Cuts.h:42
const Cuts::CutSpec & Cuts::operator() ( double  eta) const

Definition at line 44 of file Cuts.cc.

References MuonErrorMatrixValues_cff::etaRange, and mps_fire::i.

45 {
46  double absEta = fabs(eta);
47  unsigned int nCuts = theCuts.size();
48  unsigned int idx_eta = nCuts-1;
49  for (unsigned int i = 0; i < nCuts; i++) {
50  if (absEta < theCuts[i].etaRange.max() ) { idx_eta = i; break; }
51  }
52  return theCuts[idx_eta];
53 }
std::vector< CutSpec > theCuts
Definition: Cuts.h:42
const CutSpec& muonisolation::Cuts::operator[] ( unsigned int  i) const
inline

Definition at line 30 of file Cuts.h.

References mps_fire::i.

30 {return theCuts[i];};
std::vector< CutSpec > theCuts
Definition: Cuts.h:42
std::string Cuts::print ( void  ) const

Definition at line 55 of file Cuts.cc.

References mps_fire::result.

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

56 {
57  std::ostringstream result;
58  typedef std::vector<CutSpec>::const_iterator IT;
59  result << "Cuts : " << std::endl;
60  for (IT it = theCuts.begin(), itEnd = theCuts.end(); it < itEnd; ++it) {
61  result << "eta: "<<(*it).etaRange
62  <<", cone: "<< (*it).conesize
63  <<", cut: "<<(*it).threshold
64  <<std::endl;
65  }
66  return result.str();
67 }
std::vector< LinkConnSpec >::const_iterator IT
std::vector< CutSpec > theCuts
Definition: Cuts.h:42
unsigned int muonisolation::Cuts::size ( void  )
inline

Definition at line 32 of file Cuts.h.

References init, edm::print(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

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

Member Data Documentation

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

Definition at line 42 of file Cuts.h.