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 MagneticField *, const GlobalVector &, const GlobalPoint &, const int)
 
static FreeTrajectoryState getFreeTrajectoryState (const MagneticField *, const reco::Track &)
 get FreeTrajectoryState from different track representations More...
 
static FreeTrajectoryState getFreeTrajectoryState (const MagneticField *, 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 &, const AssociatorParameters &)
 

Private Attributes

CachedTrajectory cachedTrajectory_
 
const DetIdAssociatorcaloDetIdAssociator_
 
std::unique_ptr< PropagatordefProp_
 
const DetIdAssociatorecalDetIdAssociator_
 
const DetIdAssociatorhcalDetIdAssociator_
 
const DetIdAssociatorhoDetIdAssociator_
 
const PropagatorivProp_
 
const DetIdAssociatormuonDetIdAssociator_
 
const DetIdAssociatorpreshowerDetIdAssociator_
 
const CaloGeometrytheCaloGeometry_
 
edm::ESWatcher< IdealMagneticFieldRecordtheMagneticFieldWatcher_
 
const GlobalTrackingGeometrytheTrackingGeometry_
 
bool useDefaultPropagator_
 

Detailed Description

Definition at line 44 of file TrackDetectorAssociator.h.

Member Typedef Documentation

◆ AssociatorParameters

Definition at line 49 of file TrackDetectorAssociator.h.

Member Enumeration Documentation

◆ Direction

Enumerator
Any 
InsideOut 
OutsideIn 

Definition at line 50 of file TrackDetectorAssociator.h.

50 { Any, InsideOut, OutsideIn };

Constructor & Destructor Documentation

◆ TrackDetectorAssociator()

TrackDetectorAssociator::TrackDetectorAssociator ( )
explicit

Definition at line 69 of file TrackDetectorAssociator.cc.

69  {
70  ivProp_ = nullptr;
71  useDefaultPropagator_ = false;
72 }

◆ ~TrackDetectorAssociator()

TrackDetectorAssociator::~TrackDetectorAssociator ( )
default

Member Function Documentation

◆ addTAMuonSegmentMatch()

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

Definition at line 791 of file TrackDetectorAssociator.cc.

793  {
794  LogTrace("TrackAssociator") << "Segment local position: " << segment->localPosition() << "\n"
795  << std::hex << segment->geographicalId().rawId() << "\n";
796 
797  const GeomDet* chamber = muonDetIdAssociator_->getGeomDet(matchedChamber.id);
798  TrajectoryStateOnSurface trajectoryStateOnSurface = matchedChamber.tState;
799  GlobalPoint segmentGlobalPosition = chamber->toGlobal(segment->localPosition());
800 
801  LogTrace("TrackAssociator") << "Segment global position: " << segmentGlobalPosition
802  << " \t (R_xy,eta,phi): " << segmentGlobalPosition.perp() << ","
803  << segmentGlobalPosition.eta() << "," << segmentGlobalPosition.phi() << "\n";
804 
805  LogTrace("TrackAssociator") << "\teta hit: " << segmentGlobalPosition.eta()
806  << " \tpropagator: " << trajectoryStateOnSurface.freeState()->position().eta() << "\n"
807  << "\tphi hit: " << segmentGlobalPosition.phi()
808  << " \tpropagator: " << trajectoryStateOnSurface.freeState()->position().phi()
809  << std::endl;
810 
811  bool isGood = false;
812  bool isDTWithoutY = false;
813  const DTRecSegment4D* dtseg = dynamic_cast<const DTRecSegment4D*>(segment);
814  if (dtseg && (!dtseg->hasZed()))
815  isDTWithoutY = true;
816 
817  float deltaPhi(std::abs(segmentGlobalPosition.phi() - trajectoryStateOnSurface.freeState()->position().phi()));
818  if (deltaPhi > float(M_PI))
819  deltaPhi = std::abs(deltaPhi - float(M_PI) * 2.f);
820  float deltaEta = std::abs(segmentGlobalPosition.eta() - trajectoryStateOnSurface.freeState()->position().eta());
821 
822  if (isDTWithoutY) {
823  isGood = deltaPhi < parameters.dRMuon;
824  // Be in chamber
825  isGood &= deltaEta < .3f;
826  } else
827  isGood = deltaEta * deltaEta + deltaPhi * deltaPhi < parameters.dRMuon * parameters.dRMuon;
828 
829  if (isGood) {
830  TAMuonSegmentMatch muonSegment;
831  muonSegment.segmentGlobalPosition = getPoint(segmentGlobalPosition);
832  muonSegment.segmentLocalPosition = getPoint(segment->localPosition());
833  muonSegment.segmentLocalDirection = getVector(segment->localDirection());
834  muonSegment.segmentLocalErrorXX = segment->localPositionError().xx();
835  muonSegment.segmentLocalErrorYY = segment->localPositionError().yy();
836  muonSegment.segmentLocalErrorXY = segment->localPositionError().xy();
837  muonSegment.segmentLocalErrorDxDz = segment->localDirectionError().xx();
838  muonSegment.segmentLocalErrorDyDz = segment->localDirectionError().yy();
839 
840  // DANGEROUS - compiler cannot guaranty parameters ordering
841  // AlgebraicSymMatrix segmentCovMatrix = segment->parametersError();
842  // muonSegment.segmentLocalErrorXDxDz = segmentCovMatrix[2][0];
843  // muonSegment.segmentLocalErrorYDyDz = segmentCovMatrix[3][1];
844  muonSegment.segmentLocalErrorXDxDz = -999.f;
845  muonSegment.segmentLocalErrorYDyDz = -999.f;
846  muonSegment.hasZed = true;
847  muonSegment.hasPhi = true;
848 
849  // timing information
850  muonSegment.t0 = 0.f;
851  if (dtseg) {
852  if ((dtseg->hasPhi()) && (!isDTWithoutY)) {
853  int phiHits = dtseg->phiSegment()->specificRecHits().size();
854  // int zHits = dtseg->zSegment()->specificRecHits().size();
855  int hits = 0;
856  double t0 = 0.;
857  // TODO: cuts on hit numbers not optimized in any way yet...
858  if (phiHits > 5 && dtseg->phiSegment()->ist0Valid()) {
859  t0 += dtseg->phiSegment()->t0() * phiHits;
860  hits += phiHits;
861  LogTrace("TrackAssociator") << " Phi t0: " << dtseg->phiSegment()->t0() << " hits: " << phiHits;
862  }
863  // the z segments seem to contain little useful information...
864  // if (zHits>3) {
865  // t0+=s->zSegment()->t0()*zHits;
866  // hits+=zHits;
867  // LogTrace("TrackAssociator") << " Z t0: " << s->zSegment()->t0() << " hits: " << zHits << std::endl;
868  // }
869  if (hits)
870  muonSegment.t0 = t0 / hits;
871  // LogTrace("TrackAssociator") << " --- t0: " << muonSegment.t0 << std::endl;
872  } else {
873  // check and set dimensionality
874  if (isDTWithoutY)
875  muonSegment.hasZed = false;
876  if (!dtseg->hasPhi())
877  muonSegment.hasPhi = false;
878  }
879  }
880  matchedChamber.segments.push_back(muonSegment);
881  }
882 
883  return isGood;
884 }

References funct::abs(), relativeConstraints::chamber, spr::deltaEta, reco::deltaPhi(), PV3DBase< T, PVType, FrameType >::eta(), f, 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(), 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(), 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 110 of file TrackDetectorAssociator.cc.

113  {
114  return associate(iEvent, iSetup, parameters, &fts);
115 }

References iEvent.

