CMS 3D CMS Logo

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
 
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
 
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 FreeTrajectoryState &state) const
 
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)
 
void init (const edm::EventSetup &iSetup)
 Call this method at the beginning of each run, to initialize geometry, magnetic field and propagators. More...
 
 PropagateToMuon (const edm::ParameterSet &iConfig)
 
 PropagateToMuon (const edm::ParameterSet &iConfig)
 
 ~PropagateToMuon ()
 
 ~PropagateToMuon ()
 

Private Types

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

Private Member Functions

TrajectoryStateOnSurface getBestDet (const TrajectoryStateOnSurface &tsos, const DetLayer *station) const
 
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 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_
 
const BoundDiskendcapDiskPos_
 
std::pair< float, float > endcapRadii_
 
bool fallbackToME1_
 Fallback to ME1 if propagation to ME2 fails. More...
 
edm::ESHandle< MagneticFieldmagfield_
 
edm::ESHandle< MuonDetLayerGeometrymuonGeometry_
 
edm::ESHandle< Propagatorpropagator_
 
edm::ESHandle< PropagatorpropagatorAny_
 
edm::ESHandle< PropagatorpropagatorOpposite_
 
bool useMB2_
 Propagate to MB2 (default) instead of MB1. More...
 
bool useMB2InOverlap_
 
bool useSimpleGeometry_
 Labels for input collections. 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 29 of file PropagateToMuon.h.

Member Enumeration Documentation

Enumerator
AtVertex 
Innermost 
Outermost 
AtVertex 
Innermost 
Outermost 

Definition at line 52 of file PropagateToMuon.h.

Enumerator
AtVertex 
Innermost 
Outermost 
AtVertex 
Innermost 
Outermost 

Definition at line 55 of file PropagateToMuon.h.

Enumerator
None 
TrackerTk 
MuonTk 
GlobalTk 
None 
TrackerTk 
MuonTk 
GlobalTk 

Definition at line 51 of file PropagateToMuon.h.

Enumerator
None 
TrackerTk 
MuonTk 
GlobalTk 
None 
TrackerTk 
MuonTk 
GlobalTk 

Definition at line 54 of file PropagateToMuon.h.

Constructor & Destructor Documentation

PropagateToMuon::PropagateToMuon ( const edm::ParameterSet iConfig)
explicit

Definition at line 18 of file PropagateToMuon.cc.

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

19  : useSimpleGeometry_(iConfig.getParameter<bool>("useSimpleGeometry")),
22  cosmicPropagation_(iConfig.existsAs<bool>("cosmicPropagationHypothesis")
23  ? iConfig.getParameter<bool>("cosmicPropagationHypothesis")
24  : false) {
25  std::string whichTrack = iConfig.getParameter<std::string>("useTrack");
26  if (whichTrack == "none") {
27  whichTrack_ = None;
28  } else if (whichTrack == "tracker") {
30  } else if (whichTrack == "muon") {
32  } else if (whichTrack == "global") {
34  } else
35  throw cms::Exception("Configuration") << "Parameter 'useTrack' must be 'none', 'tracker', 'muon', 'global'\n";
36  if (whichTrack_ != None) {
37  std::string whichState = iConfig.getParameter<std::string>("useState");
38  if (whichState == "atVertex") {
40  } else if (whichState == "innermost") {
42  } else if (whichState == "outermost") {
44  } else
45  throw cms::Exception("Configuration") << "Parameter 'useState' must be 'atVertex', 'innermost', "
46  "'outermost'\n";
47  }
49  throw cms::Exception("Configuration") << "When using 'cosmicPropagationHypothesis' useTrack must not be "
50  "'none', and the state must not be 'atVertex'\n";
51  }
52 }
WhichTrack whichTrack_
Labels for input collections.
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
WhichState whichState_
bool cosmicPropagation_
for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states...
bool useSimpleGeometry_
Labels for input collections.
PropagateToMuon::~PropagateToMuon ( )

Definition at line 54 of file PropagateToMuon.cc.

54 {}
PropagateToMuon::PropagateToMuon ( const edm::ParameterSet iConfig)
explicit
PropagateToMuon::~PropagateToMuon ( )

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 40 of file PropagateToMuon.h.

References extrapolate(), and startingState().

Referenced by L1MuonMatcherAlgo::extrapolate(), extrapolate(), MuonGmtPair::MuonGmtPair(), TriggerMatcherToHLTDebug::produce(), L1Analysis::L1AnalysisRecoMuon2::SetMuon(), and startingState().

40 { return extrapolate(startingState(tk)); }
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
FreeTrajectoryState startingState(const reco::Candidate &reco) const
Starting state for the propagation.
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 41 of file PropagateToMuon.h.

