37 std::vector<std::pair<std::string, MVAJetPuId *>>
algos_;
63 std::vector<edm::ParameterSet>
algos = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"algos");
71 produces<edm::ValueMap<StoredPileupJetIdentifier>>(
"");
73 for (std::vector<edm::ParameterSet>::iterator it =
algos.begin(); it !=
algos.end(); ++it) {
77 produces<edm::ValueMap<float>>(
label +
"Discriminant");
78 produces<edm::ValueMap<int>>(
label +
"Id");
108 vector<StoredPileupJetIdentifier> ids;
109 map<string, vector<float>> mvas;
110 map<string, vector<int>> idflags;
112 VertexCollection::const_iterator
vtx;
123 for (
unsigned int i = 0;
i <
jets.size(); ++
i) {
124 vector<pair<string, MVAJetPuId *>>::iterator algoi =
algos_.begin();
146 corrJet = dynamic_cast<reco::Jet *>(
jet.clone());
153 ids.push_back(puIdentifier);
155 puIdentifier = (*vmap)[
jets.refAt(
i)];
156 puIdentifier.
jetPt(theJet->
pt());
159 ialgo->
set(puIdentifier);
164 for (; algoi !=
algos_.end(); ++algoi) {
165 ialgo = algoi->second;
166 ialgo->
set(puIdentifier);
168 mvas[algoi->first].push_back(
id.
mva());
169 idflags[algoi->first].push_back(
id.idFlag());
179 for (vector<pair<string, MVAJetPuId *>>::iterator ialgo =
algos_.begin(); ialgo !=
algos_.end(); ++ialgo) {
180 vector<float> &
mva = mvas[ialgo->first];
181 auto mvaout = std::make_unique<ValueMap<float>>();
183 mvafiller.insert(jetHandle,
mva.begin(),
mva.end());
187 vector<int> &idflag = idflags[ialgo->first];
188 auto idflagout = std::make_unique<ValueMap<int>>();
190 idflagfiller.insert(jetHandle, idflag.begin(), idflag.end());
196 assert(jetHandle->size() == ids.size());
197 auto idsout = std::make_unique<ValueMap<StoredPileupJetIdentifier>>();
199 idsfiller.insert(jetHandle, ids.begin(), ids.end());
207 desc.
add<
bool>(
"runMvas",
true);
208 desc.
add<
bool>(
"inputIsCorrected",
true);
210 desc.
add<
bool>(
"produceJetIds",
true);
212 desc.
add<
bool>(
"residualsFromTxt",
false);
213 desc.
add<
bool>(
"applyJec",
false);
218 vpsd1.
add<std::vector<std::string>>(
"tmvaVariables",
238 vpsd1.add<
bool>(
"cutBased",
false);
239 vpsd1.add<
std::string>(
"tmvaWeights",
"RecoJets/JetProducers/data/MVAJetPuID.weights.xml.gz");
240 vpsd1.add<std::vector<std::string>>(
"tmvaSpectators",
246 vpsd1.add<
int>(
"version", -1);
249 psd0.
add<std::vector<double>>(
"Pt2030_Tight",
256 psd0.
add<std::vector<double>>(
"Pt2030_Loose",
263 psd0.
add<std::vector<double>>(
"Pt3050_Medium",
270 psd0.
add<std::vector<double>>(
"Pt1020_Tight",
277 psd0.
add<std::vector<double>>(
"Pt2030_Medium",
284 psd0.
add<std::vector<double>>(
"Pt010_Tight",
291 psd0.
add<std::vector<double>>(
"Pt1020_Loose",
298 psd0.
add<std::vector<double>>(
"Pt010_Medium",
305 psd0.
add<std::vector<double>>(
"Pt1020_Medium",
312 psd0.
add<std::vector<double>>(
"Pt010_Loose",
319 psd0.
add<std::vector<double>>(
"Pt3050_Loose",
326 psd0.
add<std::vector<double>>(
"Pt3050_Tight",
335 vpsd1.
add<
double>(
"impactParTkThreshold", 1.0);
336 std::vector<edm::ParameterSet> temp1;
339 desc.
addVPSet(
"algos", vpsd1, temp1);
341 descriptions.
add(
"MVAJetPuIdProducer", desc);