Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HLTrigger_Muon_Test_HLTMuonRateAnalyzer_H
0002 #define HLTrigger_Muon_Test_HLTMuonRateAnalyzer_H
0003 
0004 /** \class HLTMuonRateAnalyzer
0005  *  Get L1/HLT efficiency/rate plots
0006  *
0007  *  \author J. Alcaraz
0008  */
0009 
0010 // Base Class Headers
0011 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0012 #include "FWCore/Utilities/interface/InputTag.h"
0013 
0014 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0015 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
0016 #include "DataFormats/HLTReco/interface/TriggerRefsCollections.h"
0017 
0018 #include <vector>
0019 
0020 class TFile;
0021 class TH1F;
0022 
0023 class HLTMuonRateAnalyzer : public edm::one::EDAnalyzer<> {
0024 public:
0025   /// Constructor
0026   HLTMuonRateAnalyzer(const edm::ParameterSet& pset);
0027 
0028   /// Destructor
0029   ~HLTMuonRateAnalyzer() override;
0030 
0031   // Operations
0032 
0033   void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
0034 
0035   void beginJob() override;
0036   void endJob() override;
0037 
0038 private:
0039   // Input from cfg file
0040   edm::InputTag theGenLabel;
0041   edm::InputTag theL1CollectionLabel;
0042   std::vector<edm::InputTag> theHLTCollectionLabels;
0043   edm::EDGetTokenT<edm::HepMCProduct> theGenToken;
0044   edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> theL1CollectionToken;
0045   std::vector<edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> > theHLTCollectionTokens;
0046   double theL1ReferenceThreshold;
0047   std::vector<double> theNSigmas;
0048   unsigned int theNumberOfObjects;
0049   double theCrossSection;
0050   double theLuminosity;
0051   double thePtMin;
0052   double thePtMax;
0053   unsigned int theNbins;
0054   std::string theRootFileName;
0055 
0056   // The output Root file
0057   TFile* theFile;
0058 
0059   // Histograms
0060   TH1F* hL1eff;
0061   TH1F* hL1rate;
0062   std::vector<TH1F*> hHLTeff;
0063   std::vector<TH1F*> hHLTrate;
0064 
0065   // Counter of events (weighted in general)
0066   double theNumberOfEvents;
0067 };
0068 #endif