Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:31

0001 #ifndef DataFormats_L1TGlobal_GlobalAlgBlk_h
0002 #define DataFormats_L1TGlobal_GlobalAlgBlk_h
0003 
0004 /**
0005 * \class GlobalAlgBlk
0006 *
0007 *
0008 * Description: L1 micro Global Trigger - Block holding Algorithm Information
0009 *
0010 * Implementation:
0011 * <TODO: enter implementation details>
0012 *
0013 * \author: Brian Winer - Ohio State
0014 *
0015 *
0016 */
0017 
0018 // system include files
0019 #include <vector>
0020 #include <iostream>
0021 #include <iomanip>
0022 
0023 // user include files
0024 #include "FWCore/Utilities/interface/typedefs.h"
0025 #include "DataFormats/L1Trigger/interface/BXVector.h"
0026 //#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
0027 #include "DataFormats/L1Trigger/interface/L1TObjComparison.h"
0028 
0029 // forward declarations
0030 
0031 class GlobalAlgBlk;
0032 typedef BXVector<GlobalAlgBlk> GlobalAlgBlkBxCollection;
0033 
0034 typedef l1t::ObjectRef<GlobalAlgBlk> GlobalAlgBlkRef;
0035 typedef l1t::ObjectRefBxCollection<GlobalAlgBlk> GlobalAlgBlkRefBxCollection;
0036 typedef l1t::ObjectRefPair<GlobalAlgBlk> GlobalAlgBlkRefPair;
0037 typedef l1t::ObjectRefPairBxCollection<GlobalAlgBlk> GlobalAlgBlkRefPairBxCollection;
0038 
0039 // class interface
0040 
0041 class GlobalAlgBlk {
0042 public:
0043   /// constructors
0044   GlobalAlgBlk();  // empty constructor, all members set to zero;
0045 
0046   GlobalAlgBlk(int orbitNr, int bxNr, int bxInEvent);
0047 
0048   /// destructor
0049   virtual ~GlobalAlgBlk();
0050 
0051 public:
0052   static constexpr unsigned int maxPhysicsTriggers = 512;
0053 
0054   /// set simple members
0055   void setL1MenuUUID(int uuid) { m_orbitNr = uuid; }
0056   void setL1FirmwareUUID(int fuuid) { m_bxNr = fuuid; }
0057   void setbxInEventNr(int bxNr) { m_bxInEvent = bxNr; }
0058   void setFinalORVeto(bool fOR) { m_finalORVeto = fOR; }
0059   void setFinalORPreVeto(bool fOR) { m_finalORPreVeto = fOR; }
0060   void setFinalOR(bool fOR) { m_finalOR = fOR; }
0061   void setPreScColumn(int psC) { m_preScColumn = psC; }
0062 
0063   /// get simple members
0064   inline const int getL1MenuUUID() const { return m_orbitNr; }
0065   inline const int getL1FirmwareUUID() const { return m_bxNr; }
0066   inline const int getbxInEventNr() const { return m_bxInEvent; }
0067   inline const bool getFinalOR() const { return m_finalOR; }
0068   inline const bool getFinalORPreVeto() const { return m_finalORPreVeto; };
0069   inline const bool getFinalORVeto() const { return m_finalORVeto; }
0070   inline const int getPreScColumn() const { return m_preScColumn; }
0071 
0072   /// Copy vectors words
0073   void copyInitialToInterm() { m_algoDecisionPreScaled = m_algoDecisionInitial; }
0074   void copyIntermToFinal() { m_algoDecisionFinal = m_algoDecisionPreScaled; }
0075 
0076   /// Set decision bits
0077   void setAlgoDecisionInitial(unsigned int bit, bool val);
0078   void setAlgoDecisionInterm(unsigned int bit, bool val);
0079   void setAlgoDecisionFinal(unsigned int bit, bool val);
0080 
0081   /// Get decision bits
0082   std::vector<bool> const& getAlgoDecisionInitial() const { return m_algoDecisionInitial; }
0083   std::vector<bool> const& getAlgoDecisionInterm() const { return m_algoDecisionPreScaled; }
0084   std::vector<bool> const& getAlgoDecisionFinal() const { return m_algoDecisionFinal; }
0085   bool getAlgoDecisionInitial(unsigned int bit) const;
0086   bool getAlgoDecisionInterm(unsigned int bit) const;
0087   bool getAlgoDecisionFinal(unsigned int bit) const;
0088 
0089   /// reset the content of a GlobalAlgBlk
0090   void reset();
0091 
0092   // compare the content of this GlobalAlgBlk with another one
0093   virtual bool operator==(const GlobalAlgBlk& rhs) const;
0094   virtual inline bool operator!=(const GlobalAlgBlk& rhs) const { return !(operator==(rhs)); };
0095 
0096   /// pretty print the content of a GlobalAlgBlk
0097   void print(std::ostream& myCout) const;
0098 
0099 private:
0100   // where noted member data has been re-interpreted, to keep persistant data the same, as these features were added late in release cycle.
0101 
0102   /// orbit number -> L1MenuUUID
0103   int m_orbitNr;
0104 
0105   /// bunch cross number of the actual bx -> L1FirmwareUUID
0106   int m_bxNr;
0107 
0108   /// bunch cross in the GT event record (E,F,0,1,2)
0109   int m_bxInEvent;
0110 
0111   // finalOR
0112   bool m_finalOR;
0113   bool m_finalORPreVeto;
0114   bool m_finalORVeto;
0115 
0116   //Prescale Column
0117   int m_preScColumn;
0118 
0119   std::vector<bool> m_algoDecisionInitial;
0120   std::vector<bool> m_algoDecisionPreScaled;  // -> Interm
0121   std::vector<bool> m_algoDecisionFinal;
0122 };
0123 
0124 #endif /*DataFormats_L1TGlobal_GlobalAlgBlk_h*/