CMS 3D CMS Logo

PositionAtECalEntranceComputer.cc
Go to the documentation of this file.
2 
8 
9 #include <cassert>
10 
12  : bField_esToken_(cc.esConsumes<MagneticField, IdealMagneticFieldRecord>()),
13  caloGeo_esToken_(cc.esConsumes<CaloGeometry, CaloGeometryRecord>()),
14  bField_z_(-1.),
15  isPhase2_(isPhase2) {}
16 
18  : bField_esToken_(cc.esConsumes<MagneticField, IdealMagneticFieldRecord>()),
19  caloGeo_esToken_(cc.esConsumes<CaloGeometry, CaloGeometryRecord>()),
20  bField_z_(-1.),
21  isPhase2_(isPhase2) {}
22 
24 
26  bField_z_ = es.getData(bField_esToken_).inTesla(GlobalPoint(0., 0., 0.)).z();
27  if (isPhase2_) {
29  hgcalFace_z_ = recHitTools_.getPositionLayer(1).z(); // HGCal 1st layer
30  }
31 }
32 
34  bool& success) const {
35  assert(bField_z_ != -1.);
38  RawParticle(particle->p4(),
39  math::XYZTLorentzVector(particle->vertex().x(), particle->vertex().y(), particle->vertex().z(), 0.),
40  particle->charge()),
41  0.,
42  0.,
43  bField_z_);
44  if (!isPhase2_ || std::abs(particle->eta()) < ecalBarrelEndcapEtaBorder_) { // ECal
45  propagator.propagateToEcalEntrance(false);
46  } else { // HGCal
47  if (std::abs(particle->vertex().z()) >= hgcalFace_z_) {
48  success = false;
49  return position;
50  }
51  propagator.setPropagationConditions(152.6, hgcalFace_z_, false);
52  propagator.propagate();
53  }
54  if (propagator.getSuccess() != 0) {
55  position = propagator.particle().vertex().Vect();
57  } else {
58  success = false;
59  }
60  return position;
61 }
RawParticle
Definition: RawParticle.h:37
PositionAtECalEntranceComputer::ecalBarrelEndcapEtaBorder_
static constexpr float ecalBarrelEndcapEtaBorder_
Definition: PositionAtECalEntranceComputer.h:43
reco::Candidate::eta
virtual double eta() const =0
momentum pseudorapidity
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
PositionAtECalEntranceComputer::hgcalFace_z_
float hgcalFace_z_
Definition: PositionAtECalEntranceComputer.h:42
BaseParticlePropagator.h
cms::cuda::assert
assert(be >=bs)
PositionAtECalEntranceComputer::PositionAtECalEntranceComputer
PositionAtECalEntranceComputer(edm::ConsumesCollector &&, bool isPhase2=false)
Definition: PositionAtECalEntranceComputer.cc:11
PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer
~PositionAtECalEntranceComputer()
Definition: PositionAtECalEntranceComputer.cc:23
BaseParticlePropagator
Definition: BaseParticlePropagator.h:82
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
PositionAtECalEntranceComputer::beginEvent
void beginEvent(const edm::EventSetup &)
Definition: PositionAtECalEntranceComputer.cc:25
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
CaloGeometry
Definition: CaloGeometry.h:21
PositionAtECalEntranceComputer::bField_esToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bField_esToken_
Definition: PositionAtECalEntranceComputer.h:37
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
reco::Candidate::charge
virtual int charge() const =0
electric charge
IdealMagneticFieldRecord.h
summarizeEdmComparisonLogfiles.success
success
Definition: summarizeEdmComparisonLogfiles.py:115
PositionAtECalEntranceComputer::caloGeo_esToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeo_esToken_
Definition: PositionAtECalEntranceComputer.h:38
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CaloGeometryRecord.h
PositionAtECalEntranceComputer::operator()
reco::Candidate::Point operator()(const reco::Candidate *particle, bool &success) const
Definition: PositionAtECalEntranceComputer.cc:33
PATTauDiscriminationAgainstElectronMVA6Phase2_cff.isPhase2
isPhase2
Definition: PATTauDiscriminationAgainstElectronMVA6Phase2_cff.py:15
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
hgcal::RecHitTools::getPositionLayer
GlobalPoint getPositionLayer(int layer, bool nose=false) const
Definition: RecHitTools.cc:138
PositionAtECalEntranceComputer::recHitTools_
hgcal::RecHitTools recHitTools_
Definition: PositionAtECalEntranceComputer.h:41
cc
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
reco::Candidate
Definition: Candidate.h:27
hgcal::RecHitTools::setGeometry
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
CaloGeometry.h
PositionAtECalEntranceComputer::bField_z_
double bField_z_
Definition: PositionAtECalEntranceComputer.h:39
reco::Candidate::p4
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
PositionAtECalEntranceComputer::isPhase2_
bool isPhase2_
Definition: PositionAtECalEntranceComputer.h:40
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::Candidate::Point
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
PositionAtECalEntranceComputer::hgcalHfEtaBorder_
static constexpr float hgcalHfEtaBorder_
Definition: PositionAtECalEntranceComputer.h:44
MagneticField
Definition: MagneticField.h:19
PositionAtECalEntranceComputer.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:45