CMS 3D CMS Logo

PositionAtECalEntranceComputer.cc
Go to the documentation of this file.
2 
7 
8 #include <cassert>
9 
11 
13 
16  es.get<IdealMagneticFieldRecord>().get(bField);
17  bField_z_ = bField->inTesla(GlobalPoint(0., 0., 0.)).z();
18 }
19 
21  assert(bField_z_ != -1.);
23  RawParticle(particle->p4(),
24  math::XYZTLorentzVector(particle->vertex().x(), particle->vertex().y(), particle->vertex().z(), 0.)),
25  0.,
26  0.,
27  bField_z_);
28  propagator.setCharge(particle->charge());
29  propagator.propagateToEcalEntrance(false);
31  if (propagator.getSuccess() != 0) {
32  position = propagator.vertex().Vect();
33  success = true;
34  } else {
35  success = false;
36  }
37  return position;
38 }
void setCharge(float q)
set the MEASURED charge
Definition: RawParticle.cc:139
void beginEvent(const edm::EventSetup &)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
T z() const
Definition: PV3DBase.h:64
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
bool propagateToEcalEntrance(bool first=true)
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:285
virtual int charge() const =0
electric charge
static int position[264][3]
Definition: ReadPGInfo.cc:509
T get() const
Definition: EventSetup.h:63
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
virtual const Point & vertex() const =0
vertex position
reco::Candidate::Point operator()(const reco::Candidate *particle, bool &success) const