Referenced by ValidIsoTrkCalib::analyze(), EopTreeWriter::analyze(), EcalCosmicsHists::analyze(), muonisolation::JetExtractor::deposit(), muonisolation::CaloExtractorByAssociator::deposits(), cms::MuonMETValueMapProducer::determine_deltax_deltay(), MuonIdProducer::fillMuonId(), and InterestingTrackEcalDetIdProducer::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 1046 of file TrackDetectorAssociator.cc.

1051  {
1052  auto const* bField = &iSetup.getData(parameters.bFieldToken);
1053  return associate(iEvent, iSetup, getFreeTrajectoryState(bField, momentum, vertex, charge), parameters);
1054 }

References Calorimetry_cff::bField, ALCARECOTkAlJpsiMuMu_cff::charge, edm::EventSetup::getData(), 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 955 of file TrackDetectorAssociator.cc.

959  {
960  double currentStepSize = cachedTrajectory_.getPropagationStep();
961 
962  const MagneticField* bField = &iSetup.getData(parameters.bFieldToken);
963 
964  if (track.extra().isNull()) {
965  if (direction != InsideOut)
966  throw cms::Exception("FatalError") << "No TrackExtra information is available and association is done with "
967  "something else than InsideOut track.\n"
968  << "Either change the parameter or provide needed data!\n";
969  LogTrace("TrackAssociator") << "Track Extras not found\n";
971  return associate(iEvent, iSetup, parameters, &initialState); // 5th argument is null pointer
972  }
973 
974  LogTrace("TrackAssociator") << "Track Extras found\n";
978 
979  LogTrace("TrackAssociator") << "inner track state (rho, z, phi):" << track.innerPosition().Rho() << ", "
980  << track.innerPosition().z() << ", " << track.innerPosition().phi() << "\n";
981  LogTrace("TrackAssociator") << "innerFreeState (rho, z, phi):" << innerState.position().perp() << ", "
982  << innerState.position().z() << ", " << innerState.position().phi() << "\n";
983 
984  LogTrace("TrackAssociator") << "outer track state (rho, z, phi):" << track.outerPosition().Rho() << ", "
985  << track.outerPosition().z() << ", " << track.outerPosition().phi() << "\n";
986  LogTrace("TrackAssociator") << "outerFreeState (rho, z, phi):" << outerState.position().perp() << ", "
987  << outerState.position().z() << ", " << outerState.position().phi() << "\n";
988 
989  // InsideOut first
990  if (crossedIP(track)) {
991  switch (direction) {
992  case InsideOut:
993  case Any:
994  return associate(iEvent, iSetup, parameters, &referenceState, &outerState);
995  break;
996  case OutsideIn: {
997  cachedTrajectory_.setPropagationStep(-std::abs(currentStepSize));
998  TrackDetMatchInfo result = associate(iEvent, iSetup, parameters, &innerState, &referenceState);
999  cachedTrajectory_.setPropagationStep(currentStepSize);
1000  return result;
1001  break;
1002  }
1003  }
1004  } else {
1005  switch (direction) {
1006  case InsideOut:
1007  return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1008  break;
1009  case OutsideIn: {
1010  cachedTrajectory_.setPropagationStep(-std::abs(currentStepSize));
1011  TrackDetMatchInfo result = associate(iEvent, iSetup, parameters, &outerState, &innerState);
1012  cachedTrajectory_.setPropagationStep(currentStepSize);
1013  return result;
1014  break;
1015  }
1016  case Any: {
1017  // check if we deal with clear outside-in case
1018  if (track.innerPosition().Dot(track.innerMomentum()) < 0 &&
1019  track.outerPosition().Dot(track.outerMomentum()) < 0) {
1020  cachedTrajectory_.setPropagationStep(-std::abs(currentStepSize));
1022  if (track.innerPosition().Mag2() < track.outerPosition().Mag2())
1023  result = associate(iEvent, iSetup, parameters, &innerState, &outerState);
1024  else
1025  result = associate(iEvent, iSetup, parameters, &outerState, &innerState);
1026  cachedTrajectory_.setPropagationStep(currentStepSize);
1027  return result;
1028  }
1029  }
1030  }
1031  }
1032 
1033  // all other cases
1034  return associate(iEvent, iSetup, parameters, &innerState, &outerState);
1035 }

References funct::abs(), Calorimetry_cff::bField, Exception, edm::EventSetup::getData(), iEvent, trajectoryStateTransform::initialFreeState(), trajectoryStateTransform::innerFreeState(), LogTrace, trajectoryStateTransform::outerFreeState(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), FreeTrajectoryState::position(), mps_fire::result, HLT_FULL_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 1037 of file TrackDetectorAssociator.cc.

1041  {
1042  auto const* bField = &iSetup.getData(parameters.bFieldToken);
1044 }

References Calorimetry_cff::bField, edm::EventSetup::getData(), iEvent, HLT_FULL_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 117 of file TrackDetectorAssociator.cc.

121  {
123  if (!parameters.useEcal && !parameters.useCalo && !parameters.useHcal && !parameters.useHO && !parameters.useMuon &&
124  !parameters.usePreshower)
125  throw cms::Exception("ConfigurationError")
126  << "Configuration error! No subdetector was selected for the track association.";
127 
128  SteppingHelixStateInfo trackOrigin(*innerState);
129  info.stateAtIP = *innerState;
130  cachedTrajectory_.setStateAtIP(trackOrigin);
131 
132  init(iSetup, parameters);
133  // get track trajectory
134  // ECAL points (EB+EE)
135  // If the phi angle between a track entrance and exit points is more
136  // than 2 crystals, it is possible that the track will cross 3 crystals
137  // and therefore one has to check at least 3 points along the track
138  // trajectory inside ECAL. In order to have a chance to cross 4 crystalls
139  // in the barrel, a track should have P_t as low as 3 GeV or smaller
140  // If it's necessary, number of points along trajectory can be increased
141 
142  info.setCaloGeometry(theCaloGeometry_);
143 
145  // estimate propagation outer boundaries based on
146  // requested sub-detector information. For now limit
147  // propagation region only if muon matching is not
148  // requested.
149  double HOmaxR = hoDetIdAssociator_->volume().maxR();
150  double HOmaxZ = hoDetIdAssociator_->volume().maxZ();
151  double minR = ecalDetIdAssociator_->volume().minR();
154  cachedTrajectory_.setMaxHOLength(HOmaxZ * 2.);
157 
158  if (parameters.useMuon) {
159  double maxR = muonDetIdAssociator_->volume().maxR();
160  double maxZ = muonDetIdAssociator_->volume().maxZ();
163  } else {
166  }
167 
168  // If track extras exist and outerState is before HO maximum, then use outerState
169  if (outerState) {
170  if (outerState->position().perp() < HOmaxR && std::abs(outerState->position().z()) < HOmaxZ) {
171  LogTrace("TrackAssociator") << "Using outerState as trackOrigin at Rho=" << outerState->position().perp()
172  << " Z=" << outerState->position().z() << "\n";
173  trackOrigin = SteppingHelixStateInfo(*outerState);
174  } else if (innerState) {
175  LogTrace("TrackAssociator") << "Using innerState as trackOrigin at Rho=" << innerState->position().perp()
176  << " Z=" << innerState->position().z() << "\n";
177  trackOrigin = SteppingHelixStateInfo(*innerState);
178  }
179  }
180 
181  if (trackOrigin.momentum().mag() == 0)
182  return info;
183  if (edm::isNotFinite(trackOrigin.momentum().x()) or edm::isNotFinite(trackOrigin.momentum().y()) or
184  edm::isNotFinite(trackOrigin.momentum().z()))
185  return info;
186  if (!cachedTrajectory_.propagateAll(trackOrigin))
187  return info;
188 
189  // get trajectory in calorimeters
194 
195  info.trkGlobPosAtEcal = getPoint(cachedTrajectory_.getStateAtEcal().position());
196  info.trkGlobPosAtHcal = getPoint(cachedTrajectory_.getStateAtHcal().position());
197  info.trkGlobPosAtHO = getPoint(cachedTrajectory_.getStateAtHO().position());
198 
199  info.trkMomAtEcal = cachedTrajectory_.getStateAtEcal().momentum();
200  info.trkMomAtHcal = cachedTrajectory_.getStateAtHcal().momentum();
201  info.trkMomAtHO = cachedTrajectory_.getStateAtHO().momentum();
202 
203  if (parameters.useEcal)
205  if (parameters.useCalo)
207  if (parameters.useHcal)
209  if (parameters.useHO)
211  if (parameters.usePreshower)
213  if (parameters.useMuon)
215  if (parameters.truthMatch)
217 
218  return info;
219 }

