CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
PropagateToMuon Class Reference

Propagate an object (usually a track) to the second muon station. Support for other muon stations will be added on request. More...

#include "MuonAnalysis/MuonAssociators/interface/PropagateToMuon.h"

Public Member Functions

TrajectoryStateOnSurface extrapolate (const reco::Track &tk) const
 Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails. More...
 
TrajectoryStateOnSurface extrapolate (const reco::Candidate &tk) const
 Extrapolate reco::Candidate to the muon station 2, return an invalid TSOS if it fails. More...
 
TrajectoryStateOnSurface extrapolate (const SimTrack &tk, const edm::SimVertexContainer &vtxs) const
 
TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &state) const
 Extrapolate a FreeTrajectoryState to the muon station 2, return an invalid TSOS if it fails. More...
 
void init (const edm::EventSetup &iSetup)
 Call this method at the beginning of each event, to initialize geometry, magnetic field and propagators. More...
 
 PropagateToMuon (const edm::ParameterSet &iConfig, edm::ConsumesCollector)
 
 ~PropagateToMuon ()
 

Private Types

enum  WhichState { AtVertex, Innermost, Outermost }
 
enum  WhichTrack { None, TrackerTk, MuonTk, GlobalTk }
 

Private Member Functions

TrajectoryStateOnSurface getBestDet (const TrajectoryStateOnSurface &tsos, const DetLayer *station) const
 Get the best TSOS on one of the chambres of this DetLayer, or an invalid TSOS if none match. More...
 
FreeTrajectoryState startingState (const reco::Candidate &reco) const
 Starting state for the propagation. More...
 
FreeTrajectoryState startingState (const reco::Track &tk) const
 Starting state for the propagation. More...
 
FreeTrajectoryState startingState (const SimTrack &tk, const edm::SimVertexContainer &vtxs) const
 Starting state for the propagation. More...
 

Private Attributes

const BoundCylinderbarrelCylinder_
 
double barrelHalfLength_
 
bool cosmicPropagation_
 for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states are in-out really More...
 
const BoundDiskendcapDiskNeg_ [3]
 
const BoundDiskendcapDiskPos_ [3]
 
std::pair< float, float > endcapRadii_ [3]
 
bool fallbackToME1_
 Fallback to ME1 if propagation to ME2 fails. More...
 
edm::ESHandle< MagneticFieldmagfield_
 
edm::ESGetToken< MagneticField,
IdealMagneticFieldRecord
magfieldToken_
 
edm::ESHandle
< MuonDetLayerGeometry
muonGeometry_
 
edm::ESGetToken
< MuonDetLayerGeometry,
MuonRecoGeometryRecord
muonGeometryToken_
 
edm::ESHandle< Propagatorpropagator_
 
edm::ESHandle< PropagatorpropagatorAny_
 
edm::ESGetToken< Propagator,
TrackingComponentsRecord
propagatorAnyToken_
 
edm::ESHandle< PropagatorpropagatorOpposite_
 
edm::ESGetToken< Propagator,
TrackingComponentsRecord
propagatorOppositeToken_
 
edm::ESGetToken< Propagator,
TrackingComponentsRecord
propagatorToken_
 
bool useMB2_
 Propagate to MB2 (default) instead of MB1. More...
 
bool useMB2InOverlap_
 
bool useSimpleGeometry_
 Use simplified geometry (cylinders and disks, not individual chambers) More...
 
WhichState whichState_
 
WhichTrack whichTrack_
 Labels for input collections. More...
 

Detailed Description

Propagate an object (usually a track) to the second muon station. Support for other muon stations will be added on request.

"HLTriggerOffline/Muon/interface/PropagateToMuon.h"

Author
Giovanni Petrucciani
Giovanni Petrucciani
Version
Id:
PropagateToMuon.h,v 1.3 2010/07/01 07:41:09 gpetrucc Exp

Definition at line 35 of file PropagateToMuon.h.

Member Enumeration Documentation

Enumerator
AtVertex 
Innermost 
Outermost 

Definition at line 61 of file PropagateToMuon.h.