References extrapolate(), and startingState().

Referenced by extrapolate().

41 { return extrapolate(startingState(tk)); }
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
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 44 of file PropagateToMuon.h.

References extrapolate(), and startingState().

Referenced by extrapolate().

44 { return extrapolate(startingState(tk)); }
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
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 44 of file PropagateToMuon.h.

References extrapolate(), and startingState().

Referenced by extrapolate().

44 { return extrapolate(startingState(tk)); }
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
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 136 of file PropagateToMuon.cc.

References MuonDetLayerGeometry::allDTLayers(), AtVertex, MuonDetLayerGeometry::backwardCSCLayers(), barrelCylinder_, barrelHalfLength_, cosmicPropagation_, Vector3DBase< T, FrameTag >::dot(), endcapDiskNeg_, endcapDiskPos_, endcapRadii_, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), MuonDetLayerGeometry::forwardCSCLayers(), getBestDet(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), PV3DBase< T, PVType, FrameType >::mag(), FreeTrajectoryState::momentum(), muonGeometry_, PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), Propagator::propagate(), propagator_, propagatorOpposite_, rho, useSimpleGeometry_, whichState_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

136  {
138  if (start.momentum().mag() == 0)
139  return final;
140  double eta = start.momentum().eta();
141 
142  const Propagator *propagatorBarrel = &*propagator_;
143  const Propagator *propagatorEndcaps = &*propagator_;
144 
145  if (whichState_ != AtVertex) {
146  if (start.position().perp() > barrelCylinder_->radius())
147  propagatorBarrel = &*propagatorOpposite_;
148  if (fabs(start.position().z()) > endcapDiskPos_->position().z())
149  propagatorEndcaps = &*propagatorOpposite_;
150  }
151  if (cosmicPropagation_) {
152  if (start.momentum().dot(GlobalVector(start.position().x(), start.position().y(), start.position().z())) < 0) {
153  // must flip the propagations
154  propagatorBarrel = (propagatorBarrel == &*propagator_ ? &*propagatorOpposite_ : &*propagator_);
155  propagatorEndcaps = (propagatorEndcaps == &*propagator_ ? &*propagatorOpposite_ : &*propagator_);
156  }
157  }
158 
159  TrajectoryStateOnSurface tsos = propagatorBarrel->propagate(start, *barrelCylinder_);
160  if (tsos.isValid()) {
161  if (useSimpleGeometry_) {
162  if (fabs(tsos.globalPosition().z()) <= barrelHalfLength_)
163  final = tsos;
164  } else {
165  final = getBestDet(tsos, muonGeometry_->allDTLayers()[1]);
166  }
167  }
168 
169  if (!final.isValid()) {
170  tsos = propagatorEndcaps->propagate(start, (eta > 0 ? *endcapDiskPos_ : *endcapDiskNeg_));
171  if (tsos.isValid()) {
172  if (useSimpleGeometry_) {
173  float rho = tsos.globalPosition().perp();
174  if ((rho >= endcapRadii_.first) && (rho <= endcapRadii_.second))
175  final = tsos;
176  } else {
177  final =
179  }
180  }
181  }
182  return final;
183 }
Definition: start.py:1
const BoundDisk * endcapDiskNeg_
T perp() const
Definition: PV3DBase.h:72
WhichState whichState_
GlobalPoint globalPosition() const
const BoundDisk * endcapDiskPos_
TrajectoryStateOnSurface getBestDet(const TrajectoryStateOnSurface &tsos, const DetLayer *station) const
const BoundCylinder * barrelCylinder_
T z() const
Definition: PV3DBase.h:64
edm::ESHandle< Propagator > propagator_
bool cosmicPropagation_
for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states...
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
const std::vector< const DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
bool useSimpleGeometry_
Labels for input collections.
edm::ESHandle< MuonDetLayerGeometry > muonGeometry_
double barrelHalfLength_
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
edm::ESHandle< Propagator > propagatorOpposite_
Global3DVector GlobalVector
Definition: GlobalVector.h:10
std::pair< float, float > endcapRadii_
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 49 of file PropagateToMuon.h.

References extrapolate(), and startingState().

Referenced by extrapolate().

49 { return extrapolate(startingState(tk, vtxs)); }
TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const
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.

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 185 of file PropagateToMuon.cc.

References GeometricSearchDet::compatibleDets(), and propagatorAny_.

Referenced by extrapolate(), and startingState().

186  {
187  TrajectoryStateOnSurface ret; // start as null
189  3.); // require compatibility at 3 sigma
190  std::vector<GeometricSearchDet::DetWithState> dets = layer->compatibleDets(tsos, *propagatorAny_, estimator);
191  if (!dets.empty()) {
192  ret = dets.front().second;
193  }
194  return ret;
195 }
edm::ESHandle< Propagator > propagatorAny_
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.

