RecoTauTag
RecoTau
src
PositionAtECalEntranceComputer.cc
Go to the documentation of this file.
1
#include "
RecoTauTag/RecoTau/interface/PositionAtECalEntranceComputer.h
"
2
3
#include "
MagneticField/Engine/interface/MagneticField.h
"
4
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
5
#include "
CommonTools/BaseParticlePropagator/interface/BaseParticlePropagator.h
"
6
7
#include <cassert>
8
9
PositionAtECalEntranceComputer::PositionAtECalEntranceComputer
() : bField_z_(-1.) {}
10
11
PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer
() {}
12
13
void
PositionAtECalEntranceComputer::beginEvent
(
const
edm::EventSetup
& es) {
14
edm::ESHandle<MagneticField>
bField
;
15
es.
get
<
IdealMagneticFieldRecord
>().
get
(
bField
);
16
bField_z_
=
bField
->inTesla(
GlobalPoint
(0., 0., 0.)).z();
17
}
18
19
reco::Candidate::Point
PositionAtECalEntranceComputer::operator()
(
const
reco::Candidate
* particle,
20
bool
&
success
)
const
{
21
assert
(
bField_z_
!= -1.);
22
BaseParticlePropagator
propagator
=
BaseParticlePropagator
(
23
RawParticle
(particle->
p4
(),
24
math::XYZTLorentzVector
(particle->
vertex
().x(), particle->
vertex
().y(), particle->
vertex
().z(), 0.),
25
particle->
charge
()),
26
0.,
27
0.,
28
bField_z_
);
29
propagator
.propagateToEcalEntrance(
false
);
30
reco::Candidate::Point
position
;
31
if
(
propagator
.getSuccess() != 0) {
32
position
=
propagator
.particle().vertex().Vect();
33
success
=
true
;
34
}
else
{
35
success
=
false
;
36
}
37
return
position
;
38
}
RawParticle
Definition:
RawParticle.h:37
BaseParticlePropagator.h
cms::cuda::assert
assert(be >=bs)
PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer
~PositionAtECalEntranceComputer()
Definition:
PositionAtECalEntranceComputer.cc:11
BaseParticlePropagator
Definition:
BaseParticlePropagator.h:82
PositionAtECalEntranceComputer::beginEvent
void beginEvent(const edm::EventSetup &)
Definition:
PositionAtECalEntranceComputer.cc:13
IdealMagneticFieldRecord
Definition:
IdealMagneticFieldRecord.h:11
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:73
TrackCandidateProducer_cfi.propagator
propagator
Definition:
TrackCandidateProducer_cfi.py:17
reco::Candidate::charge
virtual int charge() const =0
electric charge
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
summarizeEdmComparisonLogfiles.success
success
Definition:
summarizeEdmComparisonLogfiles.py:115
GlobalPoint
Global3DPoint GlobalPoint
Definition:
GlobalPoint.h:10
PositionAtECalEntranceComputer::operator()
reco::Candidate::Point operator()(const reco::Candidate *particle, bool &success) const
Definition:
PositionAtECalEntranceComputer.cc:19
reco::Candidate::vertex
virtual const Point & vertex() const =0
vertex position
position
static int position[264][3]
Definition:
ReadPGInfo.cc:289
MagneticField.h
edm::EventSetup
Definition:
EventSetup.h:57
PositionAtECalEntranceComputer::PositionAtECalEntranceComputer
PositionAtECalEntranceComputer()
Definition:
PositionAtECalEntranceComputer.cc:9
get
#define get
reco::Candidate
Definition:
Candidate.h:27
Calorimetry_cff.bField
bField
Definition:
Calorimetry_cff.py:292
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition:
LorentzVector.h:29
PositionAtECalEntranceComputer::bField_z_
double bField_z_
Definition:
PositionAtECalEntranceComputer.h:30
reco::Candidate::p4
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition:
Candidate.h:40
PositionAtECalEntranceComputer.h
Generated for CMSSW Reference Manual by
1.8.16