References funct::abs(), Exception, iEvent, info(), init, edm::isNotFinite(), LogTrace, PV3DBase< T, PVType, FrameType >::mag(), CosmicsPD_Skims::maxZ, HLT_FULL_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 1056 of file TrackDetectorAssociator.cc.

1056  {
1057  bool crossed = true;
1058  crossed &= (track.innerPosition().rho() > 3); // something close to active volume
1059  crossed &= (track.outerPosition().rho() > 3); // something close to active volume
1060  crossed &=
1061  ((track.innerPosition().x() * track.innerMomentum().x() + track.innerPosition().y() * track.innerMomentum().y() <
1062  0) !=
1063  (track.outerPosition().x() * track.outerMomentum().x() + track.outerPosition().y() * track.outerMomentum().y() <
1064  0));
1065  return crossed;
1066 }

References HLT_FULL_cff::track.

Referenced by MuonIdProducer::produce().

◆ fillCaloTowers()

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

Definition at line 295 of file TrackDetectorAssociator.cc.

297  {
298  // use ECAL and HCAL trajectories to match a tower. (HO isn't used for matching).
299  std::vector<GlobalPoint> trajectory;
300  const std::vector<SteppingHelixStateInfo>& ecalTrajectoryStates = cachedTrajectory_.getEcalTrajectory();
301  const std::vector<SteppingHelixStateInfo>& hcalTrajectoryStates = cachedTrajectory_.getHcalTrajectory();
302  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = ecalTrajectoryStates.begin();
303  itr != ecalTrajectoryStates.end();
304  itr++)
305  trajectory.push_back(itr->position());
306  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = hcalTrajectoryStates.begin();
307  itr != hcalTrajectoryStates.end();
308  itr++)
309  trajectory.push_back(itr->position());
310 
311  if (trajectory.empty()) {
312  LogTrace("TrackAssociator") << "HCAL trajectory is empty; moving on\n";
313  info.isGoodCalo = false;
314  return;
315  }
316  info.isGoodCalo = true;
317 
318  // find crossed CaloTowers
320  iEvent.getByToken(parameters.caloTowersToken, caloTowers);
321  if (!caloTowers.isValid())
322  throw cms::Exception("FatalError") << "Unable to find CaloTowers in event!\n";
323 
324  std::set<DetId> caloTowerIdsInRegion;
325  if (parameters.accountForTrajectoryChangeCalo) {
326  // get trajectory change with respect to initial state
327  DetIdAssociator::MapRange mapRange =
329  caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], mapRange);
330  } else
331  caloTowerIdsInRegion = caloDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], parameters.dRHcalPreselection);
332 
333  LogTrace("TrackAssociator") << "Towers in the region: " << caloTowerIdsInRegion.size();
334 
335  auto caloTowerIdsInAConeBegin = caloTowerIdsInRegion.begin();
336  auto caloTowerIdsInAConeEnd = caloTowerIdsInRegion.end();
337  std::set<DetId> caloTowerIdsInAConeTmp;
339  caloTowerIdsInAConeTmp =
340  caloDetIdAssociator_->getDetIdsInACone(caloTowerIdsInRegion, trajectory, parameters.dRHcal);
341  caloTowerIdsInAConeBegin = caloTowerIdsInAConeTmp.begin();
342  caloTowerIdsInAConeEnd = caloTowerIdsInAConeTmp.end();
343  }
344  LogTrace("TrackAssociator") << "Towers in the cone: "
345  << std::distance(caloTowerIdsInAConeBegin, caloTowerIdsInAConeEnd);
346 
347  info.crossedTowerIds = caloDetIdAssociator_->getCrossedDetIds(caloTowerIdsInRegion, trajectory);
348  const std::vector<DetId>& crossedCaloTowerIds = info.crossedTowerIds;
349  LogTrace("TrackAssociator") << "Towers crossed: " << crossedCaloTowerIds.size();
350 
351  // add CaloTowers
352  for (std::vector<DetId>::const_iterator itr = crossedCaloTowerIds.begin(); itr != crossedCaloTowerIds.end(); itr++) {
353  CaloTowerCollection::const_iterator tower = (*caloTowers).find(*itr);
354  if (tower != (*caloTowers).end())
355  info.crossedTowers.push_back(&*tower);
356  else
357  LogTrace("TrackAssociator") << "Crossed CaloTower is not found for DetId: " << (*itr).rawId();
358  }
359 
360  for (std::set<DetId>::const_iterator itr = caloTowerIdsInAConeBegin; itr != caloTowerIdsInAConeEnd; itr++) {
361  CaloTowerCollection::const_iterator tower = (*caloTowers).find(*itr);
362  if (tower != (*caloTowers).end())
363  info.towers.push_back(&*tower);
364  else
365  LogTrace("TrackAssociator") << "CaloTower from the cone is not found for DetId: " << (*itr).rawId();
366  }
367 }

References eleHcalExtractorBlocks_cff::caloTowers, HLT_FULL_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 888 of file TrackDetectorAssociator.cc.

890  {
891  // get list of simulated tracks and their vertices
892  using namespace edm;
894  iEvent.getByToken(parameters.simTracksToken, simTracks);
895  if (!simTracks.isValid())
896  throw cms::Exception("FatalError") << "No simulated tracks found\n";
897 
899  iEvent.getByToken(parameters.simVerticesToken, simVertices);
900  if (!simVertices.isValid())
901  throw cms::Exception("FatalError") << "No simulated vertices found\n";
902 
903  // get sim calo hits
904  Handle<PCaloHitContainer> simEcalHitsEB;
905  iEvent.getByToken(parameters.simEcalHitsEBToken, simEcalHitsEB);
906  if (!simEcalHitsEB.isValid())
907  throw cms::Exception("FatalError") << "No simulated ECAL EB hits found\n";
908 
909  Handle<PCaloHitContainer> simEcalHitsEE;
910  iEvent.getByToken(parameters.simEcalHitsEEToken, simEcalHitsEE);
911  if (!simEcalHitsEE.isValid())
912  throw cms::Exception("FatalError") << "No simulated ECAL EE hits found\n";
913 
914  Handle<PCaloHitContainer> simHcalHits;
915  iEvent.getByToken(parameters.simHcalHitsToken, simHcalHits);
916  if (!simHcalHits.isValid())
917  throw cms::Exception("FatalError") << "No simulated HCAL hits found\n";
918 
919  // find truth partner
920  SimTrackContainer::const_iterator simTrack = simTracks->begin();
921  for (; simTrack != simTracks->end(); ++simTrack) {
922  math::XYZVector simP3(simTrack->momentum().x(), simTrack->momentum().y(), simTrack->momentum().z());
923  math::XYZVector recoP3(info.stateAtIP.momentum().x(), info.stateAtIP.momentum().y(), info.stateAtIP.momentum().z());
924  if (ROOT::Math::VectorUtil::DeltaR(recoP3, simP3) < 0.1)
925  break;
926  }
927  if (simTrack != simTracks->end()) {
928  info.simTrack = &(*simTrack);
929  float ecalTrueEnergy(0);
930  float hcalTrueEnergy(0);
931 
932  // loop over calo hits
933  for (PCaloHitContainer::const_iterator hit = simEcalHitsEB->begin(); hit != simEcalHitsEB->end(); ++hit)
934  if (hit->geantTrackId() == info.simTrack->genpartIndex())
935  ecalTrueEnergy += hit->energy();
936 
937  for (PCaloHitContainer::const_iterator hit = simEcalHitsEE->begin(); hit != simEcalHitsEE->end(); ++hit)
938  if (hit->geantTrackId() == info.simTrack->genpartIndex())
939  ecalTrueEnergy += hit->energy();
940 
941  for (PCaloHitContainer::const_iterator hit = simHcalHits->begin(); hit != simHcalHits->end(); ++hit)
942  if (hit->geantTrackId() == info.simTrack->genpartIndex())
943  hcalTrueEnergy += hit->energy();
944 
945  info.ecalTrueEnergy = ecalTrueEnergy;
946  info.hcalTrueEnergy = hcalTrueEnergy;
947  info.hcalTrueEnergyCorrected = hcalTrueEnergy;
948  if (std::abs(info.trkGlobPosAtHcal.eta()) < 1.3f)
949  info.hcalTrueEnergyCorrected = hcalTrueEnergy * 113.2f;
950  else if (std::abs(info.trkGlobPosAtHcal.eta()) < 3.0f)
951  info.hcalTrueEnergyCorrected = hcalTrueEnergy * 167.2f;
952  }
953 }

