CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes | Private Attributes
DTBtiHit Class Reference

#include <DTBtiHit.h>

Public Member Functions

int clockTime () const
 
float curTime () const
 Return the current time. More...
 
 DTBtiHit (const DTDigi *, DTConfigBti *)
 Constructor. More...
 
 DTBtiHit (int clockTime, DTConfigBti *)
 Constructor from clock times. More...
 
 DTBtiHit (const DTBtiHit &)
 Copy constructor. More...
 
const DTDigihitDigi () const
 Return the associated DTDigi. More...
 
int isDrifting () const
 true if avalanche is still drifting More...
 
int isInsideReg () const
 true if signal is in the registers More...
 
int jtrig () const
 position in registers More...
 
DTBtiHitoperator= (const DTBtiHit &)
 Assignment operator. More...
 
void stepDownTime ()
 Move the hit forward in time one step. More...
 
 ~DTBtiHit ()
 Destructor. More...
 

Static Public Attributes

static const float _stepTime = 12.5
 
static const float _stepTimeTdc = 16.
 
static std::string t0envFlag
 

Private Attributes

int _clockTime
 
DTConfigBti_config
 
float _curTime
 
const DTDigi_hitdigi
 

Detailed Description

A class for hits in a drift cell

Author
C. Grandi, S. Vanini Modifications: 28/X/02 S.Vanini: tshift=425 included in register 1/IV/03 SV time in clock units included: _clockTime –> operation with drift time are commented 22/VI/04 SV: last trigger code update 15/I/07 SV : new config update

Definition at line 45 of file DTBtiHit.h.

Constructor & Destructor Documentation

DTBtiHit::DTBtiHit ( const DTDigi hitdigi,
DTConfigBti config 
)

Constructor.

Definition at line 48 of file DTBtiHit.cc.

References _clockTime, _curTime, _stepTimeTdc, and DTDigi::countsTDC().

48  :
49  _hitdigi(hitdigi), _config(config) {
50 
51  //SV tdcunits 11V04: time in tdc units! setup time too!
52  _curTime = hitdigi->countsTDC(); //@@ only DT>0
53 
54 /*
55  // *** ATTENTION FOR RUNNING TESTBEAM DATA ***
56  // SV 26/IX/03 if digi are corrected with wire t0s in DTBXDigitizer
57  // tdrift values must be corrected with t0 mean instead because
58  // trigger hardware don't see cable length !
59  _curTime = hitdigi->countsTDC();
60 
61  if( t0envFlag != " " ){
62  DTBXCalibration* calibration = Singleton<DTBXCalibration>::instance();
63  //the following for digitization procedure.... see DTBXDigitizer
64  int bmax = calibration->bitMax();
65  if ( _curTime >= ( bmax + calibration->recMin() ) )
66  _curTime -= bmax;
67 
68  //SV tdcunits 11V04: add t0 and trig to have raw time in tdcunits
69  _curTime += ( calibration->t0( hitdigi->slayer(), hitdigi->layer(), hitdigi->wire() )
70  + calibration->tTrig() );
71 
72  //tdc clocks in 16 units
73  int delay16 = int( ( calibration->t0mean(hitdigi->slayer()) +
74  calibration->tTrig() )
75  /_stepTimeTdc );
76 
77  //bti clocks of 16 tdc units
78  _clockTime = (int)( (_curTime +
79  _config->SetupTime())/_stepTimeTdc) - delay16;
80 }
81 
82 */
83  //bti clocks of 16 tdc units : first clock is number 1!
84  //_clockTime = (int)( (_curTime + _config->SetupTime()) / _stepTimeTdc ) + 1;
85  _clockTime = (int)( _curTime / _stepTimeTdc ) + 1;
86 
87 }
DTConfigBti * _config
Definition: DTBtiHit.h:119
int _clockTime
Definition: DTBtiHit.h:121
static const float _stepTimeTdc
Definition: DTBtiHit.h:114
float _curTime
Definition: DTBtiHit.h:120
uint32_t countsTDC() const
Get raw TDC count.
Definition: DTDigi.cc:65
const DTDigi * _hitdigi
Definition: DTBtiHit.h:118
DTBtiHit::DTBtiHit ( int  clockTime,
DTConfigBti config 
)

Constructor from clock times.

Definition at line 89 of file DTBtiHit.cc.

References _clockTime, _curTime, _hitdigi, and clockTime().

89  :
90  _config(config) {
92  _hitdigi = 0;
93  _curTime = 4000;
94 }
DTConfigBti * _config
Definition: DTBtiHit.h:119
int clockTime() const
Definition: DTBtiHit.h:78
int _clockTime
Definition: DTBtiHit.h:121
float _curTime
Definition: DTBtiHit.h:120
const DTDigi * _hitdigi
Definition: DTBtiHit.h:118
DTBtiHit::DTBtiHit ( const DTBtiHit hit)

Copy constructor.

Definition at line 96 of file DTBtiHit.cc.

