CMS 3D CMS Logo

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

#include <DTParametrizedDriftAlgo.h>

Inheritance diagram for DTParametrizedDriftAlgo:
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, const GlobalPoint &globPos, DTRecHit1D &newHit1D) const override
 
bool compute (const DTLayer *layer, const DTRecHit1D &recHit1D, const float &angle, DTRecHit1D &newHit1D) const override
 
 DTParametrizedDriftAlgo (const edm::ParameterSet &config)
 Constructor. More...
 
void setES (const edm::EventSetup &setup) override
 Pass the Event Setup to the algo at each event. More...
 
 ~DTParametrizedDriftAlgo () override
 Destructor. More...
 
- Public Member Functions inherited from DTRecHitBaseAlgo
 DTRecHitBaseAlgo (const edm::ParameterSet &config)
 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 float &angle, const GlobalPoint &globPos, DTRecHit1D &newHit1D, int step) const
 
virtual bool compute (const DTLayer *layer, const DTWireId &wireId, const float digiTime, const float &angle, const GlobalPoint &globPos, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error, int step) const
 

Private Attributes

const bool debug
 
const bool interpolate
 
const MagneticFieldmagField
 
const float maxTime
 
const float minTime
 

Additional Inherited Members

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

Detailed Description

Concrete implementation of DTRecHitBaseAlgo. Compute drift distance using the CIEMAT (by P.Garcia Abia and J. Puerta) parametrization of the cell behavior obtained with GARFIELD

Author
G. Cerminara - INFN Torino

Definition at line 16 of file DTParametrizedDriftAlgo.h.

Constructor & Destructor Documentation

◆ DTParametrizedDriftAlgo()

DTParametrizedDriftAlgo::DTParametrizedDriftAlgo ( const edm::ParameterSet config)

Constructor.

Definition at line 27 of file DTParametrizedDriftAlgo.cc.

29  interpolate(config.getParameter<bool>("interpolate")),
30  minTime(config.getParameter<double>("minTime")), // FIXME: Default was -3 ns
31  maxTime(config.getParameter<double>("maxTime")), // FIXME: Default was 415 ns
32  // Set verbose output
33  debug(config.getUntrackedParameter<bool>("debug", "false")) {}

◆ ~DTParametrizedDriftAlgo()

DTParametrizedDriftAlgo::~DTParametrizedDriftAlgo ( )
override

Destructor.

Definition at line 35 of file DTParametrizedDriftAlgo.cc.

35 {}

Member Function Documentation

◆ compute() [1/5]

bool DTParametrizedDriftAlgo::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). The center of the wire is assumed as hit coordinate along y. Returns false on failure.

Implements DTRecHitBaseAlgo.

◆ compute() [2/5]

bool DTParametrizedDriftAlgo::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. In addition the the angle, also the global position of the hit is given as input. This allows to get the magnetic field at the hit position (and not only that at the center of the wire). Also the 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.

◆ compute() [3/5]

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

Second step. The impact angle is given as input, and it's used to improve the hit position (and relative error). The angle is defined in radians, with respect to the perpendicular to the layer plane. Given the local direction, angle=atan(dir.x()/-dir.z()) . This can be used when a SL segment is built, so the impact angle is known but the position along wire is not. NOTE: Only position and error of the new hit are modified

Implements DTRecHitBaseAlgo.

◆ compute() [4/5]

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

Definition at line 294 of file DTParametrizedDriftAlgo.cc.

300  {
301  LocalPoint leftPoint;
302  LocalPoint rightPoint;
304 
305  if (compute(layer, wireId, digiTime, angle, globPos, leftPoint, rightPoint, error, step)) {
306  // Set the position and the error of the rechit which is being updated
307  switch (newHit1D.lrSide()) {
308  case DTEnums::Left: {
309  // Keep the original y position of newHit1D: for step==3, it's the
310  // position along the wire. Needed for rotation alignment
311  LocalPoint leftPoint3D(leftPoint.x(), newHit1D.localPosition().y(), leftPoint.z());
312  newHit1D.setPositionAndError(leftPoint3D, error);
313  break;
314  }
315 
316  case DTEnums::Right: {
317  // as above: 3d position
318  LocalPoint rightPoint3D(rightPoint.x(), newHit1D.localPosition().y(), rightPoint.z());
319  newHit1D.setPositionAndError(rightPoint3D, error);
320  break;
321  }
322 
323  default:
324  throw cms::Exception("InvalidDTCellSide") << "[DTParametrizedDriftAlgo] Compute at Step " << step
325  << ", Hit side " << newHit1D.lrSide() << " is invalid!" << endl;
326  return false;
327  }
328 
329  return true;
330  } else {
331  return false;
332  }
333 }