Enumerator
None 
TrackerTk 
MuonTk 
GlobalTk 

Definition at line 60 of file PropagateToMuon.h.

Constructor & Destructor Documentation

PropagateToMuon::PropagateToMuon ( const edm::ParameterSet iConfig,
edm::ConsumesCollector  iC 
)
explicit

Definition at line 17 of file PropagateToMuon.cc.

References AtVertex, cosmicPropagation_, Exception, edm::ParameterSet::getParameter(), GlobalTk, Innermost, MuonTk, None, Outermost, AlCaHLTBitMon_QueryRunRegistry::string, TrackerTk, whichState_, and whichTrack_.

18  : useSimpleGeometry_(iConfig.getParameter<bool>("useSimpleGeometry")),
19  useMB2_(iConfig.existsAs<bool>("useStation2") ? iConfig.getParameter<bool>("useStation2") : true),
20  fallbackToME1_(iConfig.existsAs<bool>("fallbackToME1") ? iConfig.getParameter<bool>("fallbackToME1") : false),
23  cosmicPropagation_(iConfig.existsAs<bool>("cosmicPropagationHypothesis")
24  ? iConfig.getParameter<bool>("cosmicPropagationHypothesis")
25  : false),
26  useMB2InOverlap_(iConfig.existsAs<bool>("useMB2InOverlap") ? iConfig.getParameter<bool>("useMB2InOverlap")
27  : false),
28  magfieldToken_(iC.esConsumes<>()),
29  propagatorToken_(iC.esConsumes<>(edm::ESInputTag("", "SteppingHelixPropagatorAlong"))),
30  propagatorAnyToken_(iC.esConsumes<>(edm::ESInputTag("", "SteppingHelixPropagatorAny"))),
31  propagatorOppositeToken_(iC.esConsumes<>(edm::ESInputTag("", "SteppingHelixPropagatorOpposite"))),
33  std::string whichTrack = iConfig.getParameter<std::string>("useTrack");
34  if (whichTrack == "none") {
35  whichTrack_ = None;
36  } else if (whichTrack == "tracker") {
38  } else if (whichTrack == "muon") {
40  } else if (whichTrack == "global") {
42  } else
43  throw cms::Exception("Configuration") << "Parameter 'useTrack' must be 'none', 'tracker', 'muon', 'global'\n";
44  if (whichTrack_ != None) {
45  std::string whichState = iConfig.getParameter<std::string>("useState");
46  if (whichState == "atVertex") {
48  } else if (whichState == "innermost") {
50  } else if (whichState == "outermost") {
52  } else
53  throw cms::Exception("Configuration") << "Parameter 'useState' must be 'atVertex', 'innermost', 'outermost'\n";
54  }
56  throw cms::Exception("Configuration") << "When using 'cosmicPropagationHypothesis' useTrack must not be 'none', "
57  "and the state must not be 'atVertex'\n";
58  }
59 }
WhichTrack whichTrack_
Labels for input collections.
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
WhichState whichState_
bool useMB2_
Propagate to MB2 (default) instead of MB1.
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorOppositeToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
bool cosmicPropagation_
for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states...
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< MuonDetLayerGeometry, MuonRecoGeometryRecord > muonGeometryToken_
bool useSimpleGeometry_
Use simplified geometry (cylinders and disks, not individual chambers)
bool fallbackToME1_
Fallback to ME1 if propagation to ME2 fails.
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorAnyToken_
PropagateToMuon::~PropagateToMuon ( )

Definition at line 61 of file PropagateToMuon.cc.

61 {}

Member Function Documentation

TrajectoryStateOnSurface PropagateToMuon::extrapolate ( const reco::Track tk) const
inline

Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails.

Definition at line 44 of file PropagateToMuon.h.

References extrapolate(), and startingState().

Referenced by L1MuonMatcherAlgo::extrapolate(), extrapolate(), MuonGmtPair::MuonGmtPair(), and TriggerMatcherToHLTDebug::produce().

