CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
CRackTrajectoryBuilder Class Reference

#include <CRackTrajectoryBuilder.h>

Classes

class  CompareDetByTraj
 

Public Member Functions

 CRackTrajectoryBuilder (const edm::ParameterSet &conf)
 
Trajectory createStartingTrajectory (const TrajectorySeed &seed) const
 
const TransientTrackingRecHitBuilderhitBuilder () const
 
void init (const edm::EventSetup &es, bool)
 
void 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. More...
 
 ~CRackTrajectoryBuilder ()
 

Private Types

typedef std::pair< TrackingRecHitRangeIterator, TSOSPairTrackingRecHitTsos
 
typedef TrajectoryMeasurement TM
 
typedef std::vector< const TrackingRecHit * >::iterator TrackingRecHitIterator
 
typedef std::pair< TrackingRecHitIterator, TrackingRecHitIteratorTrackingRecHitRange
 
typedef std::vector< TrackingRecHitRange >::iterator TrackingRecHitRangeIterator
 
typedef TrajectoryStateOnSurface TSOS
 

Private Member Functions

void AddHit (Trajectory &traj, const std::vector< const TrackingRecHit * > &Hits, Propagator *currPropagator)
 
std::pair< TrajectoryStateOnSurface, const GeomDet * > innerState (const Trajectory &traj) const
 
bool isDifferentStripReHit2D (const SiStripRecHit2D &hitA, const SiStripRecHit2D &hitB)
 
bool qualityFilter (const Trajectory &traj)
 
std::vector< TrajectoryMeasurementseedMeasurements (const TrajectorySeed &seed) const
 
std::vector< const TrackingRecHit * > SortHits (const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const SiPixelRecHitCollection &collpixel, const TrajectorySeed &seed, const bool bAddSeedHits)
 
TSOS startingTSOS (const TrajectorySeed &seed) const
 
void updateTrajectory (Trajectory &traj, const TM &tm, const TransientTrackingRecHit &hit) const
 

Private Attributes

double chi2cut
 
bool debug_info
 
bool fastPropagation
 
std::string geometry
 
TransientTrackingRecHit::RecHitContainer hits
 
edm::ESHandle< MagneticFieldmagfield
 
const TransientTrackingRecHitBuilderRHBuilder
 
bool seed_plus
 
std::string theBuilderName
 
Chi2MeasurementEstimatortheEstimator
 
const KFTrajectoryFittertheFitter
 
int theMinHits
 
PropagatorWithMaterialthePropagator
 
PropagatorWithMaterialthePropagatorOp
 
const KFTrajectorySmoothertheSmoother
 
KFUpdatortheUpdator
 
edm::ESHandle< TrackerGeometrytracker
 
std::vector< TrajectorytrajFit
 
bool useMatchedHits
 

Friends

class CompareDetByTraj
 

Detailed Description

Definition at line 125 of file CRackTrajectoryBuilder.h.

Member Typedef Documentation

Definition at line 138 of file CRackTrajectoryBuilder.h.

Definition at line 130 of file CRackTrajectoryBuilder.h.

typedef std::vector<const TrackingRecHit*>::iterator CRackTrajectoryBuilder::TrackingRecHitIterator
private

Definition at line 132 of file CRackTrajectoryBuilder.h.

Definition at line 134 of file CRackTrajectoryBuilder.h.

Definition at line 135 of file CRackTrajectoryBuilder.h.

Definition at line 129 of file CRackTrajectoryBuilder.h.

Constructor & Destructor Documentation

CRackTrajectoryBuilder::CRackTrajectoryBuilder ( const edm::ParameterSet conf)

Definition at line 32 of file CRackTrajectoryBuilder.cc.

References trackAssociatorByChi2_cfi::chi2cut, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

