Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
SimTracker
TrackAssociation
src
ParametersDefinerForTP.cc
Go to the documentation of this file.
1
#include "
SimTracker/TrackAssociation/interface/ParametersDefinerForTP.h
"
2
#include "
FWCore/Utilities/interface/typelookup.h
"
3
#include "
DataFormats/GeometryVector/interface/GlobalVector.h
"
4
#include "
DataFormats/GeometryVector/interface/GlobalPoint.h
"
5
#include "
TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h
"
6
#include "
TrackingTools/PatternTools/interface/TSCBLBuilderNoMaterial.h
"
7
#include "
TrackingTools/PatternTools/interface/TSCPBuilderNoMaterial.h
"
8
#include "
MagneticField/Engine/interface/MagneticField.h
"
9
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
10
#include "
FWCore/Framework/interface/Event.h
"
11
#include <
FWCore/Framework/interface/ESHandle.h
>
12
class
TrajectoryStateClosestToBeamLineBuilder
;
13
14
ParticleBase::Vector
15
ParametersDefinerForTP::momentum
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup,
const
TrackingParticle
& tp)
const
{
16
// to add a new implementation for cosmic. For the moment, it is just as for the base class:
17
18
using namespace
edm;
19
20
edm::ESHandle<MagneticField>
theMF;
21
iSetup.
get
<
IdealMagneticFieldRecord
>().
get
(theMF);
22
23
edm::Handle<reco::BeamSpot>
bs;
24
iEvent.
getByLabel
(
InputTag
(
"offlineBeamSpot"
),bs);
25
26
ParticleBase::Vector
momentum
(0, 0, 0);
27
28
FreeTrajectoryState
ftsAtProduction(
GlobalPoint
(tp.
vertex
().x(),tp.
vertex
().y(),tp.
vertex
().z()),
29
GlobalVector
(tp.
momentum
().x(),tp.
momentum
().y(),tp.
momentum
().z()),
30
TrackCharge
(tp.
charge
()),
31
theMF.product());
32
33
TSCBLBuilderNoMaterial
tscblBuilder;
34
TrajectoryStateClosestToBeamLine
tsAtClosestApproach = tscblBuilder(ftsAtProduction,*bs);
//as in TrackProducerAlgorithm
35
if
(tsAtClosestApproach.isValid()){
36
GlobalVector
p
= tsAtClosestApproach.trackStateAtPCA().momentum();
37
momentum =
ParticleBase::Vector
(p.
x
(), p.
y
(), p.
z
());
38
}
39
return
momentum
;
40
}
41
42
ParticleBase::Point
ParametersDefinerForTP::vertex
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup,
const
TrackingParticle
& tp)
const
{
43
// to add a new implementation for cosmic. For the moment, it is just as for the base class:
44
using namespace
edm;
45
46
edm::ESHandle<MagneticField>
theMF;
47
iSetup.
get
<
IdealMagneticFieldRecord
>().
get
(theMF);
48
49
edm::Handle<reco::BeamSpot>
bs;
50
iEvent.
getByLabel
(
InputTag
(
"offlineBeamSpot"
),bs);
51
52
ParticleBase::Point
vertex
(0, 0, 0);
53
54
FreeTrajectoryState
ftsAtProduction(
GlobalPoint
(tp.
vertex
().x(),tp.
vertex
().y(),tp.
vertex
().z()),
55
GlobalVector
(tp.
momentum
().x(),tp.
momentum
().y(),tp.
momentum
().z()),
56
TrackCharge
(tp.
charge
()),
57
theMF.product());
58
59
TSCBLBuilderNoMaterial
tscblBuilder;
60
TrajectoryStateClosestToBeamLine
tsAtClosestApproach = tscblBuilder(ftsAtProduction,*bs);
//as in TrackProducerAlgorithm
61
if
(tsAtClosestApproach.isValid()){
62
GlobalPoint
v
= tsAtClosestApproach.trackStateAtPCA().position();
63
vertex =
ParticleBase::Point
(v.
x
()-bs->x0(),v.
y
()-bs->y0(),v.
z
()-bs->z0());
64
}
65
return
vertex
;
66
}
67
68
69
TYPELOOKUP_DATA_REG
(
ParametersDefinerForTP
);
ParticleBase::charge
int charge() const
electric charge
Definition:
ParticleBase.h:54
Vector3DBase
Definition:
Vector3DBase.h:9
Event.h
GlobalPoint
Global3DPoint GlobalPoint
Definition:
GlobalPoint.h:10
PV3DBase::y
T y() const
Definition:
PV3DBase.h:62
IdealMagneticFieldRecord
Definition:
IdealMagneticFieldRecord.h:11
ParticleBase::Vector
math::XYZVectorD Vector
point in the space
Definition:
ParticleBase.h:30
ParametersDefinerForTP.h
TrajectoryStateClosestToBeamLineBuilder
Definition:
TrajectoryStateClosestToBeamLineBuilder.h:14
TrajectoryStateClosestToBeamLine
Definition:
TrajectoryStateClosestToBeamLine.h:15
edm::Handle< reco::BeamSpot >
typelookup.h
MagneticField.h
TrackCharge
int TrackCharge
Definition:
TrackCharge.h:4
ParticleBase::Point
math::XYZPointD Point
point in the space
Definition:
ParticleBase.h:28
iEvent
int iEvent
Definition:
GenABIO.cc:243
FreeTrajectoryState
Definition:
FreeTrajectoryState.h:31
edm::ESHandle< MagneticField >
PV3DBase::z
T z() const
Definition:
PV3DBase.h:63
ESHandle.h
edm::EventSetup
Definition:
EventSetup.h:44
TSCBLBuilderNoMaterial.h
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition:
Event.h:356
TSCPBuilderNoMaterial.h
GlobalVector.h
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition:
typelookup.h:97
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
ParticleBase::momentum
Vector momentum() const
spatial momentum vector
Definition:
ParticleBase.h:86
AlCaHLTBitMon_ParallelJobs.p
tuple p
Definition:
AlCaHLTBitMon_ParallelJobs.py:152
ParametersDefinerForTP
Definition:
ParametersDefinerForTP.h:15
Point3DBase< float, GlobalTag >
edm::InputTag
Definition:
InputTag.h:12
ParametersDefinerForTP::momentum
virtual ParticleBase::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticle &tp) const
Definition:
ParametersDefinerForTP.cc:15
TrackingParticle
Definition:
TrackingParticle.h:25
edm::Event
Definition:
Event.h:50
ParticleBase::vertex
const Point & vertex() const
vertex position
Definition:
ParticleBase.h:228
PV3DBase::x
T x() const
Definition:
PV3DBase.h:61
v
mathSSE::Vec4< T > v
Definition:
newBasic3DVector.h:354
TSCBLBuilderNoMaterial
Definition:
TSCBLBuilderNoMaterial.h:13
FreeTrajectoryState.h
IdealMagneticFieldRecord.h
GlobalVector
Global3DVector GlobalVector
Definition:
GlobalVector.h:10
ParametersDefinerForTP::vertex
virtual ParticleBase::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrackingParticle &tp) const
Definition:
ParametersDefinerForTP.cc:42
GlobalPoint.h
Generated for CMSSW Reference Manual by
1.8.5