74 #include "Math/VectorUtil.h"
100 using namespace reco;
106 useDefaultPropagator_ =
false;
111 if (defProp_)
delete defProp_;
117 cachedTrajectory_.setPropagator(ivProp_);
122 useDefaultPropagator_ =
true;
130 if (!theCaloGeometry_.isValid())
131 throw cms::Exception(
"FatalError") <<
"Unable to find CaloGeometryRecord in event!\n";
135 if (!theTrackingGeometry_.isValid())
136 throw cms::Exception(
"FatalError") <<
"Unable to find GlobalTrackingGeometryRecord in event!\n";
138 if (useDefaultPropagator_ && (! defProp_ || theMagneticFeildWatcher_.check(iSetup) ) ) {
148 setPropagator(defProp_);
164 return associate(iEvent,iSetup,parameters,&fts);
177 "Configuration error! No subdetector was selected for the track association.";
183 cachedTrajectory_.setStateAtIP(trackOrigin);
199 cachedTrajectory_.reset_trajectory();
204 double HOmaxR = hoDetIdAssociator_->volume().maxR();
205 double HOmaxZ = hoDetIdAssociator_->volume().maxZ();
206 double minR = ecalDetIdAssociator_->volume().minR();
207 double minZ = preshowerDetIdAssociator_->volume().minZ();
208 cachedTrajectory_.setMaxHORadius(HOmaxR);
209 cachedTrajectory_.setMaxHOLength(HOmaxZ*2.);
210 cachedTrajectory_.setMinDetectorRadius(minR);
211 cachedTrajectory_.setMinDetectorLength(minZ*2.);
217 maxR = muonDetIdAssociator_->volume().maxR();
218 maxZ = muonDetIdAssociator_->volume().maxZ();
219 cachedTrajectory_.setMaxDetectorRadius(maxR);
220 cachedTrajectory_.setMaxDetectorLength(maxZ*2.);
225 cachedTrajectory_.setMaxDetectorRadius(HOmaxR);
226 cachedTrajectory_.setMaxDetectorLength(HOmaxZ*2.);
232 LogTrace(
"TrackAssociator") <<
"Using outerState as trackOrigin at Rho=" << outerState->
position().
perp()
233 <<
" Z=" << outerState->
position().
z() <<
"\n";
236 else if(innerState) {
237 LogTrace(
"TrackAssociator") <<
"Using innerState as trackOrigin at Rho=" << innerState->
position().
perp()
238 <<
" Z=" << innerState->
position().
z() <<
"\n";
243 if ( ! cachedTrajectory_.propagateAll(trackOrigin) )
return info;
246 cachedTrajectory_.findEcalTrajectory( ecalDetIdAssociator_->volume() );
247 cachedTrajectory_.findHcalTrajectory( hcalDetIdAssociator_->volume() );
248 cachedTrajectory_.findHOTrajectory( hoDetIdAssociator_->volume() );
249 cachedTrajectory_.findPreshowerTrajectory( preshowerDetIdAssociator_->volume() );
251 info.
trkGlobPosAtEcal = getPoint( cachedTrajectory_.getStateAtEcal().position() );
252 info.
trkGlobPosAtHcal = getPoint( cachedTrajectory_.getStateAtHcal().position() );
253 info.
trkGlobPosAtHO = getPoint( cachedTrajectory_.getStateAtHO().position() );
255 info.
trkMomAtEcal = cachedTrajectory_.getStateAtEcal().momentum();
256 info.
trkMomAtHcal = cachedTrajectory_.getStateAtHcal().momentum();
257 info.
trkMomAtHO = cachedTrajectory_.getStateAtHO().momentum();
261 if (parameters.
useEcal) fillEcal( iEvent, info, parameters);
262 if (parameters.
useCalo) fillCaloTowers( iEvent, info, parameters);
263 if (parameters.
useHcal) fillHcal( iEvent, info, parameters);
264 if (parameters.
useHO) fillHO( iEvent, info, parameters);
265 if (parameters.
usePreshower) fillPreshower( iEvent, info, parameters);
266 if (parameters.
useMuon) fillMuon( iEvent, info, parameters);
267 if (parameters.
truthMatch) fillCaloTruth( iEvent, info, parameters);
279 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getEcalTrajectory();
281 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
282 itr != trajectoryStates.end(); itr++)
283 LogTrace(
"TrackAssociator") <<
"ECAL trajectory point (rho, z, phi): " << itr->position().perp() <<
284 ", " << itr->position().z() <<
", " << itr->position().phi();
286 std::vector<GlobalPoint> coreTrajectory;
287 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
288 itr != trajectoryStates.end(); itr++) coreTrajectory.push_back(itr->position());
290 if(coreTrajectory.empty()) {
291 LogTrace(
"TrackAssociator") <<
"ECAL track trajectory is empty; moving on\n";
301 if (!EBRecHits.
isValid())
throw cms::Exception(
"FatalError") <<
"Unable to find EBRecHitCollection in the event!\n";
306 if (!EERecHits.
isValid())
throw cms::Exception(
"FatalError") <<
"Unable to find EERecHitCollection in event!\n";
310 std::set<DetId> ecalIdsInRegion;
315 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0],mapRange);
316 }
else ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dREcalPreselection);
318 LogTrace(
"TrackAssociator") <<
"ECAL hits in the region: " << ecalIdsInRegion.size();
320 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsInACone(ecalIdsInRegion, coreTrajectory, parameters.
dREcal);
321 LogTrace(
"TrackAssociator") <<
"ECAL hits in the cone: " << ecalIdsInRegion.size();
322 std::vector<DetId> crossedEcalIds =
323 ecalDetIdAssociator_->getCrossedDetIds(ecalIdsInRegion, coreTrajectory);
324 LogTrace(
"TrackAssociator") <<
"ECAL crossed hits " << crossedEcalIds.size();
330 for(std::vector<DetId>::const_iterator itr=crossedEcalIds.begin(); itr!=crossedEcalIds.end();itr++)
332 std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
333 std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
334 if(ebHit != (*EBRecHits).end())
336 else if(eeHit != (*EERecHits).end())
339 LogTrace(
"TrackAssociator") <<
"Crossed EcalRecHit is not found for DetId: " << itr->rawId();
342 for(std::set<DetId>::const_iterator itr=ecalIdsInRegion.begin(); itr!=ecalIdsInRegion.end();itr++)
344 std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
345 std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
346 if(ebHit != (*EBRecHits).end())
348 else if(eeHit != (*EERecHits).end())
351 LogTrace(
"TrackAssociator") <<
"EcalRecHit from the cone is not found for DetId: " << itr->rawId();
363 std::vector<GlobalPoint> trajectory;
364 const std::vector<SteppingHelixStateInfo>& ecalTrajectoryStates = cachedTrajectory_.getEcalTrajectory();
365 const std::vector<SteppingHelixStateInfo>& hcalTrajectoryStates = cachedTrajectory_.getHcalTrajectory();
366 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = ecalTrajectoryStates.begin();
367 itr != ecalTrajectoryStates.end(); itr++) trajectory.push_back(itr->position());
368 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = hcalTrajectoryStates.begin();
369 itr != hcalTrajectoryStates.end(); itr++) trajectory.push_back(itr->position());
371 if(trajectory.empty()) {
372 LogTrace(
"TrackAssociator") <<
"HCAL trajectory is empty; moving on\n";
383 if (!caloTowers.
isValid())
throw cms::Exception(
"FatalError") <<
"Unable to find CaloTowers in event!\n";
386 std::set<DetId> caloTowerIdsInRegion;
391 caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0],mapRange);
392 }
else caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], parameters.
dRHcalPreselection);
394 LogTrace(
"TrackAssociator") <<
"Towers in the region: " << caloTowerIdsInRegion.size();
395 std::set<DetId> caloTowerIdsInACone = caloDetIdAssociator_->getDetIdsInACone(caloTowerIdsInRegion, trajectory, parameters.
dRHcal);
396 LogTrace(
"TrackAssociator") <<
"Towers in the cone: " << caloTowerIdsInACone.size();
397 std::vector<DetId> crossedCaloTowerIds = caloDetIdAssociator_->getCrossedDetIds(caloTowerIdsInRegion, trajectory);
398 LogTrace(
"TrackAssociator") <<
"Towers crossed: " << crossedCaloTowerIds.size();
404 for(std::vector<DetId>::const_iterator itr=crossedCaloTowerIds.begin(); itr!=crossedCaloTowerIds.end();itr++)
407 if(tower != (*caloTowers).end())
410 LogTrace(
"TrackAssociator") <<
"Crossed CaloTower is not found for DetId: " << (*itr).rawId();
414 for(std::set<DetId>::const_iterator itr=caloTowerIdsInACone.begin(); itr!=caloTowerIdsInACone.end();itr++)
417 if(tower != (*caloTowers).end())
418 info.
towers.push_back(&*tower);
420 LogTrace(
"TrackAssociator") <<
"CaloTower from the cone is not found for DetId: " << (*itr).rawId();
429 std::vector<GlobalPoint> trajectory;
430 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getPreshowerTrajectory();
431 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
432 itr != trajectoryStates.end(); itr++) trajectory.push_back(itr->position());
434 if(trajectory.empty()) {
435 LogTrace(
"TrackAssociator") <<
"Preshower trajectory is empty; moving on\n";
439 std::set<DetId> idsInRegion =
440 preshowerDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0],
443 LogTrace(
"TrackAssociator") <<
"Number of Preshower Ids in the region: " << idsInRegion.size();
444 std::vector<DetId> crossedIds = preshowerDetIdAssociator_->getCrossedDetIds(idsInRegion, trajectory);
445 LogTrace(
"TrackAssociator") <<
"Number of Preshower Ids in crossed: " << crossedIds.size();
457 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHcalTrajectory();
459 std::vector<GlobalPoint> coreTrajectory;
460 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
461 itr != trajectoryStates.end(); itr++) coreTrajectory.push_back(itr->position());
463 if(coreTrajectory.empty()) {
464 LogTrace(
"TrackAssociator") <<
"HCAL trajectory is empty; moving on\n";
475 if ( ! collection.
isValid() )
throw cms::Exception(
"FatalError") <<
"Unable to find HBHERecHits in event!\n";
478 std::set<DetId> idsInRegion;
483 idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
484 }
else idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dRHcalPreselection);
486 LogTrace(
"TrackAssociator") <<
"HCAL hits in the region: " << idsInRegion.size() <<
"\n" <<
DetIdInfo::info(idsInRegion);
487 std::set<DetId> idsInACone = hcalDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.
dRHcal);
488 LogTrace(
"TrackAssociator") <<
"HCAL hits in the cone: " << idsInACone.size() <<
"\n" <<
DetIdInfo::info(idsInACone);
489 std::vector<DetId> crossedIds =
490 hcalDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
491 LogTrace(
"TrackAssociator") <<
"HCAL hits crossed: " << crossedIds.size() <<
"\n" <<
DetIdInfo::info(crossedIds);
497 for(std::vector<DetId>::const_iterator itr=crossedIds.begin(); itr!=crossedIds.end();itr++)
500 if( hit != (*collection).end() )
503 LogTrace(
"TrackAssociator") <<
"Crossed HBHERecHit is not found for DetId: " << itr->rawId();
506 for(std::set<DetId>::const_iterator itr=idsInACone.begin(); itr!=idsInACone.end();itr++)
509 if( hit != (*collection).end() )
512 LogTrace(
"TrackAssociator") <<
"HBHERecHit from the cone is not found for DetId: " << itr->rawId();
523 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHOTrajectory();
525 std::vector<GlobalPoint> coreTrajectory;
526 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
527 itr != trajectoryStates.end(); itr++) coreTrajectory.push_back(itr->position());
529 if(coreTrajectory.empty()) {
530 LogTrace(
"TrackAssociator") <<
"HO trajectory is empty; moving on\n";
541 if ( ! collection.
isValid() )
throw cms::Exception(
"FatalError") <<
"Unable to find HORecHits in event!\n";
544 std::set<DetId> idsInRegion;
549 idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
550 }
else idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dRHcalPreselection);
552 LogTrace(
"TrackAssociator") <<
"idsInRegion.size(): " << idsInRegion.size();
553 std::set<DetId> idsInACone = hoDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.
dRHcal);
554 LogTrace(
"TrackAssociator") <<
"idsInACone.size(): " << idsInACone.size();
555 std::vector<DetId> crossedIds =
556 hoDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
562 for(std::vector<DetId>::const_iterator itr=crossedIds.begin(); itr!=crossedIds.end();itr++)
565 if( hit != (*collection).end() )
568 LogTrace(
"TrackAssociator") <<
"Crossed HORecHit is not found for DetId: " << itr->rawId();
572 for(std::set<DetId>::const_iterator itr=idsInACone.begin(); itr!=idsInACone.end();itr++)
575 if( hit != (*collection).end() )
578 LogTrace(
"TrackAssociator") <<
"HORecHit from the cone is not found for DetId: " << itr->rawId();
590 if (
abs(track.
type( )) == 211 ||
593 charge = track.
type( )< 0 ? -1 : 1;
594 return getFreeTrajectoryState(iSetup, vector,
point, charge);
607 ROOT::Math::SMatrixIdentity
id;
630 ROOT::Math::SMatrixIdentity
id;
645 if ( delta.first > 0 )
649 if ( delta.second > 0 )
652 mapRange.
dPhiMinus += fabs(delta.second);
653 LogTrace(
"TrackAssociator") <<
"Selection range: (dThetaPlus, dThetaMinus, dPhiPlus, dPhiMinus, dRPreselection): " <<
676 if(! trajectoryPoint.
isValid() ) trajectoryPoint = cachedTrajectory_.getOuterState();
677 if(! trajectoryPoint.
isValid() ) {
679 "trajectory position at HCAL is not valid. Assume the track cannot reach muon detectors and skip it";
684 LogTrace(
"TrackAssociator") <<
"muon direction: " << direction <<
"\n\t and corresponding point: " <<
693 std::set<DetId> muonIdsInRegion =
694 muonDetIdAssociator_->getDetIdsCloseToAPoint(trajectoryPoint.
position(), mapRange);
696 LogTrace(
"TrackAssociator") <<
"Number of chambers to check: " << muonIdsInRegion.size();
697 for(std::set<DetId>::const_iterator detId = muonIdsInRegion.begin(); detId != muonIdsInRegion.end(); detId++)
699 const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet(*detId);
702 if (! stateOnSurface.
isValid()) {
703 LogTrace(
"TrackAssociator") <<
"Failed to propagate the track; moving on\n\t"<<
714 if(
const CSCChamber* cscChamber = dynamic_cast<const CSCChamber*>(geomDet) ) {
717 LogTrace(
"TrackAssociator") <<
"Failed to get CSCChamberSpecs from CSCChamber; moving on\n";
721 if(! layerGeometry) {
722 LogTrace(
"TrackAssociator") <<
"Failed to get CSCLayerGeometry from CSCChamberSpecs; moving on\n";
727 LogTrace(
"TrackAssociator") <<
"Failed to get CSCWireTopology from CSCLayerGeometry; moving on\n";
735 float yOfFirstWire = fabs(wireTopology->
wireAngle())>1.E-06 ? -0.5*length : wireTopology->
yOfWire(1);
737 float yCOWPOffset = yOfFirstWire+0.5*length;
740 float tangent = (wideWidth-narrowWidth)/(2.*length);
742 float yPrime = localPoint.
y()+fabs(yOfFirstWire);
744 float halfWidthAtYPrime = 0.5*narrowWidth+yPrime*tangent;
745 distanceX = fabs(localPoint.
x()) - halfWidthAtYPrime;
746 distanceY = fabs(localPoint.
y()-yCOWPOffset) - 0.5*length;
747 sigmaX = distanceX/
sqrt(localError.
xx());
748 sigmaY = distanceY/
sqrt(localError.
yy());
752 sigmaX = distanceX/
sqrt(localError.
xx());
753 sigmaY = distanceY/
sqrt(localError.
yy());
760 match.
tState = stateOnSurface;
764 matches.push_back(match);
766 LogTrace(
"TrackAssociator") <<
"chamber is too far: " <<
767 DetIdInfo::info(*detId) <<
"\n\tdistanceX: " << distanceX <<
"\t distanceY: " << distanceY <<
768 "\t sigmaX: " << sigmaX <<
"\t sigmaY: " << sigmaY <<
"\n";
788 throw cms::Exception(
"FatalError") <<
"Unable to find DTRecSegment4DCollection in event!\n";
793 throw cms::Exception(
"FatalError") <<
"Unable to find CSCSegmentCollection in event!\n";
808 std::vector<TAMuonChamberMatch> matchedChambers;
809 LogTrace(
"TrackAssociator") <<
"Trying to Get ChamberMatches" << std::endl;
810 getTAMuonChamberMatches(matchedChambers, parameters);
811 LogTrace(
"TrackAssociator") <<
"Chambers matched: " << matchedChambers.size() <<
"\n";
816 for(std::vector<TAMuonChamberMatch>::iterator matchedChamber = matchedChambers.begin();
817 matchedChamber != matchedChambers.end(); matchedChamber++)
819 const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet((*matchedChamber).id);
821 if(
const DTChamber* chamber = dynamic_cast<const DTChamber*>(geomDet) ) {
826 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
827 matchedChamber->segments.back().dtSegmentRef =
DTRecSegment4DRef(dtSegments, segment - dtSegments->begin());
832 if(
const CSCChamber* chamber = dynamic_cast<const CSCChamber*>(geomDet) ) {
837 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
838 matchedChamber->segments.back().cscSegmentRef =
CSCSegmentRef(cscSegments, segment - cscSegments->begin());
845 info.
chambers.push_back(*matchedChamber);
855 <<
"Segment local position: " << segment->
localPosition() <<
"\n"
858 const GeomDet* chamber = muonDetIdAssociator_->getGeomDet(matchedChamber.
id);
863 <<
"Segment global position: " << segmentGlobalPosition <<
" \t (R_xy,eta,phi): "
864 << segmentGlobalPosition.
perp() <<
"," << segmentGlobalPosition.
eta() <<
"," << segmentGlobalPosition.
phi() <<
"\n";
867 <<
"\teta hit: " << segmentGlobalPosition.
eta() <<
" \tpropagator: " << trajectoryStateOnSurface.
freeState()->
position().
eta() <<
"\n"
868 <<
"\tphi hit: " << segmentGlobalPosition.
phi() <<
" \tpropagator: " << trajectoryStateOnSurface.
freeState()->
position().
phi() << std::endl;
871 bool isDTWithoutY =
false;
873 if ( dtseg && (! dtseg->
hasZed()) )
877 if(deltaPhi>
M_PI) deltaPhi = fabs(deltaPhi-
M_PI*2.);
881 isGood = deltaPhi < parameters.
dRMuon;
885 deltaPhi*deltaPhi) < parameters.
dRMuon;
904 muonSegment.
hasZed =
true;
905 muonSegment.
hasPhi =
true;
910 if ( (dtseg->
hasPhi()) && (! isDTWithoutY) ) {
919 LogTrace(
"TrackAssociator") <<
" Phi t0: " << dtseg->
phiSegment()->
t0() <<
" hits: " << phiHits;
927 if (hits) muonSegment.
t0 = t0/hits;
931 if (isDTWithoutY) muonSegment.
hasZed =
false;
935 matchedChamber.
segments.push_back(muonSegment);
951 if (! simTracks.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated tracks found\n";
955 if (! simVertices.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated vertices found\n";
959 iEvent.
getByLabel(
"g4SimHits",
"EcalHitsEB",simEcalHitsEB);
960 if (! simEcalHitsEB.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated ECAL EB hits found\n";
963 iEvent.
getByLabel(
"g4SimHits",
"EcalHitsEE",simEcalHitsEE);
964 if (! simEcalHitsEE.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated ECAL EE hits found\n";
967 iEvent.
getByLabel(
"g4SimHits",
"HcalHits",simHcalHits);
968 if (! simHcalHits.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated HCAL hits found\n";
971 SimTrackContainer::const_iterator simTrack = simTracks->begin();
972 for( ; simTrack != simTracks->end(); ++simTrack){
973 math::XYZVector simP3( simTrack->momentum().x(), simTrack->momentum().y(), simTrack->momentum().z() );
975 if ( ROOT::Math::VectorUtil::DeltaR(recoP3, simP3) < 0.1 )
break;
977 if ( simTrack != simTracks->end() ) {
979 double ecalTrueEnergy(0);
980 double hcalTrueEnergy(0);
983 for( PCaloHitContainer::const_iterator
hit = simEcalHitsEB->begin();
hit != simEcalHitsEB->end(); ++
hit )
986 for( PCaloHitContainer::const_iterator
hit = simEcalHitsEE->begin();
hit != simEcalHitsEE->end(); ++
hit )
989 for( PCaloHitContainer::const_iterator
hit = simHcalHits->begin();
hit != simHcalHits->end(); ++
hit )
1009 double currentStepSize = cachedTrajectory_.getPropagationStep();
1015 if ( direction != InsideOut )
1017 "No TrackExtra information is available and association is done with something else than InsideOut track.\n" <<
1018 "Either change the parameter or provide needed data!\n";
1019 LogTrace(
"TrackAssociator") <<
"Track Extras not found\n";
1021 return associate(iEvent, iSetup, parameters, &initialState);
1024 LogTrace(
"TrackAssociator") <<
"Track Extras found\n";
1029 LogTrace(
"TrackAssociator") <<
"inner track state (rho, z, phi):" <<
1032 LogTrace(
"TrackAssociator") <<
"innerFreeState (rho, z, phi):" <<
1036 LogTrace(
"TrackAssociator") <<
"outer track state (rho, z, phi):" <<
1039 LogTrace(
"TrackAssociator") <<
"outerFreeState (rho, z, phi):" <<
1044 if ( crossedIP( track ) ) {
1045 switch ( direction ) {
1048 return associate(iEvent, iSetup, parameters, &referenceState, &outerState);
1052 cachedTrajectory_.setPropagationStep( -fabs(currentStepSize) );
1054 cachedTrajectory_.setPropagationStep( currentStepSize );
1060 switch ( direction ) {
1062 return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1066 cachedTrajectory_.setPropagationStep( -fabs(currentStepSize) );
1068 cachedTrajectory_.setPropagationStep( currentStepSize );
1078 cachedTrajectory_.setPropagationStep( -fabs(currentStepSize) );
1081 result = associate(iEvent, iSetup, parameters, &innerState, &outerState);
1083 result = associate(iEvent, iSetup, parameters, &outerState, &innerState);
1084 cachedTrajectory_.setPropagationStep( currentStepSize );
1092 return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1101 return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, track, vertex), parameters);
1111 return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, momentum, vertex, charge), parameters);
1116 bool crossed =
true;
std::vector< DetId > crossedPreshowerIds
math::XYZPoint trkGlobPosAtHO
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)
const Vector & momentum() const
track momentum vector
std::vector< const CaloTower * > crossedTowers
virtual LocalError localDirectionError() const =0
Error on the local direction.
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
math::XYZPoint segmentGlobalPosition
edm::InputTag theHBHERecHitCollectionLabel
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
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)
virtual LocalVector localDirection() const =0
Local direction.
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
void useDefaultPropagator()
use the default propagator
Geom::Phi< T > phi() const
std::vector< CaloTower >::const_iterator const_iterator
void fillHcal(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
double dRMuonPreselection
bool getByType(Handle< PROD > &result) const
edm::InputTag theHORecHitCollectionLabel
bool addTAMuonSegmentMatch(TAMuonChamberMatch &, const RecSegment *, const AssociatorParameters &)
double muonMaxDistanceSigmaY
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
math::XYZVector segmentLocalDirection
LocalError positionError() const
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
uint32_t rawId() const
get the raw id
void fillCaloTruth(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
C::const_iterator const_iterator
constant access iterator type
bool isNull() const
Checks for null.
float segmentLocalErrorDyDz
tuple SteppingHelixPropagator
void setPropagator(const Propagator *)
use a user configured propagator
void getTAMuonChamberMatches(std::vector< TAMuonChamberMatch > &matches, const AssociatorParameters ¶meters)
FreeTrajectoryState * freeState(bool withErrors=true) const
void applyRadX0Correction(bool applyRadX0Correction)
GlobalPoint position() const
LocalPoint toLocal(const GlobalPoint &gp) 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) ...
std::vector< TAMuonChamberMatch > chambers
std::vector< const HBHERecHit * > hcalRecHits
std::vector< DetId > crossedHOIds
double dRPreshowerPreselection
const math::XYZTLorentzVectorD & position() const
static std::string info(const DetId &)
bool hasPhi() const
Does it have the Phi projection?
double lengthOfPlane() const
const LocalTrajectoryError & localError() const
float yOfWire(float wire, float x=0.) const
void fillPreshower(const edm::Event &iEvent, TrackDetMatchInfo &info, const AssociatorParameters &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
GlobalVector momentum() const
float segmentLocalErrorYY
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
double narrowWidthOfPlane() const
double dRHcalPreselection
edm::Ref< DTRecSegment4DCollection > DTRecSegment4DRef
double muonMaxDistanceSigmaX
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
double deltaPhi(double phi1, double phi2)
Vector3DBase unit() const
bool hasZed() const
Does it have the Z projection?
edm::InputTag theDTRecSegment4DCollectionLabel
GlobalPoint position() const
const Bounds & bounds() const
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
double wideWidthOfPlane() const
double hcalTrueEnergyCorrected
GlobalVector trkMomAtEcal
XYZVectorD XYZVector
spatial vector with cartesian internal representation
virtual LocalError localPositionError() const =0
~TrackDetectorAssociator()
edm::InputTag theEERecHitCollectionLabel
std::vector< SimVertex > SimVertexContainer
void fillMuon(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
const CSCLayerGeometry * oddLayerGeometry(int iendcap) const
Accessors for LayerGeometry's.
void init(const edm::EventSetup &)
edm::InputTag theCSCSegmentCollectionLabel
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 &)
edm::InputTag theCaloTowerCollectionLabel
const BoundPlane & surface() const
The nominal surface of the GeomDet.
const math::XYZTLorentzVectorD & momentum() const
particle info...
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.
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
edm::InputTag theEBRecHitCollectionLabel
Labels of the detector EDProducts.
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
std::vector< const HORecHit * > hoRecHits
virtual LocalPoint localPosition() const =0
virtual float width() const =0
const SimTrack * simTrack
MC truth info.
void fillHO(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
std::vector< SimTrack > SimTrackContainer
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