Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5687ecc
Add GenJets table
elenavernazza Jun 12, 2025
e6b60a1
Add vertex coordinates for tracks and remove nMuHits
elenavernazza Jun 12, 2025
b6fa249
add more information for tracks tables
mmusich Jun 14, 2025
d6f2cfa
fix bug in SimpleFlatTableProducer in presence of skipNonExistingSrc=…
mmusich Jun 19, 2025
4b107ed
add protection against empty input in HLTVertexTableProducer
mmusich Jun 19, 2025
1f58874
set skipNonExistingSrc to True in all NGT scouting tables and remove …
mmusich Jun 25, 2025
4f7216c
add protections against missing input to MuonTrackProducer
mmusich Jun 19, 2025
600bff0
Add MET and HT tables
mmusich Jun 25, 2025
5f4dc22
protect hltTaus table setting skipNonExistingSrc to True
mmusich Jun 20, 2025
af26b66
clean-up of HLTrigger/NGTScouting plugin table producers
mmusich Jun 22, 2025
a3bee2f
add Tau Extra Table producer
mmusich Jun 22, 2025
f879ab7
add Tau Extra table and introduce skipNonExistingSrc parameters for V…
mmusich Jun 22, 2025
6e6db73
make HLTTauTableProducer table name configurable
mmusich Jun 22, 2025
d9f2177
add protection to HLTVertexTableProducer against missing input
mmusich Jun 22, 2025
eb1d067
add warnings in case of missing collections
mmusich Jun 23, 2025
82bcd1d
move hltTausExtra to hltTaus file and correct input tag for deepTauVS…
mmusich Jun 23, 2025
4b37389
add skipNonExistingSrc to hlt Tracksters table and re-order BuildFile
mmusich Jun 25, 2025
68ae5ff
introduce .772 (NGT scouting with Nano and Validation)
mmusich Jun 25, 2025
d1c1816
fix issue with nanoGen
mmusich Jun 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Configuration/PyReleaseValidation/python/relval_Run4.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
numWFIB.extend([prefixDet+34.759]) # HLTTiming75e33 + NANO
numWFIB.extend([prefixDet+34.77]) # NGTScouting
numWFIB.extend([prefixDet+34.771]) # NGTScouting + NANO
numWFIB.extend([prefixDet+34.772]) # NGTScouting + NANO (including validation)

for numWF in numWFIB:
workflows[numWF] = _upgrade_workflows[numWF]
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,17 @@ def condition(self, fragment, stepList, key, hasHarvest):
upgradeWFs['NGTScoutingWithNano'].step2 = {
'-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:NGTScouting,NANO:@NGTScouting',
'--datatier':'GEN-SIM-DIGI-RAW,NANOAODSIM',
'--procModifiers': 'ngtScouting',
'--eventcontent':'FEVTDEBUGHLT,NANOAODSIM'
}

upgradeWFs['NGTScoutingWithNanoValid'] = deepcopy(upgradeWFs['HLTPhaseWithNano'])
upgradeWFs['NGTScoutingWithNanoValid'].suffix = '_NGTScoutingWithNanoVal'
upgradeWFs['NGTScoutingWithNanoValid'].offset = 0.772
upgradeWFs['NGTScoutingWithNanoValid'].step2 = {
'-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:NGTScouting,VALIDATION:@hltValidation,NANO:@NGTScoutingVal',
'--datatier':'GEN-SIM-DIGI-RAW,NANOAODSIM',
'--procModifiers': 'ngtScouting',
'--eventcontent':'FEVTDEBUGHLT,NANOAODSIM'
}

Expand Down
7 changes: 4 additions & 3 deletions Configuration/PyReleaseValidation/scripts/runTheMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ def runSelected(opt):
29634.756, # HLT phase-2 timing menu trimmed tracking
29634.7561, # HLT phase-2 timing menu Alpaka, trimmed tracking
29634.7562, # HLT phase-2 timing menu Alpaka, trimmed tracking, single tracking iteration variant
29634.759, # HLT phase-2 timing menu Alpaka, single tracking iteration, LST seeding + CKF building variant
29634.757, # HLT phase-2 timing menu, with NANO:@Phase2HLT
29634.757, # HLT phase-2 timing menu Alpaka, single tracking iteration, LST seeding + CKF building variant
29634.759, # HLT phase-2 timing menu, with NANO:@Phase2HLT
29634.77, # HLT phase-2 NGT Scouting menu
29634.771] # HLT phase-2 NGT Scouting menu, with NANO:@NGTScouting
29634.771, # HLT phase-2 NGT Scouting menu, with NANO:@NGTScouting
29634.772] # HLT phase-2 NGT Scouting menu, with NANO:@NGTScoutingVal
}

