14 #include <boost/ptr_container/ptr_vector.hpp>
15 #include <boost/ptr_container/ptr_list.hpp>
49 void print(
const std::vector<reco::RecoTauPiZero>& piZeros, std::ostream&
out);
83 typedef std::vector<edm::ParameterSet>
VPSet;
90 for (VPSet::const_iterator builderPSet =
builders.begin(); builderPSet !=
builders.end(); ++builderPSet) {
100 for (VPSet::const_iterator rankerPSet = rankers.begin(); rankerPSet != rankers.end(); ++rankerPSet) {
116 produces<reco::JetPiZeroAssociation>();
126 builder.setup(evt, es);
130 std::unique_ptr<reco::JetPiZeroAssociation>
association;
135 size_t nJets = jetView->
size();
136 for (
size_t i = 0;
i < nJets; ++
i) {
150 dirtyPiZeros.transfer(dirtyPiZeros.end(),
result);
153 <<
"Exception caught in builder plugin " << builder.name() <<
", rethrowing" << std::endl;
161 std::vector<reco::RecoTauPiZero> cleanPiZeros;
162 std::set<reco::CandidatePtr> photonsInCleanCollection;
163 while (!dirtyPiZeros.empty()) {
165 std::unique_ptr<reco::RecoTauPiZero>
toAdd(dirtyPiZeros.pop_front().release());
171 std::vector<reco::CandidatePtr> uniqueGammas;
172 std::set_difference(
toAdd->daughterPtrVector().begin(),
173 toAdd->daughterPtrVector().end(),
174 photonsInCleanCollection.begin(),
175 photonsInCleanCollection.end(),
176 std::back_inserter(uniqueGammas));
179 if (uniqueGammas.empty()) {
181 }
else if (uniqueGammas.size() ==
toAdd->daughterPtrVector().size()) {
184 photonsInCleanCollection.insert(
toAdd->daughterPtrVector().begin(),
toAdd->daughterPtrVector().end());
185 cleanPiZeros.push_back(*
toAdd);
189 toAdd->clearDaughters();
191 for (
auto const&
gamma : uniqueGammas) {
198 PiZeroList::iterator insertionPoint =
205 for (
auto& cleanPiZero : cleanPiZeros) {
220 const unsigned int width = 25;
221 for (
auto const& piZero : piZeros) {
223 out <<
"* Rankers:" << std::endl;
224 for (rankerList::const_iterator ranker =
rankers_.begin(); ranker !=
rankers_.end(); ++ranker) {
225 out <<
"* " << std::setiosflags(std::ios::left) << std::setw(
width) << ranker->name() <<
" "
226 << std::resetiosflags(std::ios::left) << std::setprecision(3) << (*ranker)(piZero);
236 desc_ranking.
add<
double>(
"selectionFailValue", 1000);
242 pset_ranking.addParameter<
double>(
"selectionFailValue", 1000);
243 pset_ranking.addParameter<
std::string>(
"selection",
"");
244 pset_ranking.addParameter<
std::string>(
"name",
"");
245 pset_ranking.addParameter<
std::string>(
"plugin",
"");
246 std::vector<edm::ParameterSet> vpsd_ranking;
247 vpsd_ranking.push_back(pset_ranking);
250 desc_signalQualityCuts.
add<
double>(
"maxDeltaZ", 0.4);
251 desc_signalQualityCuts.
add<
double>(
"minTrackPt", 0.5);
252 desc_signalQualityCuts.
add<
double>(
"minTrackVertexWeight", -1.0);
253 desc_signalQualityCuts.
add<
double>(
"maxTrackChi2", 100.0);
254 desc_signalQualityCuts.
add<
unsigned int>(
"minTrackPixelHits", 0);
255 desc_signalQualityCuts.
add<
double>(
"minGammaEt", 1.0);
256 desc_signalQualityCuts.
add<
unsigned int>(
"minTrackHits", 3);
257 desc_signalQualityCuts.
addOptional<
double>(
"minNeutralHadronEt");
258 desc_signalQualityCuts.
add<
double>(
"maxTransverseImpactParameter", 0.1);
259 desc_signalQualityCuts.
addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
262 desc_vxAssocQualityCuts.
add<
double>(
"minTrackPt", 0.5);
263 desc_vxAssocQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
264 desc_vxAssocQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
265 desc_vxAssocQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
266 desc_vxAssocQualityCuts.add<
double>(
"minGammaEt", 1.0);
267 desc_vxAssocQualityCuts.add<
unsigned int>(
"minTrackHits", 3);
268 desc_vxAssocQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.1);
269 desc_vxAssocQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
272 desc_isolationQualityCuts.
add<
double>(
"maxDeltaZ", 0.2);
273 desc_isolationQualityCuts.add<
double>(
"minTrackPt", 1.0);
274 desc_isolationQualityCuts.add<
double>(
"minTrackVertexWeight", -1.0);
275 desc_isolationQualityCuts.add<
double>(
"maxTrackChi2", 100.0);
276 desc_isolationQualityCuts.add<
unsigned int>(
"minTrackPixelHits", 0);
277 desc_isolationQualityCuts.add<
double>(
"minGammaEt", 1.5);
278 desc_isolationQualityCuts.add<
unsigned int>(
"minTrackHits", 8);
279 desc_isolationQualityCuts.add<
double>(
"maxTransverseImpactParameter", 0.03);
280 desc_isolationQualityCuts.addOptional<
bool>(
"useTracksInsteadOfPFHadrons");
286 desc_qualityCuts.
add<
std::string>(
"leadingTrkOrPFCandOption",
"leadPFCand");
287 desc_qualityCuts.add<
std::string>(
"pvFindingAlgo",
"closestInDeltaZ");
289 desc_qualityCuts.add<
bool>(
"vertexTrackFiltering",
false);
290 desc_qualityCuts.add<
bool>(
"recoverLeadingTrk",
false);
294 pset_builders.addParameter<
std::string>(
"plugin",
"");
302 desc.
add<
double>(
"massHypothesis", 0.136);
303 desc.
addVPSet(
"ranking", desc_ranking, vpsd_ranking);
304 desc.
add<
int>(
"verbosity", 0);
305 desc.
add<
double>(
"maxJetAbsEta", 2.5);
307 desc.
add<
double>(
"minJetPt", 14.0);
313 psd0.
add<
std::string>(
"function",
"TMath::Min(0.3, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))");
314 psd0.
add<
double>(
"par1", 0.707716);
315 psd0.
add<
double>(
"par0", 0.352476);
320 psd0.
add<
std::string>(
"function",
"TMath::Min(0.15, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))");
321 psd0.
add<
double>(
"par1", 0.658701);
322 psd0.
add<
double>(
"par0", 0.197077);
325 desc_builders.
addOptional<
double>(
"stripEtaAssociationDistance", 0.05);
326 desc_builders.addOptional<
double>(
"stripPhiAssociationDistance", 0.2);
332 desc_builders.add<
int>(
"verbosity", 0);
334 desc_builders.addOptional<
bool>(
"makeCombinatoricStrips");
335 desc_builders.addOptional<
int>(
"maxStripBuildIterations");
336 desc_builders.addOptional<
double>(
"minGammaEtStripAdd");
337 desc_builders.addOptional<
double>(
"minGammaEtStripSeed");
338 desc_builders.addOptional<
double>(
"minStripEt");
339 desc_builders.addOptional<std::vector<int>>(
"stripCandidatesParticleIds");
340 desc_builders.addOptional<
bool>(
"updateStripAfterEachDaughter");
341 desc_builders.addOptional<
bool>(
"applyElecTrackQcuts");
343 std::vector<edm::ParameterSet> vpsd_builders;
344 vpsd_builders.push_back(pset_builders);
345 desc.
addVPSet(
"builders", desc_builders, vpsd_builders);
347 descriptions.
add(
"recoTauPiZeroProducer", desc);