Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:40

0001 //-------------------------------------------------
0002 //
0003 //   Class: DTBtiHit
0004 //
0005 //   Description: A class for hits in a drift cell
0006 //
0007 //
0008 //   Author List:
0009 //   C. Grandi
0010 //   Modifications:
0011 //   S. Vanini
0012 //   17/V/04  SV: tdrift in tdc units, phase is included!!
0013 //   22/VI/04 SV: last trigger code update
0014 //   05/II/07 SV: move setuptime to BtiCard
0015 //--------------------------------------------------
0016 
0017 //#include "Utilities/Configuration/interface/Architecture.h"
0018 
0019 //-----------------------
0020 // This Class's Header --
0021 //-----------------------
0022 #include "L1Trigger/DTBti/interface/DTBtiHit.h"
0023 
0024 //-------------------------------
0025 // Collaborating Class Headers --
0026 //-------------------------------
0027 #include <DataFormats/DTDigi/interface/DTDigiCollection.h>
0028 //#include "Utilities/UI/interface/SimpleConfigurable.h"
0029 //#include "Utilities/Notification/interface/Singleton.h"
0030 //#include "TestBeams/DTBXAnalysis/interface/DTBXCalibration.h"
0031 //---------------
0032 // C++ Headers --
0033 //---------------
0034 
0035 // Internal clock (time of a step: 12.5 ns or 16 tdc counts ==> 80 MHz)
0036 const float DTBtiHit::_stepTime = 12.5;
0037 const float DTBtiHit::_stepTimeTdc = 16.;
0038 //const float DTBtiHit::_stepTime = 6.25;
0039 
0040 //SV only for TestBeam version
0041 //string DTBtiHit::t0envFlag = SimpleConfigurable<string>( " ",
0042 //                                  "TestBeams:DTBXAnalysis:T0SetUpFlag" );
0043 
0044 //----------------
0045 // Constructors --
0046 //----------------
0047 
0048 DTBtiHit::DTBtiHit(const DTDigi* hitdigi, DTConfigBti* config) : _hitdigi(hitdigi), _config(config) {
0049   //SV tdcunits 11V04: time in tdc units! setup time too!
0050   _curTime = hitdigi->countsTDC();  //@@ only DT>0
0051 
0052   /*
0053   // *** ATTENTION FOR RUNNING TESTBEAM DATA ***
0054   // SV 26/IX/03 if digi are corrected with wire t0s in DTBXDigitizer 
0055   // tdrift values must be corrected with  t0 mean instead because
0056   // trigger hardware don't see cable length !
0057   _curTime = hitdigi->countsTDC();
0058 
0059   if( t0envFlag != " " ){
0060     DTBXCalibration* calibration = Singleton<DTBXCalibration>::instance();
0061     //the following for digitization procedure.... see DTBXDigitizer
0062     int bmax = calibration->bitMax();
0063     if ( _curTime >= ( bmax + calibration->recMin() ) )
0064       _curTime -= bmax;
0065 
0066     //SV tdcunits 11V04: add t0 and trig to have raw time in tdcunits
0067     _curTime += (  calibration->t0( hitdigi->slayer(), hitdigi->layer(), hitdigi->wire() )
0068                  + calibration->tTrig() );
0069 
0070     //tdc clocks in 16 units
0071     int delay16 = int( ( calibration->t0mean(hitdigi->slayer()) +
0072                          calibration->tTrig() )
0073                        /_stepTimeTdc );
0074 
0075     //bti clocks of 16 tdc units
0076     _clockTime = (int)( (_curTime +
0077           _config->SetupTime())/_stepTimeTdc) - delay16;
0078 }
0079    
0080 */
0081   //bti clocks of 16 tdc units : first clock is number 1!
0082   //_clockTime = (int)( (_curTime + _config->SetupTime()) / _stepTimeTdc ) + 1;
0083   _clockTime = (int)(_curTime / _stepTimeTdc) + 1;
0084 }
0085 
0086 DTBtiHit::DTBtiHit(int clockTime, DTConfigBti* config) : _config(config) {
0087   _clockTime = clockTime;
0088   _hitdigi = nullptr;
0089   _curTime = 4000;
0090 }
0091 
0092 DTBtiHit::DTBtiHit(const DTBtiHit& hit)
0093     : _hitdigi(hit._hitdigi), _config(hit._config), _curTime(hit._curTime), _clockTime(hit._clockTime) {}
0094 
0095 //--------------
0096 // Destructor --
0097 //--------------
0098 DTBtiHit::~DTBtiHit() {}
0099 
0100 //--------------
0101 // Operations --
0102 //--------------
0103 
0104 DTBtiHit& DTBtiHit::operator=(const DTBtiHit& hit) {
0105   if (this != &hit) {
0106     _hitdigi = hit._hitdigi;
0107     _config = hit._config;
0108     _curTime = hit._curTime;
0109     _clockTime = hit._clockTime;
0110   }
0111   return *this;
0112 }