References angle(), bookConverter::compute(), relativeConstraints::error, Exception, 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().

◆ compute() [5/5]

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

Definition at line 100 of file DTParametrizedDriftAlgo.cc.

108  {
109  // Subtract Offset according to DTTTrigBaseSync concrete instance
110  // chosen with the 'tZeroMode' parameter
111  float driftTime = digiTime - theSync->offset(layer, wireId, globPos);
112 
113  // check for out-of-time only at step 1
114  if (step == 1 && (driftTime < minTime || driftTime > maxTime)) {
115  if (debug)
116  cout << "*** Drift time out of window for in-time hits " << driftTime << endl;
117 
118  if (step == 1) { //FIXME: protection against failure at 2nd and 3rd steps, must be checked!!!
119  // Hits are interpreted as coming from out-of-time pile-up and recHit
120  // is ignored.
121  return false;
122  }
123  }
124 
125  // Small negative times interpreted as hits close to the wire.
126  if (driftTime < 0.)
127  driftTime = 0;
128 
129  //----------------------------------------------------------------------
130  // Magnetic Field in layer frame
131  const LocalVector BLoc = layer->toLocal(magField->inTesla(globPos));
132 
133  float By = BLoc.y();
134  float Bz = BLoc.z();
135 
136  //--------------------------------------------------------------------
137  // Calculate the drift distance and the resolution from the parametrization
138 
140  static const DTTime2DriftParametrization par;
141 
142  bool parStatus = par.computeDriftDistance_mean(driftTime, angle, By, Bz, interpolate, &DX);
143 
144  if (!parStatus) {
145  if (debug)
146  cout << "[DTParametrizedDriftAlgo]*** WARNING: call to parametrization failed" << endl;
147  return false;
148  }
149 
150  float sigma_l = DX.x_width_m;
151  float sigma_r = DX.x_width_p;
152  float drift = DX.x_drift;
153 
154  float reso = 0;
155 
156  bool variableSigma = false;
157  // By defualt the errors are obtained from a fit of the residuals in the various
158  // stations/SL.
159  // The error returned by DTTime2DriftParametrization can not be used easily
160  // to determine the hit error due to the way the parametrization of the error
161  // is done (please contcat the authors for details).
162  // Anyhow changing variableSigma==true, an attempt is done to set a variable error
163  // according to the sigma calculated by DTTime2DriftParametrization.
164  // Additionally, contributions from uncertaionties in TOF and signal propagation
165  // corrections are added.
166  // Uncertainty in the determination of incident angle and hit position
167  // (ie B value) are NOT accounted.
168  // This is not the default since it does not give good results...
169 
170  int wheel = abs(wireId.wheel());
171  if (variableSigma) {
172  float sTDelays = 0;
173  if (step == 1) { // 1. step
174  reso = (sigma_l + sigma_r) / 2.; // FIXME: theta/B are not yet known...
175  if (wireId.superlayer() == 2) { // RZ
176  sTDelays = 2.92;
177  } else { // RPhi
178  if (wheel == 0) {
179  sTDelays = 2.74;
180  } else if (wheel == 1) {
181  sTDelays = 1.83;
182  } else if (wheel == 2) {
183  sTDelays = 1.25;
184  }
185  }
186  } else if (step == 2) { // 2. step
187  reso = (sigma_l + sigma_r) / 2.; // FIXME: B is not yet known...
188  if (wireId.superlayer() == 2) { // RZ
189  sTDelays = 0.096;
190  } else { // RPhi
191  if (wheel == 0) {
192  sTDelays = 0.022;
193  } else if (wheel == 1) {
194  sTDelays = 0.079;
195  } else if (wheel == 2) {
196  sTDelays = 0.124;
197  }
198  }
199  } else if (step == 3) { // 3. step
200  reso = (sigma_l + sigma_r) / 2.;
201  if (wireId.superlayer() == 2) { // RZ
202  sTDelays = 0.096;
203  } else { // RPhi
204  if (wheel == 0) {
205  sTDelays = 0.022;
206  } else if (wheel == 1) {
207  sTDelays = 0.079;
208  } else if (wheel == 2) {
209  sTDelays = 0.124;
210  }
211  }
212  }
213  float sXDelays = sTDelays * DX.v_drift / 10.;
214  reso = sqrt(reso * reso + sXDelays * sXDelays);
215  } else { // Use a fixed sigma, from fit of residuals.
216  if (step == 1) { // 1. step
217  if (wireId.superlayer() == 2) {
218  if (wheel == 0) {
219  reso = 0.0250;
220  } else if (wheel == 1) {
221  reso = 0.0271;
222  } else if (wheel == 2) {
223  reso = 0.0308;
224  }
225  } else {
226  reso = 0.0237;
227  }
228  } else if (step == 2) { // 2. step //FIXME
229  if (wireId.superlayer() == 2) {
230  if (wheel == 0) {
231  reso = 0.0250;
232  } else if (wheel == 1) {
233  reso = 0.0271;
234  } else if (wheel == 2) {
235  reso = 0.0305;
236  }
237  } else {
238  reso = 0.0231;
239  }
240  } else if (step == 3) { // 3. step
241  if (wireId.superlayer() == 2) {
242  if (wheel == 0) {
243  reso = 0.0196;
244  } else if (wheel == 1) {
245  reso = 0.0210;
246  } else if (wheel == 2) {
247  reso = 0.0228;
248  }
249  } else {
250  reso = 0.0207;
251  }
252  }
253  }
254  //--------------------------------------------------------------------
255 
256  error = LocalError(reso * reso, 0., 0.);
257 
258  // Get Wire position
259  if (!layer->specificTopology().isWireValid(wireId.wire()))
260  return false;
261  LocalPoint locWirePos(layer->specificTopology().wirePosition(wireId.wire()), 0, 0);
262 
263  //Build the two possible points and the error on the position
264  leftPoint = LocalPoint(locWirePos.x() - drift, locWirePos.y(), locWirePos.z());
265  rightPoint = LocalPoint(locWirePos.x() + drift, locWirePos.y(), locWirePos.z());
266 
267  if (debug) {
268  int prevW = cout.width();
269  cout << setiosflags(ios::showpoint | ios::fixed) << setw(3) << "[DTParametrizedDriftAlgo]: step " << step << endl
270  << " Global Position " << globPos << endl
271  << " Local Position " << layer->toLocal(globPos)
272  << endl
273  // << " y along Wire " << wireCoord << endl
274  << " Digi time " << digiTime
275  << endl
276  // << " dpropDelay " << propDelay << endl
277  // << " deltaTOF " << deltaTOF << endl
278  << " >Drif time " << driftTime << endl
279  << " >Angle " << angle * 180. / M_PI << endl
280  << " <Drift distance " << drift << endl
281  << " <sigma_l " << sigma_l << endl
282  << " <sigma_r " << sigma_r << endl
283  << " reso " << reso << endl
284  << " leftPoint " << leftPoint << endl
285  << " rightPoint " << rightPoint << endl
286  << " error " << error << resetiosflags(ios::showpoint | ios::fixed) << setw(prevW) << endl
287  << endl;
288  }
289 
290  return true;
291 }