44 { return extrapolate(startingState(tk)); }
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails.
FreeTrajectoryState startingState(const reco::Candidate &reco) const
Starting state for the propagation.
TrajectoryStateOnSurface PropagateToMuon::extrapolate ( const reco::Candidate tk) const
inline

Extrapolate reco::Candidate to the muon station 2, return an invalid TSOS if it fails.

Definition at line 47 of file PropagateToMuon.h.

References extrapolate(), and startingState().

Referenced by extrapolate().

47 { return extrapolate(startingState(tk)); }
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails.
FreeTrajectoryState startingState(const reco::Candidate &reco) const
Starting state for the propagation.
TrajectoryStateOnSurface PropagateToMuon::extrapolate ( const SimTrack tk,
const edm::SimVertexContainer vtxs 
) const
inline

Extrapolate a SimTrack to the muon station 2, return an invalid TSOS if it fails; needs the SimVertices too, to know where to start from Note: it will throw an exception if the SimTrack has no vertex.

Definition at line 52 of file PropagateToMuon.h.

References extrapolate(), and startingState().

52  {
53  return extrapolate(startingState(tk, vtxs));
54  }
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
Extrapolate reco::Track to the muon station 2, return an invalid TSOS if it fails.
FreeTrajectoryState startingState(const reco::Candidate &reco) const
Starting state for the propagation.
TrajectoryStateOnSurface PropagateToMuon::extrapolate ( const FreeTrajectoryState state) const

Extrapolate a FreeTrajectoryState to the muon station 2, return an invalid TSOS if it fails.

Definition at line 161 of file PropagateToMuon.cc.

References AtVertex, barrelCylinder_, barrelHalfLength_, cosmicPropagation_, Vector3DBase< T, FrameTag >::dot(), endcapDiskNeg_, endcapDiskPos_, endcapRadii_, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), Exception, fallbackToME1_, first, getBestDet(), TrajectoryStateOnSurface::globalPosition(), edm::ESHandleBase::isValid(), sistrip::SpyUtilities::isValid(), TrajectoryStateOnSurface::isValid(), PV3DBase< T, PVType, FrameType >::mag(), magfield_, FreeTrajectoryState::momentum(), muonGeometry_, PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), position, Propagator::propagate(), propagator_, propagatorOpposite_, rho, edm::second(), useMB2_, useSimpleGeometry_, whichState_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

