Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to upstream-gate #25

Open
wants to merge 15 commits into
base: upstream-gate
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
1a22548
Update for saving information about prompt scatters in phantom and cr…
sparzych Jan 12, 2023
fc7bf87
Small visual fixes like indentations
sparzych Jan 12, 2023
04cdaae
style:code is more readable without commented out code
BlurredChoise Feb 22, 2023
8da55db
style:code is more readable with corrected tabulation and added brackets
BlurredChoise Feb 22, 2023
fb3f26e
feat:new structure simplifies the RecordEndOfEvent method code
BlurredChoise Feb 22, 2023
be84582
feat:separation of phantom scatterings collection from the RecordEndO…
BlurredChoise Feb 22, 2023
8d719fa
fix:class GateSteppingAction has const method GetMode
BlurredChoise Feb 22, 2023
414ebab
feat:separation of ComptonRayleighData updates from the RecordEndOfEv…
BlurredChoise Feb 22, 2023
15e30df
feat:separation of crystal scatterings collection from the RecordEndO…
BlurredChoise Feb 22, 2023
a1ead1c
feat:separation of setting photonIDs from the RecordEndOfEvent method…
BlurredChoise Feb 22, 2023
1840f79
style:removed commented out code,edited tabulation and new brackets m…
BlurredChoise Feb 22, 2023
18b1d86
feat:allows to determine whether we are working with the positronium …
BlurredChoise Feb 22, 2023
8dbca0f
feat:methods to find photons IDs are in the separated methods
BlurredChoise Mar 3, 2023
7f739ab
fixing the photonID saved in output to separate prompt and annihilati…
sparzych Jul 12, 2023
53a67ed
fix in GateTrajectoryNavigator to avoid repetition in filling of m_ph…
sparzych Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/digits_hits/include/GateActions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public :
void StopOnBoundary(G4int aI);
void StopAndKill(G4String aString);
void SetMode( TrackingMode aMode);
TrackingMode GetMode();
TrackingMode GetMode() const;
void SetTxtOut(G4String aString);
G4int GetTxtOn() { return TxtOn;};
void SetEnergyThreshold(G4double);
Expand Down
28 changes: 28 additions & 0 deletions source/digits_hits/include/GateAnalysis.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See LICENSE.md for further details
#define GateAnalysis_H

#include "GateVOutputModule.hh"
#include "GateCrystalHit.hh"