References funct::abs(), angle(), DTTime2DriftParametrization::computeDriftDistance_mean(), gather_cfg::cout, debug, shallow::drift(), relativeConstraints::error, alignBH_cfg::fixed, HiCaloJetParameters_cff::interpolate, DTTopology::isWireValid(), M_PI, HLT_FULL_cff::maxTime, DTLayer::specificTopology(), mathSSE::sqrt(), DTSuperLayerId::superlayer(), GeomDet::toLocal(), DTTime2DriftParametrization::drift_distance::v_drift, DTChamberId::wheel(), makeMuonMisalignmentScenario::wheel, DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), DTTime2DriftParametrization::drift_distance::x_drift, DTTime2DriftParametrization::drift_distance::x_width_m, DTTime2DriftParametrization::drift_distance::x_width_p, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ setES()

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

Pass the Event Setup to the algo at each event.

Implements DTRecHitBaseAlgo.

Definition at line 37 of file DTParametrizedDriftAlgo.cc.

37  {
38  theSync->setES(setup);
39  // Access the magnetic field
43 }

References get, HLT_FULL_cff::magneticField, and singleTopDQM_cfi::setup.

Member Data Documentation

◆ debug

const bool DTParametrizedDriftAlgo::debug
private

◆ interpolate

const bool DTParametrizedDriftAlgo::interpolate
private

