CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Protected 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
 
virtual std::tuple
< TrackingParticle::Vector,
TrackingParticle::Point
momentumAndVertex (const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef &tpr) const
 
std::tuple
< TrackingParticle::Vector,
TrackingParticle::Point
momentumAndVertex (const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
 
 ParametersDefinerForTP (const edm::InputTag &beamspot, edm::ConsumesCollector iC)
 
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 ()
 

Protected Attributes

const edm::EDGetTokenT
< reco::BeamSpot
bsToken_
 
const edm::ESGetToken
< MagneticField,
IdealMagneticFieldRecord
mfToken_
 

Detailed Description

Author
Boris Mangano (UCSD) 5/7/2009

Definition at line 22 of file ParametersDefinerForTP.h.

Member Typedef Documentation

electric charge type

Definition at line 27 of file ParametersDefinerForTP.h.

Lorentz vector.

Definition at line 29 of file ParametersDefinerForTP.h.

point in the space

Definition at line 28 of file ParametersDefinerForTP.h.

Constructor & Destructor Documentation

ParametersDefinerForTP::ParametersDefinerForTP ( const edm::InputTag beamspot,
edm::ConsumesCollector  iC 
)

Definition at line 12 of file ParametersDefinerForTP.cc.

13  : bsToken_(iC.consumes(beamspot)), mfToken_(iC.esConsumes()) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
ParametersDefinerForTP::~ParametersDefinerForTP ( )
virtualdefault

Member Function Documentation

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

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 80 of file ParametersDefinerForTP.h.

80  {
81  return std::make_unique<ParametersDefinerForTP>(*this);
82  }
virtual void ParametersDefinerForTP::initEvent ( edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList simHitsTPAssocToSet)
inlinevirtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 78 of file ParametersDefinerForTP.h.

78 {}
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 cms::cuda::bs, bsToken_, edm::Event::get(), edm::EventSetup::getData(), mfToken_, AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by TrackingNtuple::fillTrackingParticles(), momentum(), and momentumAndVertex().

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 
27  auto const &bs = iEvent.get(bsToken_);
28  auto const &mf = iSetup.getData(mfToken_);
29 
31 
32  FreeTrajectoryState ftsAtProduction(
33  GlobalPoint(vtx.x(), vtx.y(), vtx.z()), GlobalVector(lv.x(), lv.y(), lv.z()), TrackCharge(charge), &mf);
34 
35  TSCBLBuilderNoMaterial tscblBuilder;
36  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
37  tscblBuilder(ftsAtProduction, bs); // as in TrackProducerAlgorithm
38  if (tsAtClosestApproach.isValid()) {
39  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
40  momentum = TrackingParticle::Vector(p.x(), p.y(), p.z());
41  }
42  return momentum;
43 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:60
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
int TrackCharge
Definition: TrackCharge.h:4
T z() const
Definition: PV3DBase.h:61
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
math::XYZVectorD Vector
point in the space
T x() const
Definition: PV3DBase.h:59
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 37 of file ParametersDefinerForTP.h.

References momentum().

39  {
40  return momentum(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
41  }
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 43 of file ParametersDefinerForTP.h.

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

45  {
46  return momentum(iEvent, iSetup, tp.charge(), tp.vertex(), tp.p4());
47  }
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
virtual std::tuple<TrackingParticle::Vector, TrackingParticle::Point> ParametersDefinerForTP::momentumAndVertex ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const TrackingParticleRef tpr 
) const
inlinevirtual

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 67 of file ParametersDefinerForTP.h.

68  {
69  return momentumAndVertex(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
70  }
virtual std::tuple< TrackingParticle::Vector, TrackingParticle::Point > momentumAndVertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef &tpr) const
std::tuple< TrackingParticle::Vector, TrackingParticle::Point > ParametersDefinerForTP::momentumAndVertex ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const Charge  ch,
const Point vtx,
const LorentzVector lv 
) const

Definition at line 76 of file ParametersDefinerForTP.cc.

References cms::cuda::bs, bsToken_, edm::Event::get(), edm::EventSetup::getData(), mfToken_, momentum(), AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::v, vertex(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

81  {
82  using namespace edm;
83 
84  auto const &bs = iEvent.get(bsToken_);
85  auto const &mf = iSetup.getData(mfToken_);
86 
87  TrackingParticle::Point vertex(bs.x0(), bs.y0(), bs.z0());
89 
90  FreeTrajectoryState ftsAtProduction(
91  GlobalPoint(vtx.x(), vtx.y(), vtx.z()), GlobalVector(lv.x(), lv.y(), lv.z()), TrackCharge(charge), &mf);
92 
93  TSCBLBuilderNoMaterial tscblBuilder;
94  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
95  tscblBuilder(ftsAtProduction, bs); // as in TrackProducerAlgorithm
96  if (tsAtClosestApproach.isValid()) {
97  GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
98  vertex = TrackingParticle::Point(v.x(), v.y(), v.z());
99  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
100  momentum = TrackingParticle::Vector(p.x(), p.y(), p.z());
101  ;
102  }
103 
104  return std::make_tuple(momentum, vertex);
105 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:60
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
math::XYZPointD Point
point in the space
bool getData(T &iHolder) const
Definition: EventSetup.h:128
int TrackCharge
Definition: TrackCharge.h:4
T z() const
Definition: PV3DBase.h:61
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
math::XYZVectorD Vector
point in the space
T x() const
Definition: PV3DBase.h:59
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
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 45 of file ParametersDefinerForTP.cc.

References cms::cuda::bs, bsToken_, edm::Event::get(), edm::EventSetup::getData(), mfToken_, findQualityFiles::v, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by Tau.Tau::dxy(), TrackingNtuple::fillTrackingParticles(), momentumAndVertex(), and vertex().

49  {
50  // to add a new implementation for cosmic. For the moment, it is just as for
51  // the base class:
52  using namespace edm;
53 
54  auto const &bs = iEvent.get(bsToken_);
55  auto const &mf = iSetup.getData(mfToken_);
56 
58 
59  FreeTrajectoryState ftsAtProduction(
60  GlobalPoint(vtx.x(), vtx.y(), vtx.z()), GlobalVector(lv.x(), lv.y(), lv.z()), TrackCharge(charge), &mf);
61 
62  TSCBLBuilderNoMaterial tscblBuilder;
63  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
64  tscblBuilder(ftsAtProduction, bs); // as in TrackProducerAlgorithm
65  if (tsAtClosestApproach.isValid()) {
66  GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
67  vertex = TrackingParticle::Point(v.x(), v.y(), v.z());
68  } else {
69  // to preserve old behaviour
70  // would be better to flag this somehow to allow ignoring in downstream
71  vertex = TrackingParticle::Point(bs.x0(), bs.y0(), bs.z0());
72  }
73  return vertex;
74 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:60
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
math::XYZPointD Point
point in the space
bool getData(T &iHolder) const
Definition: EventSetup.h:128
int TrackCharge
Definition: TrackCharge.h:4
T z() const
Definition: PV3DBase.h:61
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
T x() const
Definition: PV3DBase.h:59
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 55 of file ParametersDefinerForTP.h.

References vertex().

Referenced by Tau.Tau::dxy().

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

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

Referenced by Tau.Tau::dxy().

63  {
64  return vertex(iEvent, iSetup, tp.charge(), tp.vertex(), tp.p4());
65  }
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

const edm::EDGetTokenT<reco::BeamSpot> ParametersDefinerForTP::bsToken_
protected
const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> ParametersDefinerForTP::mfToken_
protected