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::CandidatePtr>
CandPtrs;
100 typedef CandPtrs::iterator
CandIter;
109 typedef std::list<reco::CandidatePtr> CandPtrList;
110 typedef std::list<reco::CandidatePtr>::iterator CandPtrListIter;
112 cands.insert(cands.end(), candsVector.begin(), candsVector.end());
114 while (!cands.empty()) {
122 strip->addDaughter(seed);
125 CandPtrListIter 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)
std::vector< CandidatePtr > pfCandidates(const Jet &jet, int particleId, bool sort=true)
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 Candidates.
Base class for all types of Jets.
ParameterSet const & getParameterSet(ParameterSetID const &id)
return_type operator()(const reco::Jet &jet) const override
Build a collection of piZeros from objects in the input jet.
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
void beginEvent() override
Hook called at the beginning of the event.
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::vector< reco::CandidatePtr > CandPtrs
void setPV(const reco::VertexRef &vtx) const
Update the primary vertex.
double phiAssociationDistance_
RecoTauVertexAssociator vertexAssociator_
const edm::Event * evt() const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::auto_ptr< PiZeroVector > return_type
RecoTauQualityCuts qcuts_
reco::VertexRef associatedVertex(const Jet &jet) const
boost::ptr_vector< RecoTauPiZero > PiZeroVector
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_
CandPtrs::iterator CandIter
std::vector< int > inputParticleIds_