Definition at line 67 of file DTParametrizedDriftAlgo.h.

◆ magField

const MagneticField* DTParametrizedDriftAlgo::magField
private

Definition at line 99 of file DTParametrizedDriftAlgo.h.

◆ maxTime

const float DTParametrizedDriftAlgo::maxTime
private

Definition at line 73 of file DTParametrizedDriftAlgo.h.

◆ minTime

const float DTParametrizedDriftAlgo::minTime
private

Definition at line 70 of file DTParametrizedDriftAlgo.h.

Vector3DBase< float, LocalTag >
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
DTWireId::wire
int wire() const
Return the wire number.
Definition: DTWireId.h:42
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
DTParametrizedDriftAlgo::compute
bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override
step
step
Definition: StallMonitor.cc:94
DTTopology::isWireValid
bool isWireValid(const int wireNumber) const
Definition: DTTopology.h:64
DTParametrizedDriftAlgo::minTime
const float minTime
Definition: DTParametrizedDriftAlgo.h:70
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
DTRecHit1D::lrSide
DTEnums::DTCellSide lrSide() const
The side of the cell.
Definition: DTRecHit1D.h:61
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTParametrizedDriftAlgo::magField
const MagneticField * magField
Definition: DTParametrizedDriftAlgo.h:99
DTParametrizedDriftAlgo::interpolate
const bool interpolate
Definition: DTParametrizedDriftAlgo.h:67
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
relativeConstraints.error
error
Definition: relativeConstraints.py:53
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DTTime2DriftParametrization
Definition: DTTime2DriftParametrization.h:18
DTRecHit1D::setPositionAndError
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
Definition: DTRecHit1D.h:70
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DTTime2DriftParametrization::drift_distance::x_drift
double x_drift
Definition: DTTime2DriftParametrization.h:28
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
config
Definition: config.py:1
DTTopology::wirePosition
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
DTEnums::Left
Definition: DTEnums.h:15
shallow::drift
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
DTRecHitBaseAlgo::theSync
std::unique_ptr< DTTTrigBaseSync > theSync
Definition: DTRecHitBaseAlgo.h:81
DTTime2DriftParametrization::drift_distance::x_width_p
double x_width_p
Definition: DTTime2DriftParametrization.h:28
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
edm::ESHandle< MagneticField >
Point3DBase< float, LocalTag >
GeomDet::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
DTRecHit1D::localPosition
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
LocalError
Definition: LocalError.h:12
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
DTParametrizedDriftAlgo::maxTime
const float maxTime
Definition: DTParametrizedDriftAlgo.h:73
DTParametrizedDriftAlgo::debug
const bool debug
Definition: DTParametrizedDriftAlgo.h:96
DTRecHitBaseAlgo::DTRecHitBaseAlgo
DTRecHitBaseAlgo(const edm::ParameterSet &config)
Constructor.
Definition: DTRecHitBaseAlgo.cc:17
get
#define get
DTEnums::Right
Definition: DTEnums.h:15
DTTime2DriftParametrization::drift_distance
Structure used to return output values.
Definition: DTTime2DriftParametrization.h:27
Exception
Definition: hltDiff.cc:246
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTTime2DriftParametrization::computeDriftDistance_mean
bool computeDriftDistance_mean(double time, double alpha, double by, double bz, short interpolate, drift_distance *dx) const
Definition: DTTime2DriftParametrization.cc:52
DTTime2DriftParametrization::drift_distance::v_drift
double v_drift
Definition: DTTime2DriftParametrization.h:28
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTTime2DriftParametrization::drift_distance::x_width_m
double x_width_m
Definition: DTTime2DriftParametrization.h:28