CMS 3D CMS Logo

ParametersDefinerForTP.cc
Go to the documentation of this file.
13 
15  : beamSpotInputTag_(iConfig.getUntrackedParameter<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"))) {}
16 
18  const edm::EventSetup &iSetup,
19  const Charge charge,
20  const Point &vtx,
21  const LorentzVector &lv) const {
22  // to add a new implementation for cosmic. For the moment, it is just as for
23  // the base class:
24 
25  using namespace edm;
26 
28  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
29 
31  iEvent.getByLabel(beamSpotInputTag_, bs);
32 
34 
35  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(), vtx.y(), vtx.z()),
36  GlobalVector(lv.x(), lv.y(), lv.z()),
37  TrackCharge(charge),
38  theMF.product());
39 
40  TSCBLBuilderNoMaterial tscblBuilder;
41  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
42  tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
43  if (tsAtClosestApproach.isValid()) {
44  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
45  momentum = TrackingParticle::Vector(p.x(), p.y(), p.z());
46  }
47  return momentum;
48 }
49 
51  const edm::EventSetup &iSetup,
52  const Charge charge,
53  const Point &vtx,
54  const LorentzVector &lv) const {
55  // to add a new implementation for cosmic. For the moment, it is just as for
56  // the base class:
57  using namespace edm;
58 
60  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
61 
63  iEvent.getByLabel(beamSpotInputTag_, bs);
64 
66 
67  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(), vtx.y(), vtx.z()),
68  GlobalVector(lv.x(), lv.y(), lv.z()),
69  TrackCharge(charge),
70  theMF.product());
71 
72  TSCBLBuilderNoMaterial tscblBuilder;
73  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
74  tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
75  if (tsAtClosestApproach.isValid()) {
76  GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
77  vertex = TrackingParticle::Point(v.x(), v.y(), v.z());
78  } else {
79  // to preserve old behaviour
80  // would be better to flag this somehow to allow ignoring in downstream
81  vertex = TrackingParticle::Point(bs->x0(), bs->y0(), bs->z0());
82  }
83  return vertex;
84 }
85 
double z0() const
z coordinate
Definition: BeamSpot.h:68
math::XYZTLorentzVectorD LorentzVector
Lorentz vector.
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
math::XYZPointD Point
point in the space
int TrackCharge
Definition: TrackCharge.h:4
int iEvent
Definition: GenABIO.cc:224
T z() const
Definition: PV3DBase.h:64
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
GlobalVector momentum() const
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
GlobalPoint position() const
int Charge
electric charge type
HLT enums.
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:55
T get() const
Definition: EventSetup.h:71
double y0() const
y coordinate
Definition: BeamSpot.h:66
math::XYZVectorD Vector
point in the space
T x() const
Definition: PV3DBase.h:62
T const * product() const
Definition: ESHandle.h:86
Global3DVector GlobalVector
Definition: GlobalVector.h:10
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
double x0() const
x coordinate
Definition: BeamSpot.h:64