CMS 3D CMS Logo

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

#include <PFCandWithSuperClusterExtractor.h>

Inheritance diagram for PFCandWithSuperClusterExtractor:
reco::isodeposit::IsoDepositExtractor

Public Member Functions

reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &cand) const override
 
void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &cand) override
 
 PFCandWithSuperClusterExtractor ()
 
 PFCandWithSuperClusterExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
 
 ~PFCandWithSuperClusterExtractor () override
 
- Public Member Functions inherited from reco::isodeposit::IsoDepositExtractor
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 make single IsoDeposit based on trackRef as input More...
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 make single IsoDeposit based on a CandidateBaseRef as input More...
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 
virtual void initEvent (const edm::Event &, const edm::EventSetup &)
 perform some constly initialization More...
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Member Functions

reco::IsoDeposit depositFromObject (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Photon &cand) const
 
reco::IsoDeposit depositFromObject (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::GsfElectron &cand) const
 
reco::IsoDeposit depositFromObject (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &cand) const
 
reco::IsoDeposit depositFromObject (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::PFCandidate &cand) const
 
reco::IsoDeposit::Veto veto (const reco::IsoDeposit::Direction &dir) const
 

Private Attributes

std::string theDepositLabel
 
double theDiff_r
 
double theDiff_z
 
double theDR_Max
 
double theDR_Veto
 
bool theMissHitVetoSuperClusterMatch
 
edm::EDGetTokenT< reco::PFCandidateCollectionthePFCandToken
 
bool theVetoSuperClusterMatch
 

Detailed Description

Definition at line 20 of file PFCandWithSuperClusterExtractor.h.

Constructor & Destructor Documentation

PFCandWithSuperClusterExtractor::PFCandWithSuperClusterExtractor ( )
inline

Definition at line 22 of file PFCandWithSuperClusterExtractor.h.

22 {};
PFCandWithSuperClusterExtractor::PFCandWithSuperClusterExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)

Definition at line 13 of file PFCandWithSuperClusterExtractor.cc.

16  theVetoSuperClusterMatch(par.getParameter<bool>("SCMatch_Veto")),
17  theMissHitVetoSuperClusterMatch(par.getParameter<bool>("MissHitSCMatch_Veto")),
18  theDiff_r(par.getParameter<double>("Diff_r")),
19  theDiff_z(par.getParameter<double>("Diff_z")),
20  theDR_Max(par.getParameter<double>("DR_Max")),
21  theDR_Veto(par.getParameter<double>("DR_Veto")) {
22  // std::cout << " Loading PFCandWithSuperClusterExtractor " << std::endl;
23 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::PFCandidateCollection > thePFCandToken
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
PFCandWithSuperClusterExtractor::~PFCandWithSuperClusterExtractor ( )
inlineoverride

Definition at line 25 of file PFCandWithSuperClusterExtractor.h.

25 {}

Member Function Documentation

reco::IsoDeposit PFCandWithSuperClusterExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
inlineoverridevirtual

make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 29 of file PFCandWithSuperClusterExtractor.h.

References depositFromObject().

Referenced by depositFromObject().

31  {
32  return depositFromObject(ev, evSetup, muon);
33  }
reco::IsoDeposit depositFromObject(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Photon &cand) const
reco::IsoDeposit PFCandWithSuperClusterExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const
inlineoverridevirtual

make single IsoDeposit based on a candidate as input purely virtual: have to implement in concrete implementations

Reimplemented from reco::isodeposit::IsoDepositExtractor.

Definition at line 35 of file PFCandWithSuperClusterExtractor.h.

References depositFromObject(), DeadROC_duringRun::dir, ev, and veto().

37  {
38  const reco::Photon *myPhoton = dynamic_cast<const reco::Photon *>(&cand);
39  if (myPhoton)
40  return depositFromObject(ev, evSetup, *myPhoton);
41 
42  const reco::GsfElectron *myElectron = dynamic_cast<const reco::GsfElectron *>(&cand);
43  if (myElectron)
44  return depositFromObject(ev, evSetup, *myElectron);
45 
46  const reco::PFCandidate *myPFCand = dynamic_cast<const reco::PFCandidate *>(&cand);
47  return depositFromObject(ev, evSetup, *myPFCand);
48  }
reco::IsoDeposit depositFromObject(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Photon &cand) const
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
IsoDeposit PFCandWithSuperClusterExtractor::depositFromObject ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Photon cand 
) const
private

Definition at line 40 of file PFCandWithSuperClusterExtractor.cc.

References funct::abs(), PbPb_ZMuSkimMuonDPG_cff::deltaR, deposit(), HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, reco::LeafCandidate::eta(), edm::Ref< C, T, F >::isNonnull(), phi, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::Photon::superCluster(), theDiff_r, theDiff_z, theDR_Max, theDR_Veto, thePFCandToken, theVetoSuperClusterMatch, reco::LeafCandidate::vertex(), veto(), badGlobalMuonTaggersAOD_cff::vtx, and reco::LeafCandidate::vz().

Referenced by deposit().

