CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTTTrigSyncTOFCorr Class Reference

#include <DTTTrigSyncTOFCorr.h>

Inheritance diagram for DTTTrigSyncTOFCorr:
DTTTrigBaseSync

Public Member Functions

 DTTTrigSyncTOFCorr (const edm::ParameterSet &config)
 Constructor. More...
 
double emulatorOffset (const DTWireId &wireId, double &tTrig, double &t0cell) const override
 
double offset (const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globPos, double &tTrig, double &wirePropCorr, double &tofCorr) const override
 
double offset (const DTWireId &wireId) const override
 
void setES (const edm::EventSetup &setup) override
 Pass the Event Setup to the algo at each event. More...
 
 ~DTTTrigSyncTOFCorr () override
 Destructor. More...
 
- Public Member Functions inherited from DTTTrigBaseSync
 DTTTrigBaseSync ()
 Constructor. More...
 
virtual double emulatorOffset (const DTWireId &wireId) const
 
double offset (const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globalPos) const
 
virtual ~DTTTrigBaseSync ()
 Destructor. More...
 

Private Attributes

const bool debug
 
double theBXspace
 
const int theTOFCorrType
 
const double theTTrig
 
const double theVPropWire
 

Detailed Description

Concrete implementation of a DTTTrigBaseSync. This class define the offsets for RecHit building coherently to the digitization realized with the DTDigiSyncTOFCorr module. The offset is computes as:
offset = tTrig + wirePropCorr - tofCorr
where:

The emulatorOffset is computed as:
offset = int(ttrig/BXspace)*BXspace
where:

NOTE: this should approximate what is seen online by the BTI

Author
G. Cerminara - INFN Torino

Definition at line 48 of file DTTTrigSyncTOFCorr.h.

Constructor & Destructor Documentation

◆ DTTTrigSyncTOFCorr()

DTTTrigSyncTOFCorr::DTTTrigSyncTOFCorr ( const edm::ParameterSet config)

Constructor.

Definition at line 18 of file DTTTrigSyncTOFCorr.cc.

19  : // The fixed t0 (or t_trig) to be subtracted to digi time (ns)
20  theTTrig(config.getParameter<double>("tTrig")), // FIXME: Default was 500 ns
21  // Velocity of signal propagation along the wire (cm/ns)
22  theVPropWire(config.getParameter<double>("vPropWire")), // FIXME: Default was 24.4 cm/ns
23  // Select the mode for TOF correction:
24  // 0: tofCorr = TOF from IP to 3D Hit position (globPos)
25  // 1: tofCorr = TOF correction for distance difference
26  // between 3D center of the chamber and hit position
27  // (default)
28  // 2: tofCorr = TOF correction for distance difference
29  // between 3D center of the wire and hit position
30  // (This mode in available for backward compatibility)
31  theTOFCorrType(config.getParameter<int>("tofCorrType")), // FIXME: Default was 1
32  debug(config.getUntrackedParameter<bool>("debug")),
33  theBXspace(config.getUntrackedParameter<double>("bxSpace", 25.)) // spacing of BX in ns
34 {}

◆ ~DTTTrigSyncTOFCorr()

DTTTrigSyncTOFCorr::~DTTTrigSyncTOFCorr ( )
override

Destructor.

Definition at line 36 of file DTTTrigSyncTOFCorr.cc.

36 {}

Member Function Documentation

◆ emulatorOffset()

double DTTTrigSyncTOFCorr::emulatorOffset ( const DTWireId wireId,
double &  tTrig,
double &  t0cell 
) const
overridevirtual

Time (ns) to be subtracted to the digi time for emulation purposes It does not take into account TOF and signal propagation along the wire It also returns the different contributions separately:

  • tTrig is the offset (t_trig)
  • t0cell is the t0 from pulses (always 0 in this case)

Implements DTTTrigBaseSync.

Definition at line 109 of file DTTTrigSyncTOFCorr.cc.

109  {
110  tTrig = theTTrig;
111  t0cell = 0.;
112 
113  return int(tTrig / theBXspace) * theBXspace;
114 }

References createfilelist::int, theBXspace, theTTrig, and dttriganalyzer_cfi::tTrig.

◆ offset() [1/2]

double DTTTrigSyncTOFCorr::offset ( const DTLayer layer,
const DTWireId wireId,
const GlobalPoint globPos,
double &  tTrig,
double &  wirePropCorr,
double &  tofCorr 
) const
overridevirtual

Time (ns) to be subtracted to the digi time, Parameters are the layer and the wireId to which the digi is referred and the estimation of the 3D hit position (globPos) It also returns the different contributions separately:

  • tTrig is the offset (t_trig)
  • wirePropCorr is the delay for signal propagation along the wire
  • tofCorr is the correction due to the particle TOF

Implements DTTTrigBaseSync.

Definition at line 38 of file DTTTrigSyncTOFCorr.cc.

