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

Specific implementation of MaterialScan to do Spherical scanning. More...

#include <MaterialScan.h>

Inheritance diagram for MaterialScanSpherical:
Collaboration diagram for MaterialScanSpherical:

Public Member Functions

 MaterialScanSpherical (TFile *rootFile, const G4ThreeVector &origin, const ScanParams &params, bool doCosTheta)
 Create a Spherical Scan object with the given parameters. More...
 
bool createNext (G4ThreeVector &origin, G4ThreeVector &direction) override
 Get the origin and direction for the next scan particle. More...
 
int getNRays () const override
 Return the number of rays in this scan.
 
void UserSteppingAction (const G4Step *step) override
 Record the material budget for each step of the particles.
 
std::string getName () const
 Return the name of the scan.
 

Protected Member Functions

void getRay (G4ThreeVector &origin, G4ThreeVector &direction) override
 Create a ray with the current parameter values according to a spherical distribution.
 
TH2D * getHistogram (const std::string &name)
 get histogram for a given name, create if needed. More...
 
void fillValue (const std::string &name, double value)
 Fill the recorded material budget into the corresponding histogram. More...
 
bool checkStep (const G4Step *step)
 check for stuck tracks by looking at the step length
 

Protected Attributes

G4ThreeVector m_origin
 Origin for the spherical scan.
 
bool m_doCosTheta
 Flag to indicate if polar-angular sampling is uniform in cos(theta) rather than theta.
 
ScanParams m_params
 Parameters for the scan.
 
double m_curU
 Current value of the parametetr u.
 
double m_stepU
 Stepsize for the parameter u.
 
double m_curV
 Current value of the parametetr v.
 
double m_stepV
 Stepsize for the parameter v.
 
double m_curDepth
 Tracklength of the current Ray.
 
std::map< std::string, std::unique_ptr< TH2D > > m_regions
 Map holding pointers to all created histograms.
 
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 Attributes

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

Specific implementation of MaterialScan to do Spherical scanning.

That is shooting rays from the origin with varying aximuth and polar angle.

Definition at line 164 of file MaterialScan.h.

Constructor & Destructor Documentation

◆ MaterialScanSpherical()

MaterialScanSpherical ( TFile *  rootFile,
const G4ThreeVector &  origin,
const ScanParams params,
bool  doCosTheta 
)
inline

Create a Spherical Scan object with the given parameters.

Parameters
rootFilepointer to the ROOT File containing the histograms
originOrigin for the spherical scan
paramsParameters of the scan
doCosTheta

Definition at line 172 of file MaterialScan.h.

172  :
173  MaterialScan2D(rootFile, "Spherical", doCosTheta ? "cos(#theta);#phi [deg]" : "#theta [deg];#phi [deg]", params), m_origin(origin),
174  m_doCosTheta(doCosTheta)
175  {
176  if (doCosTheta) {
179  if (m_params.minU > m_params.maxU) std::swap(m_params.minU, m_params.maxU);
181  m_curU = m_params.minU - m_stepU / 2.;
182  }
183  }
double m_stepU
Stepsize for the parameter u.
Definition: MaterialScan.h:150
MaterialScan2D(TFile *rootFile, const std::string &name, const std::string &axisLabel, const ScanParams &params)
Constructor.
Definition: MaterialScan.cc:78
double m_curU
Current value of the parametetr u.
Definition: MaterialScan.h:148
ScanParams m_params
Parameters for the scan.
Definition: MaterialScan.h:146
G4ThreeVector m_origin
Origin for the spherical scan.
Definition: MaterialScan.h:189
bool m_doCosTheta
Flag to indicate if polar-angular sampling is uniform in cos(theta) rather than theta.
Definition: MaterialScan.h:192
static const double deg
degree to radians
Definition: Unit.h:109
double maxU
Maximum u value to scan.
Definition: MaterialScan.h:93
int nU
Number of rays along u coordinate.
Definition: MaterialScan.h:87
double minU
Minimum u value to scan.
Definition: MaterialScan.h:91

Member Function Documentation

◆ createNext()

bool createNext ( G4ThreeVector &  origin,
G4ThreeVector &  direction 
)
overridevirtualinherited

Get the origin and direction for the next scan particle.

Parameters
[out]originOrigin of the next scan particle
[out]directionDirection of the next scan particle
Returns
false if the scan is finished

Implements MaterialScanBase.

Definition at line 97 of file MaterialScan.cc.

◆ fillValue()

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

Fill the recorded material budget into the corresponding histogram.

Parameters
nameName of the histogram
valueValue to store

Definition at line 138 of file MaterialScan.cc.

◆ getHistogram()

TH2D * getHistogram ( const std::string &  name)
protectedinherited

get histogram for a given name, create if needed.

Parameters
nameName of the histogram

Definition at line 125 of file MaterialScan.cc.


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