Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:24

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 //
0027 /// \file optical/wls/include/WLSSteppingAction.hh
0028 /// \brief Definition of the WLSSteppingAction class
0029 //
0030 
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0033 
0034 #ifndef WLSSteppingAction_h
0035 #define WLSSteppingAction_h 1
0036 
0037 #include "G4Types.hh"
0038 #include "G4UserSteppingAction.hh"
0039 
0040 class WLSDetectorConstruction;
0041 class WLSSteppingActionMessenger;
0042 class WLSEventAction;
0043 
0044 class G4OpBoundaryProcess;
0045 class G4Track;
0046 class G4StepPoint;
0047 
0048 class WLSSteppingAction : public G4UserSteppingAction
0049 {
0050   public:
0051     WLSSteppingAction(WLSDetectorConstruction*, WLSEventAction*);
0052     ~WLSSteppingAction() override;
0053 
0054     void UserSteppingAction(const G4Step*) override;
0055 
0056     // Set the bounce limit, 0 for no limit
0057     void SetBounceLimit(G4int);
0058 
0059     G4int GetNumberOfBounces();
0060     G4int GetNumberOfClad1Bounces();
0061     G4int GetNumberOfClad2Bounces();
0062     G4int GetNumberOfWLSBounces();
0063     // return number of successful events and reset the counter
0064     G4int ResetSuccessCounter();
0065 
0066   private:
0067     // Artificially kill the photon after it has bounced more than this number
0068     G4int fBounceLimit = 100000;
0069     // number of photons that reach the end
0070     G4int fCounterEnd = 0;
0071     // number of photons that didn't make it to the end
0072     G4int fCounterMid = 0;
0073     // total number of bounces that a photon been through
0074     G4int fCounterBounce = 0;
0075     // number of bounces that a photon been through within the fibre
0076     G4int fCounterWLSBounce = 0;
0077     // number of bounces that a photon been through from Cladding 1 to 2
0078     G4int fCounterClad1Bounce = 0;
0079     // number of bounces that a photon been through from Cladding 2 to World
0080     G4int fCounterClad2Bounce = 0;
0081 
0082     // initial gamma of the photon
0083     G4double fInitGamma = -1.;
0084     // initial theta of the photon
0085     G4double fInitTheta = -1.;
0086 
0087     G4OpBoundaryProcess* fOpProcess = nullptr;
0088 
0089     WLSDetectorConstruction* fDetector = nullptr;
0090     WLSSteppingActionMessenger* fSteppingMessenger = nullptr;
0091     WLSEventAction* fEventAction = nullptr;
0092 
0093     inline void ResetCounters()
0094     {
0095       fCounterBounce = 0;
0096       fCounterWLSBounce = 0;
0097       fCounterClad1Bounce = 0;
0098       fCounterClad2Bounce = 0;
0099       fInitGamma = -1;
0100       fInitTheta = -1;
0101     }
0102 };
0103 
0104 #endif