41 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons,
42 const std::vector<RecoTauPiZero>& piZeros,
43 const std::vector<CandidatePtr>& regionalExtras)
const override;
46 std::unique_ptr<RecoTauQualityCuts>
qcuts_;
80 usePFLeptonsAsChargedHadrons_(
pset.getParameter<
bool>(
"usePFLeptons")),
81 leadObjecPtThreshold_(
pset.getParameter<double>(
"leadObjectPt")),
82 matchingCone_(
pset.getParameter<
std::
string>(
"matchingCone")),
83 signalConeChargedHadrons_(
pset.getParameter<
std::
string>(
"signalConeChargedHadrons")),
84 isoConeChargedHadrons_(
pset.getParameter<
std::
string>(
"isoConeChargedHadrons")),
85 signalConePiZeros_(
pset.getParameter<
std::
string>(
"signalConePiZeros")),
86 signalConeSizeToStore_(
88 isoConePiZeros_(
pset.getParameter<
std::
string>(
"isoConePiZeros")),
89 signalConeNeutralHadrons_(
pset.getParameter<
std::
string>(
"signalConeNeutralHadrons")),
90 isoConeNeutralHadrons_(
pset.getParameter<
std::
string>(
"isoConeNeutralHadrons")),
91 maxSignalConeChargedHadrons_(
pset.getParameter<
int>(
"maxSignalConeChargedHadrons")),
92 minAbsPhotonSumPt_insideSignalCone_(
pset.getParameter<double>(
"minAbsPhotonSumPt_insideSignalCone")),
93 minRelPhotonSumPt_insideSignalCone_(
pset.getParameter<double>(
"minRelPhotonSumPt_insideSignalCone"))
110 const PiZeroList::const_iterator& piZerosEnd) {
111 for (
auto const& ptr :
flattenPiZeros(piZerosBegin, piZerosEnd)) {
143 double photonSumPt_insideSignalCone = 0.;
144 double photonSumPt_outsideSignalCone = 0.;
145 int numPhotons = piZero.numberOfDaughters();
146 for (
int idxPhoton = 0; idxPhoton < numPhotons; ++idxPhoton) {
150 photonSumPt_insideSignalCone +=
photon->pt();
152 photonSumPt_outsideSignalCone +=
photon->pt();
164 unsigned int nCharged = pfChs.size();
181 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons,
182 const std::vector<RecoTauPiZero>& piZeros,
183 const std::vector<CandidatePtr>& regionalExtras)
const {
188 using namespace cone;
203 typedef std::vector<CandidatePtr>
CandPtrs;
239 CandPtrs::iterator leadPFCH_iter = std::find_if(pfchs.begin(), pfchs.end(), matchingConeFilter);
241 if (leadPFCH_iter != pfchs.end()) {
242 leadPFCH = *leadPFCH_iter;
244 tau.setleadChargedHadrCand(leadPFCH);
253 CandPtrs::iterator leadPFGamma_iter = std::find_if(
pfGammas.begin(),
pfGammas.end(), matchingConeFilter);
255 if (leadPFGamma_iter !=
pfGammas.end()) {
256 leadPFGamma = *leadPFGamma_iter;
258 tau.setleadNeutralCand(leadPFGamma);
264 leadPFCand = leadPFCH;
267 leadPFCand = leadPFGamma;
270 leadPFCand = leadPFCH;
273 tau.setleadCand(leadPFCand);
303 RegionalJunkConeAndIdFilter pfChargedJunk(pfchCandSelector,
307 RegionalJunkConeAndIdFilter pfGammaJunk(pfgammaCandSelector,
311 RegionalJunkConeAndIdFilter pfNeutralJunk(pfnhCandSelector,
316 CandPtrDRFilterIter signalPFCHCands_begin(signalConePFCHFilter, pfchs.begin(), pfchs.end());
319 int numSignalPFCHs = 0;
321 int numIsolationPFCHs = 0;
322 for (
CandPtrDRFilterIter iter = signalPFCHCands_begin; iter != signalPFCHCands_end; ++iter) {
325 signalPFCHs.push_back(*iter);
330 isolationPFCHs.push_back(*iter);
334 CandPtrs::const_iterator signalPFCHs_begin = signalPFCHs.begin();
335 CandPtrs::const_iterator signalPFCHs_end = signalPFCHs.end();
339 std::vector<reco::RecoTauPiZero> cleanPiZeros = piZeroXCleaner(piZeros);
345 auto isolationPFCHCands_begin(boost::make_filter_iterator(
347 auto isolationPFCHCands_end(boost::make_filter_iterator(
349 for (
auto iter = isolationPFCHCands_begin; iter != isolationPFCHCands_end; ++iter) {
351 isolationPFCHs.push_back(*iter);
354 CandPtrs::const_iterator isolationPFCHs_begin = isolationPFCHs.begin();
355 CandPtrs::const_iterator isolationPFCHs_end = isolationPFCHs.end();
363 boost::make_filter_iterator(
365 boost::make_filter_iterator(
380 boost::make_filter_iterator(pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
381 boost::make_filter_iterator(pfChargedJunk, regionalJunk.end(), regionalJunk.end()));
386 boost::make_filter_iterator(
388 boost::make_filter_iterator(
394 boost::make_filter_iterator(pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
395 boost::make_filter_iterator(pfNeutralJunk, regionalJunk.end(), regionalJunk.end()));
405 boost::make_filter_iterator(pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
406 boost::make_filter_iterator(pfGammaJunk, regionalJunk.end(), regionalJunk.end()));
411 std::unique_ptr<reco::PFTau> tauPtr =
tau.get(
false);
416 tauPtr->setVertex(primaryVertexRef->position());
std::vector< CandidatePtr > pfCandidatesByPdgId(const Jet &jet, int pdgId, bool sort=true)
void setTauQuantities(reco::PFTau &aTau, double minAbsPhotonSumPt_insideSignalCone=2.5, double minRelPhotonSumPt_insideSignalCone=0., double minAbsPhotonSumPt_outsideSignalCone=1.e+9, double minRelPhotonSumPt_outsideSignalCone=1.e+9) const
minRelPhotonSumPt_outsideSignalCone
minAbsPhotonSumPt_outsideSignalCone
std::unique_ptr< RecoTauQualityCuts > qcuts_
double signalConeSize() const
Size of signal cone.
std::vector< std::unique_ptr< reco::PFTau > > output_type
double pt() const final
transverse momentum
return_type operator()(const reco::JetBaseRef &jet, const std::vector< reco::PFRecoTauChargedHadron > &chargedHadrons, const std::vector< RecoTauPiZero > &piZeros, const std::vector< CandidatePtr > ®ionalExtras) const override
const std::vector< RecoTauPiZero > & signalPiZeroCandidates() const
Retrieve the association of signal region gamma candidates into candidate PiZeros.
bool usePFLeptonsAsChargedHadrons_
JetFunc isoConeChargedHadrons_
const CandidatePtr & leadChargedHadrCand() const
const edm::Handle< edm::View< reco::Candidate > > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
int maxSignalConeChargedHadrons_
bool isNonnull() const
Checks for non-null.
RecoTauBuilderConePlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
std::vector< CandidatePtr > pfChargedCands(const Jet &jet, bool sort=true)
Extract all non-neutral candidates from a PFJet.
JetFunc isoConeNeutralHadrons_
const LorentzVector & p4() const final
four-momentum Lorentz vector
StringObjectFunction< reco::PFTau > signalConeSizeToStore_
std::vector< CandidatePtr > flattenPiZeros(const std::vector< RecoTauPiZero >::const_iterator &, const std::vector< RecoTauPiZero >::const_iterator &)
Flatten a list of pi zeros into a list of there constituent PFCandidates.
void setCharge(Charge q) final
set electric charge
reco::VertexRef primaryVertex(const reco::JetBaseRef &jet) const
Get primary vertex associated to this jet.
std::vector< reco::CandidatePtr > CandPtrs
minAbsPhotonSumPt_insideSignalCone
bool isNonnull() const
Checks for non-null.
void setDecayMode(const hadronicDecayMode &)
boost::filter_iterator< CandPtrDRFilter, std::vector< CandidatePtr >::const_iterator > CandPtrDRFilterIter
boost::filter_iterator< PiZeroDRFilter, std::vector< RecoTauPiZero >::const_iterator > PiZeroDRFilterIter
double leadObjecPtThreshold_
void initialize(const PtrIter &chargedHadronsBegin, const PtrIter &chargedHadronsEnd)
double minRelPhotonSumPt_insideSignalCone_
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
double minAbsPhotonSumPt_insideSignalCone_
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
~RecoTauBuilderConePlugin() override
JetFunc signalConePiZeros_
DeltaRPtrFilter< CandidatePtr > CandPtrDRFilter
DeltaRFilter< RecoTauPiZero > PiZeroDRFilter
math::XYZTLorentzVector LorentzVector
Lorentz vector.
ParameterSet const & getParameterSet(ParameterSetID const &id)
const std::vector< reco::CandidatePtr > & signalChargedHadrCands() const
Charged hadrons in signal region.
#define DEFINE_EDM_PLUGIN(factory, type, name)
StringObjectFunction< reco::Jet > JetFunc
minRelPhotonSumPt_insideSignalCone
JetFunc signalConeChargedHadrons_
void setPdgId(int pdgId) final
JetFunc signalConeNeutralHadrons_
void initialize(const PtrIter &particlesBegin, const PtrIter &particlesEnd)
std::vector< RecoTauPiZero > PiZeroList
Transform a pizero to remove given candidates.
int charge() const final
electric charge
std::vector< CandidatePtr > pfGammas(const Jet &jet, bool sort=true)
Extract all pfGammas from a PFJet.
PredicateAND< P1, P2 > makePredicateAND(const P1 &p1, const P2 &p2)