CMS 3D CMS Logo

DTLinearDriftAlgo Class Reference

Concrete implementation of DTRecHitBaseAlgo. More...

#include <RecoLocalMuon/DTRecHit/plugins/DTLinearDriftAlgo.h>

Inheritance diagram for DTLinearDriftAlgo:

DTRecHitBaseAlgo

List of all members.

Public Member Functions

virtual bool compute (const DTLayer *layer, const DTRecHit1D &recHit1D, const float &angle, const GlobalPoint &globPos, DTRecHit1D &newHit1D) const
 Third (and final) step in hits position computation.
virtual bool compute (const DTLayer *layer, const DTRecHit1D &recHit1D, const float &angle, DTRecHit1D &newHit1D) const
 Second step in hit position computation.
virtual bool compute (const DTLayer *layer, const DTDigi &digi, LocalPoint &leftPoint, LocalPoint &rightPoint, LocalError &error) const
 First step in computation of Left/Right hits from a Digi.
 DTLinearDriftAlgo (const edm::ParameterSet &config)
 Constructor.
virtual void setES (const edm::EventSetup &setup)
 Pass the Event Setup to the algo at each event.
virtual ~DTLinearDriftAlgo ()
 Destructor.

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

Static Private Attributes

static bool debug
static float hitResolution
static float maxTime
static float minTime
static float vDrift


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.

00020                                                                :
00021   DTRecHitBaseAlgo(config) {
00022     // Get the Drift Velocity from parameter set. 
00023     vDrift = config.getParameter<double>("driftVelocity"); // FIXME: Default was 0.00543 cm/ns
00024     // vDriftMB1W1 = config.getParameter<double>("driftVelocityMB1W1"); // FIXME: Default was 0.00543 cm/ns
00025 
00026     minTime = config.getParameter<double>("minTime"); // FIXME: Default was -3 ns
00027 
00028     maxTime = config.getParameter<double>("maxTime"); // FIXME: Default was 415 ns
00029 
00030     hitResolution = config.getParameter<double>("hitResolution"); // FIXME: Default is 
00031     // Set verbose output
00032     debug = config.getUntrackedParameter<bool>("debug");
00033     
00034   }

DTLinearDriftAlgo::~DTLinearDriftAlgo (  )  [virtual]

Destructor.

Definition at line 38 of file DTLinearDriftAlgo.cc.

00038 {}


Member Function Documentation

bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTWireId wireId,
const float  digiTime,
const GlobalPoint globPos,
DTRecHit1D newHit1D,
int  step 
) const [private, virtual]

Definition at line 156 of file DTLinearDriftAlgo.cc.

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

00161                                                 {
00162   LocalPoint leftPoint;
00163   LocalPoint rightPoint;
00164   LocalError error;
00165 
00166   if(compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) {
00167     // Set the position and the error of the rechit which is being updated
00168     switch(newHit1D.lrSide()) {
00169         
00170     case DTEnums::Left:
00171         {
00172           // Keep the original y position of newHit1D: for step==3, it's the
00173           // position along the wire. Needed for rotation alignment
00174           LocalPoint leftPoint3D(leftPoint.x(), newHit1D.localPosition().y(), leftPoint.z());
00175           newHit1D.setPositionAndError(leftPoint3D, error);
00176           break;
00177         }
00178         
00179     case DTEnums::Right:
00180         {
00181           // as above: 3d position
00182           LocalPoint rightPoint3D(rightPoint.x(), newHit1D.localPosition().y(), rightPoint.z());
00183           newHit1D.setPositionAndError(rightPoint3D, error);
00184           break;
00185         }
00186         
00187     default:
00188       throw cms::Exception("InvalidDTCellSide") << "[DTLinearDriftAlgo] Compute at Step "
00189                                                 << step << ", Hit side "
00190                                                 << newHit1D.lrSide()
00191                                                 << " is invalid!" << endl;
00192       return false;
00193     }
00194       
00195     return true;
00196   }else {
00197     return false;
00198   }
00199 }

bool DTLinearDriftAlgo::compute ( const DTLayer layer,
const DTWireId wireId,
const float  digiTime,
const GlobalPoint globPos,
LocalPoint leftPoint,
LocalPoint rightPoint,
LocalError error,
int  step 
) const [private, virtual]

Definition at line 90 of file DTLinearDriftAlgo.cc.

References GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), hitResolution, 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().

