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;
126 const GeomDet *hitGeomDet = (&(*tracker))->idToDet(ihit->geographicalId());
129 if (ihit == hitRange.second - 1) {
148 vector<const TrackingRecHit *> allHits;
154 for (ihit = hRange.first; ihit != hRange.second; ihit++) {
155 yref = RHBuilder->build(&(*ihit))->globalPosition().y();
156 hits.push_back((RHBuilder->build(&(*ihit))));
157 LogDebug(
"CosmicTrackFinder") <<
"SEED HITS" << RHBuilder->build(&(*ihit))->globalPosition();
161 for (ipix = collpixel.
data().begin(); ipix != collpixel.
data().end(); ipix++) {
162 float ych = RHBuilder->build(&(*ipix))->globalPosition().y();
163 if ((seed_plus && (ych < yref)) || (!(seed_plus) && (ych > yref)))
164 allHits.push_back(&(*ipix));
167 for (istrip = collrphi.
data().begin(); istrip != collrphi.
data().end(); istrip++) {
168 float ych = RHBuilder->build(&(*istrip))->globalPosition().y();
169 if ((seed_plus && (ych < yref)) || (!(seed_plus) && (ych > yref)))
170 allHits.push_back(&(*istrip));
173 for (istrip = collstereo.
data().begin(); istrip != collstereo.
data().end(); istrip++) {
174 float ych = RHBuilder->build(&(*istrip))->globalPosition().y();
175 if ((seed_plus && (ych < yref)) || (!(seed_plus) && (ych > yref)))
176 allHits.push_back(&(*istrip));
189 const GeomDet *gdet = (&(*tracker))->idToDet(
DetId(pState.detId()));
196 unsigned int ibestdet;
198 for (
unsigned int icosmhit = 0; icosmhit < Hits.size(); icosmhit++) {
199 GlobalPoint gphit = RHBuilder->build(Hits[icosmhit])->globalPosition();
200 unsigned int iraw = Hits[icosmhit]->geographicalId().rawId();
201 LogDebug(
"CosmicTrackFinder") <<
" HIT POSITION " << gphit;
205 tracker->idToDet(Hits[icosmhit]->geographicalId())->surface());
213 LogDebug(
"CosmicTrackFinder") <<
"STATE PROPAGATED AT DET " << iraw <<
" " << prSt;
214 for (icosm2 = icosmhit; icosm2 < Hits.size(); icosm2++) {
215 if (iraw == Hits[icosm2]->geographicalId().rawId()) {
217 float contr = theEstimator->estimate(prSt, *tmphit).second;
218 if (contr < chi2min) {
222 if (icosm2 != icosmhit)
226 icosm2 = Hits.size();
230 LogDebug(
"CosmicTrackFinder") <<
"Chi2 contribution for hit at "
231 << RHBuilder->build(Hits[ibestdet])->globalPosition() <<
" is " << chi2min;
235 GlobalVector ck = RHBuilder->build(Hits[ibestdet])->globalPosition() -
237 if ((
abs(ck.
x() / ck.
y()) > 2) || (
abs(ck.
z() / ck.
y()) > 2))
241 if (
abs(prLoc.
x()) < 25 &&
abs(prLoc.
y()) < 25) {
243 TSOS UpdatedState = theUpdator->
update(prSt, *tmphitbestdet);
245 traj.
push(
TM(prSt, UpdatedState, RHBuilder->build(Hits[ibestdet]), chi2min));
246 LogDebug(
"CosmicTrackFinder") <<
"STATE UPDATED WITH HIT AT POSITION " << tmphitbestdet->globalPosition()
249 hits.push_back(tmphitbestdet);
252 LogDebug(
"CosmicTrackFinder") <<
" Hits outside module surface " << prLoc;
254 LogDebug(
"CosmicTrackFinder") <<
" State can not be updated with hit at position " << gphit;
256 LogDebug(
"CosmicTrackFinder") <<
" State can not be propagated at det " << iraw;
259 if (qualityFilter(traj)) {
263 tracker->idToDet((*
hits.begin())->geographicalId())->surface())
266 tracker->idToDet((*
hits.begin())->geographicalId())->surface());
268 trajFit = theFitter->fit(tmpseed,
hits, startingState);
278 unsigned int iid = (*hit)->hit()->geographicalId().rawId();
280 if (((iid >> 0) & 0x3) != 1)
286 if (ngoodhits >= theMinHits) {