ATLAS Offline Software
Loading...
Searching...
No Matches
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.

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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114