Geant4 Cross Reference |
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 optical/OpNovice2/src/HistoManager.cc 27 /// \brief Implementation of the HistoManager class 28 // 29 // 30 // 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 33 34 #include "HistoManager.hh" 35 36 #include "G4UnitsTable.hh" 37 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 39 40 HistoManager::HistoManager() : fFileName("opnovice2") 41 { 42 Book(); 43 } 44 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 46 47 void HistoManager::Book() 48 { 49 // Create or get analysis manager 50 G4AnalysisManager* analysisMan = G4AnalysisManager::Instance(); 51 analysisMan->SetDefaultFileType("root"); 52 analysisMan->SetFileName(fFileName); 53 analysisMan->SetVerboseLevel(1); 54 analysisMan->SetActivation(true); // enable inactivation of histograms 55 56 // Define histograms 57 // Default values (to be reset via /analysis/h1/set command) 58 G4int n = 100; 59 G4double xmn = 0.; 60 G4double xmx = 100.; 61 62 // 0 63 analysisMan->CreateH1("0", "dummy", n, xmn, xmx); 64 // 1 65 analysisMan->CreateH1("Cerenkov spectrum", "Cerenkov spectrum", n, xmn, xmx); 66 // 2 67 analysisMan->CreateH1("Scintillation spectrum", "Scintillation spectrum", n, xmn, xmx); 68 // 3 69 analysisMan->CreateH1("Scintillation time", "scintillation photons creation time", n, xmn, xmx); 70 // 4 71 analysisMan->CreateH1("WLS abs", "WLS absorption spectrum", n, xmn, xmx); 72 // 5 73 analysisMan->CreateH1("WLS em", "WLS emission spectrum", n, xmn, xmx); 74 // 6 75 analysisMan->CreateH1("WLS time", "WLS emission time", n, xmn, xmx); 76 // 7 77 analysisMan->CreateH1("WLS2 abs", "WLS2 absorption spectrum", n, xmn, xmx); 78 // 8 79 analysisMan->CreateH1("WLS2 em", "WLS2 emission spectrum", n, xmn, xmx); 80 // 9 81 analysisMan->CreateH1("WLS2 time", "WLS2 emission time", n, xmn, xmx); 82 // 10 83 analysisMan->CreateH1("bdry status", "boundary process status", n, xmn, xmx); 84 // 11 85 analysisMan->CreateH1("x_backward", "X momentum dir of backward-going photons", n, xmn, xmx); 86 // 12 87 analysisMan->CreateH1("y_backward", "Y momentum dir of backward-going photons", n, xmn, xmx); 88 // 13 89 analysisMan->CreateH1("z_backward", "Z momentum dir of backward-going photons", n, xmn, xmx); 90 // 14 91 analysisMan->CreateH1("x_forward", "X momentum dir of forward-going photons", n, xmn, xmx); 92 // 15 93 analysisMan->CreateH1("y_forward", "Y momentum dir of forward-going photons", n, xmn, xmx); 94 // 16 95 analysisMan->CreateH1("z_forward", "Z momentum dir of forward-going photons", n, xmn, xmx); 96 // 17 97 analysisMan->CreateH1("x_fresnel", "X momentum dir of Fresnel-refracted photons", n, xmn, xmx); 98 // 18 99 analysisMan->CreateH1("y_fresnel", "Y momentum dir of Fresnel-refracted photons", n, xmn, xmx); 100 // 19 101 analysisMan->CreateH1("z_fresnel", "Z momentum dir of Fresnel-refracted photons", n, xmn, xmx); 102 // 20 103 analysisMan->CreateH1("Fresnel refraction", "Fresnel-refracted photons", n, xmn, xmx); 104 // 21 105 analysisMan->CreateH1("Fresnel reflection", "Fresnel-reflected photons", n, xmn, xmx); 106 // 22 107 analysisMan->CreateH1("Total internal reflection", "Total internal reflected photons", n, xmn, 108 xmx); 109 // 23 110 analysisMan->CreateH1("Fresnel reflection plus TIR", "Fresnel-reflected plus TIR photons", n, xmn, 111 xmx); 112 // 24 113 analysisMan->CreateH1("Absorption", "Absorbed photons", n, xmn, xmx); 114 // 25 115 analysisMan->CreateH1("Transmitted", "Transmitted photons", n, xmn, xmx); 116 // 26 117 analysisMan->CreateH1("Spike reflection", "Spike reflected photons", n, xmn, xmx); 118 119 for (G4int i = 0; i < analysisMan->GetNofH1s(); ++i) { 120 analysisMan->SetH1Activation(i, false); 121 } 122 } 123