75 #include "Math/VectorUtil.h" 102 using namespace reco;
107 useDefaultPropagator_ =
false;
117 cachedTrajectory_.setPropagator(ivProp_);
125 if (!theCaloGeometry_.isValid())
126 throw cms::Exception(
"FatalError") <<
"Unable to find CaloGeometryRecord in event!\n";
130 if (!theTrackingGeometry_.isValid())
131 throw cms::Exception(
"FatalError") <<
"Unable to find GlobalTrackingGeometryRecord in event!\n";
133 if (useDefaultPropagator_ && (!defProp_ || theMagneticFeildWatcher_.check(iSetup))) {
143 setPropagator(defProp_);
158 return associate(iEvent, iSetup, parameters, &fts);
170 <<
"Configuration error! No subdetector was selected for the track association.";
174 cachedTrajectory_.setStateAtIP(trackOrigin);
188 cachedTrajectory_.reset_trajectory();
193 double HOmaxR = hoDetIdAssociator_->volume().maxR();
194 double HOmaxZ = hoDetIdAssociator_->volume().maxZ();
195 double minR = ecalDetIdAssociator_->volume().minR();
196 double minZ = preshowerDetIdAssociator_->volume().minZ();
197 cachedTrajectory_.setMaxHORadius(HOmaxR);
198 cachedTrajectory_.setMaxHOLength(HOmaxZ * 2.);
199 cachedTrajectory_.setMinDetectorRadius(minR);
200 cachedTrajectory_.setMinDetectorLength(minZ * 2.);
203 double maxR = muonDetIdAssociator_->volume().maxR();
204 double maxZ = muonDetIdAssociator_->volume().maxZ();
205 cachedTrajectory_.setMaxDetectorRadius(maxR);
206 cachedTrajectory_.setMaxDetectorLength(maxZ * 2.);
208 cachedTrajectory_.setMaxDetectorRadius(HOmaxR);
209 cachedTrajectory_.setMaxDetectorLength(HOmaxZ * 2.);
215 LogTrace(
"TrackAssociator") <<
"Using outerState as trackOrigin at Rho=" << outerState->
position().
perp()
216 <<
" Z=" << outerState->
position().
z() <<
"\n";
218 }
else if (innerState) {
219 LogTrace(
"TrackAssociator") <<
"Using innerState as trackOrigin at Rho=" << innerState->
position().
perp()
220 <<
" Z=" << innerState->
position().
z() <<
"\n";
230 if (!cachedTrajectory_.propagateAll(trackOrigin))
234 cachedTrajectory_.findEcalTrajectory(ecalDetIdAssociator_->volume());
235 cachedTrajectory_.findHcalTrajectory(hcalDetIdAssociator_->volume());
236 cachedTrajectory_.findHOTrajectory(hoDetIdAssociator_->volume());
237 cachedTrajectory_.findPreshowerTrajectory(preshowerDetIdAssociator_->volume());
239 info.
trkGlobPosAtEcal = getPoint(cachedTrajectory_.getStateAtEcal().position());
240 info.
trkGlobPosAtHcal = getPoint(cachedTrajectory_.getStateAtHcal().position());
241 info.
trkGlobPosAtHO = getPoint(cachedTrajectory_.getStateAtHO().position());
243 info.
trkMomAtEcal = cachedTrajectory_.getStateAtEcal().momentum();
244 info.
trkMomAtHcal = cachedTrajectory_.getStateAtHcal().momentum();
245 info.
trkMomAtHO = cachedTrajectory_.getStateAtHO().momentum();
248 fillEcal(iEvent, info, parameters);
252 fillHcal(iEvent, info, parameters);
253 if (parameters.
useHO)
254 fillHO(iEvent, info, parameters);
256 fillPreshower(iEvent, info, parameters);
258 fillMuon(iEvent, info, parameters);
260 fillCaloTruth(iEvent, info, parameters);
268 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getEcalTrajectory();
270 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
271 itr != trajectoryStates.end();
273 LogTrace(
"TrackAssociator") <<
"ECAL trajectory point (rho, z, phi): " << itr->position().perp() <<
", " 274 << itr->position().z() <<
", " << itr->position().phi();
276 std::vector<GlobalPoint> coreTrajectory;
277 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
278 itr != trajectoryStates.end();
280 coreTrajectory.push_back(itr->position());
282 if (coreTrajectory.empty()) {
283 LogTrace(
"TrackAssociator") <<
"ECAL track trajectory is empty; moving on\n";
293 throw cms::Exception(
"FatalError") <<
"Unable to find EBRecHitCollection in the event!\n";
298 throw cms::Exception(
"FatalError") <<
"Unable to find EERecHitCollection in event!\n";
300 std::set<DetId> ecalIdsInRegion;
305 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
307 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dREcalPreselection);
308 LogTrace(
"TrackAssociator") <<
"ECAL hits in the region: " << ecalIdsInRegion.size();
310 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsInACone(ecalIdsInRegion, coreTrajectory, parameters.
dREcal);
311 LogTrace(
"TrackAssociator") <<
"ECAL hits in the cone: " << ecalIdsInRegion.size();
312 info.
crossedEcalIds = ecalDetIdAssociator_->getCrossedDetIds(ecalIdsInRegion, coreTrajectory);
314 LogTrace(
"TrackAssociator") <<
"ECAL crossed hits " << crossedEcalIds.size();
317 for (std::vector<DetId>::const_iterator itr = crossedEcalIds.begin(); itr != crossedEcalIds.end(); itr++) {
318 std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
319 std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
320 if (ebHit != (*EBRecHits).end())
322 else if (eeHit != (*EERecHits).end())
325 LogTrace(
"TrackAssociator") <<
"Crossed EcalRecHit is not found for DetId: " << itr->rawId();
327 for (std::set<DetId>::const_iterator itr = ecalIdsInRegion.begin(); itr != ecalIdsInRegion.end(); itr++) {
328 std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
329 std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
330 if (ebHit != (*EBRecHits).end())
332 else if (eeHit != (*EERecHits).end())
335 LogTrace(
"TrackAssociator") <<
"EcalRecHit from the cone is not found for DetId: " << itr->rawId();
343 std::vector<GlobalPoint> trajectory;
344 const std::vector<SteppingHelixStateInfo>& ecalTrajectoryStates = cachedTrajectory_.getEcalTrajectory();
345 const std::vector<SteppingHelixStateInfo>& hcalTrajectoryStates = cachedTrajectory_.getHcalTrajectory();
346 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = ecalTrajectoryStates.begin();
347 itr != ecalTrajectoryStates.end();
349 trajectory.push_back(itr->position());
350 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = hcalTrajectoryStates.begin();
351 itr != hcalTrajectoryStates.end();
353 trajectory.push_back(itr->position());
355 if (trajectory.empty()) {
356 LogTrace(
"TrackAssociator") <<
"HCAL trajectory is empty; moving on\n";
366 throw cms::Exception(
"FatalError") <<
"Unable to find CaloTowers in event!\n";
368 std::set<DetId> caloTowerIdsInRegion;
373 caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], mapRange);
375 caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], parameters.
dRHcalPreselection);
377 LogTrace(
"TrackAssociator") <<
"Towers in the region: " << caloTowerIdsInRegion.size();
379 auto caloTowerIdsInAConeBegin = caloTowerIdsInRegion.begin();
380 auto caloTowerIdsInAConeEnd = caloTowerIdsInRegion.end();
381 std::set<DetId> caloTowerIdsInAConeTmp;
382 if (!caloDetIdAssociator_->selectAllInACone(parameters.
dRHcal)) {
383 caloTowerIdsInAConeTmp =
384 caloDetIdAssociator_->getDetIdsInACone(caloTowerIdsInRegion, trajectory, parameters.
dRHcal);
385 caloTowerIdsInAConeBegin = caloTowerIdsInAConeTmp.begin();
386 caloTowerIdsInAConeEnd = caloTowerIdsInAConeTmp.end();
388 LogTrace(
"TrackAssociator") <<
"Towers in the cone: " 389 <<
std::distance(caloTowerIdsInAConeBegin, caloTowerIdsInAConeEnd);
391 info.
crossedTowerIds = caloDetIdAssociator_->getCrossedDetIds(caloTowerIdsInRegion, trajectory);
393 LogTrace(
"TrackAssociator") <<
"Towers crossed: " << crossedCaloTowerIds.size();
396 for (std::vector<DetId>::const_iterator itr = crossedCaloTowerIds.begin(); itr != crossedCaloTowerIds.end(); itr++) {
398 if (tower != (*caloTowers).end())
401 LogTrace(
"TrackAssociator") <<
"Crossed CaloTower is not found for DetId: " << (*itr).rawId();
404 for (std::set<DetId>::const_iterator itr = caloTowerIdsInAConeBegin; itr != caloTowerIdsInAConeEnd; itr++) {
406 if (tower != (*caloTowers).end())
407 info.
towers.push_back(&*tower);
409 LogTrace(
"TrackAssociator") <<
"CaloTower from the cone is not found for DetId: " << (*itr).rawId();
416 std::vector<GlobalPoint> trajectory;
417 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getPreshowerTrajectory();
418 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
419 itr != trajectoryStates.end();
421 trajectory.push_back(itr->position());
423 if (trajectory.empty()) {
424 LogTrace(
"TrackAssociator") <<
"Preshower trajectory is empty; moving on\n";
428 std::set<DetId> idsInRegion =
431 LogTrace(
"TrackAssociator") <<
"Number of Preshower Ids in the region: " << idsInRegion.size();
432 info.
crossedPreshowerIds = preshowerDetIdAssociator_->getCrossedDetIds(idsInRegion, trajectory);
439 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHcalTrajectory();
441 std::vector<GlobalPoint> coreTrajectory;
442 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
443 itr != trajectoryStates.end();
445 coreTrajectory.push_back(itr->position());
447 if (coreTrajectory.empty()) {
448 LogTrace(
"TrackAssociator") <<
"HCAL trajectory is empty; moving on\n";
458 throw cms::Exception(
"FatalError") <<
"Unable to find HBHERecHits in event!\n";
460 std::set<DetId> idsInRegion;
465 idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
467 idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dRHcalPreselection);
469 LogTrace(
"TrackAssociator") <<
"HCAL hits in the region: " << idsInRegion.size() <<
"\n" 472 auto idsInAConeBegin = idsInRegion.begin();
473 auto idsInAConeEnd = idsInRegion.end();
474 std::set<DetId> idsInAConeTmp;
475 if (!hcalDetIdAssociator_->selectAllInACone(parameters.
dRHcal)) {
476 idsInAConeTmp = hcalDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.
dRHcal);
477 idsInAConeBegin = idsInAConeTmp.begin();
478 idsInAConeEnd = idsInAConeTmp.end();
480 LogTrace(
"TrackAssociator") <<
"HCAL hits in the cone: " <<
std::distance(idsInAConeBegin, idsInAConeEnd) <<
"\n" 481 <<
DetIdInfo::info(std::set<DetId>(idsInAConeBegin, idsInAConeEnd),
nullptr);
482 info.
crossedHcalIds = hcalDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
484 LogTrace(
"TrackAssociator") <<
"HCAL hits crossed: " << crossedIds.size() <<
"\n" 488 for (std::vector<DetId>::const_iterator itr = crossedIds.begin(); itr != crossedIds.end(); itr++) {
490 if (hit != (*collection).end())
493 LogTrace(
"TrackAssociator") <<
"Crossed HBHERecHit is not found for DetId: " << itr->rawId();
495 for (std::set<DetId>::const_iterator itr = idsInAConeBegin; itr != idsInAConeEnd; itr++) {
497 if (hit != (*collection).end())
500 LogTrace(
"TrackAssociator") <<
"HBHERecHit from the cone is not found for DetId: " << itr->rawId();
507 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHOTrajectory();
509 std::vector<GlobalPoint> coreTrajectory;
510 for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
511 itr != trajectoryStates.end();
513 coreTrajectory.push_back(itr->position());
515 if (coreTrajectory.empty()) {
516 LogTrace(
"TrackAssociator") <<
"HO trajectory is empty; moving on\n";
526 throw cms::Exception(
"FatalError") <<
"Unable to find HORecHits in event!\n";
528 std::set<DetId> idsInRegion;
533 idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
535 idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dRHcalPreselection);
537 LogTrace(
"TrackAssociator") <<
"idsInRegion.size(): " << idsInRegion.size();
539 auto idsInAConeBegin = idsInRegion.begin();
540 auto idsInAConeEnd = idsInRegion.end();
541 std::set<DetId> idsInAConeTmp;
542 if (!hoDetIdAssociator_->selectAllInACone(parameters.
dRHcal)) {
543 idsInAConeTmp = hoDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.
dRHcal);
544 idsInAConeBegin = idsInAConeTmp.begin();
545 idsInAConeEnd = idsInAConeTmp.end();
547 LogTrace(
"TrackAssociator") <<
"idsInACone.size(): " <<
std::distance(idsInAConeBegin, idsInAConeEnd);
548 info.
crossedHOIds = hoDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
549 const std::vector<DetId>& crossedIds = info.
crossedHOIds;
552 for (std::vector<DetId>::const_iterator itr = crossedIds.begin(); itr != crossedIds.end(); itr++) {
554 if (hit != (*collection).end())
557 LogTrace(
"TrackAssociator") <<
"Crossed HORecHit is not found for DetId: " << itr->rawId();
560 for (std::set<DetId>::const_iterator itr = idsInAConeBegin; itr != idsInAConeEnd; itr++) {
562 if (hit != (*collection).end())
565 LogTrace(
"TrackAssociator") <<
"HORecHit from the cone is not found for DetId: " << itr->rawId();
576 if (
abs(track.
type()) == 211 ||
579 charge = track.
type() < 0 ? -1 : 1;
580 return getFreeTrajectoryState(iSetup, vector,
point, charge);
592 ROOT::Math::SMatrixIdentity
id;
614 ROOT::Math::SMatrixIdentity
id;
632 if (delta.second > 0)
635 mapRange.
dPhiMinus += fabs(delta.second);
636 LogTrace(
"TrackAssociator") <<
"Selection range: (dThetaPlus, dThetaMinus, dPhiPlus, dPhiMinus, dRPreselection): " 654 if (!trajectoryPoint.
isValid())
655 trajectoryPoint = cachedTrajectory_.getOuterState();
656 if (!trajectoryPoint.
isValid()) {
658 <<
"trajectory position at HCAL is not valid. Assume the track cannot reach muon detectors and skip it";
663 LogTrace(
"TrackAssociator") <<
"muon direction: " << direction
664 <<
"\n\t and corresponding point: " << trajectoryPoint.
position() <<
"\n";
671 std::set<DetId> muonIdsInRegion = muonDetIdAssociator_->getDetIdsCloseToAPoint(trajectoryPoint.
position(), mapRange);
672 LogTrace(
"TrackAssociator") <<
"Number of chambers to check: " << muonIdsInRegion.size();
673 for (std::set<DetId>::const_iterator detId = muonIdsInRegion.begin(); detId != muonIdsInRegion.end(); detId++) {
674 const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet(*detId);
676 if (!stateOnSurface.
isValid()) {
677 LogTrace(
"TrackAssociator") <<
"Failed to propagate the track; moving on\n\t" 678 <<
"Element is not crosssed: " <<
DetIdInfo::info(*detId,
nullptr) <<
"\n";
687 if (
const CSCChamber* cscChamber = dynamic_cast<const CSCChamber*>(geomDet)) {
690 LogTrace(
"TrackAssociator") <<
"Failed to get CSCChamberSpecs from CSCChamber; moving on\n";
694 if (!layerGeometry) {
695 LogTrace(
"TrackAssociator") <<
"Failed to get CSCLayerGeometry from CSCChamberSpecs; moving on\n";
700 LogTrace(
"TrackAssociator") <<
"Failed to get CSCWireTopology from CSCLayerGeometry; moving on\n";
708 float yOfFirstWire = fabs(wireTopology->
wireAngle()) > 1.E-06 ? -0.5 * length : wireTopology->
yOfWire(1);
710 float yCOWPOffset = yOfFirstWire + 0.5 * length;
713 float tangent = (wideWidth - narrowWidth) / (2. * length);
715 float yPrime = localPoint.
y() + fabs(yOfFirstWire);
717 float halfWidthAtYPrime = 0.5 * narrowWidth + yPrime * tangent;
718 distanceX = fabs(localPoint.
x()) - halfWidthAtYPrime;
719 distanceY = fabs(localPoint.
y() - yCOWPOffset) - 0.5 * length;
720 sigmaX = distanceX /
sqrt(localError.
xx());
721 sigmaY = distanceY /
sqrt(localError.
yy());
725 sigmaX = distanceX /
sqrt(localError.
xx());
726 sigmaY = distanceY /
sqrt(localError.
yy());
732 match.
tState = stateOnSurface;
736 matches.push_back(match);
739 <<
"\n\tdistanceX: " << distanceX <<
"\t distanceY: " << distanceY
740 <<
"\t sigmaX: " << sigmaX <<
"\t sigmaY: " << sigmaY <<
"\n";
752 throw cms::Exception(
"FatalError") <<
"Unable to find DTRecSegment4DCollection in event!\n";
757 throw cms::Exception(
"FatalError") <<
"Unable to find CSCSegmentCollection in event!\n";
777 std::vector<TAMuonChamberMatch> matchedChambers;
778 LogTrace(
"TrackAssociator") <<
"Trying to Get ChamberMatches" << std::endl;
779 getTAMuonChamberMatches(matchedChambers, parameters);
780 LogTrace(
"TrackAssociator") <<
"Chambers matched: " << matchedChambers.size() <<
"\n";
784 for (std::vector<TAMuonChamberMatch>::iterator matchedChamber = matchedChambers.begin();
785 matchedChamber != matchedChambers.end();
787 const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet((*matchedChamber).id);
794 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
795 matchedChamber->segments.back().dtSegmentRef =
DTRecSegment4DRef(dtSegments, segment - dtSegments->begin());
805 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
806 matchedChamber->segments.back().cscSegmentRef =
CSCSegmentRef(cscSegments, segment - cscSegments->begin());
817 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
818 matchedChamber->segments.back().gemSegmentRef =
831 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
832 matchedChamber->segments.back().me0SegmentRef =
839 info.
chambers.push_back(*matchedChamber);
849 const GeomDet*
chamber = muonDetIdAssociator_->getGeomDet(matchedChamber.
id);
853 LogTrace(
"TrackAssociator") <<
"Segment global position: " << segmentGlobalPosition
854 <<
" \t (R_xy,eta,phi): " << segmentGlobalPosition.
perp() <<
"," 855 << segmentGlobalPosition.
eta() <<
"," << segmentGlobalPosition.
phi() <<
"\n";
857 LogTrace(
"TrackAssociator") <<
"\teta hit: " << segmentGlobalPosition.
eta()
859 <<
"\tphi hit: " << segmentGlobalPosition.
phi()
864 bool isDTWithoutY =
false;
866 if (dtseg && (!dtseg->
hasZed()))
871 deltaPhi = fabs(deltaPhi -
M_PI * 2.);
874 isGood = deltaPhi < parameters.
dRMuon;
879 deltaPhi * deltaPhi) < parameters.
dRMuon;
898 muonSegment.
hasZed =
true;
899 muonSegment.
hasPhi =
true;
904 if ((dtseg->
hasPhi()) && (!isDTWithoutY)) {
913 LogTrace(
"TrackAssociator") <<
" Phi t0: " << dtseg->
phiSegment()->
t0() <<
" hits: " << phiHits;
922 muonSegment.
t0 = t0 /
hits;
927 muonSegment.
hasZed =
false;
929 muonSegment.
hasPhi =
false;
932 matchedChamber.
segments.push_back(muonSegment);
948 throw cms::Exception(
"FatalError") <<
"No simulated tracks found\n";
953 throw cms::Exception(
"FatalError") <<
"No simulated vertices found\n";
959 throw cms::Exception(
"FatalError") <<
"No simulated ECAL EB hits found\n";
964 throw cms::Exception(
"FatalError") <<
"No simulated ECAL EE hits found\n";
969 throw cms::Exception(
"FatalError") <<
"No simulated HCAL hits found\n";
972 SimTrackContainer::const_iterator
simTrack = simTracks->begin();
973 for (; simTrack != simTracks->end(); ++
simTrack) {
974 math::XYZVector simP3(simTrack->momentum().x(), simTrack->momentum().y(), simTrack->momentum().z());
979 if (simTrack != simTracks->end()) {
981 double ecalTrueEnergy(0);
982 double hcalTrueEnergy(0);
985 for (PCaloHitContainer::const_iterator
hit = simEcalHitsEB->begin();
hit != simEcalHitsEB->end(); ++
hit)
987 ecalTrueEnergy +=
hit->energy();
989 for (PCaloHitContainer::const_iterator
hit = simEcalHitsEE->begin();
hit != simEcalHitsEE->end(); ++
hit)
991 ecalTrueEnergy +=
hit->energy();
993 for (PCaloHitContainer::const_iterator
hit = simHcalHits->begin();
hit != simHcalHits->end(); ++
hit)
995 hcalTrueEnergy +=
hit->energy();
1012 double currentStepSize = cachedTrajectory_.getPropagationStep();
1018 if (direction != InsideOut)
1019 throw cms::Exception(
"FatalError") <<
"No TrackExtra information is available and association is done with " 1020 "something else than InsideOut track.\n" 1021 <<
"Either change the parameter or provide needed data!\n";
1022 LogTrace(
"TrackAssociator") <<
"Track Extras not found\n";
1024 return associate(iEvent, iSetup, parameters, &initialState);
1027 LogTrace(
"TrackAssociator") <<
"Track Extras found\n";
1032 LogTrace(
"TrackAssociator") <<
"inner track state (rho, z, phi):" << track.
innerPosition().Rho() <<
", " 1034 LogTrace(
"TrackAssociator") <<
"innerFreeState (rho, z, phi):" << innerState.
position().
perp() <<
", " 1037 LogTrace(
"TrackAssociator") <<
"outer track state (rho, z, phi):" << track.
outerPosition().Rho() <<
", " 1039 LogTrace(
"TrackAssociator") <<
"outerFreeState (rho, z, phi):" << outerState.
position().
perp() <<
", " 1043 if (crossedIP(track)) {
1044 switch (direction) {
1047 return associate(iEvent, iSetup, parameters, &referenceState, &outerState);
1050 cachedTrajectory_.setPropagationStep(-fabs(currentStepSize));
1052 cachedTrajectory_.setPropagationStep(currentStepSize);
1058 switch (direction) {
1060 return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1063 cachedTrajectory_.setPropagationStep(-fabs(currentStepSize));
1065 cachedTrajectory_.setPropagationStep(currentStepSize);
1073 cachedTrajectory_.setPropagationStep(-fabs(currentStepSize));
1076 result = associate(iEvent, iSetup, parameters, &innerState, &outerState);
1078 result = associate(iEvent, iSetup, parameters, &outerState, &innerState);
1079 cachedTrajectory_.setPropagationStep(currentStepSize);
1087 return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1095 return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, track, vertex), parameters);
1104 return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, momentum, vertex, charge), parameters);
1108 bool crossed =
true;
constexpr double deltaPhi(double phi1, double phi2)
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken
std::vector< DetId > crossedPreshowerIds
math::XYZPoint trkGlobPosAtHO
virtual float length() const =0
virtual LocalError localDirectionError() const =0
Error on the local direction.
std::pair< const_iterator, const_iterator > range
iterator range
TrackDetectorAssociator()
float segmentLocalErrorXX
const CSCWireTopology * wireTopology() const
static bool crossedIP(const reco::Track &track)
std::vector< const CaloTower * > crossedTowers
std::vector< const CaloTower * > towers
TrajectoryStateOnSurface tState
const TrackExtraRef & extra() const
reference to "extra" object
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
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
edm::Ref< CSCSegmentCollection > CSCSegmentRef
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
void setCaloGeometry(edm::ESHandle< CaloGeometry > geometry)
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
float segmentLocalErrorDxDz
math::XYZPoint trkGlobPosAtHcal
FreeTrajectoryState stateAtIP
track info
void fillCaloTowers(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
const math::XYZPoint & innerPosition() const
position of the innermost hit
void fillCaloTruth(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
virtual LocalVector localDirection() const =0
Local direction.
virtual float width() const =0
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 ...
float segmentLocalErrorDyDz
void setPropagator(const Propagator *)
use a user configured propagator
void getTAMuonChamberMatches(std::vector< TAMuonChamberMatch > &matches, const AssociatorParameters ¶meters)
void applyRadX0Correction(bool applyRadX0Correction)
GlobalPoint position() const
LocalPoint toLocal(const GlobalPoint &gp) const
edm::Ref< GEMSegmentCollection > GEMSegmentRef
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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::EDGetTokenT< DTRecSegment4DCollection > dtSegmentsToken
std::vector< DetId > crossedHOIds
double dRPreshowerPreselection
Abs< T >::type abs(const T &t)
const math::XYZTLorentzVectorD & position() const
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
virtual LocalPoint localPosition() const =0
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
~TrackDetectorAssociator()
void fillMuon(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
const CSCLayerGeometry * oddLayerGeometry(int iendcap) const
Accessors for LayerGeometry's.
void init(const edm::EventSetup &)
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
float wireAngle() const override
virtual LocalError localPositionError() const =0
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
std::vector< const HORecHit * > hoRecHits
const SimTrack * simTrack
MC truth info.
edm::EDGetTokenT< CSCSegmentCollection > cscSegmentsToken
void fillHO(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
void setMaterialMode(bool noMaterial)
Switch for material effects mode: no material effects if true.
Power< A, B >::type pow(const A &a, const B &b)
*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