Belle II Software development
|
MaterialScan implementation to shoot one ray along a defined direction and record the Material as a function of travel depth. More...
#include <MaterialScan.h>
Public Member Functions | |
MaterialScanRay (TFile *rootFile, const G4ThreeVector &origin, const G4ThreeVector &dir, double opening, int count, double sampleDepth, double maxDepth, bool splitByMaterials, const std::vector< std::string > &ignoredMaterials) | |
Construct a new instance and set all parameters. | |
int | getNRays () const override |
Return the number of rays. | |
void | UserSteppingAction (const G4Step *step) override |
Record the material budget for each step of the particles. | |
bool | createNext (G4ThreeVector &origin, G4ThreeVector &direction) override |
Implement shooting along the ray. | |
std::string | getName () const |
Return the name of the scan. | |
Protected Member Functions | |
bool | checkStep (const G4Step *step) |
check for stuck tracks by looking at the step length | |
Protected Attributes | |
TFile * | m_rootFile |
Pointer to the root file for the histograms. | |
std::string | m_name |
Name of the scan, will be prefixed to all histogram names. | |
std::string | m_axisLabel |
Labels for the coordinate axes. | |
Private Member Functions | |
TH1D * | getHistogram (const std::string &name) |
get histogram for a given name, create if needed. | |
void | fillValue (const std::string &name, double value, double steplength) |
Fill the recorded material budget into the corresponding histogram. | |
Private Attributes | |
std::set< std::string > | m_ignoredMaterials |
Materials ignored when scanning. | |
std::map< std::string, std::unique_ptr< TH1D > > | m_regions |
Map holding pointers to all created histograms. | |
G4ThreeVector | m_origin |
Origin of the scan. | |
G4ThreeVector | m_dir |
Direction of the ray. | |
double | m_opening |
Opening angle in radian. | |
double | m_sampleDepth |
The ray length after which to sample. | |
double | m_maxDepth {0} |
Maximum depth for each ray after which it will be stopped. | |
double | m_curDepth {0} |
Current depth of the current ray. | |
double | m_scanDepth {0} |
The first ray does not record any material but just checks for the maximum useful depth to not get a plot which contains the PXD at the front and then continues for 500 more cm without any content. | |
int | m_count |
Amount of rays to shoot. | |
int | m_curRay { -1} |
Current Ray number: 0 = scan for maximum depth, 1..N = record materials. | |
bool | m_splitByMaterials |
If true Split by materials instead of regions. | |
int | m_zeroSteps {0} |
Count the number of steps with (almost) zero length. | |
Static Private Attributes | |
static constexpr double | c_zeroTolerance = 1e-6 |
maximum Step length to be considered zero | |
static constexpr int | c_maxZeroStepsNudge = 10 |
maximum number of consecutive zero steps before nudging the track along | |
static constexpr int | c_maxZeroStepsKill = 20 |
maximum number of consecutive zero steps before killing the track | |
MaterialScan implementation to shoot one ray along a defined direction and record the Material as a function of travel depth.
In contrast to the other implementations this produces a 1D histogram per region (plus a cumulative one) which contains the X_0 per bin so that the integral of the histogram ( ) is equal to the total number of X_0 seen.
Definition at line 239 of file MaterialScan.h.
|
inline |
Construct a new instance and set all parameters.
Definition at line 242 of file MaterialScan.h.
|
protectedinherited |
check for stuck tracks by looking at the step length
Definition at line 44 of file MaterialScan.cc.
|
overridevirtual |
Implement shooting along the ray.
Implements MaterialScanBase.
Definition at line 215 of file MaterialScan.cc.
|
private |
Fill the recorded material budget into the corresponding histogram.
name | Name of the histogram |
value | Value to store |
steplength | The Steplength which produced the value (for correct subsampling) |
Definition at line 266 of file MaterialScan.cc.
|
private |
get histogram for a given name, create if needed.
name | Name of the histogram |
Definition at line 254 of file MaterialScan.cc.
|
inlineinherited |
|
inlineoverridevirtual |
Return the number of rays.
We have one extra ray to scan the maximum depth
Implements MaterialScanBase.
Definition at line 254 of file MaterialScan.h.
|
override |
Record the material budget for each step of the particles.
Definition at line 282 of file MaterialScan.cc.
|
staticconstexprprivateinherited |
maximum number of consecutive zero steps before killing the track
Definition at line 71 of file MaterialScan.h.
|
staticconstexprprivateinherited |
maximum number of consecutive zero steps before nudging the track along
Definition at line 69 of file MaterialScan.h.
|
staticconstexprprivateinherited |
maximum Step length to be considered zero
Definition at line 67 of file MaterialScan.h.
|
protectedinherited |
Labels for the coordinate axes.
Definition at line 64 of file MaterialScan.h.
|
private |
Amount of rays to shoot.
Definition at line 294 of file MaterialScan.h.
|
private |
Current depth of the current ray.
Definition at line 286 of file MaterialScan.h.
|
private |
Current Ray number: 0 = scan for maximum depth, 1..N = record materials.
Definition at line 296 of file MaterialScan.h.
|
private |
Direction of the ray.
Definition at line 278 of file MaterialScan.h.
|
private |
Materials ignored when scanning.
Definition at line 272 of file MaterialScan.h.
|
private |
Maximum depth for each ray after which it will be stopped.
0=no limit.
Definition at line 284 of file MaterialScan.h.
|
protectedinherited |
Name of the scan, will be prefixed to all histogram names.
Definition at line 62 of file MaterialScan.h.
|
private |
Opening angle in radian.
Definition at line 280 of file MaterialScan.h.
|
private |
Origin of the scan.
Definition at line 276 of file MaterialScan.h.
|
private |
Map holding pointers to all created histograms.
Definition at line 274 of file MaterialScan.h.
|
protectedinherited |
Pointer to the root file for the histograms.
Definition at line 60 of file MaterialScan.h.
|
private |
The ray length after which to sample.
Basically the bin width of the histogram
Definition at line 282 of file MaterialScan.h.
|
private |
The first ray does not record any material but just checks for the maximum useful depth to not get a plot which contains the PXD at the front and then continues for 500 more cm without any content.
This variable stores the maximum depth seen by this ray in non-ignored matierals
Definition at line 292 of file MaterialScan.h.
|
private |
If true Split by materials instead of regions.
Definition at line 298 of file MaterialScan.h.
|
privateinherited |
Count the number of steps with (almost) zero length.
Definition at line 73 of file MaterialScan.h.