73 #include "Math/VectorUtil.h"
105 useDefaultPropagator_ =
false;
110 if (defProp_)
delete defProp_;
116 cachedTrajectory_.setPropagator(ivProp_);
121 useDefaultPropagator_ =
true;
129 if (!theCaloGeometry_.isValid())
130 throw cms::Exception(
"FatalError") <<
"Unable to find CaloGeometryRecord in event!\n";
134 if (!theTrackingGeometry_.isValid())
135 throw cms::Exception(
"FatalError") <<
"Unable to find GlobalTrackingGeometryRecord in event!\n";
137 if (useDefaultPropagator_ && (! defProp_ || theMagneticFeildWatcher_.check(iSetup) ) ) {
143 prop->setMaterialMode(
false);
144 prop->applyRadX0Correction(
true);
147 setPropagator(defProp_);
163 return associate(iEvent,iSetup,parameters,&fts);
176 "Configuration error! No subdetector was selected for the track association.";
182 cachedTrajectory_.setStateAtIP(trackOrigin);
198 cachedTrajectory_.reset_trajectory();
203 double HOmaxR = hoDetIdAssociator_->volume().maxR();
204 double HOmaxZ = hoDetIdAssociator_->volume().maxZ();
205 double minR = ecalDetIdAssociator_->volume().minR();
206 double minZ = preshowerDetIdAssociator_->volume().minZ();
207 cachedTrajectory_.setMaxHORadius(HOmaxR);
208 cachedTrajectory_.setMaxHOLength(HOmaxZ*2.);
209 cachedTrajectory_.setMinDetectorRadius(minR);
210 cachedTrajectory_.setMinDetectorLength(minZ*2.);
216 maxR = muonDetIdAssociator_->volume().maxR();
217 maxZ = muonDetIdAssociator_->volume().maxZ();
218 cachedTrajectory_.setMaxDetectorRadius(maxR);
219 cachedTrajectory_.setMaxDetectorLength(maxZ*2.);
224 cachedTrajectory_.setMaxDetectorRadius(HOmaxR);
225 cachedTrajectory_.setMaxDetectorLength(HOmaxZ*2.);
231 LogTrace(
"TrackAssociator") <<
"Using outerState as trackOrigin at Rho=" << outerState->
position().
perp()
232 <<
" Z=" << outerState->
position().
z() <<
"\n";
235 else if(innerState) {
236 LogTrace(
"TrackAssociator") <<
"Using innerState as trackOrigin at Rho=" << innerState->
position().
perp()
237 <<
" Z=" << innerState->
position().
z() <<
"\n";
242 if ( ! cachedTrajectory_.propagateAll(trackOrigin) )
return info;
245 cachedTrajectory_.findEcalTrajectory( ecalDetIdAssociator_->volume() );
246 cachedTrajectory_.findHcalTrajectory( hcalDetIdAssociator_->volume() );
247 cachedTrajectory_.findHOTrajectory( hoDetIdAssociator_->volume() );
248 cachedTrajectory_.findPreshowerTrajectory( preshowerDetIdAssociator_->volume() );
250 info.
trkGlobPosAtEcal = getPoint( cachedTrajectory_.getStateAtEcal().position() );
251 info.
trkGlobPosAtHcal = getPoint( cachedTrajectory_.getStateAtHcal().position() );
252 info.
trkGlobPosAtHO = getPoint( cachedTrajectory_.getStateAtHO().position() );
254 info.
trkMomAtEcal = cachedTrajectory_.getStateAtEcal().momentum();
255 info.
trkMomAtHcal = cachedTrajectory_.getStateAtHcal().momentum();
256 info.
trkMomAtHO = cachedTrajectory_.getStateAtHO().momentum();
260 if (parameters.
useEcal) fillEcal( iEvent, info, parameters);
261 if (parameters.
useCalo) fillCaloTowers( iEvent, info, parameters);
262 if (parameters.
useHcal) fillHcal( iEvent, info, parameters);
263 if (parameters.
useHO) fillHO( iEvent, info, parameters);
264 if (parameters.
usePreshower) fillPreshower( iEvent, info, parameters);
265 if (parameters.
useMuon) fillMuon( iEvent, info, parameters);
266 if (parameters.
truthMatch) fillCaloTruth( iEvent, info, parameters);
278 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getEcalTrajectory();
280 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
281 itr != trajectoryStates.end(); itr++)
282 LogTrace(
"TrackAssociator") <<
"ECAL trajectory point (rho, z, phi): " << itr->position().perp() <<
283 ", " << itr->position().z() <<
", " << itr->position().phi();
285 std::vector<GlobalPoint> coreTrajectory;
286 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
287 itr != trajectoryStates.end(); itr++) coreTrajectory.push_back(itr->position());
289 if(coreTrajectory.empty()) {
290 LogTrace(
"TrackAssociator") <<
"ECAL track trajectory is empty; moving on\n";
300 if (!EBRecHits.
isValid())
throw cms::Exception(
"FatalError") <<
"Unable to find EBRecHitCollection in the event!\n";
305 if (!EERecHits.
isValid())
throw cms::Exception(
"FatalError") <<
"Unable to find EERecHitCollection in event!\n";
309 std::set<DetId> ecalIdsInRegion;
314 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0],mapRange);
315 }
else ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dREcalPreselection);
317 LogTrace(
"TrackAssociator") <<
"ECAL hits in the region: " << ecalIdsInRegion.size();
319 ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsInACone(ecalIdsInRegion, coreTrajectory, parameters.
dREcal);
320 LogTrace(
"TrackAssociator") <<
"ECAL hits in the cone: " << ecalIdsInRegion.size();
321 std::vector<DetId> crossedEcalIds =
322 ecalDetIdAssociator_->getCrossedDetIds(ecalIdsInRegion, coreTrajectory);
323 LogTrace(
"TrackAssociator") <<
"ECAL crossed hits " << crossedEcalIds.size();
329 for(std::vector<DetId>::const_iterator itr=crossedEcalIds.begin(); itr!=crossedEcalIds.end();itr++)
331 std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
332 std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
333 if(ebHit != (*EBRecHits).end())
335 else if(eeHit != (*EERecHits).end())
338 LogTrace(
"TrackAssociator") <<
"Crossed EcalRecHit is not found for DetId: " << itr->rawId();
341 for(std::set<DetId>::const_iterator itr=ecalIdsInRegion.begin(); itr!=ecalIdsInRegion.end();itr++)
343 std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
344 std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
345 if(ebHit != (*EBRecHits).end())
347 else if(eeHit != (*EERecHits).end())
350 LogTrace(
"TrackAssociator") <<
"EcalRecHit from the cone is not found for DetId: " << itr->rawId();
362 std::vector<GlobalPoint> trajectory;
363 const std::vector<SteppingHelixStateInfo>& ecalTrajectoryStates = cachedTrajectory_.getEcalTrajectory();
364 const std::vector<SteppingHelixStateInfo>& hcalTrajectoryStates = cachedTrajectory_.getHcalTrajectory();
365 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = ecalTrajectoryStates.begin();
366 itr != ecalTrajectoryStates.end(); itr++) trajectory.push_back(itr->position());
367 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = hcalTrajectoryStates.begin();
368 itr != hcalTrajectoryStates.end(); itr++) trajectory.push_back(itr->position());
370 if(trajectory.empty()) {
371 LogTrace(
"TrackAssociator") <<
"HCAL trajectory is empty; moving on\n";
382 if (!caloTowers.
isValid())
throw cms::Exception(
"FatalError") <<
"Unable to find CaloTowers in event!\n";
385 std::set<DetId> caloTowerIdsInRegion;
390 caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0],mapRange);
391 }
else caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], parameters.
dRHcalPreselection);
393 LogTrace(
"TrackAssociator") <<
"Towers in the region: " << caloTowerIdsInRegion.size();
394 std::set<DetId> caloTowerIdsInACone = caloDetIdAssociator_->getDetIdsInACone(caloTowerIdsInRegion, trajectory, parameters.
dRHcal);
395 LogTrace(
"TrackAssociator") <<
"Towers in the cone: " << caloTowerIdsInACone.size();
396 std::vector<DetId> crossedCaloTowerIds = caloDetIdAssociator_->getCrossedDetIds(caloTowerIdsInRegion, trajectory);
397 LogTrace(
"TrackAssociator") <<
"Towers crossed: " << crossedCaloTowerIds.size();
403 for(std::vector<DetId>::const_iterator itr=crossedCaloTowerIds.begin(); itr!=crossedCaloTowerIds.end();itr++)
406 if(tower != (*caloTowers).end())
409 LogTrace(
"TrackAssociator") <<
"Crossed CaloTower is not found for DetId: " << (*itr).rawId();
413 for(std::set<DetId>::const_iterator itr=caloTowerIdsInACone.begin(); itr!=caloTowerIdsInACone.end();itr++)
416 if(tower != (*caloTowers).end())
417 info.
towers.push_back(&*tower);
419 LogTrace(
"TrackAssociator") <<
"CaloTower from the cone is not found for DetId: " << (*itr).rawId();
428 std::vector<GlobalPoint> trajectory;
429 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getPreshowerTrajectory();
430 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
431 itr != trajectoryStates.end(); itr++) trajectory.push_back(itr->position());
433 if(trajectory.empty()) {
434 LogTrace(
"TrackAssociator") <<
"Preshower trajectory is empty; moving on\n";
438 std::set<DetId> idsInRegion =
439 preshowerDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0],
442 LogTrace(
"TrackAssociator") <<
"Number of Preshower Ids in the region: " << idsInRegion.size();
443 std::vector<DetId> crossedIds = preshowerDetIdAssociator_->getCrossedDetIds(idsInRegion, trajectory);
444 LogTrace(
"TrackAssociator") <<
"Number of Preshower Ids in crossed: " << crossedIds.size();
456 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHcalTrajectory();
458 std::vector<GlobalPoint> coreTrajectory;
459 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
460 itr != trajectoryStates.end(); itr++) coreTrajectory.push_back(itr->position());
462 if(coreTrajectory.empty()) {
463 LogTrace(
"TrackAssociator") <<
"HCAL trajectory is empty; moving on\n";
474 if ( ! collection.
isValid() )
throw cms::Exception(
"FatalError") <<
"Unable to find HBHERecHits in event!\n";
477 std::set<DetId> idsInRegion;
482 idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
483 }
else idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dRHcalPreselection);
485 LogTrace(
"TrackAssociator") <<
"HCAL hits in the region: " << idsInRegion.size() <<
"\n" <<
DetIdInfo::info(idsInRegion);
486 std::set<DetId> idsInACone = hcalDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.
dRHcal);
487 LogTrace(
"TrackAssociator") <<
"HCAL hits in the cone: " << idsInACone.size() <<
"\n" <<
DetIdInfo::info(idsInACone);
488 std::vector<DetId> crossedIds =
489 hcalDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
490 LogTrace(
"TrackAssociator") <<
"HCAL hits crossed: " << crossedIds.size() <<
"\n" <<
DetIdInfo::info(crossedIds);
496 for(std::vector<DetId>::const_iterator itr=crossedIds.begin(); itr!=crossedIds.end();itr++)
499 if( hit != (*collection).end() )
502 LogTrace(
"TrackAssociator") <<
"Crossed HBHERecHit is not found for DetId: " << itr->rawId();
505 for(std::set<DetId>::const_iterator itr=idsInACone.begin(); itr!=idsInACone.end();itr++)
508 if( hit != (*collection).end() )
511 LogTrace(
"TrackAssociator") <<
"HBHERecHit from the cone is not found for DetId: " << itr->rawId();
522 const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHOTrajectory();
524 std::vector<GlobalPoint> coreTrajectory;
525 for(std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
526 itr != trajectoryStates.end(); itr++) coreTrajectory.push_back(itr->position());
528 if(coreTrajectory.empty()) {
529 LogTrace(
"TrackAssociator") <<
"HO trajectory is empty; moving on\n";
540 if ( ! collection.
isValid() )
throw cms::Exception(
"FatalError") <<
"Unable to find HORecHits in event!\n";
543 std::set<DetId> idsInRegion;
548 idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
549 }
else idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.
dRHcalPreselection);
551 LogTrace(
"TrackAssociator") <<
"idsInRegion.size(): " << idsInRegion.size();
552 std::set<DetId> idsInACone = hoDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.
dRHcal);
553 LogTrace(
"TrackAssociator") <<
"idsInACone.size(): " << idsInACone.size();
554 std::vector<DetId> crossedIds =
555 hoDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
561 for(std::vector<DetId>::const_iterator itr=crossedIds.begin(); itr!=crossedIds.end();itr++)
564 if( hit != (*collection).end() )
567 LogTrace(
"TrackAssociator") <<
"Crossed HORecHit is not found for DetId: " << itr->rawId();
571 for(std::set<DetId>::const_iterator itr=idsInACone.begin(); itr!=idsInACone.end();itr++)
574 if( hit != (*collection).end() )
577 LogTrace(
"TrackAssociator") <<
"HORecHit from the cone is not found for DetId: " << itr->rawId();
589 if (
abs(track.
type( )) == 211 ||
592 charge = track.
type( )< 0 ? -1 : 1;
593 return getFreeTrajectoryState(iSetup, vector,
point, charge);
606 ROOT::Math::SMatrixIdentity id;
629 ROOT::Math::SMatrixIdentity id;
644 if ( delta.first > 0 )
648 if ( delta.second > 0 )
651 mapRange.
dPhiMinus += fabs(delta.second);
652 LogTrace(
"TrackAssociator") <<
"Selection range: (dThetaPlus, dThetaMinus, dPhiPlus, dPhiMinus, dRPreselection): " <<
675 if(! trajectoryPoint.
isValid() ) trajectoryPoint = cachedTrajectory_.getOuterState();
676 if(! trajectoryPoint.
isValid() ) {
678 "trajectory position at HCAL is not valid. Assume the track cannot reach muon detectors and skip it";
683 LogTrace(
"TrackAssociator") <<
"muon direction: " << direction <<
"\n\t and corresponding point: " <<
692 std::set<DetId> muonIdsInRegion =
693 muonDetIdAssociator_->getDetIdsCloseToAPoint(trajectoryPoint.
position(), mapRange);
695 LogTrace(
"TrackAssociator") <<
"Number of chambers to check: " << muonIdsInRegion.size();
696 for(std::set<DetId>::const_iterator detId = muonIdsInRegion.begin(); detId != muonIdsInRegion.end(); detId++)
698 const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet(*detId);
701 if (! stateOnSurface.
isValid()) {
702 LogTrace(
"TrackAssociator") <<
"Failed to propagate the track; moving on\n\t"<<
713 if(
const CSCChamber* cscChamber = dynamic_cast<const CSCChamber*>(geomDet) ) {
716 LogTrace(
"TrackAssociator") <<
"Failed to get CSCChamberSpecs from CSCChamber; moving on\n";
720 if(! layerGeometry) {
721 LogTrace(
"TrackAssociator") <<
"Failed to get CSCLayerGeometry from CSCChamberSpecs; moving on\n";
726 LogTrace(
"TrackAssociator") <<
"Failed to get CSCWireTopology from CSCLayerGeometry; moving on\n";
734 float yOfFirstWire = fabs(wireTopology->
wireAngle())>1.E-06 ? -0.5*length : wireTopology->
yOfWire(1);
736 float yCOWPOffset = yOfFirstWire+0.5*length;
739 float tangent = (wideWidth-narrowWidth)/(2.*length);
741 float yPrime = localPoint.
y()+fabs(yOfFirstWire);
743 float halfWidthAtYPrime = 0.5*narrowWidth+yPrime*tangent;
744 distanceX = fabs(localPoint.
x()) - halfWidthAtYPrime;
745 distanceY = fabs(localPoint.
y()-yCOWPOffset) - 0.5*length;
746 sigmaX = distanceX/
sqrt(localError.
xx());
747 sigmaY = distanceY/
sqrt(localError.
yy());
751 sigmaX = distanceX/
sqrt(localError.
xx());
752 sigmaY = distanceY/
sqrt(localError.
yy());
759 match.
tState = stateOnSurface;
763 matches.push_back(match);
765 LogTrace(
"TrackAssociator") <<
"chamber is too far: " <<
766 DetIdInfo::info(*detId) <<
"\n\tdistanceX: " << distanceX <<
"\t distanceY: " << distanceY <<
767 "\t sigmaX: " << sigmaX <<
"\t sigmaY: " << sigmaY <<
"\n";
787 throw cms::Exception(
"FatalError") <<
"Unable to find DTRecSegment4DCollection in event!\n";
792 throw cms::Exception(
"FatalError") <<
"Unable to find CSCSegmentCollection in event!\n";
807 std::vector<TAMuonChamberMatch> matchedChambers;
808 LogTrace(
"TrackAssociator") <<
"Trying to Get ChamberMatches" << std::endl;
809 getTAMuonChamberMatches(matchedChambers, parameters);
810 LogTrace(
"TrackAssociator") <<
"Chambers matched: " << matchedChambers.size() <<
"\n";
815 for(std::vector<TAMuonChamberMatch>::iterator matchedChamber = matchedChambers.begin();
816 matchedChamber != matchedChambers.end(); matchedChamber++)
818 const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet((*matchedChamber).id);
820 if(
const DTChamber* chamber = dynamic_cast<const DTChamber*>(geomDet) ) {
825 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
826 matchedChamber->segments.back().dtSegmentRef =
DTRecSegment4DRef(dtSegments, segment - dtSegments->begin());
831 if(
const CSCChamber* chamber = dynamic_cast<const CSCChamber*>(geomDet) ) {
836 if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
837 matchedChamber->segments.back().cscSegmentRef =
CSCSegmentRef(cscSegments, segment - cscSegments->begin());
844 info.
chambers.push_back(*matchedChamber);
854 <<
"Segment local position: " << segment->
localPosition() <<
"\n"
857 const GeomDet* chamber = muonDetIdAssociator_->getGeomDet(matchedChamber.
id);
862 <<
"Segment global position: " << segmentGlobalPosition <<
" \t (R_xy,eta,phi): "
863 << segmentGlobalPosition.
perp() <<
"," << segmentGlobalPosition.
eta() <<
"," << segmentGlobalPosition.
phi() <<
"\n";
866 <<
"\teta hit: " << segmentGlobalPosition.
eta() <<
" \tpropagator: " << trajectoryStateOnSurface.
freeState()->
position().
eta() <<
"\n"
867 <<
"\tphi hit: " << segmentGlobalPosition.
phi() <<
" \tpropagator: " << trajectoryStateOnSurface.
freeState()->
position().
phi() << std::endl;
870 bool isDTWithoutY =
false;
872 if ( dtseg && (! dtseg->
hasZed()) )
876 if(deltaPhi>
M_PI) deltaPhi = fabs(deltaPhi-
M_PI*2.);
880 isGood = deltaPhi < parameters.
dRMuon;
884 deltaPhi*deltaPhi) < parameters.
dRMuon;
903 muonSegment.
hasZed =
true;
904 muonSegment.
hasPhi =
true;
909 if ( (dtseg->
hasPhi()) && (! isDTWithoutY) ) {
918 LogTrace(
"TrackAssociator") <<
" Phi t0: " << dtseg->
phiSegment()->
t0() <<
" hits: " << phiHits;
926 if (hits) muonSegment.
t0 = t0/hits;
930 if (isDTWithoutY) muonSegment.
hasZed =
false;
934 matchedChamber.
segments.push_back(muonSegment);
950 if (! simTracks.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated tracks found\n";
954 if (! simVertices.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated vertices found\n";
958 iEvent.
getByLabel(
"g4SimHits",
"EcalHitsEB",simEcalHitsEB);
959 if (! simEcalHitsEB.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated ECAL EB hits found\n";
962 iEvent.
getByLabel(
"g4SimHits",
"EcalHitsEE",simEcalHitsEE);
963 if (! simEcalHitsEE.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated ECAL EE hits found\n";
966 iEvent.
getByLabel(
"g4SimHits",
"HcalHits",simHcalHits);
967 if (! simHcalHits.isValid() )
throw cms::Exception(
"FatalError") <<
"No simulated HCAL hits found\n";
970 SimTrackContainer::const_iterator simTrack = simTracks->begin();
971 for( ; simTrack != simTracks->end(); ++simTrack){
972 math::XYZVector simP3( simTrack->momentum().x(), simTrack->momentum().y(), simTrack->momentum().z() );
974 if ( ROOT::Math::VectorUtil::DeltaR(recoP3, simP3) < 0.1 )
break;
976 if ( simTrack != simTracks->end() ) {
978 double ecalTrueEnergy(0);
979 double hcalTrueEnergy(0);
982 for( PCaloHitContainer::const_iterator
hit = simEcalHitsEB->begin();
hit != simEcalHitsEB->end(); ++
hit )
985 for( PCaloHitContainer::const_iterator
hit = simEcalHitsEE->begin();
hit != simEcalHitsEE->end(); ++
hit )
988 for( PCaloHitContainer::const_iterator
hit = simHcalHits->begin();
hit != simHcalHits->end(); ++
hit )
1008 double currentStepSize = cachedTrajectory_.getPropagationStep();
1014 if ( direction != InsideOut )
1016 "No TrackExtra information is available and association is done with something else than InsideOut track.\n" <<
1017 "Either change the parameter or provide needed data!\n";
1018 LogTrace(
"TrackAssociator") <<
"Track Extras not found\n";
1020 return associate(iEvent, iSetup, parameters, &initialState);
1023 LogTrace(
"TrackAssociator") <<
"Track Extras found\n";
1028 LogTrace(
"TrackAssociator") <<
"inner track state (rho, z, phi):" <<
1031 LogTrace(
"TrackAssociator") <<
"innerFreeState (rho, z, phi):" <<
1035 LogTrace(
"TrackAssociator") <<
"outer track state (rho, z, phi):" <<
1038 LogTrace(
"TrackAssociator") <<
"outerFreeState (rho, z, phi):" <<
1043 if ( crossedIP( track ) ) {
1044 switch ( direction ) {
1047 return associate(iEvent, iSetup, parameters, &referenceState, &outerState);
1051 cachedTrajectory_.setPropagationStep( -fabs(currentStepSize) );
1053 cachedTrajectory_.setPropagationStep( currentStepSize );
1059 switch ( direction ) {
1061 return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1065 cachedTrajectory_.setPropagationStep( -fabs(currentStepSize) );
1067 cachedTrajectory_.setPropagationStep( currentStepSize );
1077 cachedTrajectory_.setPropagationStep( -fabs(currentStepSize) );
1080 result = associate(iEvent, iSetup, parameters, &innerState, &outerState);
1082 result = associate(iEvent, iSetup, parameters, &outerState, &innerState);
1083 cachedTrajectory_.setPropagationStep( currentStepSize );
1091 return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1100 return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, track, vertex), parameters);
1110 return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, momentum, vertex, charge), parameters);
1115 bool crossed =
true;
std::vector< DetId > crossedPreshowerIds
math::XYZPoint trkGlobPosAtHO
std::pair< const_iterator, const_iterator > range
iterator range
TrackDetectorAssociator()
void fillHO(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &) dso_internal
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
void fillCaloTowers(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &) dso_internal
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
void fillPreshower(const edm::Event &iEvent, TrackDetMatchInfo &info, const AssociatorParameters &) dso_internal
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.
void fillMuon(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &) dso_internal
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
double dRMuonPreselection
const Bounds & bounds() const
edm::InputTag theHORecHitCollectionLabel
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
const Plane & surface() const
The nominal surface of the GeomDet.
math::XYZVector segmentLocalDirection
LocalError positionError() const
float segmentLocalErrorDxDz
math::XYZPoint trkGlobPosAtHcal
FreeTrajectoryState stateAtIP
track info
const math::XYZPoint & innerPosition() const
position of the innermost hit
uint32_t rawId() const
get the raw id
bool isNull() const
Checks for null.
void fillHcal(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &) dso_internal
float segmentLocalErrorDyDz
tuple SteppingHelixPropagator
void setPropagator(const Propagator *)
use a user configured propagator
GlobalPoint position() const
DetIdAssociator::MapRange getMapRange(const std::pair< float, float > &delta, const float dR) dso_internal
LocalPoint toLocal(const GlobalPoint &gp) const
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) ...
std::vector< TAMuonChamberMatch > chambers
std::vector< const HBHERecHit * > hcalRecHits
std::vector< DetId > crossedHOIds
double dRPreshowerPreselection
void fillCaloTruth(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &) dso_internal
Abs< T >::type abs(const T &t)
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
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 ...
bool addTAMuonSegmentMatch(TAMuonChamberMatch &, const RecSegment *, const AssociatorParameters &) dso_internal
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 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
const CSCLayerGeometry * oddLayerGeometry(int iendcap) const
Accessors for LayerGeometry's.
edm::InputTag theCSCSegmentCollectionLabel
void fillEcal(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &) dso_internal
void getTAMuonChamberMatches(std::vector< TAMuonChamberMatch > &matches, const AssociatorParameters ¶meters) dso_internal
GlobalVector trkMomAtHcal
int type() const
particle type (HEP PDT convension)
float segmentLocalErrorXDxDz
void init(const edm::EventSetup &) dso_internal
edm::InputTag theCaloTowerCollectionLabel
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.
std::vector< SimTrack > SimTrackContainer
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