ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PileUpMTAlg Class Reference

#include <PileUpMTAlg.h>

Inheritance diagram for PileUpMTAlg:
Collaboration diagram for PileUpMTAlg:

Public Member Functions

 PileUpMTAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~PileUpMTAlg ()
 
virtual StatusCode initialize () override
 uncomment and implement methods as required More...
 
virtual StatusCode execute () override
 
virtual StatusCode finalize () override
 
virtual bool isClonable () const override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode get_ei (StoreGateSvc &sg, std::unique_ptr< const xAOD::EventInfo > &ei, std::unique_ptr< xAOD::EventAuxInfo > &eiAux, bool pileup=false) const
 
unsigned int get_BCID (int bc, unsigned int central_BCID) const
 
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)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< IMinbiasSvcm_lowptMBSvc
 Other useful methods provided by base class are: evtStore() : ServiceHandle to main event data storegate inputMetaStore() : ServiceHandle to input metadata storegate outputMetaStore() : ServiceHandle to output metadata storegate histSvc() : ServiceHandle to output ROOT service (writing TObjects) currentFile() : TFile* to the currently open input file retrieveMetadata(...): See twiki.cern.ch/twiki/bin/view/AtlasProtected/AthAnalysisBase#ReadingMetaDataInCpp. More...
 
ServiceHandle< IMinbiasSvcm_highptMBSvc
 
ServiceHandle< IMinbiasSvcm_cavernMBSvc
 
ServiceHandle< IMinbiasSvcm_beamhaloMBSvc
 
ServiceHandle< IMinbiasSvcm_beamgasMBSvc
 
ServiceHandle< IBeamIntensitym_beamInt
 
ServiceHandle< IBeamLuminositym_beamLumi
 
ServiceHandle< IAthRNGSvcm_rngSvc
 
ToolHandleArray< IPileUpToolm_puTools
 
Gaudi::Property< bool > m_writeTrace {this, "WriteTrace", false, "Write trace of pileup events used"}
 
Gaudi::Property< int > m_skippedHSEvents
 
Gaudi::Property< float > m_avgMu {this, "AverageMu", 200, "Average mu"}
 
Gaudi::Property< float > m_fracLowPt
 
Gaudi::Property< float > m_fracHighPt
 
Gaudi::Property< float > m_numCavern
 
Gaudi::Property< float > m_numBeamGas
 
Gaudi::Property< float > m_numBeamHalo
 
Gaudi::Property< int > m_BCSpacing
 
Gaudi::Property< int > m_earliestDeltaBC
 
Gaudi::Property< int > m_latestDeltaBC
 
ServiceHandle< ISkipEventIdxSvcm_skipEventIdxSvc
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey
 
SG::WriteHandleKey< xAOD::EventInfom_evtInfoKey
 
SG::WriteHandleKey< xAOD::EventInfoContainerm_evtInfoContKey {""}
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Static Private Attributes

static atomic_output m_pileupTrace ATLAS_THREAD_SAFE {}
 
static bool m_skiptrace_written ATLAS_THREAD_SAFE = false
 

Detailed Description

Definition at line 71 of file PileUpMTAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PileUpMTAlg()

PileUpMTAlg::PileUpMTAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 39 of file PileUpMTAlg.cxx.

40  : AthAlgorithm(name, pSvcLocator) {}

◆ ~PileUpMTAlg()

PileUpMTAlg::~PileUpMTAlg ( )
virtual

Definition at line 42 of file PileUpMTAlg.cxx.

42 {}

Member Function Documentation

◆ add_subevt()

StatusCode PileUpMTAlg::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 
)
private

Definition at line 88 of file PileUpMTAlg.cxx.

