CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TrackDetectorAssociator Class Reference

#include <TrackDetectorAssociator.h>

Public Types

typedef TrackAssociatorParameters AssociatorParameters
 
enum  Direction { Any, InsideOut, OutsideIn }
 

Public Member Functions

TrackDetMatchInfo associate (const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
 
TrackDetMatchInfo associate (const edm::Event &, const edm::EventSetup &, const GlobalVector &, const GlobalPoint &, const int, const AssociatorParameters &)
 associate using 3-momentum, vertex and charge More...
 
TrackDetMatchInfo associate (const edm::Event &, const edm::EventSetup &, const reco::Track &, const AssociatorParameters &, Direction direction=Any)
 associate using reco::Track More...
 
TrackDetMatchInfo associate (const edm::Event &, const edm::EventSetup &, const SimTrack &, const SimVertex &, const AssociatorParameters &)
 associate using a simulated track More...
 
TrackDetMatchInfo associate (const edm::Event &iEvent, const edm::EventSetup &iSetup, const AssociatorParameters &parameters, const FreeTrajectoryState *innerState, const FreeTrajectoryState *outerState=nullptr)
 
const CachedTrajectorygetCachedTrajector () const
 trajector information More...
 
void setPropagator (const Propagator *)
 use a user configured propagator More...
 
 TrackDetectorAssociator ()
 
void useDefaultPropagator ()
 use the default propagator More...
 
 ~TrackDetectorAssociator ()
 

Static Public Member Functions

static bool crossedIP (const reco::Track &track)
 
static FreeTrajectoryState getFreeTrajectoryState (const edm::EventSetup &, const GlobalVector &, const GlobalPoint &, const int)
 
static FreeTrajectoryState getFreeTrajectoryState (const edm::EventSetup &, const reco::Track &)
 get FreeTrajectoryState from different track representations More...
 
static FreeTrajectoryState getFreeTrajectoryState (const edm::EventSetup &, const SimTrack &, const SimVertex &)
 

Private Member Functions

bool addTAMuonSegmentMatch (TAMuonChamberMatch &, const RecSegment *, const AssociatorParameters &)
 
void fillCaloTowers (const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
 
void fillCaloTruth (const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
 
void fillEcal (const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
 
void fillHcal (const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
 
void fillHO (const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
 
void fillMuon (const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
 
void fillPreshower (const edm::Event &iEvent, TrackDetMatchInfo &info, const AssociatorParameters &)
 
DetIdAssociator::MapRange getMapRange (const std::pair< float, float > &delta, const float dR)
 
math::XYZPoint getPoint (const GlobalPoint &point)
 
math::XYZPoint getPoint (const LocalPoint &point)
 
void getTAMuonChamberMatches (std::vector< TAMuonChamberMatch > &matches, const AssociatorParameters &parameters)
 
math::XYZVector getVector (const GlobalVector &vec)
 
math::XYZVector getVector (const LocalVector &vec)
 
void init (const edm::EventSetup &)
 

Private Attributes

CachedTrajectory cachedTrajectory_
 
edm::ESHandle< DetIdAssociatorcaloDetIdAssociator_
 
PropagatordefProp_
 
edm::ESHandle< DetIdAssociatorecalDetIdAssociator_
 
edm::ESHandle< DetIdAssociatorhcalDetIdAssociator_
 
edm::ESHandle< DetIdAssociatorhoDetIdAssociator_
 
const PropagatorivProp_
 
edm::ESHandle< DetIdAssociatormuonDetIdAssociator_
 
edm::ESHandle< DetIdAssociatorpreshowerDetIdAssociator_
 
edm::ESHandle< CaloGeometrytheCaloGeometry_
 
edm::ESWatcher< IdealMagneticFieldRecordtheMagneticFeildWatcher_
 
edm::ESHandle< GlobalTrackingGeometrytheTrackingGeometry_
 
bool useDefaultPropagator_
 

Detailed Description

Definition at line 49 of file TrackDetectorAssociator.h.

Member Typedef Documentation

◆ AssociatorParameters

Definition at line 54 of file TrackDetectorAssociator.h.

Member Enumeration Documentation

◆ Direction

Enumerator
Any 
InsideOut 
OutsideIn 

Definition at line 55 of file TrackDetectorAssociator.h.

55 { Any, InsideOut, OutsideIn };

Constructor & Destructor Documentation

◆ TrackDetectorAssociator()

TrackDetectorAssociator::TrackDetectorAssociator ( )

Definition at line 104 of file TrackDetectorAssociator.cc.

104  {
105  ivProp_ = nullptr;
106  defProp_ = nullptr;
107  useDefaultPropagator_ = false;
108 }

◆ ~TrackDetectorAssociator()

TrackDetectorAssociator::~TrackDetectorAssociator ( )

Definition at line 110 of file TrackDetectorAssociator.cc.

110  {
111  if (defProp_)
112  delete defProp_;
113 }

Member Function Documentation

◆ addTAMuonSegmentMatch()

bool TrackDetectorAssociator::addTAMuonSegmentMatch ( TAMuonChamberMatch matchedChamber,
const RecSegment segment,
const AssociatorParameters parameters 
)
private

Definition at line 843 of file TrackDetectorAssociator.cc.

845  {
846  LogTrace("TrackAssociator") << "Segment local position: " << segment->localPosition() << "\n"
847  << std::hex << segment->geographicalId().rawId() << "\n";
848 
849  const GeomDet* chamber = muonDetIdAssociator_->getGeomDet(matchedChamber.id);
850  TrajectoryStateOnSurface trajectoryStateOnSurface = matchedChamber.tState;
851  GlobalPoint segmentGlobalPosition = chamber->toGlobal(segment->localPosition());
852 
853  LogTrace("TrackAssociator") << "Segment global position: " << segmentGlobalPosition
854  << " \t (R_xy,eta,phi): " << segmentGlobalPosition.perp() << ","
855  << segmentGlobalPosition.eta() << "," << segmentGlobalPosition.phi() << "\n";
856 
857  LogTrace("TrackAssociator") << "\teta hit: " << segmentGlobalPosition.eta()
858  << " \tpropagator: " << trajectoryStateOnSurface.freeState()->position().eta() << "\n"
859  << "\tphi hit: " << segmentGlobalPosition.phi()
860  << " \tpropagator: " << trajectoryStateOnSurface.freeState()->position().phi()
861  << std::endl;
862 
863  bool isGood = false;
864  bool isDTWithoutY = false;
865  const DTRecSegment4D* dtseg = dynamic_cast<const DTRecSegment4D*>(segment);
866  if (dtseg && (!dtseg->hasZed()))
867  isDTWithoutY = true;
868 
869  double deltaPhi(fabs(segmentGlobalPosition.phi() - trajectoryStateOnSurface.freeState()->position().phi()));
870  if (deltaPhi > M_PI)
871  deltaPhi = fabs(deltaPhi - M_PI * 2.);
872 
873  if (isDTWithoutY) {
874  isGood = deltaPhi < parameters.dRMuon;
875  // Be in chamber
876  isGood &= fabs(segmentGlobalPosition.eta() - trajectoryStateOnSurface.freeState()->position().eta()) < .3;
877  } else
878  isGood = sqrt(pow(segmentGlobalPosition.eta() - trajectoryStateOnSurface.freeState()->position().eta(), 2) +
879  deltaPhi * deltaPhi) < parameters.dRMuon;
880 
881  if (isGood) {
882  TAMuonSegmentMatch muonSegment;
883  muonSegment.segmentGlobalPosition = getPoint(segmentGlobalPosition);
884  muonSegment.segmentLocalPosition = getPoint(segment->localPosition());
885  muonSegment.segmentLocalDirection = getVector(segment->localDirection());
886  muonSegment.segmentLocalErrorXX = segment->localPositionError().xx();
887  muonSegment.segmentLocalErrorYY = segment->localPositionError().yy();
888  muonSegment.segmentLocalErrorXY = segment->localPositionError().xy();
889  muonSegment.segmentLocalErrorDxDz = segment->localDirectionError().xx();
890  muonSegment.segmentLocalErrorDyDz = segment->localDirectionError().yy();
891 
892  // DANGEROUS - compiler cannot guaranty parameters ordering
893  // AlgebraicSymMatrix segmentCovMatrix = segment->parametersError();
894  // muonSegment.segmentLocalErrorXDxDz = segmentCovMatrix[2][0];
895  // muonSegment.segmentLocalErrorYDyDz = segmentCovMatrix[3][1];
896  muonSegment.segmentLocalErrorXDxDz = -999;
897  muonSegment.segmentLocalErrorYDyDz = -999;
898  muonSegment.hasZed = true;
899  muonSegment.hasPhi = true;
900 
901  // timing information
902  muonSegment.t0 = 0;
903  if (dtseg) {
904  if ((dtseg->hasPhi()) && (!isDTWithoutY)) {
905  int phiHits = dtseg->phiSegment()->specificRecHits().size();
906  // int zHits = dtseg->zSegment()->specificRecHits().size();
907  int hits = 0;
908  double t0 = 0.;
909  // TODO: cuts on hit numbers not optimized in any way yet...
910  if (phiHits > 5 && dtseg->phiSegment()->ist0Valid()) {
911  t0 += dtseg->phiSegment()->t0() * phiHits;
912  hits += phiHits;
913  LogTrace("TrackAssociator") << " Phi t0: " << dtseg->phiSegment()->t0() << " hits: " << phiHits;
914  }
915  // the z segments seem to contain little useful information...
916  // if (zHits>3) {
917  // t0+=s->zSegment()->t0()*zHits;
918  // hits+=zHits;
919  // LogTrace("TrackAssociator") << " Z t0: " << s->zSegment()->t0() << " hits: " << zHits << std::endl;
920  // }
921  if (hits)
922  muonSegment.t0 = t0 / hits;
923  // LogTrace("TrackAssociator") << " --- t0: " << muonSegment.t0 << std::endl;
924  } else {
925  // check and set dimensionality
926  if (isDTWithoutY)
927  muonSegment.hasZed = false;
928  if (!dtseg->hasPhi())
929  muonSegment.hasPhi = false;
930  }
931  }
932  matchedChamber.segments.push_back(muonSegment);
933  }
934 
935  return isGood;
936 }

References relativeConstraints::chamber, reco::deltaPhi(), PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::freeState(), TrackingRecHit::geographicalId(), TAMuonSegmentMatch::hasPhi, DTRecSegment4D::hasPhi(), TAMuonSegmentMatch::hasZed, DTRecSegment4D::hasZed(), hfClusterShapes_cfi::hits, TAMuonChamberMatch::id, DTRecSegment2D::ist0Valid(), RecSegment::localDirection(), RecSegment::localDirectionError(), TrackingRecHit::localPosition(), TrackingRecHit::localPositionError(), LogTrace, M_PI, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), DTRecSegment4D::phiSegment(), FreeTrajectoryState::position(), funct::pow(), DetId::rawId(), TAMuonSegmentMatch::segmentGlobalPosition, TAMuonSegmentMatch::segmentLocalDirection, TAMuonSegmentMatch::segmentLocalErrorDxDz, TAMuonSegmentMatch::segmentLocalErrorDyDz, TAMuonSegmentMatch::segmentLocalErrorXDxDz, TAMuonSegmentMatch::segmentLocalErrorXX, TAMuonSegmentMatch::segmentLocalErrorXY, TAMuonSegmentMatch::segmentLocalErrorYDyDz, TAMuonSegmentMatch::segmentLocalErrorYY, TAMuonSegmentMatch::segmentLocalPosition, TAMuonChamberMatch::segments, DTRecSegment2D::specificRecHits(), mathSSE::sqrt(), TAMuonSegmentMatch::t0, DTRecSegment2D::t0(), FrontierCondition_GT_autoExpress_cfi::t0, TAMuonChamberMatch::tState, LocalError::xx(), LocalError::xy(), and LocalError::yy().

◆ associate() [1/5]

TrackDetMatchInfo TrackDetectorAssociator::associate ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const FreeTrajectoryState fts,
const AssociatorParameters parameters 
)

propagate a track across the whole detector and find associated objects. Association is done in two modes 1) an object is associated to a track only if crossed by track 2) an object is associated to a track if it is withing an eta-phi cone of some radius with respect to a track. (the cone origin is at (0,0,0)) Trajectory bending in eta-phi is taking into account when matching is performed

associate using FreeTrajectoryState

Definition at line 154 of file TrackDetectorAssociator.cc.

157  {
158  return associate(iEvent, iSetup, parameters, &fts);
159 }

References iEvent.

Referenced by BetaCalculatorECAL::addInfoToCandidate(), EopTreeWriter::analyze(), EcalCosmicsHists::analyze(), muonisolation::JetExtractor::deposit(), muonisolation::CaloExtractorByAssociator::deposits(), cms::MuonMETValueMapProducer::determine_deltax_deltay(), MuonIdProducer::fillMuonId(), InterestingTrackEcalDetIdProducer::produce(), HighPtTrackEcalDetIdProducer::produce(), and ReduceHcalRecHitCollectionProducer::produce().

◆ associate() [2/5]

TrackDetMatchInfo TrackDetectorAssociator::associate ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const GlobalVector momentum,
const GlobalPoint vertex,
const int  charge,
const AssociatorParameters parameters 
)

associate using 3-momentum, vertex and charge

Definition at line 1098 of file TrackDetectorAssociator.cc.

1103  {
1104  return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, momentum, vertex, charge), parameters);
1105 }

