81 : pfJetCollection_(consumes(iConfig.getParameter<
edm::
InputTag>(
"pfJetCollection"))),
82 pfJetTagCollection_(consumes(iConfig.getParameter<
edm::
InputTag>(
"pfJetTagCollection"))),
83 pfCandidateCollection_(consumes(iConfig.getParameter<
edm::
InputTag>(
"pfCandidateCollection"))),
84 vertexCollection_(consumes(iConfig.getParameter<
edm::
InputTag>(
"vertexCollection"))),
85 metCollection_(consumes(iConfig.getParameter<
edm::
InputTag>(
"metCollection"))),
86 rho_(consumes(iConfig.getParameter<
edm::
InputTag>(
"rho"))),
87 pfJetPtCut_(iConfig.getParameter<double>(
"pfJetPtCut")),
88 pfJetEtaCut_(iConfig.getParameter<double>(
"pfJetEtaCut")),
89 pfCandidatePtCut_(iConfig.getParameter<double>(
"pfCandidatePtCut")),
90 pfCandidateEtaCut_(iConfig.getParameter<double>(
"pfCandidateEtaCut")),
91 mantissaPrecision_(iConfig.getParameter<
int>(
"mantissaPrecision")),
92 doJetTags_(iConfig.getParameter<
bool>(
"doJetTags")),
93 doCandidates_(iConfig.getParameter<
bool>(
"doCandidates")),
94 doMet_(iConfig.getParameter<
bool>(
"doMet")),
95 doTrackVars_(iConfig.getParameter<
bool>(
"doTrackVars")),
96 relativeTrackVars_(iConfig.getParameter<
bool>(
"relativeTrackVars")),
97 doCandIndsForJets_(iConfig.getParameter<
bool>(
"doCandIndsForJets")) {
99 produces<Run3ScoutingPFJetCollection>();
100 produces<Run3ScoutingParticleCollection>();
101 produces<double>(
"rho");
102 produces<double>(
"pfMetPt");
103 produces<double>(
"pfMetPhi");
114 auto outVertices = std::make_unique<Run3ScoutingVertexCollection>();
132 auto outRho = std::make_unique<double>(-999);
139 auto outMetPt = std::make_unique<double>(-999);
140 auto outMetPhi = std::make_unique<double>(-999);
142 outMetPt = std::make_unique<double>(
metCollection->front().pt());
143 outMetPhi = std::make_unique<double>(
metCollection->front().phi());
148 auto outPFCandidates = std::make_unique<Run3ScoutingParticleCollection>();
152 int vertex_index = -1;
153 int index_counter = 0;
155 for (
auto const &
vtx : *outVertices) {
159 vertex_index = index_counter;
166 uint8_t lostInnerHits{0},
quality{0};
168 const auto *trk =
cand.bestTrack();
169 if (trk !=
nullptr) {
185 dz = trk->dz(
pv.position());
189 dxy = trk->dxy(
pv.position());
219 auto outPFJets = std::make_unique<Run3ScoutingPFJetCollection>();
223 bool haveJetTags =
false;
232 float tagValue = -20;
239 tagValue =
tag.second;
244 std::vector<int> candIndices;
246 for (
auto const &
cand :
jet.getPFConstituents()) {
247 if (not(
cand.isNonnull() and
cand.isAvailable())) {
249 <<
"invalid reference to reco::PFCandidate from reco::PFJet::getPFConstituents()";
253 float minDR2 = 0.0001;
256 for (
auto &outCand : *outPFCandidates) {
260 matchIndex = outIndex;
267 candIndices.push_back(matchIndex);
271 outPFJets->emplace_back(
284 jet.chargedHadronMultiplicity(),
285 jet.neutralHadronMultiplicity(),
286 jet.photonMultiplicity(),
287 jet.electronMultiplicity(),
288 jet.muonMultiplicity(),
289 jet.HFHadronMultiplicity(),
290 jet.HFEMMultiplicity(),
315 desc.add<
double>(
"pfJetPtCut", 20.0);
316 desc.add<
double>(
"pfJetEtaCut", 3.0);
317 desc.add<
double>(
"pfCandidatePtCut", 0.6);
318 desc.add<
double>(
"pfCandidateEtaCut", 5.0);
319 desc.add<
int>(
"mantissaPrecision", 10)->setComment(
"default float16, change to 23 for float32");
320 desc.add<
bool>(
"doJetTags",
true);
321 desc.add<
bool>(
"doCandidates",
true);
322 desc.add<
bool>(
"doMet",
true);
323 desc.add<
bool>(
"doTrackVars",
true);
324 desc.add<
bool>(
"relativeTrackVars",
true);
325 desc.add<
bool>(
"doCandIndsForJets",
false);
float quality_from_pfcand(const reco::PFCandidate &pfcand)
const int mantissaPrecision_
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< reco::PFMETCollection > metCollection_
const double pfCandidateEtaCut_
~HLTScoutingPFProducer() override
const double pfJetEtaCut_
const edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidateCollection_
const double pfCandidatePtCut_
const edm::EDGetTokenT< reco::VertexCollection > vertexCollection_
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< reco::PFJetCollection > pfJetCollection_
HLTScoutingPFProducer(const edm::ParameterSet &)
const edm::EDGetTokenT< reco::JetTagCollection > pfJetTagCollection_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const edm::EDGetTokenT< double > rho_
float lost_inner_hits_from_pfcand(const reco::PFCandidate &pfcand)
static float reduceMantissaToNbitsRounding(const float &f)
const bool doCandIndsForJets_
const bool relativeTrackVars_