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 //
19 //
20 //--------------------------------------------------
21 #ifndef DT_BTI_HIT_H
22 #define DT_BTI_HIT_H
23 
24 //------------------------------------
25 // Collaborating Class Declarations --
26 //------------------------------------
27 class DTDigi;
28 
29 //----------------------
30 // Base Class Headers --
31 //----------------------
34 
35 //---------------
36 // C++ Headers --
37 //---------------
38 #include<cmath>
39 #include<string>
40 
41 
42 // ---------------------
43 // -- Class Interface --
44 // ---------------------
45 
46 
47 class DTBtiHit {
48 
49  public:
50 
52  DTBtiHit(const DTDigi*, DTConfigBti*);
53 
56 
58  DTBtiHit(const DTBtiHit&);
59 
61  ~DTBtiHit();
62 
64  DTBtiHit & operator=(const DTBtiHit&);
65 
67  inline void stepDownTime() { //_curTime-=_stepTime;
68  _clockTime-=1;
69  }
70 
72  inline const DTDigi* hitDigi() const { return _hitdigi; }
73 
75 
79  inline float curTime() const { return _curTime; }
80  inline int clockTime() const { return _clockTime; }
81 
83  inline int isDrifting() const { //return _curTime>=0 && _curTime<4000;
84  return _clockTime>1 && _clockTime<400;
85  }
86 
88  //SV jtrig()=_config->ST() added: is for tdrift==0
89  inline int isInsideReg() const {
90  //return _curTime<0 && jtrig()<=_config->ST();
91  return ( _clockTime<=0 && jtrig()<=_config->ST() ); //SV bug fix 17XII03
92  }
93 
95  inline int jtrig() const {
96  //return (int)(fabs(_curTime)/_stepTime);
97  return -_clockTime;
98  }
99  //inline float jtrig() const { return fabs(_curTime)/_stepTime; } //prova SV
100  //SV 13/XI/02 half-int simulation added
101  /*inline float jtrig() const {
102  int idt = int(fabs(_curTime/_stepTime));
103  float rest = fmod( fabs(_curTime), _stepTime );
104  int irest = 0;
105  if(rest==0.0)
106  irest = 1;
107  else
108  irest = int( rest / (_stepTime*0.5) );
109  float jtrig_int4 = float(idt) + float(irest)*0.5;
110  return jtrig_int4;
111  }
112 */
113 
114 public:
115  static const float _stepTime;
116  static const float _stepTimeTdc;
117  static std::string t0envFlag;
118 
119 private:
120  const DTDigi* _hitdigi;
122  float _curTime;
124 };
125 
126 #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:121
DTBtiHit(const DTDigi *, DTConfigBti *)
Constructor.
Definition: DTBtiHit.cc:48
int clockTime() const
Definition: DTBtiHit.h:80
int _clockTime
Definition: DTBtiHit.h:123
static const float _stepTimeTdc
Definition: DTBtiHit.h:116
int isInsideReg() const
true if signal is in the registers
Definition: DTBtiHit.h:89
float _curTime
Definition: DTBtiHit.h:122
const DTDigi * hitDigi() const
Return the associated DTDigi.
Definition: DTBtiHit.h:72
int jtrig() const
position in registers
Definition: DTBtiHit.h:95
Definition: DTDigi.h:19
DTBtiHit & operator=(const DTBtiHit &)
Assignment operator.
Definition: DTBtiHit.cc:112
float curTime() const
Return the current time.
Definition: DTBtiHit.h:79
static std::string t0envFlag
Definition: DTBtiHit.h:117
static const float _stepTime
Definition: DTBtiHit.h:115
const DTDigi * _hitdigi
Definition: DTBtiHit.h:120
int isDrifting() const
true if avalanche is still drifting
Definition: DTBtiHit.h:83
void stepDownTime()
Move the hit forward in time one step.
Definition: DTBtiHit.h:67