15 #include <boost/ptr_container/ptr_list.hpp>
16 #include <boost/ptr_container/ptr_vector.hpp>
51 void print(
const std::vector<reco::RecoTauPiZero>& piZeros, std::ostream&
out);
85 typedef std::vector<edm::ParameterSet>
VPSet;
92 for (VPSet::const_iterator builderPSet =
builders.begin(); builderPSet !=
builders.end(); ++builderPSet) {
102 for (VPSet::const_iterator rankerPSet = rankers.begin(); rankerPSet != rankers.end(); ++rankerPSet) {
118 produces<reco::JetPiZeroAssociation>();
128 builder.setup(evt, es);
132 std::unique_ptr<reco::JetPiZeroAssociation>
association;
137 size_t nJets = jetView->
size();
138 for (
size_t i = 0;
i < nJets; ++
i) {
152 dirtyPiZeros.transfer(dirtyPiZeros.end(),
result);
155 <<
"Exception caught in builder plugin " << builder.name() <<
", rethrowing" << std::endl;
163 std::vector<reco::RecoTauPiZero> cleanPiZeros;
164 std::set<reco::CandidatePtr> photonsInCleanCollection;
165 while (!dirtyPiZeros.empty()) {
167 std::unique_ptr<reco::RecoTauPiZero>
toAdd(dirtyPiZeros.pop_front().release());
173 std::vector<reco::CandidatePtr> uniqueGammas;
174 std::set_difference(
toAdd->daughterPtrVector().begin(),
175 toAdd->daughterPtrVector().end(),
176 photonsInCleanCollection.begin(),
177 photonsInCleanCollection.end(),
178 std::back_inserter(uniqueGammas));
181 if (uniqueGammas.empty()) {
183 }
else if (uniqueGammas.size() ==
toAdd->daughterPtrVector().size()) {
186 photonsInCleanCollection.insert(
toAdd->daughterPtrVector().begin(),
toAdd->daughterPtrVector().end());
187 cleanPiZeros.push_back(*
toAdd);
191 toAdd->clearDaughters();
193 for (
auto const&
gamma : uniqueGammas) {
200 PiZeroList::iterator insertionPoint =
207 for (
auto& cleanPiZero : cleanPiZeros) {
222 const unsigned int width = 25;
223 for (
auto const& piZero : piZeros) {
225 out <<
"* Rankers:" << std::endl;
226 for (rankerList::const_iterator ranker =
rankers_.begin(); ranker !=
rankers_.end(); ++ranker) {
227 out <<
"* " << std::setiosflags(std::ios::left) << std::setw(
width) << ranker->name() <<
" "
228 << std::resetiosflags(std::ios::left) << std::setprecision(3) << (*ranker)(piZero);
238 desc_ranking.
add<
double>(
"selectionFailValue", 1000);
244 pset_ranking.addParameter<
double>(
"selectionFailValue", 1000);
245 pset_ranking.addParameter<
std::string>(
"selection",
"");
246 pset_ranking.addParameter<
std::string>(
"name",
"");
247 pset_ranking.addParameter<
std::string>(
"plugin",
"");
248 std::vector<edm::ParameterSet> vpsd_ranking;
249 vpsd_ranking.push_back(pset_ranking);
264 desc.add<
double>(
"massHypothesis", 0.136);
265 desc.addVPSet(
"ranking", desc_ranking, vpsd_ranking);
266 desc.add<
int>(
"verbosity", 0);
267 desc.add<
double>(
"maxJetAbsEta", 2.5);
269 desc.add<
double>(
"minJetPt", 14.0);
275 psd0.
add<
std::string>(
"function",
"TMath::Min(0.3, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))");
276 psd0.
add<
double>(
"par1", 0.707716);
277 psd0.
add<
double>(
"par0", 0.352476);
282 psd0.
add<
std::string>(
"function",
"TMath::Min(0.15, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))");
283 psd0.
add<
double>(
"par1", 0.658701);
284 psd0.
add<
double>(
"par0", 0.197077);
287 desc_builders.
addOptional<
double>(
"stripEtaAssociationDistance", 0.05);
288 desc_builders.addOptional<
double>(
"stripPhiAssociationDistance", 0.2);
294 desc_builders.add<
int>(
"verbosity", 0);
296 desc_builders.addOptional<
bool>(
"makeCombinatoricStrips");
297 desc_builders.addOptional<
int>(
"maxStripBuildIterations");
298 desc_builders.addOptional<
double>(
"minGammaEtStripAdd");
299 desc_builders.addOptional<
double>(
"minGammaEtStripSeed");
300 desc_builders.addOptional<
double>(
"minStripEt");
301 desc_builders.addOptional<std::vector<int>>(
"stripCandidatesParticleIds");
302 desc_builders.addOptional<
bool>(
"updateStripAfterEachDaughter");
303 desc_builders.addOptional<
bool>(
"applyElecTrackQcuts");
305 std::vector<edm::ParameterSet> vpsd_builders;
306 vpsd_builders.push_back(pset_builders);
307 desc.addVPSet(
"builders", desc_builders, vpsd_builders);
309 descriptions.
add(
"recoTauPiZeroProducer",
desc);