CMS 3D CMS Logo

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

#include <DTLinearDriftAlgo.h>

Inheritance diagram for DTLinearDriftAlgo:
DTRecHitBaseAlgo

Public Member Functions

bool compute (const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override
 
bool compute (const DTLayer *layer, const DTRecHit1D &recHit1D, const float &angle, DTRecHit1D &newHit1D) const override
 
bool compute (const DTLayer *layer, const DTRecHit1D &recHit1D, const float &angle, const GlobalPoint &globPos, DTRecHit1D &newHit1D) const override
 
 DTLinearDriftAlgo (const edm::ParameterSet &config, edm::ConsumesCollector)
 Constructor. More...
 
void setES (const edm::EventSetup &setup) override
 Pass the Event Setup to the algo at each event. More...
 
 ~DTLinearDriftAlgo () override
 Destructor. More...
 
- Public Member Functions inherited from DTRecHitBaseAlgo
 DTRecHitBaseAlgo (const edm::ParameterSet &config, edm::ConsumesCollector)
 Constructor. More...
 
virtual edm::OwnVector< DTRecHit1DPairreconstruct (const DTLayer *layer, const DTLayerId &layerId, const DTDigiCollection::Range &digiRange)
 Build all hits in the range associated to the layerId, at the 1st step. More...
 
virtual ~DTRecHitBaseAlgo ()
 Destructor. More...
 

Private Member Functions

virtual bool compute (const DTLayer *layer, const DTWireId &wireId, const float digiTime, const GlobalPoint &globPos, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error, int step) const
 
virtual bool compute (const DTLayer *layer, const DTWireId &wireId, const float digiTime, const GlobalPoint &globPos, DTRecHit1D &newHit1D, int step) const
 

Private Attributes

const bool debug
 
const float hitResolution
 
const float maxTime
 
const float minTime
 
const float vDrift
 

Additional Inherited Members

- Protected Attributes inherited from DTRecHitBaseAlgo
std::unique_ptr< DTTTrigBaseSynctheSync
 

Detailed Description

Concrete implementation of DTRecHitBaseAlgo. Compute drift distance using constant drift velocity as defined in the "driftVelocity" parameter.

Author
G. Cerminara - INFN Torino

Definition at line 15 of file DTLinearDriftAlgo.h.

Constructor & Destructor Documentation

◆ DTLinearDriftAlgo()

DTLinearDriftAlgo::DTLinearDriftAlgo ( const edm::ParameterSet config,
edm::ConsumesCollector  cc 
)

Constructor.

Definition at line 19 of file DTLinearDriftAlgo.cc.

21  // Get the Drift Velocity from parameter set.
22  vDrift(config.getParameter<double>("driftVelocity")), // FIXME: Default was 0.00543 cm/ns
23  hitResolution(config.getParameter<double>("hitResolution")), // FIXME: Default is
24  // vDriftMB1W1(config.getParameter<double>("driftVelocityMB1W1")), // FIXME: Default was 0.00543 cm/ns
25  minTime(config.getParameter<double>("minTime")), // FIXME: Default was -3 ns
26  maxTime(config.getParameter<double>("maxTime")), // FIXME: Default was 415 ns
27  // Set verbose output
28  debug(config.getUntrackedParameter<bool>("debug")) {}
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
Definition: config.py:1
DTRecHitBaseAlgo(const edm::ParameterSet &config, edm::ConsumesCollector)
Constructor.
const float hitResolution

◆ ~DTLinearDriftAlgo()

DTLinearDriftAlgo::~DTLinearDriftAlgo ( )
override

Destructor.

Definition at line 30 of file DTLinearDriftAlgo.cc.

30 {}

Member Function Documentation

◆ compute() [1/5]

bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTDigi digi,
LocalPoint leftPoint,
LocalPoint rightPoint,
LocalError error 
) const
overridevirtual

First step in computation of Left/Right hits from a Digi. The results are the local position (in DTLayer frame) of the Left and Right hit, and the error (which is common). Returns false on failure. The hit is assumed to be at the wire center.

Implements DTRecHitBaseAlgo.

Definition at line 35 of file DTLinearDriftAlgo.cc.

References relativeConstraints::error, nano_mu_digi_cff::layer, DTDigi::time(), and DTDigi::wire().

Referenced by compute().

