#include <RecoLocalMuon/DTRecHit/plugins/DTNoDriftAlgo.h>
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. | |
DTNoDriftAlgo (const edm::ParameterSet &config) | |
Constructor. | |
virtual edm::OwnVector < DTRecHit1DPair > | reconstruct (const DTLayer *layer, const DTLayerId &layerId, const DTDigiCollection::Range &digiRange) |
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. | |
virtual void | setES (const edm::EventSetup &setup) |
Pass the Event Setup to the algo at each event. | |
virtual | ~DTNoDriftAlgo () |
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 | fixedDrift |
static float | hitResolution |
static float | maxTime |
static float | minTime |
Create pair of RecHits at fixed distance from the wire.
Definition at line 19 of file DTNoDriftAlgo.h.
DTNoDriftAlgo::DTNoDriftAlgo | ( | const edm::ParameterSet & | config | ) |
Constructor.
Definition at line 20 of file DTNoDriftAlgo.cc.
References debug, fixedDrift, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hitResolution, maxTime, and minTime.
00020 : 00021 DTRecHitBaseAlgo(config) { 00022 00023 minTime = config.getParameter<double>("minTime"); 00024 00025 maxTime = config.getParameter<double>("maxTime"); 00026 00027 fixedDrift = config.getParameter<double>("fixedDrift"); 00028 00029 hitResolution = config.getParameter<double>("hitResolution"); // Set to size of (half)cell 00030 // Set verbose output 00031 debug = config.getUntrackedParameter<bool>("debug"); 00032 00033 }
DTNoDriftAlgo::~DTNoDriftAlgo | ( | ) | [virtual] |
bool DTNoDriftAlgo::compute | ( | const DTLayer * | layer, | |
const DTWireId & | wireId, | |||
const float | digiTime, | |||
const GlobalPoint & | globPos, | |||
DTRecHit1D & | newHit1D, | |||
int | step | |||
) | const [private, virtual] |
Definition at line 201 of file DTNoDriftAlgo.cc.
References compute(), lat::endl(), error, Exception, DTEnums::Left, DTRecHit1D::lrSide(), DTEnums::Right, and DTRecHit1D::setPositionAndError().
00206 { 00207 LocalPoint leftPoint; 00208 LocalPoint rightPoint; 00209 LocalError error; 00210 00211 if(compute(layer, wireId, digiTime, globPos, leftPoint, rightPoint, error, step)) { 00212 // Set the position and the error of the rechit which is being updated 00213 switch(newHit1D.lrSide()) { 00214 00215 case DTEnums::Left: 00216 newHit1D.setPositionAndError(leftPoint, error); 00217 break; 00218 00219 case DTEnums::Right: 00220 newHit1D.setPositionAndError(rightPoint, error); 00221 break; 00222 00223 default: 00224 throw cms::Exception("InvalidDTCellSide") << "[DTNoDriftAlgo] Compute at Step " 00225 << step << ", Hit side " 00226 << newHit1D.lrSide() 00227 << " is invalid!" << endl; 00228 return false; 00229 } 00230 00231 return true; 00232 }else { 00233 return false; 00234 } 00235 }
bool DTNoDriftAlgo::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 139 of file DTNoDriftAlgo.cc.
References GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), fixedDrift, hitResolution, maxTime, DTLayer::specificTopology(), DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
00146 { 00147 //} 00148 00149 // Small negative times interpreted as hits close to the wire. 00150 //if (driftTime<0.) driftTime=0; 00151 00152 00153 // check for out-of-time 00154 if (digiTime < minTime || digiTime > maxTime) { 00155 if (debug) cout << "[DTNoDriftAlgo]*** Drift time out of window for in-time hits " 00156 << digiTime << endl; 00157 00158 if(step == 1) { //FIXME: protection against failure at 2nd and 3rd steps, must be checked!!! 00159 // Hits are interpreted as coming from out-of-time pile-up and recHit 00160 // is ignored. 00161 return false; 00162 } 00163 } 00164 00165 00166 // Compute the drift distance 00167 float drift = fixedDrift; 00168 00169 // Get Wire position 00170 LocalPoint locWirePos(layer->specificTopology().wirePosition(wireId.wire()), 0, 0); 00171 //Build the two possible points and the error on the position 00172 leftPoint = LocalPoint(locWirePos.x()-drift, 00173 locWirePos.y(), 00174 locWirePos.z()); 00175 rightPoint = LocalPoint(locWirePos.x()+drift, 00176 locWirePos.y(), 00177 locWirePos.z()); 00178 error = LocalError(hitResolution*hitResolution,0.,0.); 00179 00180 00181 if(debug) { 00182 cout << "[DTNoDriftAlgo] Compute drift distance, for digi at wire: " << wireId << endl 00183 << " Step: " << step << endl 00184 << " Digi time: " << digiTime << endl 00185 // << " Drift time: " << driftTime << endl 00186 << " Fixed Drift distance: " << drift << endl 00187 << " Hit Resolution: " << hitResolution << endl 00188 << " Left point: " << leftPoint << endl 00189 << " Right point: " << rightPoint << endl 00190 << " Error: " << error << endl; 00191 } 00192 00193 00194 00195 return true; 00196 00197 }
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 128 of file DTNoDriftAlgo.cc.
References compute(), DTRecHit1D::digiTime(), and DTRecHit1D::wireId().
00132 { 00133 return compute(layer, recHit1D.wireId(), recHit1D.digiTime(), globPos, newHit1D, 3); 00134 }
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 117 of file DTNoDriftAlgo.cc.
References DTRecHit1D::localPosition(), DTRecHit1D::localPositionError(), and DTRecHit1D::setPositionAndError().
00120 { 00121 newHit1D.setPositionAndError(recHit1D.localPosition(), recHit1D.localPositionError()); 00122 return true; 00123 }
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 98 of file DTNoDriftAlgo.cc.
References DTLayer::id(), DTLayer::specificTopology(), DTDigi::time(), GeomDet::toGlobal(), DTDigi::wire(), and DTTopology::wirePosition().
Referenced by compute(), and reconstruct().
00102 { 00103 // Get the wireId 00104 DTLayerId layerId = layer->id(); 00105 const DTWireId wireId(layerId, digi.wire()); 00106 00107 // Get Wire position 00108 LocalPoint locWirePos(layer->specificTopology().wirePosition(digi.wire()), 0, 0); 00109 const GlobalPoint globWirePos = layer->toGlobal(locWirePos); 00110 00111 return compute(layer, wireId, digi.time(), globWirePos, leftPoint, rightPoint, error, 1); 00112 }
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 49 of file DTNoDriftAlgo.cc.
References edm::OwnVector< T, P >::begin(), compute(), edm::OwnVector< T, P >::end(), DTEnums::Left, edm::OwnVector< T, P >::push_back(), HLT_VtxMuL3::result, DTEnums::Right, and DTRecHit1DPair::setPositionAndError().
00051 { 00052 OwnVector<DTRecHit1DPair> result; 00053 00054 // Loop over all digis in the given range 00055 for (DTDigiCollection::const_iterator digi = digiRange.first; 00056 digi != digiRange.second; 00057 digi++) { 00058 // Get the wireId 00059 DTWireId wireId(layerId, (*digi).wire()); 00060 00061 bool isDouble = false; 00062 for (OwnVector<DTRecHit1DPair>::const_iterator doubleWireCheck = result.begin(); 00063 doubleWireCheck != result.end(); 00064 doubleWireCheck++) { 00065 if( wireId == (*doubleWireCheck).wireId()) { 00066 isDouble = true; 00067 // std::cout << " Reject this hit with time " << (*digi).time() << std::endl; 00068 break; 00069 } 00070 } 00071 00072 if (isDouble) continue; 00073 00074 LocalError tmpErr; 00075 LocalPoint lpoint, rpoint; 00076 // Call the compute method 00077 bool OK = compute(layer, *digi, lpoint, rpoint, tmpErr); 00078 00079 if (!OK) continue; 00080 00081 // Build a new pair of 1D rechit 00082 DTRecHit1DPair* recHitPair = new DTRecHit1DPair(wireId, *digi); 00083 00084 // Set the position and the error of the 1D rechits 00085 recHitPair->setPositionAndError(DTEnums::Left, lpoint, tmpErr); 00086 recHitPair->setPositionAndError(DTEnums::Right, rpoint, tmpErr); 00087 00088 result.push_back(recHitPair); 00089 } 00090 return result; 00091 }
void DTNoDriftAlgo::setES | ( | const edm::EventSetup & | setup | ) | [virtual] |
Pass the Event Setup to the algo at each event.
Implements DTRecHitBaseAlgo.
Definition at line 41 of file DTNoDriftAlgo.cc.
bool DTNoDriftAlgo::debug [static, private] |
float DTNoDriftAlgo::fixedDrift [static, private] |
float DTNoDriftAlgo::hitResolution [static, private] |
float DTNoDriftAlgo::maxTime [static, private] |
float DTNoDriftAlgo::minTime [static, private] |