void PropagateToMuon::init ( const edm::EventSetup iSetup)

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

Definition at line 56 of file PropagateToMuon.cc.

References MuonDetLayerGeometry::allDTLayers(), MuonDetLayerGeometry::backwardCSCLayers(), barrelCylinder_, barrelHalfLength_, endcapDiskNeg_, endcapDiskPos_, endcapRadii_, Exception, MuonDetLayerGeometry::forwardCSCLayers(), edm::EventSetup::get(), magfield_, muonGeometry_, propagator_, propagatorAny_, propagatorOpposite_, and GeometricSearchDet::surface().

Referenced by TriggerMatcherToHLTDebug::beginRun(), L1TMuonDQMOffline::dqmBeginRun(), L1MuonMatcherAlgo::init(), and L1Analysis::L1AnalysisRecoMuon2::init().

56  {
57  iSetup.get<IdealMagneticFieldRecord>().get(magfield_);
58  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAlong", propagator_);
59  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorOpposite", propagatorOpposite_);
60  iSetup.get<TrackingComponentsRecord>().get("SteppingHelixPropagatorAny", propagatorAny_);
62 
63  const DetLayer *dt2 = muonGeometry_->allDTLayers()[1];
64  const DetLayer *csc2Pos = muonGeometry_->forwardCSCLayers()[2];
65  const DetLayer *csc2Neg = muonGeometry_->backwardCSCLayers()[2];
66  barrelCylinder_ = dynamic_cast<const BoundCylinder *>(&dt2->surface());
67  endcapDiskPos_ = dynamic_cast<const BoundDisk *>(&csc2Pos->surface());
68  endcapDiskNeg_ = dynamic_cast<const BoundDisk *>(&csc2Neg->surface());
69  if (barrelCylinder_ == nullptr || endcapDiskPos_ == nullptr || endcapDiskNeg_ == nullptr)
70  throw cms::Exception("Geometry") << "Bad muon geometry!?";
71  barrelHalfLength_ = barrelCylinder_->bounds().length() / 2;
72  ;
73  endcapRadii_ = std::make_pair(endcapDiskPos_->innerRadius(), endcapDiskPos_->outerRadius());
74  // std::cout << "L1MuonMatcher: barrel radius = " << barrelCylinder_->radius()
75  // << ", half length = " << barrelHalfLength_ <<
76  // "; endcap Z = " << endcapDiskPos_->position().z() << ", radii =
77  // " << endcapRadii_.first << "," << endcapRadii_.second <<
78  // std::std::endl;
79 }
edm::ESHandle< Propagator > propagatorAny_
const BoundDisk * endcapDiskNeg_
const BoundDisk * endcapDiskPos_
edm::ESHandle< MagneticField > magfield_
const BoundCylinder * barrelCylinder_
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
edm::ESHandle< Propagator > propagator_
const std::vector< const DetLayer * > & allDTLayers() const
return the DT DetLayers (barrel), inside-out
const std::vector< const DetLayer * > & forwardCSCLayers() const
return the forward (+Z) CSC DetLayers, inside-out
T get() const
Definition: EventSetup.h:71
edm::ESHandle< MuonDetLayerGeometry > muonGeometry_
double barrelHalfLength_
const std::vector< const DetLayer * > & backwardCSCLayers() const
return the backward (-Z) CSC DetLayers, inside-out
edm::ESHandle< Propagator > propagatorOpposite_
std::pair< float, float > endcapRadii_
void PropagateToMuon::init ( const edm::EventSetup iSetup)

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

FreeTrajectoryState PropagateToMuon::startingState ( const reco::Candidate reco) const
private

Starting state for the propagation.

Definition at line 81 of file PropagateToMuon.cc.

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

Referenced by extrapolate().

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

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

115  {
116  WhichState state = whichState_;
117  if (cosmicPropagation_) {
118  if (whichState_ == Innermost) {
119  state = tk.innerPosition().Mag2() <= tk.outerPosition().Mag2() ? Innermost : Outermost;
120  } else if (whichState_ == Outermost) {
121  state = tk.innerPosition().Mag2() <= tk.outerPosition().Mag2() ? Outermost : Innermost;
122  }
123  }
124  switch (state) {
125  case Innermost:
127  case Outermost:
129 
130  case AtVertex:
131  default:
133  }
134 }
WhichState whichState_
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:67
edm::ESHandle< MagneticField > magfield_
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:57
bool cosmicPropagation_
for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states...
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
T const * product() const
Definition: ESHandle.h:86
FreeTrajectoryState PropagateToMuon::startingState ( const reco::Candidate reco) const
private

