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 reco::Candidate &tp) const
 
virtual TrackingParticle::Vector momentum (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
 
virtual std::tuple< TrackingParticle::Vector, TrackingParticle::PointmomentumAndVertex (const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef &tpr) 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 reco::Candidate &tp) const
 
virtual TrackingParticle::Point vertex (const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef &tpr) 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

◆ Charge

electric charge type

Definition at line 23 of file ParametersDefinerForTP.h.

◆ LorentzVector

Lorentz vector.

Definition at line 27 of file ParametersDefinerForTP.h.

◆ Point

point in the space

Definition at line 26 of file ParametersDefinerForTP.h.

Constructor & Destructor Documentation

◆ ParametersDefinerForTP() [1/2]

ParametersDefinerForTP::ParametersDefinerForTP ( )
inline

Definition at line 21 of file ParametersDefinerForTP.h.

21 {};

◆ ParametersDefinerForTP() [2/2]

ParametersDefinerForTP::ParametersDefinerForTP ( const edm::ParameterSet iConfig)

Definition at line 14 of file ParametersDefinerForTP.cc.

15  : beamSpotInputTag_(iConfig.getUntrackedParameter<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"))) {}

◆ ~ParametersDefinerForTP()

virtual ParametersDefinerForTP::~ParametersDefinerForTP ( )
inlinevirtual

Definition at line 23 of file ParametersDefinerForTP.h.

23 {};

Member Function Documentation

◆ clone()

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

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 78 of file ParametersDefinerForTP.h.

78  {
79  return std::make_unique<ParametersDefinerForTP>(*this);
80  }

◆ initEvent()

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

Reimplemented in CosmicParametersDefinerForTP.

Definition at line 76 of file ParametersDefinerForTP.h.

76 {}

◆ 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.

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 }

References beamSpotInputTag_, cms::cuda::bs, ALCARECOTkAlJpsiMuMu_cff::charge, edm::EventSetup::get(), get, iEvent, TrajectoryStateClosestToBeamLine::isValid(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), and extraflags_cff::vtx.

Referenced by MuonTrackValidator::analyze(), momentum(), and momentumAndVertex().

◆ momentum() [2/3]

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.

43  {
44  return momentum(iEvent, iSetup, tp.charge(), tp.vertex(), tp.p4());
45  }

References iEvent, momentum(), and cmsswSequenceInfo::tp.

◆ momentum() [3/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 35 of file ParametersDefinerForTP.h.

37  {
38  return momentum(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
39  }

References iEvent, and momentum().

◆ momentumAndVertex() [1/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 86 of file ParametersDefinerForTP.cc.

91  {
92  using namespace edm;
93 
95  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
96 
98  iEvent.getByLabel(beamSpotInputTag_, bs);
99 
100  TrackingParticle::Point vertex(bs->x0(), bs->y0(), bs->z0());
102 
103  FreeTrajectoryState ftsAtProduction(GlobalPoint(vtx.x(), vtx.y(), vtx.z()),
104  GlobalVector(lv.x(), lv.y(), lv.z()),
106  theMF.product());
107 
108  TSCBLBuilderNoMaterial tscblBuilder;
109  TrajectoryStateClosestToBeamLine tsAtClosestApproach =
110  tscblBuilder(ftsAtProduction, *bs); // as in TrackProducerAlgorithm
111  if (tsAtClosestApproach.isValid()) {
112  GlobalPoint v = tsAtClosestApproach.trackStateAtPCA().position();
113  vertex = TrackingParticle::Point(v.x(), v.y(), v.z());
114  GlobalVector p = tsAtClosestApproach.trackStateAtPCA().momentum();
115  momentum = TrackingParticle::Vector(p.x(), p.y(), p.z());
116  ;
117  }
118 
119  return std::make_tuple(momentum, vertex);
120 }

References beamSpotInputTag_, cms::cuda::bs, ALCARECOTkAlJpsiMuMu_cff::charge, edm::EventSetup::get(), get, iEvent, TrajectoryStateClosestToBeamLine::isValid(), momentum(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::position(), edm::ESHandle< T >::product(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), findQualityFiles::v, vertex(), and extraflags_cff::vtx.

◆ momentumAndVertex() [2/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 65 of file ParametersDefinerForTP.h.

66  {
67  return momentumAndVertex(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
68  }

References iEvent.

Referenced by MultiTrackValidator::tpParametersAndSelection().

◆ 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 50 of file ParametersDefinerForTP.cc.

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 }

References beamSpotInputTag_, cms::cuda::bs, ALCARECOTkAlJpsiMuMu_cff::charge, edm::EventSetup::get(), get, iEvent, TrajectoryStateClosestToBeamLine::isValid(), FreeTrajectoryState::position(), edm::ESHandle< T >::product(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), findQualityFiles::v, and extraflags_cff::vtx.

Referenced by MuonTrackValidator::analyze(), Tau.Tau::dxy(), momentumAndVertex(), and vertex().

◆ vertex() [2/3]

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.

61  {
62  return vertex(iEvent, iSetup, tp.charge(), tp.vertex(), tp.p4());
63  }

References iEvent, cmsswSequenceInfo::tp, and vertex().

Referenced by Tau.Tau::dxy().

◆ vertex() [3/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 53 of file ParametersDefinerForTP.h.

55  {
56  return vertex(iEvent, iSetup, tpr->charge(), tpr->vertex(), tpr->p4());
57  }

References iEvent, and vertex().

Referenced by Tau.Tau::dxy().

Member Data Documentation

◆ beamSpotInputTag_

edm::InputTag ParametersDefinerForTP::beamSpotInputTag_

Definition at line 82 of file ParametersDefinerForTP.h.

Referenced by momentum(), momentumAndVertex(), and vertex().

Vector3DBase
Definition: Vector3DBase.h:8
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
TrajectoryStateClosestToBeamLine
Definition: TrajectoryStateClosestToBeamLine.h:15
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
ParametersDefinerForTP::beamSpotInputTag_
edm::InputTag beamSpotInputTag_
Definition: ParametersDefinerForTP.h:82
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
TrackingParticle::Vector
math::XYZVectorD Vector
point in the space
Definition: TrackingParticle.h:37
ParametersDefinerForTP::momentum
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
Definition: ParametersDefinerForTP.cc:17
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::Handle< reco::BeamSpot >
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
cms::cuda::bs
bs
Definition: HistoContainer.h:76
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
edm::ESHandle< MagneticField >
ParametersDefinerForTP::momentumAndVertex
virtual std::tuple< TrackingParticle::Vector, TrackingParticle::Point > momentumAndVertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticleRef &tpr) const
Definition: ParametersDefinerForTP.h:65
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
TSCBLBuilderNoMaterial
Definition: TSCBLBuilderNoMaterial.h:13
TrajectoryStateClosestToBeamLine::isValid
bool isValid() const
Definition: TrajectoryStateClosestToBeamLine.h:50
TrajectoryStateClosestToBeamLine::trackStateAtPCA
FTS const & trackStateAtPCA() const
Definition: TrajectoryStateClosestToBeamLine.h:32
TrackingParticle::Point
math::XYZPointD Point
point in the space
Definition: TrackingParticle.h:36
edm::InputTag
Definition: InputTag.h:15
ParametersDefinerForTP::vertex
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
Definition: ParametersDefinerForTP.cc:50