File indexing completed on 2025-01-31 09:22:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #ifndef PHYSANALYSIS_h
0031 #define PHYSANALYSIS_h 1
0032
0033 #include "G4ThreeVector.hh"
0034 #include <map>
0035 #include "G4AnalysisManager.hh"
0036
0037
0038
0039 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
0040 TypeName(const TypeName&); \
0041 void operator=(const TypeName&)
0042
0043
0044
0045 struct InfoForChemGeo
0046 {
0047 G4double fType{0.};
0048 G4double fState{-99.};
0049 G4double fElectronicLevel{-99.};
0050 G4double fX{0.};
0051 G4double fY{0.};
0052 G4double fZ{0.};
0053 G4double fParentTrackID{-1.};
0054 G4double fEventNumber{-1.};
0055 G4double fVolume{-1.};
0056 G4double fVolumeCopyNumber{-1.};
0057 G4double fMotherVolume{-1.};
0058 G4double fMotherVolumeCopyNumber{-1.};
0059 G4double fRelX{-1.};
0060 G4double fRelY{-1.};
0061 G4double fRelZ{-1.};
0062 };
0063
0064
0065
0066 struct InfoInPhysStage
0067 {
0068 G4double fFlagParticle{-1.};
0069 G4double fFlagParentID{-1.};
0070 G4double fFlagProcess{-1.};
0071 G4double fX{-1.};
0072 G4double fY{-1.};
0073 G4double fZ{-1.};
0074 G4double fEdep{-1.};
0075 G4double fEventNumber{-1.};
0076 G4double fVolumeName{-1.};
0077 G4double fCopyNumber{-1.};
0078 G4double fLastMetVoxelCopyNum{-1.};
0079 };
0080
0081
0082
0083 class PhysAnalysis
0084 {
0085 public:
0086 ~PhysAnalysis() = default;
0087 static PhysAnalysis* GetAnalysis();
0088
0089 void OpenFile(const G4String& fname);
0090 void Save();
0091 void Close(G4bool reset = true);
0092
0093 void Book();
0094 G4AnalysisManager* GetAnalysisManager();
0095 void ClearVector() ;
0096 void AddInfoForChemGeo(InfoForChemGeo);
0097 void AddInfoInPhysStage(InfoInPhysStage);
0098 void UpdateChemInputDataAndFillNtuple();
0099 private:
0100 PhysAnalysis() = default;
0101 G4String CreateChemInputFile(G4int eventNum,G4int volumeCopyNumber,const G4String &voxelName);
0102 void UpdatingChemInputFile(InfoForChemGeo);
0103 void UpdatingChemInputFile(InfoInPhysStage);
0104 std::vector<InfoForChemGeo> fInfoForChemGeoVector;
0105 std::vector<InfoInPhysStage> fInfoInPhysStageVector;
0106 std::map<G4double, std::map<G4double, G4String> > fOutputFiles;
0107 G4String fOutputFolder="";
0108 DISALLOW_COPY_AND_ASSIGN(PhysAnalysis);
0109 };
0110
0111
0112
0113 #endif