161  {
162  if (!magfield_.isValid() || barrelCylinder_ == nullptr) {
163  throw cms::Exception("NotInitialized")
164  << "PropagateToMuon: You must call init(const edm::EventSetup &iSetup) before using this object.\n";
165  }
166 
168  if (start.momentum().mag() == 0)
169  return final;
170  double eta = start.momentum().eta();
171 
172  const Propagator *propagatorBarrel = &*propagator_;
173  const Propagator *propagatorEndcaps = &*propagator_;
174  if (whichState_ != AtVertex) {
175  if (start.position().perp() > barrelCylinder_->radius())
176  propagatorBarrel = &*propagatorOpposite_;
177  if (fabs(start.position().z()) > endcapDiskPos_[useMB2_ ? 2 : 1]->position().z())
178  propagatorEndcaps = &*propagatorOpposite_;
179  }
180  if (cosmicPropagation_) {
181  if (start.momentum().dot(GlobalVector(start.position().x(), start.position().y(), start.position().z())) < 0) {
182  // must flip the propagations
183  propagatorBarrel = (propagatorBarrel == &*propagator_ ? &*propagatorOpposite_ : &*propagator_);
184  propagatorEndcaps = (propagatorEndcaps == &*propagator_ ? &*propagatorOpposite_ : &*propagator_);
185  }
186  }
187 
188  TrajectoryStateOnSurface tsos = propagatorBarrel->propagate(start, *barrelCylinder_);
189  if (tsos.isValid()) {
190  if (useSimpleGeometry_) {
191  //std::cout << " propagated to barrel, z = " << tsos.globalPosition().z() << ", bound = " << barrelHalfLength_ << std::endl;
192  if (fabs(tsos.globalPosition().z()) <= barrelHalfLength_)
193  final = tsos;
194  } else {
195  final = getBestDet(tsos, muonGeometry_->allDTLayers()[1]);
196  }
197  }
198  if (!final.isValid()) {
199  for (int ie = (useMB2_ ? 2 : 1); ie >= 0; --ie) {
200  tsos = propagatorEndcaps->propagate(start, (eta > 0 ? *endcapDiskPos_[ie] : *endcapDiskNeg_[ie]));
201  if (tsos.isValid()) {
202  if (useSimpleGeometry_) {
203  float rho = tsos.globalPosition().perp();
204  //std::cout << " propagated to endcap " << ie << ", rho = " << rho << ", bounds [ " << endcapRadii_[ie].first << ", " << endcapRadii_[ie].second << "]" << std::endl;
205  if ((rho >= endcapRadii_[ie].first) && (rho <= endcapRadii_[ie].second))
206  final = tsos;
207  } else {
208  final = getBestDet(
209  tsos, (eta > 0 ? muonGeometry_->forwardCSCLayers()[ie] : muonGeometry_->backwardCSCLayers()[ie]));
210  }
211  } //else //std::cout << " failed to propagated to endcap " << ie << std::endl;
212  if (final.isValid())
213  break;
214  if (ie == 2 && !fallbackToME1_)
215  break;
216  }
217  }
218  return final;
219 }
const BoundDisk * endcapDiskNeg_[3]
edm::ESHandle< Propagator > propagator_
const BoundCylinder * barrelCylinder_
T perp() const
Definition: PV3DBase.h:69
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
WhichState whichState_
GlobalPoint globalPosition() const
bool useMB2_
Propagate to MB2 (default) instead of MB1.
TrajectoryStateOnSurface getBestDet(const TrajectoryStateOnSurface &tsos, const DetLayer *station) const
Get the best TSOS on one of the chambres of this DetLayer, or an invalid TSOS if none match...
U second(std::pair< T, U > const &p)
edm::ESHandle< Propagator > propagatorOpposite_
T z() const
Definition: PV3DBase.h:61
edm::ESHandle< MagneticField > magfield_
bool cosmicPropagation_
for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states...
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
std::pair< float, float > endcapRadii_[3]
edm::ESHandle< MuonDetLayerGeometry > muonGeometry_
bool useSimpleGeometry_
Use simplified geometry (cylinders and disks, not individual chambers)
static int position[264][3]
Definition: ReadPGInfo.cc:289
bool fallbackToME1_
Fallback to ME1 if propagation to ME2 fails.
const BoundDisk * endcapDiskPos_[3]
double barrelHalfLength_
bool isValid() const
Definition: ESHandle.h:44
Global3DVector GlobalVector
Definition: GlobalVector.h:10
TrajectoryStateOnSurface PropagateToMuon::getBestDet ( const TrajectoryStateOnSurface tsos,
const DetLayer station 
) const
private

Get the best TSOS on one of the chambres of this DetLayer, or an invalid TSOS if none match.

Definition at line 221 of file PropagateToMuon.cc.

References GeometricSearchDet::compatibleDets(), propagatorAny_, and runTheMatrix::ret.

Referenced by extrapolate().

222  {
223  TrajectoryStateOnSurface ret; // start as null
224  Chi2MeasurementEstimator estimator(1e10, 3.); // require compatibility at 3 sigma
225  std::vector<GeometricSearchDet::DetWithState> dets = layer->compatibleDets(tsos, *propagatorAny_, estimator);
226  if (!dets.empty()) {
227  ret = dets.front().second;
228  }
229  return ret;
230 }
tuple ret
prodAgent to be discontinued
edm::ESHandle< Propagator > propagatorAny_
constexpr std::array< uint8_t, layerIndexSize > layer
void PropagateToMuon::init ( const edm::EventSetup iSetup)

Call this method at the beginning of each event, to initialize geometry, magnetic field and propagators.

Definition at line 63 of file PropagateToMuon.cc.

