ATLAS Offline Software
StepHistogram.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4DEBUGGINGTOOLS_StepHistogram_H
6 #define G4DEBUGGINGTOOLS_StepHistogram_H
7 
8 
9 
10 
11 
12 //G4
13 #include "G4UserEventAction.hh"
14 #include "G4UserSteppingAction.hh"
15 #include "G4UserRunAction.hh"
16 #include "G4String.hh"
17 
18 //Athena
21 //C++
22 #include <map>
23 
24 
25 class TH1;
26 
27 namespace G4UA{
28 
29  class StepHistogram : public AthMessaging,
30  public G4UserEventAction,
31  public G4UserRunAction,
32  public G4UserSteppingAction
33  {
34  public:
36  virtual void UserSteppingAction(const G4Step*) override;
37 
38  // maps to hold info per volume/process/material per particle type
39  typedef std::map<G4String, TH1*> HistoMap_t;
40  typedef std::map<G4String, HistoMap_t> HistoMapMap_t;
41 
43  struct Report
44  {
45  // distributions per volume per particle type
57 
58  // distributions per material per particle type
70 
71  // distributions per process per particle type
83 
84  // all atlas
91 
92  // 2D maps
98 
99  // rather complicated function that merges two maps
100  void mergeMaps(HistoMapMap_t &selfMap, const HistoMapMap_t& refMap);
101 
102  // function needed by ActionToolBaseReport base class
103  void merge(const Report & rep);
104  };
105 
106  // configurable properties
107  struct Config
108  {
109  bool do2DHistograms = false;
110  bool doGeneralHistograms = false;
111  };
112 
114  StepHistogram(const Config&);
115 
116  const Report& getReport() const { return m_report; }
117 
118  private:
119  // report
121 
124 
125  // initialize and fill histogram in a map
126  void InitializeFillHistogram2D(HistoMapMap_t &hMapMap, const char* suffix,
127  const G4String& pdgId, const G4String& vol,
128  int nbinsx, double xmin, double xmax,
129  int nbinsy, double ymin, double ymax,
130  double valuex, double valuey, double weight);
131 
132  void InitializeFillHistogram(HistoMapMap_t &hMapMap, const char* suffix,
133  const G4String& pdgId, const G4String& vol,
134  int nbins, double xmin, double xmax, double value, double weight);
135 
136  void InitializeFillHistogram(HistoMapMap_t &hMapMap, const char* suffix,
137  const G4String& pdgId, const G4String& vol,
138  int nbins, double *edges, double value, double weight);
139 
141  G4String m_initialVolume;
144  int m_trackID = 0;
145 
146  }; // class StepHistogram
147 
148 } // namespace G4UA
149 
150 #endif // G4DEBUGGINGTOOLS_StepHistogram_H
G4UA::StepHistogram::Report::histoMapMap_mat_stepSize
HistoMapMap_t histoMapMap_mat_stepSize
Definition: StepHistogram.h:59
G4UA::StepHistogram::Report::histoMapMap_mat_stepKineticEnergy
HistoMapMap_t histoMapMap_mat_stepKineticEnergy
Definition: StepHistogram.h:60
G4UA::StepHistogram::HistoMap_t
std::map< G4String, TH1 * > HistoMap_t
Definition: StepHistogram.h:39
G4UA::StepHistogram::Report
this holds all the data from individual threads that needs to be merged at EoR
Definition: StepHistogram.h:44
G4UA::StepHistogram::Report::histoMapMap_prc_numberOfStepsPerInitialE
HistoMapMap_t histoMapMap_prc_numberOfStepsPerInitialE
Definition: StepHistogram.h:80
ymin
double ymin
Definition: listroot.cxx:63
G4UA::StepHistogram::Report::histoMapMap_trackLengthPerInitialE
HistoMapMap_t histoMapMap_trackLengthPerInitialE
Definition: StepHistogram.h:87
G4UA::StepHistogram::Report::histoMapMap_prc_numberOfSteps
HistoMapMap_t histoMapMap_prc_numberOfSteps
Definition: StepHistogram.h:79
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:185
G4DebuggingHelper.h
G4UA::StepHistogram::m_initialMaterial
G4String m_initialMaterial
Definition: StepHistogram.h:142
G4UA::StepHistogram::UserSteppingAction
virtual void UserSteppingAction(const G4Step *) override
the hooks for G4 UA handling
Definition: StepHistogram.cxx:39
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
G4UA::StepHistogram::HistoMapMap_t
std::map< G4String, HistoMap_t > HistoMapMap_t
Definition: StepHistogram.h:40
G4UA::StepHistogram
Definition: StepHistogram.h:33
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
G4UA::StepHistogram::m_config
Config m_config
configuration data
Definition: StepHistogram.h:123
G4UA::StepHistogram::Report::histoMapMap_mat_numberOfSteps
HistoMapMap_t histoMapMap_mat_numberOfSteps
Definition: StepHistogram.h:66
make_hlt_rep.rep
rep
Definition: make_hlt_rep.py:32
G4UA::StepHistogram::Report::histoMapMap_mat_stepEnergyDeposit
HistoMapMap_t histoMapMap_mat_stepEnergyDeposit
Definition: StepHistogram.h:63
G4UA::StepHistogram::Report::histoMapMap_stepKinetic
HistoMapMap_t histoMapMap_stepKinetic
Definition: StepHistogram.h:89
G4UA::StepHistogram::Config::do2DHistograms
bool do2DHistograms
Definition: StepHistogram.h:109
G4UA::StepHistogram::Report::merge
void merge(const Report &rep)
Definition: StepHistogram.cxx:290
athena.value
value
Definition: athena.py:124
G4UA::StepHistogram::Report::histoMapMap_mat_numberOfStepsPerInitialE
HistoMapMap_t histoMapMap_mat_numberOfStepsPerInitialE
Definition: StepHistogram.h:67
G4UA::StepHistogram::m_trackID
int m_trackID
Definition: StepHistogram.h:144
G4UA::StepHistogram::Report::histoMapMap_vol_InitialE
HistoMapMap_t histoMapMap_vol_InitialE
Definition: StepHistogram.h:56
G4UA::StepHistogram::Report::histoMapMap_vol_postStepKineticEnergy
HistoMapMap_t histoMapMap_vol_postStepKineticEnergy
Definition: StepHistogram.h:48
G4UA::StepHistogram::StepHistogram
StepHistogram(const Config &)
ctor
Definition: StepHistogram.cxx:30
G4UA::StepHistogram::Report::histoMapMap_prc_trackLengthPerInitialE
HistoMapMap_t histoMapMap_prc_trackLengthPerInitialE
Definition: StepHistogram.h:81
G4UA::StepHistogram::Report::histoMapMap_vol_stepKineticEnergy
HistoMapMap_t histoMapMap_vol_stepKineticEnergy
Definition: StepHistogram.h:47
G4UA::StepHistogram::Report::histoMapMap_prc_stepEnergyDeposit
HistoMapMap_t histoMapMap_prc_stepEnergyDeposit
Definition: StepHistogram.h:76
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:190
G4UA::StepHistogram::Report::histoMapMap_vol_numberOfStepsPerInitialE
HistoMapMap_t histoMapMap_vol_numberOfStepsPerInitialE
Definition: StepHistogram.h:54
G4UA::StepHistogram::Report::histoMapMap_prc_postStepKineticEnergy
HistoMapMap_t histoMapMap_prc_postStepKineticEnergy
Definition: StepHistogram.h:74
G4UA::StepHistogram::Report::histoMapMap_vol_stepSecondaryKinetic
HistoMapMap_t histoMapMap_vol_stepSecondaryKinetic
Definition: StepHistogram.h:52
G4UA::StepHistogram::Report::histoMapMap_vol_stepEnergyDeposit
HistoMapMap_t histoMapMap_vol_stepEnergyDeposit
Definition: StepHistogram.h:50
G4UA::StepHistogram::Report::histoMapMap_vol_stepPseudorapidity
HistoMapMap_t histoMapMap_vol_stepPseudorapidity
Definition: StepHistogram.h:49
G4UA::StepHistogram::Report::histoMapMap_mat_InitialE
HistoMapMap_t histoMapMap_mat_InitialE
Definition: StepHistogram.h:69
xmin
double xmin
Definition: listroot.cxx:60
G4UA::StepHistogram::Report::histoMapMap_mat_trackLengthPerInitialE
HistoMapMap_t histoMapMap_mat_trackLengthPerInitialE
Definition: StepHistogram.h:68
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
G4UA::StepHistogram::Report::histoMapMap_postStepKinetic
HistoMapMap_t histoMapMap_postStepKinetic
Definition: StepHistogram.h:90
G4UA::StepHistogram::Report::histoMapMap2D_mat_RZ
HistoMapMap_t histoMapMap2D_mat_RZ
Definition: StepHistogram.h:94
G4UA::StepHistogram::Report::histoMapMap_vol_trackLengthPerInitialE
HistoMapMap_t histoMapMap_vol_trackLengthPerInitialE
Definition: StepHistogram.h:55
G4UA::StepHistogram::Config
Definition: StepHistogram.h:108
G4UA::StepHistogram::Report::histoMapMap2D_mat_RZ_E
HistoMapMap_t histoMapMap2D_mat_RZ_E
Definition: StepHistogram.h:97
G4UA::StepHistogram::Report::histoMapMap_prc_stepSecondaryKinetic
HistoMapMap_t histoMapMap_prc_stepSecondaryKinetic
Definition: StepHistogram.h:78
G4UA::StepHistogram::Report::histoMapMap_vol_stepEnergyNonIonDeposit
HistoMapMap_t histoMapMap_vol_stepEnergyNonIonDeposit
Definition: StepHistogram.h:51
runIDPVM.pdgId
pdgId
Definition: runIDPVM.py:91
G4UA::StepHistogram::Report::histoMapMap_mat_stepPseudorapidity
HistoMapMap_t histoMapMap_mat_stepPseudorapidity
Definition: StepHistogram.h:62
G4UA::StepHistogram::getReport
const Report & getReport() const
Definition: StepHistogram.h:116
G4UA::StepHistogram::Report::histoMapMap_prc_stepSize
HistoMapMap_t histoMapMap_prc_stepSize
Definition: StepHistogram.h:72
G4UA::StepHistogram::Report::histoMapMap_numberOfStepsPerInitialE
HistoMapMap_t histoMapMap_numberOfStepsPerInitialE
Definition: StepHistogram.h:86
G4UA::StepHistogram::Report::histoMapMap_prc_InitialE
HistoMapMap_t histoMapMap_prc_InitialE
Definition: StepHistogram.h:82
G4UA::StepHistogram::Report::mergeMaps
void mergeMaps(HistoMapMap_t &selfMap, const HistoMapMap_t &refMap)
Definition: StepHistogram.cxx:271
G4UA::StepHistogram::Report::histoMapMap_prc_stepKineticEnergy
HistoMapMap_t histoMapMap_prc_stepKineticEnergy
Definition: StepHistogram.h:73
G4UA::StepHistogram::Report::histoMapMap_vol_numberOfSteps
HistoMapMap_t histoMapMap_vol_numberOfSteps
Definition: StepHistogram.h:53
G4UA::StepHistogram::InitializeFillHistogram2D
void InitializeFillHistogram2D(HistoMapMap_t &hMapMap, const char *suffix, const G4String &pdgId, const G4String &vol, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, double valuex, double valuey, double weight)
Definition: StepHistogram.cxx:224
G4UA::StepHistogram::Config::doGeneralHistograms
bool doGeneralHistograms
Definition: StepHistogram.h:110
AthMessaging.h
xmax
double xmax
Definition: listroot.cxx:61
G4UA::StepHistogram::m_initialVolume
G4String m_initialVolume
Definition: StepHistogram.h:141
G4UA::StepHistogram::Report::histoMapMap_numberOfSteps
HistoMapMap_t histoMapMap_numberOfSteps
Definition: StepHistogram.h:85
G4UA::StepHistogram::Report::histoMapMap2D_vol_RZ_E
HistoMapMap_t histoMapMap2D_vol_RZ_E
Definition: StepHistogram.h:96
G4UA::StepHistogram::m_report
Report m_report
Definition: StepHistogram.h:120
G4UA::StepHistogram::Report::histoMapMap2D_prc_RZ
HistoMapMap_t histoMapMap2D_prc_RZ
Definition: StepHistogram.h:95
G4UA::StepHistogram::Report::histoMapMap_vol_stepSize
HistoMapMap_t histoMapMap_vol_stepSize
Definition: StepHistogram.h:46
G4UA::StepHistogram::InitializeFillHistogram
void InitializeFillHistogram(HistoMapMap_t &hMapMap, const char *suffix, const G4String &pdgId, const G4String &vol, int nbins, double xmin, double xmax, double value, double weight)
Definition: StepHistogram.cxx:241
G4UA::StepHistogram::Report::histoMapMap_InitialE
HistoMapMap_t histoMapMap_InitialE
Definition: StepHistogram.h:88
G4UA::StepHistogram::Report::histoMapMap2D_vol_RZ
HistoMapMap_t histoMapMap2D_vol_RZ
Definition: StepHistogram.h:93
G4UA::StepHistogram::m_initialKineticEnergyOfStep
float m_initialKineticEnergyOfStep
Definition: StepHistogram.h:140
G4UA::StepHistogram::Report::histoMapMap_mat_stepEnergyNonIonDeposit
HistoMapMap_t histoMapMap_mat_stepEnergyNonIonDeposit
Definition: StepHistogram.h:64
G4UA::StepHistogram::Report::histoMapMap_prc_stepEnergyNonIonDeposit
HistoMapMap_t histoMapMap_prc_stepEnergyNonIonDeposit
Definition: StepHistogram.h:77
ymax
double ymax
Definition: listroot.cxx:64
G4UA::StepHistogram::m_initialProcess
G4String m_initialProcess
Definition: StepHistogram.h:143
G4UA::StepHistogram::Report::histoMapMap_prc_stepPseudorapidity
HistoMapMap_t histoMapMap_prc_stepPseudorapidity
Definition: StepHistogram.h:75
G4UA::StepHistogram::Report::histoMapMap_mat_stepSecondaryKinetic
HistoMapMap_t histoMapMap_mat_stepSecondaryKinetic
Definition: StepHistogram.h:65
G4UA::StepHistogram::Report::histoMapMap_mat_postStepKineticEnergy
HistoMapMap_t histoMapMap_mat_postStepKineticEnergy
Definition: StepHistogram.h:61