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

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