36  {
37  // Get the wireId
38  DTLayerId layerId = layer->id();
39  const DTWireId wireId(layerId, digi.wire());
40 
41  // Get Wire position
42  if (!layer->specificTopology().isWireValid(digi.wire()))
43  return false;
44  LocalPoint locWirePos(layer->specificTopology().wirePosition(digi.wire()), 0, 0);
45  const GlobalPoint globWirePos = layer->toGlobal(locWirePos);
46 
47  return compute(layer, wireId, digi.time(), globWirePos, leftPoint, rightPoint, error, 1);
48 }
int wire() const
Return wire number.
Definition: DTDigi.cc:41
double time() const
Get time in ns.
Definition: DTDigi.cc:37
bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override

◆ compute() [2/5]

bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTRecHit1D recHit1D,
const float &  angle,
DTRecHit1D newHit1D 
) const
overridevirtual

Second step in hit position computation. It is the same as first step since the angular information is not used NOTE: Only position and error of the new hit are modified

Implements DTRecHitBaseAlgo.

Definition at line 51 of file DTLinearDriftAlgo.cc.

References DTRecHit1D::localPosition(), DTRecHit1D::localPositionError(), and DTRecHit1D::setPositionAndError().

54  {
55  newHit1D.setPositionAndError(recHit1D.localPosition(), recHit1D.localPositionError());
56  return true;
57 }
LocalError localPositionError() const override
Return the 3-dimensional error on the local position.
Definition: DTRecHit1D.h:50
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
Definition: DTRecHit1D.h:70
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47

◆ compute() [3/5]

bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTRecHit1D recHit1D,
const float &  angle,
const GlobalPoint globPos,
DTRecHit1D newHit1D 
) const
overridevirtual

Third (and final) step in hits position computation. Also the hit position along the wire is available and can be used to correct the drift time for particle TOF and propagation of signal along the wire. NOTE: Only position and error of the new hit are modified

Implements DTRecHitBaseAlgo.

Definition at line 60 of file DTLinearDriftAlgo.cc.

References compute(), DTRecHit1D::digiTime(), nano_mu_digi_cff::layer, and DTRecHit1D::wireId().

64  {
65  return compute(layer, recHit1D.wireId(), recHit1D.digiTime(), globPos, newHit1D, 3);
66 }
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
Definition: DTRecHit1D.h:79
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:76
bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override

◆ compute() [4/5]

bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTWireId wireId,
const float  digiTime,
const GlobalPoint globPos,
LocalPoint leftPoint,
LocalPoint rightPoint,
LocalError error,
int  step 
) const
privatevirtual

Definition at line 69 of file DTLinearDriftAlgo.cc.

