CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
egHLT::PhoHLTFilterMon Class Reference

#include <EgHLTPhoHLTFilterMon.h>

Public Member Functions

void fill (const OffEvt &evt, float weight)
 
const std::string & filterName () const
 
bool operator< (const PhoHLTFilterMon &rhs) const
 
 PhoHLTFilterMon (MonElemFuncs &monElemFuncs, std::string filterName, TrigCodes::TrigBitSet filterBit, const BinData &bins, const CutMasks &masks, bool doHEP)
 
bool ptrCompStr (const PhoHLTFilterMon *lhs, const std::string &rhs)
 
bool ptrCompStr (const std::string &lhs, const PhoHLTFilterMon *rhs)
 
template<class T >
bool ptrLess (const T *lhs, const T *rhs)
 
 ~PhoHLTFilterMon ()
 

Private Member Functions

PhoHLTFilterMonoperator= (const PhoHLTFilterMon &)
 
 PhoHLTFilterMon (const PhoHLTFilterMon &)
 

Private Attributes

MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassBothHighME_
 
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassBothME_
 
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassOnlyOneHighME_
 
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassOnlyOneME_
 
bool doHEP_
 
const TrigCodes::TrigBitSet filterBit_
 
std::string filterName_
 
std::vector< MonElemContainer< OffPho > * > phoEffHists_
 
std::vector< MonElemContainer< OffPho > * > phoFailMonElems_
 
std::vector< MonElemContainer< OffPho > * > phoMonElems_
 
std::vector< MonElemManagerBase< trigger::TriggerObject > * > trigMonElems_
 

Detailed Description

Definition at line 40 of file EgHLTPhoHLTFilterMon.h.

Constructor & Destructor Documentation

egHLT::PhoHLTFilterMon::PhoHLTFilterMon ( const PhoHLTFilterMon )
inlineprivate

Definition at line 70 of file EgHLTPhoHLTFilterMon.h.

70 {}
PhoHLTFilterMon::PhoHLTFilterMon ( MonElemFuncs monElemFuncs,
std::string  filterName,
TrigCodes::TrigBitSet  filterBit,
const BinData bins,
const CutMasks masks,
bool  doHEP 
)

Definition at line 16 of file EgHLTPhoHLTFilterMon.cc.

References create_public_pileup_plots::bins, diPhoMassBothHighME_, diPhoMassBothME_, diPhoMassOnlyOneHighME_, diPhoMassOnlyOneME_, doHEP_, egHLT::BinData::et, egHLT::OffPho::et(), egHLT::BinData::eta, egHLT::OffPho::eta(), filterName_, egHLT::MonElemFuncs::getIB(), mps_fire::i, egHLT::MonElemFuncs::initStdEffHists(), egHLT::MonElemFuncs::initStdPhoHists(), egHLT::MonElemFuncs::initStdPhoHistsHEP(), egHLT::BinData::mass, egHLT::BinData::massHigh, egHLT::BinData::Data1D::max, egHLT::BinData::Data1D::min, dataset::name, egHLT::BinData::Data1D::nr, phoEffHists_, phoFailMonElems_, phoMonElems_, and AlCaHLTBitMon_QueryRunRegistry::string.

