CMS 3D CMS Logo

ParametersDefinerForTP.cc
Go to the documentation of this file.
13 
15  : beamSpotInputTag_(iConfig.getUntrackedParameter<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"))) {}
16 
18  const edm::EventSetup &iSetup,
19  const Charge charge,
20  const Point &vtx,
21  const LorentzVector &lv) const {
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 }
49 
51  const edm::EventSetup &iSetup,
52  const Charge charge,
53  const Point &vtx,
54  const LorentzVector &lv) const {
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 }
85 
Vector3DBase
Definition: Vector3DBase.h:8
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TSCBLBuilderNoMaterial.h
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
TrajectoryStateClosestToBeamLine
Definition: TrajectoryStateClosestToBeamLine.h:15
FreeTrajectoryState.h
TrackCharge
int TrackCharge
Definition: TrackCharge.h:4
ESHandle.h
ParametersDefinerForTP::beamSpotInputTag_
edm::InputTag beamSpotInputTag_
Definition: ParametersDefinerForTP.h:71
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
typelookup.h
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 >
TrajectoryStateClosestToBeamLineBuilder
Definition: TrajectoryStateClosestToBeamLineBuilder.h:14
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
cms::cuda::bs
bs
Definition: HistoContainer.h:127
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
ParametersDefinerForTP::Charge
int Charge
electric charge type
Definition: ParametersDefinerForTP.h:23
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:58
TSCPBuilderNoMaterial.h
get
#define get
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
ParametersDefinerForTP.h
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
TSCBLBuilderNoMaterial
Definition: TSCBLBuilderNoMaterial.h:13
GlobalVector.h
ParametersDefinerForTP::LorentzVector
math::XYZTLorentzVectorD LorentzVector
Lorentz vector.
Definition: ParametersDefinerForTP.h:27
ParametersDefinerForTP::ParametersDefinerForTP
ParametersDefinerForTP()
Definition: ParametersDefinerForTP.h:21
TrajectoryStateClosestToBeamLine::isValid
bool isValid() const
Definition: TrajectoryStateClosestToBeamLine.h:50
TrajectoryStateClosestToBeamLine::trackStateAtPCA
FTS const & trackStateAtPCA() const
Definition: TrajectoryStateClosestToBeamLine.h:32
edm::Event
Definition: Event.h:73
TrackingParticle::Point
math::XYZPointD Point
point in the space
Definition: TrackingParticle.h:36
GlobalPoint.h
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
ParametersDefinerForTP
Definition: ParametersDefinerForTP.h:19