32  {
33  //minimum number of hits per tracks
34 
35  theMinHits=conf.getParameter<int>("MinHits");
36  //cut on chi2
37  chi2cut=conf.getParameter<double>("Chi2Cut");
38  edm::LogInfo("CosmicTrackFinder")<<"Minimum number of hits "<<theMinHits<<" Cut on Chi2= "<<chi2cut;
39 
40  debug_info=conf.getUntrackedParameter<bool>("debug", false);
41  fastPropagation=conf.getUntrackedParameter<bool>("fastPropagation", false);
42  useMatchedHits=conf.getUntrackedParameter<bool>("useMatchedHits", true);
43 
44 
45  geometry=conf.getUntrackedParameter<std::string>("GeometricStructure","STANDARD");
46  theBuilderName = conf.getParameter<std::string>("TTRHBuilder");
47 
48 
49 
50 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
CRackTrajectoryBuilder::~CRackTrajectoryBuilder ( )

Definition at line 53 of file CRackTrajectoryBuilder.cc.

53  {
54 // delete theInitialState;
55 }

Member Function Documentation

void CRackTrajectoryBuilder::AddHit ( Trajectory traj,
const std::vector< const TrackingRecHit * > &  Hits,
Propagator currPropagator 
)
private

do the old version ....

Definition at line 549 of file CRackTrajectoryBuilder.cc.

References trackAssociatorByChi2_cfi::chi2cut, Trajectory::chiSquared(), gather_cfg::cout, spr::find(), TrackingRecHit::geographicalId(), TrajectoryStateOnSurface::globalPosition(), hfClusterShapes_cfi::hits, TrajectoryStateOnSurface::isValid(), Trajectory::lastMeasurement(), Propagator::propagate(), Trajectory::push(), DetId::rawId(), mixOne_simraw_on_sim_cfi::tracker, TrajectoryStateOnSurface::update(), and TrajectoryMeasurement::updatedState().

550  {
551  vector<const TrackingRecHit*> Hits = _Hits;
552  if ( Hits.empty() )
553  return;
554 
555  if (debug_info) cout << "CRackTrajectoryBuilder::AddHit" << endl;
556  if (debug_info) cout << "START " << traj.lastMeasurement().updatedState() << endl;
557 
558  vector <TrackingRecHitRange> hitRangeByDet;
559  TrackingRecHitIterator prevDet;
560 
561  prevDet = Hits.begin();
562  for( TrackingRecHitIterator iHit = Hits.begin(); iHit != Hits.end(); iHit++ )
563  {
564  if ( (*prevDet)->geographicalId() == (*iHit)->geographicalId() )
565  continue;
566 
567  hitRangeByDet.push_back( make_pair( prevDet, iHit ) );
568  prevDet = iHit;
569  }
570  hitRangeByDet.push_back( make_pair( prevDet, Hits.end() ) );
571 
573 
574  if (fastPropagation) {
575  for( TrackingRecHitRangeIterator iHitRange = hitRangeByDet.begin(); iHitRange != hitRangeByDet.end(); iHitRange++ )
576  {
577  const TrackingRecHit *currHit = *(iHitRange->first);
578  DetId currDet = currHit->geographicalId();
579 
580  TSOS prSt= currPropagator->propagate(traj.lastMeasurement().updatedState(),
581  tracker->idToDet(currDet)->surface());
582 
583  if ( !prSt.isValid())
584  {
585  if (debug_info) cout << "Not Valid: PRST" << prSt.globalPosition();
586  // if (debug_info) cout << "Not Valid: HIT" << *currHit;
587 
588 
589  continue;
590  }
591 
593  double chi2min = theEstimator->estimate( prSt, *bestHit).second;
594 
595  if (debug_info) cout << "Size " << iHitRange->first - (*iHitRange).second << endl;
596  for( TrackingRecHitIterator iHit = (*iHitRange).first+1; iHit != iHitRange->second; iHit++ )
597  {
598  if (debug_info) cout << "loop3 " <<" "<< Hits.end() - iHit << endl;
599 
601  double currChi2 = theEstimator->estimate(prSt, *tmpHit).second;
602  if ( currChi2 < chi2min )
603  {
604  chi2min = currChi2;
605  bestHit = tmpHit;
606  }
607  }
608  //now we have check if the track can be added to the trajectory
609  if (debug_info) cout << chi2min << endl;
610  if (chi2min < chi2cut)
611  {
612  if (debug_info) cout << "chi2 fine : " << chi2min << endl;
613  TSOS UpdatedState= theUpdator->update( prSt, *bestHit );
614  if (UpdatedState.isValid()){
615  hits.push_back(bestHit);
616  traj.push( TM(prSt,UpdatedState, bestHit, chi2min) );
617  if (debug_info) edm::LogInfo("CosmicTrackFinder") <<
618  "STATE UPDATED WITH HIT AT POSITION "
619 
620  << bestHit->globalPosition()
621  <<UpdatedState<<" "
622  <<traj.chiSquared();
623  if (debug_info) cout <<
624  "STATE UPDATED WITH HIT AT POSITION "
625 
626  << bestHit->globalPosition()
627  <<UpdatedState<<" "
628  <<traj.chiSquared();
629  if (debug_info) cout << "State is valid ..." << endl;
630  break; // now we need to
631  }
632  else
633  {
634  edm::LogWarning("CosmicTrackFinder")<<" State can not be updated with hit at position " << endl;
635  TSOS UpdatedState= theUpdator->update( prSt, *bestHit );
636  if (UpdatedState.isValid()){
637  cout <<
638  "NOT! UPDATED WITH HIT AT POSITION "
639 
640  << bestHit->globalPosition()
641  <<UpdatedState<<" "
642  <<traj.chiSquared();
643 
644  }
645  }
646  }
647  }
648  } //simple version end
649  else
650  {
651  //first sort the dets in the order they are traversed by the trajectory
652  // we need three loops:
653  // 1: loop as long as there can be an new hit added to the trajectory
654  // 2: loop over all dets that might be hit
655  // 3: loop over all hits on a certain det
656 
657 
658  std::vector < std::pair<TrackingRecHitRangeIterator, TSOS> > trackHitCandidates;
659  std::vector <std::pair<TrackingRecHitRangeIterator, TSOS> >::iterator iHitRange;
660  std::vector <uint32_t> processedDets;
661  do
662  {
663 
664  //create vector of possibly hit detectors...
665  trackHitCandidates.clear();
666  DetId currDet;
667  for( TrackingRecHitRangeIterator iHit = hitRangeByDet.begin(); iHit != hitRangeByDet.end(); iHit++ )
668  {
669  const TrackingRecHit *currHit = *(iHit->first);
670  currDet = currHit->geographicalId();
671 
672  if ( find(processedDets.begin(), processedDets.end(), currDet.rawId()) != processedDets.end() )
673  continue;
674 
675  TSOS prSt= currPropagator->propagate(traj.lastMeasurement().updatedState(),
676  tracker->idToDet(currDet)->surface());
677  if ( ( !prSt.isValid() ) || (theEstimator->Chi2MeasurementEstimatorBase::estimate(prSt,tracker->idToDet(currDet)->surface() ) == false) )
678  // if ( ( !prSt.isValid() ) || (theEstimator->estimate(prSt,tracker->idToDet(currDet)->surface() ) == false) )
679  continue;
680 
681  trackHitCandidates.push_back( make_pair(iHit, prSt) );
682  }
683 
684  if (trackHitCandidates.empty())
685  break;
686 
687  if (debug_info) cout << Hits.size() << " (int) trackHitCandidates.begin() " << trackHitCandidates.size() << endl;
688  if (debug_info) cout << "Before sorting ... " << endl;
689 
690  if (debug_info)
691  for( iHitRange = trackHitCandidates.begin(); iHitRange != trackHitCandidates.end(); iHitRange++ )
692  {
693  if (debug_info) cout << (tracker->idToDet((*(iHitRange->first->first))->geographicalId()))->position();
694  }
695  if (debug_info) cout << endl;
696 
697 
698  stable_sort( trackHitCandidates.begin(), trackHitCandidates.end(), CompareDetByTraj(traj.lastMeasurement().updatedState()) );
699 
700  if (debug_info) cout << "After sorting ... " << endl;
701  if (debug_info)
702  {
703  for( iHitRange = trackHitCandidates.begin(); iHitRange != trackHitCandidates.end(); iHitRange++ )
704  {
705  if (debug_info) cout << (tracker->idToDet((*(iHitRange->first->first))->geographicalId()))->position();
706  }
707  cout << endl;
708  }
709 
710  for( iHitRange = trackHitCandidates.begin(); iHitRange != trackHitCandidates.end(); iHitRange++ ) //loop over dets
711  {
712 
713  //now find the best hit of the detector
714  if (debug_info) cout << "loop2 " << trackHitCandidates.size() <<" " << trackHitCandidates.end() - iHitRange << endl;
715  const TrackingRecHit *currHit = *(iHitRange->first->first);
716 
718  TSOS currPrSt = (*iHitRange).second;
719 
720  if (debug_info) cout << "curr position" << bestHit->globalPosition();
721  for( TrackingRecHitIterator iHit = (*iHitRange).first->first+1; iHit != iHitRange->first->second; iHit++ )
722  {
724  if (debug_info) cout << "curr position" << tmpHit->globalPosition() ;
725 
726  }
727  }
728  if (debug_info) cout << "Cross check end ..." << endl;
729 
730 
731  //just a simple test if the same hit can be added twice ...
732  // for( iHitRange = trackHitCandidates.begin(); iHitRange != trackHitCandidates.end(); iHitRange++ ) //loop over all hits
733 
734  // break;
735 
736  for( iHitRange = trackHitCandidates.begin(); iHitRange != trackHitCandidates.end(); iHitRange++ ) //loop over detsall hits
737  {
738 
739  //now find the best hit of the detector
740  if (debug_info) cout << "loop2 " << trackHitCandidates.size() <<" " << trackHitCandidates.end() - iHitRange << endl;
741 
742  const TrackingRecHit *currHit = *(iHitRange->first->first);
743 
744  processedDets.push_back(currHit->geographicalId().rawId());
745 
746 
748 
749  if (debug_info) cout << "curr position A" << bestHit->globalPosition() << endl;
750  TSOS currPrSt = (*iHitRange).second;
751  double chi2min = theEstimator->estimate( currPrSt, *bestHit).second;
752 
753  if (debug_info) cout << "Size " << iHitRange->first->second - (*iHitRange).first->first << endl;
754  for( TrackingRecHitIterator iHit = (*iHitRange).first->first+1; iHit != iHitRange->first->second; iHit++ )
755  {
756  if (debug_info) cout << "loop3 " <<" "<< Hits.end() - iHit << endl;
757 
759  if (debug_info) cout << "curr position B" << tmpHit->globalPosition() << endl;
760  double currChi2 = theEstimator->estimate(currPrSt, *tmpHit).second;
761  if ( currChi2 < chi2min )
762  {
763  if (debug_info) cout << "Is best hit" << endl;
764  chi2min = currChi2;
765  bestHit = tmpHit;
766  }
767  }
768  //now we have checked the det and can remove the entry from the vector...
769 
770  //if (debug_info) cout << "before erase ..." << endl;
771  //this is to slow ...
772  // hitRangeByDet.erase( (*iHitRange).first,(*iHitRange).first+1 );
773  //if (debug_info) cout << "after erase ..." << endl;
774 
775  if (debug_info) cout << chi2min << endl;
776  //if the track can be added to the trajectory
777  if (chi2min < chi2cut)
778  {
779  if (debug_info) cout << "chi2 fine : " << chi2min << endl;
780 
781  // if (debug_info) cout << "previaous state " << traj.lastMeasurement().updatedState() <<endl;
782  TSOS UpdatedState= theUpdator->update( currPrSt, *bestHit );
783  if (UpdatedState.isValid()){
784 
785  hits.push_back(bestHit);
786  traj.push( TM(currPrSt,UpdatedState, bestHit, chi2min) );
787  if (debug_info) edm::LogInfo("CosmicTrackFinder") <<
788  "STATE UPDATED WITH HIT AT POSITION "
789  // <<tmphitbestdet->globalPosition()
790  <<UpdatedState<<" "
791  <<traj.chiSquared();
792  if (debug_info) cout << "Added Hit" << bestHit->globalPosition() << endl;
793  if (debug_info) cout << "State is valid ..." << UpdatedState << endl;
794  //cout << "updated state " << traj.lastMeasurement().updatedState() <<endl;
795 
796  // return; //break;
797  //
798  // TSOS prSt= currPropagator->propagate(traj.lastMeasurement().updatedState(),
799  // tracker->idToDet( bestHit->geographicalId() )->surface());
800  //
801  // if ( prSt.isValid())
802  // cout << "the same hit can be added twice ..." << endl;
803  //
804 
805  break;
806  }
807  else
808  {
809  if (debug_info) edm::LogWarning("CosmicTrackFinder")<<" State can not be updated with hit at position "
810  << bestHit->globalPosition();
811  // cout << "State can not be updated with hit at " << bestHit->globalPosition() << endl;
812  }
813  continue;
814  }
815  else
816  {
817  // cout << "chi2 to big : " << chi2min << endl;
818  }
819  if (debug_info) cout << " continue 1 " << endl;
820  }
821  //now we remove all already processed dets from the list ...
822  // hitRangeByDet.erase( (*trackHitCandidates.begin()).first,(*iHitRange).first+1 );
823 
824  if (debug_info) cout << " continue 2 " << endl;
825  }
826  //if this was the last exit
827  while ( iHitRange != trackHitCandidates.end() );
828  }
829 
830 
831 }
std::vector< TrackingRecHitRange >::iterator TrackingRecHitRangeIterator
Chi2MeasurementEstimator * theEstimator
GlobalPoint globalPosition() const
const TransientTrackingRecHitBuilder * RHBuilder
TransientTrackingRecHit::RecHitContainer hits
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
std::vector< const TrackingRecHit * >::iterator TrackingRecHitIterator
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
Definition: KFUpdator.cc:75
edm::ESHandle< TrackerGeometry > tracker
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:174
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
Definition: DetId.h:18
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
float chiSquared() const
Definition: Trajectory.h:262
const TrackerGeomDet * idToDet(DetId) const override
TrajectoryStateOnSurface const & updatedState() const
DetId geographicalId() const
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:50
TrajectoryMeasurement TM
Trajectory CRackTrajectoryBuilder::createStartingTrajectory ( const TrajectorySeed seed) const

Definition at line 252 of file CRackTrajectoryBuilder.cc.

References TrajectorySeed::direction(), mps_fire::i, eostools::move(), and mps_fire::result.

253 {
254  Trajectory result( seed, seed.direction());
255  std::vector<TM> && seedMeas = seedMeasurements(seed);
256  for (auto i : seedMeas) result.push(std::move(i));
257  return result;
258 }
PropagationDirection direction() const
std::vector< TrajectoryMeasurement > seedMeasurements(const TrajectorySeed &seed) const
def move(src, dest)
Definition: eostools.py:510
const TransientTrackingRecHitBuilder* CRackTrajectoryBuilder::hitBuilder ( ) const
inline

Definition at line 201 of file CRackTrajectoryBuilder.h.

References SurveyInfoScenario_cff::seed.

Referenced by cms::CosmicTrackFinder::produce().

201 {return RHBuilder;}
const TransientTrackingRecHitBuilder * RHBuilder
void CRackTrajectoryBuilder::init ( const edm::EventSetup es,
bool  seedplus 
)

Definition at line 58 of file CRackTrajectoryBuilder.cc.

References alongMomentum, trackAssociatorByChi2_cfi::chi2cut, Chi2MeasurementEstimator_cfi::Chi2MeasurementEstimator, edm::EventSetup::get(), oppositeToMomentum, edm::ESHandle< T >::product(), and mixOne_simraw_on_sim_cfi::tracker.

58  {
59 
60 // edm::ParameterSet tise_params = conf_.getParameter<edm::ParameterSet>("TransientInitialStateEstimatorParameters") ;
61 // theInitialState = new TransientInitialStateEstimator( es,tise_params);
62 
63  //services
66 
67 
68 
69  if (seedplus) {
70  seed_plus=true;
73  else {
74  seed_plus=false;
77  }
78 
79  theUpdator= new KFUpdator();
80 // theUpdator= new KFStripUpdator();
82 
83 
85  es.get<TransientRecHitRecord>().get(theBuilderName,theBuilder);
86 
87 
88  RHBuilder= theBuilder.product();
89 
90 
91 
92 
93  theFitter= new KFTrajectoryFitter(*thePropagator,
94  *theUpdator,
95  *theEstimator) ;
96 
97 
99  *theUpdator,
100  *theEstimator);
101 
102 }
edm::ESHandle< MagneticField > magfield
Chi2MeasurementEstimator * theEstimator
const TransientTrackingRecHitBuilder * RHBuilder
const KFTrajectorySmoother * theSmoother
edm::ESHandle< TrackerGeometry > tracker
PropagatorWithMaterial * thePropagatorOp
const T & get() const
Definition: EventSetup.h:59
PropagatorWithMaterial * thePropagator
const KFTrajectoryFitter * theFitter
T const * product() const
Definition: ESHandle.h:86
std::pair< TrajectoryStateOnSurface, const GeomDet * > CRackTrajectoryBuilder::innerState ( const Trajectory traj) const
private

Definition at line 879 of file CRackTrajectoryBuilder.cc.

References alongMomentum, patCaloMETCorrections_cff::C, Chi2MeasurementEstimator_cfi::Chi2MeasurementEstimator, Trajectory::direction(), Trajectory::foundHits(), mps_fire::i, TrajectoryStateOnSurface::localParameters(), Trajectory::measurements(), nhits, oppositeToMomentum, rpcPointValidation_cfi::recHit, and TrajectoryStateOnSurface::surface().

880 {
881  int lastFitted = 999;
882  int nhits = traj.foundHits();
883  if (nhits < lastFitted+1) lastFitted = nhits-1;
884 
885  std::vector<TrajectoryMeasurement> measvec = traj.measurements();
887 
888  bool foundLast = false;
889  int actualLast = -99;
890  for (int i=lastFitted; i >= 0; i--) {
891  if(measvec[i].recHit()->isValid()){
892  if(!foundLast){
893  actualLast = i;
894  foundLast = true;
895  }
896  firstHits.push_back( measvec[i].recHit());
897  }
898  }
899  TSOS unscaledState = measvec[actualLast].updatedState();
900  AlgebraicSymMatrix55 C=ROOT::Math::SMatrixIdentity();
901  // C *= 100.;
902 
903  TSOS startingState( unscaledState.localParameters(), LocalTrajectoryError(C),
904  unscaledState.surface(),
906 
907  // cout << endl << "FitTester starts with state " << startingState << endl;
908 
909  KFTrajectoryFitter backFitter( *thePropagator,
910  KFUpdator(),
911  Chi2MeasurementEstimator( 100., 3));
912 
914 
915  // only direction matters in this contest
918  backFitDirection);
919 
920  vector<Trajectory> fitres = backFitter.fit( fakeSeed, firstHits, startingState);
921 
922  if (fitres.size() != 1) {
923  // cout << "FitTester: first hits fit failed!" << endl;
924  return std::pair<TrajectoryStateOnSurface, const GeomDet*>();
925  }
926 
927  TrajectoryMeasurement firstMeas = fitres[0].lastMeasurement();
928  const TSOS& firstState = firstMeas.updatedState();
929 
930  // cout << "FitTester: Fitted first state " << firstState << endl;
931  //cout << "FitTester: chi2 = " << fitres[0].chiSquared() << endl;
932 
933  TSOS initialState( firstState.localParameters(), LocalTrajectoryError(C),
934  firstState.surface(),
936 
937  return std::pair<TrajectoryStateOnSurface, const GeomDet*>( initialState,
938  firstMeas.recHit()->det());
939 }
int foundHits() const
Definition: Trajectory.h:225
const LocalTrajectoryParameters & localParameters() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
PropagationDirection
PropagationDirection const & direction() const
Definition: Trajectory.cc:140
DataContainer const & measurements() const
Definition: Trajectory.h:196
const SurfaceType & surface() const
const MagneticField * magneticField() const override
std::vector< ConstRecHitPointer > ConstRecHitContainer
PropagatorWithMaterial * thePropagator
bool CRackTrajectoryBuilder::isDifferentStripReHit2D ( const SiStripRecHit2D hitA,
const SiStripRecHit2D hitB 
)
private

Definition at line 858 of file CRackTrajectoryBuilder.cc.

References TrackingRecHit::geographicalId(), BaseTrackerRecHit::localPosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

859 {
860  if ( hitA.geographicalId() != hitB.geographicalId() )
861  return true;
862  if ( hitA.localPosition().x() != hitB.localPosition().x() )
863  return true;
864  if ( hitA.localPosition().y() != hitB.localPosition().y() )
865  return true;
866  if ( hitA.localPosition().z() != hitB.localPosition().z() )
867  return true;
868 
869  // if (debug_info) cout << hitA.localPosition() << endl;
870  // if (debug_info) cout << hitB << endl;
871 
872  return false;
873 }
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
LocalPoint localPosition() const final
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:62
bool CRackTrajectoryBuilder::qualityFilter ( const Trajectory traj)
private

Definition at line 835 of file CRackTrajectoryBuilder.cc.

References Trajectory::foundHits(), hfClusterShapes_cfi::hits, and Trajectory::recHits().

835  {
836  int ngoodhits=0;
837  if(geometry=="MTCC"){
838  auto hits= traj.recHits();
839  for(auto hit=hits.begin();hit!=hits.end();hit++){
840  unsigned int iid=(*hit)->hit()->geographicalId().rawId();
841  //CHECK FOR 3 hits r-phi
842  if(((iid>>0)&0x3)!=1) ngoodhits++;
843  }
844  }
845  else ngoodhits=traj.foundHits();
846 
847  if ( ngoodhits >= theMinHits) {
848  return true;
849  }
850  else {
851  return false;
852  }
853 }
int foundHits() const
Definition: Trajectory.h:225
ConstRecHitContainer recHits() const
Definition: Trajectory.h:204
TransientTrackingRecHit::RecHitContainer hits
void CRackTrajectoryBuilder::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.

Definition at line 105 of file CRackTrajectoryBuilder.cc.

References alongMomentum, gather_cfg::cout, Trajectory::firstMeasurement(), Trajectory::foundHits(), hfClusterShapes_cfi::hits, init, iseed, Trajectory::recHits(), groupFilesInBlocks::reverse, Trajectory::seed(), mixOne_simraw_on_sim_cfi::tracker, and TrajectoryMeasurement::updatedState().

Referenced by cms::CosmicTrackFinder::produce().

113 {
114 
115  std::vector<Trajectory> trajSmooth;
116  std::vector<Trajectory>::iterator trajIter;
117 
118  TrajectorySeedCollection::const_iterator iseed;
119  unsigned int IS=0;
120  for(iseed=collseed.begin();iseed!=collseed.end();iseed++){
121  bool seedplus=((*iseed).direction()==alongMomentum);
122  init(es,seedplus);
123  hits.clear();
124  trajFit.clear();
125  trajSmooth.clear();
126 
127  Trajectory startingTraj = createStartingTrajectory(*iseed);
128  Trajectory trajTmp; // used for the opposite direction
129  Trajectory traj = startingTraj;
130 
131 
132  //first propagate track in opposite direction ...
133  seed_plus = !seed_plus;
134  vector<const TrackingRecHit*> allHitsOppsite = SortHits(collstereo,collrphi,collmatched,collpixel, *iseed, true);
135  seed_plus = !seed_plus;
136  if (!allHitsOppsite.empty())
137  {
138  //there are hits which are above the seed,
139  //cout << "Number of hits higher than seed " <<allHitsOppsite.size() << endl;
140 
141  AddHit( traj, allHitsOppsite, thePropagatorOp);
142 
143 
144  if (debug_info)
145  {
146  cout << "Hits in opposite direction..." << endl;
147  TransientTrackingRecHit::RecHitContainer::const_iterator iHit;
148  for ( iHit = hits.begin(); iHit!=hits.end(); iHit++)
149  {
150  cout << (**iHit).globalPosition() << endl;
151  }
152  }
153 
154 
155  // now add hist opposite to seed
156  //now crate new starting trajectory
157  reverse(hits.begin(), hits.end());
159  tracker->idToDet((hits.front())->geographicalId())->surface()).isValid()){
160  TSOS startingStateNew = //TrajectoryStateWithArbitraryError()//
162  tracker->idToDet((hits.front())->geographicalId())->surface()));
163 
164  if (debug_info)
165  {
166  cout << "Hits in opposite direction reversed..." << endl;
167  TransientTrackingRecHit::RecHitContainer::const_iterator iHit;
168  for ( iHit = hits.begin(); iHit!=hits.end(); iHit++)
169  {
170  cout << (**iHit).globalPosition() << endl;
171  }
172  }
173 
174  const TrajectorySeed& tmpseed=traj.seed();
175  trajTmp = theFitter->fit(tmpseed,hits, startingStateNew ).front();
176 
177  if(debug_info){
178  cout << "Debugging show fitted hits" << endl;
179  auto hitsFit= trajTmp.recHits();
180  for(auto hit=hitsFit.begin();hit!=hitsFit.end();hit++){
181 
182  cout << RHBuilder->build( &(*(*hit)->hit()) )->globalPosition() << endl;
183  }
184  }
185 
186  }
187  }
188  else
189  {
190  if(debug_info) cout << "There are no hits in opposite direction ..." << endl;
191  }
192 
193  vector<const TrackingRecHit*> allHits;
194  if (trajTmp.foundHits())
195  {
196  traj = trajTmp;
197  allHits= SortHits(collstereo,collrphi,collmatched,collpixel,*iseed, false);
198  }
199  else
200  {
201  traj = startingTraj;
202  hits.clear();
203  allHits= SortHits(collstereo,collrphi,collmatched,collpixel,*iseed, true);
204  }
205 
206  AddHit( traj,allHits, thePropagator);
207 
208 
209  if(debug_info){
210  cout << "Debugging show All fitted hits" << endl;
211  auto hits= traj.recHits();
212  for(auto hit=hits.begin();hit!=hits.end();hit++){
213 
214  cout << (*hit)->globalPosition() << endl;
215  }
216 
217  cout << qualityFilter( traj) << " <- quality filter good?" << endl;
218  }
219 
220 
221  if (debug_info) cout << "now do quality checks" << endl;
222  if ( qualityFilter( traj) ) {
223  const TrajectorySeed& tmpseed=traj.seed();
224  std::pair<TrajectoryStateOnSurface, const GeomDet*> initState = innerState(traj); //theInitialState->innerState(traj);
225  if (initState.first.isValid())
226  trajFit = theFitter->fit(tmpseed,hits, initState.first);
227  }
228 
229  for (trajIter=trajFit.begin(); trajIter!=trajFit.end();trajIter++){
230  trajSmooth=theSmoother->trajectories((*trajIter));
231  }
232  for (trajIter= trajSmooth.begin(); trajIter!=trajSmooth.end();trajIter++){
233  if((*trajIter).isValid()){
234 
235  if (debug_info) cout << "adding track ... " << endl;
236  trajoutput.push_back((*trajIter));
237  }
238  }
239  delete theUpdator;
240  delete theEstimator;
241  delete thePropagator;
242  delete thePropagatorOp;
243  delete theFitter;
244  delete theSmoother;
245  //Only the first 30 seeds are considered
246  if (IS>30) return;
247  IS++;
248 
249  }
250 }
int foundHits() const
Definition: Trajectory.h:225
Trajectory createStartingTrajectory(const TrajectorySeed &seed) const
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:285
Chi2MeasurementEstimator * theEstimator
ConstRecHitContainer recHits() const
Definition: Trajectory.h:204
const TransientTrackingRecHitBuilder * RHBuilder
TransientTrackingRecHit::RecHitContainer hits
virtual TrajectoryContainer trajectories(const Trajectory &traj) const
const KFTrajectorySmoother * theSmoother
std::pair< TrajectoryStateOnSurface, const GeomDet * > innerState(const Trajectory &traj) const
std::vector< Trajectory > trajFit
bool qualityFilter(const Trajectory &traj)
edm::ESHandle< TrackerGeometry > tracker
PropagatorWithMaterial * thePropagatorOp
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:187
int iseed
Definition: AMPTWrapper.h:124
void init(const edm::EventSetup &es, bool)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
PropagatorWithMaterial * thePropagator
const KFTrajectoryFitter * theFitter
const TrackerGeomDet * idToDet(DetId) const override
std::vector< const TrackingRecHit * > SortHits(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const SiPixelRecHitCollection &collpixel, const TrajectorySeed &seed, const bool bAddSeedHits)
TrajectoryStateOnSurface const & updatedState() const
void AddHit(Trajectory &traj, const std::vector< const TrackingRecHit * > &Hits, Propagator *currPropagator)
std::vector< TrajectoryMeasurement > CRackTrajectoryBuilder::seedMeasurements ( const TrajectorySeed seed) const
private

