7#include "GaudiKernel/IDataProviderSvc.h"
8#include "GaudiKernel/INTupleSvc.h"
9#include "GaudiKernel/NTuple.h"
10#include "GaudiKernel/SmartDataPtr.h"
15#include "GaudiKernel/Bootstrap.h"
16#include "GaudiKernel/ISvcLocator.h"
17#include "GaudiKernel/IMessageSvc.h"
39 for(
unsigned int k=0; k<
eventSteps.size(); k++){
48 if(!
ntupleSvc()->writeRecord(
"/NTUPLES/FILE1/StepNtuple/10").isSuccess()){
59 theInfo.
dep=aStep->GetTotalEnergyDeposit();
60 theInfo.
time=aStep->GetPreStepPoint()->GetGlobalTime();
61 theInfo.
code=aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
62 G4ThreeVector pos=aStep->GetPreStepPoint()->GetPosition();
74 NTupleFilePtr file1(
ntupleSvc(),
"/NTUPLES/FILE1");
76 SmartDataPtr<NTuple::Directory>
77 ntdir(
ntupleSvc(),
"/NTUPLES/FILE1/StepNtuple");
80 ntdir =
ntupleSvc()->createDirectory(file1,
"StepNtuple");
86 NTuplePtr nt(
ntupleSvc(),
"/NTUPLES/FILE1/StepNtuple/10");
90 nt =
ntupleSvc()->book( ntdir.ptr(), 10, CLID_ColumnWiseTuple,
"G4 Step Ntuple" );
96 if( nt->addItem (
"NSteps",
m_nsteps,0, 50000).isFailure() ||
#define ATH_MSG_VERBOSE(x)
void setLevel(MSG::Level lvl)
Change the current logging level.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
virtual void EndOfEventAction(const G4Event *) override
NTuple::Array< float > m_pdgcode
virtual void BeginOfRunAction(const G4Run *) override
virtual void BeginOfEventAction(const G4Event *) override
the hooks for G4 UA handling
std::vector< stepdata > eventSteps
holds data extracted from steps
NTuple::Array< float > m_step_y
virtual void UserSteppingAction(const G4Step *) override
NTuple::Item< long > m_nsteps
handles for ntuple writing
NTuple::Array< float > m_time
NTuple::Array< float > m_step_x
NTuple::Array< float > m_step_z
NTuple::Array< float > m_dep
StepNtuple(const MSG::Level lvl=MSG::INFO)
Constructor with message level argument for AthMessaging.
=============================================================================
simple struct to hold step information