Skip to content

Commit

Permalink
Addition of a new method for ChangeOutputID and new methods implement…
Browse files Browse the repository at this point in the history
…ed in DiscretizerModule
  • Loading branch information
Marc Granado committed Sep 18, 2024
1 parent 7655ede commit 6c581e1
Show file tree
Hide file tree
Showing 10 changed files with 522 additions and 53 deletions.
1 change: 1 addition & 0 deletions source/digits_hits/include/GateDigi.hh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public:
inline G4double GetScannerRotAngle() const { return m_scannerRotAngle; }

inline void SetOutputVolumeID(const GateOutputVolumeID& outputVolumeID) { m_outputVolumeID = outputVolumeID; }
inline void SetOutputVolumeID(const G4int outputVolumeID,G4int depth) { m_outputVolumeID[depth] = outputVolumeID; }
inline const GateOutputVolumeID& GetOutputVolumeID() const { return m_outputVolumeID; }
inline G4int GetComponentID(size_t depth) const { return (m_outputVolumeID.size()>depth) ? m_outputVolumeID[depth] : -1; }

Expand Down
70 changes: 51 additions & 19 deletions source/digits_hits/include/GateDiscretizerModule.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ See LICENSE.md for further details
// OK GND 2022
/*This class is not used by GATE !
The purpose of this class is to help to create new users digitizer module(DM).
Please, check GateDummyDigitizerModule.cc for more detals
Please, check GateDiscretizerModule.cc for more detals
*/


/*! \class GateDummyDigitizerModule
\brief GateDummyDigitizerModule does some dummy things with input digi
/*! \class GateDiscretizerModule
\brief GateDiscretizerModule does some dummy things with input digi
to create output digi
- GateDummyDigitizerModule - by name.surname@email.com
- GateDiscretizerModule - by marc.granado@universite-paris-saclay.fr
\sa GateDummyDigitizerModule, GateDummyDigitizerModuleMessenger
\sa GateDiscretizerModule, GateDiscretizerModuleMessenger
*/

#ifndef GateDummyDigitizerModule_h
#define GateDummyDigitizerModule_h 1
#ifndef GateDiscretizerModule_h
#define GateDiscretizerModule_h 1

#include "GateVDigitizerModule.hh"
#include "GateDigi.hh"
Expand All @@ -32,35 +32,67 @@ See LICENSE.md for further details

#include "globals.hh"

#include "GateDummyDigitizerModuleMessenger.hh"
#include "GateDiscretizerModuleMessenger.hh"
#include "GateSinglesDigitizer.hh"


class GateDummyDigitizerModule : public GateVDigitizerModule
class GateDiscretizerModule : public GateVDigitizerModule
{
public:

GateDummyDigitizerModule(GateSinglesDigitizer *digitizer, G4String name);
~GateDummyDigitizerModule();
GateDiscretizerModule(GateSinglesDigitizer *digitizer, G4String name);
~GateDiscretizerModule();

void Digitize() override;

// *******implement your methods here
void SetDummyParameter(const G4String& );

void DummyMethod1(GateDigi *);
void DummyMethod2(GateDigi *);
//! These functions return the resolution in use.
G4String GetNameAxis() { return m_nameAxis; }
G4double GetResolution() { return m_resolution; }
G4double GetResolutionX() { return m_resolutionX; }
G4double GetResolutionY() { return m_resolutionY; }
G4double GetResolutionZ() { return m_resolutionZ; }

G4double calculatePitch(G4double crystal_size, G4double spatial_resolution);


//Set Parameter
void SetNameAxis(const G4String&);



//Set Variables
void SetResolution(G4double val) { m_resolution = val; }
void SetResolutionX(G4double val) { m_resolutionX = val; }
void SetResolutionY(G4double val) { m_resolutionY = val; }
void SetResolutionZ(G4double val) { m_resolutionZ = val; }

void DescribeMyself(size_t );

void SetVirtualIDs(int nBinsX, int nBinsY,int nBinsZ, G4ThreeVector& pos);
void DescribeMyself(size_t );

protected:
// *******implement your parameters here
G4String m_parameter;
G4double m_resolution;

G4String m_nameAxis;
G4double m_resolutionX;
G4double m_resolutionY;
G4double m_resolutionZ;


//These are in Spatial resolution but aren't there rom touchable?
//We'll need to check

//G4Navigator* m_Navigator;
//G4TouchableHistoryHandle m_Touchable;

private:

G4int m_systemDepth;

GateDigi* m_outputDigi;

GateDummyDigitizerModuleMessenger *m_Messenger;
GateDiscretizerModuleMessenger *m_Messenger;

GateDigiCollection* m_OutputDigiCollection;

Expand Down
30 changes: 17 additions & 13 deletions source/digits_hits/include/GateDiscretizerModuleMessenger.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,48 @@ See LICENSE.md for further details
// OK GND 2022
/*This class is not used by GATE !
The purpose of this class is to help to create new users digitizer module(DM).
Please, check GateDummyDigitizerModule.cc for more detals
Please, check GateDiscretizerModule.cc for more detals
*/


/*! \class GateDummyDigitizerModuleMessenger
\brief Messenger for the GateDummyDigitizerModule
/*! \class GateDiscretizerModuleMessenger
\brief Messenger for the GateDiscretizerModule
- GateDummyDigitizerModule - by name.surname@email.com
- GateDiscretizerModule - by marc.granado@universite-paris-saclay.fr
\sa GateDummyDigitizerModule, GateDummyDigitizerModuleMessenger
\sa GateDiscretizerModule, GateDiscretizerModuleMessenger
*/


#ifndef GateDummyDigitizerModuleMessenger_h
#define GateDummyDigitizerModuleMessenger_h 1
#ifndef GateDiscretizerModuleMessenger_h
#define GateDiscretizerModuleMessenger_h 1

#include "G4UImessenger.hh"
#include "globals.hh"

#include "GateClockDependentMessenger.hh"
class GateDummyDigitizerModule;
class GateDiscretizerModule;
class G4UIcmdWithAString;

class GateDummyDigitizerModuleMessenger : public GateClockDependentMessenger
class GateDiscretizerModuleMessenger : public GateClockDependentMessenger
{
public:

GateDummyDigitizerModuleMessenger(GateDummyDigitizerModule*);
~GateDummyDigitizerModuleMessenger();
GateDiscretizerModuleMessenger(GateDiscretizerModule*);
~GateDiscretizerModuleMessenger();

void SetNewValue(G4UIcommand*, G4String);


private:
GateDummyDigitizerModule* m_DummyDigitizerModule;
G4UIcmdWithAString *dummyCmd;
GateDiscretizerModule* m_DiscretizerModule;

G4UIcmdWithAString* nameAxisCmd;

G4UIcmdWithADouble* resCmd;
G4UIcmdWithADouble* resolutionXCmd;
G4UIcmdWithADouble* resolutionYCmd;
G4UIcmdWithADouble* resolutionZCmd;
};

#endif
Expand Down
3 changes: 3 additions & 0 deletions source/digits_hits/src/GateDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ void GateDigi::ChangeVolumeIDAndOutputVolumeIDValue(size_t depth, G4int copyNo)
delete volSelector;
// Finally change the outputVolumeID accordingly
m_outputVolumeID[depth] = copyNo;

//With the new method the line above could be changed to:
//SetOutputVolumeID(copyNo,depth)
}


Expand Down
Loading

0 comments on commit 6c581e1

Please sign in to comment.