15 #include <boost/ptr_container/ptr_list.hpp>
16 #include <boost/ptr_container/ptr_vector.hpp>
50 void print(
const std::vector<reco::RecoTauPiZero>& piZeros, std::ostream&
out);
84 typedef std::vector<edm::ParameterSet>
VPSet;
91 for (VPSet::const_iterator builderPSet =
builders.begin(); builderPSet !=
builders.end(); ++builderPSet) {
101 for (VPSet::const_iterator rankerPSet = rankers.begin(); rankerPSet != rankers.end(); ++rankerPSet) {
117 produces<reco::JetPiZeroAssociation>();
127 builder.setup(evt, es);
131 std::unique_ptr<reco::JetPiZeroAssociation>
association;
136 size_t nJets = jetView->
size();
137 for (
size_t i = 0;
i < nJets; ++
i) {
151 dirtyPiZeros.transfer(dirtyPiZeros.end(),
result);
154 <<
"Exception caught in builder plugin " << builder.name() <<
", rethrowing" << std::endl;
162 std::vector<reco::RecoTauPiZero> cleanPiZeros;
163 std::set<reco::CandidatePtr> photonsInCleanCollection;
164 while (!dirtyPiZeros.empty()) {
166 std::unique_ptr<reco::RecoTauPiZero>
toAdd(dirtyPiZeros.pop_front().release());
172 std::vector<reco::CandidatePtr> uniqueGammas;
173 std::set_difference(
toAdd->daughterPtrVector().begin(),
174 toAdd->daughterPtrVector().end(),
175 photonsInCleanCollection.begin(),
176 photonsInCleanCollection.end(),
177 std::back_inserter(uniqueGammas));
180 if (uniqueGammas.empty()) {
182 }
else if (uniqueGammas.size() ==
toAdd->daughterPtrVector().size()) {
185 photonsInCleanCollection.insert(
toAdd->daughterPtrVector().begin(),
toAdd->daughterPtrVector().end());
186 cleanPiZeros.push_back(*
toAdd);
190 toAdd->clearDaughters();
192 for (
auto const&
gamma : uniqueGammas) {
199 PiZeroList::iterator insertionPoint =
206 for (
auto& cleanPiZero : cleanPiZeros) {
221 const unsigned int width = 25;
222 for (
auto const& piZero : piZeros) {
224 out <<
"* Rankers:" << std::endl;
225 for (rankerList::const_iterator ranker =
rankers_.begin(); ranker !=
rankers_.end(); ++ranker) {
226 out <<
"* " << std::setiosflags(std::ios::left) << std::setw(
width) << ranker->name() <<
" "
227 << std::resetiosflags(std::ios::left) << std::setprecision(3) << (*ranker)(piZero);
237 desc_ranking.
add<
double>(
"selectionFailValue", 1000);
243 pset_ranking.addParameter<
double>(
"selectionFailValue", 1000);
244 pset_ranking.addParameter<
std::string>(
"selection",
"");
245 pset_ranking.addParameter<
std::string>(
"name",
"");
246 pset_ranking.addParameter<
std::string>(
"plugin",
"");
247 std::vector<edm::ParameterSet> vpsd_ranking;
248 vpsd_ranking.push_back(pset_ranking);
263 desc.add<
double>(
"massHypothesis", 0.136);
264 desc.addVPSet(
"ranking", desc_ranking, vpsd_ranking);
265 desc.add<
int>(
"verbosity", 0);
266 desc.add<
double>(
"maxJetAbsEta", 2.5);
268 desc.add<
double>(
"minJetPt", 14.0);
274 psd0.
add<
std::string>(
"function",
"TMath::Min(0.3, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))");
275 psd0.
add<
double>(
"par1", 0.707716);
276 psd0.
add<
double>(
"par0", 0.352476);
281 psd0.
add<
std::string>(
"function",
"TMath::Min(0.15, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))");
282 psd0.
add<
double>(
"par1", 0.658701);
283 psd0.
add<
double>(
"par0", 0.197077);
286 desc_builders.
addOptional<
double>(
"stripEtaAssociationDistance", 0.05);
287 desc_builders.addOptional<
double>(
"stripPhiAssociationDistance", 0.2);
293 desc_builders.add<
int>(
"verbosity", 0);
295 desc_builders.addOptional<
bool>(
"makeCombinatoricStrips");
296 desc_builders.addOptional<
int>(
"maxStripBuildIterations");
297 desc_builders.addOptional<
double>(
"minGammaEtStripAdd");
298 desc_builders.addOptional<
double>(
"minGammaEtStripSeed");
299 desc_builders.addOptional<
double>(
"minStripEt");
300 desc_builders.addOptional<std::vector<int>>(
"stripCandidatesParticleIds");
301 desc_builders.addOptional<
bool>(
"updateStripAfterEachDaughter");
302 desc_builders.addOptional<
bool>(
"applyElecTrackQcuts");
304 std::vector<edm::ParameterSet> vpsd_builders;
305 vpsd_builders.push_back(pset_builders);
306 desc.addVPSet(
"builders", desc_builders, vpsd_builders);
308 descriptions.
add(
"recoTauPiZeroProducer",
desc);