78 pfCandidateCollection_(
82 rho_(consumes<double>(iConfig.getParameter<
edm::
InputTag>(
"rho"))),
83 pfJetPtCut(iConfig.getParameter<double>(
"pfJetPtCut")),
84 pfJetEtaCut(iConfig.getParameter<double>(
"pfJetEtaCut")),
90 doMet(iConfig.getParameter<
bool>(
"doMet")) {
92 produces<Run3ScoutingPFJetCollection>();
93 produces<Run3ScoutingParticleCollection>();
94 produces<double>(
"rho");
95 produces<double>(
"pfMetPt");
96 produces<double>(
"pfMetPhi");
110 outVertices->emplace_back(
vtx.x(),
125 std::unique_ptr<double> outRho(
new double(-999));
127 outRho = std::make_unique<double>(*
rho);
132 std::unique_ptr<double> outMetPt(
new double(-999));
133 std::unique_ptr<double> outMetPhi(
new double(-999));
135 outMetPt = std::make_unique<double>(
metCollection->front().pt());
136 outMetPhi = std::make_unique<double>(
metCollection->front().phi());
145 int vertex_index = -1;
146 int index_counter = 0;
148 for (
auto &
vtx : *outVertices) {
152 vertex_index = index_counter;
175 bool haveJetTags =
false;
184 float tagValue = -20;
191 tagValue =
tag.second;
196 std::vector<int> candIndices;
198 for (
auto &
cand :
jet.getPFConstituents()) {
201 float minDR2 = 0.0001;
204 for (
auto &outCand : *outPFCandidates) {
205 float dR2 =
pow(
cand->eta() - outCand.eta(), 2) +
pow(
cand->phi() - outCand.phi(), 2);
208 matchIndex = outIndex;
215 candIndices.push_back(matchIndex);
219 outPFJets->emplace_back(
jet.pt(),
224 jet.chargedHadronEnergy(),
225 jet.neutralHadronEnergy(),
227 jet.electronEnergy(),
229 jet.HFHadronEnergy(),
231 jet.chargedHadronMultiplicity(),
232 jet.neutralHadronMultiplicity(),
233 jet.photonMultiplicity(),
234 jet.electronMultiplicity(),
235 jet.muonMultiplicity(),
236 jet.HFHadronMultiplicity(),
237 jet.HFEMMultiplicity(),
262 desc.add<
double>(
"pfJetPtCut", 20.0);
263 desc.add<
double>(
"pfJetEtaCut", 3.0);
264 desc.add<
double>(
"pfCandidatePtCut", 0.6);
265 desc.add<
double>(
"pfCandidateEtaCut", 5.0);
266 desc.add<
int>(
"mantissaPrecision", 10)->setComment(
"default float16, change to 23 for float32");
267 desc.add<
bool>(
"doJetTags",
true);
268 desc.add<
bool>(
"doCandidates",
true);
269 desc.add<
bool>(
"doMet",
true);
270 descriptions.
add(
"hltScoutingPFProducer",
desc);