Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:59

0001 #ifndef GlobalTrigger_L1GlobalTriggerFDL_h
0002 #define GlobalTrigger_L1GlobalTriggerFDL_h
0003 /**
0004  * \class L1GlobalTriggerFDL
0005  *
0006  *
0007  * Description: Final Decision Logic board.
0008  *
0009  * Implementation:
0010  *    <TODO: enter implementation details>
0011  *
0012  * \author: M. Fierro            - HEPHY Vienna - ORCA version
0013  * \author: Vasile Mihai Ghete   - HEPHY Vienna - CMSSW version
0014  *
0015  *
0016  */
0017 
0018 // system include files
0019 #include <vector>
0020 
0021 // user include files
0022 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
0023 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0024 
0025 #include "FWCore/Framework/interface/Event.h"
0026 
0027 #include "CondFormats/L1TObjects/interface/L1GtBoard.h"
0028 #include "CondFormats/L1TObjects/interface/L1GtFwd.h"
0029 #include <cstdint>
0030 
0031 // forward declarations
0032 class L1GlobalTriggerReadoutRecord;
0033 class L1GlobalTriggerEvmReadoutRecord;
0034 
0035 class L1GtFdlWord;
0036 class L1GlobalTriggerGTL;
0037 class L1GlobalTriggerPSB;
0038 
0039 // class declaration
0040 class L1GlobalTriggerFDL {
0041 public:
0042   /// constructor
0043   L1GlobalTriggerFDL();
0044 
0045   /// destructor
0046   virtual ~L1GlobalTriggerFDL();
0047 
0048   /// run the FDL
0049   void run(edm::Event &iEvent,
0050            const std::vector<int> &prescaleFactorsAlgoTrig,
0051            const std::vector<int> &prescaleFactorsTechTrig,
0052            const std::vector<unsigned int> &triggerMaskAlgoTrig,
0053            const std::vector<unsigned int> &triggerMaskTechTrig,
0054            const std::vector<unsigned int> &triggerMaskVetoAlgoTrig,
0055            const std::vector<unsigned int> &triggerMaskVetoTechTrig,
0056            const std::vector<L1GtBoard> &boardMaps,
0057            const int totalBxInEvent,
0058            const int iBxInEvent,
0059            const unsigned int numberPhysTriggers,
0060            const unsigned int numberTechnicalTriggers,
0061            const unsigned int numberDaqPartitions,
0062            const L1GlobalTriggerGTL *ptrGTL,
0063            const L1GlobalTriggerPSB *ptrPSB,
0064            const int pfAlgoSetIndex,
0065            const int pfTechSetIndex,
0066            const bool algorithmTriggersUnprescaled,
0067            const bool algorithmTriggersUnmasked,
0068            const bool technicalTriggersUnprescaled,
0069            const bool technicalTriggersUnmasked,
0070            const bool technicalTriggersVetoUnmasked);
0071 
0072   /// fill the FDL block in the L1 GT DAQ record for iBxInEvent
0073   void fillDaqFdlBlock(const int iBxInEvent,
0074                        const uint16_t &activeBoardsGtDaq,
0075                        const int recordLength0,
0076                        const int recordLength1,
0077                        const unsigned int altNrBxBoardDaq,
0078                        const std::vector<L1GtBoard> &boardMaps,
0079                        L1GlobalTriggerReadoutRecord *gtDaqReadoutRecord);
0080 
0081   /// fill the FDL block in the L1 GT EVM record for iBxInEvent
0082   void fillEvmFdlBlock(const int iBxInEvent,
0083                        const uint16_t &activeBoardsGtEvm,
0084                        const int recordLength0,
0085                        const int recordLength1,
0086                        const unsigned int altNrBxBoardEvm,
0087                        const std::vector<L1GtBoard> &boardMaps,
0088                        L1GlobalTriggerEvmReadoutRecord *gtEvmReadoutRecord);
0089 
0090   /// clear FDL
0091   void reset();
0092 
0093   /// return the GtFdlWord
0094   inline L1GtFdlWord *gtFdlWord() const { return m_gtFdlWord; }
0095 
0096 public:
0097   inline void setVerbosity(const int verbosity) { m_verbosity = verbosity; }
0098 
0099 private:
0100   L1GtFdlWord *m_gtFdlWord;
0101 
0102   /// prescale counters: NumberPhysTriggers counters per bunch cross in event
0103   std::vector<std::vector<int>> m_prescaleCounterAlgoTrig;
0104 
0105   /// prescale counters: technical trigger counters per bunch cross in event
0106   std::vector<std::vector<int>> m_prescaleCounterTechTrig;
0107 
0108   /// logical switches for
0109   ///    the first event
0110   ///    the first event in the luminosity segment
0111   ///    and the first event in the run
0112   bool m_firstEv;
0113   bool m_firstEvLumiSegment;
0114   bool m_firstEvRun;
0115 
0116 private:
0117   /// verbosity level
0118   int m_verbosity;
0119   bool m_isDebugEnabled;
0120 };
0121 
0122 #endif