References barrelCylinder_, barrelHalfLength_, endcapDiskNeg_, endcapDiskPos_, endcapRadii_, edm::EventSetup::getHandle(), mps_fire::i, magfield_, magfieldToken_, muonGeometry_, muonGeometryToken_, propagator_, propagatorAny_, propagatorAnyToken_, propagatorOpposite_, propagatorOppositeToken_, propagatorToken_, GeometricSearchDet::surface(), useMB2_, and useMB2InOverlap_.

Referenced by L1TMuonDQMOffline::analyze(), L1MuonMatcherAlgo::init(), and TriggerMatcherToHLTDebug::produce().

63  {
69 
70  // Get the barrel cylinder
71  const DetLayer *dtLay = muonGeometry_->allDTLayers()[useMB2_ ? 1 : 0];
72  barrelCylinder_ = dynamic_cast<const BoundCylinder *>(&dtLay->surface());
73  barrelHalfLength_ = barrelCylinder_->bounds().length() / 2;
74  ;
75  //std::cout << "L1MuonMatcher: barrel radius = " << barrelCylinder_->radius() << ", half length = " << barrelHalfLength_ << std::endl;
76 
77  // Get the endcap disks. Note that ME1 has two disks (ME1/1 and ME2/1-ME3/2-ME4/1), so there's one more index
78  for (size_t i = 0; i <= (useMB2_ ? 2 : 1); ++i) {
79  endcapDiskPos_[i] = dynamic_cast<const BoundDisk *>(&muonGeometry_->forwardCSCLayers()[i]->surface());
80  endcapDiskNeg_[i] = dynamic_cast<const BoundDisk *>(&muonGeometry_->backwardCSCLayers()[i]->surface());
81  endcapRadii_[i] = std::make_pair(endcapDiskPos_[i]->innerRadius(), endcapDiskPos_[i]->outerRadius());
82  //std::cout << "L1MuonMatcher: endcap " << i << " Z = " << endcapDiskPos_[i]->position().z() << ", radii = " << endcapRadii_[i].first << "," << endcapRadii_[i].second << std::endl;
83  }
84 
86  barrelHalfLength_ = endcapDiskPos_[2]->position().z();
87 }
const BoundDisk * endcapDiskNeg_[3]
edm::ESHandle< Propagator > propagator_
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
const BoundCylinder * barrelCylinder_
bool useMB2_
Propagate to MB2 (default) instead of MB1.
edm::ESHandle< Propagator > propagatorAny_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorOppositeToken_
edm::ESHandle< Propagator > propagatorOpposite_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
edm::ESHandle< MagneticField > magfield_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
edm::ESGetToken< MuonDetLayerGeometry, MuonRecoGeometryRecord > muonGeometryToken_
std::pair< float, float > endcapRadii_[3]
edm::ESHandle< MuonDetLayerGeometry > muonGeometry_
const BoundDisk * endcapDiskPos_[3]
double barrelHalfLength_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorAnyToken_
FreeTrajectoryState PropagateToMuon::startingState ( const reco::Candidate reco) const
private

Starting state for the propagation.

Definition at line 89 of file PropagateToMuon.cc.

References reco::Candidate::charge(), reco::RecoCandidate::combinedMuon(), Exception, GlobalTk, edm::Ref< C, T, F >::isNull(), magfield_, MuonTk, None, edm::ESHandle< class >::product(), reco::Candidate::px(), reco::Candidate::py(), reco::Candidate::pz(), dt_dqm_sourceclient_common_cff::reco, runTheMatrix::ret, reco::RecoCandidate::standAloneMuon(), reco::RecoCandidate::track(), TrackerTk, reco::Candidate::vx(), reco::Candidate::vy(), reco::Candidate::vz(), and whichTrack_.

Referenced by extrapolate().