References ALCARECOTkAlJpsiMuMu_cff::charge, iEvent, and bphysicsOniaDQM_cfi::vertex.

◆ associate() [3/5]

TrackDetMatchInfo TrackDetectorAssociator::associate ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const reco::Track track,
const AssociatorParameters parameters,
Direction  direction = Any 
)

associate using reco::Track

Definition at line 1007 of file TrackDetectorAssociator.cc.

1011  {
1012  double currentStepSize = cachedTrajectory_.getPropagationStep();
1013 
1016 
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";
1024  return associate(iEvent, iSetup, parameters, &initialState); // 5th argument is null pointer
1025  }
1026 
1027  LogTrace("TrackAssociator") << "Track Extras found\n";
1031 
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() << ", "
1035  << innerState.position().z() << ", " << innerState.position().phi() << "\n";
1036 
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() << ", "
1040  << outerState.position().z() << ", " << outerState.position().phi() << "\n";
1041 
1042  // InsideOut first
1043  if (crossedIP(track)) {
1044  switch (direction) {
1045  case InsideOut:
1046  case Any:
1047  return associate(iEvent, iSetup, parameters, &referenceState, &outerState);
1048  break;
1049  case OutsideIn: {
1050  cachedTrajectory_.setPropagationStep(-fabs(currentStepSize));
1051  TrackDetMatchInfo result = associate(iEvent, iSetup, parameters, &innerState, &referenceState);
1052  cachedTrajectory_.setPropagationStep(currentStepSize);
1053  return result;
1054  break;
1055  }
1056  }
1057  } else {
1058  switch (direction) {
1059  case InsideOut:
1060  return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1061  break;
1062  case OutsideIn: {
1063  cachedTrajectory_.setPropagationStep(-fabs(currentStepSize));
1064  TrackDetMatchInfo result = associate(iEvent, iSetup, parameters, &outerState, &innerState);
1065  cachedTrajectory_.setPropagationStep(currentStepSize);
1066  return result;
1067  break;
1068  }
1069  case Any: {
1070  // check if we deal with clear outside-in case
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())
1076  result = associate(iEvent, iSetup, parameters, &innerState, &outerState);
1077  else
1078  result = associate(iEvent, iSetup, parameters, &outerState, &innerState);
1079  cachedTrajectory_.setPropagationStep(currentStepSize);
1080  return result;
1081  }
1082  }
1083  }
1084  }
1085 
1086  // all other cases
1087  return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1088 }

References Calorimetry_cff::bField, Exception, reco::get(), edm::EventSetup::get(), iEvent, trajectoryStateTransform::initialFreeState(), trajectoryStateTransform::innerFreeState(), LogTrace, trajectoryStateTransform::outerFreeState(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), FreeTrajectoryState::position(), mps_fire::result, HLT_2018_cff::track, and PV3DBase< T, PVType, FrameType >::z().

◆ associate() [4/5]

TrackDetMatchInfo TrackDetectorAssociator::associate ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const SimTrack track,
const SimVertex vertex,
const AssociatorParameters parameters 
)

associate using a simulated track

Definition at line 1090 of file TrackDetectorAssociator.cc.

1094  {
1095  return associate(iEvent, iSetup, getFreeTrajectoryState(iSetup, track, vertex), parameters);
1096 }

References iEvent, HLT_2018_cff::track, and bphysicsOniaDQM_cfi::vertex.

◆ associate() [5/5]

TrackDetMatchInfo TrackDetectorAssociator::associate ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const AssociatorParameters parameters,
const FreeTrajectoryState innerState,
const FreeTrajectoryState outerState = nullptr 
)

associate using inner and outer most states of a track in the silicon tracker.

Definition at line 161 of file TrackDetectorAssociator.cc.

165  {
167  if (!parameters.useEcal && !parameters.useCalo && !parameters.useHcal && !parameters.useHO && !parameters.useMuon &&
168  !parameters.usePreshower)
169  throw cms::Exception("ConfigurationError")
170  << "Configuration error! No subdetector was selected for the track association.";
171 
172  SteppingHelixStateInfo trackOrigin(*innerState);
173  info.stateAtIP = *innerState;
174  cachedTrajectory_.setStateAtIP(trackOrigin);
175 
176  init(iSetup);
177  // get track trajectory
178  // ECAL points (EB+EE)
179  // If the phi angle between a track entrance and exit points is more
180  // than 2 crystals, it is possible that the track will cross 3 crystals
181  // and therefore one has to check at least 3 points along the track
182  // trajectory inside ECAL. In order to have a chance to cross 4 crystalls
183  // in the barrel, a track should have P_t as low as 3 GeV or smaller
184  // If it's necessary, number of points along trajectory can be increased
185 
186  info.setCaloGeometry(theCaloGeometry_);
187 
189  // estimate propagation outer boundaries based on
190  // requested sub-detector information. For now limit
191  // propagation region only if muon matching is not
192  // requested.
193  double HOmaxR = hoDetIdAssociator_->volume().maxR();
194  double HOmaxZ = hoDetIdAssociator_->volume().maxZ();
195  double minR = ecalDetIdAssociator_->volume().minR();
198  cachedTrajectory_.setMaxHOLength(HOmaxZ * 2.);
201 
202  if (parameters.useMuon) {
203  double maxR = muonDetIdAssociator_->volume().maxR();
204  double maxZ = muonDetIdAssociator_->volume().maxZ();
207  } else {
210  }
211 
212  // If track extras exist and outerState is before HO maximum, then use outerState
213  if (outerState) {
214  if (outerState->position().perp() < HOmaxR && fabs(outerState->position().z()) < HOmaxZ) {
215  LogTrace("TrackAssociator") << "Using outerState as trackOrigin at Rho=" << outerState->position().perp()
216  << " Z=" << outerState->position().z() << "\n";
217  trackOrigin = SteppingHelixStateInfo(*outerState);
218  } else if (innerState) {
219  LogTrace("TrackAssociator") << "Using innerState as trackOrigin at Rho=" << innerState->position().perp()
220  << " Z=" << innerState->position().z() << "\n";
221  trackOrigin = SteppingHelixStateInfo(*innerState);
222  }
223  }
224 
225  if (trackOrigin.momentum().mag() == 0)
226  return info;
227  if (edm::isNotFinite(trackOrigin.momentum().x()) or edm::isNotFinite(trackOrigin.momentum().y()) or
228  edm::isNotFinite(trackOrigin.momentum().z()))
229  return info;
230  if (!cachedTrajectory_.propagateAll(trackOrigin))
231  return info;
232 
233  // get trajectory in calorimeters
238 
239  info.trkGlobPosAtEcal = getPoint(cachedTrajectory_.getStateAtEcal().position());
240  info.trkGlobPosAtHcal = getPoint(cachedTrajectory_.getStateAtHcal().position());
241  info.trkGlobPosAtHO = getPoint(cachedTrajectory_.getStateAtHO().position());
242 
243  info.trkMomAtEcal = cachedTrajectory_.getStateAtEcal().momentum();
244  info.trkMomAtHcal = cachedTrajectory_.getStateAtHcal().momentum();
245  info.trkMomAtHO = cachedTrajectory_.getStateAtHO().momentum();
246 
247  if (parameters.useEcal)
249  if (parameters.useCalo)
251  if (parameters.useHcal)
253  if (parameters.useHO)
255  if (parameters.usePreshower)
257  if (parameters.useMuon)
259  if (parameters.truthMatch)
261 
262  return info;
263 }