42  {
43  reco::isodeposit::Direction candDir(cand.eta(), cand.phi());
44  IsoDeposit deposit(candDir);
45  deposit.setVeto(veto(candDir));
46  deposit.addCandEnergy(cand.pt());
47 
49  event.getByToken(thePFCandToken, PFCandH);
50 
51  double eta = cand.eta(), phi = cand.phi();
52  const reco::Particle::Point& vtx = cand.vertex();
53  for (PFCandidateCollection::const_iterator it = PFCandH->begin(), ed = PFCandH->end(); it != ed; ++it) {
54  double dR = deltaR(it->eta(), it->phi(), eta, phi);
55  // veto SC
56  if (theVetoSuperClusterMatch && cand.superCluster().isNonnull() && it->superClusterRef().isNonnull() &&
57  cand.superCluster() == it->superClusterRef())
58  continue;
59  if ((dR < theDR_Max) && (dR > theDR_Veto) && (std::abs(it->vz() - cand.vz()) < theDiff_z) &&
60  ((it->vertex() - vtx).Rho() < theDiff_r)) {
61  // ok
62  reco::isodeposit::Direction dirTrk(it->eta(), it->phi());
63  deposit.addDeposit(dirTrk, it->pt());
64  }
65  }
66 
67  return deposit;
68 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
double eta() const final
momentum pseudorapidity
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
edm::EDGetTokenT< reco::PFCandidateCollection > thePFCandToken
double pt() const final
transverse momentum
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
const Point & vertex() const override
vertex position (overwritten by PF...)
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
math::XYZPoint Point
point in the space
Definition: Particle.h:25
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
double vz() const override
z coordinate of vertex position
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
double phi() const final
momentum azimuthal angle
IsoDeposit PFCandWithSuperClusterExtractor::depositFromObject ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::GsfElectron cand 
) const
private

Definition at line 70 of file PFCandWithSuperClusterExtractor.cc.

References funct::abs(), PbPb_ZMuSkimMuonDPG_cff::deltaR, deposit(), HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, reco::LeafCandidate::eta(), reco::GsfElectron::gsfTrack(), edm::Ref< C, T, F >::isNonnull(), reco::HitPattern::MISSING_INNER_HITS, phi, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::GsfElectron::superCluster(), theDiff_r, theDiff_z, theDR_Max, theDR_Veto, theMissHitVetoSuperClusterMatch, thePFCandToken, reco::LeafCandidate::vertex(), veto(), badGlobalMuonTaggersAOD_cff::vtx, and reco::LeafCandidate::vz().

72  {
73  reco::isodeposit::Direction candDir(cand.eta(), cand.phi());
74  IsoDeposit deposit(candDir);
75  deposit.setVeto(veto(candDir));
76  deposit.addCandEnergy(cand.pt());
77 
79  event.getByToken(thePFCandToken, PFCandH);
80 
81  double eta = cand.eta(), phi = cand.phi();
82  const reco::Particle::Point& vtx = cand.vertex();
83  for (PFCandidateCollection::const_iterator it = PFCandH->begin(), ed = PFCandH->end(); it != ed; ++it) {
84  double dR = deltaR(it->eta(), it->phi(), eta, phi);
85  // If MissHits>0 (possibly reconstructed as a photon in the PF in this case, kill the the photon if sharing the same SC)
86  if (cand.gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS) > 0 &&
87  theMissHitVetoSuperClusterMatch && it->mva_nothing_gamma() > 0.99 && cand.superCluster().isNonnull() &&
88  it->superClusterRef().isNonnull() && cand.superCluster() == it->superClusterRef()) {
89  continue;
90  }
91  if ((dR < theDR_Max) && (dR > theDR_Veto) && (std::abs(it->vz() - cand.vz()) < theDiff_z) &&
92  ((it->vertex() - vtx).Rho() < theDiff_r)) {
93  // ok
94  reco::isodeposit::Direction dirTrk(it->eta(), it->phi());
95  deposit.addDeposit(dirTrk, it->pt());
96  }
97  }
98 
99  return deposit;
100 }
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
double eta() const final
momentum pseudorapidity
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
edm::EDGetTokenT< reco::PFCandidateCollection > thePFCandToken
double pt() const final
transverse momentum
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
const Point & vertex() const override
vertex position (overwritten by PF...)
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
math::XYZPoint Point
point in the space
Definition: Particle.h:25
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
double vz() const override
z coordinate of vertex position
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
double phi() const final
momentum azimuthal angle
IsoDeposit PFCandWithSuperClusterExtractor::depositFromObject ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track cand 
) const
private

Definition at line 102 of file PFCandWithSuperClusterExtractor.cc.

References funct::abs(), PbPb_ZMuSkimMuonDPG_cff::deltaR, deposit(), HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, reco::TrackBase::eta(), phi, reco::TrackBase::phi(), reco::TrackBase::pt(), theDiff_r, theDiff_z, theDR_Max, theDR_Veto, thePFCandToken, reco::TrackBase::vertex(), veto(), badGlobalMuonTaggersAOD_cff::vtx, and reco::TrackBase::vz().