Definition at line 262 of file CRackTrajectoryBuilder.cc.

References eostools::move(), rpcPointValidation_cfi::recHit, TrajectorySeed::recHits(), mps_fire::result, GeomDet::surface(), and TrackInfoProducer_cfi::updatedState.

263 {
264  std::vector<TrajectoryMeasurement> result;
265  TrajectorySeed::range hitRange = seed.recHits();
266  for (TrajectorySeed::const_iterator ihit = hitRange.first;
267  ihit != hitRange.second; ihit++) {
268  //RC TransientTrackingRecHit* recHit = RHBuilder->build(&(*ihit));
270  const GeomDet* hitGeomDet = (&(*tracker))->idToDet( ihit->geographicalId());
271  TSOS invalidState( new BasicSingleTrajectoryState( hitGeomDet->surface()));
272 
273  if (ihit == hitRange.second - 1) {
275  result.push_back(std::move(TM( invalidState, updatedState, recHit)));
276 
277  }
278  else {
279  result.push_back(std::move(TM( invalidState, recHit)));
280  }
281 
282  }
283 
284  return result;
285 }
const TransientTrackingRecHitBuilder * RHBuilder
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
TSOS startingTSOS(const TrajectorySeed &seed) const
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
range recHits() const
def move(src, dest)
Definition: eostools.py:510
TrajectoryMeasurement TM
vector< const TrackingRecHit * > CRackTrajectoryBuilder::SortHits ( const SiStripRecHit2DCollection collstereo,
const SiStripRecHit2DCollection collrphi,
const SiStripMatchedRecHit2DCollection collmatched,
const SiPixelRecHitCollection collpixel,
const TrajectorySeed seed,
const bool  bAddSeedHits 
)
private

