Belle II Software  release-08-01-10
MaterialScanRay Class Reference

MaterialScan implementation to shoot one ray along a defined direction and record the Material as a function of travel depth. More...

#include <MaterialScan.h>

Inheritance diagram for MaterialScanRay:
Collaboration diagram for MaterialScanRay:

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. More...
 
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. More...
 
void fillValue (const std::string &name, double value, double steplength)
 Fill the recorded material budget into the corresponding histogram. More...
 

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. More...
 
double m_maxDepth {0}
 Maximum depth for each ray after which it will be stopped. More...
 
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. More...
 
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
 

Detailed Description

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 ( $\sum_i binwidth_i * bincontent_i$) is equal to the total number of X_0 seen.

Definition at line 239 of file MaterialScan.h.

Member Function Documentation

◆ fillValue()

void fillValue ( const std::string &  name,
double  value,
double  steplength 
)
private

Fill the recorded material budget into the corresponding histogram.

Parameters
nameName of the histogram
valueValue to store
steplengthThe Steplength which produced the value (for correct subsampling)

Definition at line 266 of file MaterialScan.cc.

◆ getHistogram()

TH1D * getHistogram ( const std::string &  name)
private

get histogram for a given name, create if needed.

Parameters
nameName of the histogram

Definition at line 254 of file MaterialScan.cc.

◆ getNRays()

int getNRays ( ) const
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.

Member Data Documentation

◆ m_maxDepth

double m_maxDepth {0}
private

Maximum depth for each ray after which it will be stopped.

0=no limit.

Definition at line 284 of file MaterialScan.h.

◆ m_sampleDepth

double m_sampleDepth
private

The ray length after which to sample.

Basically the bin width of the histogram

Definition at line 282 of file MaterialScan.h.

◆ m_scanDepth

double m_scanDepth {0}
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.


The documentation for this class was generated from the following files: