CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions
ParametersDefinerForTP Class Reference

#include <ParametersDefinerForTP.h>

Inheritance diagram for ParametersDefinerForTP:
CosmicParametersDefinerForTP

Public Types

typedef int Charge
 electric charge type More...
 
typedef math::XYZTLorentzVectorD LorentzVector
 Lorentz vector. More...
 
typedef math::XYZPointD Point
 point in the space More...
 

Public Member Functions

virtual void initEvent (edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssocToSet) const
 
virtual TrackingParticle::Vector momentum (const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
 
virtual TrackingParticle::Vector momentum (const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef tpr) const
 
virtual TrackingParticle::Vector momentum (const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Candidate &tp) const
 
 ParametersDefinerForTP ()
 
virtual TrackingParticle::Point vertex (const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
 
virtual TrackingParticle::Point vertex (const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef &tpr) const
 
virtual TrackingParticle::Point vertex (const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Candidate &tp) const
 
virtual ~ParametersDefinerForTP ()
 

Detailed Description

Author
Boris Mangano (UCSD) 5/7/2009

Definition at line 17 of file ParametersDefinerForTP.h.

Member Typedef Documentation

electric charge type

Definition at line 21 of file ParametersDefinerForTP.h.

Lorentz vector.

Definition at line 25 of file ParametersDefinerForTP.h.

point in the space

Definition at line 24 of file ParametersDefinerForTP.h.

Constructor & Destructor Documentation

ParametersDefinerForTP::ParametersDefinerForTP ( )
inline

Definition at line 20 of file ParametersDefinerForTP.h.

20 {};
virtual ParametersDefinerForTP::~ParametersDefinerForTP ( )
inlinevirtual

Definition at line 21 of file ParametersDefinerForTP.h.

21 {};

Member Function Documentation

virtual void ParametersDefinerForTP::initEvent ( edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList simHitsTPAssocToSet) const
inlinevirtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 49 of file ParametersDefinerForTP.h.

49 { }
TrackingParticle::Vector ParametersDefinerForTP::momentum ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const Charge  ch,
const Point vtx,
const LorentzVector lv 
) const
virtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 15 of file ParametersDefinerForTP.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), momentum(), AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by momentum().

16  {
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()),
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 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
double charge(const std::vector< uint8_t > &Ampls)
int TrackCharge
Definition: TrackCharge.h:4
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:361
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::Vector ParametersDefinerForTP::momentum ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const TrackingParticleRef  tpr 
) const
inlinevirtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 30 of file ParametersDefinerForTP.h.

References momentum().

30  {
31  return momentum(iEvent, iSetup, tpr->charge(),tpr->vertex(),tpr->p4());
32  }
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
virtual TrackingParticle::Vector ParametersDefinerForTP::momentum ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const reco::Candidate tp 
) const
inlinevirtual

Definition at line 34 of file ParametersDefinerForTP.h.

References reco::Candidate::charge(), momentum(), reco::Candidate::p4(), and reco::Candidate::vertex().

34  {
35  return momentum(iEvent, iSetup, tp.charge(),tp.vertex(),tp.p4());
36  }
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
TrackingParticle::Point ParametersDefinerForTP::vertex ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const Charge  ch,
const Point vtx,
const LorentzVector lv 
) const
virtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 43 of file ParametersDefinerForTP.cc.

References edm::EventSetup::get(), edm::Event::getByLabel(), findQualityFiles::v, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by vertex().

44  {
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()),
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 }
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
T z() const
Definition: PV3DBase.h:64
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
const T & get() const
Definition: EventSetup.h:55
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
virtual TrackingParticle::Point ParametersDefinerForTP::vertex ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const TrackingParticleRef tpr 
) const
inlinevirtual

Definition at line 41 of file ParametersDefinerForTP.h.

References vertex().

41  {
42  return vertex(iEvent, iSetup, tpr->charge(),tpr->vertex(),tpr->p4());
43  }
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
virtual TrackingParticle::Point ParametersDefinerForTP::vertex ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const reco::Candidate tp 
) const
inlinevirtual

Definition at line 45 of file ParametersDefinerForTP.h.

References reco::Candidate::charge(), reco::Candidate::p4(), vertex(), and reco::Candidate::vertex().

45  {
46  return vertex(iEvent, iSetup, tp.charge(),tp.vertex(),tp.p4());
47  }
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector