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_);
170 <<
"Configuration error! No subdetector was selected for the track association.";
173 info.stateAtIP = *innerState;
174 cachedTrajectory_.setStateAtIP(trackOrigin);
186 info.setCaloGeometry(theCaloGeometry_);
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();
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";
284 info.isGoodEcal =
false;
287 info.isGoodEcal =
true;
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;
301 if (
parameters.accountForTrajectoryChangeCalo) {
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);
313 const std::vector<DetId>& crossedEcalIds =
info.crossedEcalIds;
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())
321 info.crossedEcalRecHits.push_back(&*ebHit);
322 else if (eeHit != (*EERecHits).end())
323 info.crossedEcalRecHits.push_back(&*eeHit);
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())
331 info.ecalRecHits.push_back(&*ebHit);
332 else if (eeHit != (*EERecHits).end())
333 info.ecalRecHits.push_back(&*eeHit);
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";
357 info.isGoodCalo =
false;
360 info.isGoodCalo =
true;
366 throw cms::Exception(
"FatalError") <<
"Unable to find CaloTowers in event!\n";
368 std::set<DetId> caloTowerIdsInRegion;
369 if (
parameters.accountForTrajectoryChangeCalo) {
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);
392 const std::vector<DetId>& crossedCaloTowerIds =
info.crossedTowerIds;
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())
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 =
429 preshowerDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0],
parameters.dRPreshowerPreselection);
431 LogTrace(
"TrackAssociator") <<
"Number of Preshower Ids in the region: " << idsInRegion.size();
432 info.crossedPreshowerIds = preshowerDetIdAssociator_->getCrossedDetIds(idsInRegion, trajectory);
433 LogTrace(
"TrackAssociator") <<
"Number of Preshower Ids in crossed: " <<
info.crossedPreshowerIds.size();
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";
449 info.isGoodHcal =
false;
452 info.isGoodHcal =
true;
458 throw cms::Exception(
"FatalError") <<
"Unable to find HBHERecHits in event!\n";
460 std::set<DetId> idsInRegion;
461 if (
parameters.accountForTrajectoryChangeCalo) {
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);
483 const std::vector<DetId>& crossedIds =
info.crossedHcalIds;
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())
491 info.crossedHcalRecHits.push_back(&*
hit);
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())
498 info.hcalRecHits.push_back(&*
hit);
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";
517 info.isGoodHO =
false;
520 info.isGoodHO =
true;
526 throw cms::Exception(
"FatalError") <<
"Unable to find HORecHits in event!\n";
528 std::set<DetId> idsInRegion;
529 if (
parameters.accountForTrajectoryChangeCalo) {
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())
555 info.crossedHORecHits.push_back(&*
hit);
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())
563 info.hoRecHits.push_back(&*
hit);
565 LogTrace(
"TrackAssociator") <<
"HORecHit from the cone is not found for DetId: " <<
itr->rawId();
580 return getFreeTrajectoryState(iSetup, vector,
point,
charge);
592 ROOT::Math::SMatrixIdentity
id;
614 ROOT::Math::SMatrixIdentity
id;
632 if (
delta.second > 0)
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;
732 match.tState = stateOnSurface;
733 match.localDistanceX = distanceX;
734 match.localDistanceY = distanceY;
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)) {
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;
865 const DTRecSegment4D* dtseg = dynamic_cast<const DTRecSegment4D*>(segment);
866 if (dtseg && (!dtseg->
hasZed()))
898 muonSegment.
hasZed =
true;
899 muonSegment.
hasPhi =
true;
904 if ((dtseg->
hasPhi()) && (!isDTWithoutY)) {
913 LogTrace(
"TrackAssociator") <<
" Phi t0: " << dtseg->
phiSegment()->
t0() <<
" hits: " << phiHits;
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";
980 info.simTrack = &(*simTrack);
981 double ecalTrueEnergy(0);
982 double hcalTrueEnergy(0);
985 for (PCaloHitContainer::const_iterator
hit = simEcalHitsEB->begin();
hit != simEcalHitsEB->end(); ++
hit)
986 if (
hit->geantTrackId() ==
info.simTrack->genpartIndex())
987 ecalTrueEnergy +=
hit->energy();
989 for (PCaloHitContainer::const_iterator
hit = simEcalHitsEE->begin();
hit != simEcalHitsEE->end(); ++
hit)
990 if (
hit->geantTrackId() ==
info.simTrack->genpartIndex())
991 ecalTrueEnergy +=
hit->energy();
993 for (PCaloHitContainer::const_iterator
hit = simHcalHits->begin();
hit != simHcalHits->end(); ++
hit)
994 if (
hit->geantTrackId() ==
info.simTrack->genpartIndex())
995 hcalTrueEnergy +=
hit->energy();
997 info.ecalTrueEnergy = ecalTrueEnergy;
998 info.hcalTrueEnergy = hcalTrueEnergy;
999 info.hcalTrueEnergyCorrected = hcalTrueEnergy;
1000 if (fabs(
info.trkGlobPosAtHcal.eta()) < 1.3)
1001 info.hcalTrueEnergyCorrected = hcalTrueEnergy * 113.2;
1002 else if (fabs(
info.trkGlobPosAtHcal.eta()) < 3.0)
1003 info.hcalTrueEnergyCorrected = hcalTrueEnergy * 167.2;
1012 double currentStepSize = cachedTrajectory_.getPropagationStep();
1017 if (
track.extra().isNull()) {
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";
1027 LogTrace(
"TrackAssociator") <<
"Track Extras found\n";
1032 LogTrace(
"TrackAssociator") <<
"inner track state (rho, z, phi):" <<
track.innerPosition().Rho() <<
", "
1033 <<
track.innerPosition().z() <<
", " <<
track.innerPosition().phi() <<
"\n";
1034 LogTrace(
"TrackAssociator") <<
"innerFreeState (rho, z, phi):" << innerState.
position().
perp() <<
", "
1037 LogTrace(
"TrackAssociator") <<
"outer track state (rho, z, phi):" <<
track.outerPosition().Rho() <<
", "
1038 <<
track.outerPosition().z() <<
", " <<
track.outerPosition().phi() <<
"\n";
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) {
1063 cachedTrajectory_.setPropagationStep(-fabs(currentStepSize));
1065 cachedTrajectory_.setPropagationStep(currentStepSize);
1071 if (
track.innerPosition().Dot(
track.innerMomentum()) < 0 &&
1072 track.outerPosition().Dot(
track.outerMomentum()) < 0) {
1073 cachedTrajectory_.setPropagationStep(-fabs(currentStepSize));
1075 if (
track.innerPosition().R() <
track.outerPosition().R())
1079 cachedTrajectory_.setPropagationStep(currentStepSize);
1108 bool crossed =
true;
1109 crossed &= (
track.innerPosition().rho() > 3);
1110 crossed &= (
track.outerPosition().rho() > 3);
1112 ((
track.innerPosition().x() *
track.innerMomentum().x() +
track.innerPosition().y() *
track.innerMomentum().y() <
1114 (
track.outerPosition().x() *
track.outerMomentum().x() +
track.outerPosition().y() *
track.outerMomentum().y() <