Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:01

0001 #ifndef L1Trigger_GlobalTriggerAnalyzer_L1GetHistLimits_h
0002 #define L1Trigger_GlobalTriggerAnalyzer_L1GetHistLimits_h
0003 
0004 /**
0005  * \class L1GetHistLimits
0006  *
0007  *
0008  * Description: use L1 scales to define histogram limits for L1 trigger objects.
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *
0013  * \author: Vasile Mihai Ghete   - HEPHY Vienna
0014  *
0015  *
0016  */
0017 
0018 // system include files
0019 #include <iosfwd>
0020 #include <memory>
0021 #include <vector>
0022 #include <string>
0023 
0024 // user include files
0025 //
0026 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0027 
0028 #include "FWCore/Framework/interface/Frameworkfwd.h"
0029 #include "FWCore/Framework/interface/EventSetup.h"
0030 #include "FWCore/Framework/interface/ConsumesCollector.h"
0031 
0032 // scales
0033 #include "CondFormats/L1TObjects/interface/L1CaloGeometry.h"
0034 #include "CondFormats/DataRecord/interface/L1CaloGeometryRecord.h"
0035 
0036 #include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
0037 #include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
0038 #include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
0039 #include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
0040 #include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"
0041 #include "CondFormats/L1TObjects/interface/L1GctJetFinderParams.h"
0042 #include "CondFormats/DataRecord/interface/L1GctJetFinderParamsRcd.h"
0043 
0044 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
0045 #include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h"
0046 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
0047 #include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h"
0048 
0049 // forward declarations
0050 
0051 // class declaration
0052 class L1GetHistLimits {
0053 public:
0054   struct Tokens {
0055     Tokens(edm::ConsumesCollector, bool doEtaOrPhi);
0056 
0057     const edm::ESGetToken<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd> m_muPTScaleToken;
0058     edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> m_muScalesToken;  //eta,phi
0059     const edm::ESGetToken<L1CaloEtScale, L1EmEtScaleRcd> m_etScaleToken;
0060     edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> m_caloGeomESHToken;  //eta,phi
0061     const edm::ESGetToken<L1CaloEtScale, L1JetEtScaleRcd> m_jetScaleToken;
0062     const edm::ESGetToken<L1GctJetFinderParams, L1GctJetFinderParamsRcd> m_jetFinderParamsToken;
0063     const edm::ESGetToken<L1CaloEtScale, L1HtMissScaleRcd> m_htMissScaleToken;
0064     const edm::ESGetToken<L1CaloEtScale, L1HfRingEtScaleRcd> m_hfRingEtScaleToken;
0065   };
0066 
0067   // constructor(s)
0068   explicit L1GetHistLimits(const Tokens&, const edm::EventSetup& evSetup);
0069 
0070   // destructor
0071   virtual ~L1GetHistLimits();
0072 
0073   /// structure containing all limits:
0074   /// numbers of bins for a given histogram
0075   /// lower limit of the first bin in the histogram
0076   /// upper limit of the last bin in the histogram
0077   /// vector of bin thresholds
0078   struct L1HistLimits {
0079     int nrBins;
0080     double lowerBinValue;
0081     double upperBinValue;
0082     std::vector<float> binThresholds;
0083   };
0084 
0085 public:
0086   /// for a L1 trigger object and a given quantity,
0087   /// return all limits for a histogram
0088   const L1HistLimits& l1HistLimits(const L1GtObject& l1GtObject, const std::string& quantity);
0089 
0090   /// for a L1 trigger object and a given quantity,
0091   /// return the real limits for a histogram given an arbitrary range
0092   const L1HistLimits& l1HistLimits(const L1GtObject& l1GtObject,
0093                                    const std::string& quantity,
0094                                    const double histMinValue,
0095                                    const double histMaxValue);
0096 
0097   /// for a L1 trigger object and a given quantity,
0098   /// return the numbers of bins for a given histogram
0099   const int l1HistNrBins(const L1GtObject& l1GtObject, const std::string& quantity);
0100 
0101   /// for a L1 trigger object and a given quantity,
0102   /// return the lower limit of the first bin in the histogram
0103   const double l1HistLowerBinValue(const L1GtObject& l1GtObject, const std::string& quantity);
0104 
0105   /// for a L1 trigger object and a given quantity,
0106   /// return the upper limit of the last bin in the histogram
0107   const double l1HistUpperBinValue(const L1GtObject& l1GtObject, const std::string& quantity);
0108 
0109   /// for a L1 trigger object and a given quantity,
0110   /// return the vector of bin thresholds
0111   const std::vector<float>& l1HistBinThresholds(const L1GtObject& l1GtObject, const std::string& quantity);
0112 
0113 private:
0114   /// for a L1 trigger object and a given quantity,
0115   /// compute the number of bins, the lower limit of the first bin,
0116   /// the upper limit of the last bin and the vector of bin thresholds
0117   void getHistLimits(const L1GtObject& l1GtObject, const std::string& quantity);
0118 
0119 private:
0120   const Tokens& m_tokens;
0121   const edm::EventSetup& m_evSetup;
0122 
0123   /// all limits for a histogram
0124   L1HistLimits m_l1HistLimits;
0125 };
0126 
0127 #endif