predefinedSet['limited'] = (
Expand Down
21 changes: 10 additions & 11 deletions HLTrigger/NGTScouting/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<use name="FWCore/Common"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="DataFormats/VertexReco"/>
<use name="DataFormats/Candidate"/>
<use name="CommonTools/Utils"/>
<use name="DataFormats/NanoAOD"/>
<use name="RecoVertex/VertexTools"/>
<use name="DataFormats/Candidate"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/HGCalReco"/>
<use name="DataFormats/PatCandidates"/>
<use name="DataFormats/NanoAOD"/>
<use name="DataFormats/ParticleFlowCandidate"/>
<use name="DataFormats/PatCandidates"/>
<use name="DataFormats/Scouting"/>
<use name="DataFormats/StdDictionaries"/>
<use name="DataFormats/VertexReco"/>
<use name="FWCore/Common"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="PhysicsTools/NanoAOD"/>
<use name="DataFormats/Scouting"/>
<use name="RecoVertex/VertexTools"/>
<use name="boost"/>

16 changes: 6 additions & 10 deletions HLTrigger/NGTScouting/plugins/HLTElectronTableProducer.cc
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
#include <memory>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"

#include "CommonTools/Utils/interface/StringCutObjectSelector.h"
#include "DataFormats/NanoAOD/interface/FlatTable.h"
#include "DataFormats/Scouting/interface/Run3ScoutingElectron.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/StreamID.h"

#include "CommonTools/Utils/interface/StringCutObjectSelector.h"

#include "DataFormats/NanoAOD/interface/FlatTable.h"

#include "PhysicsTools/NanoAOD/interface/SimpleFlatTableProducer.h"
#include "DataFormats/Scouting/interface/Run3ScoutingElectron.h"

typedef SimpleFlatTableProducer<Run3ScoutingElectron> HLTElectronTableProducer;

#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down
16 changes: 6 additions & 10 deletions HLTrigger/NGTScouting/plugins/HLTPhotonTableProducer.cc
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
#include <memory>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"

#include "CommonTools/Utils/interface/StringCutObjectSelector.h"
#include "DataFormats/NanoAOD/interface/FlatTable.h"
#include "DataFormats/Scouting/interface/Run3ScoutingPhoton.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/StreamID.h"

#include "CommonTools/Utils/interface/StringCutObjectSelector.h"

#include "DataFormats/NanoAOD/interface/FlatTable.h"

#include "PhysicsTools/NanoAOD/interface/SimpleFlatTableProducer.h"
#include "DataFormats/Scouting/interface/Run3ScoutingPhoton.h"

typedef SimpleFlatTableProducer<Run3ScoutingPhoton> HLTPhotonTableProducer;

#include "FWCore/Framework/interface/MakerMacros.h"
Expand Down
151 changes: 151 additions & 0 deletions HLTrigger/NGTScouting/plugins/HLTTauTableProducer.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#include "DataFormats/NanoAOD/interface/FlatTable.h"
#include "DataFormats/TauReco/interface/PFTauTransverseImpactParameterAssociation.h"
#include "DataFormats/TauReco/interface/TauDiscriminatorContainer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

class HLTTauTableProducer : public edm::global::EDProducer<> {
public:
using TauCollection = edm::View<reco::BaseTau>;
using TauIPVector = edm::AssociationVector<reco::PFTauRefProd, std::vector<reco::PFTauTransverseImpactParameterRef>>;
using TauDiscrMap = reco::TauDiscriminatorContainer;
// TauCollection = deeptau.TauCollection;
// using TauDeepTauVector = edm::AssociationVector<reco::PFTauRefProd, std::vector<reco::TauDiscriminatorContainer>>;
HLTTauTableProducer(const edm::ParameterSet& cfg)
: tableName_(cfg.getParameter<std::string>("tableName")),
skipNonExistingSrc_(cfg.getParameter<bool>("skipNonExistingSrc")),
tauToken_(mayConsume<TauCollection>(cfg.getParameter<edm::InputTag>("taus"))),
tauIPToken_(mayConsume<TauIPVector>(cfg.getParameter<edm::InputTag>("tauTransverseImpactParameters"))),
deepTauVSeToken_(mayConsume<TauDiscrMap>(cfg.getParameter<edm::InputTag>("deepTauVSe"))),
deepTauVSmuToken_(mayConsume<TauDiscrMap>(cfg.getParameter<edm::InputTag>("deepTauVSmu"))),
deepTauVSjetToken_(mayConsume<TauDiscrMap>(cfg.getParameter<edm::InputTag>("deepTauVSjet"))),
precision_(cfg.getParameter<int>("precision")) {
produces<nanoaod::FlatTable>(tableName_);
}

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::string>("tableName", "hltHpsPFTau")
->setComment("Table name, needs to be the same as the main Tau table");
desc.add<bool>("skipNonExistingSrc", false)
->setComment("whether or not to skip producing the table on absent input product");
desc.add<edm::InputTag>("taus", edm::InputTag(""));
desc.add<edm::InputTag>("tauTransverseImpactParameters", edm::InputTag(""));
desc.add<edm::InputTag>("deepTauVSe", edm::InputTag(""));
desc.add<edm::InputTag>("deepTauVSmu", edm::InputTag(""));
desc.add<edm::InputTag>("deepTauVSjet", edm::InputTag(""));
desc.add<int>("precision", 7);
descriptions.addWithDefaultLabel(desc);
}

private:
void produce(edm::StreamID id, edm::Event& event, const edm::EventSetup& setup) const override {
const auto tausHandle = event.getHandle(tauToken_);
const size_t nTaus = tausHandle.isValid() ? (*tausHandle).size() : 0;

// resize all output vectors
static constexpr float default_value = std::numeric_limits<float>::quiet_NaN();

std::vector<float> deepTauVSe(nTaus, default_value);
std::vector<float> deepTauVSmu(nTaus, default_value);
std::vector<float> deepTauVSjet(nTaus, default_value);

// source: RecoTauTag/RecoTau/plugins/PFTauTransverseImpactParameters.cc
std::vector<float> dxy(nTaus, default_value);
std::vector<float> dxy_error(nTaus, default_value);
std::vector<float> ip3d(nTaus, default_value);
std::vector<float> ip3d_error(nTaus, default_value);
std::vector<float> hasSecondaryVertex(nTaus, default_value);
std::vector<float> flightLength_x(nTaus, default_value);
std::vector<float> flightLength_y(nTaus, default_value);
std::vector<float> flightLength_z(nTaus, default_value);
std::vector<float> flightLengthSig(nTaus, default_value);
std::vector<float> secondaryVertex_x(nTaus, default_value);
std::vector<float> secondaryVertex_y(nTaus, default_value);
std::vector<float> secondaryVertex_z(nTaus, default_value);

if (tausHandle.isValid() || !(this->skipNonExistingSrc_)) {
const auto& tausProductId = tausHandle.id();
const auto& tausIPHandle = event.getHandle(tauIPToken_);
const auto& deepTauVSeMapHandle = event.getHandle(deepTauVSeToken_);
const auto& deepTauVSmuMapHandle = event.getHandle(deepTauVSmuToken_);
const auto& deepTauVSjetMapHandle = event.getHandle(deepTauVSjetToken_);

for (size_t tau_index = 0; tau_index < nTaus; ++tau_index) {
if (deepTauVSeMapHandle.isValid() || !(this->skipNonExistingSrc_)) {
deepTauVSe[tau_index] = deepTauVSeMapHandle->get(tausProductId, tau_index).rawValues.at(0);
} else {
edm::LogWarning("HLTTauTableProducer") << " Invalid handle for DeeTauVse score input collection";
}

if (deepTauVSmuMapHandle.isValid() || !(this->skipNonExistingSrc_)) {
deepTauVSmu[tau_index] = deepTauVSmuMapHandle->get(tausProductId, tau_index).rawValues.at(0);
} else {
edm::LogWarning("HLTTauTableProducer") << " Invalid handle for DeeTauVsMu score input collection";
}

if (deepTauVSjetMapHandle.isValid() || !(this->skipNonExistingSrc_)) {
deepTauVSjet[tau_index] = deepTauVSjetMapHandle->get(tausProductId, tau_index).rawValues.at(0);
} else {
edm::LogWarning("HLTTauTableProducer") << " Invalid handle for DeeTauVsJet score input collection";
}

if (tausIPHandle.isValid() || !(this->skipNonExistingSrc_)) {
dxy[tau_index] = tausIPHandle->value(tau_index)->dxy();
dxy_error[tau_index] = tausIPHandle->value(tau_index)->dxy_error();
ip3d[tau_index] = tausIPHandle->value(tau_index)->ip3d();
ip3d_error[tau_index] = tausIPHandle->value(tau_index)->ip3d_error();
hasSecondaryVertex[tau_index] = tausIPHandle->value(tau_index)->hasSecondaryVertex();
flightLength_x[tau_index] = tausIPHandle->value(tau_index)->flightLength().x();
flightLength_y[tau_index] = tausIPHandle->value(tau_index)->flightLength().y();
flightLength_z[tau_index] = tausIPHandle->value(tau_index)->flightLength().z();
flightLengthSig[tau_index] = tausIPHandle->value(tau_index)->flightLengthSig();

if (hasSecondaryVertex[tau_index] > 0) {
secondaryVertex_x[tau_index] = tausIPHandle->value(tau_index)->secondaryVertex()->x();
secondaryVertex_y[tau_index] = tausIPHandle->value(tau_index)->secondaryVertex()->y();
secondaryVertex_z[tau_index] = tausIPHandle->value(tau_index)->secondaryVertex()->z();
}
} else {
edm::LogWarning("HLTTauTableProducer") << " Invalid handle for Tau IP input collection";
}
}
} else {
edm::LogWarning("HLTTauTableProducer") << " Invalid handle for PFTau candidate input collection";
}

auto tauTable = std::make_unique<nanoaod::FlatTable>(nTaus, tableName_, /*singleton*/ false, /*extension*/ true);
tauTable->addColumn<float>("dxy", dxy, "tau transverse impact parameter", precision_);
tauTable->addColumn<float>("dxy_error", dxy_error, " dxy_error ", precision_);
tauTable->addColumn<float>("ip3d", ip3d, " ip3d ", precision_);
tauTable->addColumn<float>("ip3d_error", ip3d_error, " ip3d_error ", precision_);
tauTable->addColumn<float>("hasSecondaryVertex", hasSecondaryVertex, " hasSecondaryVertex ", precision_);
tauTable->addColumn<float>("flightLength_x", flightLength_x, "flightLength_x", precision_);
tauTable->addColumn<float>("flightLength_y", flightLength_y, "flightLength_y", precision_);
tauTable->addColumn<float>("flightLength_z", flightLength_z, "flightLength_z", precision_);
tauTable->addColumn<float>("flightLengthSig", flightLengthSig, "flightLengthSig", precision_);
tauTable->addColumn<float>("secondaryVertex_x", secondaryVertex_x, "secondaryVertex_x", precision_);
tauTable->addColumn<float>("secondaryVertex_y", secondaryVertex_y, "secondaryVertex_y", precision_);
tauTable->addColumn<float>("secondaryVertex_z", secondaryVertex_z, "secondaryVertex_z", precision_);
tauTable->addColumn<float>("deepTauVSe", deepTauVSe, "tau vs electron discriminator", precision_);
tauTable->addColumn<float>("deepTauVSmu", deepTauVSmu, "tau vs muon discriminator", precision_);
tauTable->addColumn<float>("deepTauVSjet", deepTauVSjet, "tau vs jet discriminator", precision_);

event.put(std::move(tauTable), tableName_);
}

private:
const std::string tableName_;
const bool skipNonExistingSrc_;
const edm::EDGetTokenT<TauCollection> tauToken_;
const edm::EDGetTokenT<TauIPVector> tauIPToken_;
const edm::EDGetTokenT<TauDiscrMap> deepTauVSeToken_, deepTauVSmuToken_, deepTauVSjetToken_;
const unsigned int precision_;
};

#include "FWCore/Framework/interface/MakerMacros.h"
DEFINE_FWK_MODULE(HLTTauTableProducer);
Loading