Definition at line 288 of file CRackTrajectoryBuilder.cc.

References gather_cfg::cout, edmNew::DetSetVector< T >::data(), spr::find(), TrackingRecHit::geographicalId(), TrajectoryStateOnSurface::globalPosition(), BaseTrackerRecHit::globalPosition(), hfClusterShapes_cfi::hits, TrajectoryStateOnSurface::isValid(), Trajectory::lastMeasurement(), TrajectoryStateOnSurface::localError(), LogDebug, funct::m, LocalTrajectoryError::matrix(), SiStripMatchedRecHit2D::monoHit(), TrajectorySeed::nHits(), DetId::rawId(), TrajectorySeed::recHits(), alignCSCRings::s, SiStripMatchedRecHit2D::stereoHit(), mixOne_simraw_on_sim_cfi::tracker, TrajectoryMeasurement::updatedState(), PV3DBase< T, PVType, FrameType >::y(), CMSBoostedTauSeedingParameters_cfi::yMax, and CMSBoostedTauSeedingParameters_cfi::yMin.

294  {
295 
296 
297  //The Hits with global y more than the seed are discarded
298  //The Hits correspondign to the seed are discarded
299  //At the end all the hits are sorted in y
300  vector<const TrackingRecHit*> allHits;
301 
303  TrajectorySeed::range hRange= seed.recHits();
305  float yref=0.;
306 
307  if (debug_info) cout << "SEED " << startingTSOS(seed) << endl;
308  if (debug_info) cout << "seed hits size " << seed.nHits() << endl;
309 
310 
311  //seed debugging:
312  // GeomDet *seedDet = tracker->idToDet(seed.startingState().detId());
313 
314 
315 // edm::LogInfo("CRackTrajectoryBuilder::SortHits") << "SEED " << seed.startingState();
316 
317  edm::LogInfo("CRackTrajectoryBuilder::SortHits") << "SEED " << startingTSOS(seed);
318 // edm::LogInfo("CRackTrajectoryBuilder::SortHits" << "seed hits size " << seed.nHits();
319 
320 
321 
322  // if (seed.nHits()<2)
323  // return allHits;
324 
325  float_t yMin=0.;
326  float_t yMax=0.;
327 
328  int seedHitSize= hRange.second - hRange.first;
329 
330  vector <int> detIDSeedMatched (seedHitSize);
331  vector <int> detIDSeedRphi (seedHitSize);
332  vector <int> detIDSeedStereo (seedHitSize);
333 
334  for (ihit = hRange.first;
335  ihit != hRange.second; ihit++) {
336 
337  // need to find track with lowest (seed_plus)/ highest y (seed_minus)
338  // split matched hits ...
339  const SiStripMatchedRecHit2D* matchedhit=dynamic_cast<const SiStripMatchedRecHit2D*>(&(*ihit));
340 
341  yref=RHBuilder->build(&(*ihit))->globalPosition().y();
342  if (ihit == hRange.first)
343  {
344  yMin = yref;
345  yMax = yref;
346  }
347 
348  if (matchedhit)
349  {
350  auto m = matchedhit->monoHit();
351  auto s = matchedhit->stereoHit();
352  float_t yGlobRPhi = RHBuilder->build(&m)->globalPosition().y();
353  float_t yGlobStereo = RHBuilder->build(&s)->globalPosition().y();
354 
355  if (debug_info) cout << "Rphi ..." << yGlobRPhi << endl;
356  if (debug_info) cout << "Stereo ..." << yGlobStereo << endl;
357 
358  if ( yGlobStereo < yMin ) yMin = yGlobStereo;
359  if ( yGlobRPhi < yMin ) yMin = yGlobRPhi;
360 
361  if ( yGlobStereo > yMax ) yMax = yGlobStereo;
362  if ( yGlobRPhi > yMax ) yMax = yGlobRPhi;
363 
364  detIDSeedMatched.push_back ( matchedhit->geographicalId().rawId() );
365  detIDSeedRphi.push_back ( m.geographicalId().rawId() );
366  detIDSeedStereo.push_back ( s.geographicalId().rawId() );
367 
368  if (bAddSeedHits)
369  {
370  if (useMatchedHits)
371  {
372 
373  hits.push_back((RHBuilder->build(&(*ihit))));
374  }
375  else
376  {
377  if ( ( (yGlobRPhi > yGlobStereo ) && seed_plus ) || ((yGlobRPhi < yGlobStereo ) && !seed_plus ))
378  {
379  hits.push_back((RHBuilder->build(&m)));
380  hits.push_back((RHBuilder->build(&s)));
381  }
382  else
383  {
384  hits.push_back((RHBuilder->build(&s)));
385  hits.push_back((RHBuilder->build(&m)));
386 
387  }
388  }
389  }
390  }
391  else if (bAddSeedHits)
392  {
393  hits.push_back((RHBuilder->build(&(*ihit))));
394  detIDSeedRphi.push_back ( ihit->geographicalId().rawId() );
395  detIDSeedMatched.push_back ( -1 );
396  detIDSeedStereo.push_back ( -1 );
397 
398  }
399 
400  if ( yref < yMin ) yMin = yref;
401  if ( yref > yMax ) yMax = yref;
402 
403 // if (bAddSeedHits)
404 // hits.push_back((RHBuilder->build(&(*ihit))));
405 
406  LogDebug("CosmicTrackFinder")<<"SEED HITS"<<RHBuilder->build(&(*ihit))->globalPosition();
407  if (debug_info) cout <<"SEED HITS"<<RHBuilder->build(&(*ihit))->globalPosition() << endl;
408 // if (debug_info) cout <<"SEED HITS"<< seed.startingState().parameters() << endl;
409 
410 
411  }
412 
413  yref = (seed_plus) ? yMin : yMax;
414 
416  for(ipix=collpixel.data().begin();ipix!=collpixel.data().end();ipix++){
417  float ych= RHBuilder->build(&(*ipix))->globalPosition().y();
418  if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref)))
419  allHits.push_back(&(*ipix));
420  }
421 
422  if (useMatchedHits) // use matched
423  {
424  //add the matched hits ...
426 
427  for(istripm=collmatched.data().begin();istripm!=collmatched.data().end();istripm++){
428  float ych= RHBuilder->build(&(*istripm))->globalPosition().y();
429 
430  int cDetId=istripm->geographicalId().rawId();
431  bool noSeedDet = ( detIDSeedMatched.end() == find (detIDSeedMatched.begin(), detIDSeedMatched.end(), cDetId ) ) ;
432 
433  if ( noSeedDet )
434  if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref)))
435  allHits.push_back(&(*istripm));
436  }
437 
438  //add the rpi hits, but only accept hits that are not matched hits
439  for(istrip=collrphi.data().begin();istrip!=collrphi.data().end();istrip++){
440  float ych= RHBuilder->build(&(*istrip))->globalPosition().y();
441  StripSubdetector monoDetId(istrip->geographicalId());
442  if (monoDetId.partnerDetId())
443  {
444  edm::LogInfo("CRackTrajectoryBuilder::SortHits") << "this det belongs to a glued det " << ych << endl;
445  continue;
446  }
447  int cDetId=istrip->geographicalId().rawId();
448  bool noSeedDet = ( detIDSeedRphi.end()== find (detIDSeedRphi.begin(), detIDSeedRphi.end(), cDetId ) ) ;
449  if (noSeedDet)
450  if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref)))
451  {
452 
453  bool hitIsUnique = true;
454  //now
455  for(istripm=collmatched.data().begin();istripm!=collmatched.data().end();istripm++)
456  {
457  // if ( isDifferentStripReHit2D ( *istrip, (istripm->stereoHit() ) ) == false)
458  if ( isDifferentStripReHit2D ( *istrip, (istripm->monoHit() ) ) == false)
459  {
460  hitIsUnique = false;
461  edm::LogInfo("CRackTrajectoryBuilder::SortHits") << "rphi hit is in matched hits; y: " << ych << endl;
462  break;
463  }
464  } //end loop over all matched
465  if (hitIsUnique)
466  {
467  // if (debug_info) cout << "adding rphi hit " << &(*istrip) << endl;
468  allHits.push_back(&(*istrip));
469  }
470  }
471  }
472 
473 
474  }
475  else // dont use matched ...
476  {
477 
478  for(istrip=collrphi.data().begin();istrip!=collrphi.data().end();istrip++){
479  float ych= RHBuilder->build(&(*istrip))->globalPosition().y();
480  if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref)))
481  allHits.push_back(&(*istrip));
482  }
483 
484  for(istrip=collstereo.data().begin();istrip!=collstereo.data().end();istrip++){
485  float ych= RHBuilder->build(&(*istrip))->globalPosition().y();
486  if ((seed_plus && (ych<yref)) || (!(seed_plus) && (ych>yref)))
487  allHits.push_back(&(*istrip));
488  }
489  }
490 
491 
492 
493  if (seed_plus)
494  stable_sort(allHits.begin(),allHits.end(),CompareHitY_plus(*tracker));
495  else
496  stable_sort(allHits.begin(),allHits.end(),CompareHitY(*tracker));
497 
498  if (debug_info)
499  {
500  if (debug_info) cout << "all hits" << endl;
501 
502  //starting trajectory
503  Trajectory startingTraj = createStartingTrajectory(seed);
504 
505  if (debug_info) cout << "START " << startingTraj.lastMeasurement().updatedState() << endl;
506  if (debug_info) cout << "START Err" << startingTraj.lastMeasurement().updatedState().localError().matrix() << endl;
507 
508 
509  vector<const TrackingRecHit*>::iterator iHit;
510  for (iHit=allHits.begin(); iHit<allHits.end(); iHit++)
511  {
512  GlobalPoint gphit=RHBuilder->build(*iHit)->globalPosition();
513  if (debug_info) cout << "GH " << gphit << endl;
514 
515  // tracker->idToDet((*iHit)->geographicalId())->surface();
516 
517  TSOS prSt = thePropagator->propagate(startingTraj.lastMeasurement().updatedState(),
518  tracker->idToDet((*iHit)->geographicalId())->surface());
519 
520  if(prSt.isValid())
521  {
522  if (debug_info) cout << "PR " << prSt.globalPosition() << endl;
523  //if (debug_info) cout << "PR Err" << prSt.localError().matrix() << endl;
524 
525  }
526  else
527  {
528  if (debug_info) cout << "not valid" << endl;
529  }
530  }
531  if (debug_info) cout << "all hits end" << endl;
532  }
533 
534 
535  return allHits;
536 }
#define LogDebug(id)
Trajectory createStartingTrajectory(const TrajectorySeed &seed) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
GlobalPoint globalPosition() const
const TransientTrackingRecHitBuilder * RHBuilder
TransientTrackingRecHit::RecHitContainer hits
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
recHitContainer::const_iterator const_iterator
edm::ESHandle< TrackerGeometry > tracker
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:174
data_type const * data(size_t cell) const
std::pair< const_iterator, const_iterator > range
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
TSOS startingTSOS(const TrajectorySeed &seed) const
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
SiStripRecHit2D stereoHit() const
bool isDifferentStripReHit2D(const SiStripRecHit2D &hitA, const SiStripRecHit2D &hitB)
range recHits() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
PropagatorWithMaterial * thePropagator
SiStripRecHit2D monoHit() const
unsigned int nHits() const
const TrackerGeomDet * idToDet(DetId) const override
TrajectoryStateOnSurface const & updatedState() const
DetId geographicalId() const
TrajectoryStateOnSurface CRackTrajectoryBuilder::startingTSOS ( const TrajectorySeed seed) const
private

