CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual bool compute (const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const
 
virtual bool compute (const DTLayer *layer, const DTRecHit1D &recHit1D, const float &angle, DTRecHit1D &newHit1D) const
 
virtual bool compute (const DTLayer *layer, const DTRecHit1D &recHit1D, const float &angle, const GlobalPoint &globPos, DTRecHit1D &newHit1D) const
 
 DTLinearDriftAlgo (const edm::ParameterSet &config)
 Constructor. More...
 
virtual void setES (const edm::EventSetup &setup)
 Pass the Event Setup to the algo at each event. More...
 
virtual ~DTLinearDriftAlgo ()
 Destructor. More...
 
- Public Member Functions inherited from DTRecHitBaseAlgo
 DTRecHitBaseAlgo (const edm::ParameterSet &config)
 Constructor. More...
 
virtual edm::OwnVector
< DTRecHit1DPair
reconstruct (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
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 16 of file DTLinearDriftAlgo.h.

Constructor & Destructor Documentation

DTLinearDriftAlgo::DTLinearDriftAlgo ( const edm::ParameterSet config)

Constructor.

Definition at line 18 of file DTLinearDriftAlgo.cc.

18  :
19  DTRecHitBaseAlgo(config),
20  // Get the Drift Velocity from parameter set.
21  vDrift(config.getParameter<double>("driftVelocity")), // FIXME: Default was 0.00543 cm/ns
22  hitResolution(config.getParameter<double>("hitResolution")), // FIXME: Default is
23  // vDriftMB1W1(config.getParameter<double>("driftVelocityMB1W1")), // FIXME: Default was 0.00543 cm/ns
24  minTime(config.getParameter<double>("minTime")), // FIXME: Default was -3 ns
25  maxTime(config.getParameter<double>("maxTime")), // FIXME: Default was 415 ns
26  // Set verbose output
27  debug(config.getUntrackedParameter<bool>("debug"))
28  {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTRecHitBaseAlgo(const edm::ParameterSet &config)
Constructor.
const float hitResolution
DTLinearDriftAlgo::~DTLinearDriftAlgo ( )
virtual

Destructor.

Definition at line 32 of file DTLinearDriftAlgo.cc.

32 {}

Member Function Documentation

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

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 43 of file DTLinearDriftAlgo.cc.

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

Referenced by compute().

47  {
48  // Get the wireId
49  DTLayerId layerId = layer->id();
50  const DTWireId wireId(layerId, digi.wire());
51 
52  // Get Wire position
53  if(!layer->specificTopology().isWireValid(digi.wire())) return false;
54  LocalPoint locWirePos(layer->specificTopology().wirePosition(digi.wire()), 0, 0);
55  const GlobalPoint globWirePos = layer->toGlobal(locWirePos);
56 
57  return compute(layer, wireId, digi.time(), globWirePos, leftPoint, rightPoint, error, 1);
58 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
DTLayerId id() const
Return the DetId of this SL.
Definition: DTLayer.cc:46
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
int wire() const
Return wire number.
Definition: DTDigi.cc:67
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
double time() const
Get time in ns.
Definition: DTDigi.cc:63
virtual bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const
bool isWireValid(const int wireNumber) const
Definition: DTTopology.h:65
bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTRecHit1D recHit1D,
const float &  angle,
DTRecHit1D newHit1D 
) const
virtual

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 63 of file DTLinearDriftAlgo.cc.

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

66  {
67  newHit1D.setPositionAndError(recHit1D.localPosition(), recHit1D.localPositionError());
68  return true;
69 }
virtual LocalError localPositionError() const
Return the 3-dimensional error on the local position.
Definition: DTRecHit1D.h:66
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:60
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
Definition: DTRecHit1D.h:100
bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTRecHit1D recHit1D,
const float &  angle,
const GlobalPoint globPos,
DTRecHit1D newHit1D 
) const
virtual

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 74 of file DTLinearDriftAlgo.cc.

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

78  {
79  return compute(layer, recHit1D.wireId(), recHit1D.digiTime(), globPos, newHit1D, 3);
80 }
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
Definition: DTRecHit1D.h:113
virtual bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:107
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 85 of file DTLinearDriftAlgo.cc.

References gather_cfg::cout, debug, shallow::drift(), hitResolution, DTTopology::isWireValid(), maxTime, DTTTrigBaseSync::offset(), DTLayer::specificTopology(), DTRecHitBaseAlgo::theSync, vDrift, DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

92  {
93  // Subtract the offset to the digi time accordingly to the DTTTrigBaseSync concrete instance
94  float driftTime = digiTime - theSync->offset(layer, wireId, globPos);
95 
96  // check for out-of-time
97  if (driftTime < minTime || driftTime > maxTime) {
98  if (debug) cout << "[DTLinearDriftAlgo]*** Drift time out of window for in-time hits "
99  << driftTime << endl;
100 
101  if(step == 1) { //FIXME: protection against failure at 2nd and 3rd steps, must be checked!!!
102  // Hits are interpreted as coming from out-of-time pile-up and recHit
103  // is ignored.
104  return false;
105  }
106  }
107 
108  // Small negative times interpreted as hits close to the wire.
109  if (driftTime<0.) driftTime=0;
110 
111  // Compute the drift distance
112  // SL 21-Dec-2006: Use specific Drift for MB1W1 (non fluxed chamber)
113  float vd=vDrift;
114  // if (wireId.wheel()==1 && wireId.station()==1) {
115  // vd=vDriftMB1W1;
116  // //cout << "Using Vd " << vd<< endl;
117  // }
118 
119  float drift = driftTime * vd;
120 
121  // Get Wire position
122  if(!layer->specificTopology().isWireValid(wireId.wire())) return false;
123  LocalPoint locWirePos(layer->specificTopology().wirePosition(wireId.wire()), 0, 0);
124  //Build the two possible points and the error on the position
125  leftPoint = LocalPoint(locWirePos.x()-drift,
126  locWirePos.y(),
127  locWirePos.z());
128  rightPoint = LocalPoint(locWirePos.x()+drift,
129  locWirePos.y(),
130  locWirePos.z());
131  error = LocalError(hitResolution*hitResolution,0.,0.);
132 
133 
134  if(debug) {
135  cout << "[DTLinearDriftAlgo] Compute drift distance, for digi at wire: " << wireId << endl
136  << " Step: " << step << endl
137  << " Digi time: " << digiTime << endl
138  << " Drift time: " << driftTime << endl
139  << " Drift distance: " << drift << endl
140  << " Hit Resolution: " << hitResolution << endl
141  << " Left point: " << leftPoint << endl
142  << " Right point: " << rightPoint << endl
143  << " Error: " << error << endl;
144  }
145 
146  return true;
147 
148 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globalPos)
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:39
T y() const
Definition: PV3DBase.h:63
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
std::vector< DeviationSensor2D * > vd
DTTTrigBaseSync * theSync
int wire() const
Return the wire number.
Definition: DTWireId.h:56
const float hitResolution
bool isWireValid(const int wireNumber) const
Definition: DTTopology.h:65
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTWireId wireId,
const float  digiTime,
const GlobalPoint globPos,
DTRecHit1D newHit1D,
int  step 
) const
privatevirtual

Definition at line 152 of file DTLinearDriftAlgo.cc.

References compute(), relativeConstraints::error, edm::hlt::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().

157  {
158  LocalPoint leftPoint;
159  LocalPoint rightPoint;
161 
162  if(compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) {
163  // Set the position and the error of the rechit which is being updated
164  switch(newHit1D.lrSide()) {
165 
166  case DTEnums::Left:
167  {
168  // Keep the original y position of newHit1D: for step==3, it's the
169  // position along the wire. Needed for rotation alignment
170  LocalPoint leftPoint3D(leftPoint.x(), newHit1D.localPosition().y(), leftPoint.z());
171  newHit1D.setPositionAndError(leftPoint3D, error);
172  break;
173  }
174 
175  case DTEnums::Right:
176  {
177  // as above: 3d position
178  LocalPoint rightPoint3D(rightPoint.x(), newHit1D.localPosition().y(), rightPoint.z());
179  newHit1D.setPositionAndError(rightPoint3D, error);
180  break;
181  }
182 
183  default:
184  throw cms::Exception("InvalidDTCellSide") << "[DTLinearDriftAlgo] Compute at Step "
185  << step << ", Hit side "
186  << newHit1D.lrSide()
187  << " is invalid!" << endl;
188  return false;
189  }
190 
191  return true;
192  }else {
193  return false;
194  }
195 }
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:60
virtual bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
Definition: DTRecHit1D.h:100
T x() const
Definition: PV3DBase.h:62
DTEnums::DTCellSide lrSide() const
The side of the cell.
Definition: DTRecHit1D.h:82
void DTLinearDriftAlgo::setES ( const edm::EventSetup setup)
virtual

Pass the Event Setup to the algo at each event.

Implements DTRecHitBaseAlgo.

Definition at line 36 of file DTLinearDriftAlgo.cc.

References DTTTrigBaseSync::setES(), and DTRecHitBaseAlgo::theSync.

36  {
37  theSync->setES(setup);
38 }
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the synchronization module at each event.
DTTTrigBaseSync * theSync

Member Data Documentation

const bool DTLinearDriftAlgo::debug
private

Definition at line 98 of file DTLinearDriftAlgo.h.

Referenced by compute().

const float DTLinearDriftAlgo::hitResolution
private

Definition at line 89 of file DTLinearDriftAlgo.h.

Referenced by compute().

const float DTLinearDriftAlgo::maxTime
private

Definition at line 95 of file DTLinearDriftAlgo.h.

Referenced by compute().

const float DTLinearDriftAlgo::minTime
private

Definition at line 92 of file DTLinearDriftAlgo.h.

const float DTLinearDriftAlgo::vDrift
private

Definition at line 84 of file DTLinearDriftAlgo.h.

Referenced by compute().