ATLAS Offline Software
PileUpMTAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // PileUpMT includes
6 #include "PileUpMTAlg.h"
7 
8 #include <CxxUtils/XXH.h>
9 #include <unistd.h>
10 
11 #include <boost/core/demangle.hpp>
12 #include <range/v3/all.hpp>
13 
14 #include <chrono>
15 #include <format>
16 
18 #include "EventInfo/EventInfo.h"
19 #include <tuple>
20 
22 #include "CLHEP/Random/RandPoisson.h"
23 #include "CLHEP/Random/RandomEngine.h"
25 #include "PileUpTools/PileUpMisc.h"
31 
33 namespace rv = ranges::views;
34 // namespace ra = ranges::actions;
35 
36 inline std::string CLIDToString(const CLID& clid) {
37  return boost::core::demangle(CLIDRegistry::CLIDToTypeinfo(clid)->name());
38 }
39 
40 PileUpMTAlg::PileUpMTAlg(const std::string& name, ISvcLocator* pSvcLocator)
41  : AthAlgorithm(name, pSvcLocator) {}
42 
44 
46  std::unique_ptr<const xAOD::EventInfo>& ei_,
47  std::unique_ptr<xAOD::EventAuxInfo>& ei_aux_,
48  bool pileup) const {
49  std::string key = pileup ? "EventInfo" : "HSEventInfo";
50  auto newEi = std::make_unique<xAOD::EventInfo>();
51  auto eiAux = std::make_unique<xAOD::EventAuxInfo>();
52  newEi->setStore(eiAux.get());
53  SG::ReadHandle<xAOD::EventInfo> ei_h(key, sg.name());
54  const xAOD::EventInfo* ei = ei_h.get();
55  if (ei != nullptr) {
56  *newEi = *ei;
57  } else {
58  ATH_MSG_ERROR("Couldn't find xAOD::EventInfo. " << sg.name());
59  ATH_MSG_ERROR(sg.dump());
60  return StatusCode::FAILURE;
61  }
62  // Use attribute list if EventInfo doesn't have event numbers set
63  if (newEi->eventNumber() == 0) {
64  const auto* attr_list_p = sg.tryConstRetrieve<AthenaAttributeList>("Input");
65  if (attr_list_p != nullptr) {
66  if (attr_list_p->size() <= 6) {
67  ATH_MSG_WARNING("Read Input attribute list but size <= 6");
68  } else {
69  const AthenaAttributeList& attr_list = *attr_list_p;
70  const auto runNum = attr_list["RunNumber"].data<unsigned>();
71  const auto evtNum = attr_list["EventNumber"].data<unsigned long long>();
72  const auto lbNum = attr_list["LumiBlockN"].data<unsigned>();
73  newEi->setRunNumber(runNum);
74  newEi->setLumiBlock(lbNum);
75  newEi->setEventNumber(evtNum);
76  }
77  } else {
79  "Could not read Input attribute list and EventInfo has no event "
80  "number");
81  }
82  }
83  newEi->setEvtStore(&sg);
84  ei_ = std::move(newEi);
85  ei_aux_ = std::move(eiAux);
86  return StatusCode::SUCCESS;
87 }
88 
90  const std::vector<std::uint32_t>& bcid,
94  int bc, const EventContext& ctx, unsigned long subevt_id,
95  std::vector<std::uint64_t>& trace) {
96  // Keep the code to add and process a subevent in one place
97  const unsigned int bc_idx = bc - m_earliestDeltaBC;
98  StoreGateSvc* sg = mbSvc->getMinbias(ctx, subevt_id);
99  std::unique_ptr<const xAOD::EventInfo> ei;
100  std::unique_ptr<xAOD::EventAuxInfo> eiAux;
101  ATH_CHECK(get_ei(*sg, ei, eiAux, true));
102  xAOD::EventInfo mb_to_modify(*ei);
103  if (m_writeTrace) {
104  trace.push_back(mb_to_modify.eventNumber());
105  }
106  mb_to_modify.setBCID(bcid[bc_idx]);
107  try {
108  addSubEvent(overlaidEvt.ptr(), &mb_to_modify, bc * m_BCSpacing, puType,
109  puCont.ptr(), m_evtInfoContKey.key(), sg);
110  } catch (const std::exception& e) {
111  ATH_MSG_ERROR("Caught exception adding subevent: " << e.what());
112  return StatusCode::FAILURE;
113  }
114  return StatusCode::SUCCESS;
115 }
116 
118  using namespace std::chrono;
119  ATH_MSG_DEBUG("Initializing " << name() << "...");
120  if (m_writeTrace) {
121  std::string filename = std::format("pileup_trace_skipping-{}_{:%Y-%m-%dT%H%M}.txt",
122  m_skippedHSEvents.value(),
124  if (!m_pileupTrace.init(filename)) {
125  ATH_MSG_ERROR("Cannot append to file " << filename);
126  return StatusCode::FAILURE;
127  }
128  }
129  ATH_CHECK(m_skipEventIdxSvc.retrieve());
130  ATH_CHECK(m_rngSvc.retrieve());
131  if (m_fracLowPt != 0) {
132  ATH_CHECK(m_lowptMBSvc.retrieve());
133  }
134  if (m_fracHighPt != 0) {
135  ATH_CHECK(m_highptMBSvc.retrieve());
136  }
137  if (m_numCavern != 0) {
138  ATH_CHECK(m_cavernMBSvc.retrieve());
139  }
140  if (m_numBeamGas != 0) {
141  ATH_CHECK(m_beamgasMBSvc.retrieve());
142  }
143  if (m_numBeamHalo != 0) {
144  ATH_CHECK(m_beamhaloMBSvc.retrieve());
145  }
146  ATH_CHECK(m_beamInt.retrieve());
147  ATH_CHECK(m_beamLumi.retrieve());
148  ATH_CHECK(m_puTools.retrieve());
149 
150  m_evtInfoContKey = "PileUpEventInfo";
152  ATH_CHECK(m_evtInfoContKey.initialize());
154 
155  // Trace skipped events
156  if (m_writeTrace) {
159  std::string trace_buf{};
160  auto trace = std::back_inserter(trace_buf);
161  for (; it != end; ++it) {
162  std::format_to(trace, "SKIPPING Run: {} LB: {} EVT: {} HS ID: {}\n",
163  it->runNum, it->lbNum, it->evtNum, it->evtIdx);
164  }
165  m_pileupTrace.print(trace_buf);
166  return StatusCode::SUCCESS;
167  };
168  if (!m_skiptrace_written) {
169  ATH_CHECK(m_skipEventIdxSvc->registerCallback(handler));
170  m_skiptrace_written = true;
171  }
172  }
173  return StatusCode::SUCCESS;
174 }
175 
177  ATH_MSG_DEBUG("Finalizing " << name() << "...");
178  //
179  // Things that happen once at the end of the event loop go here
180  //
181 
182  return StatusCode::SUCCESS;
183 }
184 
186  using PUType = xAOD::EventInfo::PileUpType;
187  std::string trace_buf{}; // Hold trace of events.
188  auto trace = std::back_inserter(trace_buf);
189  ATH_MSG_DEBUG("Executing " << name() << "...");
190  const EventContext& ctx = Gaudi::Hive::currentContext();
191  const auto& evtID = ctx.eventID();
192 
194  setFilterPassed(false); // optional: start with algorithm not passed
195 
196  // Code based on PileUpEventLoopMgr and PileUpToolsAlg (trying to extract the
197  // core merging code) Read hard scatter
198  std::unique_ptr<const xAOD::EventInfo> hsEvt = nullptr;
199  std::unique_ptr<xAOD::EventAuxInfo> hsEvtAux = nullptr;
200  ATH_CHECK(get_ei(*evtStore(), hsEvt, hsEvtAux));
201 
202  // Setup overlaid event
204  ATH_CHECK(overlaidEvt.record(std::make_unique<xAOD::EventInfo>(),
205  std::make_unique<xAOD::EventAuxInfo>()));
206  *overlaidEvt = *hsEvt; // copy in hard scatter
207  overlaidEvt->setEvtStore(evtStore().get());
208  overlaidEvt->clearSubEvents();
209 
210  // This was the problem. Need to fix overlaidEvt using context run and lb
211  // number
212  overlaidEvt->setRunNumber(evtID.run_number());
213  overlaidEvt->setLumiBlock(evtID.lumi_block());
214  overlaidEvt->setEventNumber(evtID.event_number());
215  overlaidEvt->setBCID(evtID.bunch_crossing_id());
216  overlaidEvt->setTimeStamp(evtID.time_stamp());
217  overlaidEvt->setTimeStampNSOffset(evtID.time_stamp_ns_offset());
218  // Set beam spot info
220  if (!beamSpotHandle.isValid()) {
221  ATH_MSG_ERROR("Beam spot information not valid");
222  return StatusCode::FAILURE;
223  }
224 
225  overlaidEvt->setBeamPos(beamSpotHandle->beamPos()[Amg::x],
226  beamSpotHandle->beamPos()[Amg::y],
227  beamSpotHandle->beamPos()[Amg::z]);
228  overlaidEvt->setBeamPosSigma(beamSpotHandle->beamSigma(0),
229  beamSpotHandle->beamSigma(1),
230  beamSpotHandle->beamSigma(2));
231  overlaidEvt->setBeamPosSigmaXY(beamSpotHandle->beamSigmaXY());
232  overlaidEvt->setBeamTiltXZ(beamSpotHandle->beamTilt(0));
233  overlaidEvt->setBeamTiltYZ(beamSpotHandle->beamTilt(1));
234  overlaidEvt->setBeamStatus(beamSpotHandle->beamStatus());
235 
236  // Pileup container
238  ATH_CHECK(puCont.record(std::make_unique<xAOD::EventInfoContainer>(),
239  std::make_unique<xAOD::EventInfoAuxContainer>()));
240 
241  // Get crossing number
242  m_beamInt->selectT0(evtID.run_number(), evtID.event_number());
243  overlaidEvt->setBCID(m_beamInt->getCurrentT0BunchCrossing());
244 
245  // Set simulation bit
246  overlaidEvt->setEventTypeBitmask(hsEvt->eventTypeBitmask() |
248 
249  // Set properties
250  bool sf_updated = false;
251  float lumi_sf = m_beamLumi->scaleFactor(evtID.run_number(),
252  evtID.lumi_block(), sf_updated);
253  float cur_avg_mu = lumi_sf * m_avgMu;
254  overlaidEvt->setAverageInteractionsPerCrossing(cur_avg_mu);
255  overlaidEvt->setActualInteractionsPerCrossing(m_beamInt->normFactor(0) *
256  cur_avg_mu);
257 
258  // Trace
259  if (m_writeTrace) {
260  std::format_to(trace,
261  "Idx: {} Run: {} LB: {} EVT: {} "
262  "HS ID: {}\n",
263  ctx.evt(), evtID.run_number(), evtID.lumi_block(),
264  evtID.event_number(), m_lowptMBSvc->get_hs_id(ctx));
265  auto bunch_pattern =
266  rv::closed_iota(m_earliestDeltaBC.value(), m_latestDeltaBC.value()) |
268  [this](int bc) { return int(m_beamInt->normFactor(bc)); }) |
269 #if RANGE_V3_VERSION >= 1200
270  rv::chunk_by(std::equal_to{}) |
271 #else
272  rv::group_by(std::equal_to{}) |
273 #endif
274  rv::transform([](const auto& rng) {
275  return std::format("{}{}", rng.size(), rng[0] == 0 ? 'E' : 'F');
276  }) |
277  ranges::to<std::vector<std::string>>;
278  // Manual join using std::ostringstream as std::format does not support ranges
279  std::string joined_pattern;
280  for (size_t i = 0; i < bunch_pattern.size(); ++i) {
281  joined_pattern += bunch_pattern[i];
282  if (i + 1 < bunch_pattern.size()) {
283  joined_pattern += " ";
284  }
285  }
286 
287  std::format_to(trace,
288  "mu = {}, central BCID = {}, bunch pattern = [{}]\n",
289  cur_avg_mu, m_beamInt->getCurrentT0BunchCrossing(),
290  joined_pattern);
291  }
292  // Copy subevents
293  if (!hsEvt->subEvents().empty()) {
294  for (const SubEvent& se : hsEvt->subEvents()) {
295  addSubEvent(overlaidEvt.ptr(), se, puCont.ptr(), m_evtInfoContKey.key(),
296  evtStore().get());
297  }
298  } else {
299  // if no subevents, add original event
300  addSubEvent(overlaidEvt.ptr(), hsEvt.get(), 0, xAOD::EventInfo::Signal,
301  puCont.ptr(), m_evtInfoContKey.key(), evtStore().get());
302  }
303 
304  // Initialize MinbiasSvcs
305  if (m_fracLowPt != 0) {
306  ATH_CHECK(m_lowptMBSvc->beginHardScatter(ctx));
307  }
308  if (m_fracHighPt != 0) {
309  ATH_CHECK(m_highptMBSvc->beginHardScatter(ctx));
310  }
311  if (m_numCavern != 0) {
312  ATH_CHECK(m_cavernMBSvc->beginHardScatter(ctx));
313  }
314  if (m_numBeamHalo != 0) {
315  ATH_CHECK(m_beamhaloMBSvc->beginHardScatter(ctx));
316  }
317  if (m_numBeamGas != 0) {
318  ATH_CHECK(m_beamgasMBSvc->beginHardScatter(ctx));
319  }
320 
321  std::uint32_t central_bcid = overlaidEvt->bcid();
322  std::vector<std::uint32_t> bcid{};
323  bcid.reserve(m_latestDeltaBC - m_earliestDeltaBC + 1);
324 
325  for (int bc = m_earliestDeltaBC; bc <= m_latestDeltaBC; ++bc) {
326  bcid.push_back(get_BCID(bc, central_bcid));
327  }
328 
329  // Setup tools
330  for (auto&& tool : m_puTools) {
331  // Reset filter -- Don't know if this is necessary
332  tool->resetFilter();
333  }
334 
335  // Now add the events
336  std::uint64_t low_pt_count = 0;
337  std::uint64_t high_pt_count = 0;
338  std::uint64_t cavern_count = 0;
339  std::uint64_t beam_halo_count = 0;
340  std::uint64_t beam_gas_count = 0;
342  for (int bc = m_earliestDeltaBC; bc <= m_latestDeltaBC; ++bc) {
343  if (m_beamInt->normFactor(bc) == 0.) {
344  // skip empty bunch crossings
345  continue;
346  }
347  std::vector<std::uint64_t> subevts_vec{};
348  if (m_fracLowPt != 0) {
349  if (m_writeTrace) {
350  std::format_to(trace, "\tBC {:03} : LOW PT {} ", bc,
351  m_lowptMBSvc->getNumForBunch(ctx, bc));
352  }
353  for (std::size_t i = 0; i < m_lowptMBSvc->getNumForBunch(ctx, bc); ++i) {
354  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_lowptMBSvc,
355  PUType::MinimumBias, bc, ctx, low_pt_count,
356  subevts_vec));
357  ++low_pt_count;
358  }
359  }
360  if (m_fracHighPt != 0) {
361  if (m_writeTrace) {
362  std::format_to(trace, "HIGH PT {} | ",
363  m_highptMBSvc->getNumForBunch(ctx, bc));
364  }
365  for (std::size_t i = 0; i < m_highptMBSvc->getNumForBunch(ctx, bc); ++i) {
366  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_highptMBSvc,
367  PUType::HighPtMinimumBias, bc, ctx, high_pt_count,
368  subevts_vec));
369  ++high_pt_count;
370  }
371  }
372  if (m_numCavern != 0) {
373  if (m_writeTrace) {
374  std::format_to(trace, "CAVERN {} | ",
375  m_cavernMBSvc->getNumForBunch(ctx, bc));
376  }
377  for (std::size_t i = 0; i < m_cavernMBSvc->getNumForBunch(ctx, bc); ++i) {
378  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_cavernMBSvc,
379  PUType::Cavern, bc, ctx, cavern_count,
380  subevts_vec));
381  ++cavern_count;
382  }
383  }
384  if (m_numBeamHalo != 0) {
385  if (m_writeTrace) {
386  std::format_to(trace, "BEAM HALO {} | ",
387  m_beamhaloMBSvc->getNumForBunch(ctx, bc));
388  }
389  for (std::size_t i = 0; i < m_beamhaloMBSvc->getNumForBunch(ctx, bc);
390  ++i) {
391  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_beamhaloMBSvc,
392  PUType::HaloGas, bc, ctx, beam_halo_count,
393  subevts_vec));
394  ++beam_halo_count;
395  }
396  }
397  if (m_numBeamGas != 0) {
398  if (m_writeTrace) {
399  std::format_to(trace, "BEAM GAS {} | ",
400  m_beamgasMBSvc->getNumForBunch(ctx, bc));
401  }
402  for (std::size_t i = 0; i < m_beamgasMBSvc->getNumForBunch(ctx, bc);
403  ++i) {
404  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_beamgasMBSvc,
405  PUType::HaloGas, bc, ctx, beam_gas_count,
406  subevts_vec));
407  ++beam_gas_count;
408  }
409  }
410  if (m_writeTrace) {
411  std::format_to(trace, "TOTAL {} | HASH {:08X}\n", subevts_vec.size(),
412  xxh3::hash64(subevts_vec));
413  }
414  }
415  if (m_writeTrace) {
416  std::format_to(trace, "\n");
417  m_pileupTrace.print(trace_buf);
418  }
419 
420  for (auto&& tool : m_puTools) {
421  try {
422  ATH_CHECK(tool->processAllSubEvents(ctx));
423  } catch (const std::exception& e) {
424  ATH_MSG_ERROR("Caught exception running " << tool.name() << ": "
425  << e.what());
426  return StatusCode::FAILURE;
427  }
428  // Propagate filter result
429  if (!tool->filterPassed()) {
430  setFilterPassed(false);
431  }
432  }
433  ATH_MSG_DEBUG(std::format("***** Took {:%OMm %OSs} to process all subevents",
435  //
436  // Save hash (direct copy from PileUpEventLoopMgr)
437  PileUpHashHelper pileUpHashHelper;
438  pileUpHashHelper.addToHashSource(overlaidEvt.cptr());
439  ATH_MSG_VERBOSE("Pile-up hash source:" << pileUpHashHelper.hashSource());
440 
441  // Calculate and set hash
442  uuid_t pileUpHash;
443  pileUpHashHelper.calculateHash(pileUpHash);
444  overlaidEvt->setPileUpMixtureID(
446  ATH_MSG_DEBUG("PileUpMixtureID = " << overlaidEvt->pileUpMixtureID());
447 
448  setFilterPassed(true); // if got here, assume that means algorithm passed
449  if (m_fracLowPt != 0) {
450  ATH_CHECK(m_lowptMBSvc->endHardScatter(ctx));
451  }
452  if (m_fracHighPt != 0) {
453  ATH_CHECK(m_highptMBSvc->endHardScatter(ctx));
454  }
455  if (m_numCavern != 0) {
456  ATH_CHECK(m_cavernMBSvc->endHardScatter(ctx));
457  }
458  if (m_numBeamHalo != 0) {
459  ATH_CHECK(m_beamhaloMBSvc->endHardScatter(ctx));
460  }
461  if (m_numBeamGas != 0) {
462  ATH_CHECK(m_beamgasMBSvc->endHardScatter(ctx));
463  }
464  return StatusCode::SUCCESS;
465 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
PileUpHashHelper.h
A helper class to compute a hash of pile-up events.
xAOD::EventInfo_v1::setActualInteractionsPerCrossing
void setActualInteractionsPerCrossing(float value)
Set average interactions per crossing for the current BCID.
Definition: EventInfo_v1.cxx:391
xAOD::EventInfo_v1::setEventNumber
void setEventNumber(uint64_t value)
Set the current event's event number.
vtune_athena.format
format
Definition: vtune_athena.py:14
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
PileUpMTAlg::m_numBeamHalo
Gaudi::Property< float > m_numBeamHalo
Definition: PileUpMTAlg.h:127
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
PileUpMTAlg::initialize
virtual StatusCode initialize() override
uncomment and implement methods as required
Definition: PileUpMTAlg.cxx:117
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
PileUpMTAlg::finalize
virtual StatusCode finalize() override
Definition: PileUpMTAlg.cxx:176
xAOD::EventInfo_v1::clearSubEvents
void clearSubEvents()
Clear all the currently held sub-events.
Definition: EventInfo_v1.cxx:647
EventInfoAuxContainer.h
xAOD::EventInfo_v1::setBeamPos
void setBeamPos(float x, float y, float z)
Set the beam spot position.
Definition: EventInfo_v1.cxx:916
Amg::y
@ y
Definition: GeoPrimitives.h:35
PileUpMTAlg::m_lowptMBSvc
ServiceHandle< IMinbiasSvc > m_lowptMBSvc
Other useful methods provided by base class are: evtStore() : ServiceHandle to main event data storeg...
Definition: PileUpMTAlg.h:97
skel.it
it
Definition: skel.GENtoEVGEN.py:407
PileUpMTAlg::m_fracLowPt
Gaudi::Property< float > m_fracLowPt
Definition: PileUpMTAlg.h:119
xAOD::EventInfo_v1::PileUpType
PileUpType
Enumerator describing the types of pileup events.
Definition: EventInfo_v1.h:264
CLIDRegistry::CLIDToTypeinfo
static const std::type_info * CLIDToTypeinfo(CLID clid)
Translate between CLID and type_info.
Definition: CLIDRegistry.cxx:136
PileUpHashHelper::uuidToPileUpMixtureId
static xAOD::EventInfo::PileUpMixtureID uuidToPileUpMixtureId(const uuid_t &hash)
Convert uuid_t to xAOD::EventInfo::PileUpMixtureID.
Definition: PileUpHashHelper.cxx:57
xAOD::EventInfo_v1::eventTypeBitmask
uint32_t eventTypeBitmask() const
The event type bitmask.
PileUpHashHelper
Definition: PileUpHashHelper.h:21
python.PileUpEventType.MinimumBias
int MinimumBias
Definition: PileUpEventType.py:4
PileUpHashHelper::hashSource
std::string hashSource() const
Get the current hash base.
Definition: PileUpHashHelper.h:35
SG::WriteHandle::cptr
const_pointer_type cptr() const
Dereference the pointer.
PileUpMTAlg::~PileUpMTAlg
virtual ~PileUpMTAlg()
Definition: PileUpMTAlg.cxx:43
PileUpMTAlg::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: PileUpMTAlg.h:140
PileUpMTAlg::m_latestDeltaBC
Gaudi::Property< int > m_latestDeltaBC
Definition: PileUpMTAlg.h:134
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
xAOD::EventInfo_v1::setBeamPosSigma
void setBeamPosSigma(float x, float y, float z)
Set the size of the beam spot.
Definition: EventInfo_v1.cxx:935
PileUpMTAlg::m_avgMu
Gaudi::Property< float > m_avgMu
Definition: PileUpMTAlg.h:118
skel.runNum
runNum
Definition: skel.ABtoEVGEN.py:137
D3PDTest::rng
uint32_t rng()
Definition: FillerAlg.cxx:40
keylayer_zslicemap.se
se
Definition: keylayer_zslicemap.py:194
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
PileUpMTAlg::m_beamInt
ServiceHandle< IBeamIntensity > m_beamInt
Definition: PileUpMTAlg.h:107
xAOD::EventInfo_v1::pileUpMixtureID
PileUpMixtureID pileUpMixtureID() const
Unique pile-up mixture identifier.
Definition: EventInfo_v1.cxx:421
python.PileUpEventType.HighPtMinimumBias
int HighPtMinimumBias
Definition: PileUpEventType.py:7
EventInfoContainer.h
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
handler
void handler(int sig)
signal handler
Definition: rmain.cxx:99
PileUpMTAlg::m_writeTrace
Gaudi::Property< bool > m_writeTrace
Definition: PileUpMTAlg.h:115
PileUpMTAlg::m_evtInfoContKey
SG::WriteHandleKey< xAOD::EventInfoContainer > m_evtInfoContKey
Definition: PileUpMTAlg.h:144
PileUpMTAlg::m_numCavern
Gaudi::Property< float > m_numCavern
Definition: PileUpMTAlg.h:123
xAOD::EventInfo_v1::setBeamTiltYZ
void setBeamTiltYZ(float value)
Set the beam's tilt in radians in YZ.
PileUpMTAlg::m_earliestDeltaBC
Gaudi::Property< int > m_earliestDeltaBC
Definition: PileUpMTAlg.h:131
xAOD::EventInfo_v1::setPileUpMixtureID
void setPileUpMixtureID(const PileUpMixtureID &value)
Set unique pile-up mixture identifier.
Definition: EventInfo_v1.cxx:436
xAOD::EventInfo_v1::setBeamStatus
void setBeamStatus(uint32_t value)
Set the beam spot's status word.
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
PileUpMTAlg::execute
virtual StatusCode execute() override
Definition: PileUpMTAlg.cxx:185
Amg::z
@ z
Definition: GeoPrimitives.h:36
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:122
PileUpMTAlg::m_highptMBSvc
ServiceHandle< IMinbiasSvc > m_highptMBSvc
Definition: PileUpMTAlg.h:99
python.handimod.now
now
Definition: handimod.py:674
StoreGateSvc::dump
std::string dump() const
dump objects in store.
Definition: StoreGateSvc.cxx:351
CLIDToString
std::string CLIDToString(const CLID &clid)
Definition: PileUpMTAlg.cxx:36
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::EventInfo_v1::setEventTypeBitmask
void setEventTypeBitmask(uint32_t value)
Set the event type bitmask.
PileUpMTAlg::m_numBeamGas
Gaudi::Property< float > m_numBeamGas
Definition: PileUpMTAlg.h:125
lumiFormat.i
int i
Definition: lumiFormat.py:85
ISkipEventIdxSvc::EvtIter
std::vector< EvtId >::const_iterator EvtIter
Definition: ISkipEventIdxSvc.h:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::x
@ x
Definition: GeoPrimitives.h:34
PileUpMTAlg::m_beamLumi
ServiceHandle< IBeamLuminosity > m_beamLumi
Definition: PileUpMTAlg.h:109
calibdata.exception
exception
Definition: calibdata.py:495
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
python.PileUpEventType.HaloGas
int HaloGas
Definition: PileUpEventType.py:6
PileUpHashHelper::addToHashSource
void addToHashSource(const std::string &string)
Add a plain string to the stream.
Definition: PileUpHashHelper.cxx:11
PileUpMTAlg::m_beamgasMBSvc
ServiceHandle< IMinbiasSvc > m_beamgasMBSvc
Definition: PileUpMTAlg.h:105
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
XXH.h
C++ native wrapper for the C xxhash API.
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
PileUpMTAlg::get_BCID
unsigned int get_BCID(int bc, unsigned int central_BCID) const
Definition: PileUpMTAlg.h:150
xAOD::EventInfo_v1::setTimeStamp
void setTimeStamp(uint32_t value)
Set the POSIX time of the event.
xAOD::EventInfo_v1::setBCID
void setBCID(uint32_t value)
Set the bunch crossing ID of the event.
PileUpMTAlg::m_beamhaloMBSvc
ServiceHandle< IMinbiasSvc > m_beamhaloMBSvc
Definition: PileUpMTAlg.h:103
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
PileUpMTAlg::add_subevt
StatusCode add_subevt(const std::vector< std::uint32_t > &bcid, SG::WriteHandle< xAOD::EventInfo > &overlaidEvt, SG::WriteHandle< xAOD::EventInfoContainer > &puCont, ServiceHandle< IMinbiasSvc > &mbSvc, xAOD::EventInfo::PileUpType puType, int bc, const EventContext &ctx, unsigned long subevt_id, std::vector< std::uint64_t > &trace)
Definition: PileUpMTAlg.cxx:89
xAOD::EventInfo_v1::setBeamPosSigmaXY
void setBeamPosSigmaXY(float value)
Set the beam spot shape's X-Y correlation.
AthAlgorithm
Definition: AthAlgorithm.h:47
PileUpMTAlg.h
PileUpMTAlg::m_rngSvc
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition: PileUpMTAlg.h:111
dqt_zlumi_pandas.pileup
pileup
Definition: dqt_zlumi_pandas.py:175
EventAuxInfo.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
PileUpMTAlg::m_BCSpacing
Gaudi::Property< int > m_BCSpacing
Definition: PileUpMTAlg.h:129
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:452
xAOD::EventInfo_v1::setAverageInteractionsPerCrossing
void setAverageInteractionsPerCrossing(float value)
Set average interactions per crossing for all BCIDs.
Definition: EventInfo_v1.cxx:408
PileUpMTAlg::m_skippedHSEvents
Gaudi::Property< int > m_skippedHSEvents
Definition: PileUpMTAlg.h:116
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
dq_make_web_display.rv
def rv
Definition: dq_make_web_display.py:218
RNGWrapper.h
StoreGateSvc::tryConstRetrieve
const T * tryConstRetrieve() const
AthenaAttributeList.h
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
EventInfo.h
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PileUpMTAlg::m_skipEventIdxSvc
ServiceHandle< ISkipEventIdxSvc > m_skipEventIdxSvc
Definition: PileUpMTAlg.h:137
xAOD::EventInfo_v1::setTimeStampNSOffset
void setTimeStampNSOffset(uint32_t value)
Set the nanosecond offset wrt. the time stamp.
xxh3::hash64
std::uint64_t hash64(const void *data, std::size_t size)
Passthrough to XXH3_64bits.
Definition: XXH.cxx:9
xAOD::EventInfo_v1::Signal
@ Signal
The signal event.
Definition: EventInfo_v1.h:266
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
PileUpMTAlg::m_fracHighPt
Gaudi::Property< float > m_fracHighPt
Definition: PileUpMTAlg.h:121
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::EventInfo_v1::setRunNumber
void setRunNumber(uint32_t value)
Set the current event's run number.
PileUpMTAlg::m_cavernMBSvc
ServiceHandle< IMinbiasSvc > m_cavernMBSvc
Definition: PileUpMTAlg.h:101
PileUpMTAlg::PileUpMTAlg
PileUpMTAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: PileUpMTAlg.cxx:40
python.PileUpEventType.Cavern
int Cavern
Definition: PileUpEventType.py:5
xAOD::EventInfo_v1::setBeamTiltXZ
void setBeamTiltXZ(float value)
Set the beam's tilt in radians in XZ.
PileUpHashHelper::calculateHash
void calculateHash(uuid_t &hash) const
Calculate the hash.
Definition: PileUpHashHelper.cxx:49
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
PileUpMisc.h
PileUpMTAlg::get_ei
StatusCode get_ei(StoreGateSvc &sg, std::unique_ptr< const xAOD::EventInfo > &ei, std::unique_ptr< xAOD::EventAuxInfo > &eiAux, bool pileup=false) const
Definition: PileUpMTAlg.cxx:45
PileUpMTAlg::m_puTools
ToolHandleArray< IPileUpTool > m_puTools
Definition: PileUpMTAlg.h:113
BeamSpotData.h
xAOD::EventInfo_v1::setLumiBlock
void setLumiBlock(uint32_t value)
Set the current event's luminosity block number.
xAOD::EventInfo_v1::subEvents
const std::vector< SubEvent > & subEvents() const
Get the pileup events that were used in the simulation.
Definition: EventInfo_v1.cxx:596
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
SubEvent
xAOD::EventInfo::SubEvent SubEvent
Definition: PileUpMTAlg.cxx:32
xAOD::EventInfo_v1::SubEvent
Class describing the properties of one pileup sub-event.
Definition: EventInfo_v1.h:286
addSubEvent
xAOD::EventInfo * addSubEvent(xAOD::EventInfo *targetEv, const xAOD::EventInfo::SubEvent &subev, xAOD::EventInfoContainer *eiContainer, const std::string &eiContKey, StoreGateSvc *subev_store=nullptr)
Definition: PileUpMisc.cxx:18
PileUpMTAlg::m_evtInfoKey
SG::WriteHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition: PileUpMTAlg.h:142
ServiceHandle< IMinbiasSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37