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 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().

Referenced by MultiTrackValidator::analyze().

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(), 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 MultiTrackValidatorGenPs::analyze(), NewMuonTrackValidator::analyze(), MuonTrackValidator::analyze(), TrackingNtuple::fillTrackingParticles(), momentum(), and MultiTrackValidator::tpParametersAndSelection().

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()),
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:464
GlobalVector momentum() const
const T & get() const
Definition: EventSetup.h:55
HLT enums.
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 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(), iEvent, momentum(), reco::Candidate::p4(), vertex(), reco::Candidate::vertex(), and badGlobalMuonTaggersAOD_cff::vtx.

37  {
38  return momentum(iEvent, iSetup, tp.charge(),tp.vertex(),tp.p4());
39  }
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 MultiTrackValidatorGenPs::analyze(), NewMuonTrackValidator::analyze(), MuonTrackValidator::analyze(), Tau.Tau::dxy(), TrackingNtuple::fillTrackingParticles(), momentum(), MultiTrackValidator::tpParametersAndSelection(), 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()),
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(),v.y(),v.z());
73  }
74  else {
75  // to preserve old behaviour
76  // would be better to flag this somehow to allow ignoring in downstream
77  vertex = TrackingParticle::Point(bs->x0(), bs->y0(), bs->z0());
78  }
79  return vertex;
80 }
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:464
GlobalPoint position() const
const T & get() const
Definition: EventSetup.h:55
HLT enums.
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 44 of file ParametersDefinerForTP.h.

References vertex().

Referenced by Tau.Tau::dxy().

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().

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

Referenced by momentum(), and vertex().