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());
76 vertexAssociator_(pset.getParameter<edm::
ParameterSet>(
"qualityCuts"),std::move(iC)) {
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.size() > 0) {
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);
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::auto_ptr<RecoTauPiZero> combinedStrips(
178 first->daughterPtrVector()) {
179 combinedStrips->addDaughter(gamma);
182 second->daughterPtrVector()) {
183 combinedStrips->addDaughter(gamma);
186 if (combinedStrips->daughterPtr(0).isNonnull())
187 combinedStrips->setVertex(combinedStrips->daughterPtr(0)->vertex());
189 stripCombinations.push_back(combinedStrips);
194 output.transfer(output.end(), stripCombinations);
197 return output.release();
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
void setEvent(const edm::Event &evt)
Load the vertices from the event.
RecoTauPiZeroStripPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
Jets made from PFObjects.
virtual 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.
virtual ~RecoTauPiZeroStripPlugin()
void setPV(const reco::VertexRef &vtx) const
Update the primary vertex.
double phiAssociationDistance_
return_type operator()(const reco::PFJet &jet) const override
Build a collection of piZeros from objects in the input jet.
Container::value_type value_type
std::vector< int > inputPdgIds_
double deltaPhi(double phi1, double phi2)
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
virtual float pt() const GCC11_FINAL
transverse momentum
double etaAssociationDistance_