References gather_cfg::cout, debug, shallow::drift(), relativeConstraints::error, hitResolution, nano_mu_digi_cff::layer, maxTime, DTRecHitBaseAlgo::theSync, vDrift, DTWireId::wire(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

76  {
77  // Subtract the offset to the digi time accordingly to the DTTTrigBaseSync concrete instance
78  float driftTime = digiTime - theSync->offset(layer, wireId, globPos);
79 
80  // check for out-of-time
81  if (driftTime < minTime || driftTime > maxTime) {
82  if (debug)
83  cout << "[DTLinearDriftAlgo]*** Drift time out of window for in-time hits " << driftTime << endl;
84 
85  if (step == 1) { //FIXME: protection against failure at 2nd and 3rd steps, must be checked!!!
86  // Hits are interpreted as coming from out-of-time pile-up and recHit
87  // is ignored.
88  return false;
89  }
90  }
91 
92  // Small negative times interpreted as hits close to the wire.
93  if (driftTime < 0.)
94  driftTime = 0;
95 
96  // Compute the drift distance
97  // SL 21-Dec-2006: Use specific Drift for MB1W1 (non fluxed chamber)
98  float vd = vDrift;
99  // if (wireId.wheel()==1 && wireId.station()==1) {
100  // vd=vDriftMB1W1;
101  // //cout << "Using Vd " << vd<< endl;
102  // }
103 
104  float drift = driftTime * vd;
105 
106  // Get Wire position
107  if (!layer->specificTopology().isWireValid(wireId.wire()))
108  return false;
109  LocalPoint locWirePos(layer->specificTopology().wirePosition(wireId.wire()), 0, 0);
110  //Build the two possible points and the error on the position
111  leftPoint = LocalPoint(locWirePos.x() - drift, locWirePos.y(), locWirePos.z());
112  rightPoint = LocalPoint(locWirePos.x() + drift, locWirePos.y(), locWirePos.z());
114 
115  if (debug) {
116  cout << "[DTLinearDriftAlgo] Compute drift distance, for digi at wire: " << wireId << endl
117  << " Step: " << step << endl
118  << " Digi time: " << digiTime << endl
119  << " Drift time: " << driftTime << endl
120  << " Drift distance: " << drift << endl
121  << " Hit Resolution: " << hitResolution << endl
122  << " Left point: " << leftPoint << endl
123  << " Right point: " << rightPoint << endl
124  << " Error: " << error << endl;
125  }
126 
127  return true;
128 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
int wire() const
Return the wire number.
Definition: DTWireId.h:45
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
T y() const
Definition: PV3DBase.h:60
std::vector< DeviationSensor2D * > vd
const float hitResolution
std::unique_ptr< DTTTrigBaseSync > theSync
step
Definition: StallMonitor.cc:83

◆ compute() [5/5]

bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTWireId wireId,
const float  digiTime,
const GlobalPoint globPos,
DTRecHit1D newHit1D,
int  step 
) const
privatevirtual

Definition at line 131 of file DTLinearDriftAlgo.cc.

References compute(), relativeConstraints::error, Exception, nano_mu_digi_cff::layer, DTEnums::Left, DTRecHit1D::localPosition(), DTRecHit1D::lrSide(), DTEnums::Right, DTRecHit1D::setPositionAndError(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

136  {
137  LocalPoint leftPoint;
138  LocalPoint rightPoint;
140 
141  if (compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) {
142  // Set the position and the error of the rechit which is being updated
143  switch (newHit1D.lrSide()) {
144  case DTEnums::Left: {
145  // Keep the original y position of newHit1D: for step==3, it's the
146  // position along the wire. Needed for rotation alignment
147  LocalPoint leftPoint3D(leftPoint.x(), newHit1D.localPosition().y(), leftPoint.z());
148  newHit1D.setPositionAndError(leftPoint3D, error);
149  break;
150  }
151 
152  case DTEnums::Right: {
153  // as above: 3d position
154  LocalPoint rightPoint3D(rightPoint.x(), newHit1D.localPosition().y(), rightPoint.z());
155  newHit1D.setPositionAndError(rightPoint3D, error);
156  break;
157  }
158 
159  default:
160  throw cms::Exception("InvalidDTCellSide") << "[DTLinearDriftAlgo] Compute at Step " << step << ", Hit side "
161  << newHit1D.lrSide() << " is invalid!" << endl;
162  return false;
163  }
164 
165  return true;
166  } else {
167  return false;
168  }
169 }
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
DTEnums::DTCellSide lrSide() const
The side of the cell.
Definition: DTRecHit1D.h:61
bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override
step
Definition: StallMonitor.cc:83
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
Definition: DTRecHit1D.h:70
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47

◆ setES()

void DTLinearDriftAlgo::setES ( const edm::EventSetup setup)
overridevirtual

Pass the Event Setup to the algo at each event.

Implements DTRecHitBaseAlgo.

Definition at line 32 of file DTLinearDriftAlgo.cc.

References singleTopDQM_cfi::setup, and DTRecHitBaseAlgo::theSync.

32 { theSync->setES(setup); }
std::unique_ptr< DTTTrigBaseSync > theSync

Member Data Documentation

◆ debug

const bool DTLinearDriftAlgo::debug
private

◆ hitResolution

const float DTLinearDriftAlgo::hitResolution
private

Definition at line 82 of file DTLinearDriftAlgo.h.

Referenced by compute().

◆ maxTime

const float DTLinearDriftAlgo::maxTime
private

Definition at line 88 of file DTLinearDriftAlgo.h.

Referenced by compute().

◆ minTime

const float DTLinearDriftAlgo::minTime
private

Definition at line 85 of file DTLinearDriftAlgo.h.

◆ vDrift

const float DTLinearDriftAlgo::vDrift
private

Definition at line 77 of file DTLinearDriftAlgo.h.

Referenced by compute().