89  {
91  if (whichTrack_ != None) {
92  const reco::RecoCandidate *rc = dynamic_cast<const reco::RecoCandidate *>(&reco);
93  if (rc == nullptr)
94  throw cms::Exception("Invalid Data") << "Input object is not a RecoCandidate.\n";
95  reco::TrackRef tk;
96  switch (whichTrack_) {
97  case TrackerTk:
98  tk = rc->track();
99  break;
100  case MuonTk:
101  tk = rc->standAloneMuon();
102  break;
103  case GlobalTk:
104  tk = rc->combinedMuon();
105  break;
106  default:
107  break; // just to make gcc happy
108  }
109  if (tk.isNull()) {
110  ret = FreeTrajectoryState();
111  } else {
112  ret = startingState(*tk);
113  }
114  } else {
115  ret = FreeTrajectoryState(GlobalPoint(reco.vx(), reco.vy(), reco.vz()),
116  GlobalVector(reco.px(), reco.py(), reco.pz()),
117  reco.charge(),
118  magfield_.product());
119  }
120  return ret;
121 }
WhichTrack whichTrack_
Labels for input collections.
tuple ret
prodAgent to be discontinued
FreeTrajectoryState startingState(const reco::Candidate &reco) const
Starting state for the propagation.
virtual double pz() const =0
z coordinate of momentum vector
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual double vx() const =0
x coordinate of vertex position
virtual reco::TrackRef standAloneMuon() const
reference to a stand-alone muon Track
virtual double vy() const =0
y coordinate of vertex position
virtual reco::TrackRef track() const
reference to a Track
edm::ESHandle< MagneticField > magfield_
virtual int charge() const =0
electric charge
virtual double py() const =0
y coordinate of momentum vector
bool isNull() const
Checks for null.
Definition: Ref.h:235
virtual double px() const =0
x coordinate of momentum vector
T const * product() const
Definition: ESHandle.h:86
virtual double vz() const =0
z coordinate of vertex position
Global3DVector GlobalVector
Definition: GlobalVector.h:10
virtual reco::TrackRef combinedMuon() const
reference to a stand-alone muon Track
FreeTrajectoryState PropagateToMuon::startingState ( const reco::Track tk) const
private

Starting state for the propagation.

Definition at line 123 of file PropagateToMuon.cc.

References AtVertex, cosmicPropagation_, trajectoryStateTransform::initialFreeState(), trajectoryStateTransform::innerFreeState(), Innermost, reco::Track::innerPosition(), edm::ESHandleBase::isValid(), magfield_, trajectoryStateTransform::outerFreeState(), Outermost, reco::Track::outerPosition(), edm::ESHandle< class >::product(), and whichState_.

123  {
124  if (!magfield_.isValid())
125  throw cms::Exception("NotInitialized")
126  << "PropagateToMuon: You must call init(const edm::EventSetup &iSetup) before using this object.\n";
128  if (cosmicPropagation_) {
129  if (whichState_ == Innermost) {
130  state = tk.innerPosition().Mag2() <= tk.outerPosition().Mag2() ? Innermost : Outermost;
131  } else if (whichState_ == Outermost) {
132  state = tk.innerPosition().Mag2() <= tk.outerPosition().Mag2() ? Outermost : Innermost;
133  }
134  }
135  switch (state) {
136  case Innermost:
138  case Outermost:
140 
141  case AtVertex:
142  default:
144  }
145 }
WhichState whichState_
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
edm::ESHandle< MagneticField > magfield_
bool cosmicPropagation_
for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states...
T const * product() const
Definition: ESHandle.h:86
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
bool isValid() const
Definition: ESHandle.h:44
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
FreeTrajectoryState PropagateToMuon::startingState ( const SimTrack tk,
const edm::SimVertexContainer vtxs 
) const
private

Starting state for the propagation.

Definition at line 147 of file PropagateToMuon.cc.

References CoreSimTrack::charge(), edm::ESHandleBase::isValid(), magfield_, CoreSimTrack::momentum(), SimTrack::noVertex(), edm::ESHandle< class >::product(), and SimTrack::vertIndex().

