Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:46

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file medical/dna/range/src/HistoManager.cc
0027 /// \brief Implementation of the HistoManager class
0028 //
0029 //
0030 // $Id: HistoManager.cc 72238 2013-07-12 08:40:30Z gcosmo $
0031 //
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0034 
0035 #include "HistoManager.hh"
0036 
0037 #include "DetectorConstruction.hh"
0038 
0039 #include "G4RunManager.hh"
0040 #include "G4UnitsTable.hh"
0041 
0042 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0043 
0044 HistoManager::HistoManager() : fFileName("AuNP"), fpDetector(0)
0045 {
0046   fpDetector = dynamic_cast<const DetectorConstruction*>(
0047     G4RunManager::GetRunManager()->GetUserDetectorConstruction());
0048 
0049   Book();
0050 }
0051 
0052 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0053 
0054 HistoManager::~HistoManager() {}
0055 
0056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0057 
0058 void HistoManager::Book()
0059 {
0060   // Create or get analysis manager
0061   G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
0062   analysisManager->SetDefaultFileType("root");
0063   analysisManager->SetFileName(fFileName);
0064   analysisManager->SetVerboseLevel(1);
0065   analysisManager->SetActivation(true);
0066 
0067   // Define histograms start values
0068   const G4String nameh1[] = {"h1Events",
0069                              "h1Edep",
0070                              "h1SecEnergyNP_charged",
0071                              "h1SecEnergyNP_nutral",
0072                              "h1SecEnergyNPSurf_charged",
0073                              "h1SecEnergyNPSurf_nutral",
0074                              "h1Sec_charged",
0075                              "h1Sec_nutral",
0076                              "h1Chem_0",
0077                              "h1Chem_1",
0078                              "h1Chem_2",
0079                              "h1Chem_3",
0080                              "h1Chem_4",
0081                              "h1Chem_5",
0082                              "h1Chem_6",
0083                              "h1Chem_7",
0084                              "h1IncEnergyNPSurf_Back",
0085                              "h1IncEnergyNPSurf_Fowared"};
0086   const G4String nameh2[] = {"h2Edep", "h2SecEnergyAbs_charged", "h2SecEnergyAbs_nutral"};
0087 
0088   const G4String titleh1[] = {"Events",
0089                               "Energy Deposit Distribution",
0090                               "Secondary Energy in NP (charged)",
0091                               "Secondary Energy in NP (nutral)",
0092                               "Secondary Energy at NP Surface (charged)",
0093                               "Secondary Energy at NP Surface (nutral)",
0094                               "Number of Secondaries in Absorber (charged)",
0095                               "Number of Secondaries in Absorber (nutral)",
0096                               "Number of Chemical for ID=0 at 1 psec",
0097                               "Number of Chemical for ID=1 at 1 psec",
0098                               "Number of Chemical for ID=2 at 1 psec",
0099                               "Number of Chemical for ID=3 at 1 psec",
0100                               "Number of Chemical for ID=4 at 1 psec",
0101                               "Number of Chemical for ID=5 at 1 psec",
0102                               "Number of Chemical for ID=6 at 1 psec",
0103                               "Number of Chemical for ID=7 at 1 psec",
0104                               "Energy of Incident particle at backwared of GNP",
0105                               "Energy of Incident particle at forwared of GNP"};
0106   const G4String titleh2[] = {"Energy Deposit Distribution",
0107                               "Secondary Energy vs distance (charged)",
0108                               "Secondary Energy vs distance (nutral)"};
0109 
0110   // for event counting
0111   G4int nbin_eve = 1;
0112   G4double vmin_eve = 0.;
0113   G4double vmax_eve = 1.;
0114 
0115   // for SecENP
0116   G4int nbin_senp = 1000;
0117   G4double vmin_senp = 1.;
0118   G4double vmax_senp = 1000000;
0119 
0120   G4int NAzm = fpDetector->GetNReplicaAzm();
0121   G4int NR = fpDetector->GetNReplicaR();
0122   G4double Rmin = fpDetector->GetNPRadius() / CLHEP::nm;
0123   G4double Rmax = fpDetector->GetAbsRadius() / CLHEP::nm;
0124 
0125   G4int Runit = (G4int)(Rmax - Rmin) / NR;
0126   NR = NR + (G4int)(Rmin / Runit);
0127 
0128   // for dose distribution
0129   G4int nbinAzm = NAzm;
0130   G4double vminAzm = 0.;
0131   G4double vmaxAzm = 360;
0132   G4int nbinR2D = NR;
0133   G4double vminR2D = 0.;
0134   G4double vmaxR2D = 1000.;
0135   G4int nbinR = NR;
0136   G4double vminR_log = 10;
0137   G4double vmaxR_log = Rmax;
0138 
0139   analysisManager->CreateH1(nameh1[0], titleh1[0], nbin_eve, vmin_eve, vmax_eve);
0140   analysisManager->CreateH1(nameh1[1], titleh1[1], nbinR, vminR_log, vmaxR_log, "none", "none",
0141                             "log");
0142   analysisManager->CreateH1(nameh1[2], titleh1[2], nbin_senp, vmin_senp, vmax_senp, "none", "none",
0143                             "log");
0144   analysisManager->CreateH1(nameh1[3], titleh1[3], nbin_senp, vmin_senp, vmax_senp, "none", "none",
0145                             "log");
0146   analysisManager->CreateH1(nameh1[4], titleh1[4], nbin_senp, vmin_senp, vmax_senp, "none", "none",
0147                             "log");
0148   analysisManager->CreateH1(nameh1[5], titleh1[5], nbin_senp, vmin_senp, vmax_senp, "none", "none",
0149                             "log");
0150   analysisManager->CreateH1(nameh1[6], titleh1[6], nbinR, vminR_log, vmaxR_log, "none", "none",
0151                             "log");
0152   analysisManager->CreateH1(nameh1[7], titleh1[7], nbinR, vminR_log, vmaxR_log, "none", "none",
0153                             "log");
0154   analysisManager->CreateH1(nameh1[16], titleh1[16], nbin_senp, vmin_senp, vmax_senp, "none",
0155                             "none", "log");
0156   analysisManager->CreateH1(nameh1[17], titleh1[17], nbin_senp, vmin_senp, vmax_senp, "none",
0157                             "none", "log");
0158   analysisManager->CreateH1(nameh1[8], titleh1[8], nbinR, vminR_log, vmaxR_log, "none", "none",
0159                             "log");
0160   analysisManager->CreateH1(nameh1[9], titleh1[9], nbinR, vminR_log, vmaxR_log, "none", "none",
0161                             "log");
0162   analysisManager->CreateH1(nameh1[10], titleh1[10], nbinR, vminR_log, vmaxR_log, "none", "none",
0163                             "log");
0164   analysisManager->CreateH1(nameh1[11], titleh1[11], nbinR, vminR_log, vmaxR_log, "none", "none",
0165                             "log");
0166   analysisManager->CreateH1(nameh1[12], titleh1[12], nbinR, vminR_log, vmaxR_log, "none", "none",
0167                             "log");
0168   analysisManager->CreateH1(nameh1[13], titleh1[13], nbinR, vminR_log, vmaxR_log, "none", "none",
0169                             "log");
0170   analysisManager->CreateH1(nameh1[14], titleh1[14], nbinR, vminR_log, vmaxR_log, "none", "none",
0171                             "log");
0172   analysisManager->CreateH1(nameh1[15], titleh1[15], nbinR, vminR_log, vmaxR_log, "none", "none",
0173                             "log");
0174 
0175   analysisManager->CreateH2(nameh2[0], titleh2[0], nbinAzm, vminAzm, vmaxAzm, nbinR2D, vminR2D,
0176                             vmaxR2D);
0177   analysisManager->CreateH2(nameh2[1], titleh2[1], nbinR2D, vminR2D, vmaxR2D, nbin_senp, vmin_senp,
0178                             vmax_senp, "none", "none", "none", "none", "linear", "log");
0179   analysisManager->CreateH2(nameh2[2], titleh2[2], nbinR2D, vminR2D, vmaxR2D, nbin_senp, vmin_senp,
0180                             vmax_senp, "none", "none", "none", "none", "linear", "log");
0181 
0182   analysisManager->SetH1Activation(0, true);
0183   analysisManager->SetH1Activation(1, true);
0184   analysisManager->SetH1Activation(2, true);
0185   analysisManager->SetH1Activation(3, true);
0186   analysisManager->SetH1Activation(4, true);
0187   analysisManager->SetH1Activation(5, true);
0188   analysisManager->SetH1Activation(6, true);
0189   analysisManager->SetH1Activation(7, true);
0190   analysisManager->SetH1Activation(8, true);
0191   analysisManager->SetH1Activation(9, true);
0192   analysisManager->SetH1Activation(10, true);
0193   analysisManager->SetH1Activation(11, true);
0194   analysisManager->SetH1Activation(12, true);
0195   analysisManager->SetH1Activation(13, true);
0196   analysisManager->SetH1Activation(14, true);
0197   analysisManager->SetH1Activation(15, true);
0198   analysisManager->SetH1Activation(16, true);
0199   analysisManager->SetH1Activation(17, true);
0200   analysisManager->SetH2Activation(0, true);
0201   analysisManager->SetH2Activation(1, true);
0202   analysisManager->SetH2Activation(2, true);
0203 }
0204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......