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() { delete G4AnalysisManager::Instance(); } >> 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 >> 55 // The choice of analysis technology is done via selection of a namespace >> 56 // in HistoManager.hh 50 G4AnalysisManager* analysisMan = G4AnalysisM 57 G4AnalysisManager* analysisMan = G4AnalysisManager::Instance(); 51 analysisMan->SetDefaultFileType("root"); << 52 analysisMan->SetFileName(fFileName); 58 analysisMan->SetFileName(fFileName); 53 analysisMan->SetVerboseLevel(1); 59 analysisMan->SetVerboseLevel(1); 54 analysisMan->SetActivation(true); // enable 60 analysisMan->SetActivation(true); // enable inactivation of histograms 55 61 56 // Define histograms 62 // Define histograms 57 // Default values (to be reset via /analysis 63 // Default values (to be reset via /analysis/h1/set command) 58 G4int n = 100; << 64 G4int n = 100; 59 G4double xmn = 0.; 65 G4double xmn = 0.; 60 G4double xmx = 100.; 66 G4double xmx = 100.; 61 67 62 // 0 68 // 0 63 analysisMan->CreateH1("0", "dummy", n, xmn, 69 analysisMan->CreateH1("0", "dummy", n, xmn, xmx); 64 // 1 70 // 1 65 analysisMan->CreateH1("Cerenkov spectrum", " 71 analysisMan->CreateH1("Cerenkov spectrum", "Cerenkov spectrum", n, xmn, xmx); 66 // 2 72 // 2 67 analysisMan->CreateH1("Scintillation spectru << 73 analysisMan->CreateH1("Scintillation spectrum", "Scintillation spectrum", n, >> 74 xmn, xmx); 68 // 3 75 // 3 69 analysisMan->CreateH1("Scintillation time", << 76 analysisMan->CreateH1("Scintillation time", >> 77 "scintillation photons creation time", n, xmn, xmx); 70 // 4 78 // 4 71 analysisMan->CreateH1("WLS abs", "WLS absorp 79 analysisMan->CreateH1("WLS abs", "WLS absorption spectrum", n, xmn, xmx); 72 // 5 80 // 5 73 analysisMan->CreateH1("WLS em", "WLS emissio 81 analysisMan->CreateH1("WLS em", "WLS emission spectrum", n, xmn, xmx); 74 // 6 82 // 6 75 analysisMan->CreateH1("WLS time", "WLS emiss 83 analysisMan->CreateH1("WLS time", "WLS emission time", n, xmn, xmx); 76 // 7 84 // 7 77 analysisMan->CreateH1("WLS2 abs", "WLS2 abso 85 analysisMan->CreateH1("WLS2 abs", "WLS2 absorption spectrum", n, xmn, xmx); 78 // 8 86 // 8 79 analysisMan->CreateH1("WLS2 em", "WLS2 emiss 87 analysisMan->CreateH1("WLS2 em", "WLS2 emission spectrum", n, xmn, xmx); 80 // 9 88 // 9 81 analysisMan->CreateH1("WLS2 time", "WLS2 emi 89 analysisMan->CreateH1("WLS2 time", "WLS2 emission time", n, xmn, xmx); 82 // 10 90 // 10 83 analysisMan->CreateH1("bdry status", "bounda 91 analysisMan->CreateH1("bdry status", "boundary process status", n, xmn, xmx); 84 // 11 92 // 11 85 analysisMan->CreateH1("x_backward", "X momen << 93 analysisMan->CreateH1( >> 94 "x_backward", "X momentum dir of backward-going photons", n, xmn, xmx); 86 // 12 95 // 12 87 analysisMan->CreateH1("y_backward", "Y momen << 96 analysisMan->CreateH1( >> 97 "y_backward", "Y momentum dir of backward-going photons", n, xmn, xmx); 88 // 13 98 // 13 89 analysisMan->CreateH1("z_backward", "Z momen << 99 analysisMan->CreateH1( >> 100 "z_backward", "Z momentum dir of backward-going photons", n, xmn, xmx); 90 // 14 101 // 14 91 analysisMan->CreateH1("x_forward", "X moment << 102 analysisMan->CreateH1("x_forward", "X momentum dir of forward-going photons", >> 103 n, xmn, xmx); 92 // 15 104 // 15 93 analysisMan->CreateH1("y_forward", "Y moment << 105 analysisMan->CreateH1("y_forward", "Y momentum dir of forward-going photons", >> 106 n, xmn, xmx); 94 // 16 107 // 16 95 analysisMan->CreateH1("z_forward", "Z moment << 108 analysisMan->CreateH1("z_forward", "Z momentum dir of forward-going photons", >> 109 n, xmn, xmx); 96 // 17 110 // 17 97 analysisMan->CreateH1("x_fresnel", "X moment << 111 analysisMan->CreateH1( >> 112 "x_fresnel", "X momentum dir of Fresnel-refracted photons", n, xmn, xmx); 98 // 18 113 // 18 99 analysisMan->CreateH1("y_fresnel", "Y moment << 114 analysisMan->CreateH1( >> 115 "y_fresnel", "Y momentum dir of Fresnel-refracted photons", n, xmn, xmx); 100 // 19 116 // 19 101 analysisMan->CreateH1("z_fresnel", "Z moment << 117 analysisMan->CreateH1( >> 118 "z_fresnel", "Z momentum dir of Fresnel-refracted photons", n, xmn, xmx); 102 // 20 119 // 20 103 analysisMan->CreateH1("Fresnel refraction", << 104 // 21 << 105 analysisMan->CreateH1("Fresnel reflection", << 106 // 22 << 107 analysisMan->CreateH1("Total internal reflec << 108 xmx); << 109 // 23 << 110 analysisMan->CreateH1("Fresnel reflection pl << 111 xmx); << 112 // 24 << 113 analysisMan->CreateH1("Absorption", "Absorbe << 114 // 25 << 115 analysisMan->CreateH1("Transmitted", "Transm 120 analysisMan->CreateH1("Transmitted", "Transmitted photons", n, xmn, xmx); 116 // 26 << 121 // 21 117 analysisMan->CreateH1("Spike reflection", "S << 122 analysisMan->CreateH1("Reflected", "Reflected photons", n, xmn, xmx); 118 123 119 for (G4int i = 0; i < analysisMan->GetNofH1s << 124 for(G4int i = 0; i < analysisMan->GetNofH1s(); ++i) >> 125 { 120 analysisMan->SetH1Activation(i, false); 126 analysisMan->SetH1Activation(i, false); 121 } 127 } 122 } 128 } 123 129