References Exception, HLT_2018_cff::fillCaloTowers, iEvent, info(), init, edm::isNotFinite(), LogTrace, PV3DBase< T, PVType, FrameType >::mag(), CosmicsPD_Skims::maxZ, HLT_2018_cff::minR, CosmicGenFilterHelix_cff::minZ, SteppingHelixStateInfo::momentum(), or, PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ crossedIP()

bool TrackDetectorAssociator::crossedIP ( const reco::Track track)
static

Definition at line 1107 of file TrackDetectorAssociator.cc.

1107  {
1108  bool crossed = true;
1109  crossed &= (track.innerPosition().rho() > 3); // something close to active volume
1110  crossed &= (track.outerPosition().rho() > 3); // something close to active volume
1111  crossed &=
1112  ((track.innerPosition().x() * track.innerMomentum().x() + track.innerPosition().y() * track.innerMomentum().y() <
1113  0) !=
1114  (track.outerPosition().x() * track.outerMomentum().x() + track.outerPosition().y() * track.outerMomentum().y() <
1115  0));
1116  return crossed;
1117 }

References HLT_2018_cff::track.

Referenced by MuonIdProducer::produce().

◆ fillCaloTowers()

void TrackDetectorAssociator::fillCaloTowers ( const edm::Event iEvent,
TrackDetMatchInfo info,
const AssociatorParameters parameters 
)
private

Definition at line 339 of file TrackDetectorAssociator.cc.

341  {
342  // use ECAL and HCAL trajectories to match a tower. (HO isn't used for matching).
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();
348  itr++)
349  trajectory.push_back(itr->position());
350  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = hcalTrajectoryStates.begin();
351  itr != hcalTrajectoryStates.end();
352  itr++)
353  trajectory.push_back(itr->position());
354 
355  if (trajectory.empty()) {
356  LogTrace("TrackAssociator") << "HCAL trajectory is empty; moving on\n";
357  info.isGoodCalo = false;
358  return;
359  }
360  info.isGoodCalo = true;
361 
362  // find crossed CaloTowers
364  iEvent.getByToken(parameters.caloTowersToken, caloTowers);
365  if (!caloTowers.isValid())
366  throw cms::Exception("FatalError") << "Unable to find CaloTowers in event!\n";
367 
368  std::set<DetId> caloTowerIdsInRegion;
369  if (parameters.accountForTrajectoryChangeCalo) {
370  // get trajectory change with respect to initial state
371  DetIdAssociator::MapRange mapRange =
373  caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], mapRange);
374  } else
375  caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], parameters.dRHcalPreselection);
376 
377  LogTrace("TrackAssociator") << "Towers in the region: " << caloTowerIdsInRegion.size();
378 
379  auto caloTowerIdsInAConeBegin = caloTowerIdsInRegion.begin();
380  auto caloTowerIdsInAConeEnd = caloTowerIdsInRegion.end();
381  std::set<DetId> caloTowerIdsInAConeTmp;
383  caloTowerIdsInAConeTmp =
384  caloDetIdAssociator_->getDetIdsInACone(caloTowerIdsInRegion, trajectory, parameters.dRHcal);
385  caloTowerIdsInAConeBegin = caloTowerIdsInAConeTmp.begin();
386  caloTowerIdsInAConeEnd = caloTowerIdsInAConeTmp.end();
387  }
388  LogTrace("TrackAssociator") << "Towers in the cone: "
389  << std::distance(caloTowerIdsInAConeBegin, caloTowerIdsInAConeEnd);
390 
391  info.crossedTowerIds = caloDetIdAssociator_->getCrossedDetIds(caloTowerIdsInRegion, trajectory);
392  const std::vector<DetId>& crossedCaloTowerIds = info.crossedTowerIds;
393  LogTrace("TrackAssociator") << "Towers crossed: " << crossedCaloTowerIds.size();
394 
395  // add CaloTowers
396  for (std::vector<DetId>::const_iterator itr = crossedCaloTowerIds.begin(); itr != crossedCaloTowerIds.end(); itr++) {
397  CaloTowerCollection::const_iterator tower = (*caloTowers).find(*itr);
398  if (tower != (*caloTowers).end())
399  info.crossedTowers.push_back(&*tower);
400  else
401  LogTrace("TrackAssociator") << "Crossed CaloTower is not found for DetId: " << (*itr).rawId();
402  }
403 
404  for (std::set<DetId>::const_iterator itr = caloTowerIdsInAConeBegin; itr != caloTowerIdsInAConeEnd; itr++) {
405  CaloTowerCollection::const_iterator tower = (*caloTowers).find(*itr);
406  if (tower != (*caloTowers).end())
407  info.towers.push_back(&*tower);
408  else
409  LogTrace("TrackAssociator") << "CaloTower from the cone is not found for DetId: " << (*itr).rawId();
410  }
411 }

References eleHcalExtractorBlocks_cff::caloTowers, HLT_2018_cff::distance, iEvent, info(), CachedTrajectory::IpToHcal, LogTrace, and hgcalTowerProducer_cfi::tower.

◆ fillCaloTruth()

void TrackDetectorAssociator::fillCaloTruth ( const edm::Event iEvent,
TrackDetMatchInfo info,
const AssociatorParameters parameters 
)
private

Definition at line 940 of file TrackDetectorAssociator.cc.

942  {
943  // get list of simulated tracks and their vertices
944  using namespace edm;
946  iEvent.getByToken(parameters.simTracksToken, simTracks);
947  if (!simTracks.isValid())
948  throw cms::Exception("FatalError") << "No simulated tracks found\n";
949 
951  iEvent.getByToken(parameters.simVerticesToken, simVertices);
952  if (!simVertices.isValid())
953  throw cms::Exception("FatalError") << "No simulated vertices found\n";
954 
955  // get sim calo hits
956  Handle<PCaloHitContainer> simEcalHitsEB;
957  iEvent.getByToken(parameters.simEcalHitsEBToken, simEcalHitsEB);
958  if (!simEcalHitsEB.isValid())
959  throw cms::Exception("FatalError") << "No simulated ECAL EB hits found\n";
960 
961  Handle<PCaloHitContainer> simEcalHitsEE;
962  iEvent.getByToken(parameters.simEcalHitsEEToken, simEcalHitsEE);
963  if (!simEcalHitsEE.isValid())
964  throw cms::Exception("FatalError") << "No simulated ECAL EE hits found\n";
965 
966  Handle<PCaloHitContainer> simHcalHits;
967  iEvent.getByToken(parameters.simHcalHitsToken, simHcalHits);
968  if (!simHcalHits.isValid())
969  throw cms::Exception("FatalError") << "No simulated HCAL hits found\n";
970 
971  // find truth partner
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());
975  math::XYZVector recoP3(info.stateAtIP.momentum().x(), info.stateAtIP.momentum().y(), info.stateAtIP.momentum().z());
976  if (ROOT::Math::VectorUtil::DeltaR(recoP3, simP3) < 0.1)
977  break;
978  }
979  if (simTrack != simTracks->end()) {
980  info.simTrack = &(*simTrack);
981  double ecalTrueEnergy(0);
982  double hcalTrueEnergy(0);
983 
984  // loop over calo hits
985  for (PCaloHitContainer::const_iterator hit = simEcalHitsEB->begin(); hit != simEcalHitsEB->end(); ++hit)
986  if (hit->geantTrackId() == info.simTrack->genpartIndex())
987  ecalTrueEnergy += hit->energy();
988 
989  for (PCaloHitContainer::const_iterator hit = simEcalHitsEE->begin(); hit != simEcalHitsEE->end(); ++hit)
990  if (hit->geantTrackId() == info.simTrack->genpartIndex())
991  ecalTrueEnergy += hit->energy();
992 
993  for (PCaloHitContainer::const_iterator hit = simHcalHits->begin(); hit != simHcalHits->end(); ++hit)
994  if (hit->geantTrackId() == info.simTrack->genpartIndex())
995  hcalTrueEnergy += hit->energy();
996 
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;
1004  }
1005 }

References electronAnalyzer_cfi::DeltaR, iEvent, info(), edm::HandleBase::isValid(), muonSimHitMatcherPSet::simTrack, TrackCandidateProducer_cfi::simTracks, and HGCalValidator_cfi::simVertices.

◆ fillEcal()

void TrackDetectorAssociator::fillEcal ( const edm::Event iEvent,
TrackDetMatchInfo info,
const AssociatorParameters parameters 
)
private

Definition at line 265 of file TrackDetectorAssociator.cc.

