#include <TestActionEHist.h>
|
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. More...
|
|
bool | BuildDirs (const std::string &vol_tag, const std::string &dirTitle, int &dLeft) |
| Remaining directories to create. More...
|
|
Definition at line 46 of file TestActionEHist.h.
◆ TestActionEHist()
G4UA::TestActionEHist::TestActionEHist |
( |
const Config & |
config | ) |
|
◆ BeginOfRunAction()
void G4UA::TestActionEHist::BeginOfRunAction |
( |
const G4Run * |
| ) |
|
|
overridevirtual |
◆ BuildDirs()
bool G4UA::TestActionEHist::BuildDirs |
( |
const std::string & |
vol_tag, |
|
|
const std::string & |
dirTitle, |
|
|
int & |
dLeft |
|
) |
| |
|
private |
Remaining directories to create.
- Parameters
-
vol_tag | Function to generate TDirectory objects Tag to identify object by volume |
dirTitle | Directory title |
Definition at line 180 of file TestActionEHist.cxx.
183 TDirectory* dExists = (TDirectory*)
gDirectory->FindObjectAny(vol_tag.c_str());
184 if (!dLeft && !dExists) {
return enter; }
186 dExists =
new TDirectoryFile(vol_tag.c_str(),
190 if (!dLeft) G4cout<<
"Last directory created"<<G4endl;
193 if (dExists) enter = (
bool)dExists->cd();
◆ BuildHists()
void G4UA::TestActionEHist::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 |
|
) |
| |
|
private |
Size of bins in histogram, in MeV.
- Parameters
-
vol_tag | Function to generate TH1-type histograms Tag to identify object by volume |
part_tag | Tag to identify object by particle |
hLeft | Amount of histogram space remaining, set by maxhists |
xfill | Parameter to fill histogram along x |
yfill | Paramteter to fill histogram along y |
nbins | Number of bins in histogram |
Definition at line 158 of file TestActionEHist.cxx.
163 (
TH1F*)
gDirectory->FindObjectAny((part_tag+
"_"+vol_tag+
"_hist").c_str());
164 if (!hLeft && !hExists) {
return; }
166 hExists =
new TH1F((part_tag+
"_"+vol_tag+
"_hist").c_str(),
167 (part_tag+
" KE in "+vol_tag).c_str(),
171 if (!hLeft) G4cout<<
"Last histogram reached"<<G4endl;
174 if (xfill >= 0 &&
weight >= 0) { hExists->Fill(xfill,
weight); }
175 else if (xfill >= 0) { hExists->Fill(xfill); }
◆ EndOfRunAction()
void G4UA::TestActionEHist::EndOfRunAction |
( |
const G4Run * |
| ) |
|
|
overridevirtual |
◆ PostUserTrackingAction()
void G4UA::TestActionEHist::PostUserTrackingAction |
( |
const G4Track * |
aTrack | ) |
|
|
overridevirtual |
◆ PreUserTrackingAction()
void G4UA::TestActionEHist::PreUserTrackingAction |
( |
const G4Track * |
aTrack | ) |
|
|
overridevirtual |
Definition at line 50 of file TestActionEHist.cxx.
55 G4ParticleDefinition* pDef = aTrack->GetDefinition();
56 const G4String& pName = pDef->GetParticleName();
57 const G4String& pSubType = pDef->GetParticleSubType();
58 if (pName ==
"neutron" || pName ==
"proton" ) {
m_p_tag = pName; }
59 else if (pSubType ==
"e" || pSubType ==
"pi" ) {
m_p_tag = pSubType; }
60 else {
m_p_tag = pDef->GetParticleType(); }
◆ UserSteppingAction()
void G4UA::TestActionEHist::UserSteppingAction |
( |
const G4Step * |
aStep | ) |
|
|
overridevirtual |
Definition at line 88 of file TestActionEHist.cxx.
101 if (currentTree.GetStepNumber() > 1) {
104 if ( *
it ==
stringify( currentTree.GetVolume()->GetName() ) ) {
129 currentTree.Ascend( currentTree.GetCurrentDepth() );
133 G4VPhysicalVolume*
pv = currentTree.GetVolume();
135 string thNoDau =
stringify(
pv->GetLogicalVolume()->GetNoDaughters());
136 int thRep = currentTree.GetCopyNumber();
139 string v_name = (thRep == 16969 ? thPV : thPV+
"_"+
stringify(thRep));
140 string p_name =
m_p_tag + ( currentTree.GetStepNumber() != 1 ?
"_entred" :
"_madein" );
141 string title = thNoDau+
" daughters, "+
stringify(currentTree.GetCurrentDepth())+
" from base";
144 if ( currentTree.GetStepNumber() == 1 || currentTree.GetCurrentDepth() == currentTree.GetFullDepth() ) {
147 if ( !currentTree.Descend() )
break;
◆ m_config
Config G4UA::TestActionEHist::m_config |
|
private |
◆ m_firstStep
bool G4UA::TestActionEHist::m_firstStep |
|
private |
Flag indicating whether step is first in current volume.
Definition at line 75 of file TestActionEHist.h.
◆ m_p_tag
std::string G4UA::TestActionEHist::m_p_tag |
|
private |
◆ m_trajectory
std::vector<std::string> G4UA::TestActionEHist::m_trajectory |
|
private |
Used to store volume names which the current track has entered.
Definition at line 79 of file TestActionEHist.h.
◆ m_world
TFile* G4UA::TestActionEHist::m_world |
|
private |
File in which to store neutron & electron info.
Definition at line 73 of file TestActionEHist.h.
The documentation for this class was generated from the following files:
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.