104  {
105  reco::isodeposit::Direction candDir(cand.eta(), cand.phi());
106  IsoDeposit deposit(candDir);
107  deposit.setVeto(veto(candDir));
108  deposit.addCandEnergy(cand.pt());
110  event.getByToken(thePFCandToken, PFCandH);
111 
112  double eta = cand.eta(), phi = cand.phi();
113  const reco::Particle::Point& vtx = cand.vertex();
114  for (PFCandidateCollection::const_iterator it = PFCandH->begin(), ed = PFCandH->end(); it != ed; ++it) {
115  double dR = deltaR(it->eta(), it->phi(), eta, phi);
116 
117  if ((dR < theDR_Max) && (dR > theDR_Veto) && (std::abs(it->vz() - cand.vz()) < theDiff_z) &&
118  ((it->vertex() - vtx).Rho() < theDiff_r)) {
119  // ok
120  reco::isodeposit::Direction dirTrk(it->eta(), it->phi());
121  deposit.addDeposit(dirTrk, it->pt());
122  }
123  }
124 
125  return deposit;
126 }
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
edm::EDGetTokenT< reco::PFCandidateCollection > thePFCandToken
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:614
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:641
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:617
double pt() const
track transverse momentum
Definition: TrackBase.h:602
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
math::XYZPoint Point
point in the space
Definition: Particle.h:25
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:626
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
IsoDeposit PFCandWithSuperClusterExtractor::depositFromObject ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::PFCandidate cand 
) const
private

Definition at line 128 of file PFCandWithSuperClusterExtractor.cc.

References funct::abs(), DEFINE_EDM_PLUGIN, PbPb_ZMuSkimMuonDPG_cff::deltaR, deposit(), HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, reco::LeafCandidate::eta(), edm::Ref< C, T, F >::isNonnull(), phi, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::PFCandidate::superClusterRef(), theDiff_r, theDiff_z, theDR_Max, theDR_Veto, thePFCandToken, theVetoSuperClusterMatch, reco::PFCandidate::vertex(), veto(), badGlobalMuonTaggersAOD_cff::vtx, and reco::PFCandidate::vz().

130  {
131  reco::isodeposit::Direction candDir(cand.eta(), cand.phi());
132  IsoDeposit deposit(candDir);
133  deposit.setVeto(veto(candDir));
134  deposit.addCandEnergy(cand.pt());
136  event.getByToken(thePFCandToken, PFCandH);
137 
138  double eta = cand.eta(), phi = cand.phi();
139  const reco::Particle::Point& vtx = cand.vertex();
140  for (PFCandidateCollection::const_iterator it = PFCandH->begin(), ed = PFCandH->end(); it != ed; ++it) {
141  // veto SC
142  if (theVetoSuperClusterMatch && cand.superClusterRef().isNonnull() && it->superClusterRef().isNonnull() &&
143  cand.superClusterRef() == it->superClusterRef())
144  continue;
145  double dR = deltaR(it->eta(), it->phi(), eta, phi);
146 
147  if ((dR < theDR_Max) && (dR > theDR_Veto) && (std::abs(it->vz() - cand.vz()) < theDiff_z) &&
148  ((it->vertex() - vtx).Rho() < theDiff_r)) {
149  // ok
150  reco::isodeposit::Direction dirTrk(it->eta(), it->phi());
151  deposit.addDeposit(dirTrk, it->pt());
152  }
153  }
154 
155  return deposit;
156 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
double eta() const final
momentum pseudorapidity
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
edm::EDGetTokenT< reco::PFCandidateCollection > thePFCandToken
double pt() const final
transverse momentum
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
const Point & vertex() const override
vertex position (overwritten by PF...)
Definition: PFCandidate.cc:602
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
math::XYZPoint Point
point in the space
Definition: Particle.h:25
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
double phi() const final
momentum azimuthal angle
double vz() const override
z coordinate of vertex position
Definition: PFCandidate.h:411
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any
Definition: PFCandidate.cc:558
void PFCandWithSuperClusterExtractor::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
)
inlineoverridevirtual

fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 27 of file PFCandWithSuperClusterExtractor.h.

27 {}
reco::IsoDeposit::Veto PFCandWithSuperClusterExtractor::veto ( const reco::IsoDeposit::Direction dir) const
private

Member Data Documentation

std::string PFCandWithSuperClusterExtractor::theDepositLabel
private

Definition at line 71 of file PFCandWithSuperClusterExtractor.h.

double PFCandWithSuperClusterExtractor::theDiff_r
private

Definition at line 74 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

double PFCandWithSuperClusterExtractor::theDiff_z
private

Definition at line 75 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

double PFCandWithSuperClusterExtractor::theDR_Max
private

Definition at line 76 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

double PFCandWithSuperClusterExtractor::theDR_Veto
private

Definition at line 77 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject(), and veto().

bool PFCandWithSuperClusterExtractor::theMissHitVetoSuperClusterMatch
private

Definition at line 73 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

edm::EDGetTokenT<reco::PFCandidateCollection> PFCandWithSuperClusterExtractor::thePFCandToken
private

Definition at line 70 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

bool PFCandWithSuperClusterExtractor::theVetoSuperClusterMatch
private

Definition at line 72 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().