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_;
81 usePFLeptonsAsChargedHadrons_(
pset.getParameter<
bool>(
"usePFLeptons")),
82 leadObjecPtThreshold_(
pset.getParameter<double>(
"leadObjectPt")),
83 matchingCone_(
pset.getParameter<
std::
string>(
"matchingCone")),
84 signalConeChargedHadrons_(
pset.getParameter<
std::
string>(
"signalConeChargedHadrons")),
85 isoConeChargedHadrons_(
pset.getParameter<
std::
string>(
"isoConeChargedHadrons")),
86 signalConePiZeros_(
pset.getParameter<
std::
string>(
"signalConePiZeros")),
87 signalConeSizeToStore_(
89 isoConePiZeros_(
pset.getParameter<
std::
string>(
"isoConePiZeros")),
90 signalConeNeutralHadrons_(
pset.getParameter<
std::
string>(
"signalConeNeutralHadrons")),
91 isoConeNeutralHadrons_(
pset.getParameter<
std::
string>(
"isoConeNeutralHadrons")),
92 maxSignalConeChargedHadrons_(
pset.getParameter<
int>(
"maxSignalConeChargedHadrons")),
93 minAbsPhotonSumPt_insideSignalCone_(
pset.getParameter<double>(
"minAbsPhotonSumPt_insideSignalCone")),
94 minRelPhotonSumPt_insideSignalCone_(
pset.getParameter<double>(
"minRelPhotonSumPt_insideSignalCone"))
111 const PiZeroList::const_iterator& piZerosEnd) {
112 for (
auto const& ptr :
flattenPiZeros(piZerosBegin, piZerosEnd)) {
144 double photonSumPt_insideSignalCone = 0.;
145 double photonSumPt_outsideSignalCone = 0.;
146 int numPhotons = piZero.numberOfDaughters();
147 for (
int idxPhoton = 0; idxPhoton < numPhotons; ++idxPhoton) {
151 photonSumPt_insideSignalCone +=
photon->pt();
153 photonSumPt_outsideSignalCone +=
photon->pt();
165 unsigned int nCharged = pfChs.size();
182 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons,
183 const std::vector<RecoTauPiZero>& piZeros,
184 const std::vector<CandidatePtr>& regionalExtras)
const {
189 using namespace cone;
204 typedef std::vector<CandidatePtr>
CandPtrs;
240 CandPtrs::iterator leadPFCH_iter = std::find_if(pfchs.begin(), pfchs.end(), matchingConeFilter);
242 if (leadPFCH_iter != pfchs.end()) {
243 leadPFCH = *leadPFCH_iter;
245 tau.setleadChargedHadrCand(leadPFCH);
254 CandPtrs::iterator leadPFGamma_iter = std::find_if(
pfGammas.begin(),
pfGammas.end(), matchingConeFilter);
256 if (leadPFGamma_iter !=
pfGammas.end()) {
257 leadPFGamma = *leadPFGamma_iter;
259 tau.setleadNeutralCand(leadPFGamma);
265 leadPFCand = leadPFCH;
268 leadPFCand = leadPFGamma;
271 leadPFCand = leadPFCH;
274 tau.setleadCand(leadPFCand);
304 RegionalJunkConeAndIdFilter pfChargedJunk(pfchCandSelector,
308 RegionalJunkConeAndIdFilter pfGammaJunk(pfgammaCandSelector,
312 RegionalJunkConeAndIdFilter pfNeutralJunk(pfnhCandSelector,
317 CandPtrDRFilterIter signalPFCHCands_begin(signalConePFCHFilter, pfchs.begin(), pfchs.end());
320 int numSignalPFCHs = 0;
322 for (
CandPtrDRFilterIter iter = signalPFCHCands_begin; iter != signalPFCHCands_end; ++iter) {
325 signalPFCHs.push_back(*iter);
329 isolationPFCHs.push_back(*iter);
332 CandPtrs::const_iterator signalPFCHs_begin = signalPFCHs.begin();
333 CandPtrs::const_iterator signalPFCHs_end = signalPFCHs.end();
337 std::vector<reco::RecoTauPiZero> cleanPiZeros = piZeroXCleaner(piZeros);
343 auto isolationPFCHCands_begin(boost::make_filter_iterator(
345 auto isolationPFCHCands_end(boost::make_filter_iterator(
347 for (
auto iter = isolationPFCHCands_begin; iter != isolationPFCHCands_end; ++iter) {
348 isolationPFCHs.push_back(*iter);
350 CandPtrs::const_iterator isolationPFCHs_begin = isolationPFCHs.begin();
351 CandPtrs::const_iterator isolationPFCHs_end = isolationPFCHs.end();
359 boost::make_filter_iterator(
361 boost::make_filter_iterator(
376 boost::make_filter_iterator(pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
377 boost::make_filter_iterator(pfChargedJunk, regionalJunk.end(), regionalJunk.end()));
382 boost::make_filter_iterator(
384 boost::make_filter_iterator(
390 boost::make_filter_iterator(pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
391 boost::make_filter_iterator(pfNeutralJunk, regionalJunk.end(), regionalJunk.end()));
401 boost::make_filter_iterator(pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
402 boost::make_filter_iterator(pfGammaJunk, regionalJunk.end(), regionalJunk.end()));
407 std::unique_ptr<reco::PFTau> tauPtr =
tau.get(
false);
412 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
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.
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float charge(ConstView const &tracks, int32_t i)
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
minAbsPhotonSumPt_outsideSignalCone
reco::VertexRef primaryVertex(const reco::JetBaseRef &jet) const
Get primary vertex associated to this jet.
std::vector< reco::CandidatePtr > CandPtrs
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.
minRelPhotonSumPt_insideSignalCone
#define DEFINE_EDM_PLUGIN(factory, type, name)
StringObjectFunction< reco::Jet > JetFunc
JetFunc signalConeChargedHadrons_
void setPdgId(int pdgId) final
JetFunc signalConeNeutralHadrons_
void initialize(const PtrIter &particlesBegin, const PtrIter &particlesEnd)
std::vector< RecoTauPiZero > PiZeroList
minAbsPhotonSumPt_insideSignalCone
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)