CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
PositionAtECalEntranceComputer Class Reference

#include <PositionAtECalEntranceComputer.h>

Public Member Functions

void beginEvent (const edm::EventSetup &)
 
reco::Candidate::Point operator() (const reco::Candidate *particle, bool &success) const
 
 PositionAtECalEntranceComputer (edm::ConsumesCollector &&, bool isPhase2=false)
 
 PositionAtECalEntranceComputer (edm::ConsumesCollector &, bool isPhase2=false)
 
 ~PositionAtECalEntranceComputer ()
 

Private Attributes

edm::ESGetToken< MagneticField, IdealMagneticFieldRecordbField_esToken_
 
double bField_z_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeo_esToken_
 
float hgcalFace_z_
 
bool isPhase2_
 
hgcal::RecHitTools recHitTools_
 

Static Private Attributes

static constexpr float ecalBarrelEndcapEtaBorder_ = 1.479
 
static constexpr float hgcalHfEtaBorder_ = 3.0
 

Detailed Description

Extrapolate particle (charged or neutral) to ECAL entrance, in order to compute the distance of the tau to ECAL cracks and/or dead ECAL channels

Authors
Fabio Colombo, Christian Veelken

Definition at line 25 of file PositionAtECalEntranceComputer.h.

Constructor & Destructor Documentation

◆ PositionAtECalEntranceComputer() [1/2]

PositionAtECalEntranceComputer::PositionAtECalEntranceComputer ( edm::ConsumesCollector &&  cc,
bool  isPhase2 = false 
)

◆ PositionAtECalEntranceComputer() [2/2]

PositionAtECalEntranceComputer::PositionAtECalEntranceComputer ( edm::ConsumesCollector cc,
bool  isPhase2 = false 
)

◆ ~PositionAtECalEntranceComputer()

PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer ( )

Definition at line 23 of file PositionAtECalEntranceComputer.cc.

23 {}

Member Function Documentation

◆ beginEvent()

void PositionAtECalEntranceComputer::beginEvent ( const edm::EventSetup es)

Definition at line 25 of file PositionAtECalEntranceComputer.cc.

References bField_esToken_, bField_z_, caloGeo_esToken_, edm::EventSetup::getData(), hgcal::RecHitTools::getPositionLayer(), hgcalFace_z_, isPhase2_, recHitTools_, hgcal::RecHitTools::setGeometry(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by TauDiscriminationAgainstElectronMVA6< TauType, TauDiscriminator, ElectronType >::beginEvent(), AntiElectronDeadECAL::beginEvent(), and pat::PATTauProducer::produce().

25  {
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 }
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeo_esToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
T z() const
Definition: PV3DBase.h:61
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bField_esToken_
GlobalPoint getPositionLayer(int layer, bool nose=false) const
Definition: RecHitTools.cc:141
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68

◆ operator()()

reco::Candidate::Point PositionAtECalEntranceComputer::operator() ( const reco::Candidate particle,
bool &  success 
) const

Definition at line 33 of file PositionAtECalEntranceComputer.cc.

References funct::abs(), cms::cuda::assert(), bField_z_, reco::Candidate::charge(), ecalBarrelEndcapEtaBorder_, reco::Candidate::eta(), hgcalFace_z_, hgcalHfEtaBorder_, isPhase2_, reco::Candidate::p4(), position, TrackCandidateProducer_cfi::propagator, summarizeEdmComparisonLogfiles::success, and reco::Candidate::vertex().

34  {
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 }
assert(be >=bs)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
static int position[264][3]
Definition: ReadPGInfo.cc:289
math::XYZPoint Point
point in the space
Definition: Candidate.h:40
virtual double eta() const =0
momentum pseudorapidity
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector

Member Data Documentation

◆ bField_esToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> PositionAtECalEntranceComputer::bField_esToken_
private

Definition at line 37 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent().

◆ bField_z_

double PositionAtECalEntranceComputer::bField_z_
private

Definition at line 39 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent(), and operator()().

◆ caloGeo_esToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> PositionAtECalEntranceComputer::caloGeo_esToken_
private

Definition at line 38 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent().

◆ ecalBarrelEndcapEtaBorder_

constexpr float PositionAtECalEntranceComputer::ecalBarrelEndcapEtaBorder_ = 1.479
staticprivate

Definition at line 43 of file PositionAtECalEntranceComputer.h.

Referenced by operator()().

◆ hgcalFace_z_

float PositionAtECalEntranceComputer::hgcalFace_z_
private

Definition at line 42 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent(), and operator()().

◆ hgcalHfEtaBorder_

constexpr float PositionAtECalEntranceComputer::hgcalHfEtaBorder_ = 3.0
staticprivate

Definition at line 44 of file PositionAtECalEntranceComputer.h.

Referenced by operator()().

◆ isPhase2_

bool PositionAtECalEntranceComputer::isPhase2_
private

Definition at line 40 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent(), and operator()().

◆ recHitTools_

hgcal::RecHitTools PositionAtECalEntranceComputer::recHitTools_
private

Definition at line 41 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent().