Open the file for the analysis.
57{
58
59 G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
60
61
62 analysisManager->SetNtupleMerging(true);
63 analysisManager->SetVerboseLevel(0);
64
65
72
73 G4double maxEnergy = 1000;
74
75
76 analysisManager->CreateH1("energyParticle", "Primary energy;E_{MC} (GeV);Entries", 1024, 0,
77 1.1 * maxEnergy);
78 analysisManager->CreateH1("energyDepositedInVirtual", "Deposited energy;E_{MC} (GeV);Entries",
79 1024, 0, 1.1 * maxEnergy);
80 analysisManager->CreateH1(
81 "energyRatioInVirtual", "Ratio of energy deposited to primary;E_{dep} / E_{MC};Entries",
82 1024, 0, 1);
83 analysisManager->CreateH1("time", "Simulation time; time (s);Entries", 2048, 0, 100);
84 analysisManager->CreateH1("longProfile", "Longitudinal profile;t (mm);#LTE#GT (MeV)", cellNumZ,
85 -0.5 * cellSizeZ, (cellNumZ - 0.5) * cellSizeZ);
86 analysisManager->CreateH1("transProfile", "Transverse profile;r (mm);#LTE#GT (MeV)", cellNumRho,
87 -0.5 * cellSizeRho, (cellNumRho - 0.5) * cellSizeRho);
88 analysisManager->CreateH1("longFirstMoment",
89 "First moment of longitudinal distribution;#LT#lambda#GT (mm);Entries",
90 1024, -0.5 * cellSizeZ,
91 cellNumZ * cellSizeZ / 2);
92 analysisManager->CreateH1("transFirstMoment",
93 "First moment of transverse distribution;#LTr#GT "
94 "(mm);Entries",
95 1024, -0.5 * cellSizeRho,
96 cellNumRho * cellSizeRho /
97 1);
98 analysisManager->CreateH1(
99 "longSecondMoment",
100 "Second moment of longitudinal distribution;#LT#lambda^{2}#GT "
101 "(mm^{2});Entries",
102 1024, 0, std::pow(cellNumZ * cellSizeZ, 2) / 25);
103 analysisManager->CreateH1(
104 "transSecondMoment", "Second moment of transverse distribution;#LTr^{2}#GT (mm^{2});Entries",
105 1024, 0, std::pow(cellNumRho * cellSizeRho, 2) / 5);
106 analysisManager->CreateH1("hitType", "hit type;type (0=full, 1= fast);Entries", 2, -0.5, 1.5);
107 analysisManager->CreateH1("phiProfile",
108 "Azimuthal angle profile, centred at mean;phi;#LTE#GT (MeV)",
109 cellNumPhi, - (cellNumPhi - 0.5) * cellSizePhi,
110 (cellNumPhi - 0.5) * cellSizePhi);
111 analysisManager->CreateH1("numHitsInVirtual", "Number of hits above 0.5 keV", 4048, 0, 20000);
112 analysisManager->CreateH1("cellEnergy", "Cell energy distribution;log10(E/MeV);Entries",
113 1024, -4, 2);
114 analysisManager->CreateH1("numDepositsInVirtual", "Number of deposits in all cells per event",
115 4048, 0, 40000);
116 analysisManager->CreateH1("cellDepositsInVirtual",
117 "Distribution of number of deposits per cell per event", 4048, 0, 1024);
118 analysisManager->CreateH1("energyDepositedInPhysical",
119 "Deposited energy in physical detector readout;E_{MC} (GeV);Entries",
120 1024, 0, 1.1 * maxEnergy);
121 analysisManager->CreateH1("energyRatioInPhysical",
122 "Ratio of energy deposited in physical readout to primary; E_{dep} / E_{MC};Entries",
123 1024, 0, 1);
124 analysisManager->CreateH1("numHitsInPhysical", "Number of hits in physical readout above 0.5 keV",
125 4048, 0, 5000);
126 analysisManager->CreateH1("cellEnergyInPhysical",
127 "Physical cell energy distribution;log10(E/MeV);Entries", 1024, -4, 2);
128 analysisManager->CreateH1("numDepositsInPhysical",
129 "Number of deposits in all physical cells per event", 4048, 0, 40000);
130 analysisManager->CreateH1("cellDepositsInPhysical",
131 "Distribution of number of deposits per physical cell per event",
132 4048, 0, 1024);
133
134
135 analysisManager->CreateNtuple("global", "Event data");
136 analysisManager->CreateNtupleDColumn("EnergyMC");
137 analysisManager->CreateNtupleDColumn("SimTime");
138 analysisManager->FinishNtuple();
139
140 analysisManager->CreateNtuple("virtualReadout", "Cylindrical mesh readout");
145 analysisManager->FinishNtuple();
146
147 analysisManager->CreateNtuple("physicalReadout", "Detector physical readout");
152 analysisManager->FinishNtuple();
153
154 analysisManager->OpenFile();
155}
G4ThreeVector GetMeshSizeOfCells() const
Get size of Mesh cells in cylindrical coordinates (r, phi, z)
G4ThreeVector GetMeshNbOfCells() const
Get number of Mesh cells in cylindrical coordinates (r, phi, z)
std::vector< G4int > & GetPhysicalCalSlice()
std::vector< G4int > & GetCalZ()
std::vector< G4int > & GetCalPhi()
std::vector< G4int > & GetCalRho()
std::vector< G4double > & GetCalEdep()
std::vector< G4int > & GetPhysicalCalRow()
std::vector< G4double > & GetPhysicalCalEdep()
std::vector< G4int > & GetPhysicalCalLayer()