|
|
|||
File indexing completed on 2026-09-10 08:29:51
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 Par04EventAction.hh 0027 /// \brief Definition of the Par04EventAction class 0028 0029 #ifndef PAR04EVENTACTION_HH 0030 #define PAR04EVENTACTION_HH 0031 0032 #include "G4Timer.hh" // for G4Timer 0033 #include "G4UserEventAction.hh" // for G4UserEventAction 0034 0035 #include <G4Types.hh> // for G4int, G4double 0036 #include <vector> // for vector 0037 class G4Event; 0038 class Par04DetectorConstruction; 0039 class Par04ParallelFullWorld; 0040 0041 /** 0042 * @brief Event action class for hits' analysis. 0043 * 0044 * Analysis of single-particle events and developed showers in the detector. 0045 * At the end of the event basic variables are calculated and saved in the 0046 * histograms. 0047 * Additionally ntuple with cell energies and IDs (in cylindrical coordinates) is stored. 0048 * 0049 */ 0050 0051 class Par04EventAction : public G4UserEventAction 0052 { 0053 public: 0054 Par04EventAction(Par04DetectorConstruction* aDetector, Par04ParallelFullWorld* aParallel); 0055 virtual ~Par04EventAction(); 0056 0057 /// Timer is started 0058 virtual void BeginOfEventAction(const G4Event* aEvent) final; 0059 /// Hits collection is retrieved, analysed, and histograms are filled. 0060 virtual void EndOfEventAction(const G4Event* aEvent) final; 0061 inline std::vector<G4double>& GetCalEdep() { return fCalEdep; } 0062 inline std::vector<G4int>& GetCalRho() { return fCalRho; } 0063 inline std::vector<G4int>& GetCalPhi() { return fCalPhi; } 0064 inline std::vector<G4int>& GetCalZ() { return fCalZ; } 0065 inline std::vector<G4double>& GetPhysicalCalEdep() { return fCalPhysicalEdep; } 0066 inline std::vector<G4int>& GetPhysicalCalLayer() { return fCalPhysicalLayer; } 0067 inline std::vector<G4int>& GetPhysicalCalSlice() { return fCalPhysicalSlice; } 0068 inline std::vector<G4int>& GetPhysicalCalRow() { return fCalPhysicalRow; } 0069 void StartTimer(); 0070 void StopTimer(); 0071 0072 private: 0073 /// ID of a hit collection to analyse 0074 G4int fHitCollectionID = -1; 0075 G4int fPhysicalFullHitCollectionID = -1; 0076 G4int fPhysicalFastHitCollectionID = -1; 0077 /// Timer measurement from Geant4 0078 G4Timer fTimer; 0079 /// Pointer to detector construction to retrieve (once) the detector 0080 /// dimensions and size of readout 0081 Par04DetectorConstruction* fDetector = nullptr; 0082 Par04ParallelFullWorld* fParallel = nullptr; 0083 /// Size of cell along Z axis 0084 G4double fCellSizeZ = 0; 0085 /// Size of cell along radius of cylinder 0086 G4double fCellSizeRho = 0; 0087 /// Size of cell in azimuthal angle 0088 G4double fCellSizePhi = 0; 0089 /// Number of readout cells along radius 0090 G4int fCellNbRho = 0; 0091 /// Number of readout cells in azimuthal angle 0092 G4int fCellNbPhi = 0; 0093 /// Number of readout cells along z axis 0094 G4int fCellNbZ = 0; 0095 /// Number of physical readout layers 0096 G4int fPhysicalNbLayers = 0; 0097 /// Number of physical readout slices 0098 G4int fPhysicalNbSlices = 0; 0099 /// Number of physical readout rows 0100 G4int fPhysicalNbRows = 0; 0101 /// Cell energy deposits to be stored in ntuple 0102 std::vector<G4double> fCalEdep; 0103 /// Cell ID of radius to be stored in ntuple 0104 std::vector<G4int> fCalRho; 0105 /// Cell ID of azimuthal angle to be stored in ntuple 0106 std::vector<G4int> fCalPhi; 0107 /// Cell ID of z axis to be stored in ntuple 0108 std::vector<G4int> fCalZ; 0109 /// Physical cell energy deposits to be stored in ntuple 0110 std::vector<G4double> fCalPhysicalEdep; 0111 /// Physical layer ID to be stored in ntuple 0112 std::vector<G4int> fCalPhysicalLayer; 0113 /// Physical slice ID to be stored in ntuple 0114 std::vector<G4int> fCalPhysicalSlice; 0115 /// Physical row ID to be stored in ntuple 0116 std::vector<G4int> fCalPhysicalRow; 0117 }; 0118 0119 #endif /* PAR04EVENTACTION_HH */
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|