CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Static Private Attributes

DTLinearDriftAlgo Class Reference

#include <DTLinearDriftAlgo.h>

Inheritance diagram for DTLinearDriftAlgo:
DTRecHitBaseAlgo

List of all members.

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.
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, 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

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.

                                                               :
  DTRecHitBaseAlgo(config) {
    // Get the Drift Velocity from parameter set. 
    vDrift = config.getParameter<double>("driftVelocity"); // FIXME: Default was 0.00543 cm/ns
    // vDriftMB1W1 = config.getParameter<double>("driftVelocityMB1W1"); // FIXME: Default was 0.00543 cm/ns

    minTime = config.getParameter<double>("minTime"); // FIXME: Default was -3 ns

    maxTime = config.getParameter<double>("maxTime"); // FIXME: Default was 415 ns

    hitResolution = config.getParameter<double>("hitResolution"); // FIXME: Default is 
    // Set verbose output
    debug = config.getUntrackedParameter<bool>("debug");
    
  }
DTLinearDriftAlgo::~DTLinearDriftAlgo ( ) [virtual]

Destructor.

Definition at line 38 of file DTLinearDriftAlgo.cc.

{}

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().

                                                         {
  // Get the wireId
  DTLayerId layerId = layer->id();
  const DTWireId wireId(layerId, digi.wire());

  // Get Wire position
  if(!layer->specificTopology().isWireValid(digi.wire())) return false;
  LocalPoint locWirePos(layer->specificTopology().wirePosition(digi.wire()), 0, 0);
  const GlobalPoint globWirePos = layer->toGlobal(locWirePos);
  
  return compute(layer, wireId, digi.time(), globWirePos, leftPoint, rightPoint, error, 1); 
}
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 158 of file DTLinearDriftAlgo.cc.

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

                                                {
  LocalPoint leftPoint;
  LocalPoint rightPoint;
  LocalError error;

  if(compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) {
    // Set the position and the error of the rechit which is being updated
    switch(newHit1D.lrSide()) {
        
    case DTEnums::Left:
        {
          // Keep the original y position of newHit1D: for step==3, it's the
          // position along the wire. Needed for rotation alignment
          LocalPoint leftPoint3D(leftPoint.x(), newHit1D.localPosition().y(), leftPoint.z());
          newHit1D.setPositionAndError(leftPoint3D, error);
          break;
        }
        
    case DTEnums::Right:
        {
          // as above: 3d position
          LocalPoint rightPoint3D(rightPoint.x(), newHit1D.localPosition().y(), rightPoint.z());
          newHit1D.setPositionAndError(rightPoint3D, error);
          break;
        }
        
    default:
      throw cms::Exception("InvalidDTCellSide") << "[DTLinearDriftAlgo] Compute at Step "
                                                << step << ", Hit side "
                                                << newHit1D.lrSide()
                                                << " is invalid!" << endl;
      return false;
    }
      
    return true;
  }else {
    return false;
  }
}
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 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().

                                                {
  // Subtract the offset to the digi time accordingly to the DTTTrigBaseSync concrete instance
  float driftTime = digiTime - theSync->offset(layer, wireId, globPos); 
  
  // check for out-of-time
  if (driftTime < minTime || driftTime > maxTime) {
    if (debug) cout << "[DTLinearDriftAlgo]*** Drift time out of window for in-time hits "
                              << driftTime << endl;

    if(step == 1) { //FIXME: protection against failure at 2nd and 3rd steps, must be checked!!!
      // Hits are interpreted as coming from out-of-time pile-up and recHit
      // is ignored.
      return false;
    }
  }

  // Small negative times interpreted as hits close to the wire.
  if (driftTime<0.) driftTime=0;

  // Compute the drift distance
  // SL 21-Dec-2006: Use specific Drift for MB1W1 (non fluxed chamber)
  float vd=vDrift;
  // if (wireId.wheel()==1 && wireId.station()==1) {
  //   vd=vDriftMB1W1;
  //   //cout << "Using Vd " << vd<< endl;
  // }

  float drift = driftTime * vd;

  // Get Wire position
  if(!layer->specificTopology().isWireValid(wireId.wire())) return false;
  LocalPoint locWirePos(layer->specificTopology().wirePosition(wireId.wire()), 0, 0);
  //Build the two possible points and the error on the position
  leftPoint  = LocalPoint(locWirePos.x()-drift,
                            locWirePos.y(),
                            locWirePos.z());
  rightPoint = LocalPoint(locWirePos.x()+drift,
                            locWirePos.y(),
                            locWirePos.z());
  error = LocalError(hitResolution*hitResolution,0.,0.);


  if(debug) {
    cout << "[DTLinearDriftAlgo] Compute drift distance, for digi at wire: " << wireId << endl
         << "       Step:           " << step << endl
         << "       Digi time:      " << digiTime << endl
         << "       Drift time:     " << driftTime << endl
         << "       Drift distance: " << drift << endl
         << "       Hit Resolution: " << hitResolution << endl
         << "       Left point:     " << leftPoint << endl
         << "       Right point:    " << rightPoint << endl
         << "       Error:          " << error << endl;
   }
  
  return true;
  
}
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().

                                                            {
  return compute(layer, recHit1D.wireId(), recHit1D.digiTime(), globPos, newHit1D, 3);
}
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().

                                                            {
  newHit1D.setPositionAndError(recHit1D.localPosition(), recHit1D.localPositionError());
  return true;
}
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.

                                                     {
  theSync->setES(setup);
}

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().