147  {
148  if (!magfield_.isValid())
149  throw cms::Exception("NotInitialized")
150  << "PropagateToMuon: You must call init(const edm::EventSetup &iSetup) before using this object.\n";
151  if (tk.noVertex())
152  throw cms::Exception("UnsupportedOperation")
153  << "I can't propagate simtracks without a vertex, I don't know where to start from.\n";
154  const math::XYZTLorentzVectorD &vtx = (vtxs)[tk.vertIndex()].position();
155  return FreeTrajectoryState(GlobalPoint(vtx.X(), vtx.Y(), vtx.Z()),
156  GlobalVector(tk.momentum().X(), tk.momentum().Y(), tk.momentum().Z()),
157  int(tk.charge()),
158  magfield_.product());
159 }
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
float charge() const
charge
Definition: CoreSimTrack.cc:17
edm::ESHandle< MagneticField > magfield_
bool noVertex() const
Definition: SimTrack.h:34
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
Definition: SimTrack.h:33
T const * product() const
Definition: ESHandle.h:86
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
bool isValid() const
Definition: ESHandle.h:44
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

const BoundCylinder* PropagateToMuon::barrelCylinder_
private

Definition at line 90 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

double PropagateToMuon::barrelHalfLength_
private

Definition at line 92 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

bool PropagateToMuon::cosmicPropagation_
private

for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states are in-out really

Definition at line 77 of file PropagateToMuon.h.

Referenced by extrapolate(), PropagateToMuon(), and startingState().

const BoundDisk * PropagateToMuon::endcapDiskNeg_[3]
private

Definition at line 91 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

const BoundDisk* PropagateToMuon::endcapDiskPos_[3]
private

Definition at line 91 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

std::pair<float, float> PropagateToMuon::endcapRadii_[3]
private

Definition at line 93 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

bool PropagateToMuon::fallbackToME1_
private

Fallback to ME1 if propagation to ME2 fails.

Definition at line 70 of file PropagateToMuon.h.

Referenced by extrapolate().

edm::ESHandle<MagneticField> PropagateToMuon::magfield_
private

Definition at line 82 of file PropagateToMuon.h.

Referenced by extrapolate(), init(), and startingState().

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> PropagateToMuon::magfieldToken_
private

Definition at line 86 of file PropagateToMuon.h.

Referenced by init().

edm::ESHandle<MuonDetLayerGeometry> PropagateToMuon::muonGeometry_
private

Definition at line 84 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

edm::ESGetToken<MuonDetLayerGeometry, MuonRecoGeometryRecord> PropagateToMuon::muonGeometryToken_
private

Definition at line 88 of file PropagateToMuon.h.

Referenced by init().

edm::ESHandle<Propagator> PropagateToMuon::propagator_
private

Definition at line 83 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

edm::ESHandle<Propagator> PropagateToMuon::propagatorAny_
private

Definition at line 83 of file PropagateToMuon.h.

Referenced by getBestDet(), and init().

edm::ESGetToken<Propagator, TrackingComponentsRecord> PropagateToMuon::propagatorAnyToken_
private

Definition at line 87 of file PropagateToMuon.h.

Referenced by init().

edm::ESHandle<Propagator> PropagateToMuon::propagatorOpposite_
private

Definition at line 83 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

edm::ESGetToken<Propagator, TrackingComponentsRecord> PropagateToMuon::propagatorOppositeToken_
private

Definition at line 87 of file PropagateToMuon.h.

Referenced by init().

edm::ESGetToken<Propagator, TrackingComponentsRecord> PropagateToMuon::propagatorToken_
private

Definition at line 87 of file PropagateToMuon.h.

Referenced by init().

bool PropagateToMuon::useMB2_
private

Propagate to MB2 (default) instead of MB1.

Definition at line 67 of file PropagateToMuon.h.

Referenced by extrapolate(), and init().

bool PropagateToMuon::useMB2InOverlap_
private

Definition at line 79 of file PropagateToMuon.h.

Referenced by init().

bool PropagateToMuon::useSimpleGeometry_
private

Use simplified geometry (cylinders and disks, not individual chambers)

Definition at line 64 of file PropagateToMuon.h.

Referenced by extrapolate().

WhichState PropagateToMuon::whichState_
private

Definition at line 74 of file PropagateToMuon.h.

Referenced by extrapolate(), PropagateToMuon(), and startingState().

WhichTrack PropagateToMuon::whichTrack_
private

Labels for input collections.

Definition at line 73 of file PropagateToMuon.h.

Referenced by PropagateToMuon(), and startingState().