CMS 3D CMS Logo

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< ParametersDefinerForTPclone () 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 23 of file ParametersDefinerForTP.h.

Lorentz vector.

Definition at line 27 of file ParametersDefinerForTP.h.

point in the space

Definition at line 26 of file ParametersDefinerForTP.h.

Constructor & Destructor Documentation

ParametersDefinerForTP::ParametersDefinerForTP ( )
inline

Definition at line 21 of file ParametersDefinerForTP.h.

Referenced by clone().

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

Definition at line 14 of file ParametersDefinerForTP.cc.

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

Definition at line 23 of file ParametersDefinerForTP.h.

23 {};

Member Function Documentation

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

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 67 of file ParametersDefinerForTP.h.

References ParametersDefinerForTP().

Referenced by MultiTrackValidator::dqmAnalyze().

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

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 65 of file ParametersDefinerForTP.h.

65 {}
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 17 of file ParametersDefinerForTP.cc.

References beamSpotInputTag_, edm::EventSetup::get(), edm::Event::getByLabel(), TrajectoryStateClosestToBeamLine::isValid(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by MuonTrackValidator::analyze(), MultiTrackValidatorGenPs::dqmAnalyze(), TrackingNtuple::fillTrackingParticles(), momentum(), and MultiTrackValidator::tpParametersAndSelection().

21  {
22  // to add a new implementation for cosmic. For the moment, it is just as for
23  // the base class:
24 
25  using namespace edm;
26 
28  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
29 
31  iEvent.getByLabel(beamSpotInputTag_, bs);
32 
34 
35  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(), vtx.y(), vtx.z()),
36  GlobalVector(lv.x(), lv.y(), lv.z()),
38  theMF.product());
39 
40  TSCBLBuilderNoMaterial tscblBuilder;
41  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
42  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:480
GlobalVector momentum() const
HLT enums.
T get() const
Definition: EventSetup.h:71
math::XYZVectorD Vector
point in the space
T x() const
Definition: PV3DBase.h:62
T const * product() const
Definition: ESHandle.h:86
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 35 of file ParametersDefinerForTP.h.

References momentum().

37  {
38  return momentum(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->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 TrackingParticle::Vector ParametersDefinerForTP::momentum ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const reco::Candidate tp 
) const
inlinevirtual

Definition at line 41 of file ParametersDefinerForTP.h.

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

43  {
44  return momentum(iEvent, iSetup, tp.charge(), tp.vertex(), tp.p4());
45  }
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
virtual int charge() const =0
electric charge
virtual const Point & vertex() const =0
vertex position
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(), TrajectoryStateClosestToBeamLine::isValid(), FreeTrajectoryState::position(), edm::ESHandle< T >::product(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), findQualityFiles::v, PV3DBase< T, PVType, FrameType >::x(), reco::BeamSpot::x0(), PV3DBase< T, PVType, FrameType >::y(), reco::BeamSpot::y0(), PV3DBase< T, PVType, FrameType >::z(), and reco::BeamSpot::z0().

Referenced by MuonTrackValidator::analyze(), MultiTrackValidatorGenPs::dqmAnalyze(), Tau.Tau::dxy(), TrackingNtuple::fillTrackingParticles(), momentum(), MultiTrackValidator::tpParametersAndSelection(), and vertex().

54  {
55  // to add a new implementation for cosmic. For the moment, it is just as for
56  // the base class:
57  using namespace edm;
58 
60  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
61 
63  iEvent.getByLabel(beamSpotInputTag_, bs);
64 
66 
67  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(), vtx.y(), vtx.z()),
68  GlobalVector(lv.x(), lv.y(), lv.z()),
70  theMF.product());
71 
72  TSCBLBuilderNoMaterial tscblBuilder;
73  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
74  tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
75  if (tsAtClosestApproach.isValid()) {
76  GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
77  vertex = TrackingParticle::Point(v.x(), v.y(), v.z());
78  } else {
79  // to preserve old behaviour
80  // would be better to flag this somehow to allow ignoring in downstream
81  vertex = TrackingParticle::Point(bs->x0(), bs->y0(), bs->z0());
82  }
83  return vertex;
84 }
double z0() const
z coordinate
Definition: BeamSpot.h:68
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:480
GlobalPoint position() const
HLT enums.
T get() const
Definition: EventSetup.h:71
double y0() const
y coordinate
Definition: BeamSpot.h:66
T x() const
Definition: PV3DBase.h:62
T const * product() const
Definition: ESHandle.h:86
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
double x0() const
x coordinate
Definition: BeamSpot.h:64
virtual TrackingParticle::Point ParametersDefinerForTP::vertex ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const TrackingParticleRef tpr 
) const
inlinevirtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 53 of file ParametersDefinerForTP.h.

References vertex().

Referenced by Tau.Tau::dxy().

55  {
56  return vertex(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
57  }
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 59 of file ParametersDefinerForTP.h.

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

Referenced by Tau.Tau::dxy().

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

Member Data Documentation

edm::InputTag ParametersDefinerForTP::beamSpotInputTag_

Definition at line 71 of file ParametersDefinerForTP.h.

Referenced by momentum(), and vertex().