test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParametersDefinerForTP.cc
Go to the documentation of this file.
13 
14 
16  : beamSpotInputTag_ ( iConfig.getUntrackedParameter<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot")) )
17 {
18 }
19 
20 
23  const Charge charge, const Point & vtx, const LorentzVector& lv) const {
24  // to add a new implementation for cosmic. For the moment, it is just as for the base class:
25 
26  using namespace edm;
27 
29  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
30 
32  iEvent.getByLabel(beamSpotInputTag_,bs);
33 
35 
36  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(),vtx.y(),vtx.z()),
37  GlobalVector(lv.x(),lv.y(),lv.z()),
38  TrackCharge(charge),
39  theMF.product());
40 
41  TSCBLBuilderNoMaterial tscblBuilder;
42  TrajectoryStateClosestToBeamLine tsAtClosestApproach = 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 Charge charge, const Point & vtx, const LorentzVector& lv) const {
52  // to add a new implementation for cosmic. For the moment, it is just as for the base class:
53  using namespace edm;
54 
56  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
57 
59  iEvent.getByLabel(beamSpotInputTag_,bs);
60 
62 
63  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(),vtx.y(),vtx.z()),
64  GlobalVector(lv.x(),lv.y(),lv.z()),
65  TrackCharge(charge),
66  theMF.product());
67 
68  TSCBLBuilderNoMaterial tscblBuilder;
69  TrajectoryStateClosestToBeamLine tsAtClosestApproach = tscblBuilder(ftsAtProduction,*bs);//as in TrackProducerAlgorithm
70  if(tsAtClosestApproach.isValid()){
71  GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
72  vertex = TrackingParticle::Point(v.x()-bs->x0(),v.y()-bs->y0(),v.z()-bs->z0());
73  }
74  return vertex;
75 }
76 
77 
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:230
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
math::XYZPointD Point
point in the space
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:96
int Charge
electric charge type
const T & get() const
Definition: EventSetup.h:56
math::XYZVectorD Vector
point in the space
T x() const
Definition: PV3DBase.h:62
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