267  {
268  const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getEcalTrajectory();
269 
270  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
271  itr != trajectoryStates.end();
272  itr++)
273  LogTrace("TrackAssociator") << "ECAL trajectory point (rho, z, phi): " << itr->position().perp() << ", "
274  << itr->position().z() << ", " << itr->position().phi();
275 
276  std::vector<GlobalPoint> coreTrajectory;
277  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
278  itr != trajectoryStates.end();
279  itr++)
280  coreTrajectory.push_back(itr->position());
281 
282  if (coreTrajectory.empty()) {
283  LogTrace("TrackAssociator") << "ECAL track trajectory is empty; moving on\n";
284  info.isGoodEcal = false;
285  return;
286  }
287  info.isGoodEcal = true;
288 
289  // Find ECAL crystals
291  iEvent.getByToken(parameters.EBRecHitsToken, EBRecHits);
292  if (!EBRecHits.isValid())
293  throw cms::Exception("FatalError") << "Unable to find EBRecHitCollection in the event!\n";
294 
296  iEvent.getByToken(parameters.EERecHitsToken, EERecHits);
297  if (!EERecHits.isValid())
298  throw cms::Exception("FatalError") << "Unable to find EERecHitCollection in event!\n";
299 
300  std::set<DetId> ecalIdsInRegion;
301  if (parameters.accountForTrajectoryChangeCalo) {
302  // get trajectory change with respect to initial state
303  DetIdAssociator::MapRange mapRange =
305  ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
306  } else
307  ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.dREcalPreselection);
308  LogTrace("TrackAssociator") << "ECAL hits in the region: " << ecalIdsInRegion.size();
309  if (parameters.dREcalPreselection > parameters.dREcal)
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();
315 
316  // add EcalRecHits
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);
324  else
325  LogTrace("TrackAssociator") << "Crossed EcalRecHit is not found for DetId: " << itr->rawId();
326  }
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);
334  else
335  LogTrace("TrackAssociator") << "EcalRecHit from the cone is not found for DetId: " << itr->rawId();
336  }
337 }

References filterRecHits_cfi::EBRecHits, filterRecHits_cfi::EERecHits, iEvent, info(), CachedTrajectory::IpToEcal, and LogTrace.

◆ fillHcal()

void TrackDetectorAssociator::fillHcal ( const edm::Event iEvent,
TrackDetMatchInfo info,
const AssociatorParameters parameters 
)
private

Definition at line 436 of file TrackDetectorAssociator.cc.

438  {
439  const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHcalTrajectory();
440 
441  std::vector<GlobalPoint> coreTrajectory;
442  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
443  itr != trajectoryStates.end();
444  itr++)
445  coreTrajectory.push_back(itr->position());
446 
447  if (coreTrajectory.empty()) {
448  LogTrace("TrackAssociator") << "HCAL trajectory is empty; moving on\n";
449  info.isGoodHcal = false;
450  return;
451  }
452  info.isGoodHcal = true;
453 
454  // find crossed Hcals
456  iEvent.getByToken(parameters.HBHEcollToken, collection);
457  if (!collection.isValid())
458  throw cms::Exception("FatalError") << "Unable to find HBHERecHits in event!\n";
459 
460  std::set<DetId> idsInRegion;
461  if (parameters.accountForTrajectoryChangeCalo) {
462  // get trajectory change with respect to initial state
463  DetIdAssociator::MapRange mapRange =
465  idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
466  } else
467  idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.dRHcalPreselection);
468 
469  LogTrace("TrackAssociator") << "HCAL hits in the region: " << idsInRegion.size() << "\n"
470  << DetIdInfo::info(idsInRegion, nullptr);
471 
472  auto idsInAConeBegin = idsInRegion.begin();
473  auto idsInAConeEnd = idsInRegion.end();
474  std::set<DetId> idsInAConeTmp;
476  idsInAConeTmp = hcalDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.dRHcal);
477  idsInAConeBegin = idsInAConeTmp.begin();
478  idsInAConeEnd = idsInAConeTmp.end();
479  }
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"
485  << DetIdInfo::info(crossedIds, nullptr);
486 
487  // add Hcal
488  for (std::vector<DetId>::const_iterator itr = crossedIds.begin(); itr != crossedIds.end(); itr++) {
489  HBHERecHitCollection::const_iterator hit = (*collection).find(*itr);
490  if (hit != (*collection).end())
491  info.crossedHcalRecHits.push_back(&*hit);
492  else
493  LogTrace("TrackAssociator") << "Crossed HBHERecHit is not found for DetId: " << itr->rawId();
494  }
495  for (std::set<DetId>::const_iterator itr = idsInAConeBegin; itr != idsInAConeEnd; itr++) {
496  HBHERecHitCollection::const_iterator hit = (*collection).find(*itr);
497  if (hit != (*collection).end())
498  info.hcalRecHits.push_back(&*hit);
499  else
500  LogTrace("TrackAssociator") << "HBHERecHit from the cone is not found for DetId: " << itr->rawId();
501  }
502 }

References universalConfigTemplate::collection, HLT_2018_cff::distance, iEvent, DetIdInfo::info(), info(), CachedTrajectory::IpToHcal, and LogTrace.

◆ fillHO()

void TrackDetectorAssociator::fillHO ( const edm::Event iEvent,
TrackDetMatchInfo info,
const AssociatorParameters parameters 
)
private

Definition at line 504 of file TrackDetectorAssociator.cc.

506  {
507  const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHOTrajectory();
508 
509  std::vector<GlobalPoint> coreTrajectory;
510  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
511  itr != trajectoryStates.end();
512  itr++)
513  coreTrajectory.push_back(itr->position());
514 
515  if (coreTrajectory.empty()) {
516  LogTrace("TrackAssociator") << "HO trajectory is empty; moving on\n";
517  info.isGoodHO = false;
518  return;
519  }
520  info.isGoodHO = true;
521 
522  // find crossed HOs
524  iEvent.getByToken(parameters.HOcollToken, collection);
525  if (!collection.isValid())
526  throw cms::Exception("FatalError") << "Unable to find HORecHits in event!\n";
527 
528  std::set<DetId> idsInRegion;
529  if (parameters.accountForTrajectoryChangeCalo) {
530  // get trajectory change with respect to initial state
531  DetIdAssociator::MapRange mapRange =
533  idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
534  } else
535  idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.dRHcalPreselection);
536 
537  LogTrace("TrackAssociator") << "idsInRegion.size(): " << idsInRegion.size();
538 
539  auto idsInAConeBegin = idsInRegion.begin();
540  auto idsInAConeEnd = idsInRegion.end();
541  std::set<DetId> idsInAConeTmp;
543  idsInAConeTmp = hoDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.dRHcal);
544  idsInAConeBegin = idsInAConeTmp.begin();
545  idsInAConeEnd = idsInAConeTmp.end();
546  }
547  LogTrace("TrackAssociator") << "idsInACone.size(): " << std::distance(idsInAConeBegin, idsInAConeEnd);
548  info.crossedHOIds = hoDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
549  const std::vector<DetId>& crossedIds = info.crossedHOIds;
550 
551  // add HO
552  for (std::vector<DetId>::const_iterator itr = crossedIds.begin(); itr != crossedIds.end(); itr++) {
553  HORecHitCollection::const_iterator hit = (*collection).find(*itr);
554  if (hit != (*collection).end())
555  info.crossedHORecHits.push_back(&*hit);
556  else
557  LogTrace("TrackAssociator") << "Crossed HORecHit is not found for DetId: " << itr->rawId();
558  }
559 
560  for (std::set<DetId>::const_iterator itr = idsInAConeBegin; itr != idsInAConeEnd; itr++) {
561  HORecHitCollection::const_iterator hit = (*collection).find(*itr);
562  if (hit != (*collection).end())
563  info.hoRecHits.push_back(&*hit);
564  else
565  LogTrace("TrackAssociator") << "HORecHit from the cone is not found for DetId: " << itr->rawId();
566  }
567 }

References universalConfigTemplate::collection, HLT_2018_cff::distance, iEvent, info(), CachedTrajectory::IpToHO, and LogTrace.

◆ fillMuon()

void TrackDetectorAssociator::fillMuon ( const edm::Event iEvent,
TrackDetMatchInfo info,
const AssociatorParameters parameters 
)
private

Definition at line 745 of file TrackDetectorAssociator.cc.

747  {
748  // Get the segments from the event
750  iEvent.getByToken(parameters.dtSegmentsToken, dtSegments);
751  if (!dtSegments.isValid())
752  throw cms::Exception("FatalError") << "Unable to find DTRecSegment4DCollection in event!\n";
753 
755  iEvent.getByToken(parameters.cscSegmentsToken, cscSegments);
756  if (!cscSegments.isValid())
757  throw cms::Exception("FatalError") << "Unable to find CSCSegmentCollection in event!\n";
758 
760  if (parameters.useGEM)
761  iEvent.getByToken(parameters.gemSegmentsToken, gemSegments);
763  if (parameters.useME0)
764  iEvent.getByToken(parameters.me0SegmentsToken, me0Segments);
765 
767 
768  // check the map of available segments
769  // if there is no segments in a given direction at all,
770  // then there is no point to fly there.
771  //
772  // MISSING
773  // Possible solution: quick search for presence of segments
774  // for the set of DetIds
775 
776  // get a set of matches corresponding to muon chambers
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";
781 
782  // Iterate over all chamber matches and fill segment matching
783  // info if it's available
784  for (std::vector<TAMuonChamberMatch>::iterator matchedChamber = matchedChambers.begin();
785  matchedChamber != matchedChambers.end();
786  matchedChamber++) {
787  const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet((*matchedChamber).id);
788  // DT chamber
789  if (const DTChamber* chamber = dynamic_cast<const DTChamber*>(geomDet)) {
790  // Get the range for the corresponding segments
791  DTRecSegment4DCollection::range range = dtSegments->get(chamber->id());
792  // Loop over the segments of this chamber
793  for (DTRecSegment4DCollection::const_iterator segment = range.first; segment != range.second; segment++) {
794  if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
795  matchedChamber->segments.back().dtSegmentRef = DTRecSegment4DRef(dtSegments, segment - dtSegments->begin());
796  }
797  }
798  }
799  // CSC Chamber
800  else if (const CSCChamber* chamber = dynamic_cast<const CSCChamber*>(geomDet)) {
801  // Get the range for the corresponding segments
803  // Loop over the segments
804  for (CSCSegmentCollection::const_iterator segment = range.first; segment != range.second; segment++) {
805  if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
806  matchedChamber->segments.back().cscSegmentRef = CSCSegmentRef(cscSegments, segment - cscSegments->begin());
807  }
808  }
809  } else {
810  // GEM Chamber
811  if (parameters.useGEM) {
812  if (const GEMSuperChamber* chamber = dynamic_cast<const GEMSuperChamber*>(geomDet)) {
813  // Get the range for the corresponding segments
815  // Loop over the segments
816  for (GEMSegmentCollection::const_iterator segment = range.first; segment != range.second; segment++) {
817  if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
818  matchedChamber->segments.back().gemSegmentRef =
819  GEMSegmentRef(gemSegments, segment - gemSegments->begin());
820  }
821  }
822  }
823  }
824  // ME0 Chamber
825  if (parameters.useME0) {
826  if (const ME0Chamber* chamber = dynamic_cast<const ME0Chamber*>(geomDet)) {
827  // Get the range for the corresponding segments
829  // Loop over the segments
830  for (ME0SegmentCollection::const_iterator segment = range.first; segment != range.second; segment++) {
831  if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
832  matchedChamber->segments.back().me0SegmentRef =
833  ME0SegmentRef(me0Segments, segment - me0Segments->begin());
834  }
835  }
836  }
837  }
838  }
839  info.chambers.push_back(*matchedChamber);
840  }
841 }

