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10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/optical/OpNovice2/src/HistoManager.cc (Version 11.3.0) and /examples/extended/optical/OpNovice2/src/HistoManager.cc (Version 11.2)


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