Definition at line 539 of file CRackTrajectoryBuilder.cc.

References TrajectorySeed::startingState(), and trajectoryStateTransform::transientState().

540 {
541  PTrajectoryStateOnDet pState( seed.startingState());
542  const GeomDet* gdet = (&(*tracker))->idToDet(DetId(pState.detId()));
543  TSOS State= trajectoryStateTransform::transientState( pState, &(gdet->surface()),
544  &(*magfield));
545  return State;
546 
547 }
edm::ESHandle< MagneticField > magfield
Definition: DetId.h:18
PTrajectoryStateOnDet const & startingState() const
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
void CRackTrajectoryBuilder::updateTrajectory ( Trajectory traj,
const TM tm,
const TransientTrackingRecHit hit 
) const
private

Friends And Related Function Documentation

friend class CompareDetByTraj
friend

Definition at line 141 of file CRackTrajectoryBuilder.h.

Member Data Documentation

double CRackTrajectoryBuilder::chi2cut
private

Definition at line 260 of file CRackTrajectoryBuilder.h.

bool CRackTrajectoryBuilder::debug_info
private

Definition at line 255 of file CRackTrajectoryBuilder.h.

bool CRackTrajectoryBuilder::fastPropagation
private

Definition at line 256 of file CRackTrajectoryBuilder.h.

