CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
float etaValue() const
Definition: L1MuGMTCand.cc:102
float phiValue() const
Definition: L1MuGMTCand.cc:92
tuple cfg
Definition: looper.py:296
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static double getBendingError(double invPt, double eta)
tuple result
Definition: mps_fire.py:311
bool getData(T &iHolder) const
Definition: EventSetup.h:122
L1MuonRegionProducer(const edm::ParameterSet &cfg, edm::ConsumesCollector iC)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::EventSetup &iSetup) const
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > theMSMakerToken
static double getBending(double invPt, double eta, int charge)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
void setL1Constraint(const L1MuGMTCand &muon)
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
int charge() const
get charge (+1 -1)
Definition: L1MuGMTCand.h:132