CMS 3D CMS Logo

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< 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
 
virtual std::tuple< TrackingParticle::Vector, TrackingParticle::PointmomentumAndVertex (const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef &tpr) const
 
std::tuple< TrackingParticle::Vector, TrackingParticle::PointmomentumAndVertex (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::BeamSpotbsToken_
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmfToken_
 

Detailed Description

Author
Boris Mangano (UCSD) 5/7/2009

Definition at line 22 of file ParametersDefinerForTP.h.

Member Typedef Documentation

◆ Charge

electric charge type

Definition at line 27 of file ParametersDefinerForTP.h.

◆ LorentzVector

Lorentz vector.

Definition at line 29 of file ParametersDefinerForTP.h.

◆ Point

point in the space

Definition at line 28 of file ParametersDefinerForTP.h.

Constructor & Destructor Documentation

◆ ParametersDefinerForTP()

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

Definition at line 12 of file ParametersDefinerForTP.cc.

EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_

◆ ~ParametersDefinerForTP()

ParametersDefinerForTP::~ParametersDefinerForTP ( )
virtualdefault

Member Function Documentation

◆ clone()

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  }

◆ initEvent()

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

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 78 of file ParametersDefinerForTP.h.

78 {}

◆ momentum() [1/3]

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_, ALCARECOTkAlJpsiMuMu_cff::charge, edm::EventSetup::getData(), iEvent, TrajectoryStateClosestToBeamLine::isValid(), mfToken_, FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, TrajectoryStateClosestToBeamLine::trackStateAtPCA(), and L1BJetProducer_cff::vtx.

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 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
int TrackCharge
Definition: TrackCharge.h:4
int iEvent
Definition: GenABIO.cc:224
GlobalVector momentum() const
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
HLT enums.
math::XYZVectorD Vector
point in the space
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ momentum() [2/3]

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 iEvent, and momentum().

39  {
40  return momentum(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
41  }
int iEvent
Definition: GenABIO.cc:224
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const

◆ momentum() [3/3]

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 iEvent, momentum(), and cmsswSequenceInfo::tp.

45  {
46  return momentum(iEvent, iSetup, tp.charge(), tp.vertex(), tp.p4());
47  }
int iEvent
Definition: GenABIO.cc:224
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const

◆ momentumAndVertex() [1/2]

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.

References iEvent.

68  {
69  return momentumAndVertex(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
70  }
int iEvent
Definition: GenABIO.cc:224
virtual std::tuple< TrackingParticle::Vector, TrackingParticle::Point > momentumAndVertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef &tpr) const

◆ momentumAndVertex() [2/2]

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_, ALCARECOTkAlJpsiMuMu_cff::charge, edm::EventSetup::getData(), iEvent, TrajectoryStateClosestToBeamLine::isValid(), mfToken_, momentum(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::position(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), findQualityFiles::v, vertex(), and L1BJetProducer_cff::vtx.

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 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
GlobalPoint position() const
math::XYZPointD Point
point in the space
int TrackCharge
Definition: TrackCharge.h:4
int iEvent
Definition: GenABIO.cc:224
GlobalVector momentum() const
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
HLT enums.
math::XYZVectorD Vector
point in the space
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ vertex() [1/3]

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_, ALCARECOTkAlJpsiMuMu_cff::charge, edm::EventSetup::getData(), iEvent, TrajectoryStateClosestToBeamLine::isValid(), mfToken_, FreeTrajectoryState::position(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), findQualityFiles::v, and L1BJetProducer_cff::vtx.

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 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
GlobalPoint position() const
math::XYZPointD Point
point in the space
int TrackCharge
Definition: TrackCharge.h:4
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
HLT enums.
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ vertex() [2/3]

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 iEvent, and vertex().

Referenced by Tau.Tau::dxy().

57  {
58  return vertex(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
59  }
int iEvent
Definition: GenABIO.cc:224
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const

◆ vertex() [3/3]

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 iEvent, cmsswSequenceInfo::tp, and vertex().

Referenced by Tau.Tau::dxy().

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

◆ bsToken_

const edm::EDGetTokenT<reco::BeamSpot> ParametersDefinerForTP::bsToken_
protected

◆ mfToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> ParametersDefinerForTP::mfToken_
protected