ATLAS Offline Software
Loading...
Searching...
No Matches
TestActionEHist.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6// //
7// TestActionEHist.h //
8// Code for ROOT output (filename selected in code) //
9// of histograms of the initial kinetic energy //
10// (from truth) of specified particles, by volume. //
11// //
12// Written by Kevin Sapp //
13// University of Pittsburgh //
14// kcs34@pitt.edu //
15// Last update 01.26.10 //
16// //
17// //
19
20#ifndef G4PROFILINGTOOLS_TestActionEHist_H
21#define G4PROFILINGTOOLS_TestActionEHist_H
22
23#include "VolumeTreeNavigator.h"
24
25#include <string>
26#include <vector>
27
28#include "G4UserTrackingAction.hh"
29#include "G4UserRunAction.hh"
30#include "G4UserSteppingAction.hh"
31
32class G4Run;
33class G4Event;
34class G4Step;
35class G4String;
36class G4VPhysicalVolume;
37class G4TouchableHistory;
38class Algorithm;
39class IMessageSvc;
40class TFile;
41
42
43namespace G4UA
44{
45
47 public G4UserTrackingAction, public G4UserRunAction, public G4UserSteppingAction
48 {
49
50 public:
51
52 struct Config
53 {
54 int dCALO=2;
55 int dBeam=2;
56 int dIDET=2;
57 int dMUON=2;
58 int maxhists=1000;
59 int maxdirs=1000;
60 std::string dDetail="";
61 std::string name="default.root";
62 };
63
65 virtual void PreUserTrackingAction(const G4Track*) override;
66 virtual void PostUserTrackingAction(const G4Track*) override;
67 virtual void BeginOfRunAction(const G4Run*) override;
68 virtual void EndOfRunAction(const G4Run*) override;
69 virtual void UserSteppingAction(const G4Step*) override;
70 private:
72
73 TFile* m_world;
74
76
77 std::string m_p_tag;
78
79 std::vector<std::string> m_trajectory;
80
81 void BuildHists (
82 const std::string& vol_tag,
83 const std::string& part_tag,
84 int& hLeft,
85 double xfill = -1,
86 double yfill = -1,
87 const int nbins = 3000,
88 const int binsize = 1);
89
90 bool BuildDirs (
91 const std::string& vol_tag,
92 const std::string& dirTitle,
93 int& dLeft);
94
95
96
97 }; // class TestActionEHist
98
99} // namespace G4UA
100
101#endif // #define G4PROFILINGTOOLS_TestActionEHist_H
TestActionEHist(const Config &config)
Config m_config
holds the python configuration
void BuildHists(const std::string &vol_tag, const std::string &part_tag, int &hLeft, double xfill=-1, double yfill=-1, const int nbins=3000, const int binsize=1)
Size of bins in histogram, in MeV.
virtual void EndOfRunAction(const G4Run *) override
bool BuildDirs(const std::string &vol_tag, const std::string &dirTitle, int &dLeft)
Remaining directories to create.
virtual void PreUserTrackingAction(const G4Track *) override
std::string m_p_tag
Used to specify current particle in tracking.
bool m_firstStep
Flag indicating whether step is first in current volume.
TFile * m_world
File in which to store neutron & electron info.
std::vector< std::string > m_trajectory
Used to store volume names which the current track has entered.
virtual void UserSteppingAction(const G4Step *) override
virtual void PostUserTrackingAction(const G4Track *) override
virtual void BeginOfRunAction(const G4Run *) override
std::string dDetail
Path used to set detailed depth cuts.
int dMUON
Used for depth limits applied in jobOptions.
int maxdirs
Used to set maximum number of histograms/directories from jobOptions.
std::string name
Name of root output file.