CMS 3D CMS Logo

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

#include <DTNoDriftAlgo.h>

Inheritance diagram for DTNoDriftAlgo:
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
 
 DTNoDriftAlgo (const edm::ParameterSet &config)
 Constructor. More...
 
edm::OwnVector< DTRecHit1DPairreconstruct (const DTLayer *layer, const DTLayerId &layerId, const DTDigiCollection::Range &digiRange) override
 
void setES (const edm::EventSetup &setup) override
 Pass the Event Setup to the algo at each event. More...
 
 ~DTNoDriftAlgo () override
 Destructor. More...
 
- Public Member Functions inherited from DTRecHitBaseAlgo
 DTRecHitBaseAlgo (const edm::ParameterSet &config)
 Constructor. More...
 
virtual ~DTRecHitBaseAlgo ()
 Destructor. More...
 

Private Member Functions

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

Private Attributes

const bool debug
 
const float fixedDrift
 
const float hitResolution
 
const float maxTime
 
const float minTime
 

Additional Inherited Members

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

Detailed Description

Concrete implementation of DTRecHitBaseAlgo. Create pair of RecHits at fixed distance from the wire.

Author
Martijn Mulders - CERN (marti.nosp@m.jn.m.nosp@m.ulder.nosp@m.s@ce.nosp@m.rn.ch) based on DTLinearDriftAlgo

Definition at line 15 of file DTNoDriftAlgo.h.

Constructor & Destructor Documentation

◆ DTNoDriftAlgo()

DTNoDriftAlgo::DTNoDriftAlgo ( const edm::ParameterSet config)

Constructor.

Definition at line 18 of file DTNoDriftAlgo.cc.

20  fixedDrift(config.getParameter<double>("fixedDrift")),
21  hitResolution(config.getParameter<double>("hitResolution")), // Set to size of (half)cell
22  minTime(config.getParameter<double>("minTime")),
23  maxTime(config.getParameter<double>("maxTime")),
24  debug(config.getUntrackedParameter<bool>("debug")) // Set verbose output
25 {}

◆ ~DTNoDriftAlgo()

DTNoDriftAlgo::~DTNoDriftAlgo ( )
override

Destructor.

Definition at line 27 of file DTNoDriftAlgo.cc.

27 {}

Member Function Documentation

◆ compute() [1/5]

bool DTNoDriftAlgo::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 78 of file DTNoDriftAlgo.cc.

79  {
80  // Get the wireId
81  DTLayerId layerId = layer->id();
82  const DTWireId wireId(layerId, digi.wire());
83 
84  // Get Wire position
85  if (!layer->specificTopology().isWireValid(digi.wire()))
86  return false;
87  LocalPoint locWirePos(layer->specificTopology().wirePosition(digi.wire()), 0, 0);
88  const GlobalPoint globWirePos = layer->toGlobal(locWirePos);
89 
90  return compute(layer, wireId, digi.time(), globWirePos, leftPoint, rightPoint, error, 1);
91 }

References relativeConstraints::error, DTLayer::id(), DTTopology::isWireValid(), DTLayer::specificTopology(), DTDigi::time(), GeomDet::toGlobal(), DTDigi::wire(), and DTTopology::wirePosition().

Referenced by compute(), and reconstruct().

◆ compute() [2/5]

bool DTNoDriftAlgo::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 103 of file DTNoDriftAlgo.cc.

107  {
108  return compute(layer, recHit1D.wireId(), recHit1D.digiTime(), globPos, newHit1D, 3);
109 }

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

◆ compute() [3/5]

bool DTNoDriftAlgo::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 94 of file DTNoDriftAlgo.cc.

97  {
98  newHit1D.setPositionAndError(recHit1D.localPosition(), recHit1D.localPositionError());
99  return true;
100 }

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

◆ compute() [4/5]

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

Definition at line 166 of file DTNoDriftAlgo.cc.

171  {
172  LocalPoint leftPoint;
173  LocalPoint rightPoint;
175 
176  if (compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) {
177  // Set the position and the error of the rechit which is being updated
178  switch (newHit1D.lrSide()) {
179  case DTEnums::Left:
180  newHit1D.setPositionAndError(leftPoint, error);
181  break;
182 
183  case DTEnums::Right:
184  newHit1D.setPositionAndError(rightPoint, error);
185  break;
186 
187  default:
188  throw cms::Exception("InvalidDTCellSide") << "[DTNoDriftAlgo] Compute at Step " << step << ", Hit side "
189  << newHit1D.lrSide() << " is invalid!" << endl;
190  return false;
191  }
192 
193  return true;
194  } else {
195  return false;
196  }
197 }