16  :
18  filterBit_(filterBit),
19  doHEP_(doHEP)
20 {
21  bool monHLTFailedPho=false;
22  bool doN1andSingleEffsPho=false;
23  std::string histname="egamma";
24 
25  phoMonElems_.push_back(new MonElemContainer<OffPho>());
26  //phoMonElems_.push_back(new MonElemContainer<OffPho>("_cut"," cut, debug hists ",new EgHLTDQMVarCut<OffPho>(~0x0,&OffPho::cutCode)));
27  for(auto & phoMonElem : phoMonElems_){
28  if(doHEP_){
29  monElemFuncs.initStdPhoHistsHEP(phoMonElem->monElems(),filterName_,histname+"_passFilter"+phoMonElem->name(),bins);
30  }else{
31  monElemFuncs.initStdPhoHists(phoMonElem->monElems(),filterName_,filterName_+"_pho_passFilter"+phoMonElem->name(),bins);
32  }
33  }
34 
35  if(monHLTFailedPho) phoFailMonElems_.push_back(new MonElemContainer<OffPho>());
36 
37  for(size_t i=0;i<phoFailMonElems_.size();i++){
38  if(doHEP_){
39  monElemFuncs.initStdPhoHistsHEP(phoFailMonElems_[i]->monElems(),filterName_,histname+"_failFilter"+phoMonElems_[i]->name(),bins);
40  }else{
41  monElemFuncs.initStdPhoHists(phoFailMonElems_[i]->monElems(),filterName_,filterName_+"_pho_failFilter"+phoMonElems_[i]->name(),bins);
42  }
43  }
44  phoEffHists_.push_back(new MonElemContainer<OffPho>());
45  // phoEffHists_.push_back(new MonElemContainer<OffPho>("_jetTag"," Tag and Probe ",new EgJetB2BCut<OffPho>(-M_PI/12,M_PI/12,0.3)));
46  if(doN1andSingleEffsPho){
47  for(auto & phoEffHist : phoEffHists_){
48  monElemFuncs.initStdEffHists(phoEffHist->cutMonElems(),filterName_,
49  filterName_+"_pho_effVsEt"+phoEffHist->name(),bins.et,&OffPho::et,masks);
50  monElemFuncs.initStdEffHists(phoEffHist->cutMonElems(),filterName_,
51  filterName_+"_pho_effVsEta"+phoEffHist->name(),bins.eta,&OffPho::eta,masks);
52  /* monElemFuncs.initStdEffHists(phoEffHists_[i]->cutMonElems(),filterName_,
53  filterName_+"_pho_effVsPhi"+phoEffHists_[i]->name(),bins.phi,&OffPho::phi,masks);*/
54  }
55  }
56  if(!doHEP_)
57  {
58  typedef MonElemManager<ParticlePair<OffPho>,float > DiPhoMon;
59  diPhoMassBothME_ = new DiPhoMon(monElemFuncs.getIB(), filterName_+"_diPho_bothPassFilter_mass",
60  filterName_+"_diPho_bothPassFilter Mass;M_{#gamma#gamma} (GeV/c^{2})",
62  diPhoMassOnlyOneME_ = new DiPhoMon(monElemFuncs.getIB(), filterName_+"_diPho_onlyOnePassFilter_mass",
63  filterName_+"_diPho_onlyOnePassFilter Mass;M_{#gamma#gamma} (GeV/c^{2})",
65  diPhoMassBothHighME_ = new DiPhoMon(monElemFuncs.getIB(), filterName_+"_diPho_bothPassFilter_massHigh",
66  filterName_+"_diPho_bothPassFilter Mass;M_{#gamma#gamma} (GeV/c^{2})",
68  diPhoMassOnlyOneHighME_ = new DiPhoMon(monElemFuncs.getIB(), filterName_+"_diPho_onlyOnePassFilter_massHigh",
69  filterName_+"_diPho_onlyOnePassFilter Mass;M_{#gamma#gamma} (GeV/c^{2})",
71 
72  }
73 }
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassOnlyOneME_
void initStdPhoHists(std::vector< MonElemManagerBase< OffPho > * > &histVec, const std::string &filterName, const std::string &baseName, const BinData &bins)
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassBothHighME_
float et() const
Definition: EgHLTOffPho.h:101
std::vector< MonElemContainer< OffPho > * > phoEffHists_
std::vector< MonElemContainer< OffPho > * > phoMonElems_
float eta() const
Definition: EgHLTOffPho.h:104
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassOnlyOneHighME_
std::vector< MonElemContainer< OffPho > * > phoFailMonElems_
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassBothME_
const std::string & filterName() const
void initStdPhoHistsHEP(std::vector< MonElemManagerBase< OffPho > * > &histVec, const std::string &filterName, const std::string &baseName, const BinData &bins)
DQMStore::IBooker & getIB()
const TrigCodes::TrigBitSet filterBit_
def move(src, dest)
Definition: eostools.py:511
void initStdEffHists(std::vector< MonElemWithCutBase< OffEle > * > &histVec, const std::string &filterName, const std::string &baseName, int nrBins, double xMin, double xMax, float(OffEle::*vsVarFunc)() const, const CutMasks &masks)
PhoHLTFilterMon::~PhoHLTFilterMon ( )

Definition at line 75 of file EgHLTPhoHLTFilterMon.cc.

References diPhoMassBothHighME_, diPhoMassBothME_, diPhoMassOnlyOneHighME_, diPhoMassOnlyOneME_, doHEP_, phoEffHists_, phoFailMonElems_, and phoMonElems_.

76 {
77  for(auto & phoMonElem : phoMonElems_) delete phoMonElem;
78  for(auto & phoFailMonElem : phoFailMonElems_) delete phoFailMonElem;
79  for(auto & phoEffHist : phoEffHists_) delete phoEffHist;
80  if(!doHEP_)
81  {
82  delete diPhoMassBothME_;
83  delete diPhoMassOnlyOneME_;
84  delete diPhoMassBothHighME_;
86  }
87 }
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassOnlyOneME_
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassBothHighME_
std::vector< MonElemContainer< OffPho > * > phoEffHists_
std::vector< MonElemContainer< OffPho > * > phoMonElems_
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassOnlyOneHighME_
std::vector< MonElemContainer< OffPho > * > phoFailMonElems_
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassBothME_

Member Function Documentation

void PhoHLTFilterMon::fill ( const OffEvt evt,
float  weight 
)

Definition at line 89 of file EgHLTPhoHLTFilterMon.cc.

References diPhoMassBothME_, diPhoMassOnlyOneME_, doHEP_, egHLT::OffEvt::evtTrigBits(), filterBit_, phoEffHists_, phoFailMonElems_, phoMonElems_, egHLT::OffEvt::phos(), and egHLT::OffPho::trigBits().

90 {
91  for(size_t phoNr=0;phoNr<evt.phos().size();phoNr++){
92  const OffPho& pho = evt.phos()[phoNr];
93  if((pho.trigBits()&filterBit_)!=0){ //pho passes
94  for(auto & phoMonElem : phoMonElems_) phoMonElem->fill(pho,evt,weight);
95  for(auto & phoEffHist : phoEffHists_) phoEffHist->fill(pho,evt,weight);
96  }else { //pho didnt pass trigger
97  for(auto & phoFailMonElem : phoFailMonElems_) phoFailMonElem->fill(pho,evt,weight);
98  }
99  }//end loop over photons
100 
101 
102 
103  if((evt.evtTrigBits()&filterBit_)!=0){
104  for(size_t pho1Nr=0;pho1Nr<evt.phos().size();pho1Nr++){
105  for(size_t pho2Nr=pho1Nr+1;pho2Nr<evt.phos().size();pho2Nr++){
106  const OffPho& pho1 = evt.phos()[pho1Nr];
107  const OffPho& pho2 = evt.phos()[pho2Nr];
108  if(!doHEP_)
109  {
110  if((pho1.trigBits()&pho2.trigBits()&filterBit_)==filterBit_) diPhoMassBothME_->fill(ParticlePair<OffPho>(pho1,pho2),weight);
111  else if((pho1.trigBits()&filterBit_)==filterBit_ ||
112  (pho2.trigBits()&filterBit_)==filterBit_){
114  }
115  }
116  }//end inner pho loop
117  }//end outer pho loop
118  }//end check if filter is present
119 }
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassOnlyOneME_
std::vector< MonElemContainer< OffPho > * > phoEffHists_
Definition: weight.py:1
std::vector< MonElemContainer< OffPho > * > phoMonElems_
TrigCodes::TrigBitSet trigBits() const
Definition: EgHLTOffPho.h:155
std::vector< MonElemContainer< OffPho > * > phoFailMonElems_
TrigCodes::TrigBitSet evtTrigBits() const
Definition: EgHLTOffEvt.h:52
const std::vector< OffPho > & phos() const
Definition: EgHLTOffEvt.h:50
MonElemManagerBase< ParticlePair< OffPho > > * diPhoMassBothME_
const TrigCodes::TrigBitSet filterBit_
const std::string& egHLT::PhoHLTFilterMon::filterName ( ) const
inline

Definition at line 82 of file EgHLTPhoHLTFilterMon.h.

Referenced by ptrCompStr().

82 {return filterName_;}
bool egHLT::PhoHLTFilterMon::operator< ( const PhoHLTFilterMon rhs) const
inline

Definition at line 80 of file EgHLTPhoHLTFilterMon.h.

References filterName_.

80 {return filterName_<rhs.filterName_;}
PhoHLTFilterMon& egHLT::PhoHLTFilterMon::operator= ( const PhoHLTFilterMon )
inlineprivate
bool egHLT::PhoHLTFilterMon::ptrCompStr ( const PhoHLTFilterMon lhs,
const std::string &  rhs 
)
inline

Definition at line 47 of file EgHLTPhoHLTFilterMon.h.

References filterName().

47 {return lhs->filterName()<rhs;}
bool egHLT::PhoHLTFilterMon::ptrCompStr ( const std::string &  lhs,
const PhoHLTFilterMon rhs 
)
inline

Definition at line 48 of file EgHLTPhoHLTFilterMon.h.

References filterName().

48 {return lhs<rhs->filterName();}
template<class T >
bool egHLT::PhoHLTFilterMon::ptrLess ( const T lhs,
const T rhs 
)
inline

Definition at line 51 of file EgHLTPhoHLTFilterMon.h.

51 {return *lhs<*rhs;}

Member Data Documentation

MonElemManagerBase<ParticlePair<OffPho> >* egHLT::PhoHLTFilterMon::diPhoMassBothHighME_
private

Definition at line 66 of file EgHLTPhoHLTFilterMon.h.

Referenced by PhoHLTFilterMon(), and ~PhoHLTFilterMon().

MonElemManagerBase<ParticlePair<OffPho> >* egHLT::PhoHLTFilterMon::diPhoMassBothME_
private

Definition at line 64 of file EgHLTPhoHLTFilterMon.h.

Referenced by fill(), PhoHLTFilterMon(), and ~PhoHLTFilterMon().

MonElemManagerBase<ParticlePair<OffPho> >* egHLT::PhoHLTFilterMon::diPhoMassOnlyOneHighME_
private

Definition at line 67 of file EgHLTPhoHLTFilterMon.h.

Referenced by PhoHLTFilterMon(), and ~PhoHLTFilterMon().

MonElemManagerBase<ParticlePair<OffPho> >* egHLT::PhoHLTFilterMon::diPhoMassOnlyOneME_
private

Definition at line 65 of file EgHLTPhoHLTFilterMon.h.

Referenced by fill(), PhoHLTFilterMon(), and ~PhoHLTFilterMon().

bool egHLT::PhoHLTFilterMon::doHEP_
private

Definition at line 56 of file EgHLTPhoHLTFilterMon.h.

Referenced by fill(), PhoHLTFilterMon(), and ~PhoHLTFilterMon().

const TrigCodes::TrigBitSet egHLT::PhoHLTFilterMon::filterBit_
private

Definition at line 55 of file EgHLTPhoHLTFilterMon.h.

Referenced by fill().

std::string egHLT::PhoHLTFilterMon::filterName_
private

Definition at line 54 of file EgHLTPhoHLTFilterMon.h.

Referenced by operator<(), and PhoHLTFilterMon().

std::vector<MonElemContainer<OffPho>*> egHLT::PhoHLTFilterMon::phoEffHists_
private

Definition at line 59 of file EgHLTPhoHLTFilterMon.h.

Referenced by fill(), PhoHLTFilterMon(), and ~PhoHLTFilterMon().

std::vector<MonElemContainer<OffPho>*> egHLT::PhoHLTFilterMon::phoFailMonElems_
private

Definition at line 61 of file EgHLTPhoHLTFilterMon.h.

Referenced by fill(), PhoHLTFilterMon(), and ~PhoHLTFilterMon().

std::vector<MonElemContainer<OffPho>*> egHLT::PhoHLTFilterMon::phoMonElems_
private

Definition at line 60 of file EgHLTPhoHLTFilterMon.h.

Referenced by fill(), PhoHLTFilterMon(), and ~PhoHLTFilterMon().

std::vector<MonElemManagerBase<trigger::TriggerObject>*> egHLT::PhoHLTFilterMon::trigMonElems_
private

Definition at line 58 of file EgHLTPhoHLTFilterMon.h.