Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:18:54

0001 #ifndef HLTriggerOffline_Higgs_HLTHiggsPlotter_H
0002 #define HLTriggerOffline_Higgs_HLTHiggsPlotter_H
0003 
0004 /** \class HLTHiggsPlotter
0005 *  Generate histograms for trigger efficiencies Higgs related
0006 *  Documentation available on the CMS TWiki:
0007 *  https://twiki.cern.ch/twiki/bin/view/CMS/HiggsWGHLTValidate
0008 *
0009 *  \author  J. Duarte Campderros (based and adapted on J. Klukas,
0010 *           M. Vander Donckt and J. Alcaraz code from the 
0011 *           HLTriggerOffline/Muon package)
0012 *  \author  J. Klukas, M. Vander Donckt, J. Alcaraz
0013 */
0014 
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 #include "FWCore/Framework/interface/Event.h"
0017 
0018 #include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
0019 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
0020 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
0021 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h"
0022 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h"
0023 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0024 #include "DataFormats/Candidate/interface/Candidate.h"
0025 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
0026 #include "DataFormats/JetReco/interface/GenJet.h"
0027 #include "DataFormats/MuonReco/interface/Muon.h"
0028 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0029 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0030 #include "DataFormats/JetReco/interface/PFJet.h"
0031 
0032 #include "DQMServices/Core/interface/DQMStore.h"
0033 
0034 #include "MatchStruct.h"
0035 
0036 #include <vector>
0037 #include <cstring>
0038 #include <map>
0039 #include <set>
0040 
0041 struct EVTColContainer;
0042 
0043 class HLTHiggsPlotter {
0044 public:
0045   typedef dqm::legacy::DQMStore DQMStore;
0046   typedef dqm::legacy::MonitorElement MonitorElement;
0047 
0048   HLTHiggsPlotter(const edm::ParameterSet &pset,
0049                   const std::string &hltPath,
0050                   //const std::string & lastFilter,
0051                   const std::vector<unsigned int> &objectsType,
0052                   const unsigned int &minCandidates,
0053                   const std::vector<double> &NminOneCuts);
0054   ~HLTHiggsPlotter();
0055   void beginJob();
0056   void beginRun(const edm::Run &, const edm::EventSetup &);
0057   void bookHistograms(DQMStore::IBooker &, const bool &);
0058   void analyze(const bool &isPassTrigger,
0059                const std::string &source,
0060                const std::vector<MatchStruct> &matches,
0061                const unsigned int &minCandidates);
0062   void analyze(const bool &isPassTrigger,
0063                const std::string &source,
0064                const std::vector<MatchStruct> &matches,
0065                std::map<std::string, bool> &nMinOne,
0066                const float &dEtaqq,
0067                const float &mqq,
0068                const float &dPhibb,
0069                const float &CSV1,
0070                const float &CSV2,
0071                const float &CSV3,
0072                const bool &passAllCuts);
0073 
0074   inline const std::string gethltpath() const { return _hltPath; }
0075 
0076 private:
0077   void bookHist(const std::string &source, const std::string &objType, const std::string &variable, DQMStore::IBooker &);
0078   void fillHist(const bool &passTrigger,
0079                 const std::string &source,
0080                 const std::string &objType,
0081                 const std::string &var,
0082                 const float &value);
0083 
0084   std::string _hltPath;
0085   //std::string _lastFilter;
0086   std::string _hltProcessName;
0087 
0088   std::set<unsigned int> _objectsType;
0089   // Number of objects (elec,muons, ...) needed in the hlt path
0090   unsigned int _nObjects;
0091 
0092   std::vector<double> _parametersEta;
0093   std::vector<double> _parametersPhi;
0094   std::vector<double> _parametersTurnOn;
0095 
0096   std::map<unsigned int, double> _cutMinPt;
0097   std::map<unsigned int, double> _cutMaxEta;
0098   std::map<unsigned int, unsigned int> _cutMotherId;
0099   std::map<unsigned int, std::vector<double> > _cutsDr;
0100 
0101   // The amount of Pt plots needed for the hlt path
0102   unsigned int _NptPlots;
0103 
0104   //N-1 cut values
0105   std::vector<double> _NminOneCuts;
0106 
0107   std::map<std::string, MonitorElement *> _elements;
0108 };
0109 #endif