References funct::abs(), electronAnalyzer_cfi::DeltaR, f, iEvent, info(), edm::HandleBase::isValid(), cscDigiValidation_cfi::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 221 of file TrackDetectorAssociator.cc.

223  {
224  const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getEcalTrajectory();
225 
226  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
227  itr != trajectoryStates.end();
228  itr++)
229  LogTrace("TrackAssociator") << "ECAL trajectory point (rho, z, phi): " << itr->position().perp() << ", "
230  << itr->position().z() << ", " << itr->position().phi();
231 
232  std::vector<GlobalPoint> coreTrajectory;
233  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
234  itr != trajectoryStates.end();
235  itr++)
236  coreTrajectory.push_back(itr->position());
237 
238  if (coreTrajectory.empty()) {
239  LogTrace("TrackAssociator") << "ECAL track trajectory is empty; moving on\n";
240  info.isGoodEcal = false;
241  return;
242  }
243  info.isGoodEcal = true;
244 
245  // Find ECAL crystals
247  iEvent.getByToken(parameters.EBRecHitsToken, EBRecHits);
248  if (!EBRecHits.isValid())
249  throw cms::Exception("FatalError") << "Unable to find EBRecHitCollection in the event!\n";
250 
252  iEvent.getByToken(parameters.EERecHitsToken, EERecHits);
253  if (!EERecHits.isValid())
254  throw cms::Exception("FatalError") << "Unable to find EERecHitCollection in event!\n";
255 
256  std::set<DetId> ecalIdsInRegion;
257  if (parameters.accountForTrajectoryChangeCalo) {
258  // get trajectory change with respect to initial state
259  DetIdAssociator::MapRange mapRange =
261  ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
262  } else
263  ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.dREcalPreselection);
264  LogTrace("TrackAssociator") << "ECAL hits in the region: " << ecalIdsInRegion.size();
265  if (parameters.dREcalPreselection > parameters.dREcal)
266  ecalIdsInRegion = ecalDetIdAssociator_->getDetIdsInACone(ecalIdsInRegion, coreTrajectory, parameters.dREcal);
267  LogTrace("TrackAssociator") << "ECAL hits in the cone: " << ecalIdsInRegion.size();
268  info.crossedEcalIds = ecalDetIdAssociator_->getCrossedDetIds(ecalIdsInRegion, coreTrajectory);
269  const std::vector<DetId>& crossedEcalIds = info.crossedEcalIds;
270  LogTrace("TrackAssociator") << "ECAL crossed hits " << crossedEcalIds.size();
271 
272  // add EcalRecHits
273  for (std::vector<DetId>::const_iterator itr = crossedEcalIds.begin(); itr != crossedEcalIds.end(); itr++) {
274  std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
275  std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
276  if (ebHit != (*EBRecHits).end())
277  info.crossedEcalRecHits.push_back(&*ebHit);
278  else if (eeHit != (*EERecHits).end())
279  info.crossedEcalRecHits.push_back(&*eeHit);
280  else
281  LogTrace("TrackAssociator") << "Crossed EcalRecHit is not found for DetId: " << itr->rawId();
282  }
283  for (std::set<DetId>::const_iterator itr = ecalIdsInRegion.begin(); itr != ecalIdsInRegion.end(); itr++) {
284  std::vector<EcalRecHit>::const_iterator ebHit = (*EBRecHits).find(*itr);
285  std::vector<EcalRecHit>::const_iterator eeHit = (*EERecHits).find(*itr);
286  if (ebHit != (*EBRecHits).end())
287  info.ecalRecHits.push_back(&*ebHit);
288  else if (eeHit != (*EERecHits).end())
289  info.ecalRecHits.push_back(&*eeHit);
290  else
291  LogTrace("TrackAssociator") << "EcalRecHit from the cone is not found for DetId: " << itr->rawId();
292  }
293 }

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 392 of file TrackDetectorAssociator.cc.

394  {
395  const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHcalTrajectory();
396 
397  std::vector<GlobalPoint> coreTrajectory;
398  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
399  itr != trajectoryStates.end();
400  itr++)
401  coreTrajectory.push_back(itr->position());
402 
403  if (coreTrajectory.empty()) {
404  LogTrace("TrackAssociator") << "HCAL trajectory is empty; moving on\n";
405  info.isGoodHcal = false;
406  return;
407  }
408  info.isGoodHcal = true;
409 
410  // find crossed Hcals
412  iEvent.getByToken(parameters.HBHEcollToken, collection);
413  if (!collection.isValid())
414  throw cms::Exception("FatalError") << "Unable to find HBHERecHits in event!\n";
415 
416  std::set<DetId> idsInRegion;
417  if (parameters.accountForTrajectoryChangeCalo) {
418  // get trajectory change with respect to initial state
419  DetIdAssociator::MapRange mapRange =
421  idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
422  } else
423  idsInRegion = hcalDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.dRHcalPreselection);
424 
425  LogTrace("TrackAssociator") << "HCAL hits in the region: " << idsInRegion.size() << "\n"
426  << DetIdInfo::info(idsInRegion, nullptr);
427 
428  auto idsInAConeBegin = idsInRegion.begin();
429  auto idsInAConeEnd = idsInRegion.end();
430  std::set<DetId> idsInAConeTmp;
432  idsInAConeTmp = hcalDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.dRHcal);
433  idsInAConeBegin = idsInAConeTmp.begin();
434  idsInAConeEnd = idsInAConeTmp.end();
435  }
436  LogTrace("TrackAssociator") << "HCAL hits in the cone: " << std::distance(idsInAConeBegin, idsInAConeEnd) << "\n"
437  << DetIdInfo::info(std::set<DetId>(idsInAConeBegin, idsInAConeEnd), nullptr);
438  info.crossedHcalIds = hcalDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
439  const std::vector<DetId>& crossedIds = info.crossedHcalIds;
440  LogTrace("TrackAssociator") << "HCAL hits crossed: " << crossedIds.size() << "\n"
441  << DetIdInfo::info(crossedIds, nullptr);
442 
443  // add Hcal
444  for (std::vector<DetId>::const_iterator itr = crossedIds.begin(); itr != crossedIds.end(); itr++) {
445  HBHERecHitCollection::const_iterator hit = (*collection).find(*itr);
446  if (hit != (*collection).end())
447  info.crossedHcalRecHits.push_back(&*hit);
448  else
449  LogTrace("TrackAssociator") << "Crossed HBHERecHit is not found for DetId: " << itr->rawId();
450  }
451  for (std::set<DetId>::const_iterator itr = idsInAConeBegin; itr != idsInAConeEnd; itr++) {
452  HBHERecHitCollection::const_iterator hit = (*collection).find(*itr);
453  if (hit != (*collection).end())
454  info.hcalRecHits.push_back(&*hit);
455  else
456  LogTrace("TrackAssociator") << "HBHERecHit from the cone is not found for DetId: " << itr->rawId();
457  }
458 }

