Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:20

0001 #ifndef CondFormats_L1TObjects_L1GtEnergySumTemplate_h
0002 #define CondFormats_L1TObjects_L1GtEnergySumTemplate_h
0003 
0004 /**
0005  * \class L1GtEnergySumTemplate
0006  *
0007  *
0008  * Description: L1 Global Trigger energy-sum template.
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *
0013  * \author: Vasile Mihai Ghete - HEPHY Vienna
0014  *
0015  * $Date$
0016  * $Revision$
0017  *
0018  */
0019 
0020 // system include files
0021 #include "CondFormats/Serialization/interface/Serializable.h"
0022 
0023 #include <string>
0024 #include <iosfwd>
0025 
0026 // user include files
0027 
0028 //   base class
0029 #include "CondFormats/L1TObjects/interface/L1GtCondition.h"
0030 
0031 // forward declarations
0032 
0033 // class declaration
0034 class L1GtEnergySumTemplate : public L1GtCondition {
0035 public:
0036   // constructor
0037   L1GtEnergySumTemplate();
0038 
0039   // constructor
0040   L1GtEnergySumTemplate(const std::string&);
0041 
0042   // constructor
0043   L1GtEnergySumTemplate(const std::string&, const L1GtConditionType&);
0044 
0045   // copy constructor
0046   L1GtEnergySumTemplate(const L1GtEnergySumTemplate&);
0047 
0048   // destructor
0049   ~L1GtEnergySumTemplate() override;
0050 
0051   // assign operator
0052   L1GtEnergySumTemplate& operator=(const L1GtEnergySumTemplate&);
0053 
0054 public:
0055   /// typedef for a single object template
0056   struct ObjectParameter {
0057     unsigned int etThreshold;
0058     bool energyOverflow;
0059 
0060     // two words used only for ETM (ETM phi has 72 bins - two 64-bits words)
0061     // one word used for HTM
0062     unsigned long long phiRange0Word;
0063     unsigned long long phiRange1Word;
0064 
0065     // make sure all objects (esp. the bool) are properly initialised to avoid problems with serialisation:
0066     ObjectParameter() : etThreshold(0), energyOverflow(false), phiRange0Word(0), phiRange1Word(0) { /*nop*/
0067       ;
0068     };
0069 
0070     COND_SERIALIZABLE;
0071   };
0072 
0073 public:
0074   inline const std::vector<ObjectParameter>* objectParameter() const { return &m_objectParameter; }
0075 
0076   /// set functions
0077   void setConditionParameter(const std::vector<ObjectParameter>&);
0078 
0079   /// print the condition
0080   void print(std::ostream& myCout) const override;
0081 
0082   /// output stream operator
0083   friend std::ostream& operator<<(std::ostream&, const L1GtEnergySumTemplate&);
0084 
0085 private:
0086   /// copy function for copy constructor and operator=
0087   void copy(const L1GtEnergySumTemplate& cp);
0088 
0089 private:
0090   /// variables containing the parameters
0091   std::vector<ObjectParameter> m_objectParameter;
0092 
0093   COND_SERIALIZABLE;
0094 };
0095 
0096 #endif