References relativeConstraints::chamber, dtChamberEfficiency_cfi::cscSegments, gemSegments_cfi::gemSegments, iEvent, info(), edm::HandleBase::isValid(), LogTrace, me0Segments_cfi::me0Segments, and FastTimerService_cff::range.

◆ fillPreshower()

void TrackDetectorAssociator::fillPreshower ( const edm::Event iEvent,
TrackDetMatchInfo info,
const AssociatorParameters parameters 
)
private

Definition at line 413 of file TrackDetectorAssociator.cc.

415  {
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();
420  itr++)
421  trajectory.push_back(itr->position());
422 
423  if (trajectory.empty()) {
424  LogTrace("TrackAssociator") << "Preshower trajectory is empty; moving on\n";
425  return;
426  }
427 
428  std::set<DetId> idsInRegion =
429  preshowerDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], parameters.dRPreshowerPreselection);
430 
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();
434 }

References info(), and LogTrace.

◆ getCachedTrajector()

const CachedTrajectory& TrackDetectorAssociator::getCachedTrajector ( ) const
inline

trajector information

Definition at line 98 of file TrackDetectorAssociator.h.

98 { return cachedTrajectory_; }

References cachedTrajectory_.

◆ getFreeTrajectoryState() [1/3]

FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState ( const edm::EventSetup iSetup,
const GlobalVector momentum,
const GlobalPoint vertex,
const int  charge 
)
static

Definition at line 583 of file TrackDetectorAssociator.cc.

586  {
589 
590  GlobalTrajectoryParameters tPars(vertex, momentum, charge, &*bField);
591 
592  ROOT::Math::SMatrixIdentity id;
593  AlgebraicSymMatrix66 covT(id);
594  covT *= 1e-6; // initialize to sigma=1e-3
595  CartesianTrajectoryError tCov(covT);
596 
597  return FreeTrajectoryState(tPars, tCov);
598 }

References Calorimetry_cff::bField, ALCARECOTkAlJpsiMuMu_cff::charge, MillePedeFileConverter_cfg::e, reco::get(), edm::EventSetup::get(), triggerObjects_cff::id, and bphysicsOniaDQM_cfi::vertex.

◆ getFreeTrajectoryState() [2/3]

FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState ( const edm::EventSetup iSetup,
const reco::Track track 
)
static

get FreeTrajectoryState from different track representations

Definition at line 600 of file TrackDetectorAssociator.cc.

601  {
604 
605  GlobalVector vector(track.momentum().x(), track.momentum().y(), track.momentum().z());
606 
607  GlobalPoint point(track.vertex().x(), track.vertex().y(), track.vertex().z());
608 
609  GlobalTrajectoryParameters tPars(point, vector, track.charge(), &*bField);
610 
611  // FIX THIS !!!
612  // need to convert from perigee to global or helix (curvilinear) frame
613  // for now just an arbitrary matrix.
614  ROOT::Math::SMatrixIdentity id;
615  AlgebraicSymMatrix66 covT(id);
616  covT *= 1e-6; // initialize to sigma=1e-3
617  CartesianTrajectoryError tCov(covT);
618 
619  return FreeTrajectoryState(tPars, tCov);
620 }

References Calorimetry_cff::bField, MillePedeFileConverter_cfg::e, reco::get(), edm::EventSetup::get(), triggerObjects_cff::id, point, and HLT_2018_cff::track.

Referenced by BetaCalculatorECAL::addInfoToCandidate(), EopTreeWriter::analyze(), cms::MuonMETValueMapProducer::determine_deltax_deltay(), and InterestingTrackEcalDetIdProducer::produce().

◆ getFreeTrajectoryState() [3/3]

FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState ( const edm::EventSetup iSetup,
const SimTrack track,
const SimVertex vertex 
)
static

Definition at line 569 of file TrackDetectorAssociator.cc.

571  {
572  GlobalVector vector(track.momentum().x(), track.momentum().y(), track.momentum().z());
573  GlobalPoint point(vertex.position().x(), vertex.position().y(), vertex.position().z());
574 
575  int charge = track.type() > 0 ? -1 : 1; // lepton convention
576  if (abs(track.type()) == 211 || // pion
577  abs(track.type()) == 321 || // kaon
578  abs(track.type()) == 2212)
579  charge = track.type() < 0 ? -1 : 1;
580  return getFreeTrajectoryState(iSetup, vector, point, charge);
581 }

References funct::abs(), ALCARECOTkAlJpsiMuMu_cff::charge, point, HLT_2018_cff::track, and bphysicsOniaDQM_cfi::vertex.

◆ getMapRange()

DetIdAssociator::MapRange TrackDetectorAssociator::getMapRange ( const std::pair< float, float > &  delta,
const float  dR 
)
private

Definition at line 622 of file TrackDetectorAssociator.cc.

622  {
623  DetIdAssociator::MapRange mapRange;
624  mapRange.dThetaPlus = dR;
625  mapRange.dThetaMinus = dR;
626  mapRange.dPhiPlus = dR;
627  mapRange.dPhiMinus = dR;
628  if (delta.first > 0)
629  mapRange.dThetaPlus += delta.first;
630  else
631  mapRange.dThetaMinus += fabs(delta.first);
632  if (delta.second > 0)
633  mapRange.dPhiPlus += delta.second;
634  else
635  mapRange.dPhiMinus += fabs(delta.second);
636  LogTrace("TrackAssociator") << "Selection range: (dThetaPlus, dThetaMinus, dPhiPlus, dPhiMinus, dRPreselection): "
637  << mapRange.dThetaPlus << ", " << mapRange.dThetaMinus << ", " << mapRange.dPhiPlus
638  << ", " << mapRange.dPhiMinus << ", " << dR;
639  return mapRange;
640 }

References dumpMFGeometry_cfg::delta, DetIdAssociator::MapRange::dPhiMinus, DetIdAssociator::MapRange::dPhiPlus, HGC3DClusterGenMatchSelector_cfi::dR, DetIdAssociator::MapRange::dThetaMinus, DetIdAssociator::MapRange::dThetaPlus, and LogTrace.

◆ getPoint() [1/2]

math::XYZPoint TrackDetectorAssociator::getPoint ( const GlobalPoint point)
inlineprivate

Definition at line 140 of file TrackDetectorAssociator.h.

140  {
141  return math::XYZPoint(point.x(), point.y(), point.z());
142  }

References point.

◆ getPoint() [2/2]

math::XYZPoint TrackDetectorAssociator::getPoint ( const LocalPoint point)
inlineprivate

Definition at line 144 of file TrackDetectorAssociator.h.

144  {
145  return math::XYZPoint(point.x(), point.y(), point.z());
146  }

References point.

◆ getTAMuonChamberMatches()

void TrackDetectorAssociator::getTAMuonChamberMatches ( std::vector< TAMuonChamberMatch > &  matches,
const AssociatorParameters parameters 
)
private

Definition at line 642 of file TrackDetectorAssociator.cc.