class GateTrajectoryNavigator;
Expand All @@ -26,6 +27,16 @@ class GateAnalysis : public GateVOutputModule
{
public:

struct PhotonScatterings {
G4int nPhantomCompton = 0;
G4int nPhantomRayleigh = 0;
G4int nCrystalCompton = 0;
G4int nCrystalRayleigh = 0;
G4int photonID = 0;
G4String theComptonVolumeName = G4String("NULL");
G4String theRayleighVolumeName = G4String("NULL");
};

GateAnalysis(const G4String& name, GateOutputMgr* outputMgr,DigiMode digiMode);
virtual ~GateAnalysis();
const G4String& GiveNameOfFile();
Expand Down Expand Up @@ -57,6 +68,23 @@ public:
inline G4bool GetRecordSeptalFlag() const { return m_recordSeptalFlag; }
inline void SetSeptalPhysVolumeName(const G4String& name) { m_septalPhysVolumeName = name; }
inline void SetRecordSeptalFlag(G4bool flag) { m_recordSeptalFlag = flag; }

void CollectPhantomScatterings(std::vector<PhotonScatterings>& photon_scatterings, G4int& septalNb);
void UpdateComptonRayleighDataFromScatterings(const std::vector<PhotonScatterings>& photon_scatterings);
void UpdateScatteringsFromComptonRayleighData(std::vector<PhotonScatterings>& photon_scatterings);
void MakeComptonRayleighDataUpdates(std::vector<PhotonScatterings>& photon_scatterings);
void SetCrystalScatterings(std::vector<PhotonScatterings>& photon_scatterings, GateCrystalHit* hit);
void UpdateHitDataForAnalysis(
std::vector<PhotonScatterings>& photon_scatterings, GateCrystalHit* hit,
const G4int septalNb,
const G4int sourceID,
const G4int eventID,
const G4int runID,
const G4ThreeVector& sourceVertex,
const G4int gammaType
);
void CollectCrystalScatterings(std::vector<PhotonScatterings>& photon_scatterings, const G4int septalNb, GateCrystalHitsCollection* CHC, const G4int eventID);
void SetPhotonIDs(std::vector<PhotonScatterings>& photon_scatterings);

private:

Expand Down
28 changes: 28 additions & 0 deletions source/digits_hits/include/GatePositroniumDecayInfo.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef POSITRONIUM_DECAY_INFO_HH
#define POSITRONIUM_DECAY_INFO_HH
#include "GateCrystalHit.hh"
#include <set>

namespace GatePositroniumDecay {
enum class GammaType {Unknown = 0,SinglePhoton = 1,AnnihilationPhoton = 2,PromptPhoton = 3};
enum class SourceType {Unknown = 0, SingleGamaEmitter = 1, ParaPositronium = 2, OrthoPositronium = 3 };
enum class DecayType {Unknown = 0, StandardChannel = 1, DeexciatationChannel = 2};

GammaType IntToGammaType(const G4int value);
SourceType IntToSourceType(const G4int value);
DecayType IntToDecayType(const G4int value);
G4int GetMaxPhotonsNumber(const SourceType source_type,const DecayType decay_type);

class GatePositroniumDecayInfo {
public:
void Fill(const GateCrystalHitsCollection* collection);
bool HasGamma(const GammaType gamma_type) const;
bool HasSource(const SourceType source_type) const;
bool HasDecay(const DecayType decay_type) const;
private:
std::set<GammaType> gammaTypes;
std::set<SourceType> sourceTypes;
std::set<DecayType> decayTypes;
};
}
#endif
6 changes: 3 additions & 3 deletions source/digits_hits/include/GateToRoot.hh
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ class GateTrajectoryNavigator;

class ComptonRayleighData {
public:
G4int photon1_phantom_Rayleigh, photon2_phantom_Rayleigh;
G4int photon1_phantom_compton, photon2_phantom_compton;
Char_t theComptonVolumeName1[60], theComptonVolumeName2[60], theRayleighVolumeName1[60], theRayleighVolumeName2[60];
G4int photon1_phantom_Rayleigh,photon2_phantom_Rayleigh,photon3_phantom_Rayleigh;
G4int photon1_phantom_compton , photon2_phantom_compton,photon3_phantom_compton;
Char_t theComptonVolumeName1[60] , theComptonVolumeName2[60], theComptonVolumeName3[60], theRayleighVolumeName1[60], theRayleighVolumeName2[60], theRayleighVolumeName3[60];

ComptonRayleighData(ComptonRayleighData &);

Expand Down
39 changes: 21 additions & 18 deletions source/digits_hits/include/GateTrajectoryNavigator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,46 @@ public:
virtual ~GateTrajectoryNavigator();


G4int FindSourceIndex();
G4int FindSourceIndex();

G4ThreeVector FindSourcePosition();

G4int FindPositronTrackID();
G4int FindPositronTrackID();

std::vector<G4int> FindAnnihilationGammasTrackID();

G4int FindPhotonID(G4int trackID);
G4int FindPhotonID(G4int trackID);

G4int FindPrimaryID(G4int trackID);
G4int FindPrimaryID(G4int trackID);

void Initialize();
void Initialize();

void SetTrajectoryContainer(G4TrajectoryContainer* trajectoryContainer);
void SetTrajectoryContainer(G4TrajectoryContainer* trajectoryContainer);

inline G4TrajectoryContainer* GetTrajectoryContainer() { return m_trajectoryContainer; };
inline G4TrajectoryContainer* GetTrajectoryContainer() { return m_trajectoryContainer; };

inline std::vector<G4int> GetPhotonIDVec() { return m_photonIDVec; };
inline std::vector<G4int> GetPhotonIDVec() { return m_photonIDVec; };

inline G4int GetPositronTrackID() { return m_positronTrackID; };
inline G4int GetPositronTrackID() { return m_positronTrackID; };

void SetIonID();
void SetIonID();

void SetVerboseLevel(G4int val) { nVerboseLevel = val; };
void SetVerboseLevel(G4int val) { nVerboseLevel = val; };

protected:

std::vector<G4int> GetPhotonIndices();
void FillPhotonIDsForThreePhotons(std::vector<G4int>& photonIndices, bool& only2gamma);
void FillPhotonIDsForTwoPhotons(std::vector<G4int>& photonIndices);

private:
G4TrajectoryContainer* m_trajectoryContainer;
G4TrajectoryContainer* m_trajectoryContainer = NULL;

std::vector<G4int> m_photonIDVec;
G4int m_positronTrackID;
G4Trajectory* m_positronTrj;
G4int m_ionID;

G4int nVerboseLevel;
std::vector<G4int> m_photonIDVec;
G4int m_positronTrackID = 0;
G4Trajectory* m_positronTrj = NULL;
G4int m_ionID = 0;
G4int nVerboseLevel = 0;
};


Expand Down
2 changes: 1 addition & 1 deletion source/digits_hits/src/GateActions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void GateSteppingAction::SetMode( TrackingMode aMode)
m_trackingMode = aMode;
}

TrackingMode GateSteppingAction::GetMode()
TrackingMode GateSteppingAction::GetMode() const
{ return m_trackingMode;}

//-----------------------------------------------------------------------------
Expand Down
Loading