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 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 /// \file medical/dna/range/src/HistoManager.cc
 27 /// \brief Implementation of the HistoManager class
 28 //
 29 //
 30 // $Id: HistoManager.cc 72238 2013-07-12 08:40:30Z gcosmo $
 31 //
 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 34 
 35 #include "HistoManager.hh"
 36 
 37 #include "DetectorConstruction.hh"
 38 
 39 #include "G4RunManager.hh"
 40 #include "G4UnitsTable.hh"
 41 
 42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 43 
 44 HistoManager::HistoManager() : fFileName("AuNP"), fpDetector(0)
 45 {
 46   fpDetector = dynamic_cast<const DetectorConstruction*>(
 47     G4RunManager::GetRunManager()->GetUserDetectorConstruction());
 48 
 49   Book();
 50 }
 51 
 52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 53 
 54 HistoManager::~HistoManager() {}
 55 
 56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 57 
 58 void HistoManager::Book()
 59 {
 60   // Create or get analysis manager
 61   G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
 62   analysisManager->SetDefaultFileType("root");
 63   analysisManager->SetFileName(fFileName);
 64   analysisManager->SetVerboseLevel(1);
 65   analysisManager->SetActivation(true);
 66 
 67   // Define histograms start values
 68   const G4String nameh1[] = {"h1Events",
 69                              "h1Edep",
 70                              "h1SecEnergyNP_charged",
 71                              "h1SecEnergyNP_nutral",
 72                              "h1SecEnergyNPSurf_charged",
 73                              "h1SecEnergyNPSurf_nutral",
 74                              "h1Sec_charged",
 75                              "h1Sec_nutral",
 76                              "h1Chem_0",
 77                              "h1Chem_1",
 78                              "h1Chem_2",
 79                              "h1Chem_3",
 80                              "h1Chem_4",
 81                              "h1Chem_5",
 82                              "h1Chem_6",
 83                              "h1Chem_7",
 84                              "h1IncEnergyNPSurf_Back",
 85                              "h1IncEnergyNPSurf_Fowared"};
 86   const G4String nameh2[] = {"h2Edep", "h2SecEnergyAbs_charged", "h2SecEnergyAbs_nutral"};
 87 
 88   const G4String titleh1[] = {"Events",
 89                               "Energy Deposit Distribution",
 90                               "Secondary Energy in NP (charged)",
 91                               "Secondary Energy in NP (nutral)",
 92                               "Secondary Energy at NP Surface (charged)",
 93                               "Secondary Energy at NP Surface (nutral)",
 94                               "Number of Secondaries in Absorber (charged)",
 95                               "Number of Secondaries in Absorber (nutral)",
 96                               "Number of Chemical for ID=0 at 1 psec",
 97                               "Number of Chemical for ID=1 at 1 psec",
 98                               "Number of Chemical for ID=2 at 1 psec",
 99                               "Number of Chemical for ID=3 at 1 psec",
100                               "Number of Chemical for ID=4 at 1 psec",
101                               "Number of Chemical for ID=5 at 1 psec",
102                               "Number of Chemical for ID=6 at 1 psec",
103                               "Number of Chemical for ID=7 at 1 psec",
104                               "Energy of Incident particle at backwared of GNP",
105                               "Energy of Incident particle at forwared of GNP"};
106   const G4String titleh2[] = {"Energy Deposit Distribution",
107                               "Secondary Energy vs distance (charged)",
108                               "Secondary Energy vs distance (nutral)"};
109 
110   // for event counting
111   G4int nbin_eve = 1;
112   G4double vmin_eve = 0.;
113   G4double vmax_eve = 1.;
114 
115   // for SecENP
116   G4int nbin_senp = 1000;
117   G4double vmin_senp = 1.;
118   G4double vmax_senp = 1000000;
119 
120   G4int NAzm = fpDetector->GetNReplicaAzm();
121   G4int NR = fpDetector->GetNReplicaR();
122   G4double Rmin = fpDetector->GetNPRadius() / CLHEP::nm;
123   G4double Rmax = fpDetector->GetAbsRadius() / CLHEP::nm;
124 
125   G4int Runit = (G4int)(Rmax - Rmin) / NR;
126   NR = NR + (G4int)(Rmin / Runit);
127 
128   // for dose distribution
129   G4int nbinAzm = NAzm;
130   G4double vminAzm = 0.;
131   G4double vmaxAzm = 360;
132   G4int nbinR2D = NR;
133   G4double vminR2D = 0.;
134   G4double vmaxR2D = 1000.;
135   G4int nbinR = NR;
136   G4double vminR_log = 10;
137   G4double vmaxR_log = Rmax;
138 
139   analysisManager->CreateH1(nameh1[0], titleh1[0], nbin_eve, vmin_eve, vmax_eve);
140   analysisManager->CreateH1(nameh1[1], titleh1[1], nbinR, vminR_log, vmaxR_log, "none", "none",
141                             "log");
142   analysisManager->CreateH1(nameh1[2], titleh1[2], nbin_senp, vmin_senp, vmax_senp, "none", "none",
143                             "log");
144   analysisManager->CreateH1(nameh1[3], titleh1[3], nbin_senp, vmin_senp, vmax_senp, "none", "none",
145                             "log");
146   analysisManager->CreateH1(nameh1[4], titleh1[4], nbin_senp, vmin_senp, vmax_senp, "none", "none",
147                             "log");
148   analysisManager->CreateH1(nameh1[5], titleh1[5], nbin_senp, vmin_senp, vmax_senp, "none", "none",
149                             "log");
150   analysisManager->CreateH1(nameh1[6], titleh1[6], nbinR, vminR_log, vmaxR_log, "none", "none",
151                             "log");
152   analysisManager->CreateH1(nameh1[7], titleh1[7], nbinR, vminR_log, vmaxR_log, "none", "none",
153                             "log");
154   analysisManager->CreateH1(nameh1[16], titleh1[16], nbin_senp, vmin_senp, vmax_senp, "none",
155                             "none", "log");
156   analysisManager->CreateH1(nameh1[17], titleh1[17], nbin_senp, vmin_senp, vmax_senp, "none",
157                             "none", "log");
158   analysisManager->CreateH1(nameh1[8], titleh1[8], nbinR, vminR_log, vmaxR_log, "none", "none",
159                             "log");
160   analysisManager->CreateH1(nameh1[9], titleh1[9], nbinR, vminR_log, vmaxR_log, "none", "none",
161                             "log");
162   analysisManager->CreateH1(nameh1[10], titleh1[10], nbinR, vminR_log, vmaxR_log, "none", "none",
163                             "log");
164   analysisManager->CreateH1(nameh1[11], titleh1[11], nbinR, vminR_log, vmaxR_log, "none", "none",
165                             "log");
166   analysisManager->CreateH1(nameh1[12], titleh1[12], nbinR, vminR_log, vmaxR_log, "none", "none",
167                             "log");
168   analysisManager->CreateH1(nameh1[13], titleh1[13], nbinR, vminR_log, vmaxR_log, "none", "none",
169                             "log");
170   analysisManager->CreateH1(nameh1[14], titleh1[14], nbinR, vminR_log, vmaxR_log, "none", "none",
171                             "log");
172   analysisManager->CreateH1(nameh1[15], titleh1[15], nbinR, vminR_log, vmaxR_log, "none", "none",
173                             "log");
174 
175   analysisManager->CreateH2(nameh2[0], titleh2[0], nbinAzm, vminAzm, vmaxAzm, nbinR2D, vminR2D,
176                             vmaxR2D);
177   analysisManager->CreateH2(nameh2[1], titleh2[1], nbinR2D, vminR2D, vmaxR2D, nbin_senp, vmin_senp,
178                             vmax_senp, "none", "none", "none", "none", "linear", "log");
179   analysisManager->CreateH2(nameh2[2], titleh2[2], nbinR2D, vminR2D, vmaxR2D, nbin_senp, vmin_senp,
180                             vmax_senp, "none", "none", "none", "none", "linear", "log");
181 
182   analysisManager->SetH1Activation(0, true);
183   analysisManager->SetH1Activation(1, true);
184   analysisManager->SetH1Activation(2, true);
185   analysisManager->SetH1Activation(3, true);
186   analysisManager->SetH1Activation(4, true);
187   analysisManager->SetH1Activation(5, true);
188   analysisManager->SetH1Activation(6, true);
189   analysisManager->SetH1Activation(7, true);
190   analysisManager->SetH1Activation(8, true);
191   analysisManager->SetH1Activation(9, true);
192   analysisManager->SetH1Activation(10, true);
193   analysisManager->SetH1Activation(11, true);
194   analysisManager->SetH1Activation(12, true);
195   analysisManager->SetH1Activation(13, true);
196   analysisManager->SetH1Activation(14, true);
197   analysisManager->SetH1Activation(15, true);
198   analysisManager->SetH1Activation(16, true);
199   analysisManager->SetH1Activation(17, true);
200   analysisManager->SetH2Activation(0, true);
201   analysisManager->SetH2Activation(1, true);
202   analysisManager->SetH2Activation(2, true);
203 }
204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
205