643  {
644  // Strategy:
645  // Propagate through the whole detector, estimate change in eta and phi
646  // along the trajectory, add this to dRMuon and find DetIds around this
647  // direction using the map. Then propagate fast to each surface and apply
648  // final matching criteria.
649 
650  // get the direction first
652  // If trajectory point at HCAL is not valid, try to use the outer most state of the
653  // trajectory instead.
654  if (!trajectoryPoint.isValid())
655  trajectoryPoint = cachedTrajectory_.getOuterState();
656  if (!trajectoryPoint.isValid()) {
657  LogTrace("TrackAssociator")
658  << "trajectory position at HCAL is not valid. Assume the track cannot reach muon detectors and skip it";
659  return;
660  }
661 
662  GlobalVector direction = trajectoryPoint.momentum().unit();
663  LogTrace("TrackAssociator") << "muon direction: " << direction
664  << "\n\t and corresponding point: " << trajectoryPoint.position() << "\n";
665 
666  DetIdAssociator::MapRange mapRange =
668 
669  // and find chamber DetIds
670 
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);
675  TrajectoryStateOnSurface stateOnSurface = cachedTrajectory_.propagate(&geomDet->surface());
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";
679  continue;
680  }
681  LocalPoint localPoint = geomDet->surface().toLocal(stateOnSurface.freeState()->position());
682  LocalError localError = stateOnSurface.localError().positionError();
683  float distanceX = 0;
684  float distanceY = 0;
685  float sigmaX = 0.0;
686  float sigmaY = 0.0;
687  if (const CSCChamber* cscChamber = dynamic_cast<const CSCChamber*>(geomDet)) {
688  const CSCChamberSpecs* chamberSpecs = cscChamber->specs();
689  if (!chamberSpecs) {
690  LogTrace("TrackAssociator") << "Failed to get CSCChamberSpecs from CSCChamber; moving on\n";
691  continue;
692  }
693  const CSCLayerGeometry* layerGeometry = chamberSpecs->oddLayerGeometry(1);
694  if (!layerGeometry) {
695  LogTrace("TrackAssociator") << "Failed to get CSCLayerGeometry from CSCChamberSpecs; moving on\n";
696  continue;
697  }
698  const CSCWireTopology* wireTopology = layerGeometry->wireTopology();
699  if (!wireTopology) {
700  LogTrace("TrackAssociator") << "Failed to get CSCWireTopology from CSCLayerGeometry; moving on\n";
701  continue;
702  }
703 
704  float wideWidth = wireTopology->wideWidthOfPlane();
705  float narrowWidth = wireTopology->narrowWidthOfPlane();
706  float length = wireTopology->lengthOfPlane();
707  // If slanted, there is no y offset between local origin and symmetry center of wire plane
708  float yOfFirstWire = fabs(wireTopology->wireAngle()) > 1.E-06 ? -0.5 * length : wireTopology->yOfWire(1);
709  // y offset between local origin and symmetry center of wire plane
710  float yCOWPOffset = yOfFirstWire + 0.5 * length;
711 
712  // tangent of the incline angle from inside the trapezoid
713  float tangent = (wideWidth - narrowWidth) / (2. * length);
714  // y position wrt bottom of trapezoid
715  float yPrime = localPoint.y() + fabs(yOfFirstWire);
716  // half trapezoid width at y' is 0.5 * narrowWidth + x side of triangle with the above tangent and side y'
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());
722  } else {
723  distanceX = fabs(localPoint.x()) - geomDet->surface().bounds().width() / 2.;
724  distanceY = fabs(localPoint.y()) - geomDet->surface().bounds().length() / 2.;
725  sigmaX = distanceX / sqrt(localError.xx());
726  sigmaY = distanceY / sqrt(localError.yy());
727  }
728  if ((distanceX < parameters.muonMaxDistanceX && distanceY < parameters.muonMaxDistanceY) ||
729  (sigmaX < parameters.muonMaxDistanceSigmaX && sigmaY < parameters.muonMaxDistanceSigmaY)) {
730  LogTrace("TrackAssociator") << "found a match: " << DetIdInfo::info(*detId, nullptr) << "\n";
732  match.tState = stateOnSurface;
733  match.localDistanceX = distanceX;
734  match.localDistanceY = distanceY;
735  match.id = *detId;
736  matches.push_back(match);
737  } else {
738  LogTrace("TrackAssociator") << "chamber is too far: " << DetIdInfo::info(*detId, nullptr)
739  << "\n\tdistanceX: " << distanceX << "\t distanceY: " << distanceY
740  << "\t sigmaX: " << sigmaX << "\t sigmaY: " << sigmaY << "\n";
741  }
742  }
743 }

References Surface::bounds(), TrajectoryStateOnSurface::freeState(), CachedTrajectory::FullTrajectory, DetIdInfo::info(), TrajectoryStateOnSurface::isValid(), SteppingHelixStateInfo::isValid(), Bounds::length(), CSCWireTopology::lengthOfPlane(), TrajectoryStateOnSurface::localError(), LogTrace, match(), patCandidatesForDimuonsSequences_cff::matches, SteppingHelixStateInfo::momentum(), CSCWireTopology::narrowWidthOfPlane(), CSCChamberSpecs::oddLayerGeometry(), SteppingHelixStateInfo::position(), FreeTrajectoryState::position(), LocalTrajectoryError::positionError(), fftjetvertexadder_cfi::sigmaX, fftjetvertexadder_cfi::sigmaY, mathSSE::sqrt(), GeomDet::surface(), GloballyPositioned< T >::toLocal(), Vector3DBase< T, FrameTag >::unit(), CSCWireTopology::wideWidthOfPlane(), Bounds::width(), CSCWireTopology::wireAngle(), CSCLayerGeometry::wireTopology(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), CSCWireTopology::yOfWire(), and LocalError::yy().

◆ getVector() [1/2]

math::XYZVector TrackDetectorAssociator::getVector ( const GlobalVector vec)
inlineprivate

Definition at line 148 of file TrackDetectorAssociator.h.

148 { return math::XYZVector(vec.x(), vec.y(), vec.z()); }

◆ getVector() [2/2]

math::XYZVector TrackDetectorAssociator::getVector ( const LocalVector vec)
inlineprivate

Definition at line 150 of file TrackDetectorAssociator.h.

150 { return math::XYZVector(vec.x(), vec.y(), vec.z()); }

◆ init()

void TrackDetectorAssociator::init ( const edm::EventSetup iSetup)
private

Definition at line 122 of file TrackDetectorAssociator.cc.

122  {
123  // access the calorimeter geometry
125  if (!theCaloGeometry_.isValid())
126  throw cms::Exception("FatalError") << "Unable to find CaloGeometryRecord in event!\n";
127 
128  // get the tracking Geometry
131  throw cms::Exception("FatalError") << "Unable to find GlobalTrackingGeometryRecord in event!\n";
132 
134  // setup propagator
137 
139  prop->setMaterialMode(false);
140  prop->applyRadX0Correction(true);
141  // prop->setDebug(true); // tmp
142  defProp_ = prop;
144  }
145 
146  iSetup.get<DetIdAssociatorRecord>().get("EcalDetIdAssociator", ecalDetIdAssociator_);
147  iSetup.get<DetIdAssociatorRecord>().get("HcalDetIdAssociator", hcalDetIdAssociator_);
148  iSetup.get<DetIdAssociatorRecord>().get("HODetIdAssociator", hoDetIdAssociator_);
149  iSetup.get<DetIdAssociatorRecord>().get("CaloDetIdAssociator", caloDetIdAssociator_);
150  iSetup.get<DetIdAssociatorRecord>().get("MuonDetIdAssociator", muonDetIdAssociator_);
151  iSetup.get<DetIdAssociatorRecord>().get("PreshowerDetIdAssociator", preshowerDetIdAssociator_);
152 }

References anyDirection, SteppingHelixPropagator::applyRadX0Correction(), Calorimetry_cff::bField, reco::get(), edm::EventSetup::get(), SteppingHelixPropagator::setMaterialMode(), and SteppingHelixPropagator_cfi::SteppingHelixPropagator.

◆ setPropagator()

void TrackDetectorAssociator::setPropagator ( const Propagator ptr)

use a user configured propagator

Definition at line 115 of file TrackDetectorAssociator.cc.

115  {
116  ivProp_ = ptr;
118 }

Referenced by muonisolation::JetExtractor::deposit(), muonisolation::CaloExtractorByAssociator::deposits(), and MuonIdProducer::init().

◆ useDefaultPropagator()

void TrackDetectorAssociator::useDefaultPropagator ( )

Member Data Documentation

◆ cachedTrajectory_

CachedTrajectory TrackDetectorAssociator::cachedTrajectory_
private

Definition at line 154 of file TrackDetectorAssociator.h.

Referenced by getCachedTrajector().

◆ caloDetIdAssociator_

edm::ESHandle<DetIdAssociator> TrackDetectorAssociator::caloDetIdAssociator_
private

Definition at line 160 of file TrackDetectorAssociator.h.

◆ defProp_

Propagator* TrackDetectorAssociator::defProp_
private

Definition at line 153 of file TrackDetectorAssociator.h.

◆ ecalDetIdAssociator_

edm::ESHandle<DetIdAssociator> TrackDetectorAssociator::ecalDetIdAssociator_
private

Definition at line 157 of file TrackDetectorAssociator.h.

◆ hcalDetIdAssociator_

edm::ESHandle<DetIdAssociator> TrackDetectorAssociator::hcalDetIdAssociator_
private

Definition at line 158 of file TrackDetectorAssociator.h.

◆ hoDetIdAssociator_

edm::ESHandle<DetIdAssociator> TrackDetectorAssociator::hoDetIdAssociator_
private

Definition at line 159 of file TrackDetectorAssociator.h.

◆ ivProp_

const Propagator* TrackDetectorAssociator::ivProp_
private

Definition at line 152 of file TrackDetectorAssociator.h.

◆ muonDetIdAssociator_

edm::ESHandle<DetIdAssociator> TrackDetectorAssociator::muonDetIdAssociator_
private

Definition at line 161 of file TrackDetectorAssociator.h.

◆ preshowerDetIdAssociator_

edm::ESHandle<DetIdAssociator> TrackDetectorAssociator::preshowerDetIdAssociator_
private

Definition at line 162 of file TrackDetectorAssociator.h.

◆ theCaloGeometry_

edm::ESHandle<CaloGeometry> TrackDetectorAssociator::theCaloGeometry_
private

Definition at line 164 of file TrackDetectorAssociator.h.

◆ theMagneticFeildWatcher_

edm::ESWatcher<IdealMagneticFieldRecord> TrackDetectorAssociator::theMagneticFeildWatcher_
private

Definition at line 167 of file TrackDetectorAssociator.h.

◆ theTrackingGeometry_

edm::ESHandle<GlobalTrackingGeometry> TrackDetectorAssociator::theTrackingGeometry_
private

Definition at line 165 of file TrackDetectorAssociator.h.

◆ useDefaultPropagator_

bool TrackDetectorAssociator::useDefaultPropagator_
private

Definition at line 155 of file TrackDetectorAssociator.h.

