CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTBtiHit.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTBtiHit
4 //
5 // Description: A class for hits in a drift cell
6 //
7 //
8 // Author List:
9 // C. Grandi
10 // Modifications:
11 // S. Vanini
12 // 17/V/04 SV: tdrift in tdc units, phase is included!!
13 // 22/VI/04 SV: last trigger code update
14 // 05/II/07 SV: move setuptime to BtiCard
15 //--------------------------------------------------
16 
17 //#include "Utilities/Configuration/interface/Architecture.h"
18 
19 //-----------------------
20 // This Class's Header --
21 //-----------------------
23 
24 //-------------------------------
25 // Collaborating Class Headers --
26 //-------------------------------
28 //#include "Utilities/UI/interface/SimpleConfigurable.h"
29 //#include "Utilities/Notification/interface/Singleton.h"
30 //#include "TestBeams/DTBXAnalysis/interface/DTBXCalibration.h"
31 //---------------
32 // C++ Headers --
33 //---------------
34 
35 // Internal clock (time of a step: 12.5 ns or 16 tdc counts ==> 80 MHz)
36 const float DTBtiHit::_stepTime = 12.5;
37 const float DTBtiHit::_stepTimeTdc = 16.;
38 //const float DTBtiHit::_stepTime = 6.25;
39 
40 //SV only for TestBeam version
41 //string DTBtiHit::t0envFlag = SimpleConfigurable<string>( " ",
42 // "TestBeams:DTBXAnalysis:T0SetUpFlag" );
43 
44 //----------------
45 // Constructors --
46 //----------------
47 
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 }
88 
90  _config(config) {
92  _hitdigi = 0;
93  _curTime = 4000;
94 }
95 
97  _hitdigi(hit._hitdigi), _config(hit._config), _curTime(hit._curTime),
98  _clockTime(hit._clockTime) {
99 }
100 
101 //--------------
102 // Destructor --
103 //--------------
105 }
106 
107 //--------------
108 // Operations --
109 //--------------
110 
111 DTBtiHit &
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 }
~DTBtiHit()
Destructor.
Definition: DTBtiHit.cc:104
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
float _curTime
Definition: DTBtiHit.h:122
Definition: DTDigi.h:19
uint32_t countsTDC() const
Get raw TDC count.
Definition: DTDigi.cc:67
DTBtiHit & operator=(const DTBtiHit &)
Assignment operator.
Definition: DTBtiHit.cc:112
static const float _stepTime
Definition: DTBtiHit.h:115
tuple config
Definition: cmsDriver.py:17
const DTDigi * _hitdigi
Definition: DTBtiHit.h:120