Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:49

0001 #ifndef DQMOFFLINE_TRIGGER_EGHLTELEHLTFILTERMON
0002 #define DQMOFFLINE_TRIGGER_EGHLTELEHLTFILTERMON
0003 
0004 //class: EleHLTFilterMon
0005 //
0006 //author: Sam Harper (June 2008)
0007 //
0008 //WARNING: interface is NOT final, please dont use this class for now without clearing it with me
0009 //         as I will change it and possibly break all your code
0010 //
0011 //aim: this object will manage all histograms associated with a particular HLT filter
0012 //     ie histograms for computing efficiency of each filter step, id efficiency of gsf electrons passing trigger etc
0013 //
0014 //implimentation:
0015 //
0016 //
0017 
0018 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
0019 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0020 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0021 
0022 #include "DQMOffline/Trigger/interface/EgHLTMonElemContainer.h"
0023 #include "DQMOffline/Trigger/interface/EgHLTMonElemManager.h"
0024 #include "DQMOffline/Trigger/interface/EgHLTMonElemWithCut.h"
0025 #include "DQMOffline/Trigger/interface/EgHLTMonElemFuncs.h"
0026 #include "DQMOffline/Trigger/interface/EgHLTOffEvt.h"
0027 #include "DQMOffline/Trigger/interface/EgHLTParticlePair.h"
0028 #include "DQMOffline/Trigger/interface/EgHLTOffEle.h"
0029 #include "DQMOffline/Trigger/interface/EgHLTTrigCodes.h"
0030 
0031 #include <string>
0032 
0033 namespace trigger {
0034   class TriggerObject;
0035 }
0036 
0037 namespace egHLT {
0038   struct BinData;
0039   struct CutMasks;
0040   class EleHLTFilterMon {
0041   public:
0042     //comparision functor for EleHLTFilterMon
0043     //short for: pointer compared with string
0044     static bool ptrCompStr(const EleHLTFilterMon* lhs, const std::string& rhs) { return lhs->filterName() < rhs; }
0045     static bool ptrCompStr(const std::string& lhs, const EleHLTFilterMon* rhs) { return lhs < rhs->filterName(); }
0046     //yes I am aware that such a function undoubtably exists but it was quicker to write it than look it up
0047     template <class T>
0048     static bool ptrLess(const T* lhs, const T* rhs) {
0049       return *lhs < *rhs;
0050     }
0051 
0052   private:
0053     std::string filterName_;
0054     const TrigCodes::TrigBitSet filterBit_;
0055     bool doHEP_;
0056     //we own the pointers in the vectors
0057     //std::vector<MonElemManagerBase<OffEle>*> eleMonElems_;
0058     std::vector<MonElemManagerBase<trigger::TriggerObject>*> trigMonElems_;
0059     //  std::vector<MonElemManagerBase<OffEle>*> eleFailMonElems_;
0060     //  std::vector<MonElemWithCutBase<OffEle>*> eleEffHists_;
0061     std::vector<MonElemContainer<OffEle>*> eleEffHists_;
0062     std::vector<MonElemContainer<OffEle>*> eleMonElems_;
0063     std::vector<MonElemContainer<OffEle>*> eleFailMonElems_;
0064 
0065     //we also own these pointers
0066     MonElemManagerBase<ParticlePair<OffEle> >* diEleMassBothME_;
0067     MonElemManagerBase<ParticlePair<OffEle> >* diEleMassOnlyOneME_;
0068     MonElemManagerBase<ParticlePair<OffEle> >* diEleMassBothHighME_;
0069     MonElemManagerBase<ParticlePair<OffEle> >* diEleMassOnlyOneHighME_;
0070 
0071     //disabling copying
0072     EleHLTFilterMon(const EleHLTFilterMon&) {}
0073     EleHLTFilterMon& operator=(const EleHLTFilterMon&) { return *this; }
0074 
0075   public:
0076     EleHLTFilterMon(MonElemFuncs& monElemFuncs,
0077                     const std::string& filterName,
0078                     TrigCodes::TrigBitSet filterBit,
0079                     const BinData& bins,
0080                     const CutMasks& masks,
0081                     bool doHEP);
0082     ~EleHLTFilterMon();
0083 
0084     void fill(const OffEvt& evt, float weight);
0085 
0086     //sort by filter name
0087     bool operator<(const EleHLTFilterMon& rhs) const { return filterName_ < rhs.filterName_; }
0088     //bool operator<(const std::string& rhs)const{return filterName_<rhs;}
0089     const std::string& filterName() const { return filterName_; }
0090   };
0091 }  // namespace egHLT
0092 
0093 #endif