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::Candidate &cand) const override
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) 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::CandidateBaseRef &track) const
 make single IsoDeposit based on a CandidateBaseRef as input More...
 
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 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 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 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::GsfElectron &cand) const
 
reco::IsoDeposit depositFromObject (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::PFCandidate &cand) const
 
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::Track &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() [1/2]

PFCandWithSuperClusterExtractor::PFCandWithSuperClusterExtractor ( )
inline

Definition at line 22 of file PFCandWithSuperClusterExtractor.h.

22 {};

◆ PFCandWithSuperClusterExtractor() [2/2]

PFCandWithSuperClusterExtractor::PFCandWithSuperClusterExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)

Definition at line 12 of file PFCandWithSuperClusterExtractor.cc.

15  theVetoSuperClusterMatch(par.getParameter<bool>("SCMatch_Veto")),
16  theMissHitVetoSuperClusterMatch(par.getParameter<bool>("MissHitSCMatch_Veto")),
17  theDiff_r(par.getParameter<double>("Diff_r")),
18  theDiff_z(par.getParameter<double>("Diff_z")),
19  theDR_Max(par.getParameter<double>("DR_Max")),
20  theDR_Veto(par.getParameter<double>("DR_Veto")) {
21  // std::cout << " Loading PFCandWithSuperClusterExtractor " << std::endl;
22 }

◆ ~PFCandWithSuperClusterExtractor()

PFCandWithSuperClusterExtractor::~PFCandWithSuperClusterExtractor ( )
inlineoverride

Definition at line 25 of file PFCandWithSuperClusterExtractor.h.

25 {}

Member Function Documentation

◆ deposit() [1/2]

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.

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  }

References depositFromObject(), and ev.

◆ deposit() [2/2]

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.

31  {
32  return depositFromObject(ev, evSetup, muon);
33  }

References depositFromObject(), and ev.

Referenced by depositFromObject().

◆ depositFromObject() [1/4]

IsoDeposit PFCandWithSuperClusterExtractor::depositFromObject ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::GsfElectron cand 
) const
private

Definition at line 69 of file PFCandWithSuperClusterExtractor.cc.

71  {
72  reco::isodeposit::Direction candDir(cand.eta(), cand.phi());
73  IsoDeposit deposit(candDir);
74  deposit.setVeto(veto(candDir));
76 
78  event.getByToken(thePFCandToken, PFCandH);
79 
80  double eta = cand.eta(), phi = cand.phi();
81  const reco::Particle::Point& vtx = cand.vertex();
82  for (PFCandidateCollection::const_iterator it = PFCandH->begin(), ed = PFCandH->end(); it != ed; ++it) {
83  double dR = deltaR(it->eta(), it->phi(), eta, phi);
84  // If MissHits>0 (possibly reconstructed as a photon in the PF in this case, kill the the photon if sharing the same SC)
85  if (cand.gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS) > 0 &&
86  theMissHitVetoSuperClusterMatch && it->mva_nothing_gamma() > 0.99 && cand.superCluster().isNonnull() &&
87  it->superClusterRef().isNonnull() && cand.superCluster() == it->superClusterRef()) {
88  continue;
89  }
90  if ((dR < theDR_Max) && (dR > theDR_Veto) && (std::abs(it->vz() - cand.vz()) < theDiff_z) &&
91  ((it->vertex() - vtx).Rho() < theDiff_r)) {
92  // ok
93  reco::isodeposit::Direction dirTrk(it->eta(), it->phi());
94  deposit.addDeposit(dirTrk, it->pt());
95  }
96  }
97 
98  return deposit;
99 }

References funct::abs(), reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), PbPb_ZMuSkimMuonDPG_cff::deltaR, deposit(), HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, reco::HitPattern::MISSING_INNER_HITS, phi, reco::IsoDeposit::setVeto(), theDiff_r, theDiff_z, theDR_Max, theDR_Veto, theMissHitVetoSuperClusterMatch, thePFCandToken, veto(), and extraflags_cff::vtx.

◆ depositFromObject() [2/4]

IsoDeposit PFCandWithSuperClusterExtractor::depositFromObject ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::PFCandidate cand 
) const
private

Definition at line 127 of file PFCandWithSuperClusterExtractor.cc.