References compute(), relativeConstraints::error, Exception, DTEnums::Left, DTRecHit1D::lrSide(), DTEnums::Right, and DTRecHit1D::setPositionAndError().

◆ compute() [5/5]

bool DTNoDriftAlgo::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 112 of file DTNoDriftAlgo.cc.

119  {
120  //}
121 
122  // Small negative times interpreted as hits close to the wire.
123  //if (driftTime<0.) driftTime=0;
124 
125  // check for out-of-time
126  if (digiTime < minTime || digiTime > maxTime) {
127  if (debug)
128  cout << "[DTNoDriftAlgo]*** Drift time out of window for in-time hits " << digiTime << endl;
129 
130  if (step == 1) { //FIXME: protection against failure at 2nd and 3rd steps, must be checked!!!
131  // Hits are interpreted as coming from out-of-time pile-up and recHit
132  // is ignored.
133  return false;
134  }
135  }
136 
137  // Compute the drift distance
138  float drift = fixedDrift;
139 
140  // Get Wire position
141  if (!layer->specificTopology().isWireValid(wireId.wire()))
142  return false;
143  LocalPoint locWirePos(layer->specificTopology().wirePosition(wireId.wire()), 0, 0);
144  //Build the two possible points and the error on the position
145  leftPoint = LocalPoint(locWirePos.x() - drift, locWirePos.y(), locWirePos.z());
146  rightPoint = LocalPoint(locWirePos.x() + drift, locWirePos.y(), locWirePos.z());
148 
149  if (debug) {
150  cout << "[DTNoDriftAlgo] Compute drift distance, for digi at wire: " << wireId << endl
151  << " Step: " << step << endl
152  << " Digi time: " << digiTime
153  << endl
154  // << " Drift time: " << driftTime << endl
155  << " Fixed Drift distance: " << drift << endl
156  << " Hit Resolution: " << hitResolution << endl
157  << " Left point: " << leftPoint << endl
158  << " Right point: " << rightPoint << endl
159  << " Error: " << error << endl;
160  }
161 
162  return true;
163 }

References gather_cfg::cout, debug, shallow::drift(), relativeConstraints::error, fixedDrift, hitResolution, DTTopology::isWireValid(), maxTime, DTLayer::specificTopology(), DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ reconstruct()

OwnVector< DTRecHit1DPair > DTNoDriftAlgo::reconstruct ( const DTLayer layer,
const DTLayerId layerId,
const DTDigiCollection::Range digiRange 
)
overridevirtual

MM: Override virtual function from DTRecHitBaseAlgo--> for the NoDrift algorithm only a maximum of one hit per wire is allowed! Build all hits in the range associated to the layerId, at the 1st step.

Reimplemented from DTRecHitBaseAlgo.

Definition at line 34 of file DTNoDriftAlgo.cc.

36  {
38 
39  // Loop over all digis in the given range
40  for (DTDigiCollection::const_iterator digi = digiRange.first; digi != digiRange.second; digi++) {
41  // Get the wireId
42  DTWireId wireId(layerId, (*digi).wire());
43 
44  bool isDouble = false;
45  for (OwnVector<DTRecHit1DPair>::const_iterator doubleWireCheck = result.begin(); doubleWireCheck != result.end();
46  doubleWireCheck++) {
47  if (wireId == (*doubleWireCheck).wireId()) {
48  isDouble = true;
49  // std::cout << " Reject this hit with time " << (*digi).time() << std::endl;
50  break;
51  }
52  }
53 
54  if (isDouble)
55  continue;
56 
57  LocalError tmpErr;
58  LocalPoint lpoint, rpoint;
59  // Call the compute method
60  bool OK = compute(layer, *digi, lpoint, rpoint, tmpErr);
61 
62  if (!OK)
63  continue;
64 
65  // Build a new pair of 1D rechit
66  DTRecHit1DPair* recHitPair = new DTRecHit1DPair(wireId, *digi);
67 
68  // Set the position and the error of the 1D rechits
69  recHitPair->setPositionAndError(DTEnums::Left, lpoint, tmpErr);
70  recHitPair->setPositionAndError(DTEnums::Right, rpoint, tmpErr);
71 
72  result.push_back(recHitPair);
73  }
74  return result;
75 }

