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();
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);
const float & jetPhi() const
void initJetEnergyCorrector(const edm::EventSetup &iSetup, bool isData)
T getParameter(std::string const &) const
virtual void scaleEnergy(double fScale)
scale energy of the jet
double pt() const final
transverse momentum
FactorizedJetCorrector * jecCor_
Base class for all types of Jets.
T const * product() const
std::vector< Vertex > VertexCollection
collection of Vertex objects
const float & jetPt() const
edm::FileInPath residualsTxt_
void setJetEta(float fEta)
MVAJetPuIdProducer(const edm::ParameterSet &)
PileupJetIdentifier computeIdVariables(const reco::Jet *jet, float jec, const reco::Vertex *, const reco::VertexCollection &, double rho, bool calculateMva=false)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
std::vector< JetCorrectorParameters > jetCorPars_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::View< reco::Jet > > input_jet_token_
std::vector< std::pair< std::string, MVAJetPuId * > > algos_
const float & jetEta() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void set(const PileupJetIdentifier &)
PileupJetIdentifier computeMva()
edm::EDGetTokenT< double > input_rho_token_
edm::EDGetTokenT< edm::ValueMap< StoredPileupJetIdentifier > > input_vm_pujetid_token_
double phi() const final
momentum azimuthal angle
edm::EDGetTokenT< reco::VertexCollection > input_vertex_token_
double eta() const final
momentum pseudorapidity