CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTBtiHit.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
17 //
18 //--------------------------------------------------
19 #ifndef DT_BTI_HIT_H
20 #define DT_BTI_HIT_H
21 
22 //------------------------------------
23 // Collaborating Class Declarations --
24 //------------------------------------
25 class DTDigi;
26 
27 //----------------------
28 // Base Class Headers --
29 //----------------------
32 
33 //---------------
34 // C++ Headers --
35 //---------------
36 #include<cmath>
37 #include<string>
38 
39 
40 // ---------------------
41 // -- Class Interface --
42 // ---------------------
43 
44 
45 class DTBtiHit {
46 
47  public:
48 
50  DTBtiHit(const DTDigi*, DTConfigBti*);
51 
54 
56  DTBtiHit(const DTBtiHit&);
57 
59  ~DTBtiHit();
60 
62  DTBtiHit & operator=(const DTBtiHit&);
63 
65  inline void stepDownTime() { //_curTime-=_stepTime;
66  _clockTime-=1;
67  }
68 
70  inline const DTDigi* hitDigi() const { return _hitdigi; }
71 
73 
77  inline float curTime() const { return _curTime; }
78  inline int clockTime() const { return _clockTime; }
79 
81  inline int isDrifting() const { //return _curTime>=0 && _curTime<4000;
82  return _clockTime>1 && _clockTime<400;
83  }
84 
86  //SV jtrig()=_config->ST() added: is for tdrift==0
87  inline int isInsideReg() const {
88  //return _curTime<0 && jtrig()<=_config->ST();
89  return ( _clockTime<=0 && jtrig()<=_config->ST() ); //SV bug fix 17XII03
90  }
91 
93  inline int jtrig() const {
94  //return (int)(fabs(_curTime)/_stepTime);
95  return -_clockTime;
96  }
97  //inline float jtrig() const { return fabs(_curTime)/_stepTime; } //prova SV
98  //SV 13/XI/02 half-int simulation added
99  /*inline float jtrig() const {
100  int idt = int(fabs(_curTime/_stepTime));
101  float rest = fmod( fabs(_curTime), _stepTime );
102  int irest = 0;
103  if(rest==0.0)
104  irest = 1;
105  else
106  irest = int( rest / (_stepTime*0.5) );
107  float jtrig_int4 = float(idt) + float(irest)*0.5;
108  return jtrig_int4;
109  }
110 */
111 
112 public:
113  static const float _stepTime;
114  static const float _stepTimeTdc;
116 
117 private:
118  const DTDigi* _hitdigi;
120  float _curTime;
122 };
123 
124 #endif
~DTBtiHit()
Destructor.
Definition: DTBtiHit.cc:104
float ST() const
Max drift time in 12.5 ns steps.
Definition: DTConfigBti.h:65
DTConfigBti * _config
Definition: DTBtiHit.h:119
DTBtiHit(const DTDigi *, DTConfigBti *)
Constructor.
Definition: DTBtiHit.cc:48
int clockTime() const
Definition: DTBtiHit.h:78
int _clockTime
Definition: DTBtiHit.h:121
static const float _stepTimeTdc
Definition: DTBtiHit.h:114
int isInsideReg() const
true if signal is in the registers
Definition: DTBtiHit.h:87
float _curTime
Definition: DTBtiHit.h:120
const DTDigi * hitDigi() const
Return the associated DTDigi.
Definition: DTBtiHit.h:70
int jtrig() const
position in registers
Definition: DTBtiHit.h:93
Definition: DTDigi.h:17
DTBtiHit & operator=(const DTBtiHit &)
Assignment operator.
Definition: DTBtiHit.cc:112
float curTime() const
Return the current time.
Definition: DTBtiHit.h:77
static std::string t0envFlag
Definition: DTBtiHit.h:115
static const float _stepTime
Definition: DTBtiHit.h:113
const DTDigi * _hitdigi
Definition: DTBtiHit.h:118
int isDrifting() const
true if avalanche is still drifting
Definition: DTBtiHit.h:81
void stepDownTime()
Move the hit forward in time one step.
Definition: DTBtiHit.h:65