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
DTNoDriftAlgo Class Reference

#include <DTNoDriftAlgo.h>

Inheritance diagram for DTNoDriftAlgo:
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
 
 DTNoDriftAlgo (const edm::ParameterSet &config)
 Constructor. More...
 
virtual edm::OwnVector
< DTRecHit1DPair
reconstruct (const DTLayer *layer, const DTLayerId &layerId, const DTDigiCollection::Range &digiRange)
 
virtual void setES (const edm::EventSetup &setup)
 Pass the Event Setup to the algo at each event. More...
 
virtual ~DTNoDriftAlgo ()
 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, 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 fixedDrift
 
const float hitResolution
 
const float maxTime
 
const float minTime
 

Additional Inherited Members

- Protected Attributes inherited from DTRecHitBaseAlgo
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 17 of file DTNoDriftAlgo.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 18 of file DTNoDriftAlgo.cc.

18  :
19  DTRecHitBaseAlgo(config),
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  {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const float hitResolution
Definition: DTNoDriftAlgo.h:96
const float minTime
Definition: DTNoDriftAlgo.h:99
const float fixedDrift
Definition: DTNoDriftAlgo.h:93
DTRecHitBaseAlgo(const edm::ParameterSet &config)
Constructor.
const float maxTime
const bool debug
DTNoDriftAlgo::~DTNoDriftAlgo ( )
virtual

Destructor.

Definition at line 29 of file DTNoDriftAlgo.cc.

29 {}

Member Function Documentation

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

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

Referenced by compute(), and reconstruct().

94  {
95  // Get the wireId
96  DTLayerId layerId = layer->id();
97  const DTWireId wireId(layerId, digi.wire());
98 
99  // Get Wire position
100  if(!layer->specificTopology().isWireValid(digi.wire())) return false;
101  LocalPoint locWirePos(layer->specificTopology().wirePosition(digi.wire()), 0, 0);
102  const GlobalPoint globWirePos = layer->toGlobal(locWirePos);
103 
104  return compute(layer, wireId, digi.time(), globWirePos, leftPoint, rightPoint, error, 1);
105 }
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 DTNoDriftAlgo::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 110 of file DTNoDriftAlgo.cc.

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

113  {
114  newHit1D.setPositionAndError(recHit1D.localPosition(), recHit1D.localPositionError());
115  return true;
116 }
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 DTNoDriftAlgo::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 121 of file DTNoDriftAlgo.cc.

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

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

References gather_cfg::cout, debug, shallow::drift(), 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().

139  {
140  //}
141 
142  // Small negative times interpreted as hits close to the wire.
143  //if (driftTime<0.) driftTime=0;
144 
145 
146  // check for out-of-time
147  if (digiTime < minTime || digiTime > maxTime) {
148  if (debug) cout << "[DTNoDriftAlgo]*** Drift time out of window for in-time hits "
149  << digiTime << endl;
150 
151  if(step == 1) { //FIXME: protection against failure at 2nd and 3rd steps, must be checked!!!
152  // Hits are interpreted as coming from out-of-time pile-up and recHit
153  // is ignored.
154  return false;
155  }
156  }
157 
158 
159  // Compute the drift distance
160  float drift = fixedDrift;
161 
162  // Get Wire position
163  if(!layer->specificTopology().isWireValid(wireId.wire())) return false;
164  LocalPoint locWirePos(layer->specificTopology().wirePosition(wireId.wire()), 0, 0);
165  //Build the two possible points and the error on the position
166  leftPoint = LocalPoint(locWirePos.x()-drift,
167  locWirePos.y(),
168  locWirePos.z());
169  rightPoint = LocalPoint(locWirePos.x()+drift,
170  locWirePos.y(),
171  locWirePos.z());
172  error = LocalError(hitResolution*hitResolution,0.,0.);
173 
174 
175  if(debug) {
176  cout << "[DTNoDriftAlgo] Compute drift distance, for digi at wire: " << wireId << endl
177  << " Step: " << step << endl
178  << " Digi time: " << digiTime << endl
179  // << " Drift time: " << driftTime << endl
180  << " Fixed Drift distance: " << drift << endl
181  << " Hit Resolution: " << hitResolution << endl
182  << " Left point: " << leftPoint << endl
183  << " Right point: " << rightPoint << endl
184  << " Error: " << error << endl;
185  }
186 
187 
188 
189  return true;
190 
191 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
const float hitResolution
Definition: DTNoDriftAlgo.h:96
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:39
T y() const
Definition: PV3DBase.h:63
const float fixedDrift
Definition: DTNoDriftAlgo.h:93
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
int wire() const
Return the wire number.
Definition: DTWireId.h:56
bool isWireValid(const int wireNumber) const
Definition: DTTopology.h:65
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
const float maxTime
tuple cout
Definition: gather_cfg.py:121
const bool debug
bool DTNoDriftAlgo::compute ( const DTLayer layer,
const DTWireId wireId,
const float  digiTime,
const GlobalPoint globPos,
DTRecHit1D newHit1D,
int  step 
) const
privatevirtual

Definition at line 195 of file DTNoDriftAlgo.cc.

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

200  {
201  LocalPoint leftPoint;
202  LocalPoint rightPoint;
204 
205  if(compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) {
206  // Set the position and the error of the rechit which is being updated
207  switch(newHit1D.lrSide()) {
208 
209  case DTEnums::Left:
210  newHit1D.setPositionAndError(leftPoint, error);
211  break;
212 
213  case DTEnums::Right:
214  newHit1D.setPositionAndError(rightPoint, error);
215  break;
216 
217  default:
218  throw cms::Exception("InvalidDTCellSide") << "[DTNoDriftAlgo] Compute at Step "
219  << step << ", Hit side "
220  << newHit1D.lrSide()
221  << " is invalid!" << endl;
222  return false;
223  }
224 
225  return true;
226  }else {
227  return false;
228  }
229 }
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
DTEnums::DTCellSide lrSide() const
The side of the cell.
Definition: DTRecHit1D.h:82
OwnVector< DTRecHit1DPair > DTNoDriftAlgo::reconstruct ( const DTLayer layer,
const DTLayerId layerId,
const DTDigiCollection::Range digiRange 
)
virtual

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 41 of file DTNoDriftAlgo.cc.

References edm::OwnVector< T, P >::begin(), compute(), edm::OwnVector< T, P >::end(), DTEnums::Left, edm::OwnVector< T, P >::push_back(), query::result, DTEnums::Right, and DTRecHit1DPair::setPositionAndError().

43  {
45 
46  // Loop over all digis in the given range
47  for (DTDigiCollection::const_iterator digi = digiRange.first;
48  digi != digiRange.second;
49  digi++) {
50  // Get the wireId
51  DTWireId wireId(layerId, (*digi).wire());
52 
53  bool isDouble = false;
54  for (OwnVector<DTRecHit1DPair>::const_iterator doubleWireCheck = result.begin();
55  doubleWireCheck != result.end();
56  doubleWireCheck++) {
57  if( wireId == (*doubleWireCheck).wireId()) {
58  isDouble = true;
59  // std::cout << " Reject this hit with time " << (*digi).time() << std::endl;
60  break;
61  }
62  }
63 
64  if (isDouble) continue;
65 
66  LocalError tmpErr;
67  LocalPoint lpoint, rpoint;
68  // Call the compute method
69  bool OK = compute(layer, *digi, lpoint, rpoint, tmpErr);
70 
71  if (!OK) continue;
72 
73  // Build a new pair of 1D rechit
74  DTRecHit1DPair* recHitPair = new DTRecHit1DPair(wireId, *digi);
75 
76  // Set the position and the error of the 1D rechits
77  recHitPair->setPositionAndError(DTEnums::Left, lpoint, tmpErr);
78  recHitPair->setPositionAndError(DTEnums::Right, rpoint, tmpErr);
79 
80  result.push_back(recHitPair);
81  }
82  return result;
83 }
pair< int, edm::FunctionWithDict > OK
Definition: findMethod.cc:72
iterator begin()
Definition: OwnVector.h:228
void push_back(D *&d)
Definition: OwnVector.h:274
virtual bool compute(const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const
void setPositionAndError(DTEnums::DTCellSide lrside, const LocalPoint &point, const LocalError &err)
tuple result
Definition: query.py:137
iterator end()
Definition: OwnVector.h:233
std::vector< DTDigi >::const_iterator const_iterator
void DTNoDriftAlgo::setES ( const edm::EventSetup setup)
virtual

Pass the Event Setup to the algo at each event.

Implements DTRecHitBaseAlgo.

Definition at line 33 of file DTNoDriftAlgo.cc.

33  {
34  // theSync->setES(setup);
35 }

Member Data Documentation

const bool DTNoDriftAlgo::debug
private

Definition at line 105 of file DTNoDriftAlgo.h.

Referenced by compute().

const float DTNoDriftAlgo::fixedDrift
private

Definition at line 93 of file DTNoDriftAlgo.h.

Referenced by compute().

const float DTNoDriftAlgo::hitResolution
private

Definition at line 96 of file DTNoDriftAlgo.h.

Referenced by compute().

const float DTNoDriftAlgo::maxTime
private

Definition at line 102 of file DTNoDriftAlgo.h.

Referenced by compute().

const float DTNoDriftAlgo::minTime
private

Definition at line 99 of file DTNoDriftAlgo.h.