Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:23

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 optical/OpNovice2/src/HistoManager.cc
0027 /// \brief Implementation of the HistoManager class
0028 //
0029 //
0030 //
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 
0034 #include "HistoManager.hh"
0035 
0036 #include "G4UnitsTable.hh"
0037 
0038 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0039 
0040 HistoManager::HistoManager() : fFileName("opnovice2")
0041 {
0042   Book();
0043 }
0044 
0045 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0046 
0047 void HistoManager::Book()
0048 {
0049   // Create or get analysis manager
0050   G4AnalysisManager* analysisMan = G4AnalysisManager::Instance();
0051   analysisMan->SetDefaultFileType("root");
0052   analysisMan->SetFileName(fFileName);
0053   analysisMan->SetVerboseLevel(1);
0054   analysisMan->SetActivation(true);  // enable inactivation of histograms
0055 
0056   // Define histograms
0057   // Default values (to be reset via /analysis/h1/set command)
0058   G4int n = 100;
0059   G4double xmn = 0.;
0060   G4double xmx = 100.;
0061 
0062   // 0
0063   analysisMan->CreateH1("0", "dummy", n, xmn, xmx);
0064   // 1
0065   analysisMan->CreateH1("Cerenkov spectrum", "Cerenkov spectrum", n, xmn, xmx);
0066   // 2
0067   analysisMan->CreateH1("Scintillation spectrum", "Scintillation spectrum", n, xmn, xmx);
0068   // 3
0069   analysisMan->CreateH1("Scintillation time", "scintillation photons creation time", n, xmn, xmx);
0070   // 4
0071   analysisMan->CreateH1("WLS abs", "WLS absorption spectrum", n, xmn, xmx);
0072   // 5
0073   analysisMan->CreateH1("WLS em", "WLS emission spectrum", n, xmn, xmx);
0074   // 6
0075   analysisMan->CreateH1("WLS time", "WLS emission time", n, xmn, xmx);
0076   // 7
0077   analysisMan->CreateH1("WLS2 abs", "WLS2 absorption spectrum", n, xmn, xmx);
0078   // 8
0079   analysisMan->CreateH1("WLS2 em", "WLS2 emission spectrum", n, xmn, xmx);
0080   // 9
0081   analysisMan->CreateH1("WLS2 time", "WLS2 emission time", n, xmn, xmx);
0082   // 10
0083   analysisMan->CreateH1("bdry status", "boundary process status", n, xmn, xmx);
0084   // 11
0085   analysisMan->CreateH1("x_backward", "X momentum dir of backward-going photons", n, xmn, xmx);
0086   // 12
0087   analysisMan->CreateH1("y_backward", "Y momentum dir of backward-going photons", n, xmn, xmx);
0088   // 13
0089   analysisMan->CreateH1("z_backward", "Z momentum dir of backward-going photons", n, xmn, xmx);
0090   // 14
0091   analysisMan->CreateH1("x_forward", "X momentum dir of forward-going photons", n, xmn, xmx);
0092   // 15
0093   analysisMan->CreateH1("y_forward", "Y momentum dir of forward-going photons", n, xmn, xmx);
0094   // 16
0095   analysisMan->CreateH1("z_forward", "Z momentum dir of forward-going photons", n, xmn, xmx);
0096   // 17
0097   analysisMan->CreateH1("x_fresnel", "X momentum dir of Fresnel-refracted photons", n, xmn, xmx);
0098   // 18
0099   analysisMan->CreateH1("y_fresnel", "Y momentum dir of Fresnel-refracted photons", n, xmn, xmx);
0100   // 19
0101   analysisMan->CreateH1("z_fresnel", "Z momentum dir of Fresnel-refracted photons", n, xmn, xmx);
0102   // 20
0103   analysisMan->CreateH1("Fresnel refraction", "Fresnel-refracted photons", n, xmn, xmx);
0104   // 21
0105   analysisMan->CreateH1("Fresnel reflection", "Fresnel-reflected photons", n, xmn, xmx);
0106   // 22
0107   analysisMan->CreateH1("Total internal reflection", "Total internal reflected photons", n, xmn,
0108                         xmx);
0109   // 23
0110   analysisMan->CreateH1("Fresnel reflection plus TIR", "Fresnel-reflected plus TIR photons", n, xmn,
0111                         xmx);
0112   // 24
0113   analysisMan->CreateH1("Absorption", "Absorbed photons", n, xmn, xmx);
0114   // 25
0115   analysisMan->CreateH1("Transmitted", "Transmitted photons", n, xmn, xmx);
0116   // 26
0117   analysisMan->CreateH1("Spike reflection", "Spike reflected photons", n, xmn, xmx);
0118 
0119   for (G4int i = 0; i < analysisMan->GetNofH1s(); ++i) {
0120     analysisMan->SetH1Activation(i, false);
0121   }
0122 }