Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-14 23:16:43

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