Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:48

0001 #ifndef L1GlobalTrigger_L1GlobalTriggerReadoutRecord_h
0002 #define L1GlobalTrigger_L1GlobalTriggerReadoutRecord_h
0003 
0004 /**
0005  * \class L1GlobalTriggerReadoutRecord
0006  * 
0007  * 
0008  * Description: readout record for L1 Global Trigger.  
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *   
0013  * \author: N. Neumeister        - HEPHY Vienna - ORCA version 
0014  * \author: Vasile Mihai Ghete   - HEPHY Vienna - CMSSW version 
0015  * 
0016  *
0017  */
0018 
0019 // system include files
0020 #include <string>
0021 #include <vector>
0022 #include <iosfwd>
0023 
0024 // user include files
0025 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0026 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
0027 
0028 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
0029 
0030 #include "DataFormats/L1GlobalTrigger/interface/L1GtfeWord.h"
0031 #include "DataFormats/L1GlobalTrigger/interface/L1GtFdlWord.h"
0032 #include "DataFormats/L1GlobalTrigger/interface/L1GtPsbWord.h"
0033 
0034 #include "DataFormats/Common/interface/RefProd.h"
0035 
0036 #include "FWCore/Utilities/interface/typedefs.h"
0037 
0038 // forward declarations
0039 namespace edm {
0040   template <typename T>
0041   class Handle;
0042 }
0043 
0044 // class interface
0045 
0046 class L1GlobalTriggerReadoutRecord {
0047 public:
0048   /// constructors
0049   L1GlobalTriggerReadoutRecord();
0050 
0051   L1GlobalTriggerReadoutRecord(int NumberBxInEvent);
0052 
0053   L1GlobalTriggerReadoutRecord(const int numberBxInEvent, const int numberFdlBoards, const int numberPsbBoards);
0054 
0055   /// copy constructor
0056   L1GlobalTriggerReadoutRecord(const L1GlobalTriggerReadoutRecord&);
0057 
0058   /// destructor
0059   virtual ~L1GlobalTriggerReadoutRecord();
0060 
0061   /// assignment operator
0062   L1GlobalTriggerReadoutRecord& operator=(const L1GlobalTriggerReadoutRecord&);
0063 
0064   /// equal operator
0065   bool operator==(const L1GlobalTriggerReadoutRecord&) const;
0066 
0067   /// unequal operator
0068   bool operator!=(const L1GlobalTriggerReadoutRecord&) const;
0069 
0070 public:
0071   /// get Global Trigger decision, decision word and technical trigger word
0072   ///   overloaded w.r.t. bxInEvent argument
0073   ///   bxInEvent not given: for bunch cross with L1Accept
0074   const bool decision(int bxInEventValue) const;
0075   const bool decision() const;
0076 
0077   const cms_uint16_t finalOR(int bxInEventValue) const;
0078   const cms_uint16_t finalOR() const;
0079 
0080   const DecisionWord& decisionWord(int bxInEventValue) const;
0081   const DecisionWord& decisionWord() const;
0082 
0083   const TechnicalTriggerWord& technicalTriggerWord(int bxInEventValue) const;
0084   const TechnicalTriggerWord& technicalTriggerWord() const;
0085 
0086   /// set global decision, decision word and technical trigger word
0087   void setDecision(const bool& t, int bxInEventValue);
0088   void setDecision(const bool& t);
0089 
0090   void setDecisionWord(const DecisionWord& decisionWordValue, int bxInEventValue);
0091   void setDecisionWord(const DecisionWord& decisionWordValue);
0092 
0093   void setTechnicalTriggerWord(const TechnicalTriggerWord& ttWordValue, int bxInEventValue);
0094   void setTechnicalTriggerWord(const TechnicalTriggerWord& ttWordValue);
0095 
0096   /// print global decision and algorithm decision word
0097   void printGtDecision(std::ostream& myCout, int bxInEventValue) const;
0098   void printGtDecision(std::ostream& myCout) const;
0099 
0100   /// print technical triggers
0101   void printTechnicalTrigger(std::ostream& myCout, int bxInEventValue) const;
0102   void printTechnicalTrigger(std::ostream& myCout) const;
0103 
0104   /// get / set reference to L1MuGMTReadoutCollection
0105   const edm::RefProd<L1MuGMTReadoutCollection> muCollectionRefProd() const;
0106   void setMuCollectionRefProd(edm::Handle<L1MuGMTReadoutCollection>&);
0107   void setMuCollectionRefProd(const edm::RefProd<L1MuGMTReadoutCollection>&);
0108 
0109   //**************************************************************************
0110   // get/set hardware-related words
0111   //
0112   //**************************************************************************
0113 
0114   /// get / set GTFE word (record) in the GT readout record
0115   const L1GtfeWord gtfeWord() const;
0116   void setGtfeWord(const L1GtfeWord&);
0117 
0118   /// get the vector of L1GtFdlWord
0119   const std::vector<L1GtFdlWord> gtFdlVector() const { return m_gtFdlWord; }
0120 
0121   std::vector<L1GtFdlWord>& gtFdlVector() { return m_gtFdlWord; }
0122 
0123   /// get / set FDL word (record) in the GT readout record
0124   const L1GtFdlWord gtFdlWord(int bxInEventValue) const;
0125   const L1GtFdlWord gtFdlWord() const;
0126 
0127   void setGtFdlWord(const L1GtFdlWord&, int bxInEventValue);
0128   void setGtFdlWord(const L1GtFdlWord&);
0129 
0130   /// get the vector of L1GtPsbWord
0131   const std::vector<L1GtPsbWord> gtPsbVector() const { return m_gtPsbWord; }
0132 
0133   std::vector<L1GtPsbWord>& gtPsbVector() { return m_gtPsbWord; }
0134 
0135   /// get / set PSB word (record) in the GT readout record
0136   const L1GtPsbWord gtPsbWord(cms_uint16_t boardIdValue, int bxInEventValue) const;
0137   const L1GtPsbWord gtPsbWord(cms_uint16_t boardIdValue) const;
0138 
0139   void setGtPsbWord(const L1GtPsbWord&, cms_uint16_t boardIdValue, int bxInEventValue);
0140   void setGtPsbWord(const L1GtPsbWord&, cms_uint16_t boardIdValue);
0141   void setGtPsbWord(const L1GtPsbWord& gtPsbWordValue);
0142 
0143   // other methods
0144 
0145   /// clear the record
0146   void reset();
0147 
0148   /// pretty print the content of a L1GlobalTriggerReadoutRecord
0149   void print(std::ostream& myCout) const;
0150 
0151   /// output stream operator
0152   friend std::ostream& operator<<(std::ostream&, const L1GlobalTriggerReadoutRecord&);
0153 
0154 private:
0155   L1GtfeWord m_gtfeWord;
0156 
0157   std::vector<L1GtFdlWord> m_gtFdlWord;
0158 
0159   std::vector<L1GtPsbWord> m_gtPsbWord;
0160 
0161   edm::RefProd<L1MuGMTReadoutCollection> m_muCollRefProd;
0162 };
0163 
0164 #endif