00001 //------------------------------------------------- 00002 // 00003 // Class: DTBtiHit 00004 // 00005 // Description: A class for hits in a drift cell 00006 // 00007 // 00008 // Author List: 00009 // C. Grandi 00010 // Modifications: 00011 // S. Vanini 00012 // 17/V/04 SV: tdrift in tdc units, phase is included!! 00013 // 22/VI/04 SV: last trigger code update 00014 // 05/II/07 SV: move setuptime to BtiCard 00015 //-------------------------------------------------- 00016 00017 //#include "Utilities/Configuration/interface/Architecture.h" 00018 00019 //----------------------- 00020 // This Class's Header -- 00021 //----------------------- 00022 #include "L1Trigger/DTBti/interface/DTBtiHit.h" 00023 00024 //------------------------------- 00025 // Collaborating Class Headers -- 00026 //------------------------------- 00027 #include <DataFormats/DTDigi/interface/DTDigiCollection.h> 00028 //#include "Utilities/UI/interface/SimpleConfigurable.h" 00029 //#include "Utilities/Notification/interface/Singleton.h" 00030 //#include "TestBeams/DTBXAnalysis/interface/DTBXCalibration.h" 00031 //--------------- 00032 // C++ Headers -- 00033 //--------------- 00034 00035 // Internal clock (time of a step: 12.5 ns or 16 tdc counts ==> 80 MHz) 00036 const float DTBtiHit::_stepTime = 12.5; 00037 const float DTBtiHit::_stepTimeTdc = 16.; 00038 //const float DTBtiHit::_stepTime = 6.25; 00039 00040 //SV only for TestBeam version 00041 //string DTBtiHit::t0envFlag = SimpleConfigurable<string>( " ", 00042 // "TestBeams:DTBXAnalysis:T0SetUpFlag" ); 00043 00044 //---------------- 00045 // Constructors -- 00046 //---------------- 00047 00048 DTBtiHit::DTBtiHit(const DTDigi* hitdigi, DTConfigBti* config) : 00049 _hitdigi(hitdigi), _config(config) { 00050 00051 //SV tdcunits 11V04: time in tdc units! setup time too! 00052 _curTime = hitdigi->countsTDC(); //@@ only DT>0 00053 00054 /* 00055 // *** ATTENTION FOR RUNNING TESTBEAM DATA *** 00056 // SV 26/IX/03 if digi are corrected with wire t0s in DTBXDigitizer 00057 // tdrift values must be corrected with t0 mean instead because 00058 // trigger hardware don't see cable length ! 00059 _curTime = hitdigi->countsTDC(); 00060 00061 if( t0envFlag != " " ){ 00062 DTBXCalibration* calibration = Singleton<DTBXCalibration>::instance(); 00063 //the following for digitization procedure.... see DTBXDigitizer 00064 int bmax = calibration->bitMax(); 00065 if ( _curTime >= ( bmax + calibration->recMin() ) ) 00066 _curTime -= bmax; 00067 00068 //SV tdcunits 11V04: add t0 and trig to have raw time in tdcunits 00069 _curTime += ( calibration->t0( hitdigi->slayer(), hitdigi->layer(), hitdigi->wire() ) 00070 + calibration->tTrig() ); 00071 00072 //tdc clocks in 16 units 00073 int delay16 = int( ( calibration->t0mean(hitdigi->slayer()) + 00074 calibration->tTrig() ) 00075 /_stepTimeTdc ); 00076 00077 //bti clocks of 16 tdc units 00078 _clockTime = (int)( (_curTime + 00079 _config->SetupTime())/_stepTimeTdc) - delay16; 00080 } 00081 00082 */ 00083 //bti clocks of 16 tdc units : first clock is number 1! 00084 //_clockTime = (int)( (_curTime + _config->SetupTime()) / _stepTimeTdc ) + 1; 00085 _clockTime = (int)( _curTime / _stepTimeTdc ) + 1; 00086 00087 } 00088 00089 DTBtiHit::DTBtiHit(int clockTime, DTConfigBti* config) : 00090 _config(config) { 00091 _clockTime = clockTime; 00092 _hitdigi = 0; 00093 _curTime = 4000; 00094 } 00095 00096 DTBtiHit::DTBtiHit(const DTBtiHit& hit) : 00097 _hitdigi(hit._hitdigi), _config(hit._config), _curTime(hit._curTime), 00098 _clockTime(hit._clockTime) { 00099 } 00100 00101 //-------------- 00102 // Destructor -- 00103 //-------------- 00104 DTBtiHit::~DTBtiHit() { 00105 } 00106 00107 //-------------- 00108 // Operations -- 00109 //-------------- 00110 00111 DTBtiHit & 00112 DTBtiHit::operator=(const DTBtiHit& hit){ 00113 if(this != &hit){ 00114 _hitdigi = hit._hitdigi; 00115 _config = hit._config; 00116 _curTime = hit._curTime; 00117 _clockTime = hit._clockTime; 00118 } 00119 return *this; 00120 }