References compute(), DTEnums::Left, mps_fire::result, DTEnums::Right, and DTRecHit1DPair::setPositionAndError().

◆ setES()

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

Pass the Event Setup to the algo at each event.

Implements DTRecHitBaseAlgo.

Definition at line 29 of file DTNoDriftAlgo.cc.

29  {
30  // theSync->setES(setup);
31 }

Member Data Documentation

◆ debug

const bool DTNoDriftAlgo::debug
private

◆ fixedDrift

const float DTNoDriftAlgo::fixedDrift
private

Definition at line 84 of file DTNoDriftAlgo.h.

Referenced by compute().

◆ hitResolution

const float DTNoDriftAlgo::hitResolution
private

Definition at line 87 of file DTNoDriftAlgo.h.

Referenced by compute().

◆ maxTime

const float DTNoDriftAlgo::maxTime
private

Definition at line 93 of file DTNoDriftAlgo.h.

Referenced by compute().

◆ minTime

const float DTNoDriftAlgo::minTime
private

Definition at line 90 of file DTNoDriftAlgo.h.

DTWireId::wire
int wire() const
Return the wire number.
Definition: DTWireId.h:42
step
step
Definition: StallMonitor.cc:94
DTTopology::isWireValid
bool isWireValid(const int wireNumber) const
Definition: DTTopology.h:64
DTRecHit1D::lrSide
DTEnums::DTCellSide lrSide() const
The side of the cell.
Definition: DTRecHit1D.h:61
gather_cfg.cout
cout
Definition: gather_cfg.py:144
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
DTRecHit1D::localPositionError
LocalError localPositionError() const override
Return the 3-dimensional error on the local position.
Definition: DTRecHit1D.h:50
relativeConstraints.error
error
Definition: relativeConstraints.py:53
DTDigi::time
double time() const
Get time in ns.
Definition: DTDigi.cc:37
reco::OK
std::pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:126
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
DTRecHit1D::setPositionAndError
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
Definition: DTRecHit1D.h:70
DTNoDriftAlgo::minTime
const float minTime
Definition: DTNoDriftAlgo.h:90
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
DTRecHit1D::wireId
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:76
DTEnums::Left
Definition: DTEnums.h:15
shallow::drift
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
DTDigi::wire
int wire() const
Return wire number.
Definition: DTDigi.cc:41
DTWireId
Definition: DTWireId.h:12
DTNoDriftAlgo::compute
bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const override
Definition: DTNoDriftAlgo.cc:78
DTRecHit1DPair
Definition: DTRecHit1DPair.h:26
Point3DBase< float, LocalTag >
DTLayerId
Definition: DTLayerId.h:12
DTNoDriftAlgo::debug
const bool debug
Definition: DTNoDriftAlgo.h:96
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
DTRecHit1D::localPosition
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
LocalError
Definition: LocalError.h:12
DTNoDriftAlgo::hitResolution
const float hitResolution
Definition: DTNoDriftAlgo.h:87
DTLayer::id
DTLayerId id() const
Return the DetId of this SL.
Definition: DTLayer.cc:39
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
DTRecHitBaseAlgo::DTRecHitBaseAlgo
DTRecHitBaseAlgo(const edm::ParameterSet &config)
Constructor.
Definition: DTRecHitBaseAlgo.cc:17
DTRecHit1D::digiTime
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
Definition: DTRecHit1D.h:79
DTEnums::Right
Definition: DTEnums.h:15
DTRecHit1DPair::setPositionAndError
void setPositionAndError(DTEnums::DTCellSide lrside, const LocalPoint &point, const LocalError &err)
Definition: DTRecHit1DPair.cc:85
Exception
Definition: hltDiff.cc:246
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
mps_fire.result
result
Definition: mps_fire.py:311
DTNoDriftAlgo::fixedDrift
const float fixedDrift
Definition: DTNoDriftAlgo.h:84
edm::OwnVector
Definition: OwnVector.h:24
DTNoDriftAlgo::maxTime
const float maxTime
Definition: DTNoDriftAlgo.h:93