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 std::unique_ptr
< ParametersDefinerForTP
clone () const
 
virtual void initEvent (edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssocToSet)
 
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 19 of file ParametersDefinerForTP.h.

Member Typedef Documentation

electric charge type

Definition at line 24 of file ParametersDefinerForTP.h.

Lorentz vector.

Definition at line 28 of file ParametersDefinerForTP.h.

point in the space

Definition at line 27 of file ParametersDefinerForTP.h.

Constructor & Destructor Documentation

ParametersDefinerForTP::ParametersDefinerForTP ( )
inline

Definition at line 22 of file ParametersDefinerForTP.h.

Referenced by clone().

22 {};
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 24 of file ParametersDefinerForTP.h.

24 {};

Member Function Documentation

virtual std::unique_ptr<ParametersDefinerForTP> ParametersDefinerForTP::clone ( void  ) const
inlinevirtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 54 of file ParametersDefinerForTP.h.

References ParametersDefinerForTP().

54 { return std::unique_ptr<ParametersDefinerForTP>(new ParametersDefinerForTP(*this)); }
virtual void ParametersDefinerForTP::initEvent ( edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList simHitsTPAssocToSet)
inlinevirtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 52 of file ParametersDefinerForTP.h.

52 { }
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()),
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 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
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:402
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 33 of file ParametersDefinerForTP.h.

References momentum().

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

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

37  {
38  return momentum(iEvent, iSetup, tp.charge(),tp.vertex(),tp.p4());
39  }
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 Tau.Tau::dxy(), Tau.Tau::dz(), and 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()),
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 }
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
T z() const
Definition: PV3DBase.h:64
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
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 44 of file ParametersDefinerForTP.h.

References vertex().

Referenced by Tau.Tau::dxy(), and Tau.Tau::dz().

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

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

Referenced by Tau.Tau::dxy(), and Tau.Tau::dz().

48  {
49  return vertex(iEvent, iSetup, tp.charge(),tp.vertex(),tp.p4());
50  }
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 56 of file ParametersDefinerForTP.h.

Referenced by momentum(), and vertex().