43  {
44  tTrig = offset(wireId);
45 
46  //Compute the time spent in signal propagation along wire.
47  // NOTE: the FE is always at y>0
48  float halfL = layer->specificTopology().cellLenght() / 2;
49  float wireCoord = layer->toLocal(globPos).y();
50  float propgL = halfL - wireCoord;
51  wirePropCorr = propgL / theVPropWire;
52 
53  // Compute TOF correction treating it accordingly to
54  // the tofCorrType card
55  float flightToHit = globPos.mag();
56  static const float cSpeed = 29.9792458; // cm/ns
57  tofCorr = 0.;
58  switch (theTOFCorrType) {
59  case 0: {
60  // In this mode the subtraction of the TOF from IP to
61  // estimate 3D hit digi position is done here
62  // (No correction is needed anymore)
63  tofCorr = -flightToHit / cSpeed;
64  break;
65  }
66  case 1: {
67  // Correction for TOF from the center of the chamber to hit position
68  const DTChamber* chamber = layer->chamber();
69  double flightToChamber = chamber->surface().position().mag();
70  tofCorr = (flightToChamber - flightToHit) / cSpeed;
71  break;
72  }
73  case 2: {
74  // TOF from 3D center of the wire to hit position
75  float flightToWire =
76  layer->toGlobal(LocalPoint(layer->specificTopology().wirePosition(wireId.wire()), 0., 0.)).mag();
77  tofCorr = (flightToWire - flightToHit) / cSpeed;
78  break;
79  }
80  default: {
81  throw cms::Exception("[DTTTrigSyncTOFCorr]")
82  << " Invalid parameter: tofCorrType = " << theTOFCorrType << std::endl;
83  break;
84  }
85  }
86 
87  if (debug) {
88  cout << "[DTTTrigSyncTOFCorr] Offset (ns): " << tTrig + wirePropCorr - tofCorr << endl
89  << " various contributions are: " << endl
90  << " tTrig (ns): " << tTrig << endl
91  << " Propagation along wire delay (ns): " << wirePropCorr << endl
92  << " TOF correction (ns): " << tofCorr << endl
93  << endl;
94  }
95  //The global offset is the sum of various contributions
96  return tTrig + wirePropCorr - tofCorr;
97 }

References relativeConstraints::chamber, gather_cfg::cout, debug, Exception, phase1PixelTopology::layer, PV3DBase< T, PVType, FrameType >::mag(), mag(), theTOFCorrType, theVPropWire, dttriganalyzer_cfi::tTrig, and DTWireId::wire().

◆ offset() [2/2]

double DTTTrigSyncTOFCorr::offset ( const DTWireId wireId) const
overridevirtual

Time (ns) to be subtracted to the digi time. It does not take into account TOF and signal propagation along the wire

Implements DTTTrigBaseSync.

Definition at line 99 of file DTTTrigSyncTOFCorr.cc.

99  {
100  // Correction for the float to int conversion
101  // (half a bin on average) in DTDigi constructor
102  static const float f2i_convCorr = (25. / 64.); // ns
103  //FIXME: This should be considered only if the Digi is constructed from a float....
104 
105  // The tTrig is taken from a parameter
106  return theTTrig - f2i_convCorr;
107 }

References theTTrig.

◆ setES()

void DTTTrigSyncTOFCorr::setES ( const edm::EventSetup setup)
inlineoverridevirtual

Pass the Event Setup to the algo at each event.

Implements DTTTrigBaseSync.

Definition at line 59 of file DTTTrigSyncTOFCorr.h.

59 {}

Member Data Documentation

◆ debug

const bool DTTTrigSyncTOFCorr::debug
private

◆ theBXspace

double DTTTrigSyncTOFCorr::theBXspace
private

Definition at line 105 of file DTTTrigSyncTOFCorr.h.

Referenced by emulatorOffset().

◆ theTOFCorrType

const int DTTTrigSyncTOFCorr::theTOFCorrType
private

Definition at line 100 of file DTTTrigSyncTOFCorr.h.

Referenced by offset().

◆ theTTrig

const double DTTTrigSyncTOFCorr::theTTrig
private

Definition at line 87 of file DTTTrigSyncTOFCorr.h.

Referenced by emulatorOffset(), and offset().

◆ theVPropWire

const double DTTTrigSyncTOFCorr::theVPropWire
private

Definition at line 92 of file DTTTrigSyncTOFCorr.h.

Referenced by offset().

DTTTrigSyncTOFCorr::theTTrig
const double theTTrig
Definition: DTTTrigSyncTOFCorr.h:87
DTWireId::wire
int wire() const
Return the wire number.
Definition: DTWireId.h:42
dttriganalyzer_cfi.tTrig
tTrig
Definition: dttriganalyzer_cfi.py:11
DTTTrigSyncTOFCorr::theTOFCorrType
const int theTOFCorrType
Definition: DTTTrigSyncTOFCorr.h:100
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTChamber
Definition: DTChamber.h:24
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
config
Definition: config.py:1
DTTTrigSyncTOFCorr::theBXspace
double theBXspace
Definition: DTTTrigSyncTOFCorr.h:105
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
createfilelist.int
int
Definition: createfilelist.py:10
DTTTrigSyncTOFCorr::theVPropWire
const double theVPropWire
Definition: DTTTrigSyncTOFCorr.h:92
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
Exception
Definition: hltDiff.cc:245
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
DTTTrigSyncTOFCorr::offset
double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globPos, double &tTrig, double &wirePropCorr, double &tofCorr) const override
Definition: DTTTrigSyncTOFCorr.cc:38
DTTTrigSyncTOFCorr::debug
const bool debug
Definition: DTTTrigSyncTOFCorr.h:103