80 : pfJetCollection_(consumes(iConfig.getParameter<edm::
InputTag>(
"pfJetCollection"))),
81 pfJetTagCollection_(consumes(iConfig.getParameter<edm::
InputTag>(
"pfJetTagCollection"))),
82 pfCandidateCollection_(consumes(iConfig.getParameter<edm::
InputTag>(
"pfCandidateCollection"))),
83 vertexCollection_(consumes(iConfig.getParameter<edm::
InputTag>(
"vertexCollection"))),
84 metCollection_(consumes(iConfig.getParameter<edm::
InputTag>(
"metCollection"))),
85 rho_(consumes(iConfig.getParameter<edm::
InputTag>(
"rho"))),
86 pfJetPtCut_(iConfig.getParameter<double>(
"pfJetPtCut")),
87 pfJetEtaCut_(iConfig.getParameter<double>(
"pfJetEtaCut")),
88 pfCandidatePtCut_(iConfig.getParameter<double>(
"pfCandidatePtCut")),
89 pfCandidateEtaCut_(iConfig.getParameter<double>(
"pfCandidateEtaCut")),
90 mantissaPrecision_(iConfig.getParameter<int>(
"mantissaPrecision")),
91 doJetTags_(iConfig.getParameter<bool>(
"doJetTags")),
92 doCandidates_(iConfig.getParameter<bool>(
"doCandidates")),
93 doMet_(iConfig.getParameter<bool>(
"doMet")),
94 doTrackRelVars_(iConfig.getParameter<bool>(
"doTrackRelVars")),
95 doCandIndsForJets_(iConfig.getParameter<bool>(
"doCandIndsForJets")) {
97 produces<Run3ScoutingPFJetCollection>();
98 produces<Run3ScoutingParticleCollection>();
99 produces<double>(
"rho");
100 produces<double>(
"pfMetPt");
101 produces<double>(
"pfMetPhi");
112 auto outVertices = std::make_unique<Run3ScoutingVertexCollection>();
130 auto outRho = std::make_unique<double>(-999);
137 auto outMetPt = std::make_unique<double>(-999);
138 auto outMetPhi = std::make_unique<double>(-999);
140 outMetPt = std::make_unique<double>(
metCollection->front().pt());
141 outMetPhi = std::make_unique<double>(
metCollection->front().phi());
146 auto outPFCandidates = std::make_unique<Run3ScoutingParticleCollection>();
150 int vertex_index = -1;
151 int index_counter = 0;
153 for (
auto const &vtx : *outVertices) {
154 double tmp_dr2 =
pow(vtx.x() - cand.vx(), 2) +
pow(vtx.y() - cand.vy(), 2) +
pow(vtx.z() - cand.vz(), 2);
157 vertex_index = index_counter;
163 float normchi2{0},
dz{0},
dxy{0}, dzError{0}, dxyError{0}, trk_pt{0}, trk_eta{0}, trk_phi{0};
164 uint8_t lostInnerHits{0},
quality{0};
166 const auto *trk = cand.bestTrack();
167 if (trk !=
nullptr) {
190 outPFCandidates->emplace_back(
213 auto outPFJets = std::make_unique<Run3ScoutingPFJetCollection>();
217 bool haveJetTags =
false;
226 float tagValue = -20;
229 for (
auto const &
tag : *pfJetTagCollection) {
233 tagValue =
tag.second;
238 std::vector<int> candIndices;
240 for (
auto const &cand :
jet.getPFConstituents()) {
241 if (not(cand.isNonnull() and cand.isAvailable())) {
243 <<
"invalid reference to reco::PFCandidate from reco::PFJet::getPFConstituents()";
247 float minDR2 = 0.0001;
250 for (
auto &outCand : *outPFCandidates) {
254 matchIndex = outIndex;
261 candIndices.push_back(matchIndex);
265 outPFJets->emplace_back(
278 jet.chargedHadronMultiplicity(),
279 jet.neutralHadronMultiplicity(),
280 jet.photonMultiplicity(),
281 jet.electronMultiplicity(),
282 jet.muonMultiplicity(),
283 jet.HFHadronMultiplicity(),
284 jet.HFEMMultiplicity(),
309 desc.
add<
double>(
"pfJetPtCut", 20.0);
310 desc.
add<
double>(
"pfJetEtaCut", 3.0);
311 desc.
add<
double>(
"pfCandidatePtCut", 0.6);
312 desc.
add<
double>(
"pfCandidateEtaCut", 5.0);
313 desc.
add<
int>(
"mantissaPrecision", 10)->setComment(
"default float16, change to 23 for float32");
314 desc.
add<
bool>(
"doJetTags",
true);
315 desc.
add<
bool>(
"doCandidates",
true);
316 desc.
add<
bool>(
"doMet",
true);
317 desc.
add<
bool>(
"doTrackRelVars",
true);
318 desc.
add<
bool>(
"doCandIndsForJets",
false);
float quality_from_pfcand(const reco::PFCandidate &pfcand)
const int mantissaPrecision_
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::PFMETCollection > metCollection_
const bool doTrackRelVars_
const double pfCandidateEtaCut_
~HLTScoutingPFProducer() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
uint32_t const *__restrict__ Quality * quality
const double pfJetEtaCut_
const Point & position() const
position
const edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidateCollection_
const double pfCandidatePtCut_
tuple pfCandidateCollection
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)
const edm::EDGetTokenT< reco::PFJetCollection > pfJetCollection_
HLTScoutingPFProducer(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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_
Power< A, B >::type pow(const A &a, const B &b)