57 #include "Math/VectorUtil.h"
71 useDefaultPropagator_ =
false;
78 cachedTrajectory_.setPropagator(ivProp_);
90 if (useDefaultPropagator_ && (!defProp_ || theMagneticFieldWatcher_.check(iSetup))) {
95 prop->setMaterialMode(
false);
96 prop->applyRadX0Correction(
true);
99 setPropagator(defProp_.get());
114 return associate(iEvent, iSetup, parameters, &fts);
126 <<
"Configuration error! No subdetector was selected for the track association.";
130 cachedTrajectory_.setStateAtIP(trackOrigin);
132 init(iSetup, parameters);
144 cachedTrajectory_.reset_trajectory();
149 double HOmaxR = hoDetIdAssociator_->volume().maxR();
150 double HOmaxZ = hoDetIdAssociator_->volume().maxZ();
151 double minR = ecalDetIdAssociator_->volume().minR();
152 double minZ = preshowerDetIdAssociator_->volume().minZ();
153 cachedTrajectory_.setMaxHORadius(HOmaxR);
154 cachedTrajectory_.setMaxHOLength(HOmaxZ * 2.);
155 cachedTrajectory_.setMinDetectorRadius(minR);
156 cachedTrajectory_.setMinDetectorLength(minZ * 2.);
159 double maxR = muonDetIdAssociator_->volume().maxR();
160 double maxZ = muonDetIdAssociator_->volume().maxZ();
161 cachedTrajectory_.setMaxDetectorRadius(maxR);
162 cachedTrajectory_.setMaxDetectorLength(maxZ * 2.);
164 cachedTrajectory_.setMaxDetectorRadius(HOmaxR);
165 cachedTrajectory_.setMaxDetectorLength(HOmaxZ * 2.);
171 LogTrace(
"TrackAssociator") <<
"Using outerState as trackOrigin at Rho=" << outerState->
position().
perp()
172 <<
" Z=" << outerState->
position().
z() <<
"\n";
174 }
else if (innerState) {
175 LogTrace(
"TrackAssociator") <<
"Using innerState as trackOrigin at Rho=" << innerState->
position().
perp()
176 <<
" Z=" << innerState->
position().
z() <<
"\n";
186 if (!cachedTrajectory_.propagateAll(trackOrigin))
190 cachedTrajectory_.findEcalTrajectory(ecalDetIdAssociator_->volume());
191 cachedTrajectory_.findHcalTrajectory(hcalDetIdAssociator_->volume());
192 cachedTrajectory_.findHOTrajectory(hoDetIdAssociator_->volume());
193 cachedTrajectory_.findPreshowerTrajectory(preshowerDetIdAssociator_->volume());
195 info.
trkGlobPosAtEcal = getPoint(cachedTrajectory_.getStateAtEcal().position());
196 info.
trkGlobPosAtHcal = getPoint(cachedTrajectory_.getStateAtHcal().position());
197 info.
trkGlobPosAtHO = getPoint(cachedTrajectory_.getStateAtHO().position());
199 info.
trkMomAtEcal = cachedTrajectory_.getStateAtEcal().momentum();
200 info.
trkMomAtHcal = cachedTrajectory_.getStateAtHcal().momentum();
201 info.
trkMomAtHO = cachedTrajectory_.getStateAtHO().momentum();
204 fillEcal(iEvent, info, parameters);
206 fillCaloTowers(iEvent, info, parameters);
208 fillHcal(iEvent, info, parameters);
209 if (parameters.
useHO)
210 fillHO(iEvent, info, parameters);
212 fillPreshower(iEvent, info, parameters);
214 fillMuon(iEvent, info, parameters);
216 fillCaloTruth(iEvent, info, parameters);
224 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getEcalTrajectory();
226 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
227 itr != trajectoryStates.end();
229 LogTrace(
"TrackAssociator") <<
"ECAL trajectory point (rho, z, phi): " << itr->position().perp() <<
", "
230 << itr->position().z() <<
", " << itr->position().phi();
232 std::vector<GlobalPoint> coreTrajectory;
233 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
234 itr != trajectoryStates.end();
236 coreTrajectory.push_back(itr->position());
238 if (coreTrajectory.empty()) {
239 LogTrace(
"TrackAssociator") <<
"ECAL track trajectory is empty; moving on\n";
249 throw cms::Exception(
"FatalError") <<
"Unable to find EBRecHitCollection in the event!\n";
254 throw cms::Exception(
"FatalError") <<
"Unable to find EERecHitCollection in event!\n";
256 std::set<DetId> ecalIdsInRegion;
261 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
263 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dREcalPreselection);
264 LogTrace(
"TrackAssociator") <<
"ECAL hits in the region: " << ecalIdsInRegion.size();
266 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsInACone(ecalIdsInRegion, coreTrajectory, parameters.
dREcal);
267 LogTrace(
"TrackAssociator") <<
"ECAL hits in the cone: " << ecalIdsInRegion.size();
268 info.
crossedEcalIds = ecalDetIdAssociator_->getCrossedDetIds(ecalIdsInRegion, coreTrajectory);
270 LogTrace(
"TrackAssociator") <<
"ECAL crossed hits " << crossedEcalIds.size();
273 for (std::vector<DetId>::const_iterator itr = crossedEcalIds.begin(); itr != crossedEcalIds.end(); itr++) {
274 std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
275 std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
276 if (ebHit != (*EBRecHits).end())
278 else if (eeHit != (*EERecHits).end())
281 LogTrace(
"TrackAssociator") <<
"Crossed EcalRecHit is not found for DetId: " << itr->rawId();
283 for (std::set<DetId>::const_iterator itr = ecalIdsInRegion.begin(); itr != ecalIdsInRegion.end(); itr++) {
284 std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
285 std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
286 if (ebHit != (*EBRecHits).end())
288 else if (eeHit != (*EERecHits).end())
291 LogTrace(
"TrackAssociator") <<
"EcalRecHit from the cone is not found for DetId: " << itr->rawId();
299 std::vector<GlobalPoint> trajectory;
300 const std::vector<SteppingHelixStateInfo>& ecalTrajectoryStates = cachedTrajectory_.getEcalTrajectory();
301 const std::vector<SteppingHelixStateInfo>& hcalTrajectoryStates = cachedTrajectory_.getHcalTrajectory();
302 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = ecalTrajectoryStates.begin();
303 itr != ecalTrajectoryStates.end();
305 trajectory.push_back(itr->position());
306 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = hcalTrajectoryStates.begin();
307 itr != hcalTrajectoryStates.end();
309 trajectory.push_back(itr->position());
311 if (trajectory.empty()) {
312 LogTrace(
"TrackAssociator") <<
"HCAL trajectory is empty; moving on\n";
322 throw cms::Exception(
"FatalError") <<
"Unable to find CaloTowers in event!\n";
324 std::set<DetId> caloTowerIdsInRegion;
329 caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], mapRange);
331 caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], parameters.
dRHcalPreselection);
333 LogTrace(
"TrackAssociator") <<
"Towers in the region: " << caloTowerIdsInRegion.size();
335 auto caloTowerIdsInAConeBegin = caloTowerIdsInRegion.begin();
336 auto caloTowerIdsInAConeEnd = caloTowerIdsInRegion.end();
337 std::set<DetId> caloTowerIdsInAConeTmp;
338 if (!caloDetIdAssociator_->selectAllInACone(parameters.
dRHcal)) {
339 caloTowerIdsInAConeTmp =
340 caloDetIdAssociator_->getDetIdsInACone(caloTowerIdsInRegion, trajectory, parameters.
dRHcal);
341 caloTowerIdsInAConeBegin = caloTowerIdsInAConeTmp.begin();
342 caloTowerIdsInAConeEnd = caloTowerIdsInAConeTmp.end();
344 LogTrace(
"TrackAssociator") <<
"Towers in the cone: "
345 <<
std::distance(caloTowerIdsInAConeBegin, caloTowerIdsInAConeEnd);
347 info.
crossedTowerIds = caloDetIdAssociator_->getCrossedDetIds(caloTowerIdsInRegion, trajectory);
349 LogTrace(
"TrackAssociator") <<
"Towers crossed: " << crossedCaloTowerIds.size();
352 for (std::vector<DetId>::const_iterator itr = crossedCaloTowerIds.begin(); itr != crossedCaloTowerIds.end(); itr++) {
354 if (tower != (*caloTowers).end())
357 LogTrace(
"TrackAssociator") <<
"Crossed CaloTower is not found for DetId: " << (*itr).rawId();
360 for (std::set<DetId>::const_iterator itr = caloTowerIdsInAConeBegin; itr != caloTowerIdsInAConeEnd; itr++) {
362 if (tower != (*caloTowers).end())
363 info.
towers.push_back(&*tower);
365 LogTrace(
"TrackAssociator") <<
"CaloTower from the cone is not found for DetId: " << (*itr).rawId();
372 std::vector<GlobalPoint> trajectory;
373 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getPreshowerTrajectory();
374 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
375 itr != trajectoryStates.end();
377 trajectory.push_back(itr->position());
379 if (trajectory.empty()) {
380 LogTrace(
"TrackAssociator") <<
"Preshower trajectory is empty; moving on\n";
384 std::set<DetId> idsInRegion =
387 LogTrace(
"TrackAssociator") <<
"Number of Preshower Ids in the region: " << idsInRegion.size();
388 info.
crossedPreshowerIds = preshowerDetIdAssociator_->getCrossedDetIds(idsInRegion, trajectory);
395 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHcalTrajectory();
397 std::vector<GlobalPoint> coreTrajectory;
398 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
399 itr != trajectoryStates.end();
401 coreTrajectory.push_back(itr->position());
403 if (coreTrajectory.empty()) {
404 LogTrace(
"TrackAssociator") <<
"HCAL trajectory is empty; moving on\n";
414 throw cms::Exception(
"FatalError") <<
"Unable to find HBHERecHits in event!\n";
416 std::set<DetId> idsInRegion;
421 idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
423 idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dRHcalPreselection);
425 LogTrace(
"TrackAssociator") <<
"HCAL hits in the region: " << idsInRegion.size() <<
"\n"
428 auto idsInAConeBegin = idsInRegion.begin();
429 auto idsInAConeEnd = idsInRegion.end();
430 std::set<DetId> idsInAConeTmp;
431 if (!hcalDetIdAssociator_->selectAllInACone(parameters.
dRHcal)) {
432 idsInAConeTmp = hcalDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.
dRHcal);
433 idsInAConeBegin = idsInAConeTmp.begin();
434 idsInAConeEnd = idsInAConeTmp.end();
436 LogTrace(
"TrackAssociator") <<
"HCAL hits in the cone: " <<
std::distance(idsInAConeBegin, idsInAConeEnd) <<
"\n"
437 <<
DetIdInfo::info(std::set<DetId>(idsInAConeBegin, idsInAConeEnd),
nullptr);
438 info.
crossedHcalIds = hcalDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
440 LogTrace(
"TrackAssociator") <<
"HCAL hits crossed: " << crossedIds.size() <<
"\n"
444 for (std::vector<DetId>::const_iterator itr = crossedIds.begin(); itr != crossedIds.end(); itr++) {
446 if (hit != (*collection).end())
449 LogTrace(
"TrackAssociator") <<
"Crossed HBHERecHit is not found for DetId: " << itr->rawId();
451 for (std::set<DetId>::const_iterator itr = idsInAConeBegin; itr != idsInAConeEnd; itr++) {
453 if (hit != (*collection).end())
456 LogTrace(
"TrackAssociator") <<
"HBHERecHit from the cone is not found for DetId: " << itr->rawId();
463 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHOTrajectory();
465 std::vector<GlobalPoint> coreTrajectory;
466 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
467 itr != trajectoryStates.end();
469 coreTrajectory.push_back(itr->position());
471 if (coreTrajectory.empty()) {
472 LogTrace(
"TrackAssociator") <<
"HO trajectory is empty; moving on\n";
482 throw cms::Exception(
"FatalError") <<
"Unable to find HORecHits in event!\n";
484 std::set<DetId> idsInRegion;
489 idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
491 idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dRHcalPreselection);
493 LogTrace(
"TrackAssociator") <<
"idsInRegion.size(): " << idsInRegion.size();
495 auto idsInAConeBegin = idsInRegion.begin();
496 auto idsInAConeEnd = idsInRegion.end();
497 std::set<DetId> idsInAConeTmp;
498 if (!hoDetIdAssociator_->selectAllInACone(parameters.
dRHcal)) {
499 idsInAConeTmp = hoDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.
dRHcal);
500 idsInAConeBegin = idsInAConeTmp.begin();
501 idsInAConeEnd = idsInAConeTmp.end();
503 LogTrace(
"TrackAssociator") <<
"idsInACone.size(): " <<
std::distance(idsInAConeBegin, idsInAConeEnd);
504 info.
crossedHOIds = hoDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
505 const std::vector<DetId>& crossedIds = info.
crossedHOIds;
508 for (std::vector<DetId>::const_iterator itr = crossedIds.begin(); itr != crossedIds.end(); itr++) {
510 if (hit != (*collection).end())
513 LogTrace(
"TrackAssociator") <<
"Crossed HORecHit is not found for DetId: " << itr->rawId();
516 for (std::set<DetId>::const_iterator itr = idsInAConeBegin; itr != idsInAConeEnd; itr++) {
518 if (hit != (*collection).end())
521 LogTrace(
"TrackAssociator") <<
"HORecHit from the cone is not found for DetId: " << itr->rawId();
532 if (
abs(track.
type()) == 211 ||
535 charge = track.
type() < 0 ? -1 : 1;
536 return getFreeTrajectoryState(bField,
vector,
point, charge);
545 ROOT::Math::SMatrixIdentity
id;
564 ROOT::Math::SMatrixIdentity
id;
582 if (delta.second > 0)
586 LogTrace(
"TrackAssociator") <<
"Selection range: (dThetaPlus, dThetaMinus, dPhiPlus, dPhiMinus, dRPreselection): "
588 <<
", " << mapRange.
dPhiMinus <<
", " << dR;
604 if (!trajectoryPoint.
isValid())
605 trajectoryPoint = cachedTrajectory_.getOuterState();
606 if (!trajectoryPoint.
isValid()) {
608 <<
"trajectory position at HCAL is not valid. Assume the track cannot reach muon detectors and skip it";
613 LogTrace(
"TrackAssociator") <<
"muon direction: " << direction
614 <<
"\n\t and corresponding point: " << trajectoryPoint.
position() <<
"\n";
621 std::set<DetId> muonIdsInRegion = muonDetIdAssociator_->getDetIdsCloseToAPoint(trajectoryPoint.
position(), mapRange);
622 LogTrace(
"TrackAssociator") <<
"Number of chambers to check: " << muonIdsInRegion.size();
623 for (std::set<DetId>::const_iterator detId = muonIdsInRegion.begin(); detId != muonIdsInRegion.end(); detId++) {
624 const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet(*detId);
626 if (!stateOnSurface.
isValid()) {
627 LogTrace(
"TrackAssociator") <<
"Failed to propagate the track; moving on\n\t"
628 <<
"Element is not crosssed: " <<
DetIdInfo::info(*detId,
nullptr) <<
"\n";
633 float distanceX = 0.f;
634 float distanceY = 0.f;
635 if (
const CSCChamber* cscChamber = dynamic_cast<const CSCChamber*>(geomDet)) {
638 LogTrace(
"TrackAssociator") <<
"Failed to get CSCChamberSpecs from CSCChamber; moving on\n";
642 if (!layerGeometry) {
643 LogTrace(
"TrackAssociator") <<
"Failed to get CSCLayerGeometry from CSCChamberSpecs; moving on\n";
648 LogTrace(
"TrackAssociator") <<
"Failed to get CSCWireTopology from CSCLayerGeometry; moving on\n";
658 float yCOWPOffset = yOfFirstWire + 0.5f * length;
661 float tangent = (wideWidth - narrowWidth) / (2.
f * length);
663 float yPrime = localPoint.
y() +
std::abs(yOfFirstWire);
665 float halfWidthAtYPrime = 0.5f * narrowWidth + yPrime * tangent;
666 distanceX =
std::abs(localPoint.
x()) - halfWidthAtYPrime;
667 distanceY =
std::abs(localPoint.
y() - yCOWPOffset) - 0.5
f * length;
673 (distanceX * distanceX <
675 distanceY * distanceY <
679 match.
tState = stateOnSurface;
683 matches.push_back(match);
686 <<
"\n\tdistanceX: " << distanceX <<
"\t distanceY: " << distanceY
687 <<
"\t sigmaX: " << distanceX /
sqrt(localError.
xx())
688 <<
"\t sigmaY: " << distanceY /
sqrt(localError.
yy()) <<
"\n";
700 throw cms::Exception(
"FatalError") <<
"Unable to find DTRecSegment4DCollection in event!\n";
705 throw cms::Exception(
"FatalError") <<
"Unable to find CSCSegmentCollection in event!\n";
725 std::vector<TAMuonChamberMatch> matchedChambers;
726 LogTrace(
"TrackAssociator") <<
"Trying to Get ChamberMatches" << std::endl;
727 getTAMuonChamberMatches(matchedChambers, parameters);
728 LogTrace(
"TrackAssociator") <<
"Chambers matched: " << matchedChambers.size() <<
"\n";
732 for (std::vector<TAMuonChamberMatch>::iterator matchedChamber = matchedChambers.begin();
733 matchedChamber != matchedChambers.end();
735 const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet((*matchedChamber).id);
737 if (
const DTChamber* chamber = dynamic_cast<const DTChamber*>(geomDet)) {
742 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
743 matchedChamber->segments.back().dtSegmentRef =
DTRecSegment4DRef(dtSegments, segment - dtSegments->begin());
748 else if (
const CSCChamber* chamber = dynamic_cast<const CSCChamber*>(geomDet)) {
753 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
754 matchedChamber->segments.back().cscSegmentRef =
CSCSegmentRef(cscSegments, segment - cscSegments->begin());
760 if (
const GEMSuperChamber* chamber = dynamic_cast<const GEMSuperChamber*>(geomDet)) {
765 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
766 matchedChamber->segments.back().gemSegmentRef =
774 if (
const ME0Chamber* chamber = dynamic_cast<const ME0Chamber*>(geomDet)) {
779 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
780 matchedChamber->segments.back().me0SegmentRef =
787 info.
chambers.push_back(*matchedChamber);
797 const GeomDet* chamber = muonDetIdAssociator_->getGeomDet(matchedChamber.
id);
801 LogTrace(
"TrackAssociator") <<
"Segment global position: " << segmentGlobalPosition
802 <<
" \t (R_xy,eta,phi): " << segmentGlobalPosition.
perp() <<
","
803 << segmentGlobalPosition.
eta() <<
"," << segmentGlobalPosition.
phi() <<
"\n";
805 LogTrace(
"TrackAssociator") <<
"\teta hit: " << segmentGlobalPosition.
eta()
807 <<
"\tphi hit: " << segmentGlobalPosition.
phi()
812 bool isDTWithoutY =
false;
814 if (dtseg && (!dtseg->
hasZed()))
818 if (deltaPhi >
float(
M_PI))
823 isGood = deltaPhi < parameters.
dRMuon;
825 isGood &= deltaEta < .3f;
827 isGood = deltaEta * deltaEta + deltaPhi * deltaPhi < parameters.
dRMuon * parameters.
dRMuon;
846 muonSegment.
hasZed =
true;
847 muonSegment.
hasPhi =
true;
850 muonSegment.
t0 = 0.f;
852 if ((dtseg->
hasPhi()) && (!isDTWithoutY)) {
861 LogTrace(
"TrackAssociator") <<
" Phi t0: " << dtseg->
phiSegment()->
t0() <<
" hits: " << phiHits;
870 muonSegment.
t0 = t0 / hits;
875 muonSegment.
hasZed =
false;
877 muonSegment.
hasPhi =
false;
880 matchedChamber.
segments.push_back(muonSegment);
895 if (!simTracks.isValid())
896 throw cms::Exception(
"FatalError") <<
"No simulated tracks found\n";
900 if (!simVertices.isValid())
901 throw cms::Exception(
"FatalError") <<
"No simulated vertices found\n";
906 if (!simEcalHitsEB.isValid())
907 throw cms::Exception(
"FatalError") <<
"No simulated ECAL EB hits found\n";
911 if (!simEcalHitsEE.isValid())
912 throw cms::Exception(
"FatalError") <<
"No simulated ECAL EE hits found\n";
916 if (!simHcalHits.isValid())
917 throw cms::Exception(
"FatalError") <<
"No simulated HCAL hits found\n";
920 SimTrackContainer::const_iterator
simTrack = simTracks->begin();
929 float ecalTrueEnergy(0);
930 float hcalTrueEnergy(0);
933 for (PCaloHitContainer::const_iterator
hit = simEcalHitsEB->begin();
hit != simEcalHitsEB->end(); ++
hit)
935 ecalTrueEnergy +=
hit->energy();
937 for (PCaloHitContainer::const_iterator
hit = simEcalHitsEE->begin();
hit != simEcalHitsEE->end(); ++
hit)
939 ecalTrueEnergy +=
hit->energy();
941 for (PCaloHitContainer::const_iterator
hit = simHcalHits->begin();
hit != simHcalHits->end(); ++
hit)
943 hcalTrueEnergy +=
hit->energy();
960 double currentStepSize = cachedTrajectory_.getPropagationStep();
965 if (direction != InsideOut)
966 throw cms::Exception(
"FatalError") <<
"No TrackExtra information is available and association is done with "
967 "something else than InsideOut track.\n"
968 <<
"Either change the parameter or provide needed data!\n";
969 LogTrace(
"TrackAssociator") <<
"Track Extras not found\n";
971 return associate(iEvent, iSetup, parameters, &initialState);
974 LogTrace(
"TrackAssociator") <<
"Track Extras found\n";
979 LogTrace(
"TrackAssociator") <<
"inner track state (rho, z, phi):" << track.
innerPosition().Rho() <<
", "
981 LogTrace(
"TrackAssociator") <<
"innerFreeState (rho, z, phi):" << innerState.
position().
perp() <<
", "
984 LogTrace(
"TrackAssociator") <<
"outer track state (rho, z, phi):" << track.
outerPosition().Rho() <<
", "
986 LogTrace(
"TrackAssociator") <<
"outerFreeState (rho, z, phi):" << outerState.
position().
perp() <<
", "
990 if (crossedIP(track)) {
994 return associate(iEvent, iSetup, parameters, &referenceState, &outerState);
997 cachedTrajectory_.setPropagationStep(-
std::abs(currentStepSize));
999 cachedTrajectory_.setPropagationStep(currentStepSize);
1005 switch (direction) {
1007 return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1010 cachedTrajectory_.setPropagationStep(-
std::abs(currentStepSize));
1012 cachedTrajectory_.setPropagationStep(currentStepSize);
1020 cachedTrajectory_.setPropagationStep(-
std::abs(currentStepSize));
1023 result = associate(iEvent, iSetup, parameters, &innerState, &outerState);
1025 result = associate(iEvent, iSetup, parameters, &outerState, &innerState);
1026 cachedTrajectory_.setPropagationStep(currentStepSize);
1034 return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1043 return associate(iEvent, iSetup, getFreeTrajectoryState(
bField, track, vertex), parameters);
1053 return associate(iEvent, iSetup, getFreeTrajectoryState(
bField, momentum, vertex, charge), parameters);
1057 bool crossed =
true;
edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > hoDetIdAssociatorToken
constexpr double deltaPhi(double phi1, double phi2)
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken
std::vector< DetId > crossedPreshowerIds
math::XYZPoint trkGlobPosAtHO
edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > caloDetIdAssociatorToken
std::pair< const_iterator, const_iterator > range
iterator range
TrackDetectorAssociator()
float segmentLocalErrorXX
const CSCWireTopology * wireTopology() const
virtual float length() const =0
static bool crossedIP(const reco::Track &track)
std::vector< const CaloTower * > crossedTowers
virtual LocalError localDirectionError() const =0
Error on the local direction.
std::vector< const CaloTower * > towers
uint16_t *__restrict__ id
TrajectoryStateOnSurface tState
const TrackExtraRef & extra() const
reference to "extra" object
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::vector< const HBHERecHit * > crossedHcalRecHits
std::vector< DetId > crossedTowerIds
double dREcalPreselection
float segmentLocalErrorXY
bool getByToken(EDGetToken token, Handle< PROD > &result) const
math::XYZPoint segmentGlobalPosition
constexpr bool isNotFinite(T x)
float segmentLocalErrorYDyDz
edm::Ref< CSCSegmentCollection > CSCSegmentRef
edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > preshowerDetIdAssociatorToken
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
std::vector< DetId > crossedEcalIds
edm::Ref< ME0SegmentCollection > ME0SegmentRef
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
math::XYZPoint segmentLocalPosition
virtual LocalVector localDirection() const =0
Local direction.
edm::EDGetTokenT< GEMSegmentCollection > gemSegmentsToken
void useDefaultPropagator()
use the default propagator
Geom::Phi< T > phi() const
constexpr uint32_t rawId() const
get the raw id
std::vector< CaloTower >::const_iterator const_iterator
void fillHcal(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
double dRMuonPreselection
const Bounds & bounds() const
bool addTAMuonSegmentMatch(TAMuonChamberMatch &, const RecSegment *, const AssociatorParameters &)
double muonMaxDistanceSigmaY
const Vector & momentum() const
track momentum vector
const math::XYZPoint & outerPosition() const
position of the outermost hit
std::vector< DetId > crossedHcalIds
GlobalVector momentum() const
std::vector< const EcalRecHit * > crossedEcalRecHits
hits in detector elements crossed by a track
const Plane & surface() const
The nominal surface of the GeomDet.
math::XYZVector segmentLocalDirection
LocalError positionError() const
edm::EDGetTokenT< EBRecHitCollection > EBRecHitsToken
void setCaloGeometry(const CaloGeometry *geometry)
float segmentLocalErrorDxDz
static const double deltaEta
math::XYZPoint trkGlobPosAtHcal
const uint16_t range(const Frame &aFrame)
FreeTrajectoryState stateAtIP
track info
void fillCaloTowers(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > ecalDetIdAssociatorToken
const math::XYZPoint & innerPosition() const
position of the innermost hit
void fillCaloTruth(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
bool getData(T &iHolder) const
edm::EDGetTokenT< edm::PCaloHitContainer > simEcalHitsEBToken
C::const_iterator const_iterator
constant access iterator type
edm::EDGetTokenT< HORecHitCollection > HOcollToken
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > theCaloGeometryToken
void init(const edm::EventSetup &, const AssociatorParameters &)
float wireAngle() const override
float segmentLocalErrorDyDz
void setPropagator(const Propagator *)
use a user configured propagator
void getTAMuonChamberMatches(std::vector< TAMuonChamberMatch > &matches, const AssociatorParameters ¶meters)
GlobalPoint position() const
LocalPoint toLocal(const GlobalPoint &gp) const
edm::Ref< GEMSegmentCollection > GEMSegmentRef
FreeTrajectoryState const * freeState(bool withErrors=true) const
std::vector< TAMuonSegmentMatch > segments
distance sign convention: negative - crossed chamber, positive - missed chamber
int genpartIndex() const
index of the corresponding Generator particle in the Event container (-1 if no Genpart) ...
edm::EDGetTokenT< ME0SegmentCollection > me0SegmentsToken
std::vector< TAMuonChamberMatch > chambers
std::vector< const HBHERecHit * > hcalRecHits
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > theTrackingGeometryToken
edm::EDGetTokenT< DTRecSegment4DCollection > dtSegmentsToken
std::vector< DetId > crossedHOIds
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken
double dRPreshowerPreselection
Abs< T >::type abs(const T &t)
const math::XYZTLorentzVectorD & position() const
edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > muonDetIdAssociatorToken
bool hasPhi() const
Does it have the Phi projection?
double lengthOfPlane() const
const LocalTrajectoryError & localError() const
edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken
float yOfWire(float wire, float x=0.) const
edm::EDGetTokenT< EERecHitCollection > EERecHitsToken
edm::EDGetTokenT< HBHERecHitCollection > HBHEcollToken
void fillPreshower(const edm::Event &iEvent, TrackDetMatchInfo &info, const AssociatorParameters &)
bool isNull() const
Checks for null.
GlobalVector momentum() const
float segmentLocalErrorYY
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
double narrowWidthOfPlane() const
double dRHcalPreselection
edm::Ref< DTRecSegment4DCollection > DTRecSegment4DRef
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
double muonMaxDistanceSigmaX
Vector3DBase unit() const
bool hasZed() const
Does it have the Z projection?
GlobalPoint position() const
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
double wideWidthOfPlane() const
double hcalTrueEnergyCorrected
GlobalVector trkMomAtEcal
edm::EDGetTokenT< edm::SimVertexContainer > simVerticesToken
static std::string info(const DetId &, const TrackerTopology *tTopo)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
virtual LocalError localPositionError() const =0
~TrackDetectorAssociator()
void fillMuon(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
static FreeTrajectoryState getFreeTrajectoryState(const MagneticField *, const reco::Track &)
get FreeTrajectoryState from different track representations
const CSCLayerGeometry * oddLayerGeometry(int iendcap) const
Accessors for LayerGeometry's.
DetIdAssociator::MapRange getMapRange(const std::pair< float, float > &delta, const float dR)
GlobalVector trkMomAtHcal
int type() const
particle type (HEP PDT convension)
float segmentLocalErrorXDxDz
void fillEcal(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
const math::XYZTLorentzVectorD & momentum() const
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
std::vector< const HORecHit * > crossedHORecHits
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
edm::EDGetTokenT< edm::PCaloHitContainer > simHcalHitsToken
int charge() const
track electric charge
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
DetId geographicalId() const
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
std::vector< const HORecHit * > hoRecHits
edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > hcalDetIdAssociatorToken
virtual LocalPoint localPosition() const =0
virtual float width() const =0
const SimTrack * simTrack
MC truth info.
edm::EDGetTokenT< CSCSegmentCollection > cscSegmentsToken
void fillHO(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
bool accountForTrajectoryChangeCalo
edm::EDGetTokenT< edm::PCaloHitContainer > simEcalHitsEEToken