67 hitCloner =
static_cast<TkTransientTrackingRecHitBuilder
const *
>(
RHBuilder)->cloner();
89 vector<Trajectory> &trajoutput)
95 std::vector<Trajectory> trajSmooth;
96 std::vector<Trajectory>::iterator trajIter;
98 TrajectorySeedCollection::const_iterator
iseed;
100 for(iseed=collseed.begin();iseed!=collseed.end();iseed++){
107 vector<const TrackingRecHit*> allHits=
SortHits(collstereo,collrphi,collmatched,collpixel,*iseed);
109 AddHit(startingTraj,allHits);
110 for (trajIter=
trajFit.begin(); trajIter!=
trajFit.end();trajIter++){
113 for (trajIter= trajSmooth.begin(); trajIter!=trajSmooth.end();trajIter++){
114 if((*trajIter).isValid()){
115 trajoutput.push_back((*trajIter));
135 for (
auto &
i : seedMeas)
result.push(std::move(
i));
140 std::vector<TrajectoryMeasurement>
143 std::vector<TrajectoryMeasurement>
result;
146 ihit != hitRange.second; ihit++) {
149 const GeomDet* hitGeomDet = (&(*tracker))->idToDet( ihit->geographicalId());
150 TSOS invalidState(
new BasicSingleTrajectoryState( hitGeomDet->
surface()));
152 if (ihit == hitRange.second - 1) {
154 result.emplace_back(invalidState, updatedState, recHit);
157 result.emplace_back(invalidState, recHit);
169 vector<const TrackingRecHit*>
180 vector<const TrackingRecHit*> allHits;
186 for (ihit = hRange.first;
187 ihit != hRange.second; ihit++) {
194 if ((&collpixel)!=0){
196 for(ipix=collpixel.
data().begin();ipix!=collpixel.
data().end();ipix++){
199 allHits.push_back(&(*ipix));
206 for(istrip=collrphi.
data().begin();istrip!=collrphi.
data().end();istrip++){
209 allHits.push_back(&(*istrip));
216 if ((&collstereo)!=0){
217 for(istrip=collstereo.
data().begin();istrip!=collstereo.
data().end();istrip++){
220 allHits.push_back(&(*istrip));
247 const GeomDet* gdet = (&(*tracker))->idToDet(
DetId(pState.detId()));
255 const vector<const TrackingRecHit*>&Hits){
259 unsigned int ibestdet;
261 for (
unsigned int icosmhit=0;icosmhit<Hits.size();icosmhit++){
263 unsigned int iraw= Hits[icosmhit]->geographicalId().rawId();
264 LogDebug(
"CosmicTrackFinder")<<
" HIT POSITION "<< gphit;
268 tracker->idToDet(Hits[icosmhit]->geographicalId())->surface());
276 LogDebug(
"CosmicTrackFinder") <<
"STATE PROPAGATED AT DET "<<iraw<<
" "<<prSt;
277 for(icosm2=icosmhit;icosm2<Hits.size();icosm2++){
279 if (iraw==Hits[icosm2]->geographicalId().rawId()){
286 if (icosm2!=icosmhit) icosmhit++;
289 else icosm2=Hits.size();
293 LogDebug(
"CosmicTrackFinder")<<
"Chi2 contribution for hit at "
301 if ((
abs(ck.
x()/ck.
y())>2)||(
abs(ck.
z()/ck.
y())>2)) chi2min=300;
304 if (
abs(prLoc.
x()) < 25 &&
abs(prLoc.
y()) < 25 ){
312 "STATE UPDATED WITH HIT AT POSITION "
313 <<tmphitbestdet->globalPosition()
317 hits.push_back(tmphitbestdet);
319 }
else LogDebug(
"CosmicTrackFinder")<<
" Hits outside module surface "<< prLoc;
320 }
else LogDebug(
"CosmicTrackFinder")<<
" State can not be updated with hit at position " <<gphit;
321 }
else LogDebug(
"CosmicTrackFinder")<<
" State can not be propagated at det "<< iraw;
329 tracker->idToDet((*
hits.begin())->geographicalId())->surface()).isValid()){
332 tracker->idToDet((*
hits.begin())->geographicalId())->surface());
345 auto hits = traj.recHits();
347 unsigned int iid=(*hit)->hit()->geographicalId().rawId();
349 if(((iid>>0)&0x3)!=1) ngoodhits++;
PropagationDirection direction() const
KFTrajectoryFitter * theFitter
KFTrajectorySmoother * theSmoother
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
edm::ESHandle< MagneticField > magfield
edm::ESHandle< TrackerGeometry > tracker
LocalPoint localPosition() const
PropagatorWithMaterial * thePropagatorOp
GlobalPoint globalPosition() const
std::vector< Trajectory > trajFit
const Plane & surface() const
The nominal surface of the GeomDet.
void init(const edm::EventSetup &es, bool)
const TransientTrackingRecHitBuilder * RHBuilder
std::vector< TrajectoryMeasurement > seedMeasurements(const TrajectorySeed &seed) const
std::vector< TrajectorySeed > TrajectorySeedCollection
recHitContainer::const_iterator const_iterator
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TrajectoryMeasurement const & lastMeasurement() const
data_type const * data(size_t cell) const
Abs< T >::type abs(const T &t)
std::pair< const_iterator, const_iterator > range
TSOS startingTSOS(const TrajectorySeed &seed) const
tuple Chi2MeasurementEstimator
std::shared_ptr< TrackingRecHit const > RecHitPointer
TrajectoryMeasurement const & firstMeasurement() const
PTrajectoryStateOnDet const & startingState() const
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.
T const * product() const
PropagatorWithMaterial * thePropagator
std::vector< const TrackingRecHit * > SortHits(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, const SiPixelRecHitCollection &collpixel, const TrajectorySeed &seed)
void AddHit(Trajectory &traj, const std::vector< const TrackingRecHit * > &Hits)
Chi2MeasurementEstimator * theEstimator
bool qualityFilter(const Trajectory &traj)
virtual std::pair< bool, double > estimate(const TrajectoryStateOnSurface &, const TrackingRecHit &) const
tuple KFTrajectorySmoother
TrajectoryStateOnSurface const & updatedState() const
Trajectory createStartingTrajectory(const TrajectorySeed &seed) const
CosmicTrajectoryBuilder(const edm::ParameterSet &conf)
TransientTrackingRecHit::RecHitContainer hits
~CosmicTrajectoryBuilder()
void push(const TrajectoryMeasurement &tm)