15 #include "boost/bind.hpp" 33 namespace reco {
namespace tau {
39 double factor =
sqrt(vec.energy()*vec.energy()-mass*
mass)/vec.P();
41 vec.px()*factor,vec.py()*factor,vec.pz()*factor,vec.energy());
78 "stripCandidatesParticleIds");
80 "stripEtaAssociationDistance");
82 "stripPhiAssociationDistance");
99 typedef std::vector<reco::PFCandidatePtr>
PFCandPtrs;
109 typedef std::list<reco::PFCandidatePtr> PFCandPtrList;
110 typedef std::list<reco::PFCandidatePtr>::iterator PFCandPtrListIter;
112 cands.insert(cands.end(), candsVector.begin(), candsVector.end());
114 while (!cands.empty()) {
122 strip->addDaughter(seed);
125 PFCandPtrListIter stripCand = cands.begin();
126 while(stripCand != cands.end()) {
130 strip->addDaughter(*stripCand);
135 stripCand = cands.erase(stripCand);
142 if (strip->daughterPtr(0).isNonnull())
143 strip->setVertex(strip->daughterPtr(0)->vertex());
144 output.push_back(strip.get());
151 output.sort(output.begin(), output.end(),
159 for (PiZeroVector::const_iterator
first = output.begin();
161 for (PiZeroVector::const_iterator
second =
first+1;
170 std::unique_ptr<RecoTauPiZero> combinedStrips(
177 for(
auto const&
gamma :
first->daughterPtrVector()) {
178 combinedStrips->addDaughter(
gamma);
180 for(
auto const&
gamma :
second->daughterPtrVector()) {
181 combinedStrips->addDaughter(
gamma);
184 if (combinedStrips->daughterPtr(0).isNonnull())
185 combinedStrips->setVertex(combinedStrips->daughterPtr(0)->vertex());
187 stripCombinations.push_back(combinedStrips.get());
192 output.transfer(output.end(), stripCombinations);
195 return output.release();
constexpr double deltaPhi(double phi1, double phi2)
T getParameter(std::string const &) const
AddFourMomenta p4Builder_
InputIterator takeNElements(const InputIterator &begin, const InputIterator &end, size_t N)
Coll filterCandRefs(const Coll &refcoll, bool invert=false) const
Filter a ref vector of PFCandidates.
ParameterSet const & getParameterSet(ParameterSetID const &id)
std::vector< reco::PFCandidatePtr > PFCandPtrs
reco::VertexRef associatedVertex(const PFJet &jet) const
double pt() const final
transverse momentum
void setEvent(const edm::Event &evt)
Load the vertices from the event.
RecoTauPiZeroStripPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
~RecoTauPiZeroStripPlugin() override
Jets made from PFObjects.
void beginEvent() override
Hook called at the beginning of the event.
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
return_type operator()(const reco::PFJet &jet) const override
Build a collection of piZeros from objects in the input jet.
void setPV(const reco::VertexRef &vtx) const
Update the primary vertex.
double phiAssociationDistance_
std::vector< int > inputPdgIds_
RecoTauVertexAssociator vertexAssociator_
const edm::Event * evt() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::auto_ptr< PiZeroVector > return_type
RecoTauQualityCuts qcuts_
boost::ptr_vector< RecoTauPiZero > PiZeroVector
PFCandPtrs::iterator PFCandIter
math::XYZPoint Point
point in the space
double combinatoricStripMassHypo_
#define DEFINE_EDM_PLUGIN(factory, type, name)
void set(reco::Candidate &c) const
set up a candidate
double etaAssociationDistance_