#include <CosmicTrajectoryBuilder.h>
Definition at line 73 of file CosmicTrajectoryBuilder.h.
typedef TrajectoryMeasurement CosmicTrajectoryBuilder::TM [private] |
Definition at line 77 of file CosmicTrajectoryBuilder.h.
typedef TrajectoryStateOnSurface CosmicTrajectoryBuilder::TSOS [private] |
Definition at line 76 of file CosmicTrajectoryBuilder.h.
CosmicTrajectoryBuilder::CosmicTrajectoryBuilder | ( | const edm::ParameterSet & | conf | ) |
Definition at line 21 of file CosmicTrajectoryBuilder.cc.
References chi2cut, conf_, geometry, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and theMinHits.
: conf_(conf) { //minimum number of hits per tracks theMinHits=conf_.getParameter<int>("MinHits"); //cut on chi2 chi2cut=conf_.getParameter<double>("Chi2Cut"); edm::LogInfo("CosmicTrackFinder")<<"Minimum number of hits "<<theMinHits<<" Cut on Chi2= "<<chi2cut; geometry=conf_.getUntrackedParameter<std::string>("GeometricStructure","STANDARD"); }
CosmicTrajectoryBuilder::~CosmicTrajectoryBuilder | ( | ) |
Definition at line 33 of file CosmicTrajectoryBuilder.cc.
{ }
void CosmicTrajectoryBuilder::AddHit | ( | Trajectory & | traj, |
std::vector< const TrackingRecHit * > | Hits | ||
) | [private] |
Trajectory CosmicTrajectoryBuilder::createStartingTrajectory | ( | const TrajectorySeed & | seed | ) | const |
Definition at line 130 of file CosmicTrajectoryBuilder.cc.
References TrajectorySeed::direction(), i, query::result, and seedMeasurements().
{ Trajectory result( seed, seed.direction()); std::vector<TM> seedMeas = seedMeasurements(seed); if ( !seedMeas.empty()) { for (std::vector<TM>::const_iterator i=seedMeas.begin(); i!=seedMeas.end(); i++){ result.push(*i); } } return result; }
void CosmicTrajectoryBuilder::init | ( | const edm::EventSetup & | es, |
bool | seedplus | ||
) |
Definition at line 37 of file CosmicTrajectoryBuilder.cc.
References alongMomentum, chi2cut, Chi2MeasurementEstimatorESProducer_cfi::Chi2MeasurementEstimator, conf_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), KFTrajectoryFitterESProducer_cfi::KFTrajectoryFitter, KFTrajectorySmootherESProducer_cfi::KFTrajectorySmoother, magfield, oppositeToMomentum, edm::ESHandle< T >::product(), RHBuilder, seed_plus, theEstimator, theFitter, thePropagator, thePropagatorOp, theSmoother, theUpdator, and tracker.
{ //services es.get<IdealMagneticFieldRecord>().get(magfield); es.get<TrackerDigiGeometryRecord>().get(tracker); if (seedplus) { seed_plus=true; thePropagator= new PropagatorWithMaterial(alongMomentum,0.1057,&(*magfield) ); thePropagatorOp= new PropagatorWithMaterial(oppositeToMomentum,0.1057,&(*magfield) );} else { seed_plus=false; thePropagator= new PropagatorWithMaterial(oppositeToMomentum,0.1057,&(*magfield) ); thePropagatorOp= new PropagatorWithMaterial(alongMomentum,0.1057,&(*magfield) ); } theUpdator= new KFUpdator(); theEstimator= new Chi2MeasurementEstimator(chi2cut); edm::ESHandle<TransientTrackingRecHitBuilder> theBuilder; std::string builderName = conf_.getParameter<std::string>("TTRHBuilder"); es.get<TransientRecHitRecord>().get(builderName,theBuilder); RHBuilder= theBuilder.product(); theFitter= new KFTrajectoryFitter(*thePropagator, *theUpdator, *theEstimator) ; theSmoother= new KFTrajectorySmoother(*thePropagatorOp, *theUpdator, *theEstimator); }
bool CosmicTrajectoryBuilder::qualityFilter | ( | Trajectory | traj | ) | [private] |
Definition at line 347 of file CosmicTrajectoryBuilder.cc.
References Trajectory::foundHits(), geometry, hits, Trajectory::recHits(), and theMinHits.
Referenced by CRackTrajectoryBuilder::AddHit().
{ int ngoodhits=0; if(geometry=="MTCC"){ std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit> > hits= traj.recHits(); std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit> >::const_iterator hit; for(hit=hits.begin();hit!=hits.end();hit++){ unsigned int iid=(*hit)->hit()->geographicalId().rawId(); //CHECK FOR 3 hits r-phi if(((iid>>0)&0x3)!=1) ngoodhits++; } } else ngoodhits=traj.foundHits(); if ( ngoodhits >= theMinHits) { return true; } else { return false; } }
void CosmicTrajectoryBuilder::run | ( | const TrajectorySeedCollection & | collseed, |
const SiStripRecHit2DCollection & | collstereo, | ||
const SiStripRecHit2DCollection & | collrphi, | ||
const SiStripMatchedRecHit2DCollection & | collmatched, | ||
const SiPixelRecHitCollection & | collpixel, | ||
const edm::EventSetup & | es, | ||
edm::Event & | e, | ||
std::vector< Trajectory > & | trajoutput | ||
) |
Runs the algorithm.
Referenced by cms::CosmicTrackFinder::produce().
std::vector< TrajectoryMeasurement > CosmicTrajectoryBuilder::seedMeasurements | ( | const TrajectorySeed & | seed | ) | const [private] |
Definition at line 145 of file CosmicTrajectoryBuilder.cc.
References TransientTrackingRecHitBuilder::build(), TrajectorySeed::recHits(), query::result, RHBuilder, startingTSOS(), and GeomDet::surface().
Referenced by createStartingTrajectory().
{ std::vector<TrajectoryMeasurement> result; TrajectorySeed::range hitRange = seed.recHits(); for (TrajectorySeed::const_iterator ihit = hitRange.first; ihit != hitRange.second; ihit++) { //RC TransientTrackingRecHit* recHit = RHBuilder->build(&(*ihit)); TransientTrackingRecHit::RecHitPointer recHit = RHBuilder->build(&(*ihit)); const GeomDet* hitGeomDet = (&(*tracker))->idToDet( ihit->geographicalId()); TSOS invalidState( new BasicSingleTrajectoryState( hitGeomDet->surface())); if (ihit == hitRange.second - 1) { TSOS updatedState=startingTSOS(seed); result.push_back(TM( invalidState, updatedState, recHit)); } else { result.push_back(TM( invalidState, recHit)); } } return result; }
vector< const TrackingRecHit * > CosmicTrajectoryBuilder::SortHits | ( | const SiStripRecHit2DCollection & | collstereo, |
const SiStripRecHit2DCollection & | collrphi, | ||
const SiStripMatchedRecHit2DCollection & | collmatched, | ||
const SiPixelRecHitCollection & | collpixel, | ||
const TrajectorySeed & | seed | ||
) | [private] |
Definition at line 175 of file CosmicTrajectoryBuilder.cc.
References TransientTrackingRecHitBuilder::build(), edmNew::DetSetVector< T >::data(), hits, LogDebug, TrajectorySeed::recHits(), RHBuilder, seed_plus, and tracker.
{ //The Hits with global y more than the seed are discarded //The Hits correspondign to the seed are discarded //At the end all the hits are sorted in y vector<const TrackingRecHit*> allHits; SiStripRecHit2DCollection::DataContainer::const_iterator istrip; TrajectorySeed::range hRange= seed.recHits(); TrajectorySeed::const_iterator ihit; float yref=0.; for (ihit = hRange.first; ihit != hRange.second; ihit++) { yref=RHBuilder->build(&(*ihit))->globalPosition().y(); hits.push_back((RHBuilder->build(&(*ihit)))); LogDebug("CosmicTrackFinder")<<"SEED HITS"<<RHBuilder->build(&(*ihit))->globalPosition(); } if ((&collpixel)!=0){ SiPixelRecHitCollection::DataContainer::const_iterator ipix; for(ipix=collpixel.data().begin();ipix!=collpixel.data().end();ipix++){ float ych= RHBuilder->build(&(*ipix))->globalPosition().y(); if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref))) allHits.push_back(&(*ipix)); } } if ((&collrphi)!=0){ for(istrip=collrphi.data().begin();istrip!=collrphi.data().end();istrip++){ float ych= RHBuilder->build(&(*istrip))->globalPosition().y(); if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref))) allHits.push_back(&(*istrip)); } } if ((&collstereo)!=0){ for(istrip=collstereo.data().begin();istrip!=collstereo.data().end();istrip++){ float ych= RHBuilder->build(&(*istrip))->globalPosition().y(); if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref))) allHits.push_back(&(*istrip)); } } // SiStripMatchedRecHit2DCollection::DataContainer::const_iterator istripm; // if ((&collmatched)!=0){ // for(istripm=collmatched.data().begin();istripm!=collmatched.data().end();istripm++){ // float ych= RHBuilder->build(&(*istripm))->globalPosition().y(); // if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref))) // allHits.push_back(&(*istripm)); // } // } if (seed_plus){ stable_sort(allHits.begin(),allHits.end(),CompareHitY_plus(*tracker)); } else { stable_sort(allHits.begin(),allHits.end(),CompareHitY(*tracker)); } return allHits; }
TrajectoryStateOnSurface CosmicTrajectoryBuilder::startingTSOS | ( | const TrajectorySeed & | seed | ) | const [private] |
Definition at line 249 of file CosmicTrajectoryBuilder.cc.
References magfield, TrajectorySeed::startingState(), and trajectoryStateTransform::transientState().
Referenced by seedMeasurements().
{ PTrajectoryStateOnDet pState( seed.startingState()); const GeomDet* gdet = (&(*tracker))->idToDet(DetId(pState.detId())); TSOS State= trajectoryStateTransform::transientState( pState, &(gdet->surface()), &(*magfield)); return State; }
void CosmicTrajectoryBuilder::updateTrajectory | ( | Trajectory & | traj, |
const TM & | tm, | ||
const TransientTrackingRecHit & | hit | ||
) | const [private] |
double CosmicTrajectoryBuilder::chi2cut [private] |
Definition at line 135 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), CosmicTrajectoryBuilder(), and init().
Definition at line 122 of file CosmicTrajectoryBuilder.h.
Referenced by CosmicTrajectoryBuilder(), and init().
std::string CosmicTrajectoryBuilder::geometry [private] |
Definition at line 140 of file CosmicTrajectoryBuilder.h.
Referenced by CosmicTrajectoryBuilder(), and qualityFilter().
Definition at line 138 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), qualityFilter(), and SortHits().
Definition at line 120 of file CosmicTrajectoryBuilder.h.
Referenced by init(), and startingTSOS().
const TransientTrackingRecHitBuilder* CosmicTrajectoryBuilder::RHBuilder [private] |
Definition at line 128 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), init(), seedMeasurements(), and SortHits().
bool CosmicTrajectoryBuilder::seed_plus [private] |
Definition at line 139 of file CosmicTrajectoryBuilder.h.
Referenced by init(), and SortHits().
Definition at line 127 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), and init().
const KFTrajectoryFitter* CosmicTrajectoryBuilder::theFitter [private] |
Definition at line 130 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), and init().
int CosmicTrajectoryBuilder::theMinHits [private] |
Definition at line 134 of file CosmicTrajectoryBuilder.h.
Referenced by CosmicTrajectoryBuilder(), and qualityFilter().
Definition at line 124 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), and init().
Definition at line 125 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), and init().
const KFTrajectorySmoother* CosmicTrajectoryBuilder::theSmoother [private] |
Definition at line 129 of file CosmicTrajectoryBuilder.h.
Referenced by init().
KFUpdator* CosmicTrajectoryBuilder::theUpdator [private] |
Definition at line 126 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), and init().
Definition at line 121 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit(), init(), and SortHits().
std::vector<Trajectory> CosmicTrajectoryBuilder::trajFit [private] |
Definition at line 136 of file CosmicTrajectoryBuilder.h.
Referenced by CRackTrajectoryBuilder::AddHit().