PhoHLTFilterMon

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
#ifndef DQMOFFLINE_TRIGGER_EGHLTPHOHLTFILTERMON
#define DQMOFFLINE_TRIGGER_EGHLTPHOHLTFILTERMON

//class: EleHLTFilterMon
//
//author: Sam Harper (June 2008)
//
//WARNING: interface is NOT final, please dont use this class for now without clearing it with me
//         as I will change it and possibly break all your code
//
//aim: this object will manage all histograms associated with a particular HLT filter
//     ie histograms for computing efficiency of each filter step, id efficiency of gsf electrons passing trigger etc
//
//implimentation:
//
//

#include "DataFormats/HLTReco/interface/TriggerEvent.h"

#include "DQMOffline/Trigger/interface/EgHLTMonElemContainer.h"
#include "DQMOffline/Trigger/interface/EgHLTMonElemManager.h"
#include "DQMOffline/Trigger/interface/EgHLTMonElemWithCut.h"
#include "DQMOffline/Trigger/interface/EgHLTMonElemFuncs.h"
#include "DQMOffline/Trigger/interface/EgHLTOffEvt.h"
#include "DQMOffline/Trigger/interface/EgHLTParticlePair.h"
#include "DQMOffline/Trigger/interface/EgHLTOffPho.h"
#include "DQMOffline/Trigger/interface/EgHLTTrigCodes.h"

#include <string>

namespace trigger {
  class TriggerObject;
}

namespace egHLT {
  struct BinData;
  struct CutMasks;

  class PhoHLTFilterMon {
  public:
    //comparision functor for PhoHLTFilterMon
    //short for: pointer compared with string
    bool ptrCompStr(const PhoHLTFilterMon* lhs, const std::string& rhs) { return lhs->filterName() < rhs; }
    bool ptrCompStr(const std::string& lhs, const PhoHLTFilterMon* rhs) { return lhs < rhs->filterName(); }
    //yes I am aware that such a function undoubtably exists but it was quicker to write it than look it up
    template <class T>
    inline bool ptrLess(const T* lhs, const T* rhs) {
      return *lhs < *rhs;
    }

  private:
    std::string filterName_;
    const TrigCodes::TrigBitSet filterBit_;
    bool doHEP_;
    //we own the pointers in the vectors
    std::vector<MonElemManagerBase<trigger::TriggerObject>*> trigMonElems_;
    std::vector<MonElemContainer<OffPho>*> phoEffHists_;
    std::vector<MonElemContainer<OffPho>*> phoMonElems_;
    std::vector<MonElemContainer<OffPho>*> phoFailMonElems_;

    //we also own these pointers
    MonElemManagerBase<ParticlePair<OffPho> >* diPhoMassBothME_;
    MonElemManagerBase<ParticlePair<OffPho> >* diPhoMassOnlyOneME_;
    MonElemManagerBase<ParticlePair<OffPho> >* diPhoMassBothHighME_;
    MonElemManagerBase<ParticlePair<OffPho> >* diPhoMassOnlyOneHighME_;

    //disabling copying
    PhoHLTFilterMon(const PhoHLTFilterMon&) {}
    PhoHLTFilterMon& operator=(const PhoHLTFilterMon&) { return *this; }

  public:
    PhoHLTFilterMon(MonElemFuncs& monElemFuncs,
                    std::string filterName,
                    TrigCodes::TrigBitSet filterBit,
                    const BinData& bins,
                    const CutMasks& masks,
                    bool doHEP);
    ~PhoHLTFilterMon();

    void fill(const OffEvt& evt, float weight);

    //sort by filter name
    bool operator<(const PhoHLTFilterMon& rhs) const { return filterName_ < rhs.filterName_; }
    //bool operator<(const std::string& rhs)const{return filterName_<rhs;}
    const std::string& filterName() const { return filterName_; }
  };
}  // namespace egHLT

#endif