129  {
130  reco::isodeposit::Direction candDir(cand.eta(), cand.phi());
131  IsoDeposit deposit(candDir);
132  deposit.setVeto(veto(candDir));
133  deposit.addCandEnergy(cand.pt());
135  event.getByToken(thePFCandToken, PFCandH);
136 
137  double eta = cand.eta(), phi = cand.phi();
138  const reco::Particle::Point& vtx = cand.vertex();
139  for (PFCandidateCollection::const_iterator it = PFCandH->begin(), ed = PFCandH->end(); it != ed; ++it) {
140  // veto SC
141  if (theVetoSuperClusterMatch && cand.superClusterRef().isNonnull() && it->superClusterRef().isNonnull() &&
142  cand.superClusterRef() == it->superClusterRef())
143  continue;
144  double dR = deltaR(it->eta(), it->phi(), eta, phi);
145 
146  if ((dR < theDR_Max) && (dR > theDR_Veto) && (std::abs(it->vz() - cand.vz()) < theDiff_z) &&
147  ((it->vertex() - vtx).Rho() < theDiff_r)) {
148  // ok
149  reco::isodeposit::Direction dirTrk(it->eta(), it->phi());
150  deposit.addDeposit(dirTrk, it->pt());
151  }
152  }
153 
154  return deposit;
155 }

References funct::abs(), reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), PbPb_ZMuSkimMuonDPG_cff::deltaR, deposit(), HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, phi, reco::IsoDeposit::setVeto(), theDiff_r, theDiff_z, theDR_Max, theDR_Veto, thePFCandToken, theVetoSuperClusterMatch, veto(), and extraflags_cff::vtx.

◆ depositFromObject() [3/4]

IsoDeposit PFCandWithSuperClusterExtractor::depositFromObject ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Photon cand 
) const
private

Definition at line 39 of file PFCandWithSuperClusterExtractor.cc.

41  {
42  reco::isodeposit::Direction candDir(cand.eta(), cand.phi());
43  IsoDeposit deposit(candDir);
44  deposit.setVeto(veto(candDir));
46 
48  event.getByToken(thePFCandToken, PFCandH);
49 
50  double eta = cand.eta(), phi = cand.phi();
51  const reco::Particle::Point& vtx = cand.vertex();
52  for (PFCandidateCollection::const_iterator it = PFCandH->begin(), ed = PFCandH->end(); it != ed; ++it) {
53  double dR = deltaR(it->eta(), it->phi(), eta, phi);
54  // veto SC
55  if (theVetoSuperClusterMatch && cand.superCluster().isNonnull() && it->superClusterRef().isNonnull() &&
56  cand.superCluster() == it->superClusterRef())
57  continue;
58  if ((dR < theDR_Max) && (dR > theDR_Veto) && (std::abs(it->vz() - cand.vz()) < theDiff_z) &&
59  ((it->vertex() - vtx).Rho() < theDiff_r)) {
60  // ok
61  reco::isodeposit::Direction dirTrk(it->eta(), it->phi());
62  deposit.addDeposit(dirTrk, it->pt());
63  }
64  }
65 
66  return deposit;
67 }

References funct::abs(), reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), PbPb_ZMuSkimMuonDPG_cff::deltaR, deposit(), HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, phi, reco::IsoDeposit::setVeto(), theDiff_r, theDiff_z, theDR_Max, theDR_Veto, thePFCandToken, theVetoSuperClusterMatch, veto(), and extraflags_cff::vtx.

Referenced by deposit().

◆ depositFromObject() [4/4]

IsoDeposit PFCandWithSuperClusterExtractor::depositFromObject ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track cand 
) const
private

Definition at line 101 of file PFCandWithSuperClusterExtractor.cc.

103  {
104  reco::isodeposit::Direction candDir(cand.eta(), cand.phi());
105  IsoDeposit deposit(candDir);
106  deposit.setVeto(veto(candDir));
107  deposit.addCandEnergy(cand.pt());
109  event.getByToken(thePFCandToken, PFCandH);
110 
111  double eta = cand.eta(), phi = cand.phi();
112  const reco::Particle::Point& vtx = cand.vertex();
113  for (PFCandidateCollection::const_iterator it = PFCandH->begin(), ed = PFCandH->end(); it != ed; ++it) {
114  double dR = deltaR(it->eta(), it->phi(), eta, phi);
115 
116  if ((dR < theDR_Max) && (dR > theDR_Veto) && (std::abs(it->vz() - cand.vz()) < theDiff_z) &&
117  ((it->vertex() - vtx).Rho() < theDiff_r)) {
118  // ok
119  reco::isodeposit::Direction dirTrk(it->eta(), it->phi());
120  deposit.addDeposit(dirTrk, it->pt());
121  }
122  }
123 
124  return deposit;
125 }

