Definition at line 137 of file CosmicTrackSplitter.cc.
138 LogDebug(
"CosmicTrackSplitter") <<
"IN THE SPLITTER!!!!!";
155 auto output = std::make_unique<TrackCandidateCollection>();
159 std::vector<TrackingRecHit *>
hits;
163 LogDebug(
"CosmicTrackSplitter") <<
"size of map: " << m_TrajTracksMap->
size();
164 int HITTOSPLITFROM = 0;
166 iPair != m_TrajTracksMap->
end();
168 const Trajectory *trajFromMap = &(*(*iPair).key);
169 const reco::Track *trackFromMap = &(*(*iPair).val);
172 std::vector<TrajectoryMeasurement> measurements = trajFromMap->
measurements();
173 int totalNumberOfHits = measurements.size();
174 int numberOfHits = 0;
175 double previousDotProduct = 0;
178 GlobalVector stateMomentum = measurements[numberOfHits].forwardPredictedState().globalMomentum();
179 GlobalPoint statePosition = measurements[numberOfHits].forwardPredictedState().globalPosition();
180 double dotProduct = stateMomentum.
x() * statePosition.
x() + stateMomentum.
y() * statePosition.
y();
181 if (dotProduct * previousDotProduct < 0) {
183 HITTOSPLITFROM = numberOfHits;
186 previousDotProduct = dotProduct;
189 LogDebug(
"CosmicTrackSplitter") <<
"number of rechits: " << numberOfHits;
223 GlobalPoint bPosState = measurements[0].updatedState().globalPosition();
224 GlobalPoint fPosState = measurements[measurements.size() - 1].updatedState().globalPosition();
225 bool trajReversedFlag =
false;
235 if (((bPosHit - bPosState).
mag() > (bPosHit - fPosState).
mag()) &&
236 ((fPosHit - fPosState).
mag() > (fPosHit - bPosState).
mag())) {
237 trajReversedFlag =
true;
239 if (trajReversedFlag) {
240 int temp = HITTOSPLITFROM;
241 HITTOSPLITFROM = totalNumberOfHits -
temp;
247 for (std::vector<reco::Track>::const_iterator itt =
tracks->begin(), edt =
tracks->end(); itt != edt; ++itt) {
256 bool continueWithTrack =
true;
258 continueWithTrack =
false;
260 continueWithTrack =
false;
261 if (continueWithTrack ==
false)
265 for (
int i = 0;
i < 2; ++
i) {
267 LogDebug(
"CosmicTrackSplitter") <<
" loop on hits of track #" << (itt -
tracks->begin());
273 LogDebug(
"CosmicTrackSplitter") <<
" hit number " << (ith - itt->recHitsBegin());
275 if (
hit->isValid()) {
276 LogDebug(
"CosmicTrackSplitter") <<
" valid, detid = " <<
hit->geographicalId().rawId();
277 DetId detid =
hit->geographicalId();
280 LogDebug(
"CosmicTrackSplitter") <<
" valid, tracker ";
281 bool verdict =
false;
287 LogDebug(
"CosmicTrackSplitter") <<
"hit pos: " <<
pos <<
", dca pos: " <<
v;
290 if ((
i == 0) && (hitCtr < HITTOSPLITFROM)) {
292 LogDebug(
"CosmicTrackSplitter") <<
"tophalf";
295 if ((
i == 1) && (hitCtr >= HITTOSPLITFROM)) {
297 LogDebug(
"CosmicTrackSplitter") <<
"bottomhalf";
314 <<
" verdict after module list: " << (verdict ?
"ok" :
"no");
315 if (verdict ==
true) {
333 LogDebug(
"CosmicTrackSplitter") <<
" end of hit " << (ith - itt->recHitsBegin());
336 LogDebug(
"CosmicTrackSplitter") <<
" end of loop on hits of track #" << (itt -
tracks->begin());
338 std::vector<TrackingRecHit *>::iterator
begin =
hits.begin(),
end =
hits.end();
340 LogDebug(
"CosmicTrackSplitter") <<
" selected " <<
hits.size() <<
" hits ";
344 while ((
begin !=
end) && ((*begin)->isValid() ==
false))
348 LogDebug(
"CosmicTrackSplitter") <<
" after front stripping we have " << (
end -
begin) <<
" hits ";
353 while ((
begin !=
end) && ((*end)->isValid() ==
false))
358 LogDebug(
"CosmicTrackSplitter") <<
" after back stripping we have " << (
end -
begin) <<
" hits ";
364 LogDebug(
"CosmicTrackSplitter") <<
"we made a candidate of " <<
hits.size() <<
" hits!";
372 <<
"loop: " <<
i <<
" has " << usedHitCtr <<
" active hits and " <<
hits.size() <<
" total hits...";
References begin, edm::AssociationMap< Tag >::begin(), edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, DetId::det(), detsToIgnore_, dXYcut_, dZcut_, end, edm::AssociationMap< Tag >::end(), excludePixelHits_, TrackingRecHit::geographicalId(), reco::get(), edm::EventSetup::get(), hfClusterShapes_cfi::hits, mps_fire::i, TrackerGeometry::idToDetUnit(), iEvent, TrackingRecHit::inactive, TrackingRecHit::isValid(), TrackingRecHit::localPosition(), LogDebug, mag(), makeCandidate(), Trajectory::measurements(), minimumHits_, eostools::move(), convertSQLitetoXML_cfg::output, DetId::rawId(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), replaceWithInactiveHits_, edm::AssociationMap< Tag >::size(), stripAllInvalidHits_, stripBackInvalidHits_, stripFrontInvalidHits_, DetId::subdetId(), GeomDet::surface(), groupFilesInBlocks::temp, theGeometry, theMagField, Surface::toGlobal(), tokenTracks, tokenTrajTrack, totalTracks_, DetId::Tracker, PDWG_EXOHSCP_cff::tracks, TrackingRecHit::type(), and findQualityFiles::v.