00097                                                 {
00098   // Subtract the offset to the digi time accordingly to the DTTTrigBaseSync concrete instance
00099   float driftTime = digiTime - theSync->offset(layer, wireId, globPos); 
00100   
00101   // check for out-of-time
00102   if (driftTime < minTime || driftTime > maxTime) {
00103     if (debug) cout << "[DTLinearDriftAlgo]*** Drift time out of window for in-time hits "
00104                               << driftTime << endl;
00105 
00106     if(step == 1) { //FIXME: protection against failure at 2nd and 3rd steps, must be checked!!!
00107       // Hits are interpreted as coming from out-of-time pile-up and recHit
00108       // is ignored.
00109       return false;
00110     }
00111   }
00112 
00113   // Small negative times interpreted as hits close to the wire.
00114   if (driftTime<0.) driftTime=0;
00115 
00116   // Compute the drift distance
00117   // SL 21-Dec-2006: Use specific Drift for MB1W1 (non fluxed chamber)
00118   float vd=vDrift;
00119   // if (wireId.wheel()==1 && wireId.station()==1) {
00120   //   vd=vDriftMB1W1;
00121   //   //cout << "Using Vd " << vd<< endl;
00122   // }
00123 
00124   float drift = driftTime * vd;
00125 
00126   // Get Wire position
00127   LocalPoint locWirePos(layer->specificTopology().wirePosition(wireId.wire()), 0, 0);
00128   //Build the two possible points and the error on the position
00129   leftPoint  = LocalPoint(locWirePos.x()-drift,
00130                             locWirePos.y(),
00131                             locWirePos.z());
00132   rightPoint = LocalPoint(locWirePos.x()+drift,
00133                             locWirePos.y(),
00134                             locWirePos.z());
00135   error = LocalError(hitResolution*hitResolution,0.,0.);
00136 
00137 
00138   if(debug) {
00139     cout << "[DTLinearDriftAlgo] Compute drift distance, for digi at wire: " << wireId << endl
00140          << "       Step:           " << step << endl
00141          << "       Digi time:      " << digiTime << endl
00142          << "       Drift time:     " << driftTime << endl
00143          << "       Drift distance: " << drift << endl
00144          << "       Hit Resolution: " << hitResolution << endl
00145          << "       Left point:     " << leftPoint << endl
00146          << "       Right point:    " << rightPoint << endl
00147          << "       Error:          " << error << endl;
00148    }
00149   
00150   return true;
00151   
00152 }

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

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

00083                                                             {
00084   return compute(layer, recHit1D.wireId(), recHit1D.digiTime(), globPos, newHit1D, 3);
00085 }

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

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

00071                                                             {
00072   newHit1D.setPositionAndError(recHit1D.localPosition(), recHit1D.localPositionError());
00073   return true;
00074 }

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 DTLayer::id(), DTLayer::specificTopology(), DTDigi::time(), GeomDet::toGlobal(), DTDigi::wire(), and DTTopology::wirePosition().

Referenced by compute().

00053                                                          {
00054   // Get the wireId
00055   DTLayerId layerId = layer->id();
00056   const DTWireId wireId(layerId, digi.wire());
00057 
00058   // Get Wire position
00059   LocalPoint locWirePos(layer->specificTopology().wirePosition(digi.wire()), 0, 0);
00060   const GlobalPoint globWirePos = layer->toGlobal(locWirePos);
00061   
00062   return compute(layer, wireId, digi.time(), globWirePos, leftPoint, rightPoint, error, 1); 
00063 }

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.

00042                                                      {
00043   theSync->setES(setup);
00044 }


Member Data Documentation

bool DTLinearDriftAlgo::debug [static, private]

Definition at line 100 of file DTLinearDriftAlgo.h.

Referenced by compute(), and DTLinearDriftAlgo().

float DTLinearDriftAlgo::hitResolution [static, private]

Definition at line 91 of file DTLinearDriftAlgo.h.

Referenced by compute(), and DTLinearDriftAlgo().

float DTLinearDriftAlgo::maxTime [static, private]

Definition at line 97 of file DTLinearDriftAlgo.h.

Referenced by compute(), and DTLinearDriftAlgo().

float DTLinearDriftAlgo::minTime [static, private]

Definition at line 94 of file DTLinearDriftAlgo.h.

Referenced by DTLinearDriftAlgo().

float DTLinearDriftAlgo::vDrift [static, private]

Definition at line 86 of file DTLinearDriftAlgo.h.

Referenced by compute(), and DTLinearDriftAlgo().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:55 2009 for CMSSW by  doxygen 1.5.4