std::string CRackTrajectoryBuilder::geometry
private
TransientTrackingRecHit::RecHitContainer CRackTrajectoryBuilder::hits
private

Definition at line 263 of file CRackTrajectoryBuilder.h.

edm::ESHandle<MagneticField> CRackTrajectoryBuilder::magfield
private

Definition at line 239 of file CRackTrajectoryBuilder.h.

const TransientTrackingRecHitBuilder* CRackTrajectoryBuilder::RHBuilder
private

Definition at line 250 of file CRackTrajectoryBuilder.h.

bool CRackTrajectoryBuilder::seed_plus
private

Definition at line 264 of file CRackTrajectoryBuilder.h.

std::string CRackTrajectoryBuilder::theBuilderName
private

Definition at line 266 of file CRackTrajectoryBuilder.h.

Chi2MeasurementEstimator* CRackTrajectoryBuilder::theEstimator
private

Definition at line 249 of file CRackTrajectoryBuilder.h.

const KFTrajectoryFitter* CRackTrajectoryBuilder::theFitter
private

Definition at line 252 of file CRackTrajectoryBuilder.h.

int CRackTrajectoryBuilder::theMinHits
private

Definition at line 259 of file CRackTrajectoryBuilder.h.

PropagatorWithMaterial* CRackTrajectoryBuilder::thePropagator
private

Definition at line 242 of file CRackTrajectoryBuilder.h.

PropagatorWithMaterial* CRackTrajectoryBuilder::thePropagatorOp
private

Definition at line 243 of file CRackTrajectoryBuilder.h.

const KFTrajectorySmoother* CRackTrajectoryBuilder::theSmoother
private

Definition at line 251 of file CRackTrajectoryBuilder.h.

KFUpdator* CRackTrajectoryBuilder::theUpdator
private

Definition at line 248 of file CRackTrajectoryBuilder.h.

edm::ESHandle<TrackerGeometry> CRackTrajectoryBuilder::tracker
private

Definition at line 240 of file CRackTrajectoryBuilder.h.

std::vector<Trajectory> CRackTrajectoryBuilder::trajFit
private

Definition at line 261 of file CRackTrajectoryBuilder.h.

bool CRackTrajectoryBuilder::useMatchedHits
private

Definition at line 257 of file CRackTrajectoryBuilder.h.