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 31 of file GenBase.cxx.

31  {
32  // Make a new MC event collection if necessary
33  McEventCollection* mcevents = nullptr;
34  if (!evtStore()->contains<McEventCollection>(m_mcEventKey) && m_mkMcEvent) {
35  ATH_MSG_DEBUG("Creating new McEventCollection in the event store");
36  mcevents = new McEventCollection();
37  if (evtStore()->record(mcevents, m_mcEventKey).isFailure())
38  ATH_MSG_ERROR("Failed to record a new McEventCollection");
39  }
40  else {
41  const McEventCollection* mecc = 0;
42 
43  if (evtStore()->retrieve (mecc, m_mcEventKey).isFailure())
44  ATH_MSG_ERROR("Failed to retrieve McEventCollection");
45 
46  mcevents = const_cast<McEventCollection*> (&(*mecc));
47  }
48 
49  return mcevents;
50 }
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