Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file optical/OpNovice2/src/HistoManager.c 26 /// \file optical/OpNovice2/src/HistoManager.cc 27 /// \brief Implementation of the HistoManager 27 /// \brief Implementation of the HistoManager class 28 // 28 // 29 // 29 // 30 // 30 // 31 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 33 33 34 #include "HistoManager.hh" 34 #include "HistoManager.hh" 35 35 36 #include "G4UnitsTable.hh" 36 #include "G4UnitsTable.hh" 37 37 38 //....oooOO0OOooo........oooOO0OOooo........oo 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 39 39 40 HistoManager::HistoManager() : fFileName("opno << 40 HistoManager::HistoManager() >> 41 : fFileName("opnovice2") 41 { 42 { 42 Book(); 43 Book(); 43 } 44 } 44 45 45 //....oooOO0OOooo........oooOO0OOooo........oo 46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 46 47 >> 48 HistoManager::~HistoManager() {} >> 49 >> 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 51 47 void HistoManager::Book() 52 void HistoManager::Book() 48 { 53 { 49 // Create or get analysis manager 54 // Create or get analysis manager 50 G4AnalysisManager* analysisMan = G4AnalysisM 55 G4AnalysisManager* analysisMan = G4AnalysisManager::Instance(); 51 analysisMan->SetDefaultFileType("root"); 56 analysisMan->SetDefaultFileType("root"); 52 analysisMan->SetFileName(fFileName); 57 analysisMan->SetFileName(fFileName); 53 analysisMan->SetVerboseLevel(1); 58 analysisMan->SetVerboseLevel(1); 54 analysisMan->SetActivation(true); // enable 59 analysisMan->SetActivation(true); // enable inactivation of histograms 55 60 56 // Define histograms 61 // Define histograms 57 // Default values (to be reset via /analysis 62 // Default values (to be reset via /analysis/h1/set command) 58 G4int n = 100; << 63 G4int n = 100; 59 G4double xmn = 0.; 64 G4double xmn = 0.; 60 G4double xmx = 100.; 65 G4double xmx = 100.; 61 66 62 // 0 67 // 0 63 analysisMan->CreateH1("0", "dummy", n, xmn, 68 analysisMan->CreateH1("0", "dummy", n, xmn, xmx); 64 // 1 69 // 1 65 analysisMan->CreateH1("Cerenkov spectrum", " 70 analysisMan->CreateH1("Cerenkov spectrum", "Cerenkov spectrum", n, xmn, xmx); 66 // 2 71 // 2 67 analysisMan->CreateH1("Scintillation spectru << 72 analysisMan->CreateH1("Scintillation spectrum", "Scintillation spectrum", n, >> 73 xmn, xmx); 68 // 3 74 // 3 69 analysisMan->CreateH1("Scintillation time", << 75 analysisMan->CreateH1("Scintillation time", >> 76 "scintillation photons creation time", n, xmn, xmx); 70 // 4 77 // 4 71 analysisMan->CreateH1("WLS abs", "WLS absorp 78 analysisMan->CreateH1("WLS abs", "WLS absorption spectrum", n, xmn, xmx); 72 // 5 79 // 5 73 analysisMan->CreateH1("WLS em", "WLS emissio 80 analysisMan->CreateH1("WLS em", "WLS emission spectrum", n, xmn, xmx); 74 // 6 81 // 6 75 analysisMan->CreateH1("WLS time", "WLS emiss 82 analysisMan->CreateH1("WLS time", "WLS emission time", n, xmn, xmx); 76 // 7 83 // 7 77 analysisMan->CreateH1("WLS2 abs", "WLS2 abso 84 analysisMan->CreateH1("WLS2 abs", "WLS2 absorption spectrum", n, xmn, xmx); 78 // 8 85 // 8 79 analysisMan->CreateH1("WLS2 em", "WLS2 emiss 86 analysisMan->CreateH1("WLS2 em", "WLS2 emission spectrum", n, xmn, xmx); 80 // 9 87 // 9 81 analysisMan->CreateH1("WLS2 time", "WLS2 emi 88 analysisMan->CreateH1("WLS2 time", "WLS2 emission time", n, xmn, xmx); 82 // 10 89 // 10 83 analysisMan->CreateH1("bdry status", "bounda 90 analysisMan->CreateH1("bdry status", "boundary process status", n, xmn, xmx); 84 // 11 91 // 11 85 analysisMan->CreateH1("x_backward", "X momen << 92 analysisMan->CreateH1( >> 93 "x_backward", "X momentum dir of backward-going photons", n, xmn, xmx); 86 // 12 94 // 12 87 analysisMan->CreateH1("y_backward", "Y momen << 95 analysisMan->CreateH1( >> 96 "y_backward", "Y momentum dir of backward-going photons", n, xmn, xmx); 88 // 13 97 // 13 89 analysisMan->CreateH1("z_backward", "Z momen << 98 analysisMan->CreateH1( >> 99 "z_backward", "Z momentum dir of backward-going photons", n, xmn, xmx); 90 // 14 100 // 14 91 analysisMan->CreateH1("x_forward", "X moment << 101 analysisMan->CreateH1("x_forward", "X momentum dir of forward-going photons", >> 102 n, xmn, xmx); 92 // 15 103 // 15 93 analysisMan->CreateH1("y_forward", "Y moment << 104 analysisMan->CreateH1("y_forward", "Y momentum dir of forward-going photons", >> 105 n, xmn, xmx); 94 // 16 106 // 16 95 analysisMan->CreateH1("z_forward", "Z moment << 107 analysisMan->CreateH1("z_forward", "Z momentum dir of forward-going photons", >> 108 n, xmn, xmx); 96 // 17 109 // 17 97 analysisMan->CreateH1("x_fresnel", "X moment << 110 analysisMan->CreateH1( >> 111 "x_fresnel", "X momentum dir of Fresnel-refracted photons", n, xmn, xmx); 98 // 18 112 // 18 99 analysisMan->CreateH1("y_fresnel", "Y moment << 113 analysisMan->CreateH1( >> 114 "y_fresnel", "Y momentum dir of Fresnel-refracted photons", n, xmn, xmx); 100 // 19 115 // 19 101 analysisMan->CreateH1("z_fresnel", "Z moment << 116 analysisMan->CreateH1( >> 117 "z_fresnel", "Z momentum dir of Fresnel-refracted photons", n, xmn, xmx); 102 // 20 118 // 20 103 analysisMan->CreateH1("Fresnel refraction", << 119 analysisMan->CreateH1("Fresnel refraction", "Fresnel-refracted photons", n, >> 120 xmn, xmx); 104 // 21 121 // 21 105 analysisMan->CreateH1("Fresnel reflection", << 122 analysisMan->CreateH1("Fresnel reflection", "Fresnel-reflected photons", n, >> 123 xmn, xmx); 106 // 22 124 // 22 107 analysisMan->CreateH1("Total internal reflec << 125 analysisMan->CreateH1("Total internal reflection", 108 xmx); << 126 "Total internal reflected photons", n, xmn, xmx); 109 // 23 127 // 23 110 analysisMan->CreateH1("Fresnel reflection pl << 128 analysisMan->CreateH1("Fresnel reflection plus TIR", 111 xmx); << 129 "Fresnel-reflected plus TIR photons", n, xmn, xmx); 112 // 24 130 // 24 113 analysisMan->CreateH1("Absorption", "Absorbe 131 analysisMan->CreateH1("Absorption", "Absorbed photons", n, xmn, xmx); 114 // 25 132 // 25 115 analysisMan->CreateH1("Transmitted", "Transm 133 analysisMan->CreateH1("Transmitted", "Transmitted photons", n, xmn, xmx); 116 // 26 134 // 26 117 analysisMan->CreateH1("Spike reflection", "S << 135 analysisMan->CreateH1("Spike reflection", "Spike reflected photons", n, xmn, >> 136 xmx); 118 137 119 for (G4int i = 0; i < analysisMan->GetNofH1s << 138 for(G4int i = 0; i < analysisMan->GetNofH1s(); ++i) >> 139 { 120 analysisMan->SetH1Activation(i, false); 140 analysisMan->SetH1Activation(i, false); 121 } 141 } 122 } 142 } 123 143