CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
IdealMagneticFieldRecord
bField_esToken_
 
double bField_z_
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
caloGeo_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::PositionAtECalEntranceComputer ( edm::ConsumesCollector &&  cc,
bool  isPhase2 = false 
)
PositionAtECalEntranceComputer::PositionAtECalEntranceComputer ( edm::ConsumesCollector cc,
bool  isPhase2 = false 
)
PositionAtECalEntranceComputer::~PositionAtECalEntranceComputer ( )

Definition at line 23 of file PositionAtECalEntranceComputer.cc.

23 {}

Member Function Documentation

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_
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bField_esToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
T z() const
Definition: PV3DBase.h:61
GlobalPoint getPositionLayer(int layer, bool nose=false) const
Definition: RecHitTools.cc:141
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:68
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(), BaseParticlePropagator::getSuccess(), hgcalFace_z_, hgcalHfEtaBorder_, isPhase2_, reco::Candidate::p4(), BaseParticlePropagator::particle(), position, BaseParticlePropagator::propagate(), BaseParticlePropagator::propagateToEcalEntrance(), HLT_FULL_cff::propagator, BaseParticlePropagator::setPropagationConditions(), reco::Candidate::vertex(), and RawParticle::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();
56  success = (std::abs(position.eta()) <= hgcalHfEtaBorder_);
57  } else {
58  success = false;
59  }
60  return position;
61 }
tuple propagator
int getSuccess() const
Has propagation been performed and was barrel or endcap reached ?
void setPropagationConditions(double r, double z, bool firstLoop=true)
Set the propagation characteristics (rCyl, zCyl and first loop only)
RawParticle const & particle() const
The particle being propagated.
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
bool propagateToEcalEntrance(bool first=true)
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:320
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

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

Definition at line 37 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent().

double PositionAtECalEntranceComputer::bField_z_
private

Definition at line 39 of file PositionAtECalEntranceComputer.h.

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

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

Definition at line 38 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent().

constexpr float PositionAtECalEntranceComputer::ecalBarrelEndcapEtaBorder_ = 1.479
staticprivate

Definition at line 43 of file PositionAtECalEntranceComputer.h.

Referenced by operator()().

float PositionAtECalEntranceComputer::hgcalFace_z_
private

Definition at line 42 of file PositionAtECalEntranceComputer.h.

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

constexpr float PositionAtECalEntranceComputer::hgcalHfEtaBorder_ = 3.0
staticprivate

Definition at line 44 of file PositionAtECalEntranceComputer.h.

Referenced by operator()().

bool PositionAtECalEntranceComputer::isPhase2_
private

Definition at line 40 of file PositionAtECalEntranceComputer.h.

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

hgcal::RecHitTools PositionAtECalEntranceComputer::recHitTools_
private

Definition at line 41 of file PositionAtECalEntranceComputer.h.

Referenced by beginEvent().