27 edm::LogInfo(
"CosmicTrackFinder") <<
"Minimum number of hits " << theMinHits <<
" Cut on Chi2= " <<
chi2cut;
58 RHBuilder = theBuilder.
product();
59 hitCloner = static_cast<TkTransientTrackingRecHitBuilder const *>(RHBuilder)->cloner();
61 theFitter =
new KFTrajectoryFitter(*thePropagator, *theUpdator, *theEstimator);
62 theFitter->setHitCloner(&hitCloner);
65 theSmoother->setHitCloner(&hitCloner);
75 vector<Trajectory> &trajoutput) {
76 std::vector<Trajectory> trajSmooth;
77 std::vector<Trajectory>::iterator trajIter;
79 TrajectorySeedCollection::const_iterator
iseed;
88 vector<const TrackingRecHit *> allHits = SortHits(collstereo, collrphi, collmatched, collpixel, *
iseed);
90 AddHit(startingTraj, allHits);
91 for (trajIter = trajFit.begin(); trajIter != trajFit.end(); trajIter++) {
92 trajSmooth = theSmoother->trajectories((*trajIter));
94 for (trajIter = trajSmooth.begin(); trajIter != trajSmooth.end(); trajIter++) {
95 if ((*trajIter).isValid()) {
96 trajoutput.push_back((*trajIter));
101 delete thePropagator;
102 delete thePropagatorOp;
114 std::vector<TM> &&seedMeas = seedMeasurements(
seed);
115 for (
auto &
i : seedMeas)
121 std::vector<TrajectoryMeasurement>
result;
122 auto const &hitRange =
seed.recHits();
123 for (
auto ihit = hitRange.begin(); ihit != hitRange.end(); ihit++) {
126 const GeomDet *hitGeomDet = (&(*tracker))->idToDet(ihit->geographicalId());
129 if (ihit == hitRange.end() - 1) {
130 TSOS updatedState = startingTSOS(
seed);
131 result.emplace_back(invalidState, updatedState,
recHit);
148 vector<const TrackingRecHit *> allHits;
153 yref = RHBuilder->build(&
recHit)->globalPosition().y();
155 LogDebug(
"CosmicTrackFinder") <<
"SEED HITS" << RHBuilder->build(&
recHit)->globalPosition();
159 for (ipix = collpixel.
data().begin(); ipix != collpixel.
data().end(); ipix++) {
160 float ych = RHBuilder->build(&(*ipix))->globalPosition().y();
161 if ((seed_plus && (ych < yref)) || (!(seed_plus) && (ych > yref)))
162 allHits.push_back(&(*ipix));
165 for (istrip = collrphi.
data().begin(); istrip != collrphi.
data().end(); istrip++) {
166 float ych = RHBuilder->build(&(*istrip))->globalPosition().y();
167 if ((seed_plus && (ych < yref)) || (!(seed_plus) && (ych > yref)))
168 allHits.push_back(&(*istrip));
171 for (istrip = collstereo.
data().begin(); istrip != collstereo.
data().end(); istrip++) {
172 float ych = RHBuilder->build(&(*istrip))->globalPosition().y();
173 if ((seed_plus && (ych < yref)) || (!(seed_plus) && (ych > yref)))
174 allHits.push_back(&(*istrip));
187 const GeomDet *gdet = (&(*tracker))->idToDet(
DetId(pState.detId()));
194 unsigned int ibestdet;
196 for (
unsigned int icosmhit = 0; icosmhit < Hits.size(); icosmhit++) {
197 GlobalPoint gphit = RHBuilder->build(Hits[icosmhit])->globalPosition();
198 unsigned int iraw = Hits[icosmhit]->geographicalId().rawId();
199 LogDebug(
"CosmicTrackFinder") <<
" HIT POSITION " << gphit;
203 tracker->idToDet(Hits[icosmhit]->geographicalId())->surface());
211 LogDebug(
"CosmicTrackFinder") <<
"STATE PROPAGATED AT DET " << iraw <<
" " << prSt;
212 for (icosm2 = icosmhit; icosm2 < Hits.size(); icosm2++) {
213 if (iraw == Hits[icosm2]->geographicalId().rawId()) {
215 float contr = theEstimator->estimate(prSt, *tmphit).second;
216 if (contr < chi2min) {
220 if (icosm2 != icosmhit)
224 icosm2 = Hits.size();
228 LogDebug(
"CosmicTrackFinder") <<
"Chi2 contribution for hit at "
229 << RHBuilder->build(Hits[ibestdet])->globalPosition() <<
" is " << chi2min;
233 GlobalVector ck = RHBuilder->build(Hits[ibestdet])->globalPosition() -
235 if ((
abs(ck.
x() / ck.
y()) > 2) || (
abs(ck.
z() / ck.
y()) > 2))
239 if (
abs(prLoc.
x()) < 25 &&
abs(prLoc.
y()) < 25) {
241 TSOS UpdatedState = theUpdator->
update(prSt, *tmphitbestdet);
243 traj.
push(
TM(prSt, UpdatedState, RHBuilder->build(Hits[ibestdet]), chi2min));
244 LogDebug(
"CosmicTrackFinder") <<
"STATE UPDATED WITH HIT AT POSITION " << tmphitbestdet->globalPosition()
247 hits.push_back(tmphitbestdet);
250 LogDebug(
"CosmicTrackFinder") <<
" Hits outside module surface " << prLoc;
252 LogDebug(
"CosmicTrackFinder") <<
" State can not be updated with hit at position " << gphit;
254 LogDebug(
"CosmicTrackFinder") <<
" State can not be propagated at det " << iraw;
257 if (qualityFilter(traj)) {
261 tracker->idToDet((*
hits.begin())->geographicalId())->surface())
264 tracker->idToDet((*
hits.begin())->geographicalId())->surface());
266 trajFit = theFitter->fit(tmpseed,
hits, startingState);
276 unsigned int iid = (*hit)->hit()->geographicalId().rawId();
278 if (((iid >> 0) & 0x3) != 1)
284 if (ngoodhits >= theMinHits) {