References universalConfigTemplate::collection, HLT_FULL_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 460 of file TrackDetectorAssociator.cc.

462  {
463  const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getHOTrajectory();
464 
465  std::vector<GlobalPoint> coreTrajectory;
466  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
467  itr != trajectoryStates.end();
468  itr++)
469  coreTrajectory.push_back(itr->position());
470 
471  if (coreTrajectory.empty()) {
472  LogTrace("TrackAssociator") << "HO trajectory is empty; moving on\n";
473  info.isGoodHO = false;
474  return;
475  }
476  info.isGoodHO = true;
477 
478  // find crossed HOs
480  iEvent.getByToken(parameters.HOcollToken, collection);
481  if (!collection.isValid())
482  throw cms::Exception("FatalError") << "Unable to find HORecHits in event!\n";
483 
484  std::set<DetId> idsInRegion;
485  if (parameters.accountForTrajectoryChangeCalo) {
486  // get trajectory change with respect to initial state
487  DetIdAssociator::MapRange mapRange =
489  idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], mapRange);
490  } else
491  idsInRegion = hoDetIdAssociator_->getDetIdsCloseToAPoint(coreTrajectory[0], parameters.dRHcalPreselection);
492 
493  LogTrace("TrackAssociator") << "idsInRegion.size(): " << idsInRegion.size();
494 
495  auto idsInAConeBegin = idsInRegion.begin();
496  auto idsInAConeEnd = idsInRegion.end();
497  std::set<DetId> idsInAConeTmp;
499  idsInAConeTmp = hoDetIdAssociator_->getDetIdsInACone(idsInRegion, coreTrajectory, parameters.dRHcal);
500  idsInAConeBegin = idsInAConeTmp.begin();
501  idsInAConeEnd = idsInAConeTmp.end();
502  }
503  LogTrace("TrackAssociator") << "idsInACone.size(): " << std::distance(idsInAConeBegin, idsInAConeEnd);
504  info.crossedHOIds = hoDetIdAssociator_->getCrossedDetIds(idsInRegion, coreTrajectory);
505  const std::vector<DetId>& crossedIds = info.crossedHOIds;
506 
507  // add HO
508  for (std::vector<DetId>::const_iterator itr = crossedIds.begin(); itr != crossedIds.end(); itr++) {
509  HORecHitCollection::const_iterator hit = (*collection).find(*itr);
510  if (hit != (*collection).end())
511  info.crossedHORecHits.push_back(&*hit);
512  else
513  LogTrace("TrackAssociator") << "Crossed HORecHit is not found for DetId: " << itr->rawId();
514  }
515 
516  for (std::set<DetId>::const_iterator itr = idsInAConeBegin; itr != idsInAConeEnd; itr++) {
517  HORecHitCollection::const_iterator hit = (*collection).find(*itr);
518  if (hit != (*collection).end())
519  info.hoRecHits.push_back(&*hit);
520  else
521  LogTrace("TrackAssociator") << "HORecHit from the cone is not found for DetId: " << itr->rawId();
522  }
523 }

References universalConfigTemplate::collection, HLT_FULL_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 693 of file TrackDetectorAssociator.cc.

695  {
696  // Get the segments from the event
698  iEvent.getByToken(parameters.dtSegmentsToken, dtSegments);
699  if (!dtSegments.isValid())
700  throw cms::Exception("FatalError") << "Unable to find DTRecSegment4DCollection in event!\n";
701 
703  iEvent.getByToken(parameters.cscSegmentsToken, cscSegments);
704  if (!cscSegments.isValid())
705  throw cms::Exception("FatalError") << "Unable to find CSCSegmentCollection in event!\n";
706 
708  if (parameters.useGEM)
709  iEvent.getByToken(parameters.gemSegmentsToken, gemSegments);
711  if (parameters.useME0)
712  iEvent.getByToken(parameters.me0SegmentsToken, me0Segments);
713 
715 
716  // check the map of available segments
717  // if there is no segments in a given direction at all,
718  // then there is no point to fly there.
719  //
720  // MISSING
721  // Possible solution: quick search for presence of segments
722  // for the set of DetIds
723 
724  // get a set of matches corresponding to muon chambers
725  std::vector<TAMuonChamberMatch> matchedChambers;
726  LogTrace("TrackAssociator") << "Trying to Get ChamberMatches" << std::endl;
727  getTAMuonChamberMatches(matchedChambers, parameters);
728  LogTrace("TrackAssociator") << "Chambers matched: " << matchedChambers.size() << "\n";
729 
730  // Iterate over all chamber matches and fill segment matching
731  // info if it's available
732  for (std::vector<TAMuonChamberMatch>::iterator matchedChamber = matchedChambers.begin();
733  matchedChamber != matchedChambers.end();
734  matchedChamber++) {
735  const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet((*matchedChamber).id);
736  // DT chamber
737  if (const DTChamber* chamber = dynamic_cast<const DTChamber*>(geomDet)) {
738  // Get the range for the corresponding segments
739  DTRecSegment4DCollection::range range = dtSegments->get(chamber->id());
740  // Loop over the segments of this chamber
741  for (DTRecSegment4DCollection::const_iterator segment = range.first; segment != range.second; segment++) {
742  if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
743  matchedChamber->segments.back().dtSegmentRef = DTRecSegment4DRef(dtSegments, segment - dtSegments->begin());
744  }
745  }
746  }
747  // CSC Chamber
748  else if (const CSCChamber* chamber = dynamic_cast<const CSCChamber*>(geomDet)) {
749  // Get the range for the corresponding segments
751  // Loop over the segments
752  for (CSCSegmentCollection::const_iterator segment = range.first; segment != range.second; segment++) {
753  if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
754  matchedChamber->segments.back().cscSegmentRef = CSCSegmentRef(cscSegments, segment - cscSegments->begin());
755  }
756  }
757  } else {
758  // GEM Chamber
759  if (parameters.useGEM) {
760  if (const GEMSuperChamber* chamber = dynamic_cast<const GEMSuperChamber*>(geomDet)) {
761  // Get the range for the corresponding segments
763  // Loop over the segments
764  for (GEMSegmentCollection::const_iterator segment = range.first; segment != range.second; segment++) {
765  if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
766  matchedChamber->segments.back().gemSegmentRef =
767  GEMSegmentRef(gemSegments, segment - gemSegments->begin());
768  }
769  }
770  }
771  }
772  // ME0 Chamber
773  if (parameters.useME0) {
774  if (const ME0Chamber* chamber = dynamic_cast<const ME0Chamber*>(geomDet)) {
775  // Get the range for the corresponding segments
777  // Loop over the segments
778  for (ME0SegmentCollection::const_iterator segment = range.first; segment != range.second; segment++) {
779  if (addTAMuonSegmentMatch(*matchedChamber, &(*segment), parameters)) {
780  matchedChamber->segments.back().me0SegmentRef =
781  ME0SegmentRef(me0Segments, segment - me0Segments->begin());
782  }
783  }
784  }
785  }
786  }
787  info.chambers.push_back(*matchedChamber);
788  }
789 }

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 369 of file TrackDetectorAssociator.cc.

