Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:57

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTBtiTrigData
0004  *
0005  *    DTBtiChip Trigger Data
0006  *
0007  *
0008  *
0009  *   \author C. Grandi, S. Vanini
0010  *
0011  *   Modifications: 
0012  *   SV 29/I/03 : insert trigger Strobe
0013  */
0014 //
0015 //--------------------------------------------------
0016 #ifndef DT_BTI_TRIG_DATA_H
0017 #define DT_BTI_TRIG_DATA_H
0018 
0019 //------------------------------------
0020 // Collaborating Class Declarations --
0021 //------------------------------------
0022 #include "DataFormats/MuonDetId/interface/DTBtiId.h"
0023 
0024 //----------------------
0025 // Base Class Headers --
0026 //----------------------
0027 #include "L1Trigger/DTUtilities/interface/DTTrigData.h"
0028 
0029 //---------------
0030 // C++ Headers --
0031 //---------------
0032 
0033 //              ---------------------
0034 //              -- Class Interface --
0035 //              ---------------------
0036 
0037 typedef unsigned char myint8;
0038 
0039 class DTBtiTrigData : public DTTrigData {
0040 public:
0041   //! Constructor
0042   DTBtiTrigData() {}
0043 
0044   //! Destructor
0045   ~DTBtiTrigData() override {}
0046 
0047   //! Set the parent BTI identifier
0048   inline void setParent(DTBtiId btiid) { _btiid = btiid; }
0049 
0050   //! Set trigger step
0051   inline void setStep(int step) { _step = step; }
0052 
0053   //! Set trigger code
0054   inline void setCode(int code) { _code = code; }
0055 
0056   //! Set trigger K parameter
0057   inline void setK(int k) { _Kval = k; }
0058 
0059   //! Set trigger X parameter
0060   inline void setX(int x) { _Xval = x; }
0061 
0062   //! Set triggering equation
0063   inline void setEq(int eq) { _eq = eq; }
0064 
0065   //! Set trigger strobe
0066   inline void setStrobe(int str) { _str = str; }
0067 
0068   //! Set trigger _Keq
0069   inline void setKeq(int num, float Keq) { _Keq[num] = Keq; }
0070 
0071   //! Clear
0072   void clear() {
0073     _step = 0;
0074     _eq = 0;
0075     _code = 0;
0076     _Kval = 9999;
0077     _Xval = 0;
0078     _str = -1;
0079     for (int j = 0; j < 6; j++)
0080       _Keq[j] = -1;
0081   }
0082 
0083   //! Return chamber identifier
0084   DTChamberId ChamberId() const override { return DTChamberId(_btiid.wheel(), _btiid.station(), _btiid.sector()); }
0085 
0086   //! Print
0087   void print() const override;
0088 
0089   //! Return parent BTI identifier
0090   inline DTBtiId parentId() const { return _btiid; }
0091 
0092   //! Return superlayer identifier
0093   inline DTSuperLayerId SLId() const { return _btiid.SLId(); }
0094 
0095   //! Return parent BTI number
0096   inline int btiNumber() const { return _btiid.bti(); }
0097 
0098   //! Return parent BTI superlayer
0099   inline int btiSL() const { return _btiid.superlayer(); }
0100 
0101   //! Return trigger step
0102   inline int step() const { return _step; }
0103 
0104   //! Return trigger code
0105   inline int code() const { return _code; }
0106 
0107   //! Return trigger K parameter
0108   inline int K() const { return _Kval; }
0109 
0110   //! Return trigger X parameter
0111   inline int X() const { return _Xval; }
0112 
0113   //! Return triggering equation
0114   inline int eq() const { return _eq; }
0115 
0116   //! Return trigger strobe
0117   inline int Strobe() const { return _str; }
0118 
0119   //! Return triggering K equations
0120   inline float Keq(int i) const { return _Keq[i]; }
0121 
0122 private:
0123   // Parent BTI identifier
0124   DTBtiId _btiid;  // this is 5 bytes
0125 
0126   // output values
0127   myint8 _code;
0128   int _Kval;
0129   myint8 _Xval;
0130 
0131   myint8 _step;
0132   myint8 _eq;
0133   int _str;
0134   float _Keq[6];
0135 };
0136 
0137 #endif