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 | Public Attributes
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 ()
 
 ParametersDefinerForTP (const edm::ParameterSet &iConfig)
 
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 ()
 

Public Attributes

edm::InputTag beamSpotInputTag_
 

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 22 of file ParametersDefinerForTP.h.

Lorentz vector.

Definition at line 26 of file ParametersDefinerForTP.h.

point in the space

Definition at line 25 of file ParametersDefinerForTP.h.

Constructor & Destructor Documentation

ParametersDefinerForTP::ParametersDefinerForTP ( )
inline

Definition at line 20 of file ParametersDefinerForTP.h.

20 {};
ParametersDefinerForTP::ParametersDefinerForTP ( const edm::ParameterSet iConfig)

Definition at line 15 of file ParametersDefinerForTP.cc.

16  : beamSpotInputTag_ ( iConfig.getUntrackedParameter<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot")) )
17 {
18 }
T getUntrackedParameter(std::string const &, T const &) const
virtual ParametersDefinerForTP::~ParametersDefinerForTP ( )
inlinevirtual

Definition at line 22 of file ParametersDefinerForTP.h.

22 {};

Member Function Documentation

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

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 50 of file ParametersDefinerForTP.h.

50 { }
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 22 of file ParametersDefinerForTP.cc.

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

Referenced by momentum().

23  {
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()),
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 }
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:390
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 31 of file ParametersDefinerForTP.h.

References momentum().

31  {
32  return momentum(iEvent, iSetup, tpr->charge(),tpr->vertex(),tpr->p4());
33  }
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 35 of file ParametersDefinerForTP.h.

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

35  {
36  return momentum(iEvent, iSetup, tp.charge(),tp.vertex(),tp.p4());
37  }
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 50 of file ParametersDefinerForTP.cc.

References beamSpotInputTag_, 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().

51  {
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()),
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 }
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:390
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

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 42 of file ParametersDefinerForTP.h.

References vertex().

42  {
43  return vertex(iEvent, iSetup, tpr->charge(),tpr->vertex(),tpr->p4());
44  }
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 46 of file ParametersDefinerForTP.h.

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

46  {
47  return vertex(iEvent, iSetup, tp.charge(),tp.vertex(),tp.p4());
48  }
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

Member Data Documentation

edm::InputTag ParametersDefinerForTP::beamSpotInputTag_

Definition at line 52 of file ParametersDefinerForTP.h.

Referenced by momentum(), and vertex().