371  {
372  std::vector<GlobalPoint> trajectory;
373  const std::vector<SteppingHelixStateInfo>& trajectoryStates = cachedTrajectory_.getPreshowerTrajectory();
374  for (std::vector<SteppingHelixStateInfo>::const_iterator itr = trajectoryStates.begin();
375  itr != trajectoryStates.end();
376  itr++)
377  trajectory.push_back(itr->position());
378 
379  if (trajectory.empty()) {
380  LogTrace("TrackAssociator") << "Preshower trajectory is empty; moving on\n";
381  return;
382  }
383 
384  std::set<DetId> idsInRegion =
385  preshowerDetIdAssociator_->getDetIdsCloseToAPoint(trajectory[0], parameters.dRPreshowerPreselection);
386 
387  LogTrace("TrackAssociator") << "Number of Preshower Ids in the region: " << idsInRegion.size();
388  info.crossedPreshowerIds = preshowerDetIdAssociator_->getCrossedDetIds(idsInRegion, trajectory);
389  LogTrace("TrackAssociator") << "Number of Preshower Ids in crossed: " << info.crossedPreshowerIds.size();
390 }

References info(), and LogTrace.

◆ getCachedTrajector()

const CachedTrajectory& TrackDetectorAssociator::getCachedTrajector ( ) const
inline

trajector information

Definition at line 93 of file TrackDetectorAssociator.h.

93 { return cachedTrajectory_; }

References cachedTrajectory_.

◆ getFreeTrajectoryState() [1/3]

FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState ( const MagneticField bField,
const GlobalVector momentum,
const GlobalPoint vertex,
const int  charge 
)
static

Definition at line 539 of file TrackDetectorAssociator.cc.

542  {
543  GlobalTrajectoryParameters tPars(vertex, momentum, charge, bField);
544 
545  ROOT::Math::SMatrixIdentity id;
546  AlgebraicSymMatrix66 covT(id);
547  covT *= 1e-6; // initialize to sigma=1e-3
548  CartesianTrajectoryError tCov(covT);
549 
550  return FreeTrajectoryState(tPars, tCov);
551 }

References Calorimetry_cff::bField, ALCARECOTkAlJpsiMuMu_cff::charge, MillePedeFileConverter_cfg::e, triggerObjects_cff::id, and bphysicsOniaDQM_cfi::vertex.

◆ getFreeTrajectoryState() [2/3]

FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState ( const MagneticField bField,
const reco::Track track 
)
static

get FreeTrajectoryState from different track representations

Definition at line 553 of file TrackDetectorAssociator.cc.

554  {
555  GlobalVector vector(track.momentum().x(), track.momentum().y(), track.momentum().z());
556 
557  GlobalPoint point(track.vertex().x(), track.vertex().y(), track.vertex().z());
558 
560 
561  // FIX THIS !!!
562  // need to convert from perigee to global or helix (curvilinear) frame
563  // for now just an arbitrary matrix.
564  ROOT::Math::SMatrixIdentity id;
565  AlgebraicSymMatrix66 covT(id);
566  covT *= 1e-6; // initialize to sigma=1e-3
567  CartesianTrajectoryError tCov(covT);
568 
569  return FreeTrajectoryState(tPars, tCov);
570 }

References Calorimetry_cff::bField, MillePedeFileConverter_cfg::e, triggerObjects_cff::id, point, HLT_FULL_cff::track, and trackerHitRTTI::vector.

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

◆ getFreeTrajectoryState() [3/3]

FreeTrajectoryState TrackDetectorAssociator::getFreeTrajectoryState ( const MagneticField bField,
const SimTrack track,
const SimVertex vertex 
)
static

Definition at line 525 of file TrackDetectorAssociator.cc.

527  {
528  GlobalVector vector(track.momentum().x(), track.momentum().y(), track.momentum().z());
529  GlobalPoint point(vertex.position().x(), vertex.position().y(), vertex.position().z());
530 
531  int charge = track.type() > 0 ? -1 : 1; // lepton convention
532  if (abs(track.type()) == 211 || // pion
533  abs(track.type()) == 321 || // kaon
534  abs(track.type()) == 2212)
535  charge = track.type() < 0 ? -1 : 1;
537 }

References funct::abs(), Calorimetry_cff::bField, ALCARECOTkAlJpsiMuMu_cff::charge, point, HLT_FULL_cff::track, trackerHitRTTI::vector, and bphysicsOniaDQM_cfi::vertex.

◆ getMapRange()

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

Definition at line 572 of file TrackDetectorAssociator.cc.

572  {
573  DetIdAssociator::MapRange mapRange;
574  mapRange.dThetaPlus = dR;
575  mapRange.dThetaMinus = dR;
576  mapRange.dPhiPlus = dR;
577  mapRange.dPhiMinus = dR;
578  if (delta.first > 0)
579  mapRange.dThetaPlus += delta.first;
580  else
581  mapRange.dThetaMinus += std::abs(delta.first);
582  if (delta.second > 0)
583  mapRange.dPhiPlus += delta.second;
584  else
585  mapRange.dPhiMinus += std::abs(delta.second);
586  LogTrace("TrackAssociator") << "Selection range: (dThetaPlus, dThetaMinus, dPhiPlus, dPhiMinus, dRPreselection): "
587  << mapRange.dThetaPlus << ", " << mapRange.dThetaMinus << ", " << mapRange.dPhiPlus
588  << ", " << mapRange.dPhiMinus << ", " << dR;
589  return mapRange;
590 }

References funct::abs(), 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 135 of file TrackDetectorAssociator.h.

135  {
136  return math::XYZPoint(point.x(), point.y(), point.z());
137  }

References point.

◆ getPoint() [2/2]

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

Definition at line 139 of file TrackDetectorAssociator.h.

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

References point.

◆ getTAMuonChamberMatches()

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

Definition at line 592 of file TrackDetectorAssociator.cc.

593  {
594  // Strategy:
595  // Propagate through the whole detector, estimate change in eta and phi
596  // along the trajectory, add this to dRMuon and find DetIds around this
597  // direction using the map. Then propagate fast to each surface and apply
598  // final matching criteria.
599 
600  // get the direction first
602  // If trajectory point at HCAL is not valid, try to use the outer most state of the
603  // trajectory instead.
604  if (!trajectoryPoint.isValid())
605  trajectoryPoint = cachedTrajectory_.getOuterState();
606  if (!trajectoryPoint.isValid()) {
607  LogTrace("TrackAssociator")
608  << "trajectory position at HCAL is not valid. Assume the track cannot reach muon detectors and skip it";
609  return;
610  }
611 
612  GlobalVector direction = trajectoryPoint.momentum().unit();
613  LogTrace("TrackAssociator") << "muon direction: " << direction
614  << "\n\t and corresponding point: " << trajectoryPoint.position() << "\n";
615 
616  DetIdAssociator::MapRange mapRange =
618 
619  // and find chamber DetIds
620 
621  std::set<DetId> muonIdsInRegion = muonDetIdAssociator_->getDetIdsCloseToAPoint(trajectoryPoint.position(), mapRange);
622  LogTrace("TrackAssociator") << "Number of chambers to check: " << muonIdsInRegion.size();
623  for (std::set<DetId>::const_iterator detId = muonIdsInRegion.begin(); detId != muonIdsInRegion.end(); detId++) {
624  const GeomDet* geomDet = muonDetIdAssociator_->getGeomDet(*detId);
625  TrajectoryStateOnSurface stateOnSurface = cachedTrajectory_.propagate(&geomDet->surface());
626  if (!stateOnSurface.isValid()) {
627  LogTrace("TrackAssociator") << "Failed to propagate the track; moving on\n\t"
628  << "Element is not crosssed: " << DetIdInfo::info(*detId, nullptr) << "\n";
629  continue;
630  }
631  LocalPoint localPoint = geomDet->surface().toLocal(stateOnSurface.freeState()->position());
632  LocalError localError = stateOnSurface.localError().positionError();
633  float distanceX = 0.f;
634  float distanceY = 0.f;
635  if (const CSCChamber* cscChamber = dynamic_cast<const CSCChamber*>(geomDet)) {
636  const CSCChamberSpecs* chamberSpecs = cscChamber->specs();
637  if (!chamberSpecs) {
638  LogTrace("TrackAssociator") << "Failed to get CSCChamberSpecs from CSCChamber; moving on\n";
639  continue;
640  }
641  const CSCLayerGeometry* layerGeometry = chamberSpecs->oddLayerGeometry(1);
642  if (!layerGeometry) {
643  LogTrace("TrackAssociator") << "Failed to get CSCLayerGeometry from CSCChamberSpecs; moving on\n";
644  continue;
645  }
646  const CSCWireTopology* wireTopology = layerGeometry->wireTopology();
647  if (!wireTopology) {
648  LogTrace("TrackAssociator") << "Failed to get CSCWireTopology from CSCLayerGeometry; moving on\n";
649  continue;
650  }
651 
652  float wideWidth = wireTopology->wideWidthOfPlane();
653  float narrowWidth = wireTopology->narrowWidthOfPlane();
654  float length = wireTopology->lengthOfPlane();
655  // If slanted, there is no y offset between local origin and symmetry center of wire plane
656  float yOfFirstWire = std::abs(wireTopology->wireAngle()) > 1.E-06f ? -0.5 * length : wireTopology->yOfWire(1);
657  // y offset between local origin and symmetry center of wire plane
658  float yCOWPOffset = yOfFirstWire + 0.5f * length;
659 
660  // tangent of the incline angle from inside the trapezoid
661  float tangent = (wideWidth - narrowWidth) / (2.f * length);
662  // y position wrt bottom of trapezoid
663  float yPrime = localPoint.y() + std::abs(yOfFirstWire);
664  // half trapezoid width at y' is 0.5 * narrowWidth + x side of triangle with the above tangent and side y'
665  float halfWidthAtYPrime = 0.5f * narrowWidth + yPrime * tangent;
666  distanceX = std::abs(localPoint.x()) - halfWidthAtYPrime;
667  distanceY = std::abs(localPoint.y() - yCOWPOffset) - 0.5f * length;
668  } else {
669  distanceX = std::abs(localPoint.x()) - 0.5f * geomDet->surface().bounds().width();
670  distanceY = std::abs(localPoint.y()) - 0.5f * geomDet->surface().bounds().length();
671  }
672  if ((distanceX < parameters.muonMaxDistanceX && distanceY < parameters.muonMaxDistanceY) ||
673  (distanceX * distanceX <
674  localError.xx() * parameters.muonMaxDistanceSigmaX * parameters.muonMaxDistanceSigmaX &&
675  distanceY * distanceY <
676  localError.yy() * parameters.muonMaxDistanceSigmaY * parameters.muonMaxDistanceSigmaY)) {
677  LogTrace("TrackAssociator") << "found a match: " << DetIdInfo::info(*detId, nullptr) << "\n";
679  match.tState = stateOnSurface;
680  match.localDistanceX = distanceX;
681  match.localDistanceY = distanceY;
682  match.id = *detId;
683  matches.push_back(match);
684  } else {
685  LogTrace("TrackAssociator") << "chamber is too far: " << DetIdInfo::info(*detId, nullptr)
686  << "\n\tdistanceX: " << distanceX << "\t distanceY: " << distanceY
687  << "\t sigmaX: " << distanceX / sqrt(localError.xx())
688  << "\t sigmaY: " << distanceY / sqrt(localError.yy()) << "\n";
689  }
690  }
691 }

References funct::abs(), Surface::bounds(), f, TrajectoryStateOnSurface::freeState(), CachedTrajectory::FullTrajectory, DetIdInfo::info(), TrajectoryStateOnSurface::isValid(), SteppingHelixStateInfo::isValid(), Bounds::length(), CSCWireTopology::lengthOfPlane(), TrajectoryStateOnSurface::localError(), LogTrace, match(), oniaPATMuonsWithTrigger_cff::matches, SteppingHelixStateInfo::momentum(), CSCWireTopology::narrowWidthOfPlane(), CSCChamberSpecs::oddLayerGeometry(), SteppingHelixStateInfo::position(), FreeTrajectoryState::position(), LocalTrajectoryError::positionError(), 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 143 of file TrackDetectorAssociator.h.

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

◆ getVector() [2/2]

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

Definition at line 145 of file TrackDetectorAssociator.h.

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

◆ init()

void TrackDetectorAssociator::init ( const edm::EventSetup iSetup,
const AssociatorParameters parameters 
)
private

Definition at line 83 of file TrackDetectorAssociator.cc.

83  {
84  // access the calorimeter geometry
85  theCaloGeometry_ = &iSetup.getData(parameters.theCaloGeometryToken);
86 
87  // get the tracking Geometry
88  theTrackingGeometry_ = &iSetup.getData(parameters.theTrackingGeometryToken);
89 
91  // setup propagator
92  const MagneticField* bField = &iSetup.getData(parameters.bFieldToken);
93 
94  auto prop = std::make_unique<SteppingHelixPropagator>(bField, anyDirection);
95  prop->setMaterialMode(false);
96  prop->applyRadX0Correction(true);
97  // prop->setDebug(true); // tmp
98  defProp_ = std::move(prop);
99  setPropagator(defProp_.get());
100  }
101 
102  ecalDetIdAssociator_ = &iSetup.getData(parameters.ecalDetIdAssociatorToken);
103  hcalDetIdAssociator_ = &iSetup.getData(parameters.hcalDetIdAssociatorToken);
104  hoDetIdAssociator_ = &iSetup.getData(parameters.hoDetIdAssociatorToken);
105  caloDetIdAssociator_ = &iSetup.getData(parameters.caloDetIdAssociatorToken);
106  muonDetIdAssociator_ = &iSetup.getData(parameters.muonDetIdAssociatorToken);
107  preshowerDetIdAssociator_ = &iSetup.getData(parameters.preshowerDetIdAssociatorToken);
108 }

References anyDirection, Calorimetry_cff::bField, edm::EventSetup::getData(), and eostools::move().

◆ setPropagator()

void TrackDetectorAssociator::setPropagator ( const Propagator ptr)

use a user configured propagator

Definition at line 76 of file TrackDetectorAssociator.cc.

76  {
77  ivProp_ = ptr;
79 }

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 149 of file TrackDetectorAssociator.h.

Referenced by getCachedTrajector().

◆ caloDetIdAssociator_

const DetIdAssociator* TrackDetectorAssociator::caloDetIdAssociator_
private

Definition at line 155 of file TrackDetectorAssociator.h.

◆ defProp_

std::unique_ptr<Propagator> TrackDetectorAssociator::defProp_
private

Definition at line 148 of file TrackDetectorAssociator.h.

◆ ecalDetIdAssociator_

const DetIdAssociator* TrackDetectorAssociator::ecalDetIdAssociator_
private

Definition at line 152 of file TrackDetectorAssociator.h.

◆ hcalDetIdAssociator_

const DetIdAssociator* TrackDetectorAssociator::hcalDetIdAssociator_
private

Definition at line 153 of file TrackDetectorAssociator.h.

◆ hoDetIdAssociator_

const DetIdAssociator* TrackDetectorAssociator::hoDetIdAssociator_
private

Definition at line 154 of file TrackDetectorAssociator.h.

◆ ivProp_

const Propagator* TrackDetectorAssociator::ivProp_
private

Definition at line 147 of file TrackDetectorAssociator.h.

