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 | Static 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
 

Static Private Attributes

static bool debug
 
static float hitResolution
 
static float maxTime
 
static float minTime
 
static 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.

Date:
2007/04/19 11:08:17
Revision:
1.1
Author
G. Cerminara - INFN Torino

Definition at line 18 of file DTLinearDriftAlgo.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 20 of file DTLinearDriftAlgo.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hitResolution, maxTime, minTime, and vDrift.

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

Destructor.

Definition at line 38 of file DTLinearDriftAlgo.cc.

38 {}

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

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

Referenced by compute().

53  {
54  // Get the wireId
55  DTLayerId layerId = layer->id();
56  const DTWireId wireId(layerId, digi.wire());
57 
58  // Get Wire position
59  if(!layer->specificTopology().isWireValid(digi.wire())) return false;
60  LocalPoint locWirePos(layer->specificTopology().wirePosition(digi.wire()), 0, 0);
61  const GlobalPoint globWirePos = layer->toGlobal(locWirePos);
62 
63  return compute(layer, wireId, digi.time(), globWirePos, leftPoint, rightPoint, error, 1);
64 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:88
DTLayerId id() const
Return the DetId of this SL.
Definition: DTLayer.cc:48
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:69
const DTTopology & specificTopology() const
Definition: DTLayer.cc:44
double time() const
Get time in ns.
Definition: DTDigi.cc:65
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:67
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 69 of file DTLinearDriftAlgo.cc.

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

72  {
73  newHit1D.setPositionAndError(recHit1D.localPosition(), recHit1D.localPositionError());
74  return true;
75 }
virtual LocalError localPositionError() const
Return the 3-dimensional error on the local position.
Definition: DTRecHit1D.h:68
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:62
void setPositionAndError(LocalPoint pos, LocalError err)
Set the local position and its error.
Definition: DTRecHit1D.h:102
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 80 of file DTLinearDriftAlgo.cc.

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

84  {
85  return compute(layer, recHit1D.wireId(), recHit1D.digiTime(), globPos, newHit1D, 3);
86 }
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
Definition: DTRecHit1D.h:115
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:109
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 91 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().

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

References compute(), 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().

163  {
164  LocalPoint leftPoint;
165  LocalPoint rightPoint;
167 
168  if(compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) {
169  // Set the position and the error of the rechit which is being updated
170  switch(newHit1D.lrSide()) {
171 
172  case DTEnums::Left:
173  {
174  // Keep the original y position of newHit1D: for step==3, it's the
175  // position along the wire. Needed for rotation alignment
176  LocalPoint leftPoint3D(leftPoint.x(), newHit1D.localPosition().y(), leftPoint.z());
177  newHit1D.setPositionAndError(leftPoint3D, error);
178  break;
179  }
180 
181  case DTEnums::Right:
182  {
183  // as above: 3d position
184  LocalPoint rightPoint3D(rightPoint.x(), newHit1D.localPosition().y(), rightPoint.z());
185  newHit1D.setPositionAndError(rightPoint3D, error);
186  break;
187  }
188 
189  default:
190  throw cms::Exception("InvalidDTCellSide") << "[DTLinearDriftAlgo] Compute at Step "
191  << step << ", Hit side "
192  << newHit1D.lrSide()
193  << " is invalid!" << endl;
194  return false;
195  }
196 
197  return true;
198  }else {
199  return false;
200  }
201 }
list step
Definition: launcher.py:15
T y() const
Definition: PV3DBase.h:62
T z() const
Definition: PV3DBase.h:63
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:62
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:102
T x() const
Definition: PV3DBase.h:61
DTEnums::DTCellSide lrSide() const
The side of the cell.
Definition: DTRecHit1D.h:84
void DTLinearDriftAlgo::setES ( const edm::EventSetup setup)
virtual

Pass the Event Setup to the algo at each event.

Implements DTRecHitBaseAlgo.

Definition at line 42 of file DTLinearDriftAlgo.cc.

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

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

Member Data Documentation

bool DTLinearDriftAlgo::debug
staticprivate

Definition at line 100 of file DTLinearDriftAlgo.h.

Referenced by compute(), and DTLinearDriftAlgo().

float DTLinearDriftAlgo::hitResolution
staticprivate

Definition at line 91 of file DTLinearDriftAlgo.h.

Referenced by compute(), and DTLinearDriftAlgo().

float DTLinearDriftAlgo::maxTime
staticprivate

Definition at line 97 of file DTLinearDriftAlgo.h.

Referenced by compute(), and DTLinearDriftAlgo().

float DTLinearDriftAlgo::minTime
staticprivate

Definition at line 94 of file DTLinearDriftAlgo.h.

Referenced by DTLinearDriftAlgo().

float DTLinearDriftAlgo::vDrift
staticprivate

Definition at line 86 of file DTLinearDriftAlgo.h.

Referenced by compute(), and DTLinearDriftAlgo().