Starting state for the propagation.

FreeTrajectoryState PropagateToMuon::startingState ( const reco::Track tk) const
private

Starting state for the propagation.

FreeTrajectoryState PropagateToMuon::startingState ( const SimTrack tk,
const edm::SimVertexContainer vtxs 
) const
private

Starting state for the propagation.

Definition at line 123 of file PropagateToMuon.cc.

References MuonDetLayerGeometry::allDTLayers(), AtVertex, MuonDetLayerGeometry::backwardCSCLayers(), barrelCylinder_, barrelHalfLength_, CoreSimTrack::charge(), GeometricSearchDet::compatibleDets(), cosmicPropagation_, Vector3DBase< T, FrameTag >::dot(), endcapDiskNeg_, endcapDiskPos_, endcapRadii_, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), Exception, extrapolate(), fallbackToME1_, plotBeamSpotDB::first, MuonDetLayerGeometry::forwardCSCLayers(), getBestDet(), TrajectoryStateOnSurface::globalPosition(), edm::ESHandleBase::isValid(), TrajectoryStateOnSurface::isValid(), PV3DBase< T, PVType, FrameType >::mag(), magfield_, CoreSimTrack::momentum(), FreeTrajectoryState::momentum(), muonGeometry_, SimTrack::noVertex(), PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), position, edm::ESHandle< T >::product(), Propagator::propagate(), propagator_, propagatorAny_, propagatorOpposite_, rho, edm::second(), useMB2_, useSimpleGeometry_, SimTrack::vertIndex(), badGlobalMuonTaggersAOD_cff::vtx, whichState_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

123  {
124  if (!magfield_.isValid()) throw cms::Exception("NotInitialized") << "PropagateToMuon: You must call init(const edm::EventSetup &iSetup) before using this object.\n";
125  if (tk.noVertex()) throw cms::Exception("UnsupportedOperation") << "I can't propagate simtracks without a vertex, I don't know where to start from.\n";
126  const math::XYZTLorentzVectorD & vtx = (vtxs)[tk.vertIndex()].position();
127  return FreeTrajectoryState( GlobalPoint(vtx.X(), vtx.Y(), vtx.Z()),
128  GlobalVector(tk.momentum().X(), tk.momentum().Y(), tk.momentum().Z()),
129  int(tk.charge()),
130  magfield_.product());
131 }
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:31
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
Definition: SimTrack.h:30
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
bool isValid() const
Definition: ESHandle.h:44
T const * product() const
Definition: ESHandle.h:86
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

const BoundCylinder * PropagateToMuon::barrelCylinder_
private

Definition at line 68 of file PropagateToMuon.h.

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

double PropagateToMuon::barrelHalfLength_
private

Definition at line 70 of file PropagateToMuon.h.

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

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

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

Definition at line 61 of file PropagateToMuon.h.

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

const BoundDisk * PropagateToMuon::endcapDiskNeg_
private

Definition at line 69 of file PropagateToMuon.h.

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

const BoundDisk * PropagateToMuon::endcapDiskPos_
private

Definition at line 69 of file PropagateToMuon.h.

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

std::pair< float, float > PropagateToMuon::endcapRadii_
private

Definition at line 71 of file PropagateToMuon.h.

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

bool PropagateToMuon::fallbackToME1_
private

Fallback to ME1 if propagation to ME2 fails.

Definition at line 64 of file PropagateToMuon.h.

Referenced by startingState().

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

Definition at line 64 of file PropagateToMuon.h.

Referenced by init(), and startingState().

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

Definition at line 66 of file PropagateToMuon.h.

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

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

Definition at line 65 of file PropagateToMuon.h.

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

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

Definition at line 65 of file PropagateToMuon.h.

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

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

Definition at line 65 of file PropagateToMuon.h.

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

bool PropagateToMuon::useMB2_
private

Propagate to MB2 (default) instead of MB1.

Definition at line 61 of file PropagateToMuon.h.

Referenced by startingState().

bool PropagateToMuon::useMB2InOverlap_
private

Definition at line 73 of file PropagateToMuon.h.

bool PropagateToMuon::useSimpleGeometry_
private

Labels for input collections.

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

Definition at line 55 of file PropagateToMuon.h.

Referenced by extrapolate(), and startingState().

WhichState PropagateToMuon::whichState_
private

Definition at line 57 of file PropagateToMuon.h.

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

WhichTrack PropagateToMuon::whichTrack_
private

Labels for input collections.

Definition at line 56 of file PropagateToMuon.h.

Referenced by PropagateToMuon(), and startingState().