-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After adding the DiscretizerModule Files
- Loading branch information
Marc Granado
committed
Sep 18, 2024
1 parent
83f199c
commit 7655ede
Showing
4 changed files
with
255 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/*---------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
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 | ||
*/ | ||
|
||
|
||
/*! \class GateDummyDigitizerModule | ||
\brief GateDummyDigitizerModule does some dummy things with input digi | ||
to create output digi | ||
- GateDummyDigitizerModule - by name.surname@email.com | ||
\sa GateDummyDigitizerModule, GateDummyDigitizerModuleMessenger | ||
*/ | ||
|
||
#ifndef GateDummyDigitizerModule_h | ||
#define GateDummyDigitizerModule_h 1 | ||
|
||
#include "GateVDigitizerModule.hh" | ||
#include "GateDigi.hh" | ||
#include "GateClockDependent.hh" | ||
#include "GateCrystalSD.hh" | ||
|
||
#include "globals.hh" | ||
|
||
#include "GateDummyDigitizerModuleMessenger.hh" | ||
#include "GateSinglesDigitizer.hh" | ||
|
||
|
||
class GateDummyDigitizerModule : public GateVDigitizerModule | ||
{ | ||
public: | ||
|
||
GateDummyDigitizerModule(GateSinglesDigitizer *digitizer, G4String name); | ||
~GateDummyDigitizerModule(); | ||
|
||
void Digitize() override; | ||
|
||
// *******implement your methods here | ||
void SetDummyParameter(const G4String& ); | ||
|
||
void DummyMethod1(GateDigi *); | ||
void DummyMethod2(GateDigi *); | ||
|
||
void DescribeMyself(size_t ); | ||
|
||
protected: | ||
// *******implement your parameters here | ||
G4String m_parameter; | ||
|
||
private: | ||
GateDigi* m_outputDigi; | ||
|
||
GateDummyDigitizerModuleMessenger *m_Messenger; | ||
|
||
GateDigiCollection* m_OutputDigiCollection; | ||
|
||
GateSinglesDigitizer *m_digitizer; | ||
|
||
|
||
}; | ||
|
||
#endif | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
60 changes: 60 additions & 0 deletions
60
source/digits_hits/include/GateDiscretizerModuleMessenger.hh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/*---------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
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 | ||
*/ | ||
|
||
|
||
/*! \class GateDummyDigitizerModuleMessenger | ||
\brief Messenger for the GateDummyDigitizerModule | ||
- GateDummyDigitizerModule - by name.surname@email.com | ||
\sa GateDummyDigitizerModule, GateDummyDigitizerModuleMessenger | ||
*/ | ||
|
||
|
||
#ifndef GateDummyDigitizerModuleMessenger_h | ||
#define GateDummyDigitizerModuleMessenger_h 1 | ||
|
||
#include "G4UImessenger.hh" | ||
#include "globals.hh" | ||
|
||
#include "GateClockDependentMessenger.hh" | ||
class GateDummyDigitizerModule; | ||
class G4UIcmdWithAString; | ||
|
||
class GateDummyDigitizerModuleMessenger : public GateClockDependentMessenger | ||
{ | ||
public: | ||
|
||
GateDummyDigitizerModuleMessenger(GateDummyDigitizerModule*); | ||
~GateDummyDigitizerModuleMessenger(); | ||
|
||
void SetNewValue(G4UIcommand*, G4String); | ||
|
||
|
||
private: | ||
GateDummyDigitizerModule* m_DummyDigitizerModule; | ||
G4UIcmdWithAString *dummyCmd; | ||
|
||
|
||
}; | ||
|
||
#endif | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*---------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
See LICENSE.md for further details | ||
----------------------*/ | ||
|
||
// OK GND 2022 | ||
/*! | ||
\class GateDiscretizer (by marc.granado@universite-paris-saclay.fr) | ||
\brief for discretizing the position within a monolithic crystal | ||
- For each volume the local position of the interactions within the crystal are discretized. | ||
the X,Y,Z vector is translated into the IDs of virtual divisions within the crystal | ||
ocuppying the levels of SubmoduleID, CrystalID and LayerID. | ||
*/ | ||
|
||
|
||
#include "GateDigi.hh" | ||
|
||
#include "GateDigitizerMgr.hh" | ||
|
||
#include "G4SystemOfUnits.hh" | ||
#include "G4EventManager.hh" | ||
#include "G4Event.hh" | ||
#include "G4SDManager.hh" | ||
#include "G4DigiManager.hh" | ||
#include "G4ios.hh" | ||
#include "G4UnitsTable.hh" | ||
|
||
|
||
GateDiscretizer::GateDiscretizer(GateSinglesDigitizer *digitizer, G4String name) | ||
:GateVDigitizerModule(name,"digitizerMgr/"+digitizer->GetSD()->GetName()+"/SinglesDigitizer/"+digitizer->m_digitizerName+"/"+name,digitizer, digitizer->GetSD()), | ||
m_outputDigi(0), | ||
m_OutputDigiCollection(0), | ||
m_digitizer(digitizer) | ||
{ | ||
|
||
} | ||
|
||
|
||
GateDiscretizer::GateDiscretizer() | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/*---------------------- | ||
Copyright (C): OpenGATE Collaboration | ||
This software is distributed under the terms | ||
of the GNU Lesser General Public Licence (LGPL) | ||
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 | ||
*/ | ||
|
||
#include "GateDummyDigitizerModuleMessenger.hh" | ||
#include "GateDummyDigitizerModule.hh" | ||
#include "GateDigitizerMgr.hh" | ||
|
||
#include "G4SystemOfUnits.hh" | ||
#include "G4UIcmdWithAString.hh" | ||
#include "G4UIdirectory.hh" | ||
|
||
|
||
|
||
GateDummyDigitizerModuleMessenger::GateDummyDigitizerModuleMessenger (GateDummyDigitizerModule* DummyDigitizerModule) | ||
:GateClockDependentMessenger(DummyDigitizerModule), | ||
m_DummyDigitizerModule(DummyDigitizerModule) | ||
{ | ||
G4String guidance; | ||
G4String cmdName; | ||
|
||
cmdName = GetDirectoryName()+"positionPolicy"; | ||
dummyCmd = new G4UIcmdWithAString(cmdName,this); | ||
dummyCmd->SetGuidance("How to generate position"); | ||
dummyCmd->SetCandidates("energyWeightedCentroid takeEnergyWinner"); | ||
|
||
} | ||
|
||
|
||
GateDummyDigitizerModuleMessenger::~GateDummyDigitizerModuleMessenger() | ||
{ | ||
delete dummyCmd; | ||
} | ||
|
||
|
||
void GateDummyDigitizerModuleMessenger::SetNewValue(G4UIcommand * aCommand,G4String newValue) | ||
{ | ||
if (aCommand ==dummyCmd) | ||
{ | ||
m_DummyDigitizerModule->SetDummyParameter(newValue); | ||
} | ||
else | ||
{ | ||
GateClockDependentMessenger::SetNewValue(aCommand,newValue); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|