References funct::abs(), reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), PbPb_ZMuSkimMuonDPG_cff::deltaR, deposit(), HGC3DClusterGenMatchSelector_cfi::dR, PVValHelper::eta, phi, reco::IsoDeposit::setVeto(), theDiff_r, theDiff_z, theDR_Max, theDR_Veto, thePFCandToken, veto(), and extraflags_cff::vtx.

◆ fillVetos()

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 {}

◆ veto()

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

Definition at line 32 of file PFCandWithSuperClusterExtractor.cc.

32  {
34  result.vetoDir = dir;
35  result.dR = theDR_Veto;
36  return result;
37 }

References DeadROC_duringRun::dir, mps_fire::result, and theDR_Veto.

Referenced by depositFromObject().

Member Data Documentation

◆ theDepositLabel

std::string PFCandWithSuperClusterExtractor::theDepositLabel
private

Definition at line 71 of file PFCandWithSuperClusterExtractor.h.

◆ theDiff_r

double PFCandWithSuperClusterExtractor::theDiff_r
private

Definition at line 74 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

◆ theDiff_z

double PFCandWithSuperClusterExtractor::theDiff_z
private

Definition at line 75 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

◆ theDR_Max

double PFCandWithSuperClusterExtractor::theDR_Max
private

Definition at line 76 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

◆ theDR_Veto

double PFCandWithSuperClusterExtractor::theDR_Veto
private

Definition at line 77 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject(), and veto().

◆ theMissHitVetoSuperClusterMatch

bool PFCandWithSuperClusterExtractor::theMissHitVetoSuperClusterMatch
private

Definition at line 73 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

◆ thePFCandToken

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

Definition at line 70 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

◆ theVetoSuperClusterMatch

bool PFCandWithSuperClusterExtractor::theVetoSuperClusterMatch
private

Definition at line 72 of file PFCandWithSuperClusterExtractor.h.

Referenced by depositFromObject().

PFCandWithSuperClusterExtractor::theDepositLabel
std::string theDepositLabel
Definition: PFCandWithSuperClusterExtractor.h:71
PFCandWithSuperClusterExtractor::theDiff_z
double theDiff_z
Definition: PFCandWithSuperClusterExtractor.h:75
muon
Definition: MuonCocktails.h:17
reco::IsoDeposit::addDeposit
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
reco::IsoDeposit::Veto
Definition: IsoDeposit.h:59
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
PFCandWithSuperClusterExtractor::veto
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
Definition: PFCandWithSuperClusterExtractor.cc:32
PFCandWithSuperClusterExtractor::theMissHitVetoSuperClusterMatch
bool theMissHitVetoSuperClusterMatch
Definition: PFCandWithSuperClusterExtractor.h:73
edm::Handle
Definition: AssociativeIterator.h:50
PFCandWithSuperClusterExtractor::theDiff_r
double theDiff_r
Definition: PFCandWithSuperClusterExtractor.h:74
PVValHelper::eta
Definition: PVValidationHelpers.h:69
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
PFCandWithSuperClusterExtractor::deposit
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
Definition: PFCandWithSuperClusterExtractor.h:29
reco::GsfElectron
Definition: GsfElectron.h:35
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
PFCandWithSuperClusterExtractor::theDR_Veto
double theDR_Veto
Definition: PFCandWithSuperClusterExtractor.h:77
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cand
Definition: decayParser.h:32
reco::IsoDeposit::addCandEnergy
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
DDAxes::phi
reco::Photon
Definition: Photon.h:21
PFCandWithSuperClusterExtractor::thePFCandToken
edm::EDGetTokenT< reco::PFCandidateCollection > thePFCandToken
Definition: PFCandWithSuperClusterExtractor.h:70
JME::Binning::Rho
PFCandWithSuperClusterExtractor::theDR_Max
double theDR_Max
Definition: PFCandWithSuperClusterExtractor.h:76
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
reco::HitPattern::MISSING_INNER_HITS
Definition: HitPattern.h:155
reco::PFCandidateCollection
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Definition: PFCandidateFwd.h:12
reco::IsoDeposit
Definition: IsoDeposit.h:49
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::Particle::Point
math::XYZPoint Point
point in the space
Definition: Particle.h:25
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
mps_fire.result
result
Definition: mps_fire.py:311
PFCandWithSuperClusterExtractor::depositFromObject
reco::IsoDeposit depositFromObject(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Photon &cand) const
Definition: PFCandWithSuperClusterExtractor.cc:39
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
PFCandWithSuperClusterExtractor::theVetoSuperClusterMatch
bool theVetoSuperClusterMatch
Definition: PFCandWithSuperClusterExtractor.h:72
edm::InputTag
Definition: InputTag.h:15
reco::IsoDeposit::setVeto
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23