ATLAS Offline Software
Functions
GenBase.cxx File Reference
#include "GeneratorModules/GenBase.h"
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/DataSvc.h"
#include <fstream>
Include dependency graph for GenBase.cxx:

Go to the source code of this file.

Functions

McEventCollection *GenBase::events ATLAS_NOT_CONST_THREAD_SAFE ()
 Access the current event's McEventCollection. More...
 

Function Documentation

◆ ATLAS_NOT_CONST_THREAD_SAFE()

McEventCollection* GenBase::events ATLAS_NOT_CONST_THREAD_SAFE ( )

Access the current event's McEventCollection.

Definition at line 28 of file GenBase.cxx.

28  {
29  // Make a new MC event collection if necessary
30  McEventCollection* mcevents = nullptr;
31  if (!evtStore()->contains<McEventCollection>(m_mcEventKey) && m_mkMcEvent) {
32  ATH_MSG_DEBUG("Creating new McEventCollection in the event store");
33  mcevents = new McEventCollection();
34  if (evtStore()->record(mcevents, m_mcEventKey).isFailure())
35  ATH_MSG_ERROR("Failed to record a new McEventCollection");
36  }
37  else {
38  const McEventCollection* mecc = 0;
39 
40  if (evtStore()->retrieve (mecc, m_mcEventKey).isFailure())
41  ATH_MSG_ERROR("Failed to retrieve McEventCollection");
42 
43  mcevents = const_cast<McEventCollection*> (&(*mecc));
44  }
45 
46  return mcevents;
47 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
McEventCollection
McEventCollection
Definition: GeneratorObjectsTPCnv.cxx:60
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33