CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PropagateToMuonSetup.cc
Go to the documentation of this file.
2 
6 
8  : useSimpleGeometry_(iConfig.getParameter<bool>("useSimpleGeometry")),
9  useMB2_(iConfig.getParameter<bool>("useStation2")),
10  fallbackToME1_(iConfig.getParameter<bool>("fallbackToME1")),
11  whichTrack_(None),
12  whichState_(AtVertex),
13  cosmicPropagation_(iConfig.getParameter<bool>("cosmicPropagationHypothesis")),
14  useMB2InOverlap_(iConfig.getParameter<bool>("useMB2InOverlap")),
15  magfieldToken_(iC.esConsumes()),
16  propagatorToken_(iC.esConsumes(iConfig.getParameter<edm::ESInputTag>("propagatorAlong"))),
17  propagatorAnyToken_(iC.esConsumes(iConfig.getParameter<edm::ESInputTag>("propagatorAny"))),
18  propagatorOppositeToken_(iC.esConsumes(iConfig.getParameter<edm::ESInputTag>("propagatorOpposite"))),
19  muonGeometryToken_(iC.esConsumes()) {
20  std::string whichTrack = iConfig.getParameter<std::string>("useTrack");
21  if (whichTrack == "none") {
22  whichTrack_ = None;
23  } else if (whichTrack == "tracker") {
25  } else if (whichTrack == "muon") {
27  } else if (whichTrack == "global") {
29  } else
30  throw cms::Exception("Configuration") << "Parameter 'useTrack' must be 'none', 'tracker', 'muon', 'global'\n";
31  if (whichTrack_ != None) {
32  std::string whichState = iConfig.getParameter<std::string>("useState");
33  if (whichState == "atVertex") {
35  } else if (whichState == "innermost") {
37  } else if (whichState == "outermost") {
39  } else
40  throw cms::Exception("Configuration") << "Parameter 'useState' must be 'atVertex', 'innermost', "
41  "'outermost'\n";
42  }
44  throw cms::Exception("Configuration") << "When using 'cosmicPropagationHypothesis' useTrack must not be "
45  "'none', and the state must not be 'atVertex'\n";
46  }
47 }
48 
50  auto const magfield = iSetup.getHandle(magfieldToken_);
51  auto const propagator = iSetup.getHandle(propagatorToken_);
53  auto const propagatorAny = iSetup.getHandle(propagatorAnyToken_);
54  auto const muonGeometry = iSetup.getHandle(muonGeometryToken_);
55 
57  propagator,
60  muonGeometry,
62  useMB2_,
68 }
tuple propagator
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorOppositeToken_
PropagateToMuon init(const edm::EventSetup &iSetup) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
const bool cosmicPropagation_
for cosmics, some things change: the along-opposite is not in-out, nor the innermost/outermost states...
Propagate an object (usually a track) to the second muon station. Support for other muon stations wil...
const bool useMB2_
Propagate to MB2 (default) instead of MB1.
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
WhichTrack whichTrack_
Labels for input collections.
const bool useSimpleGeometry_
Use simplified geometry (cylinders and disks, not individual chambers)
PropagateToMuonSetup(const edm::ParameterSet &iConfig, edm::ConsumesCollector)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorAnyToken_
tuple propagatorOpposite
Definition: HLT_FULL_cff.py:96
const bool fallbackToME1_
Fallback to ME1 if propagation to ME2 fails.
const edm::ESGetToken< MuonDetLayerGeometry, MuonRecoGeometryRecord > muonGeometryToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283