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 
16  const Charge charge, const Point & vtx, const LorentzVector& lv) const {
17  // to add a new implementation for cosmic. For the moment, it is just as for the base class:
18 
19  using namespace edm;
20 
22  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
23 
25  iEvent.getByLabel(InputTag("offlineBeamSpot"),bs);
26 
28 
29  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(),vtx.y(),vtx.z()),
30  GlobalVector(lv.x(),lv.y(),lv.z()),
31  TrackCharge(charge),
32  theMF.product());
33 
34  TSCBLBuilderNoMaterial tscblBuilder;
35  TrajectoryStateClosestToBeamLine tsAtClosestApproach = tscblBuilder(ftsAtProduction,*bs);//as in TrackProducerAlgorithm
36  if(tsAtClosestApproach.isValid()){
37  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
38  momentum = TrackingParticle::Vector(p.x(), p.y(), p.z());
39  }
40  return momentum;
41 }
42 
44  const Charge charge, const Point & vtx, const LorentzVector& lv) const {
45  // to add a new implementation for cosmic. For the moment, it is just as for the base class:
46  using namespace edm;
47 
49  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
50 
52  iEvent.getByLabel(InputTag("offlineBeamSpot"),bs);
53 
55 
56  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(),vtx.y(),vtx.z()),
57  GlobalVector(lv.x(),lv.y(),lv.z()),
58  TrackCharge(charge),
59  theMF.product());
60 
61  TSCBLBuilderNoMaterial tscblBuilder;
62  TrajectoryStateClosestToBeamLine tsAtClosestApproach = tscblBuilder(ftsAtProduction,*bs);//as in TrackProducerAlgorithm
63  if(tsAtClosestApproach.isValid()){
64  GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
65  vertex = TrackingParticle::Point(v.x()-bs->x0(),v.y()-bs->y0(),v.z()-bs->z0());
66  }
67  return vertex;
68 }
69 
70 
math::XYZTLorentzVectorD LorentzVector
Lorentz vector.
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
double charge(const std::vector< uint8_t > &Ampls)
math::XYZPointD Point
point in the space
int TrackCharge
Definition: TrackCharge.h:4
int iEvent
Definition: GenABIO.cc:243
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:361
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:97
int Charge
electric charge type
const T & get() const
Definition: EventSetup.h:55
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