CMS 3D CMS Logo

L1MuonRegionProducer.cc
Go to the documentation of this file.
2 
12 
13 using namespace std;
14 
16  : theFieldToken(iC.esConsumes()), theMSMakerToken(iC.esConsumes()) {
17  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
18 
19  thePtMin = regionPSet.getParameter<double>("ptMin");
20  theOriginRadius = regionPSet.getParameter<double>("originRadius");
21  theOriginHalfLength = regionPSet.getParameter<double>("originHalfLength");
22  theOrigin = GlobalPoint(regionPSet.getParameter<double>("originXPos"),
23  regionPSet.getParameter<double>("originYPos"),
24  regionPSet.getParameter<double>("originZPos"));
25 }
26 
28  thePhiL1 = muon.phiValue() + 0.021817;
29  theEtaL1 = muon.etaValue();
30  theChargeL1 = muon.charge();
31 }
32 
33 std::vector<std::unique_ptr<TrackingRegion> > L1MuonRegionProducer::regions(const edm::EventSetup& iSetup) const {
34  const auto& field = iSetup.getData(theFieldToken);
35  const auto& msmaker = iSetup.getData(theMSMakerToken);
36  double dx = cos(thePhiL1);
37  double dy = sin(thePhiL1);
38  double dz = sinh(theEtaL1);
39  GlobalVector direction(dx, dy, dz); // muon direction
40 
41  std::vector<std::unique_ptr<TrackingRegion> > result;
43  bending = fabs(bending);
45 
46  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
47  theOrigin,
48  thePtMin,
51  0.15,
52  bending + 3 * errBending,
53  field,
54  &msmaker));
55 
56  return result;
57 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static double getBendingError(double invPt, double eta)
L1MuonRegionProducer(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > theMSMakerToken
static double getBending(double invPt, double eta, int charge)
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::EventSetup &iSetup) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
void setL1Constraint(const L1MuGMTCand &muon)