Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-06 07:49:31

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 WLSUserTrackInformation.hh
0027 /// \brief Definition of the WLSUserTrackInformation class
0028 
0029 #ifndef WLSUserTrackInformation_h
0030 #define WLSUserTrackInformation_h 1
0031 
0032 #include "G4ThreeVector.hh"
0033 #include "G4VUserTrackInformation.hh"
0034 
0035 enum TrackStatus
0036 {
0037   undefined = 0,
0038   left = 1,  // track is going -z
0039   right = 2,  // track is going +z
0040   defined = 3,  // left or right flag is on (Can't be Set)
0041   EscapedFromSide = 4,  // photon escaped through the side of the fiber
0042   EscapedFromReadOut = 8,  // photon escaped through read-out end of the fiber
0043   ReflectedAtMirror = 16,  // photon has been reflected by mirror at far end
0044   ReflectedAtReadOut = 32,  // photon has been reflected at the read-out end
0045   murderee = 64,  // photon is artificially killed
0046   InsideOfFiber = 128,  // Flag is on if the photon is inside of fiber
0047   OutsideOfFiber = 256  // Flag is on if the photon is outside of fiber
0048 };
0049 
0050 class WLSUserTrackInformation : public G4VUserTrackInformation
0051 {
0052   public:
0053     WLSUserTrackInformation() = default;
0054     ~WLSUserTrackInformation() override = default;
0055 
0056     const G4ThreeVector& GetExitPosition() const { return fExitPosition; }
0057     void SetExitPosition(const G4ThreeVector& pos) { fExitPosition = pos; }
0058 
0059     // Try adding a status flag and return if it is successful or not
0060     // Cannot Add Undefine or a flag that conflicts with another flag
0061     // Return true if the addition of flag is successful, false otherwise
0062     G4bool AddStatusFlag(TrackStatus s);
0063 
0064     // Check if a certain flag is on
0065     G4bool IsStatus(TrackStatus s) { return s == undefined ? !(fStatus &= defined) : fStatus & s; }
0066 
0067   private:
0068     G4int fStatus = undefined;
0069     G4ThreeVector fExitPosition;
0070 };
0071 
0072 #endif