96  :
98  _clockTime(hit._clockTime) {
99 }
DTConfigBti * _config
Definition: DTBtiHit.h:119
int _clockTime
Definition: DTBtiHit.h:121
float _curTime
Definition: DTBtiHit.h:120
const DTDigi * _hitdigi
Definition: DTBtiHit.h:118
DTBtiHit::~DTBtiHit ( )

Destructor.

Definition at line 104 of file DTBtiHit.cc.

104  {
105 }

Member Function Documentation

int DTBtiHit::clockTime ( ) const
inline

Definition at line 78 of file DTBtiHit.h.

References _clockTime.

Referenced by DTBtiHit().

78 { return _clockTime; }
int _clockTime
Definition: DTBtiHit.h:121
float DTBtiHit::curTime ( ) const
inline

Return the current time.

hits with curTime >0 correspond to avalanches drifting to wires
                  <0      "     "  signals already in the registers

SV curTime=4000 if digis are given in clock units....

Definition at line 77 of file DTBtiHit.h.

References _curTime.

Referenced by DTBtiChip::tick().

77 { return _curTime; }
float _curTime
Definition: DTBtiHit.h:120
const DTDigi* DTBtiHit::hitDigi ( ) const
inline

Return the associated DTDigi.

Definition at line 70 of file DTBtiHit.h.

References _hitdigi.

Referenced by DTBtiChip::store().

70 { return _hitdigi; }
const DTDigi * _hitdigi
Definition: DTBtiHit.h:118
int DTBtiHit::isDrifting ( ) const
inline

true if avalanche is still drifting

Definition at line 81 of file DTBtiHit.h.

References _clockTime.

81  { //return _curTime>=0 && _curTime<4000;
82  return _clockTime>1 && _clockTime<400;
83  }
int _clockTime
Definition: DTBtiHit.h:121
int DTBtiHit::isInsideReg ( ) const
inline

true if signal is in the registers

Definition at line 87 of file DTBtiHit.h.

References _clockTime, _config, jtrig(), and DTConfigBti::ST().

87  {
88  //return _curTime<0 && jtrig()<=_config->ST();
89  return ( _clockTime<=0 && jtrig()<=_config->ST() ); //SV bug fix 17XII03
90  }
float ST() const
Max drift time in 12.5 ns steps.
Definition: DTConfigBti.h:65
DTConfigBti * _config
Definition: DTBtiHit.h:119
int _clockTime
Definition: DTBtiHit.h:121
int jtrig() const
position in registers
Definition: DTBtiHit.h:93
int DTBtiHit::jtrig ( ) const
inline

position in registers

Definition at line 93 of file DTBtiHit.h.

References _clockTime.

Referenced by isInsideReg(), and DTBtiChip::tick().

93  {
94  //return (int)(fabs(_curTime)/_stepTime);
95  return -_clockTime;
96  }
int _clockTime
Definition: DTBtiHit.h:121
DTBtiHit & DTBtiHit::operator= ( const DTBtiHit hit)

Assignment operator.

Definition at line 112 of file DTBtiHit.cc.

References _clockTime, _config, _curTime, and _hitdigi.

112  {
113  if(this != &hit){
114  _hitdigi = hit._hitdigi;
115  _config = hit._config;
116  _curTime = hit._curTime;
117  _clockTime = hit._clockTime;
118  }
119  return *this;
120 }
DTConfigBti * _config
Definition: DTBtiHit.h:119
int _clockTime
Definition: DTBtiHit.h:121
float _curTime
Definition: DTBtiHit.h:120
const DTDigi * _hitdigi
Definition: DTBtiHit.h:118
void DTBtiHit::stepDownTime ( )
inline

Move the hit forward in time one step.

Definition at line 65 of file DTBtiHit.h.

References _clockTime.

65  { //_curTime-=_stepTime;
66  _clockTime-=1;
67  }
int _clockTime
Definition: DTBtiHit.h:121

Member Data Documentation

int DTBtiHit::_clockTime
private

Definition at line 121 of file DTBtiHit.h.

Referenced by clockTime(), DTBtiHit(), isDrifting(), isInsideReg(), jtrig(), operator=(), and stepDownTime().

DTConfigBti* DTBtiHit::_config
private

Definition at line 119 of file DTBtiHit.h.

Referenced by isInsideReg(), and operator=().

float DTBtiHit::_curTime
private

Definition at line 120 of file DTBtiHit.h.

Referenced by curTime(), DTBtiHit(), and operator=().

const DTDigi* DTBtiHit::_hitdigi
private

Definition at line 118 of file DTBtiHit.h.

Referenced by DTBtiHit(), hitDigi(), and operator=().

const float DTBtiHit::_stepTime = 12.5
static

Definition at line 113 of file DTBtiHit.h.

const float DTBtiHit::_stepTimeTdc = 16.
static

Definition at line 114 of file DTBtiHit.h.

Referenced by DTBtiChip::add_digi(), and DTBtiHit().

std::string DTBtiHit::t0envFlag
static

Definition at line 115 of file DTBtiHit.h.