◆ muonDetIdAssociator_

const DetIdAssociator* TrackDetectorAssociator::muonDetIdAssociator_
private

Definition at line 156 of file TrackDetectorAssociator.h.

◆ preshowerDetIdAssociator_

const DetIdAssociator* TrackDetectorAssociator::preshowerDetIdAssociator_
private

Definition at line 157 of file TrackDetectorAssociator.h.

◆ theCaloGeometry_

const CaloGeometry* TrackDetectorAssociator::theCaloGeometry_
private

Definition at line 159 of file TrackDetectorAssociator.h.

◆ theMagneticFieldWatcher_

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

Definition at line 162 of file TrackDetectorAssociator.h.

◆ theTrackingGeometry_

const GlobalTrackingGeometry* TrackDetectorAssociator::theTrackingGeometry_
private

Definition at line 160 of file TrackDetectorAssociator.h.

◆ useDefaultPropagator_

bool TrackDetectorAssociator::useDefaultPropagator_
private

Definition at line 150 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:1056
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
DTRecSegment4D
Definition: DTRecSegment4D.h:23
TrackDetectorAssociator::Any
Definition: TrackDetectorAssociator.h:50
cscDigiValidation_cfi.simTrack
simTrack
Definition: cscDigiValidation_cfi.py:29
anyDirection
Definition: PropagationDirection.h:4
edm::SortedCollection< CaloTower >::const_iterator
std::vector< CaloTower >::const_iterator const_iterator
Definition: SortedCollection.h:80
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
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
HLT_FULL_cff.minR
minR
Definition: HLT_FULL_cff.py:95126
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
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
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
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
CachedTrajectory::setMinDetectorLength
void setMinDetectorLength(float l=0.)
Definition: CachedTrajectory.h:118
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
oniaPATMuonsWithTrigger_cff.matches
matches
Definition: oniaPATMuonsWithTrigger_cff.py:77
TrackDetectorAssociator::getVector
math::XYZVector getVector(const GlobalVector &vec)
Definition: TrackDetectorAssociator.h:143
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:4
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
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
TrackDetectorAssociator::addTAMuonSegmentMatch
bool addTAMuonSegmentMatch(TAMuonChamberMatch &, const RecSegment *, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:791
TrackDetectorAssociator::fillCaloTruth
void fillCaloTruth(const edm::Event &, TrackDetMatchInfo &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:888
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
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
TrackDetectorAssociator::defProp_
std::unique_ptr< Propagator > defProp_
Definition: TrackDetectorAssociator.h:148
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:392
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
TrackDetectorAssociator::ecalDetIdAssociator_
const DetIdAssociator * ecalDetIdAssociator_
Definition: TrackDetectorAssociator.h:152
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:295
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
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
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
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
TrackDetectorAssociator::ivProp_
const Propagator * ivProp_
Definition: TrackDetectorAssociator.h:147
spr::deltaEta
static const double deltaEta
Definition: CaloConstants.h:8
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:149
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
TrackDetectorAssociator::hcalDetIdAssociator_
const DetIdAssociator * hcalDetIdAssociator_
Definition: TrackDetectorAssociator.h:153
TrackDetectorAssociator::OutsideIn
Definition: TrackDetectorAssociator.h:50
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
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:76
TrackDetectorAssociator::getTAMuonChamberMatches
void getTAMuonChamberMatches(std::vector< TAMuonChamberMatch > &matches, const AssociatorParameters &parameters)
Definition: TrackDetectorAssociator.cc:592
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
TrackDetectorAssociator::init
void init(const edm::EventSetup &, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:83
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:693
TrackDetectorAssociator::getFreeTrajectoryState
static FreeTrajectoryState getFreeTrajectoryState(const MagneticField *, const reco::Track &)
get FreeTrajectoryState from different track representations
Definition: TrackDetectorAssociator.cc:553
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
TrackDetectorAssociator::hoDetIdAssociator_
const DetIdAssociator * hoDetIdAssociator_
Definition: TrackDetectorAssociator.h:154
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
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
TrackDetectorAssociator::muonDetIdAssociator_
const DetIdAssociator * muonDetIdAssociator_
Definition: TrackDetectorAssociator.h:156
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
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
ME0Chamber
Definition: ME0Chamber.h:10
TrackDetectorAssociator::getPoint
math::XYZPoint getPoint(const GlobalPoint &point)
Definition: TrackDetectorAssociator.h:135
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:49
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
TAMuonSegmentMatch::hasZed
bool hasZed
Definition: TAMuonSegmentMatch.h:24
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
TrackDetectorAssociator::theTrackingGeometry_
const GlobalTrackingGeometry * theTrackingGeometry_
Definition: TrackDetectorAssociator.h:160
TrackDetectorAssociator::InsideOut
Definition: TrackDetectorAssociator.h:50
SteppingHelixStateInfo::isValid
bool isValid() const
Definition: SteppingHelixStateInfo.h:65
CSCWireTopology::wideWidthOfPlane
double wideWidthOfPlane() const
Definition: CSCWireTopology.h:91
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
TAMuonChamberMatch
Definition: TAMuonChamberMatch.h:20
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:13
TrackDetectorAssociator::fillPreshower
void fillPreshower(const edm::Event &iEvent, TrackDetMatchInfo &info, const AssociatorParameters &)
Definition: TrackDetectorAssociator.cc:369
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:221
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DTRecSegment4D::hasZed
bool hasZed() const
Does it have the Z projection?
Definition: DTRecSegment4D.h:93
TrackDetectorAssociator::preshowerDetIdAssociator_
const DetIdAssociator * preshowerDetIdAssociator_
Definition: TrackDetectorAssociator.h:157
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:284
CSCLayerGeometry::wireTopology
const CSCWireTopology * wireTopology() const
Definition: CSCLayerGeometry.h:282
TrackDetectorAssociator::theMagneticFieldWatcher_
edm::ESWatcher< IdealMagneticFieldRecord > theMagneticFieldWatcher_
Definition: TrackDetectorAssociator.h:162
TAMuonSegmentMatch
Definition: TAMuonSegmentMatch.h:11
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
TrackDetectorAssociator::caloDetIdAssociator_
const DetIdAssociator * caloDetIdAssociator_
Definition: TrackDetectorAssociator.h:155
CSCWireTopology::yOfWire
float yOfWire(float wire, float x=0.) const
Definition: CSCWireTopology.h:81
TrackDetectorAssociator::theCaloGeometry_
const CaloGeometry * theCaloGeometry_
Definition: TrackDetectorAssociator.h:159
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:245
CSCWireTopology
Definition: CSCWireTopology.h:18
TrackDetectorAssociator::getMapRange
DetIdAssociator::MapRange getMapRange(const std::pair< float, float > &delta, const float dR)
Definition: TrackDetectorAssociator.cc:572
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:150
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
DTRecSegment4D::hasPhi
bool hasPhi() const
Does it have the Phi projection?
Definition: DTRecSegment4D.h:90
TrackDetectorAssociator::cachedTrajectory_
CachedTrajectory cachedTrajectory_
Definition: TrackDetectorAssociator.h:149
CachedTrajectory::getHOTrajectory
const std::vector< SteppingHelixStateInfo > & getHOTrajectory() const
Definition: CachedTrajectory.cc:475
TAMuonChamberMatch::tState
TrajectoryStateOnSurface tState
Definition: TAMuonChamberMatch.h:30
mps_fire.result
result
Definition: mps_fire.py:311
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:110
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
HGCalValidator_cfi.simVertices
simVertices
Definition: HGCalValidator_cfi.py:57
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
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7733
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
MagneticField
Definition: MagneticField.h:19
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
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:460
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
filterRecHits_cfi.EBRecHits
EBRecHits
Definition: filterRecHits_cfi.py:8