Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1Trigger_L1TGlobal_GtCondition_h
0002 #define L1Trigger_L1TGlobal_GtCondition_h
0003 
0004 /**
0005  * \class GlobalCondition
0006  *
0007  *
0008  * Description: base class for L1 Global Trigger object templates (condition).
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *
0013  * \author: Brian Winer, OSU   Vasile Mihai Ghete - HEPHY Vienna
0014  *          Elisa Fontanesi - extended for three-body correlation conditions
0015  *
0016  * $Date$
0017  * $Revision$
0018  *
0019  */
0020 
0021 // system include files
0022 #include <string>
0023 #include <vector>
0024 
0025 #include <iostream>
0026 
0027 // user include files
0028 #include "DataFormats/L1TGlobal/interface/GlobalObject.h"
0029 #include "L1Trigger/L1TGlobal/interface/GlobalDefinitions.h"
0030 
0031 // forward declarations
0032 
0033 // class declaration
0034 class GlobalCondition {
0035 public:
0036   /// constructor(s)
0037   ///
0038   GlobalCondition();
0039 
0040   ///   constructor from condition name
0041   GlobalCondition(const std::string&);
0042 
0043   ///   constructor from condition name, category and type
0044   GlobalCondition(const std::string&, const l1t::GtConditionCategory&, const l1t::GtConditionType&);
0045 
0046   /// destructor
0047   virtual ~GlobalCondition();
0048 
0049 public:
0050   /// get / set condition name
0051   inline const std::string& condName() const { return m_condName; }
0052 
0053   inline void setCondName(const std::string& cName) { m_condName = cName; }
0054 
0055   /// get / set the category of the condition
0056   inline const l1t::GtConditionCategory& condCategory() const { return m_condCategory; }
0057 
0058   inline void setCondCategory(const l1t::GtConditionCategory& cCategory) { m_condCategory = cCategory; }
0059 
0060   /// get / set the type of the condition (1s, etc)
0061   inline const l1t::GtConditionType& condType() const { return m_condType; }
0062 
0063   inline void setCondType(const l1t::GtConditionType& cType) { m_condType = cType; }
0064 
0065   /// get / set the trigger object type(s) in the condition
0066   inline const std::vector<l1t::GlobalObject>& objectType() const { return m_objectType; }
0067 
0068   inline void setObjectType(const std::vector<l1t::GlobalObject>& objType) { m_objectType = objType; }
0069 
0070   /// get / set condition GEq flag
0071   inline const bool condGEq() const { return m_condGEq; }
0072 
0073   inline void setCondGEq(const bool& cGEq) { m_condGEq = cGEq; }
0074 
0075   /// get / set the condition-chip number the condition is located on
0076   inline const int& condChipNr() const { return m_condChipNr; }
0077 
0078   inline void setCondChipNr(const int& cChipNr) { m_condChipNr = cChipNr; }
0079 
0080   /// get / set the condition relative bx
0081   inline const int& condRelativeBx() const { return m_condRelativeBx; }
0082 
0083   inline void setCondRelativeBx(const int& cRelativeBx) { m_condRelativeBx = cRelativeBx; }
0084 
0085 public:
0086   /// get number of trigger objects
0087   const int nrObjects() const;
0088 
0089   /// get logic flag for conditions, same type of trigger objects,
0090   /// and with spatial correlations
0091   const bool wsc() const;
0092 
0093   /// get logic flag for conditions, different type of trigger objects,
0094   /// and with spatial correlations
0095   const bool corr() const;
0096 
0097   /// get logic flag for three-body conditions, trigger objects are muons
0098   const bool corrThree() const;
0099 
0100   /// print condition
0101   virtual void print(std::ostream& myCout) const;
0102 
0103   /// output stream operator
0104   friend std::ostream& operator<<(std::ostream&, const GlobalCondition&);
0105 
0106 protected:
0107   /// the name of the condition
0108   std::string m_condName;
0109 
0110   /// the category of the condition
0111   l1t::GtConditionCategory m_condCategory;
0112 
0113   /// the type of the condition (1s, etc)
0114   l1t::GtConditionType m_condType;
0115 
0116   /// the trigger object type(s)
0117   std::vector<l1t::GlobalObject> m_objectType;
0118 
0119   /// the operator used for the condition (>=, =): true for >=
0120   bool m_condGEq = false;
0121 
0122   /// condition is located on condition chip m_condChipNr
0123   int m_condChipNr;
0124 
0125   // Relative bunch crossing offset for input data.
0126   int m_condRelativeBx;
0127 };
0128 
0129 #endif /*L1Trigger_L1TGlobal_GtCondition_h*/