#include <DTMeantimerPatternReco4D.h>
Algo for reconstructing 4d segment in DT using a Meantimer approach
Definition at line 41 of file DTMeantimerPatternReco4D.h.
DTMeantimerPatternReco4D::DTMeantimerPatternReco4D | ( | const edm::ParameterSet & | pset | ) |
Constructor.
Definition at line 34 of file DTMeantimerPatternReco4D.cc.
References allDTRecHits, debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), the2DAlgo, and theUpdator.
: DTRecSegment4DBaseAlgo(pset), theAlgoName("DTMeantimerPatternReco4D"){ // debug parameter debug = pset.getUntrackedParameter<bool>("debug"); // the updator theUpdator = new DTSegmentUpdator(pset); // the input type. // If true the instructions in setDTRecSegment2DContainer will be schipped and the // theta segment will be recomputed from the 1D rechits // If false the theta segment will be taken from the Event. Caveat: in this case the // event must contain the 2D segments! allDTRecHits = pset.getParameter<bool>("AllDTRecHits"); // Get the concrete 2D-segments reconstruction algo from the factory // For the 2D reco I use this reconstructor! the2DAlgo = new DTMeantimerPatternReco(pset.getParameter<ParameterSet>("Reco2DAlgoConfig")); }
DTMeantimerPatternReco4D::~DTMeantimerPatternReco4D | ( | ) | [virtual] |
Destructor.
Definition at line 56 of file DTMeantimerPatternReco4D.cc.
References the2DAlgo, and theUpdator.
{ delete the2DAlgo; delete theUpdator; }
virtual std::string DTMeantimerPatternReco4D::algoName | ( | void | ) | const [inline, virtual] |
Implements DTRecSegment4DBaseAlgo.
Definition at line 54 of file DTMeantimerPatternReco4D.h.
References theAlgoName.
{ return theAlgoName; }
vector< DTSegmentCand * > DTMeantimerPatternReco4D::buildPhiSuperSegmentsCandidates | ( | ) | [private] |
Definition at line 263 of file DTCombinatorialPatternReco4D.cc.
References DTCombinatorialPatternReco::buildSegments(), filterCSVwithJSON::copy, gather_cfg::cout, DTCombinatorialPatternReco4D::debug, DTCombinatorialPatternReco::initHits(), DTCombinatorialPatternReco4D::the2DAlgo, DTCombinatorialPatternReco4D::theDTGeometry, DTCombinatorialPatternReco4D::theHitsFromPhi1, and DTCombinatorialPatternReco4D::theHitsFromPhi2.
Referenced by reconstruct().
{ DTSuperLayerId slId; if(theHitsFromPhi1.size()) slId = theHitsFromPhi1.front().wireId().superlayerId(); else if(theHitsFromPhi2.size()) slId = theHitsFromPhi2.front().wireId().superlayerId(); else{ if(debug) cout<<"DTCombinatorialPatternReco4D::buildPhiSuperSegmentsCandidates: " <<"No Hits in the two Phi SL"<<endl; return vector<DTSegmentCand*>(); } const DTSuperLayer *sl = theDTGeometry->superLayer(slId); vector<DTHitPairForFit*> pairPhi1 = the2DAlgo->initHits(sl,theHitsFromPhi1); // same sl!! Since the fit will be in the sl phi 1! vector<DTHitPairForFit*> pairPhi2 = the2DAlgo->initHits(sl,theHitsFromPhi2); // copy the pairPhi2 in the pairPhi1 vector copy(pairPhi2.begin(),pairPhi2.end(),back_inserter(pairPhi1)); pairPhiOwned.swap(pairPhi1); // Build the segment candidate return the2DAlgo->buildSegments(sl,pairPhiOwned); }
OwnVector< DTRecSegment4D > DTMeantimerPatternReco4D::reconstruct | ( | ) | [virtual] |
Operations.
4d segment: I have the pos along the wire => further update!
Implements DTRecSegment4DBaseAlgo.
Definition at line 124 of file DTMeantimerPatternReco4D.cc.
References allDTRecHits, edm::OwnVector< T, P >::begin(), buildPhiSuperSegmentsCandidates(), gather_cfg::cout, debug, edm::OwnVector< T, P >::end(), DTChamber::id(), phi, edm::OwnVector< T, P >::push_back(), DTMeantimerPatternReco::reconstruct(), query::result, DTChamber::superLayer(), the2DAlgo, theChamber, theHitsFromTheta, theSegments2DTheta, theUpdator, GeomDet::toGlobal(), GeomDet::toLocal(), and DTSegmentUpdator::update().
{ OwnVector<DTRecSegment4D> result; if (debug){ cout << "Segments in " << theChamber->id() << endl; cout << "Reconstructing Phi segments"<<endl; } vector<DTSegmentCand*> resultPhi = buildPhiSuperSegmentsCandidates(); if (debug) cout << "There are " << resultPhi.size() << " Phi cand" << endl; if (allDTRecHits){ // take the theta SL of this chamber const DTSuperLayer* sl = theChamber->superLayer(2); // sl points to 0 if the theta SL was not found if(sl){ // reconstruct the theta segments if(debug) cout << "Reconstructing Theta segments"<<endl; OwnVector<DTSLRecSegment2D> thetaSegs = the2DAlgo->reconstruct(sl, theHitsFromTheta); vector<DTSLRecSegment2D> segments2DTheta(thetaSegs.begin(),thetaSegs.end()); theSegments2DTheta = segments2DTheta; } } bool hasZed=false; // has this chamber the Z-superlayer? if (theSegments2DTheta.size()){ hasZed = theSegments2DTheta.size()>0; if (debug) cout << "There are " << theSegments2DTheta.size() << " Theta cand" << endl; } else { if (debug) cout << "No Theta SL" << endl; } // Now I want to build the concrete DTRecSegment4D. if(debug) cout<<"Building the concrete DTRecSegment4D"<<endl; if (resultPhi.size()) { for (vector<DTSegmentCand*>::const_iterator phi=resultPhi.begin(); phi!=resultPhi.end(); ++phi) { DTChamberRecSegment2D* superPhi = (**phi); theUpdator->update(superPhi); if (hasZed) { // Create all the 4D-segment combining the Z view with the Phi one // loop over the Z segments for(vector<DTSLRecSegment2D>::const_iterator zed = theSegments2DTheta.begin(); zed != theSegments2DTheta.end(); ++zed){ // Important!! DTSuperLayerId ZedSegSLId(zed->geographicalId().rawId()); const LocalPoint posZInCh = theChamber->toLocal( theChamber->superLayer(ZedSegSLId)->toGlobal(zed->localPosition() )) ; const LocalVector dirZInCh = theChamber->toLocal( theChamber->superLayer(ZedSegSLId)->toGlobal(zed->localDirection() )) ; DTRecSegment4D* newSeg = new DTRecSegment4D(*superPhi,*zed,posZInCh,dirZInCh); //<< theUpdator->update(newSeg); if (debug) cout << "Created a 4D seg " << *newSeg << endl; result.push_back(newSeg); } } else { // Only phi DTRecSegment4D* newSeg = new DTRecSegment4D(*superPhi); if (debug) cout << "Created a 4D segment using only the 2D Phi segment" << endl; result.push_back(newSeg); } } } else { // DTRecSegment4D from zed projection only (unlikely, not so useful, but...) if (hasZed) { for(vector<DTSLRecSegment2D>::const_iterator zed = theSegments2DTheta.begin(); zed != theSegments2DTheta.end(); ++zed){ // Important!! DTSuperLayerId ZedSegSLId(zed->geographicalId().rawId()); const LocalPoint posZInCh = theChamber->toLocal( theChamber->superLayer(ZedSegSLId)->toGlobal(zed->localPosition() )) ; const LocalVector dirZInCh = theChamber->toLocal( theChamber->superLayer(ZedSegSLId)->toGlobal(zed->localDirection() )) ; DTRecSegment4D* newSeg = new DTRecSegment4D( *zed,posZInCh,dirZInCh); // << if (debug) cout << "Created a 4D segment using only the 2D Theta segment" << endl; result.push_back(newSeg); } } } // finally delete the candidates! for (vector<DTSegmentCand*>::iterator phi=resultPhi.begin(); phi!=resultPhi.end(); ++phi) delete *phi; return result; }
DTRecSegment4D* DTMeantimerPatternReco4D::segmentSpecialZed | ( | DTRecSegment4D * | seg | ) | [private] |
void DTMeantimerPatternReco4D::setChamber | ( | const DTChamberId & | chId | ) | [virtual] |
Implements DTRecSegment4DBaseAlgo.
Definition at line 67 of file DTMeantimerPatternReco4D.cc.
References theChamber, and theDTGeometry.
{ // Set the chamber theChamber = theDTGeometry->chamber(chId); }
void DTMeantimerPatternReco4D::setDTRecHit1DContainer | ( | edm::Handle< DTRecHitCollection > | all1DHits | ) | [virtual] |
Implements DTRecSegment4DBaseAlgo.
Definition at line 72 of file DTMeantimerPatternReco4D.cc.
References allDTRecHits, gather_cfg::cout, debug, DTSuperLayerId, DTChamber::id(), DTRangeMapAccessor::layersBySuperLayer(), theChamber, theHitsFromPhi1, theHitsFromPhi2, and theHitsFromTheta.
{ theHitsFromPhi1.clear(); theHitsFromPhi2.clear(); theHitsFromTheta.clear(); DTRecHitCollection::range rangeHitsFromPhi1 = all1DHits->get(DTRangeMapAccessor::layersBySuperLayer( DTSuperLayerId(theChamber->id(),1) ) ); DTRecHitCollection::range rangeHitsFromPhi2 = all1DHits->get(DTRangeMapAccessor::layersBySuperLayer( DTSuperLayerId(theChamber->id(),3) ) ); vector<DTRecHit1DPair> hitsFromPhi1(rangeHitsFromPhi1.first,rangeHitsFromPhi1.second); vector<DTRecHit1DPair> hitsFromPhi2(rangeHitsFromPhi2.first,rangeHitsFromPhi2.second); if(debug) cout<< "Number of DTRecHit1DPair in the SL 1 (Phi 1): " << hitsFromPhi1.size()<<endl << "Number of DTRecHit1DPair in the SL 3 (Phi 2): " << hitsFromPhi2.size()<<endl; theHitsFromPhi1 = hitsFromPhi1; theHitsFromPhi2 = hitsFromPhi2; if(allDTRecHits){ DTRecHitCollection::range rangeHitsFromTheta = all1DHits->get(DTRangeMapAccessor::layersBySuperLayer( DTSuperLayerId(theChamber->id(),2) ) ); vector<DTRecHit1DPair> hitsFromTheta(rangeHitsFromTheta.first,rangeHitsFromTheta.second); if(debug) cout<< "Number of DTRecHit1DPair in the SL 2 (Theta): " << hitsFromTheta.size()<<endl; theHitsFromTheta = hitsFromTheta; } }
void DTMeantimerPatternReco4D::setDTRecSegment2DContainer | ( | edm::Handle< DTRecSegment2DCollection > | all2DSegments | ) | [virtual] |
Implements DTRecSegment4DBaseAlgo.
Definition at line 103 of file DTMeantimerPatternReco4D.cc.
References allDTRecHits, gather_cfg::cout, debug, DTSuperLayerId, DTChamber::id(), theChamber, and theSegments2DTheta.
{ theSegments2DTheta.clear(); if(!allDTRecHits){ //Extract the DTRecSegment2DCollection range for the theta SL DTRecSegment2DCollection::range rangeTheta = all2DSegments->get(DTSuperLayerId(theChamber->id(),2)); // Fill the DTRecSegment2D container for the theta SL vector<DTSLRecSegment2D> segments2DTheta(rangeTheta.first,rangeTheta.second); if(debug) cout << "Number of 2D-segments in the second SL (Theta): " << segments2DTheta.size() << endl; theSegments2DTheta = segments2DTheta; } }
void DTMeantimerPatternReco4D::setES | ( | const edm::EventSetup & | setup | ) | [virtual] |
Implements DTRecSegment4DBaseAlgo.
Definition at line 61 of file DTMeantimerPatternReco4D.cc.
References edm::EventSetup::get(), DTMeantimerPatternReco::setES(), DTSegmentUpdator::setES(), the2DAlgo, theDTGeometry, and theUpdator.
{ setup.get<MuonGeometryRecord>().get(theDTGeometry); the2DAlgo->setES(setup); theUpdator->setES(setup); }
virtual bool DTMeantimerPatternReco4D::wants2DSegments | ( | ) | [inline, virtual] |
Implements DTRecSegment4DBaseAlgo.
Definition at line 60 of file DTMeantimerPatternReco4D.h.
References allDTRecHits.
{return !allDTRecHits;}
bool DTMeantimerPatternReco4D::allDTRecHits [private] |
Definition at line 87 of file DTMeantimerPatternReco4D.h.
Referenced by DTMeantimerPatternReco4D(), reconstruct(), setDTRecHit1DContainer(), setDTRecSegment2DContainer(), and wants2DSegments().
bool DTMeantimerPatternReco4D::debug [private] |
Definition at line 71 of file DTMeantimerPatternReco4D.h.
Referenced by DTMeantimerPatternReco4D(), reconstruct(), setDTRecHit1DContainer(), and setDTRecSegment2DContainer().
Definition at line 79 of file DTMeantimerPatternReco4D.h.
Referenced by DTMeantimerPatternReco4D(), reconstruct(), setES(), and ~DTMeantimerPatternReco4D().
std::string DTMeantimerPatternReco4D::theAlgoName [private] |
Definition at line 69 of file DTMeantimerPatternReco4D.h.
Referenced by algoName().
const DTChamber* DTMeantimerPatternReco4D::theChamber [private] |
Definition at line 84 of file DTMeantimerPatternReco4D.h.
Referenced by reconstruct(), setChamber(), setDTRecHit1DContainer(), and setDTRecSegment2DContainer().
Definition at line 75 of file DTMeantimerPatternReco4D.h.
Referenced by setChamber(), and setES().
std::vector<DTRecHit1DPair> DTMeantimerPatternReco4D::theHitsFromPhi1 [private] |
Definition at line 91 of file DTMeantimerPatternReco4D.h.
Referenced by setDTRecHit1DContainer().
std::vector<DTRecHit1DPair> DTMeantimerPatternReco4D::theHitsFromPhi2 [private] |
Definition at line 93 of file DTMeantimerPatternReco4D.h.
Referenced by setDTRecHit1DContainer().
std::vector<DTRecHit1DPair> DTMeantimerPatternReco4D::theHitsFromTheta [private] |
Definition at line 92 of file DTMeantimerPatternReco4D.h.
Referenced by reconstruct(), and setDTRecHit1DContainer().
std::vector<DTSLRecSegment2D> DTMeantimerPatternReco4D::theSegments2DTheta [private] |
Definition at line 90 of file DTMeantimerPatternReco4D.h.
Referenced by reconstruct(), and setDTRecSegment2DContainer().
Definition at line 82 of file DTMeantimerPatternReco4D.h.
Referenced by DTMeantimerPatternReco4D(), reconstruct(), setES(), and ~DTMeantimerPatternReco4D().