38 double factor =
sqrt(vec.energy() * vec.energy() - mass *
mass) / vec.P();
53 std::unique_ptr<RecoTauQualityCuts>
qcuts_;
71 vertexAssociator_(pset.getParameter<edm::
ParameterSet>(
"qualityCuts"), std::
move(iC)) {
87 typedef std::vector<reco::CandidatePtr>
CandPtrs;
97 std::list<reco::CandidatePtr>
cands;
98 cands.insert(cands.end(), candsVector.begin(), candsVector.end());
100 while (!cands.empty()) {
107 strip->addDaughter(seed);
110 auto stripCand = cands.begin();
111 while (stripCand != cands.end()) {
115 strip->addDaughter(*stripCand);
120 stripCand = cands.erase(stripCand);
127 if (
strip->daughterPtr(0).isNonnull())
128 strip->setVertex(
strip->daughterPtr(0)->vertex());
129 output.emplace_back(
strip.release());
136 std::sort(output.begin(), output.end(), [&](
auto& arg1,
auto& arg2) {
return arg1->pt() > arg2->pt(); });
141 for (PiZeroVector::const_iterator firstIter = output.begin(); firstIter != end_iter - 1; ++firstIter) {
142 for (PiZeroVector::const_iterator secondIter = firstIter + 1; secondIter != end_iter; ++secondIter) {
143 auto const&
first = *firstIter;
144 auto const&
second = *secondIter;
152 auto combinedStrips =
153 std::make_unique<RecoTauPiZero>(0,
163 for (
auto const& gamma :
first->daughterPtrVector()) {
164 combinedStrips->addDaughter(gamma);
166 for (
auto const& gamma :
second->daughterPtrVector()) {
167 combinedStrips->addDaughter(gamma);
170 if (combinedStrips->daughterPtr(0).isNonnull())
171 combinedStrips->setVertex(combinedStrips->daughterPtr(0)->vertex());
173 stripCombinations.emplace_back(combinedStrips.release());
177 std::move(stripCombinations.begin(), stripCombinations.end(), std::back_inserter(output));
constexpr double deltaPhi(double phi1, double phi2)
std::vector< CandidatePtr > pfCandidates(const Jet &jet, int particleId, bool sort=true)
AddFourMomenta p4Builder_
InputIterator takeNElements(const InputIterator &begin, const InputIterator &end, size_t N)
Base class for all types of Jets.
ParameterSet const & getParameterSet(ParameterSetID const &id)
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
double phiAssociationDistance_
RecoTauVertexAssociator vertexAssociator_
const edm::Event * evt() const
T getParameter(std::string const &) const
std::vector< std::unique_ptr< RecoTauPiZero > > PiZeroVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
reco::VertexRef associatedVertex(const Jet &jet) const
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
std::unique_ptr< RecoTauQualityCuts > qcuts_
return_type operator()(const reco::Jet &jet) const override
Build a collection of piZeros from objects in the input jet.
double etaAssociationDistance_
CandPtrs::iterator CandIter
std::vector< int > inputParticleIds_