|
|
|||
File indexing completed on 2026-04-27 07:32:54
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 RunData.hh 0027 /// \brief Definition of the B4b::RunData class 0028 0029 #ifndef B4bRunData_h 0030 #define B4bRunData_h 1 0031 0032 #include "G4Run.hh" 0033 #include "globals.hh" 0034 0035 #include <array> 0036 0037 namespace B4b 0038 { 0039 0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0041 0042 const G4int kAbs = 0; 0043 const G4int kGap = 1; 0044 const G4int kDim = 2; 0045 0046 /// Run data class 0047 /// 0048 /// It defines data members to hold the energy deposit and track lengths 0049 /// of charged particles in Absober and Gap layers. 0050 /// 0051 /// In order to reduce the number of data members a 2-dimensions array 0052 /// is introduced for each quantity: 0053 /// - fEdep[], fTrackLength[]. 0054 /// 0055 /// The data are collected step by step in SteppingAction, and 0056 /// the accumulated values are filled in histograms and a Ntuple 0057 /// event by event in EventAction. 0058 0059 class RunData : public G4Run 0060 { 0061 public: 0062 RunData() = default; 0063 ~RunData() override = default; 0064 0065 void Add(G4int id, G4double de, G4double dl); 0066 void FillPerEvent(); 0067 0068 void Reset(); 0069 0070 // Get methods 0071 G4String GetVolumeName(G4int id) const; 0072 G4double GetEdep(G4int id) const; 0073 G4double GetTrackLength(G4int id) const; 0074 0075 private: 0076 std::array<G4String, kDim> fVolumeNames = {"Absorber", "Gap"}; 0077 std::array<G4double, kDim> fEdep = {0., 0.}; 0078 std::array<G4double, kDim> fTrackLength = {0., 0.}; 0079 }; 0080 0081 // inline functions 0082 0083 inline void RunData::Add(G4int id, G4double de, G4double dl) 0084 { 0085 fEdep[id] += de; 0086 fTrackLength[id] += dl; 0087 } 0088 0089 inline G4String RunData::GetVolumeName(G4int id) const 0090 { 0091 return fVolumeNames[id]; 0092 } 0093 0094 inline G4double RunData::GetEdep(G4int id) const 0095 { 0096 return fEdep[id]; 0097 } 0098 0099 inline G4double RunData::GetTrackLength(G4int id) const 0100 { 0101 return fTrackLength[id]; 0102 } 0103 0104 } // namespace B4b 0105 0106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 0107 0108 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|