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>();
117 outVertices->emplace_back(
136 auto outRho = std::make_unique<double>(-999);
143 auto outMetPt = std::make_unique<double>(-999);
144 auto outMetPhi = std::make_unique<double>(-999);
146 outMetPt = std::make_unique<double>(
metCollection->front().pt());
147 outMetPhi = std::make_unique<double>(
metCollection->front().phi());
152 auto outPFCandidates = std::make_unique<Run3ScoutingParticleCollection>();
156 int vertex_index = -1;
157 int index_counter = 0;
159 for (
auto const &
vtx : *outVertices) {
163 vertex_index = index_counter;
170 uint8_t lostInnerHits{0},
quality{0};
172 const auto *trk =
cand.bestTrack();
173 if (trk !=
nullptr) {
189 dz = trk->dz(
pv.position());
193 dxy = trk->dxy(
pv.position());
223 auto outPFJets = std::make_unique<Run3ScoutingPFJetCollection>();
227 bool haveJetTags =
false;
236 float tagValue = -20;
243 tagValue =
tag.second;
248 std::vector<int> candIndices;
250 for (
auto const &
cand :
jet.getPFConstituents()) {
251 if (not(
cand.isNonnull() and
cand.isAvailable())) {
253 <<
"invalid reference to reco::PFCandidate from reco::PFJet::getPFConstituents()";
257 float minDR2 = 0.0001;
260 for (
auto &outCand : *outPFCandidates) {
264 matchIndex = outIndex;
271 candIndices.push_back(matchIndex);
275 outPFJets->emplace_back(
288 jet.chargedHadronMultiplicity(),
289 jet.neutralHadronMultiplicity(),
290 jet.photonMultiplicity(),
291 jet.electronMultiplicity(),
292 jet.muonMultiplicity(),
293 jet.HFHadronMultiplicity(),
294 jet.HFEMMultiplicity(),
319 desc.add<
double>(
"pfJetPtCut", 20.0);
320 desc.add<
double>(
"pfJetEtaCut", 3.0);
321 desc.add<
double>(
"pfCandidatePtCut", 0.6);
322 desc.add<
double>(
"pfCandidateEtaCut", 5.0);
323 desc.add<
int>(
"mantissaPrecision", 10)->setComment(
"default float16, change to 23 for float32");
324 desc.add<
bool>(
"doJetTags",
true);
325 desc.add<
bool>(
"doCandidates",
true);
326 desc.add<
bool>(
"doMet",
true);
327 desc.add<
bool>(
"doTrackVars",
true);
328 desc.add<
bool>(
"relativeTrackVars",
true);
329 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
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
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_
Power< A, B >::type pow(const A &a, const B &b)