Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HLTfilters_HLTL1TSeed_h
0002 #define HLTfilters_HLTL1TSeed_h
0003 
0004 /**
0005  * \class HLTL1TSeed
0006  *
0007  *
0008  * Description: filter L1 bits and extract seed objects from L1 GT for HLT algorithms.
0009  *
0010  * Implementation:
0011  *    This class is an HLTStreamFilter (-> stream::EDFilter). It implements:
0012  *      - filtering on Level-1 bits, given via a logical expression of algorithm names (currently ignored)
0013  *      - extraction of the seed objects from L1T uGT object map record
0014  *
0015  */
0016 
0017 // system include files
0018 #include <string>
0019 #include <vector>
0020 
0021 // user include files
0022 
0023 //   base class
0024 #include "HLTrigger/HLTcore/interface/HLTStreamFilter.h"
0025 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
0026 
0027 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0028 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
0029 #include "DataFormats/L1TGlobal/interface/GlobalLogicParser.h"
0030 #include "DataFormats/L1TGlobal/interface/GlobalObject.h"
0031 #include "DataFormats/L1TGlobal/interface/GlobalAlgBlk.h"
0032 
0033 #include "FWCore/Utilities/interface/InputTag.h"
0034 
0035 // forward declarations
0036 class L1GtTriggerMenu;
0037 class L1GtTriggerMask;
0038 class L1GlobalTriggerReadoutRecord;
0039 
0040 class GlobalObjectMapRecord;
0041 namespace edm {
0042   class ConfigurationDescriptions;
0043 }
0044 
0045 // class declaration
0046 class HLTL1TSeed : public HLTStreamFilter {
0047 public:
0048   /// constructor
0049   explicit HLTL1TSeed(const edm::ParameterSet&);
0050 
0051   /// destructor
0052   ~HLTL1TSeed() override;
0053 
0054   /// parameter description
0055   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0056 
0057   /// filter the event
0058   bool hltFilter(edm::Event&, const edm::EventSetup&, trigger::TriggerFilterObjectWithRefs& filterproduct) override;
0059 
0060 private:
0061   /// update the tokenNumber (holding the bit numbers) from m_l1AlgoLogicParser
0062   /// for a new L1 Trigger menu
0063   void inline updateAlgoLogicParser(const L1GtTriggerMenu*, const AlgorithmMap&){};
0064 
0065   /// update the tokenResult members from m_l1AlgoLogicParser
0066   /// for a new event
0067   void inline updateAlgoLogicParser(const std::vector<bool>& gtWord,
0068                                     const std::vector<unsigned int>& triggerMask,
0069                                     const int physicsDaqPartition){};
0070 
0071   /// seeding is done via L1 trigger object maps, considering the objects which fired in L1
0072   bool seedsL1TriggerObjectMaps(edm::Event&, trigger::TriggerFilterObjectWithRefs&);
0073 
0074   /// detailed print of filter content
0075   void dumpTriggerFilterObjectWithRefs(trigger::TriggerFilterObjectWithRefs&) const;
0076 
0077 private:
0078   /// logic parser for m_l1SeedsLogicalExpression
0079   GlobalLogicParser m_l1AlgoLogicParser;
0080 
0081   /// list of required algorithms for seeding
0082   std::vector<GlobalLogicParser::OperandToken> m_l1AlgoSeeds;
0083 
0084   /// vector of Rpn vectors for the required algorithms for seeding
0085   std::vector<const std::vector<GlobalLogicParser::TokenRPN>*> m_l1AlgoSeedsRpn;
0086 
0087   /// vector of object-type vectors for each condition in the required algorithms for seeding
0088   std::vector<std::vector<const std::vector<l1t::GlobalObject>*> > m_l1AlgoSeedsObjType;
0089 
0090 private:
0091   /// option used forL1UseL1TriggerObjectMaps = False only
0092   /// number of BxInEvent: 1: L1A=0; 3: -1, L1A=0, 1; 5: -2, -1, L1A=0, 1, 2
0093   int m_l1NrBxInEvent;
0094 
0095   /// logical expression for the required L1 algorithms
0096   /// the algorithms are specified by name
0097   std::string m_l1SeedsLogicalExpression;
0098 
0099   /// InputTag for L1 Global Trigger object maps. This is done per menu. Should be part of Run.
0100   edm::InputTag m_l1GtObjectMapTag;
0101   edm::EDGetTokenT<GlobalObjectMapRecord> m_l1GtObjectMapToken;
0102 
0103   /// InputTag for L1 Global Trigger
0104   edm::InputTag m_l1GlobalTag;
0105   edm::EDGetTokenT<GlobalAlgBlkBxCollection> m_l1GlobalToken;
0106 
0107   //edm::InputTag dummyTag;
0108   /// Meta InputTag for L1 Muon collection
0109   edm::InputTag m_l1MuonCollectionsTag;
0110   edm::InputTag m_l1MuonTag;
0111   edm::EDGetTokenT<l1t::MuonBxCollection> m_l1MuonToken;
0112 
0113   /// Meta InputTag for L1 Muon collection
0114   edm::InputTag m_l1MuonShowerCollectionsTag;
0115   edm::InputTag m_l1MuonShowerTag;
0116   edm::EDGetTokenT<l1t::MuonShowerBxCollection> m_l1MuonShowerToken;
0117 
0118   /// Meta InputTag for L1 Egamma collection
0119   edm::InputTag m_l1EGammaCollectionsTag;
0120   edm::InputTag m_l1EGammaTag;
0121   edm::EDGetTokenT<l1t::EGammaBxCollection> m_l1EGammaToken;
0122 
0123   /// Meta InputTag for L1 Jet collection
0124   edm::InputTag m_l1JetCollectionsTag;
0125   edm::InputTag m_l1JetTag;
0126   edm::EDGetTokenT<l1t::JetBxCollection> m_l1JetToken;
0127 
0128   /// Meta InputTag for L1 Tau collection
0129   edm::InputTag m_l1TauCollectionsTag;
0130   edm::InputTag m_l1TauTag;
0131   edm::EDGetTokenT<l1t::TauBxCollection> m_l1TauToken;
0132 
0133   /// Meta InputTag for L1 EtSum collection
0134   edm::InputTag m_l1EtSumCollectionsTag;
0135   edm::InputTag m_l1EtSumTag;
0136   edm::EDGetTokenT<l1t::EtSumBxCollection> m_l1EtSumToken;
0137 
0138   /// Meta InputTag for L1 EtSum (ZDC) collection
0139   edm::InputTag m_l1EtSumZdcCollectionsTag;
0140   edm::InputTag m_l1EtSumZdcTag;
0141   edm::EDGetTokenT<l1t::EtSumBxCollection> m_l1EtSumZdcToken;
0142 
0143   /// flag to pass if L1TGlobal accept
0144   bool m_l1GlobalDecision;
0145 
0146   /// cache edm::isDebugEnabled()
0147   bool m_isDebugEnabled;
0148 };
0149 
0150 #endif  // HLTfilters_HLTL1TSeed_h