Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 08:29:40

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 WLSRun.hh
0027 /// \brief Definition of the WLSRun class
0028 
0029 #ifndef WLSRun_h
0030 #define WLSRun_h 1
0031 
0032 #include "G4Run.hh"
0033 
0034 class WLSRun : public G4Run
0035 {
0036   public:
0037     WLSRun() = default;
0038     ~WLSRun() override = default;
0039 
0040     void AddTIR(G4int n)
0041     {
0042       G4double nd(n);
0043       fNTIR += nd;
0044       fNTIR2 += nd * nd;
0045     };
0046     void AddExiting(G4int n)
0047     {
0048       G4double nd(n);
0049       fNExiting += nd;
0050       fNExiting2 += nd * nd;
0051     };
0052     void AddEscapedEnd(G4int n)
0053     {
0054       G4double nd(n);
0055       fEscapedEnd += nd;
0056       fEscapedEnd2 += nd * nd;
0057     };
0058     void AddEscapedMid(G4int n)
0059     {
0060       G4double nd(n);
0061       fEscapedMid += nd;
0062       fEscapedMid2 += nd * nd;
0063     };
0064     void AddBounce(G4int n)
0065     {
0066       G4double nd(n);
0067       fBounce += nd;
0068       fBounce2 += nd * nd;
0069     };
0070     void AddWLSBounce(G4int n)
0071     {
0072       G4double nd(n);
0073       fWLSBounce += nd;
0074       fWLSBounce2 += nd * nd;
0075     };
0076     void AddClad1Bounce(G4int n)
0077     {
0078       G4double nd(n);
0079       fClad1Bounce += nd;
0080       fClad1Bounce2 += nd * nd;
0081     };
0082     void AddClad2Bounce(G4int n)
0083     {
0084       G4double nd(n);
0085       fClad2Bounce += nd;
0086       fClad2Bounce2 += nd * nd;
0087     };
0088     void AddReflected(G4int n)
0089     {
0090       G4double nd(n);
0091       fReflected += nd;
0092       fReflected2 += nd * nd;
0093     };
0094     void AddEscaped(G4int n)
0095     {
0096       G4double nd(n);
0097       fEscaped += nd;
0098       fEscaped2 += nd * nd;
0099     };
0100     void AddMirror(G4int n)
0101     {
0102       G4double nd(n);
0103       fMirror += nd;
0104       fMirror2 += nd * nd;
0105     };
0106     void AddDetectorHits(G4int n)
0107     {
0108       G4double nd(n);
0109       fDetectorHits += nd;
0110       fDetectorHits2 += nd * nd;
0111     };
0112 
0113     void EndOfRun();
0114     void Merge(const G4Run*) override;
0115 
0116   private:
0117     G4double fNTIR = 0.;
0118     G4double fNTIR2 = 0.;
0119     G4double fNExiting = 0.;
0120     G4double fNExiting2 = 0.;
0121     G4double fEscapedEnd = 0.;
0122     G4double fEscapedEnd2 = 0.;
0123     G4double fEscapedMid = 0.;
0124     G4double fEscapedMid2 = 0.;
0125     G4double fBounce = 0.;
0126     G4double fBounce2 = 0.;
0127     G4double fWLSBounce = 0.;
0128     G4double fWLSBounce2 = 0.;
0129     G4double fClad1Bounce = 0.;
0130     G4double fClad1Bounce2 = 0.;
0131     G4double fClad2Bounce = 0.;
0132     G4double fClad2Bounce2 = 0.;
0133     G4double fReflected = 0.;
0134     G4double fReflected2 = 0.;
0135     G4double fEscaped = 0.;
0136     G4double fEscaped2 = 0.;
0137     G4double fMirror = 0.;
0138     G4double fMirror2 = 0.;
0139     G4double fDetectorHits = 0.;
0140     G4double fDetectorHits2 = 0.;
0141 };
0142 
0143 #endif