Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:01

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTTracoTrig
0004  *
0005  *   TRACO Trigger Data.
0006  *   Has pointers to parent TRACO and BTI triggers
0007  *   which allow algorithm debugging
0008  *
0009  *
0010  *
0011  *   \author C. Grandi, S. Vanini
0012  */
0013 //
0014 //--------------------------------------------------
0015 #ifndef DT_TRACO_TRIG_H
0016 #define DT_TRACO_TRIG_H
0017 
0018 //------------------------------------
0019 // Collaborating Class Declarations --
0020 //------------------------------------
0021 class DTBtiTrigData;
0022 class DTTracoChip;
0023 
0024 //----------------------
0025 // Base Class Headers --
0026 //----------------------
0027 #include "L1Trigger/DTBti/interface/DTBtiTrig.h"
0028 #include "L1Trigger/DTTraco/interface/DTTracoTrigData.h"
0029 #include "L1Trigger/DTUtilities/interface/DTTrigData.h"
0030 
0031 //---------------
0032 // C++ Headers --
0033 //---------------
0034 #include <vector>
0035 
0036 //              ---------------------
0037 //              -- Class Interface --
0038 //              ---------------------
0039 
0040 class DTTracoTrig : public DTTrigData {
0041 public:
0042   /// Constructors
0043   DTTracoTrig();
0044 
0045   /// Constructors
0046   DTTracoTrig(DTTracoChip *, int);
0047 
0048   /// Constructors
0049   DTTracoTrig(DTTracoChip *, DTTracoTrigData);
0050 
0051   /// Destructor
0052   ~DTTracoTrig() override;
0053 
0054   /// Set the parent TRACO
0055   inline void setParent(DTTracoChip *parent) { _tparent = parent; }
0056 
0057   /// Add a BTI trigger to the list
0058   inline void addDTBtiTrig(const DTBtiTrigData *btitrig) { _btitrig.push_back(btitrig); }
0059 
0060   /// Set trigger preview parameters
0061   inline void setPV(int first, int code, int K, int io) { _data.setPV(first, code, K, io); }
0062 
0063   /// Set trigger preview correlation bit
0064   inline void setPVCorr(int ic) { _data.setPVCorr(ic); }
0065 
0066   /// Set trigger code, inner segment
0067   inline void setCodeIn(int code) { _data.setCodeIn(code); }
0068 
0069   /// Set trigger code, outer segment
0070   inline void setCodeOut(int code) { _data.setCodeOut(code); }
0071 
0072   /// Set position of segments, inner
0073   inline void setPosIn(int pos) { _data.setPosIn(pos); }
0074 
0075   /// Set position of segments, outer
0076   inline void setPosOut(int pos) { _data.setPosOut(pos); }
0077 
0078   /// Set bti trigger equation of segments, inner
0079   inline void setEqIn(int eq) { _data.setEqIn(eq); }
0080 
0081   /// Set bti trigger equation of segments, outer
0082   inline void setEqOut(int eq) { _data.setEqOut(eq); }
0083 
0084   /// Set trigger K parameter
0085   inline void setK(int k) { _data.setK(k); }
0086 
0087   /// Set trigger X parameter
0088   inline void setX(int x) { _data.setX(x); }
0089 
0090   /// Set trigger angles
0091   inline void setAngles(int psi, int psir, int dpsir) { _data.setAngles(psi, psir, dpsir); }
0092 
0093   /// Reset all variables but preview
0094   inline void resetVar() { _data.resetVar(); }
0095 
0096   /// Reset preview variables
0097   inline void resetPV() { _data.resetPV(); }
0098 
0099   /// Clear
0100   inline void clear() {
0101     _data.clear();
0102     _btitrig.clear();
0103   }
0104 
0105   /// Return chamber identifier
0106   inline DTChamberId ChamberId() const override { return _data.ChamberId(); }
0107 
0108   /// Print
0109   inline void print() const override { _data.print(); }
0110 
0111   /// Return parent TRACO pointer
0112   inline DTTracoChip *tParent() const { return _tparent; }
0113 
0114   /// Return the data part
0115   inline DTTracoTrigData data() const { return _data; }
0116 
0117   /// Return parent TRACO number
0118   inline int tracoNumber() const { return _data.tracoNumber(); }
0119 
0120   /// Return step
0121   inline int step() const { return _data.step(); }
0122 
0123   /// Return trigger code
0124   inline int code() const { return _data.code(); }
0125 
0126   /// Return correlator output code (position of segments)
0127   inline int posMask() const { return _data.posMask(); }
0128 
0129   /// Return the position of inner segment
0130   inline int posIn() const { return _data.posIn(); }
0131 
0132   /// Return the position of outer segment
0133   inline int posOut() const { return _data.posOut(); }
0134 
0135   /// Return bti trigger equation of segments, inner
0136   inline int eqIn() { return _data.eqIn(); }
0137 
0138   /// Return bti trigger equation of segments, outer
0139   inline int eqOut() { return _data.eqOut(); }
0140 
0141   /// Return non 0 if the track is a first track
0142   inline int isFirst() const { return _data.isFirst(); }
0143 
0144   /// Return the preview code
0145   inline int pvCode() const { return _data.pvCode(); }
0146 
0147   /// Return the preview K
0148   inline int pvK() const { return _data.pvK(); }
0149 
0150   /// Return the preview correaltion bit
0151   inline int pvCorr() const { return _data.pvCorr(); }
0152 
0153   /// Return trigger K parameter
0154   inline int K() const { return _data.K(); }
0155 
0156   /// Return trigger X parameter
0157   inline int X() const { return _data.X(); }
0158 
0159   /// Return trigger K parameter converted to angle
0160   inline int psi() const { return _data.psi(); }
0161 
0162   /// Return trigger X parameter converted to angle
0163   inline int psiR() const { return _data.psiR(); }
0164 
0165   /// Return DeltaPsiR
0166   inline int DeltaPsiR() const { return _data.DeltaPsiR(); }
0167 
0168   /// Return the trigger code in new format
0169   inline int qdec() const { return _data.qdec(); }
0170 
0171   /// Return the BTI Triggers list
0172   std::vector<const DTBtiTrigData *> btiTrigList() const { return _btitrig; }
0173 
0174   /// comparison operator
0175   bool operator==(const DTTracoTrig &) const;
0176 
0177 private:
0178   // parent TRACO
0179   DTTracoChip *_tparent;
0180 
0181   // Trigger data component
0182   DTTracoTrigData _data;
0183 
0184   // vector of BTI triggers which produce the DTTracoChip trigger (1 or 2)
0185   std::vector<const DTBtiTrigData *> _btitrig;
0186 };
0187 
0188 #endif