Vector3DBase
Definition: Vector3DBase.h:8
DTRecSegment2D::ist0Valid
bool ist0Valid() const
Definition: DTRecSegment2D.h:115
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
SteppingHelixStateInfo::momentum
GlobalVector momentum() const
Definition: SteppingHelixStateInfo.h:60
DetIdAssociator::volume
const FiducialVolume & volume() const
get active detector volume
Definition: DetIdAssociator.cc:352
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
TrackDetectorAssociator::crossedIP
static bool crossedIP(const reco::Track &track)
Definition: TrackDetectorAssociator.cc:1107
DTRecSegment4D
Definition: DTRecSegment4D.h:23
TrackDetectorAssociator::Any
Definition: TrackDetectorAssociator.h:55
anyDirection
Definition: PropagationDirection.h:4
edm::SortedCollection< CaloTower >::const_iterator
std::vector< CaloTower >::const_iterator const_iterator
Definition: SortedCollection.h:80
Bounds::width
virtual float width() const =0
SteppingHelixStateInfo::position
GlobalPoint position() const
Definition: SteppingHelixStateInfo.h:59
trajectoryStateTransform::outerFreeState
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:98
GeomDet
Definition: GeomDet.h:27
trajectoryStateTransform::initialFreeState
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:58
CSCWireTopology::wireAngle
float wireAngle() const override
Definition: CSCWireTopology.h:70
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
TAMuonSegmentMatch::segmentLocalErrorYDyDz
float segmentLocalErrorYDyDz
Definition: TAMuonSegmentMatch.h:22
HLT_2018_cff.minR
minR
Definition: HLT_2018_cff.py:83154
DTRecSegment2D::t0
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
Definition: DTRecSegment2D.h:114
GEMSuperChamber
Definition: GEMSuperChamber.h:19
LocalTrajectoryError::positionError
LocalError positionError() const
Definition: LocalTrajectoryError.h:81
LocalError::xy
float xy() const
Definition: LocalError.h:23
CachedTrajectory::getPropagationStep
float getPropagationStep() const
Definition: CachedTrajectory.h:121
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CachedTrajectory::setMaxDetectorRadius
void setMaxDetectorRadius(float r=800.)
Definition: CachedTrajectory.h:113
TrackDetectorAssociator::defProp_
Propagator * defProp_
Definition: TrackDetectorAssociator.h:153
CachedTrajectory::setMinDetectorLength
void setMinDetectorLength(float l=0.)
Definition: CachedTrajectory.h:118
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
CachedTrajectory::setMinDetectorRadius
void setMinDetectorRadius(float r=0.)
Definition: CachedTrajectory.h:117
DetIdAssociator::MapRange::dThetaPlus
float dThetaPlus
Definition: DetIdAssociator.h:49
CSCChamberSpecs
Definition: CSCChamberSpecs.h:39
CachedTrajectory::findPreshowerTrajectory
void findPreshowerTrajectory(const FiducialVolume &)
Definition: CachedTrajectory.cc:449
DTChamber
Definition: DTChamber.h:24
TrackDetectorAssociator::getVector
math::XYZVector getVector(const GlobalVector &vec)
Definition: TrackDetectorAssociator.h:148
FiducialVolume::minR
double minR(bool withTolerance=true) const
Definition: FiducialVolume.h:37
DetIdAssociator::MapRange::dPhiPlus
float dPhiPlus
Definition: DetIdAssociator.h:51
CSCWireTopology::lengthOfPlane
double lengthOfPlane() const
Definition: CSCWireTopology.h:96
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
DetIdAssociator::selectAllInACone
virtual bool selectAllInACone(const double dR) const
helper to see if getDetIdsInACone is useful
Definition: DetIdAssociator.h:82
CachedTrajectory::FullTrajectory
Definition: CachedTrajectory.h:64
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
TrackDetectorAssociator::addTAMuonSegmentMatch
bool addTAMuonSegmentMatch(TAMuonChamberMatch &, const RecSegment *, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:843
TrackDetectorAssociator::fillCaloTruth
void fillCaloTruth(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:940
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
SteppingHelixPropagator_cfi.SteppingHelixPropagator
SteppingHelixPropagator
Definition: SteppingHelixPropagator_cfi.py:3
dtChamberEfficiency_cfi.cscSegments
cscSegments
Definition: dtChamberEfficiency_cfi.py:15
CachedTrajectory::getOuterState
SteppingHelixStateInfo getOuterState()
Definition: CachedTrajectory.cc:605
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
gemSegments_cfi.gemSegments
gemSegments
Definition: gemSegments_cfi.py:3
DetIdAssociator::MapRange::dThetaMinus
float dThetaMinus
Definition: DetIdAssociator.h:50
TAMuonSegmentMatch::hasPhi
bool hasPhi
Definition: TAMuonSegmentMatch.h:25
edm::Handle
Definition: AssociativeIterator.h:50
TrackingRecHit::localPosition
virtual LocalPoint localPosition() const =0
filterRecHits_cfi.EERecHits
EERecHits
Definition: filterRecHits_cfi.py:9
CachedTrajectory::IpToEcal
Definition: CachedTrajectory.h:64
CachedTrajectory::setPropagationStep
void setPropagationStep(float s=20.)
Definition: CachedTrajectory.h:120
TrackDetectorAssociator::fillHcal
void fillHcal(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:436
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
CSCSegmentRef
edm::Ref< CSCSegmentCollection > CSCSegmentRef
Definition: CSCSegmentCollection.h:21
CachedTrajectory::setMaxDetectorLength
void setMaxDetectorLength(float l=2200.)
Definition: CachedTrajectory.h:114
Bounds::length
virtual float length() const =0
TrackDetectorAssociator::fillCaloTowers
void fillCaloTowers(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:339
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
CSCWireTopology::narrowWidthOfPlane
double narrowWidthOfPlane() const
Definition: CSCWireTopology.h:86
CachedTrajectory::findHcalTrajectory
void findHcalTrajectory(const FiducialVolume &)
Definition: CachedTrajectory.cc:461
CosmicsPD_Skims.maxZ
maxZ
Definition: CosmicsPD_Skims.py:136
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
TrackDetectorAssociator::getFreeTrajectoryState
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
Definition: TrackDetectorAssociator.cc:600
DetIdAssociator::getDetIdsInACone
virtual std::set< DetId > getDetIdsInACone(const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory, const double dR) const
Definition: DetIdAssociator.cc:273
CachedTrajectory::setMaxHOLength
void setMaxHOLength(float l=2200.)
Definition: CachedTrajectory.h:116
DetIdAssociator::getCrossedDetIds
virtual std::vector< DetId > getCrossedDetIds(const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory) const
Definition: DetIdAssociator.cc:290
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
TAMuonSegmentMatch::segmentLocalErrorXDxDz
float segmentLocalErrorXDxDz
Definition: TAMuonSegmentMatch.h:21
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
TrackDetectorAssociator::theMagneticFeildWatcher_
edm::ESWatcher< IdealMagneticFieldRecord > theMagneticFeildWatcher_
Definition: TrackDetectorAssociator.h:167
SteppingHelixPropagator
Definition: SteppingHelixPropagator.h:36
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
TrajectoryStateOnSurface::freeState
FreeTrajectoryState const * freeState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:58
CachedTrajectory::getStateAtHO
SteppingHelixStateInfo getStateAtHO()
Definition: CachedTrajectory.cc:591
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackDetectorAssociator::ivProp_
const Propagator * ivProp_
Definition: TrackDetectorAssociator.h:152
TrackDetectorAssociator::theCaloGeometry_
edm::ESHandle< CaloGeometry > theCaloGeometry_
Definition: TrackDetectorAssociator.h:164
DetIdInfo::info
static std::string info(const DetId &, const TrackerTopology *tTopo)
Definition: DetIdInfo.cc:25
CachedTrajectory::propagateAll
bool propagateAll(const SteppingHelixStateInfo &initialState)
propagate through the whole detector, returns true if successful
Definition: CachedTrajectory.cc:115
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
FrontierCondition_GT_autoExpress_cfi.t0
t0
Definition: FrontierCondition_GT_autoExpress_cfi.py:148
TrackDetectorAssociator::ecalDetIdAssociator_
edm::ESHandle< DetIdAssociator > ecalDetIdAssociator_
Definition: TrackDetectorAssociator.h:157
LocalError::xx
float xx() const
Definition: LocalError.h:22
CachedTrajectory::setPropagator
void setPropagator(const Propagator *ptr)
Definition: CachedTrajectory.h:83
CSCLayerGeometry
Definition: CSCLayerGeometry.h:25
FiducialVolume::maxR
double maxR(bool withTolerance=true) const
Definition: FiducialVolume.h:43
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
CachedTrajectory::propagate
void propagate(SteppingHelixStateInfo &state, const Plane &plane)
Definition: CachedTrajectory.cc:77
AlgebraicSymMatrix66
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Definition: AlgebraicROOTObjects.h:24
edm::ESHandle< MagneticField >
TrackDetectorAssociator::OutsideIn
Definition: TrackDetectorAssociator.h:55
CSCChamber
Definition: CSCChamber.h:22
GEMSegmentRef
edm::Ref< GEMSegmentCollection > GEMSegmentRef
Definition: GEMSegmentCollection.h:21
RecSegment::localDirection
virtual LocalVector localDirection() const =0
Local direction.
TAMuonSegmentMatch::segmentGlobalPosition
math::XYZPoint segmentGlobalPosition
Definition: TAMuonSegmentMatch.h:13
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
TrackDetectorAssociator::hcalDetIdAssociator_
edm::ESHandle< DetIdAssociator > hcalDetIdAssociator_
Definition: TrackDetectorAssociator.h:158
TAMuonSegmentMatch::segmentLocalErrorYY
float segmentLocalErrorYY
Definition: TAMuonSegmentMatch.h:17
Point3DBase< float, GlobalTag >
CachedTrajectory::findHOTrajectory
void findHOTrajectory(const FiducialVolume &)
Definition: CachedTrajectory.cc:469
TrackDetectorAssociator::setPropagator
void setPropagator(const Propagator *)
use a user configured propagator
Definition: TrackDetectorAssociator.cc:115
TrackDetectorAssociator::getTAMuonChamberMatches
void getTAMuonChamberMatches(std::vector< TAMuonChamberMatch > &matches, const AssociatorParameters &parameters)
Definition: TrackDetectorAssociator.cc:642
TAMuonSegmentMatch::t0
float t0
Definition: TAMuonSegmentMatch.h:23
SteppingHelixStateInfo
Definition: SteppingHelixStateInfo.h:27
TAMuonSegmentMatch::segmentLocalErrorDyDz
float segmentLocalErrorDyDz
Definition: TAMuonSegmentMatch.h:20
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
DetIdAssociator::getGeomDet
virtual const GeomDet * getGeomDet(const DetId &) const =0
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
CachedTrajectory::getStateAtEcal
SteppingHelixStateInfo getStateAtEcal()
Definition: CachedTrajectory.cc:570
eleHcalExtractorBlocks_cff.caloTowers
caloTowers
Definition: eleHcalExtractorBlocks_cff.py:15
FiducialVolume::minZ
double minZ(bool withTolerance=true) const
Definition: FiducialVolume.h:49
LocalError
Definition: LocalError.h:12
TrackDetectorAssociator::fillMuon
void fillMuon(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:745
DetIdAssociator::MapRange
Definition: DetIdAssociator.h:48
CachedTrajectory::trajectoryDelta
std::pair< float, float > trajectoryDelta(TrajectorType)
Definition: CachedTrajectory.cc:256
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
CachedTrajectory::IpToHO
Definition: CachedTrajectory.h:64
TAMuonChamberMatch::id
DetId id
Definition: TAMuonChamberMatch.h:31
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
SteppingHelixPropagator::applyRadX0Correction
void applyRadX0Correction(bool applyRadX0Correction)
Definition: SteppingHelixPropagator.h:133
muonSimHitMatcherPSet.simTrack
simTrack
Definition: muonSimHitMatcherPSet.py:4
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
TAMuonSegmentMatch::segmentLocalErrorDxDz
float segmentLocalErrorDxDz
Definition: TAMuonSegmentMatch.h:19
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
TAMuonSegmentMatch::segmentLocalErrorXX
float segmentLocalErrorXX
Definition: TAMuonSegmentMatch.h:16
iEvent
int iEvent
Definition: GenABIO.cc:224
CachedTrajectory::setMaxHORadius
void setMaxHORadius(float r=800.)
Definition: CachedTrajectory.h:115
TrackDetectorAssociator::muonDetIdAssociator_
edm::ESHandle< DetIdAssociator > muonDetIdAssociator_
Definition: TrackDetectorAssociator.h:161
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
ME0Chamber
Definition: ME0Chamber.h:10
TrackDetectorAssociator::getPoint
math::XYZPoint getPoint(const GlobalPoint &point)
Definition: TrackDetectorAssociator.h:140
DetIdAssociator::MapRange::dPhiMinus
float dPhiMinus
Definition: DetIdAssociator.h:52
DetIdAssociator::getDetIdsCloseToAPoint
virtual std::set< DetId > getDetIdsCloseToAPoint(const GlobalPoint &, const int iN=0) const
Definition: DetIdAssociator.cc:36
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
TAMuonSegmentMatch::hasZed
bool hasZed
Definition: TAMuonSegmentMatch.h:24
TrackDetectorAssociator::preshowerDetIdAssociator_
edm::ESHandle< DetIdAssociator > preshowerDetIdAssociator_
Definition: TrackDetectorAssociator.h:162
TrackDetectorAssociator::hoDetIdAssociator_
edm::ESHandle< DetIdAssociator > hoDetIdAssociator_
Definition: TrackDetectorAssociator.h:159
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
TrackDetectorAssociator::InsideOut
Definition: TrackDetectorAssociator.h:55
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
get
#define get
SteppingHelixStateInfo::isValid
bool isValid() const
Definition: SteppingHelixStateInfo.h:65
DetIdAssociatorRecord
Definition: DetIdAssociatorRecord.h:13
TrackDetectorAssociator::init
void init(const edm::EventSetup &)
Definition: TrackDetectorAssociator.cc:122
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
SteppingHelixPropagator::setMaterialMode
void setMaterialMode(bool noMaterial)
Switch for material effects mode: no material effects if true.
Definition: SteppingHelixPropagator.h:124
CSCWireTopology::wideWidthOfPlane
double wideWidthOfPlane() const
Definition: CSCWireTopology.h:91
TAMuonChamberMatch
Definition: TAMuonChamberMatch.h:20
fftjetvertexadder_cfi.sigmaX
sigmaX
Definition: fftjetvertexadder_cfi.py:30
FiducialVolume::maxZ
double maxZ(bool withTolerance=true) const
Definition: FiducialVolume.h:55
TAMuonChamberMatch::segments
std::vector< TAMuonSegmentMatch > segments
distance sign convention: negative - crossed chamber, positive - missed chamber
Definition: TAMuonChamberMatch.h:27
trajectoryStateTransform::innerFreeState
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:86
CartesianTrajectoryError
Definition: CartesianTrajectoryError.h:15
TrackDetMatchInfo
Definition: TrackDetMatchInfo.h:14
TrackDetectorAssociator::fillPreshower
void fillPreshower(const edm::Event &iEvent, TrackDetMatchInfo &info, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:413
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
TrackDetectorAssociator::fillEcal
void fillEcal(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:265
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
fftjetvertexadder_cfi.sigmaY
sigmaY
Definition: fftjetvertexadder_cfi.py:31
DTRecSegment4D::hasZed
bool hasZed() const
Does it have the Z projection?
Definition: DTRecSegment4D.h:93
CachedTrajectory::getPreshowerTrajectory
const std::vector< SteppingHelixStateInfo > & getPreshowerTrajectory() const
Definition: CachedTrajectory.cc:457
CachedTrajectory::IpToHcal
Definition: CachedTrajectory.h:64
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:292
CSCLayerGeometry::wireTopology
const CSCWireTopology * wireTopology() const
Definition: CSCLayerGeometry.h:282
TAMuonSegmentMatch
Definition: TAMuonSegmentMatch.h:11
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCWireTopology::yOfWire
float yOfWire(float wire, float x=0.) const
Definition: CSCWireTopology.h:81
GloballyPositioned::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
CachedTrajectory::setStateAtIP
void setStateAtIP(const SteppingHelixStateInfo &state)
Definition: CachedTrajectory.h:84
ME0SegmentRef
edm::Ref< ME0SegmentCollection > ME0SegmentRef
Definition: ME0SegmentCollection.h:22
Exception
Definition: hltDiff.cc:246
CSCWireTopology
Definition: CSCWireTopology.h:18
TrackDetectorAssociator::getMapRange
DetIdAssociator::MapRange getMapRange(const std::pair< float, float > &delta, const float dR)
Definition: TrackDetectorAssociator.cc:622
CachedTrajectory::getStateAtHcal
SteppingHelixStateInfo getStateAtHcal()
Definition: CachedTrajectory.cc:584
DTRecSegment4DRef
edm::Ref< DTRecSegment4DCollection > DTRecSegment4DRef
Definition: DTRecSegment4DCollection.h:24
DTRecSegment2D::specificRecHits
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
Definition: DTRecSegment2D.cc:104
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
TrackDetectorAssociator::useDefaultPropagator_
bool useDefaultPropagator_
Definition: TrackDetectorAssociator.h:155
or
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
Definition: Activities.doc:12
TAMuonSegmentMatch::segmentLocalDirection
math::XYZVector segmentLocalDirection
Definition: TAMuonSegmentMatch.h:15
TAMuonSegmentMatch::segmentLocalErrorXY
float segmentLocalErrorXY
Definition: TAMuonSegmentMatch.h:18
TAMuonSegmentMatch::segmentLocalPosition
math::XYZPoint segmentLocalPosition
Definition: TAMuonSegmentMatch.h:14
patCandidatesForDimuonsSequences_cff.matches
matches
Definition: patCandidatesForDimuonsSequences_cff.py:131
DTRecSegment4D::hasPhi
bool hasPhi() const
Does it have the Phi projection?
Definition: DTRecSegment4D.h:90
TrackDetectorAssociator::cachedTrajectory_
CachedTrajectory cachedTrajectory_
Definition: TrackDetectorAssociator.h:154
CachedTrajectory::getHOTrajectory
const std::vector< SteppingHelixStateInfo > & getHOTrajectory() const
Definition: CachedTrajectory.cc:475
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
TAMuonChamberMatch::tState
TrajectoryStateOnSurface tState
Definition: TAMuonChamberMatch.h:30
mps_fire.result
result
Definition: mps_fire.py:303
CachedTrajectory::getHcalTrajectory
const std::vector< SteppingHelixStateInfo > & getHcalTrajectory() const
Definition: CachedTrajectory.cc:467
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackDetectorAssociator::associate
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:154
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
HGCalValidator_cfi.simVertices
simVertices
Definition: HGCalValidator_cfi.py:43
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
CachedTrajectory::getEcalTrajectory
const std::vector< SteppingHelixStateInfo > & getEcalTrajectory() const
Definition: CachedTrajectory.cc:455
me0Segments_cfi.me0Segments
me0Segments
Definition: me0Segments_cfi.py:6
point
*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
Definition: invegas.h:5
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
DTRecSegment4D::phiSegment
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
Definition: DTRecSegment4D.h:96
CachedTrajectory::reset_trajectory
void reset_trajectory()
Definition: CachedTrajectory.cc:431
CSCChamberSpecs::oddLayerGeometry
const CSCLayerGeometry * oddLayerGeometry(int iendcap) const
Accessors for LayerGeometry's.
Definition: CSCChamberSpecs.h:67
LocalError::yy
float yy() const
Definition: LocalError.h:24
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TrackDetectorAssociator::caloDetIdAssociator_
edm::ESHandle< DetIdAssociator > caloDetIdAssociator_
Definition: TrackDetectorAssociator.h:160
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
TrackDetectorAssociator::fillHO
void fillHO(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:504
RecSegment::localDirectionError
virtual LocalError localDirectionError() const =0
Error on the local direction.
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
TrackingRecHit::localPositionError
virtual LocalError localPositionError() const =0
CosmicGenFilterHelix_cff.minZ
minZ
i.e.
Definition: CosmicGenFilterHelix_cff.py:9
CachedTrajectory::findEcalTrajectory
void findEcalTrajectory(const FiducialVolume &)
Definition: CachedTrajectory.cc:443
TrackDetectorAssociator::theTrackingGeometry_
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry_
Definition: TrackDetectorAssociator.h:165
filterRecHits_cfi.EBRecHits
EBRecHits
Definition: filterRecHits_cfi.py:8