19 produces<edm::ValueMap<float>>(
"dR2Mean");
20 produces<edm::ValueMap<float>>(
"majW");
21 produces<edm::ValueMap<float>>(
"minW");
22 produces<edm::ValueMap<float>>(
"frac01");
23 produces<edm::ValueMap<float>>(
"frac02");
24 produces<edm::ValueMap<float>>(
"frac03");
25 produces<edm::ValueMap<float>>(
"frac04");
26 produces<edm::ValueMap<float>>(
"ptD");
27 produces<edm::ValueMap<float>>(
"beta");
28 produces<edm::ValueMap<float>>(
"pull");
29 produces<edm::ValueMap<float>>(
"jetR");
30 produces<edm::ValueMap<float>>(
"jetRchg");
31 produces<edm::ValueMap<int>>(
"nCharged");
53 unsigned int nJet = srcJet->size();
55 std::vector<float> dR2Mean(nJet, -1);
56 std::vector<float> majW(nJet, -1);
57 std::vector<float> minW(nJet, -1);
58 std::vector<float> frac01(nJet, -1);
59 std::vector<float> frac02(nJet, -1);
60 std::vector<float> frac03(nJet, -1);
61 std::vector<float> frac04(nJet, -1);
62 std::vector<float> ptD(nJet, -1);
63 std::vector<float>
beta(nJet, -1);
64 std::vector<float> pull(nJet, -1);
65 std::vector<float> jetR(nJet, -1);
66 std::vector<float> jetRchg(nJet, -1);
67 std::vector<int> nCharged(nJet, -1);
69 for (
unsigned int ij = 0; ij < nJet; ij++) {
70 auto jet = srcJet->ptrAt(ij);
74 dR2Mean[ij] = (*srcPileupJetId)[jetRef].dR2Mean();
75 majW[ij] = (*srcPileupJetId)[jetRef].majW();
76 minW[ij] = (*srcPileupJetId)[jetRef].minW();
77 frac01[ij] = (*srcPileupJetId)[jetRef].frac01();
78 frac02[ij] = (*srcPileupJetId)[jetRef].frac02();
79 frac03[ij] = (*srcPileupJetId)[jetRef].frac03();
80 frac04[ij] = (*srcPileupJetId)[jetRef].frac04();
81 ptD[ij] = (*srcPileupJetId)[jetRef].ptD();
82 beta[ij] = (*srcPileupJetId)[jetRef].beta();
83 pull[ij] = (*srcPileupJetId)[jetRef].pull();
84 jetR[ij] = (*srcPileupJetId)[jetRef].jetR();
85 jetRchg[ij] = (*srcPileupJetId)[jetRef].jetRchg();
86 nCharged[ij] = (*srcPileupJetId)[jetRef].nCharged();
91 filler_dR2Mean.
insert(srcJet, dR2Mean.begin(), dR2Mean.end());
92 filler_dR2Mean.
fill();
97 filler_majW.
insert(srcJet, majW.begin(), majW.end());
103 filler_minW.
insert(srcJet, minW.begin(), minW.end());
109 filler_frac01.
insert(srcJet, frac01.begin(), frac01.end());
110 filler_frac01.
fill();
115 filler_frac02.
insert(srcJet, frac02.begin(), frac02.end());
116 filler_frac02.
fill();
121 filler_frac03.
insert(srcJet, frac03.begin(), frac03.end());
122 filler_frac03.
fill();
127 filler_frac04.
insert(srcJet, frac04.begin(), frac04.end());
128 filler_frac04.
fill();
133 filler_ptD.
insert(srcJet, ptD.begin(), ptD.end());
139 filler_beta.
insert(srcJet, beta.begin(), beta.end());
145 filler_pull.
insert(srcJet, pull.begin(), pull.end());
151 filler_jetR.
insert(srcJet, jetR.begin(), jetR.end());
157 filler_jetRchg.
insert(srcJet, jetRchg.begin(), jetRchg.end());
158 filler_jetRchg.
fill();
163 filler_nCharged.
insert(srcJet, nCharged.begin(), nCharged.end());
164 filler_nCharged.
fill();
174 desc.
add<
edm::InputTag>(
"srcPileupJetId")->setComment(
"StoredPileupJetIdentifier name");
176 modname +=
"PileupJetIDVarProducer";
177 descriptions.
add(modname, desc);
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
~PileupJetIDVarProducer() override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::ValueMap< StoredPileupJetIdentifier > > srcPileupJetId_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< edm::View< pat::Jet > > srcJet_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
PileupJetIDVarProducer(const edm::ParameterSet &iConfig)