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 ( 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 {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const double theVPropWire
DTTTrigSyncTOFCorr::~DTTTrigSyncTOFCorr ( )
override

Destructor.

Definition at line 36 of file DTTTrigSyncTOFCorr.cc.

36 {}

Member Function Documentation

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.

References createfilelist::int, theBXspace, and theTTrig.

109  {
110  tTrig = theTTrig;
111  t0cell = 0.;
112 
113  return int(tTrig / theBXspace) * theBXspace;
114 }
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.

References DTTopology::cellLenght(), relativeConstraints::chamber, DTLayer::chamber(), gather_cfg::cout, debug, Exception, PV3DBase< T, PVType, FrameType >::mag(), mag(), GloballyPositioned< T >::position(), DTLayer::specificTopology(), GeomDet::surface(), theTOFCorrType, theVPropWire, GeomDet::toGlobal(), GeomDet::toLocal(), DTWireId::wire(), DTTopology::wirePosition(), and PV3DBase< T, PVType, FrameType >::y().

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 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
const double theVPropWire
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
T mag() const
Definition: PV3DBase.h:67
int wire() const
Return the wire number.
Definition: DTWireId.h:56
const DTChamber * chamber() const
Definition: DTLayer.cc:58
double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globPos, double &tTrig, double &wirePropCorr, double &tofCorr) const override
float cellLenght() const
Definition: DTTopology.h:73
const PositionType & position() const
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.

References theTTrig.

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 }
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.

References PFRecoTauDiscriminationByIsolation_cfi::offset.

59 {}

Member Data Documentation

const bool DTTTrigSyncTOFCorr::debug
private
double DTTTrigSyncTOFCorr::theBXspace
private

Definition at line 105 of file DTTTrigSyncTOFCorr.h.

Referenced by emulatorOffset().

const int DTTTrigSyncTOFCorr::theTOFCorrType
private

Definition at line 100 of file DTTTrigSyncTOFCorr.h.

Referenced by offset().

const double DTTTrigSyncTOFCorr::theTTrig
private

Definition at line 87 of file DTTTrigSyncTOFCorr.h.

Referenced by emulatorOffset(), and offset().

const double DTTTrigSyncTOFCorr::theVPropWire
private

Definition at line 92 of file DTTTrigSyncTOFCorr.h.

Referenced by offset().