Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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