94  {
95  // Keep the code to add and process a subevent in one place
96  const unsigned int bc_idx = bc - m_earliestDeltaBC;
97  StoreGateSvc* sg = mbSvc->getMinbias(ctx, subevt_id);
98  std::unique_ptr<const xAOD::EventInfo> ei;
99  std::unique_ptr<xAOD::EventAuxInfo> eiAux;
100  ATH_CHECK(get_ei(*sg, ei, eiAux, true));
101  xAOD::EventInfo mb_to_modify(*ei);
102  if (m_writeTrace) {
103  trace.push_back(mb_to_modify.eventNumber());
104  }
105  mb_to_modify.setBCID(bcid[bc_idx]);
106  try {
107  addSubEvent(overlaidEvt.ptr(), &mb_to_modify, bc * m_BCSpacing, puType,
108  puCont.ptr(), m_evtInfoContKey.key(), sg);
109  } catch (const std::exception& e) {
110  ATH_MSG_ERROR("Caught exception adding subevent: " << e.what());
111  return StatusCode::FAILURE;
112  }
113  return StatusCode::SUCCESS;
114 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode PileUpMTAlg::execute ( )
overridevirtual

Definition at line 184 of file PileUpMTAlg.cxx.

184  {
185  using PUType = xAOD::EventInfo::PileUpType;
186  std::string trace_buf{}; // Hold trace of events.
187  auto trace = std::back_inserter(trace_buf);
188  ATH_MSG_DEBUG("Executing " << name() << "...");
189  const EventContext& ctx = Gaudi::Hive::currentContext();
190  const auto& evtID = ctx.eventID();
191 
193  setFilterPassed(false); // optional: start with algorithm not passed
194 
195  // Code based on PileUpEventLoopMgr and PileUpToolsAlg (trying to extract the
196  // core merging code) Read hard scatter
197  std::unique_ptr<const xAOD::EventInfo> hsEvt = nullptr;
198  std::unique_ptr<xAOD::EventAuxInfo> hsEvtAux = nullptr;
199  ATH_CHECK(get_ei(*evtStore(), hsEvt, hsEvtAux));
200 
201  // Setup overlaid event
203  ATH_CHECK(overlaidEvt.record(std::make_unique<xAOD::EventInfo>(),
204  std::make_unique<xAOD::EventAuxInfo>()));
205  *overlaidEvt = *hsEvt; // copy in hard scatter
206  overlaidEvt->setEvtStore(evtStore().get());
207  overlaidEvt->clearSubEvents();
208 
209  // This was the problem. Need to fix overlaidEvt using context run and lb
210  // number
211  overlaidEvt->setRunNumber(evtID.run_number());
212  overlaidEvt->setLumiBlock(evtID.lumi_block());
213  overlaidEvt->setEventNumber(evtID.event_number());
214  overlaidEvt->setBCID(evtID.bunch_crossing_id());
215  overlaidEvt->setTimeStamp(evtID.time_stamp());
216  overlaidEvt->setTimeStampNSOffset(evtID.time_stamp_ns_offset());
217  // Set beam spot info
219  if (!beamSpotHandle.isValid()) {
220  ATH_MSG_ERROR("Beam spot information not valid");
221  return StatusCode::FAILURE;
222  }
223 
224  overlaidEvt->setBeamPos(beamSpotHandle->beamPos()[Amg::x],
225  beamSpotHandle->beamPos()[Amg::y],
226  beamSpotHandle->beamPos()[Amg::z]);
227  overlaidEvt->setBeamPosSigma(beamSpotHandle->beamSigma(0),
228  beamSpotHandle->beamSigma(1),
229  beamSpotHandle->beamSigma(2));
230  overlaidEvt->setBeamPosSigmaXY(beamSpotHandle->beamSigmaXY());
231  overlaidEvt->setBeamTiltXZ(beamSpotHandle->beamTilt(0));
232  overlaidEvt->setBeamTiltYZ(beamSpotHandle->beamTilt(1));
233  overlaidEvt->setBeamStatus(beamSpotHandle->beamStatus());
234 
235  // Pileup container
237  ATH_CHECK(puCont.record(std::make_unique<xAOD::EventInfoContainer>(),
238  std::make_unique<xAOD::EventInfoAuxContainer>()));
239 
240  // Get crossing number
241  m_beamInt->selectT0(evtID.run_number(), evtID.event_number());
242  overlaidEvt->setBCID(m_beamInt->getCurrentT0BunchCrossing());
243 
244  // Set simulation bit
245  overlaidEvt->setEventTypeBitmask(hsEvt->eventTypeBitmask() |
247 
248  // Set properties
249  bool sf_updated = false;
250  float lumi_sf = m_beamLumi->scaleFactor(evtID.run_number(),
251  evtID.lumi_block(), sf_updated);
252  float cur_avg_mu = lumi_sf * m_avgMu;
253  overlaidEvt->setAverageInteractionsPerCrossing(cur_avg_mu);
254  overlaidEvt->setActualInteractionsPerCrossing(m_beamInt->normFactor(0) *
255  cur_avg_mu);
256 
257  // Trace
258  if (m_writeTrace) {
259  std::format_to(trace,
260  "Idx: {} Run: {} LB: {} EVT: {} "
261  "HS ID: {}\n",
262  ctx.evt(), evtID.run_number(), evtID.lumi_block(),
263  evtID.event_number(), m_lowptMBSvc->get_hs_id(ctx));
264  auto bunch_pattern =
265  rv::closed_iota(m_earliestDeltaBC.value(), m_latestDeltaBC.value()) |
267  [this](int bc) { return int(m_beamInt->normFactor(bc)); }) |
268 #if RANGE_V3_VERSION >= 1200
269  rv::chunk_by(std::equal_to{}) |
270 #else
271  rv::group_by(std::equal_to{}) |
272 #endif
273  rv::transform([](const auto& rng) {
274  return std::format("{}{}", rng.size(), rng[0] == 0 ? 'E' : 'F');
275  }) |
276  ranges::to<std::vector<std::string>>;
277  // Manual join using std::ostringstream as std::format does not support ranges
278  std::string joined_pattern;
279  for (size_t i = 0; i < bunch_pattern.size(); ++i) {
280  joined_pattern += bunch_pattern[i];
281  if (i + 1 < bunch_pattern.size()) {
282  joined_pattern += " ";
283  }
284  }
285 
286  std::format_to(trace,
287  "mu = {}, central BCID = {}, bunch pattern = [{}]\n",
288  cur_avg_mu, m_beamInt->getCurrentT0BunchCrossing(),
289  joined_pattern);
290  }
291  // Copy subevents
292  if (!hsEvt->subEvents().empty()) {
293  for (const SubEvent& se : hsEvt->subEvents()) {
294  addSubEvent(overlaidEvt.ptr(), se, puCont.ptr(), m_evtInfoContKey.key(),
295  evtStore().get());
296  }
297  } else {
298  // if no subevents, add original event
299  addSubEvent(overlaidEvt.ptr(), hsEvt.get(), 0, xAOD::EventInfo::Signal,
300  puCont.ptr(), m_evtInfoContKey.key(), evtStore().get());
301  }
302 
303  // Initialize MinbiasSvcs
304  if (m_fracLowPt != 0) {
305  ATH_CHECK(m_lowptMBSvc->beginHardScatter(ctx));
306  }
307  if (m_fracHighPt != 0) {
308  ATH_CHECK(m_highptMBSvc->beginHardScatter(ctx));
309  }
310  if (m_numCavern != 0) {
311  ATH_CHECK(m_cavernMBSvc->beginHardScatter(ctx));
312  }
313  if (m_numBeamHalo != 0) {
314  ATH_CHECK(m_beamhaloMBSvc->beginHardScatter(ctx));
315  }
316  if (m_numBeamGas != 0) {
317  ATH_CHECK(m_beamgasMBSvc->beginHardScatter(ctx));
318  }
319 
320  std::uint32_t central_bcid = overlaidEvt->bcid();
321  std::vector<std::uint32_t> bcid{};
322  bcid.reserve(m_latestDeltaBC - m_earliestDeltaBC + 1);
323 
324  for (int bc = m_earliestDeltaBC; bc <= m_latestDeltaBC; ++bc) {
325  bcid.push_back(get_BCID(bc, central_bcid));
326  }
327 
328  // Setup tools
329  for (auto&& tool : m_puTools) {
330  // Reset filter -- Don't know if this is necessary
331  tool->resetFilter();
332  }
333 
334  // Now add the events
335  std::uint64_t low_pt_count = 0;
336  std::uint64_t high_pt_count = 0;
337  std::uint64_t cavern_count = 0;
338  std::uint64_t beam_halo_count = 0;
339  std::uint64_t beam_gas_count = 0;
341  for (int bc = m_earliestDeltaBC; bc <= m_latestDeltaBC; ++bc) {
342  if (m_beamInt->normFactor(bc) == 0.) {
343  // skip empty bunch crossings
344  continue;
345  }
346  std::vector<std::uint64_t> subevts_vec{};
347  if (m_fracLowPt != 0) {
348  if (m_writeTrace) {
349  std::format_to(trace, "\tBC {:03} : LOW PT {} ", bc,
350  m_lowptMBSvc->getNumForBunch(ctx, bc));
351  }
352  for (std::size_t i = 0; i < m_lowptMBSvc->getNumForBunch(ctx, bc); ++i) {
353  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_lowptMBSvc,
354  PUType::MinimumBias, bc, ctx, low_pt_count,
355  subevts_vec));
356  ++low_pt_count;
357  }
358  }
359  if (m_fracHighPt != 0) {
360  if (m_writeTrace) {
361  std::format_to(trace, "HIGH PT {} | ",
362  m_highptMBSvc->getNumForBunch(ctx, bc));
363  }
364  for (std::size_t i = 0; i < m_highptMBSvc->getNumForBunch(ctx, bc); ++i) {
365  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_highptMBSvc,
366  PUType::HighPtMinimumBias, bc, ctx, high_pt_count,
367  subevts_vec));
368  ++high_pt_count;
369  }
370  }
371  if (m_numCavern != 0) {
372  if (m_writeTrace) {
373  std::format_to(trace, "CAVERN {} | ",
374  m_cavernMBSvc->getNumForBunch(ctx, bc));
375  }
376  for (std::size_t i = 0; i < m_cavernMBSvc->getNumForBunch(ctx, bc); ++i) {
377  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_cavernMBSvc,
378  PUType::Cavern, bc, ctx, cavern_count,
379  subevts_vec));
380  ++cavern_count;
381  }
382  }
383  if (m_numBeamHalo != 0) {
384  if (m_writeTrace) {
385  std::format_to(trace, "BEAM HALO {} | ",
386  m_beamhaloMBSvc->getNumForBunch(ctx, bc));
387  }
388  for (std::size_t i = 0; i < m_beamhaloMBSvc->getNumForBunch(ctx, bc);
389  ++i) {
390  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_beamhaloMBSvc,
391  PUType::HaloGas, bc, ctx, beam_halo_count,
392  subevts_vec));
393  ++beam_halo_count;
394  }
395  }
396  if (m_numBeamGas != 0) {
397  if (m_writeTrace) {
398  std::format_to(trace, "BEAM GAS {} | ",
399  m_beamgasMBSvc->getNumForBunch(ctx, bc));
400  }
401  for (std::size_t i = 0; i < m_beamgasMBSvc->getNumForBunch(ctx, bc);
402  ++i) {
403  ATH_CHECK(add_subevt(bcid, overlaidEvt, puCont, m_beamgasMBSvc,
404  PUType::HaloGas, bc, ctx, beam_gas_count,
405  subevts_vec));
406  ++beam_gas_count;
407  }
408  }
409  if (m_writeTrace) {
410  std::format_to(trace, "TOTAL {} | HASH {:08X}\n", subevts_vec.size(),
411  xxh3::hash64(subevts_vec));
412  }
413  }
414  if (m_writeTrace) {
415  std::format_to(trace, "\n");
416  m_pileupTrace.print(trace_buf);
417  }
418 
419  for (auto&& tool : m_puTools) {
420  try {
421  ATH_CHECK(tool->processAllSubEvents(ctx));
422  } catch (const std::exception& e) {
423  ATH_MSG_ERROR("Caught exception running " << tool.name() << ": "
424  << e.what());
425  return StatusCode::FAILURE;
426  }
427  // Propagate filter result
428  if (!tool->filterPassed()) {
429  setFilterPassed(false);
430  }
431  }
432  ATH_MSG_DEBUG(std::format("***** Took {:%OMm %OSs} to process all subevents",
434  //
435  // Save hash (direct copy from PileUpEventLoopMgr)
436  PileUpHashHelper pileUpHashHelper;
437  pileUpHashHelper.addToHashSource(overlaidEvt.cptr());
438  ATH_MSG_VERBOSE("Pile-up hash source:" << pileUpHashHelper.hashSource());
439 
440  // Calculate and set hash
441  uuid_t pileUpHash;
442  pileUpHashHelper.calculateHash(pileUpHash);
443  overlaidEvt->setPileUpMixtureID(
445  ATH_MSG_DEBUG("PileUpMixtureID = " << overlaidEvt->pileUpMixtureID());
446 
447  setFilterPassed(true); // if got here, assume that means algorithm passed
448  if (m_fracLowPt != 0) {
449  ATH_CHECK(m_lowptMBSvc->endHardScatter(ctx));
450  }
451  if (m_fracHighPt != 0) {
452  ATH_CHECK(m_highptMBSvc->endHardScatter(ctx));
453  }
454  if (m_numCavern != 0) {
455  ATH_CHECK(m_cavernMBSvc->endHardScatter(ctx));
456  }
457  if (m_numBeamHalo != 0) {
458  ATH_CHECK(m_beamhaloMBSvc->endHardScatter(ctx));
459  }
460  if (m_numBeamGas != 0) {
461  ATH_CHECK(m_beamgasMBSvc->endHardScatter(ctx));
462  }
463  return StatusCode::SUCCESS;
464 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode PileUpMTAlg::finalize ( )
overridevirtual

Definition at line 175 of file PileUpMTAlg.cxx.

175  {
176  ATH_MSG_DEBUG("Finalizing " << name() << "...");
177  //
178  // Things that happen once at the end of the event loop go here
179  //
180 
181  return StatusCode::SUCCESS;
182 }

◆ get_BCID()

unsigned int PileUpMTAlg::get_BCID ( int  bc,
unsigned int  central_BCID 
) const
inlineprivate

Definition at line 150 of file PileUpMTAlg.h.

150  {
151  constexpr int maxBCPerOrbit = 3564; // FIXME may need update
152  return static_cast<unsigned int>((bc + static_cast<int>(central_BCID)) %
153  maxBCPerOrbit);
154  }

◆ get_ei()

StatusCode PileUpMTAlg::get_ei ( StoreGateSvc sg,
std::unique_ptr< const xAOD::EventInfo > &  ei,
std::unique_ptr< xAOD::EventAuxInfo > &  eiAux,
bool  pileup = false 
) const
private

Definition at line 44 of file PileUpMTAlg.cxx.

47  {
48  std::string key = pileup ? "EventInfo" : "HSEventInfo";
49  auto newEi = std::make_unique<xAOD::EventInfo>();
50  auto eiAux = std::make_unique<xAOD::EventAuxInfo>();
51  newEi->setStore(eiAux.get());
52  SG::ReadHandle<xAOD::EventInfo> ei_h(key, sg.name());
53  const xAOD::EventInfo* ei = ei_h.get();
54  if (ei != nullptr) {
55  *newEi = *ei;
56  } else {
57  ATH_MSG_ERROR("Couldn't find xAOD::EventInfo. " << sg.name());
58  ATH_MSG_ERROR(sg.dump());
59  return StatusCode::FAILURE;
60  }
61  // Use attribute list if EventInfo doesn't have event numbers set
62  if (newEi->eventNumber() == 0) {
63  const auto* attr_list_p = sg.tryConstRetrieve<AthenaAttributeList>("Input");
64  if (attr_list_p != nullptr) {
65  if (attr_list_p->size() <= 6) {
66  ATH_MSG_WARNING("Read Input attribute list but size <= 6");
67  } else {
68  const AthenaAttributeList& attr_list = *attr_list_p;
69  const auto runNum = attr_list["RunNumber"].data<unsigned>();
70  const auto evtNum = attr_list["EventNumber"].data<unsigned long long>();
71  const auto lbNum = attr_list["LumiBlockN"].data<unsigned>();
72  newEi->setRunNumber(runNum);
73  newEi->setLumiBlock(lbNum);
74  newEi->setEventNumber(evtNum);
75  }
76  } else {
78  "Could not read Input attribute list and EventInfo has no event "
79  "number");
80  }
81  }
82  newEi->setEvtStore(&sg);
83  ei_ = std::move(newEi);
84  ei_aux_ = std::move(eiAux);
85  return StatusCode::SUCCESS;
86 }

◆ initialize()

StatusCode PileUpMTAlg::initialize ( )
overridevirtual

uncomment and implement methods as required

Definition at line 116 of file PileUpMTAlg.cxx.

116  {
117  using namespace std::chrono;
118  ATH_MSG_DEBUG("Initializing " << name() << "...");
119  if (m_writeTrace) {
120  std::string filename = std::format("pileup_trace_skipping-{}_{:%Y-%m-%dT%H%M}.txt",
121  m_skippedHSEvents.value(),
123  if (!m_pileupTrace.init(filename)) {
124  ATH_MSG_ERROR("Cannot append to file " << filename);
125  return StatusCode::FAILURE;
126  }
127  }
128  ATH_CHECK(m_skipEventIdxSvc.retrieve());
129  ATH_CHECK(m_rngSvc.retrieve());
130  if (m_fracLowPt != 0) {
131  ATH_CHECK(m_lowptMBSvc.retrieve());
132  }
133  if (m_fracHighPt != 0) {
134  ATH_CHECK(m_highptMBSvc.retrieve());
135  }
136  if (m_numCavern != 0) {
137  ATH_CHECK(m_cavernMBSvc.retrieve());
138  }
139  if (m_numBeamGas != 0) {
140  ATH_CHECK(m_beamgasMBSvc.retrieve());
141  }
142  if (m_numBeamHalo != 0) {
143  ATH_CHECK(m_beamhaloMBSvc.retrieve());
144  }
145  ATH_CHECK(m_beamInt.retrieve());
146  ATH_CHECK(m_beamLumi.retrieve());
147  ATH_CHECK(m_puTools.retrieve());
148 
149  m_evtInfoContKey = "PileUpEventInfo";
151  ATH_CHECK(m_evtInfoContKey.initialize());
153 
154  // Trace skipped events
155  if (m_writeTrace) {
158  std::string trace_buf{};
159  auto trace = std::back_inserter(trace_buf);
160  for (; it != end; ++it) {
161  std::format_to(trace, "SKIPPING Run: {} LB: {} EVT: {} HS ID: {}\n",
162  it->runNum, it->lbNum, it->evtNum, it->evtIdx);
163  }
164  m_pileupTrace.print(trace_buf);
165  return StatusCode::SUCCESS;
166  };
167  if (!m_skiptrace_written) {
168  ATH_CHECK(m_skipEventIdxSvc->registerCallback(handler));
169  m_skiptrace_written = true;
170  }
171  }
172  return StatusCode::SUCCESS;
173 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool PileUpMTAlg::isClonable ( ) const
inlineoverridevirtual

Definition at line 84 of file PileUpMTAlg.h.

84 { return true; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/2]

atomic_output m_pileupTrace PileUpMTAlg::ATLAS_THREAD_SAFE {}
inlinestaticprivate

Definition at line 162 of file PileUpMTAlg.h.

◆ ATLAS_THREAD_SAFE [2/2]

bool m_skiptrace_written PileUpMTAlg::ATLAS_THREAD_SAFE = false
inlinestaticprivate

Definition at line 163 of file PileUpMTAlg.h.

◆ m_avgMu

Gaudi::Property<float> PileUpMTAlg::m_avgMu {this, "AverageMu", 200, "Average mu"}
private

Definition at line 118 of file PileUpMTAlg.h.

◆ m_BCSpacing

Gaudi::Property<int> PileUpMTAlg::m_BCSpacing
private
Initial value:
{this, "BCSpacing", 25,
"Bunch crossing spacing in ns"}

Definition at line 129 of file PileUpMTAlg.h.

◆ m_beamgasMBSvc

ServiceHandle<IMinbiasSvc> PileUpMTAlg::m_beamgasMBSvc
private
Initial value:
{
this, "BeamGasMinbiasSvc", "", "MinbiasSvc for beam gas background"}

Definition at line 105 of file PileUpMTAlg.h.

◆ m_beamhaloMBSvc

ServiceHandle<IMinbiasSvc> PileUpMTAlg::m_beamhaloMBSvc
private
Initial value:
{
this, "BeamHaloMinbiasSvc", "", "MinbiasSvc for beam halo background"}

Definition at line 103 of file PileUpMTAlg.h.

◆ m_beamInt

ServiceHandle<IBeamIntensity> PileUpMTAlg::m_beamInt
private
Initial value:
{this, "BeamIntSvc", "FlatBM",
"Beam intensity service"}

Definition at line 107 of file PileUpMTAlg.h.

◆ m_beamLumi

ServiceHandle<IBeamLuminosity> PileUpMTAlg::m_beamLumi
private
Initial value:
{
this, "BeamLumiSvc", "LumiProfileSvc", "Beam luminosity service"}

Definition at line 109 of file PileUpMTAlg.h.

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> PileUpMTAlg::m_beamSpotKey
private
Initial value:
{
this, "BeamSpotKey", "BeamSpotData", "Beam spot info key"}

Definition at line 140 of file PileUpMTAlg.h.

◆ m_cavernMBSvc

ServiceHandle<IMinbiasSvc> PileUpMTAlg::m_cavernMBSvc
private
Initial value:
{this, "CavernMinbiasSvc", "",
"MinbiasSvc for cavern background"}

Definition at line 101 of file PileUpMTAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_earliestDeltaBC

Gaudi::Property<int> PileUpMTAlg::m_earliestDeltaBC
private
Initial value:
{
this, "EarliestDeltaBC", -32,
"Earliest bunch crossing to consider (as delta)"}

Definition at line 131 of file PileUpMTAlg.h.

◆ m_evtInfoContKey

SG::WriteHandleKey<xAOD::EventInfoContainer> PileUpMTAlg::m_evtInfoContKey {""}
private

Definition at line 144 of file PileUpMTAlg.h.

◆ m_evtInfoKey

SG::WriteHandleKey<xAOD::EventInfo> PileUpMTAlg::m_evtInfoKey
private
Initial value:
{
this, "EventInfoKey", "OverlayEvent", "Overlay EventInfo key"}

Definition at line 142 of file PileUpMTAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fracHighPt

Gaudi::Property<float> PileUpMTAlg::m_fracHighPt
private
Initial value:
{this, "FracHighPt", 0.,
"Fraction of pileup that has high pT"}

Definition at line 121 of file PileUpMTAlg.h.

◆ m_fracLowPt

Gaudi::Property<float> PileUpMTAlg::m_fracLowPt
private
Initial value:
{this, "FracLowPt", 0.,
"Fraction of pileup that has low pT"}

Definition at line 119 of file PileUpMTAlg.h.

◆ m_highptMBSvc

ServiceHandle<IMinbiasSvc> PileUpMTAlg::m_highptMBSvc
private
Initial value:
{this, "HighPtMinbiasSvc", "",
"MinbiasSvc for high pT minbias"}

Definition at line 99 of file PileUpMTAlg.h.

◆ m_latestDeltaBC

Gaudi::Property<int> PileUpMTAlg::m_latestDeltaBC
private
Initial value:
{
this, "LatestDeltaBC", +6,
"Latest bunch crossing to consider (as delta)"}

Definition at line 134 of file PileUpMTAlg.h.

◆ m_lowptMBSvc

ServiceHandle<IMinbiasSvc> PileUpMTAlg::m_lowptMBSvc
private
Initial value:
{this, "LowPtMinbiasSvc", "",
"MinbiasSvc for low pT minbias"}

Other useful methods provided by base class are: evtStore() : ServiceHandle to main event data storegate inputMetaStore() : ServiceHandle to input metadata storegate outputMetaStore() : ServiceHandle to output metadata storegate histSvc() : ServiceHandle to output ROOT service (writing TObjects) currentFile() : TFile* to the currently open input file retrieveMetadata(...): See twiki.cern.ch/twiki/bin/view/AtlasProtected/AthAnalysisBase#ReadingMetaDataInCpp.

Definition at line 97 of file PileUpMTAlg.h.

◆ m_numBeamGas

Gaudi::Property<float> PileUpMTAlg::m_numBeamGas
private
Initial value:
{
this, "NumBeamGas", 0., "Number of beam gas background events per BC"}

Definition at line 125 of file PileUpMTAlg.h.

◆ m_numBeamHalo

Gaudi::Property<float> PileUpMTAlg::m_numBeamHalo
private
Initial value:
{
this, "NumBeamHalo", 0., "Number of beam halo background events per BC"}

Definition at line 127 of file PileUpMTAlg.h.

◆ m_numCavern

Gaudi::Property<float> PileUpMTAlg::m_numCavern
private
Initial value:
{
this, "NumCavern", 0., "Number of cavern background events per BC"}

Definition at line 123 of file PileUpMTAlg.h.

◆ m_puTools

ToolHandleArray<IPileUpTool> PileUpMTAlg::m_puTools
private
Initial value:
{
this, "PileUpTools", {}, "Pileup tools"}

Definition at line 113 of file PileUpMTAlg.h.

◆ m_rngSvc

ServiceHandle<IAthRNGSvc> PileUpMTAlg::m_rngSvc
private
Initial value:
{this, "RNGSvc", "AthRNGSvc/PileupRNG",
"RNG service for pile-up digitization"}

Definition at line 111 of file PileUpMTAlg.h.

◆ m_skipEventIdxSvc

ServiceHandle<ISkipEventIdxSvc> PileUpMTAlg::m_skipEventIdxSvc
private
Initial value:
{
this, "SkipEvtIdxSvc", "SkipEventIdxSvc",
"Skipped event index (run / lb num) provider"}

Definition at line 137 of file PileUpMTAlg.h.

◆ m_skippedHSEvents

Gaudi::Property<int> PileUpMTAlg::m_skippedHSEvents
private
Initial value:
{this, "SkippedHSEvents", 0,
"Number of skipped HS events"}

Definition at line 116 of file PileUpMTAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeTrace

Gaudi::Property<bool> PileUpMTAlg::m_writeTrace {this, "WriteTrace", false, "Write trace of pileup events used"}
private

Definition at line 115 of file PileUpMTAlg.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
vtune_athena.format
format
Definition: vtune_athena.py:14
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
PileUpMTAlg::m_numBeamHalo
Gaudi::Property< float > m_numBeamHalo
Definition: PileUpMTAlg.h:127
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
xAOD::EventInfo_v1::clearSubEvents
void clearSubEvents()
Clear all the currently held sub-events.
Definition: EventInfo_v1.cxx:647
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::EventInfo_v1::PileUpType
PileUpType
Enumerator describing the types of pileup events.
Definition: EventInfo_v1.h:264
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
PileUpMTAlg::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: PileUpMTAlg.h:140
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
PileUpMTAlg::m_latestDeltaBC
Gaudi::Property< int > m_latestDeltaBC
Definition: PileUpMTAlg.h:134
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
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
python.PileUpEventType.HighPtMinimumBias
int HighPtMinimumBias
Definition: PileUpEventType.py:7
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
handler
void handler(int sig)
signal handler
Definition: rmain.cxx:99
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
PileUpMTAlg::m_writeTrace
Gaudi::Property< bool > m_writeTrace
Definition: PileUpMTAlg.h:115
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
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
PileUpMTAlg::m_earliestDeltaBC
Gaudi::Property< int > m_earliestDeltaBC
Definition: PileUpMTAlg.h:131
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
Amg::z
@ z
Definition: GeoPrimitives.h:36
PileUpMTAlg::m_highptMBSvc
ServiceHandle< IMinbiasSvc > m_highptMBSvc
Definition: PileUpMTAlg.h:99
python.handimod.now
now
Definition: handimod.py:674
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
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.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
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
PileUpMTAlg::m_beamhaloMBSvc
ServiceHandle< IMinbiasSvc > m_beamhaloMBSvc
Definition: PileUpMTAlg.h:103
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:88
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
PileUpMTAlg::m_rngSvc
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition: PileUpMTAlg.h:111
dqt_zlumi_pandas.pileup
pileup
Definition: dqt_zlumi_pandas.py:175
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
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
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
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
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
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
hydjet.StoreGateSvc
StoreGateSvc
Definition: hydjet.minbias.pbpb5520.r12345.job.py:40
PileUpMTAlg::m_fracHighPt
Gaudi::Property< float > m_fracHighPt
Definition: PileUpMTAlg.h:121
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PileUpMTAlg::m_cavernMBSvc
ServiceHandle< IMinbiasSvc > m_cavernMBSvc
Definition: PileUpMTAlg.h:101
python.PileUpEventType.Cavern
int Cavern
Definition: PileUpEventType.py:5
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
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
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:44
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
PileUpMTAlg::m_puTools
ToolHandleArray< IPileUpTool > m_puTools
Definition: PileUpMTAlg.h:113
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
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::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
fitman.k
k
Definition: fitman.py:528
PileUpMTAlg::m_evtInfoKey
SG::WriteHandleKey< xAOD::EventInfo > m_evtInfoKey
Definition: PileUpMTAlg.h:142
ServiceHandle< ICondSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37