9using Athena::Units::GeV;
22 m_tree =
new TTree(
"analysis",
"Ntuple for JZ combine weight calculation");
39 return StatusCode::SUCCESS;
51 m_mu_actual = std::ceil(evt->actualInteractionsPerCrossing());
59 if (hs_jets->
size()) {
60 auto iter_jet = std::max_element(hs_jets->
begin(), hs_jets->
end(),
68 std::unordered_map<int, double> leading_pts;
69 if (pu_jets->
size()) {
70 for (
const xAOD::Jet* pu_jet : *pu_jets) {
72 const uint32_t pu_enum =
static_cast<uint32_t
>(pu_enum_acc.
withDefault(*pu_jet, 0));
73 double pu_jet_pt = pu_jet->pt() /
GeV;
74 if (!leading_pts.contains(pu_enum) || leading_pts.at(pu_enum) < pu_jet_pt) {
75 leading_pts[pu_enum] = pu_jet_pt;
81 for (
const auto& [pu_enum, pu_jet_pt] : leading_pts) {
91 return StatusCode::SUCCESS;
95 return StatusCode::SUCCESS;
100 const std::string& name = trigger->branchName();
108 return StatusCode::SUCCESS;
113 const std::string& name = trigger->branchName();
114 ATH_CHECK(trigger->updateThresholdValue());
116 ATH_MSG_ERROR(name <<
" does not exist! Please check `Triggers`!");
117 return StatusCode::FAILURE;
121 return StatusCode::SUCCESS;
132 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Wrapper to avoid constant divisions when using units.
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode ratesInitialize() override
To be implemented by the user.
JZCombineWeightNtupler(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode ratesExecute() override
To be implemented by the user.
virtual ~JZCombineWeightNtupler()
uint32_t m_n_pileup_records
ToolHandleArray< IEmulatedTrigger > m_triggers
User can extend the output tree with customised emulated triggers.
Gaudi::Property< std::string > m_jetCollectionPU
std::vector< uint32_t > m_pileup_event_number
virtual StatusCode ratesFinalize() override
To be implemented by the user.
Gaudi::Property< std::string > m_jetCollectionHS
std::unordered_map< std::string, double > m_thresholds
StatusCode setEmulatedThresholds()
std::vector< double > m_pt_j0_AK4PU
StatusCode addEmulatedThresholds()
Gaudi::Property< uint32_t > m_dsid_JZ0
RatesAnalysisAlg(const std::string &name, ISvcLocator *pSvcLocator)
WeightingValuesSummary_t m_weightingValues
Possible weighting & lumi extrapolation values for the current event.
Helper class to provide constant type-safe access to aux data.
const_reference_type withDefault(const ELT &e, const T &deflt) const
Fetch the variable for one element, as a const reference, with a default.
@ IS_SIMULATION
true: simulation, false: data
Jet_v1 Jet
Definition of the current "jet version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
JetContainer_v1 JetContainer
Definition of the current "jet container version".