Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:39:17

0001 #ifndef L1GlobalTrigger_L1GlobalTriggerObjectMap_h
0002 #define L1GlobalTrigger_L1GlobalTriggerObjectMap_h
0003 
0004 /**
0005  * \class L1GlobalTriggerObjectMap
0006  * 
0007  * 
0008  * Description: map trigger objects to an algorithm and the conditions therein.  
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 <string>
0020 #include <vector>
0021 
0022 #include <iosfwd>
0023 
0024 // user include files
0025 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapFwd.h"
0026 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
0027 
0028 #include "DataFormats/L1GlobalTrigger/interface/L1GtLogicParser.h"
0029 
0030 // forward declarations
0031 
0032 // class declaration
0033 class L1GlobalTriggerObjectMap {
0034 public:
0035   /// constructor(s)
0036   L1GlobalTriggerObjectMap() {}
0037 
0038   /// destructor
0039   ~L1GlobalTriggerObjectMap() {}
0040 
0041 public:
0042   /// get / set name for algorithm in the object map
0043   inline const std::string& algoName() const { return m_algoName; }
0044 
0045   void setAlgoName(const std::string& algoNameValue) { m_algoName = algoNameValue; }
0046 
0047   /// get / set bit number for algorithm in the object map
0048   inline int algoBitNumber() const { return m_algoBitNumber; }
0049 
0050   void setAlgoBitNumber(int algoBitNumberValue) { m_algoBitNumber = algoBitNumberValue; }
0051 
0052   /// get / set the GTL result for algorithm
0053   /// NOTE: FDL can mask an algorithm!
0054   inline bool algoGtlResult() const { return m_algoGtlResult; }
0055 
0056   void setAlgoGtlResult(bool algoGtlResultValue) { m_algoGtlResult = algoGtlResultValue; }
0057 
0058   /// get / set the vector of combinations for the algorithm
0059   /// return a constant reference to the vector of combinations for the algorithm
0060   inline const std::vector<CombinationsInCond>& combinationVector() const { return m_combinationVector; }
0061 
0062   void setCombinationVector(const std::vector<CombinationsInCond>& combinationVectorValue) {
0063     m_combinationVector = combinationVectorValue;
0064   }
0065   void swapCombinationVector(std::vector<CombinationsInCond>& combinationVectorValue) {
0066     m_combinationVector.swap(combinationVectorValue);
0067   }
0068 
0069   /// get / set the vector of operand tokens
0070   /// return a constant reference to the vector of operand tokens
0071   inline const std::vector<L1GtLogicParser::OperandToken>& operandTokenVector() const { return m_operandTokenVector; }
0072 
0073   void setOperandTokenVector(const std::vector<L1GtLogicParser::OperandToken>& operandTokenVectorValue) {
0074     m_operandTokenVector = operandTokenVectorValue;
0075   }
0076   void swapOperandTokenVector(std::vector<L1GtLogicParser::OperandToken>& operandTokenVectorValue) {
0077     m_operandTokenVector.swap(operandTokenVectorValue);
0078   }
0079 
0080   /// get / set the vector of object types
0081   /// return a constant reference to the vector of operand tokens
0082   inline const std::vector<ObjectTypeInCond>& objectTypeVector() const { return m_objectTypeVector; }
0083   void setObjectTypeVector(const std::vector<ObjectTypeInCond>& objectTypeVectorValue) {
0084     m_objectTypeVector = objectTypeVectorValue;
0085   }
0086   void swapObjectTypeVector(std::vector<ObjectTypeInCond>& objectTypeVectorValue) {
0087     m_objectTypeVector.swap(objectTypeVectorValue);
0088   }
0089 
0090 public:
0091   /// return all the combinations passing the requirements imposed in condition condNameVal
0092   const CombinationsInCond* getCombinationsInCond(const std::string& condNameVal) const;
0093 
0094   /// return all the combinations passing the requirements imposed in condition condNumberVal
0095   const CombinationsInCond* getCombinationsInCond(const int condNumberVal) const;
0096 
0097   /// return the result for the condition condNameVal
0098   const bool getConditionResult(const std::string& condNameVal) const;
0099 
0100 public:
0101   /// reset the object map
0102   void reset();
0103 
0104   /// print the full object map
0105   void print(std::ostream& myCout) const;
0106 
0107 private:
0108   // name of the algorithm
0109   std::string m_algoName;
0110 
0111   // bit number for algorithm
0112   int m_algoBitNumber;
0113 
0114   // GTL result of the algorithm
0115   bool m_algoGtlResult;
0116 
0117   /// vector of operand tokens for an algorithm
0118   /// (condition name, condition index, condition result)
0119   std::vector<L1GtLogicParser::OperandToken> m_operandTokenVector;
0120 
0121   // vector of combinations for all conditions in an algorithm
0122   std::vector<CombinationsInCond> m_combinationVector;
0123 
0124   // vector of object type vectors for all conditions in an algorithm
0125   std::vector<ObjectTypeInCond> m_objectTypeVector;
0126 };
0127 
0128 #endif /* L1GlobalTrigger_L1GlobalTriggerObjectMap_h */