CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Private Attributes

DTBtiHit Class Reference

#include <DTBtiHit.h>

List of all members.

Public Member Functions

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

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

Date:
2008/06/30 13:41:36
Revision:
1.6
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 47 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().

                                                             :
  _hitdigi(hitdigi), _config(config) {

  //SV tdcunits 11V04: time in tdc units! setup time too!
  _curTime = hitdigi->countsTDC(); //@@ only DT>0

/*
  // *** ATTENTION FOR RUNNING TESTBEAM DATA ***
  // SV 26/IX/03 if digi are corrected with wire t0s in DTBXDigitizer 
  // tdrift values must be corrected with  t0 mean instead because
  // trigger hardware don't see cable length !
  _curTime = hitdigi->countsTDC();

  if( t0envFlag != " " ){
    DTBXCalibration* calibration = Singleton<DTBXCalibration>::instance();
    //the following for digitization procedure.... see DTBXDigitizer
    int bmax = calibration->bitMax();
    if ( _curTime >= ( bmax + calibration->recMin() ) )
      _curTime -= bmax;

    //SV tdcunits 11V04: add t0 and trig to have raw time in tdcunits
    _curTime += (  calibration->t0( hitdigi->slayer(), hitdigi->layer(), hitdigi->wire() )
                 + calibration->tTrig() );

    //tdc clocks in 16 units
    int delay16 = int( ( calibration->t0mean(hitdigi->slayer()) +
                         calibration->tTrig() )
                       /_stepTimeTdc );

    //bti clocks of 16 tdc units
    _clockTime = (int)( (_curTime +
          _config->SetupTime())/_stepTimeTdc) - delay16;
}
   
*/
  //bti clocks of 16 tdc units : first clock is number 1!
  //_clockTime = (int)( (_curTime + _config->SetupTime()) / _stepTimeTdc ) + 1;
  _clockTime = (int)( _curTime  / _stepTimeTdc ) + 1;

}
DTBtiHit::DTBtiHit ( int  clockTime,
DTConfigBti config 
)

Constructor from clock times.

Definition at line 89 of file DTBtiHit.cc.

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

                                                     :
  _config(config) {
  _clockTime = clockTime;
  _hitdigi = 0;
  _curTime = 4000;
}
DTBtiHit::DTBtiHit ( const DTBtiHit hit)

Copy constructor.

Definition at line 96 of file DTBtiHit.cc.

DTBtiHit::~DTBtiHit ( )

Destructor.

Definition at line 104 of file DTBtiHit.cc.

                    {
}

Member Function Documentation

int DTBtiHit::clockTime ( ) const [inline]

Definition at line 80 of file DTBtiHit.h.

References _clockTime.

Referenced by DTBtiHit().

{ return _clockTime; }
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 79 of file DTBtiHit.h.

References _curTime.

Referenced by DTBtiChip::tick().

{ return _curTime; }
const DTDigi* DTBtiHit::hitDigi ( ) const [inline]

Return the associated DTDigi.

Definition at line 72 of file DTBtiHit.h.

References _hitdigi.

Referenced by DTBtiChip::store().

{ return _hitdigi; }
int DTBtiHit::isDrifting ( ) const [inline]

true if avalanche is still drifting

Definition at line 83 of file DTBtiHit.h.

References _clockTime.

                                { //return _curTime>=0 && _curTime<4000; 
                                  return _clockTime>1 && _clockTime<400; 
  }
int DTBtiHit::isInsideReg ( ) const [inline]

true if signal is in the registers

Definition at line 89 of file DTBtiHit.h.

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

                                 {
    //return _curTime<0 && jtrig()<=_config->ST();
    return ( _clockTime<=0 && jtrig()<=_config->ST() );      //SV bug fix 17XII03
  }
int DTBtiHit::jtrig ( ) const [inline]

position in registers

Definition at line 95 of file DTBtiHit.h.

References _clockTime.

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

                           { 
                             //return (int)(fabs(_curTime)/_stepTime); 
                              return -_clockTime;
                            }
DTBtiHit & DTBtiHit::operator= ( const DTBtiHit hit)

Assignment operator.

Definition at line 112 of file DTBtiHit.cc.

References _clockTime, _config, _curTime, and _hitdigi.

                                      {
  if(this != &hit){
    _hitdigi = hit._hitdigi;
    _config = hit._config;
    _curTime = hit._curTime;
    _clockTime = hit._clockTime;
  }
  return *this;
}
void DTBtiHit::stepDownTime ( ) [inline]

Move the hit forward in time one step.

Definition at line 67 of file DTBtiHit.h.

References _clockTime.

                             { //_curTime-=_stepTime; 
                               _clockTime-=1; 
                              }

Member Data Documentation

int DTBtiHit::_clockTime [private]

Definition at line 123 of file DTBtiHit.h.

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

Definition at line 121 of file DTBtiHit.h.

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

float DTBtiHit::_curTime [private]

Definition at line 122 of file DTBtiHit.h.

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

const DTDigi* DTBtiHit::_hitdigi [private]

Definition at line 120 of file DTBtiHit.h.

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

const float DTBtiHit::_stepTime = 12.5 [static]

Definition at line 115 of file DTBtiHit.h.

const float DTBtiHit::_stepTimeTdc = 16. [static]

Definition at line 116 of file DTBtiHit.h.

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

std::string DTBtiHit::t0envFlag [static]

Definition at line 117 of file DTBtiHit.h.