ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
G4ProfilingTools
src
VolumeTreeNavigator.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// //
7
// VolumeTreeNavigator.h //
8
// Class containing functions to allow a general //
9
// navigation of uniquely specified GEANT4 volumes //
10
// and collection of their tree patterns and locations. //
11
// //
12
// Written by Kevin Sapp //
13
// University of Pittsburgh //
14
// kcs34@pitt.edu //
15
// Last update 02.02.10 //
16
// //
17
// //
19
20
#ifndef VolumeTreeNavigator_H
21
#define VolumeTreeNavigator_H
22
23
#include <string>
24
#include <vector>
25
#include <stdarg.h>
26
27
#include "
AthenaBaseComps/AthMessaging.h
"
28
29
class
G4Step;
30
class
G4Track;
31
class
G4StepPoint;
32
class
G4TouchableHistory;
33
class
G4VPhysicalVolume;
34
35
typedef
std::pair<G4VPhysicalVolume*,int>
VolID
;
36
typedef
std::vector<VolID>
VolTree
;
37
typedef
VolTree::iterator
VolNav
;
38
39
class
VolumeTreeNavigator
:
public
AthMessaging
{
40
public
:
41
VolumeTreeNavigator
(
const
G4Step*);
42
43
void
SetDepthCutSimple
(
const
int
,
const
int
,
const
int
,
const
int
);
44
void
SetDepthCutDetail
(
const
char
*);
45
VolTree
Extract
();
46
bool
Ascend
(
int
levels = 1);
47
bool
Descend
(
int
levels = 1);
48
bool
KillProcesses
(
const
int
,
const
char
*, ...);
49
50
int
GetCurrentDepth
();
51
G4VPhysicalVolume*
GetVolume
(
int
rel = 0)
const
;
52
int
GetCopyNumber
(
int
rel = 0)
const
;
53
const
G4Track*
GetTrack
()
const
;
54
const
G4StepPoint*
GetPreStepPoint
()
const
;
55
const
G4StepPoint*
GetPostStepPoint
()
const
;
56
int
GetStepNumber
()
const
;
57
const
VolTree
&
GetHistory
()
const
;
58
int
GetFullDepth
()
const
;
59
60
private
:
61
G4Track*
m_track
;
62
G4StepPoint*
m_preStepPoint
;
63
G4StepPoint*
m_postStepPoint
;
64
const
G4TouchableHistory*
m_preHistory
;
65
int
m_preDepth
,
m_stepNo
;
66
67
VolTree
m_history
;
68
VolNav
m_h_end
;
69
VolNav
m_h_nav
;
70
};
71
72
template
<
class
T>
73
inline
std::string
stringify
(T obj)
74
{
75
std::ostringstream
ss
;
76
ss
<< obj;
77
return
ss
.str();
78
}
79
80
template
<
class
T>
81
inline
std::string
cleanstr
(T obj)
82
{
83
std::string s =
stringify
(std::move(obj));
84
std::string::size_type col = s.find_first_of(
":"
);
85
while
(col != std::string::npos) {
86
(s.substr(col,2) ==
"::"
) ? s.replace(col,2,
"_"
) : s.replace(col,1,
"-"
);
87
col = s.find_first_of(
":"
);
88
}
89
std::string::size_type
sp
= s.find_first_of(
" "
);
90
while
(
sp
!= std::string::npos) {
91
s.erase(
sp
,1);
92
sp
= s.find_first_of(
" "
);
93
}
94
return
s;
95
}
96
97
#include "
VolumeTreeNavigator.icc
"
98
#endif
AthMessaging.h
sp
static Double_t sp
Definition
LArPhysWaveHECTool.cxx:37
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
VolTree
std::vector< VolID > VolTree
Definition
VolumeTreeNavigator.h:36
VolID
std::pair< G4VPhysicalVolume *, int > VolID
Definition
VolumeTreeNavigator.h:35
cleanstr
std::string cleanstr(T obj)
Definition
VolumeTreeNavigator.h:81
VolNav
VolTree::iterator VolNav
Definition
VolumeTreeNavigator.h:37
stringify
std::string stringify(T obj)
Definition
VolumeTreeNavigator.h:73
VolumeTreeNavigator.icc
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
VolumeTreeNavigator::KillProcesses
bool KillProcesses(const int, const char *,...)
Definition
VolumeTreeNavigator.cxx:164
VolumeTreeNavigator::m_stepNo
int m_stepNo
depth of volume tree, step number
Definition
VolumeTreeNavigator.h:65
VolumeTreeNavigator::GetStepNumber
int GetStepNumber() const
VolumeTreeNavigator::Ascend
bool Ascend(int levels=1)
Definition
VolumeTreeNavigator.cxx:137
VolumeTreeNavigator::m_h_end
VolNav m_h_end
specifies cut termination in history
Definition
VolumeTreeNavigator.h:68
VolumeTreeNavigator::GetVolume
G4VPhysicalVolume * GetVolume(int rel=0) const
VolumeTreeNavigator::GetPostStepPoint
const G4StepPoint * GetPostStepPoint() const
VolumeTreeNavigator::GetTrack
const G4Track * GetTrack() const
VolumeTreeNavigator::GetCopyNumber
int GetCopyNumber(int rel=0) const
VolumeTreeNavigator::m_history
VolTree m_history
full volume history, cast as const after preparation
Definition
VolumeTreeNavigator.h:67
VolumeTreeNavigator::SetDepthCutDetail
void SetDepthCutDetail(const char *)
Definition
VolumeTreeNavigator.cxx:92
VolumeTreeNavigator::m_preDepth
int m_preDepth
Definition
VolumeTreeNavigator.h:65
VolumeTreeNavigator::Descend
bool Descend(int levels=1)
Definition
VolumeTreeNavigator.cxx:150
VolumeTreeNavigator::m_track
G4Track * m_track
current track
Definition
VolumeTreeNavigator.h:61
VolumeTreeNavigator::Extract
VolTree Extract()
Definition
VolumeTreeNavigator.cxx:126
VolumeTreeNavigator::GetHistory
const VolTree & GetHistory() const
VolumeTreeNavigator::m_preHistory
const G4TouchableHistory * m_preHistory
touchable history containing current volume's history
Definition
VolumeTreeNavigator.h:64
VolumeTreeNavigator::SetDepthCutSimple
void SetDepthCutSimple(const int, const int, const int, const int)
Definition
VolumeTreeNavigator.cxx:69
VolumeTreeNavigator::VolumeTreeNavigator
VolumeTreeNavigator(const G4Step *)
Definition
VolumeTreeNavigator.cxx:35
VolumeTreeNavigator::m_preStepPoint
G4StepPoint * m_preStepPoint
volume/process/etc.
Definition
VolumeTreeNavigator.h:62
VolumeTreeNavigator::m_postStepPoint
G4StepPoint * m_postStepPoint
volume/process/etc.
Definition
VolumeTreeNavigator.h:63
VolumeTreeNavigator::GetCurrentDepth
int GetCurrentDepth()
VolumeTreeNavigator::m_h_nav
VolNav m_h_nav
VolTree iterator with no access below cut.
Definition
VolumeTreeNavigator.h:69
VolumeTreeNavigator::GetPreStepPoint
const G4StepPoint * GetPreStepPoint() const
VolumeTreeNavigator::GetFullDepth
int GetFullDepth() const
Generated on
for ATLAS Offline Software by
1.17.0