Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:43

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTTracoCand
0004  *
0005  *   Implementation of DTTracoChip candidate
0006  *
0007  *
0008  *
0009  *   \author C. Grandi, S. Vanini
0010  *
0011  *   Modifications:
0012  *   S.V. store BtiTrig pointer instead of TrigData
0013  */
0014 //
0015 //--------------------------------------------------
0016 #ifndef DT_TRACO_CAND_H
0017 #define DT_TRACO_CAND_H
0018 
0019 //------------------------------------
0020 // Collaborating Class Declarations --
0021 //------------------------------------
0022 class DTBtiTrigData;
0023 class DTTracoChip;
0024 
0025 //----------------------
0026 // Base Class Headers --
0027 //----------------------
0028 #include "L1TriggerConfig/DTTPGConfig/interface/BitArray.h"
0029 
0030 //---------------
0031 // C++ Headers --
0032 //---------------
0033 
0034 //              ---------------------
0035 //              -- Class Interface --
0036 //              ---------------------
0037 
0038 class DTTracoCand {
0039 public:
0040   /// Constructor
0041   DTTracoCand() {}
0042 
0043   /// Constructor
0044   DTTracoCand(DTTracoChip *tc, const DTBtiTrigData *btitr, int pos, int step);
0045 
0046   /// Constructor
0047   DTTracoCand(const DTTracoCand &tccand);
0048 
0049   /// Assignment operator
0050   DTTracoCand &operator=(const DTTracoCand &tccand);
0051 
0052   /// Destructor
0053   ~DTTracoCand();
0054 
0055   /// set candidate used (unusable)
0056   inline void setUsed() { _usable = 0; }
0057 
0058   /// set candidate unused (usable)
0059   inline void setUnused() { _usable = 1; }
0060 
0061   /// set quality bits for first/second track
0062   void setBits(int itk);
0063 
0064   /// Return parent TRACO
0065   inline DTTracoChip *Traco() const { return _traco; }
0066 
0067   /// Return associated BTI trigger
0068   inline const DTBtiTrigData *BtiTrig() const { return _btitr; }
0069 
0070   /// Return Bunch crossing
0071   inline int step() const { return _step; }
0072 
0073   /// Return position inside TRACO
0074   inline int position() const { return _position; }
0075 
0076   /// Return K-KRAD
0077   inline int K() const { return _tcK; }
0078 
0079   /// Return local X coordinate
0080   inline int X() const { return _tcX; }
0081 
0082   /// Check if candidate is usable
0083   inline int usable() const { return _usable; }
0084 
0085   /// returns true if it has smaller K w.r.t. DTTracoChip center K (sort ascend)
0086   bool operator<(const DTTracoCand &c) const { return _tcK < c._tcK; }
0087   // bool operator < ( const DTTracoCand& c) const { return
0088   // _dataword<c._dataword; }
0089 
0090   /*
0091   /// returns true if it has smaller K w.r.t. DTTracoChip center K (sort ascend)
0092   inline bool closer ( const DTTracoCand& cand1, const DTTracoCand& cand2) const
0093   { return cand1<cand2;
0094   }
0095 
0096   /// return true if it has larger K w.r.t. DTTracoChip center K (sort descend)
0097   inline bool wider ( const DTTracoCand& cand1, const DTTracoCand& cand2) const
0098   { return cand2<cand1;
0099   }
0100   */
0101 
0102   /// Print candidate
0103   void print() const;
0104 
0105 private:
0106   DTTracoChip *_traco;  // Parent DTTracoChip
0107 
0108   const DTBtiTrigData *_btitr;  // Associated BTI trigger
0109 
0110   // Other variables
0111   BitArray<7> _dataword;  // the word on which sorting is done
0112   int _step;
0113   int _position;
0114   int _usable;
0115   int _tcX;
0116   int _tcK;
0117 };
0118 
0119 #endif