Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:18

0001 #ifndef DQMOFFLINE_TRIGGER_EGHLTPHOHLTFILTERMON
0002 #define DQMOFFLINE_TRIGGER_EGHLTPHOHLTFILTERMON
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 
0020 #include "DQMOffline/Trigger/interface/EgHLTMonElemContainer.h"
0021 #include "DQMOffline/Trigger/interface/EgHLTMonElemManager.h"
0022 #include "DQMOffline/Trigger/interface/EgHLTMonElemWithCut.h"
0023 #include "DQMOffline/Trigger/interface/EgHLTMonElemFuncs.h"
0024 #include "DQMOffline/Trigger/interface/EgHLTOffEvt.h"
0025 #include "DQMOffline/Trigger/interface/EgHLTParticlePair.h"
0026 #include "DQMOffline/Trigger/interface/EgHLTOffPho.h"
0027 #include "DQMOffline/Trigger/interface/EgHLTTrigCodes.h"
0028 
0029 #include <string>
0030 
0031 namespace trigger {
0032   class TriggerObject;
0033 }
0034 
0035 namespace egHLT {
0036   struct BinData;
0037   struct CutMasks;
0038 
0039   class PhoHLTFilterMon {
0040   public:
0041     //comparision functor for PhoHLTFilterMon
0042     //short for: pointer compared with string
0043     bool ptrCompStr(const PhoHLTFilterMon* lhs, const std::string& rhs) { return lhs->filterName() < rhs; }
0044     bool ptrCompStr(const std::string& lhs, const PhoHLTFilterMon* rhs) { return lhs < rhs->filterName(); }
0045     //yes I am aware that such a function undoubtably exists but it was quicker to write it than look it up
0046     template <class T>
0047     inline bool ptrLess(const T* lhs, const T* rhs) {
0048       return *lhs < *rhs;
0049     }
0050 
0051   private:
0052     std::string filterName_;
0053     const TrigCodes::TrigBitSet filterBit_;
0054     bool doHEP_;
0055     //we own the pointers in the vectors
0056     std::vector<MonElemManagerBase<trigger::TriggerObject>*> trigMonElems_;
0057     std::vector<MonElemContainer<OffPho>*> phoEffHists_;
0058     std::vector<MonElemContainer<OffPho>*> phoMonElems_;
0059     std::vector<MonElemContainer<OffPho>*> phoFailMonElems_;
0060 
0061     //we also own these pointers
0062     MonElemManagerBase<ParticlePair<OffPho> >* diPhoMassBothME_;
0063     MonElemManagerBase<ParticlePair<OffPho> >* diPhoMassOnlyOneME_;
0064     MonElemManagerBase<ParticlePair<OffPho> >* diPhoMassBothHighME_;
0065     MonElemManagerBase<ParticlePair<OffPho> >* diPhoMassOnlyOneHighME_;
0066 
0067     //disabling copying
0068     PhoHLTFilterMon(const PhoHLTFilterMon&) {}
0069     PhoHLTFilterMon& operator=(const PhoHLTFilterMon&) { return *this; }
0070 
0071   public:
0072     PhoHLTFilterMon(MonElemFuncs& monElemFuncs,
0073                     std::string filterName,
0074                     TrigCodes::TrigBitSet filterBit,
0075                     const BinData& bins,
0076                     const CutMasks& masks,
0077                     bool doHEP);
0078     ~PhoHLTFilterMon();
0079 
0080     void fill(const OffEvt& evt, float weight);
0081 
0082     //sort by filter name
0083     bool operator<(const PhoHLTFilterMon& rhs) const { return filterName_ < rhs.filterName_; }
0084     //bool operator<(const std::string& rhs)const{return filterName_<rhs;}
0085     const std::string& filterName() const { return filterName_; }
0086   };
0087 }  // namespace egHLT
0088 
0089 #endif