Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-21 02:12:36

0001 #ifndef HLTINFO_H
0002 #define HLTINFO_H
0003 
0004 #include <memory>
0005 #include <vector>
0006 #include <map>
0007 
0008 // ROOT
0009 #include <TChain.h>
0010 #include <TFile.h>
0011 #include <TH1.h>
0012 #include <TH2.h>
0013 #include <TNamed.h>
0014 #include <TROOT.h>
0015 
0016 // CMSSW
0017 #include "CondFormats/DataRecord/interface/L1TUtmTriggerMenuRcd.h"
0018 #include "CondFormats/L1TObjects/interface/L1TUtmAlgorithm.h"
0019 #include "CondFormats/L1TObjects/interface/L1TUtmTriggerMenu.h"
0020 #include "DataFormats/Candidate/interface/Candidate.h"
0021 #include "DataFormats/Common/interface/Handle.h"
0022 #include "DataFormats/Common/interface/TriggerResults.h"
0023 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0024 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0025 #include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
0026 #include "DataFormats/L1TGlobal/interface/GlobalAlgBlk.h"
0027 #include "DataFormats/L1TGlobal/interface/GlobalExtBlk.h"
0028 #include "DataFormats/METReco/interface/CaloMETCollection.h"
0029 #include "FWCore/Common/interface/Provenance.h"
0030 #include "FWCore/Framework/interface/EventPrincipal.h"
0031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0032 #include "HLTrigger/HLTcore/interface/HLTPrescaleProvider.h"
0033 
0034 #include "JetUtil.h"
0035 
0036 namespace edm {
0037   class ConsumesCollector;
0038   class ParameterSet;
0039 }  // namespace edm
0040 
0041 typedef std::vector<std::string> MyStrings;
0042 
0043 /** \class HLTInfo
0044   *
0045   * $Date: November 2006
0046   * $Revision:
0047   * \author P. Bargassa - Rice U.
0048 
0049   * $Date: April 2016
0050   * $Revision:
0051   * \author G. Karapostoli - ULB
0052   */
0053 class HLTInfo {
0054 public:
0055   //HLTInfo();
0056 
0057   template <typename T>
0058   HLTInfo(edm::ParameterSet const& pset, edm::ConsumesCollector&& iC, T& module);
0059 
0060   template <typename T>
0061   HLTInfo(edm::ParameterSet const& pset, edm::ConsumesCollector& iC, T& module);
0062 
0063   void setup(const edm::ParameterSet& pSet, TTree* tree);
0064   void beginRun(const edm::Run&, const edm::EventSetup&);
0065 
0066   /** Analyze the Data */
0067   void analyze(const edm::Handle<edm::TriggerResults>& hltresults,
0068                const edm::Handle<GlobalAlgBlkBxCollection>& l1results,
0069                edm::EventSetup const& eventSetup,
0070                edm::Event const& iEvent,
0071                TTree* tree);
0072 
0073 private:
0074   HLTInfo();
0075 
0076   edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd> l1tUtmTriggerMenuToken_;
0077 
0078   // Tree variables
0079   float *hltppt, *hltpeta;
0080   int L1EvtCnt, HltEvtCnt, nhltpart;
0081 
0082   int *trigflag, *l1flag, *l1flag5Bx, *l1techflag;
0083   double* trigPrescl;
0084   int *l1Prescl, *l1techPrescl;
0085 
0086   TString* algoBitToName;
0087   TString* techBitToName;
0088   std::vector<std::string> dummyBranches_;
0089 
0090   //HLTConfigProvider hltConfig_;
0091   //L1GtUtils m_l1GtUtils;
0092   std::unique_ptr<HLTPrescaleProvider> hltPrescaleProvider_;
0093   std::string processName_;
0094 
0095   bool _OR_BXes;
0096   int UnpackBxInEvent;  // save number of BXs unpacked in event
0097 
0098   // input variables
0099 
0100   // L1 uGT menu
0101   unsigned long long cache_id_;
0102 
0103   /*
0104   edm::ESHandle<L1TUtmTriggerMenu> menu;
0105   //std::map<std::string, L1TUtmAlgorithm> const & algorithmMap_;
0106   const std::map<std::string, L1TUtmAlgorithm>* algorithmMap_;
0107   */
0108   bool _Debug;
0109 };
0110 
0111 template <typename T>
0112 HLTInfo::HLTInfo(edm::ParameterSet const& pset, edm::ConsumesCollector&& iC, T& module) : HLTInfo(pset, iC, module) {}
0113 
0114 template <typename T>
0115 HLTInfo::HLTInfo(edm::ParameterSet const& pset, edm::ConsumesCollector& iC, T& module) : HLTInfo() {
0116   l1tUtmTriggerMenuToken_ = iC.esConsumes<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>();
0117   hltPrescaleProvider_ = std::make_unique<HLTPrescaleProvider>(pset, iC, module);
0118 }
0119 
0120 #endif