-
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.
Merge pull request #650 from kochebina/Buffer
Buffer for GND
- Loading branch information
Showing
5 changed files
with
359 additions
and
171 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 |
---|---|---|
|
@@ -6,59 +6,80 @@ of the GNU Lesser General Public Licence (LGPL) | |
See LICENSE.md for further details | ||
----------------------*/ | ||
|
||
// OK GND 2022 | ||
|
||
|
||
/*! \class GateBuffer | ||
\brief GateBuffer mimics the effect of limited transfer rate | ||
5/12/2023 added to GND by [email protected] | ||
\sa GateBuffer, GateBufferMessenger | ||
*/ | ||
|
||
#ifndef GateBuffer_h | ||
#define GateBuffer_h 1 | ||
|
||
#include "GateVDigitizerModule.hh" | ||
#include "GateDigi.hh" | ||
#include "GateClockDependent.hh" | ||
#include "GateCrystalSD.hh" | ||
|
||
#include "globals.hh" | ||
#include <iostream> | ||
#include <vector> | ||
|
||
#include "GateVPulseProcessor.hh" | ||
#include "GatePulse.hh" | ||
#include "GateBufferMessenger.hh" | ||
#include "GateSinglesDigitizer.hh" | ||
|
||
|
||
class GateBufferMessenger; | ||
class GateVDistribution; | ||
class GateBuffer : public GateVPulseProcessor | ||
class GateBuffer : public GateVDigitizerModule | ||
{ | ||
public: | ||
typedef unsigned long long int buffer_t; | ||
|
||
GateBuffer(GatePulseProcessorChain* itsChain, | ||
const G4String& itsName=theTypeName) ; | ||
|
||
//! Destructor | ||
virtual ~GateBuffer() ; | ||
|
||
|
||
//! Implementation of the pure virtual method declared by the base class GateDigitizerComponent | ||
//! print-out the attributes specific of the blurring | ||
void SetBufferSize(buffer_t val) { m_bufferSize = val;} | ||
void SetReadFrequency(G4double val) { m_readFrequency = val;} | ||
void SetDoModifyTime(G4bool val) { m_doModifyTime = val;} | ||
void SetMode(G4int val) { m_mode = val;} | ||
void SetDepth(size_t depth); | ||
virtual void DescribeMyself(size_t indent); | ||
|
||
protected: | ||
//! Implementation of the pure virtual method declared by the base class GateVPulseProcessor | ||
//! This methods processes one input-pulse | ||
//! It is is called by ProcessPulseList() for each of the input pulses | ||
//! The result of the pulse-processing is incorporated into the output pulse-list | ||
|
||
virtual void ProcessOnePulse(const GatePulse* inputPulse,GatePulseList& outputPulseList); | ||
private: | ||
buffer_t m_bufferSize; | ||
std::vector<buffer_t> m_bufferPos; | ||
buffer_t m_oldClock; | ||
G4double m_readFrequency; | ||
G4bool m_doModifyTime; | ||
G4int m_mode; | ||
std::vector<G4bool> m_enableList; | ||
GateBufferMessenger *m_messenger; //!< Messenger | ||
|
||
static const G4String& theTypeName; //!< Default type-name for all buffers | ||
}; | ||
public: | ||
|
||
typedef unsigned long long int Buffer_t; | ||
|
||
GateBuffer(GateSinglesDigitizer *digitizer, G4String name); | ||
~GateBuffer(); | ||
|
||
void Digitize() override; | ||
|
||
//! Implementation of the pure virtual method declared by the base class GateDigitizerComponent | ||
//! print-out the attributes specific of the blurring | ||
void SetBufferSize(Buffer_t val) { m_BufferSize = val;} | ||
void SetReadFrequency(G4double val) { m_readFrequency = val;} | ||
void SetDoModifyTime(G4bool val) { m_doModifyTime = val;} | ||
void SetMode(G4int val) { m_mode = val;} | ||
void SetDepth(size_t depth); | ||
|
||
void DescribeMyself(size_t ); | ||
|
||
protected: | ||
Buffer_t m_BufferSize; | ||
std::vector<Buffer_t> m_BufferPos; | ||
Buffer_t m_oldClock; | ||
G4double m_readFrequency; | ||
G4bool m_doModifyTime; | ||
G4int m_mode; | ||
std::vector<G4bool> m_enableList; | ||
|
||
private: | ||
GateDigi* m_outputDigi; | ||
|
||
GateBufferMessenger *m_Messenger; | ||
|
||
GateDigiCollection* m_OutputDigiCollection; | ||
|
||
GateSinglesDigitizer *m_digitizer; | ||
|
||
static const G4String& theTypeName; //!< Default type-name for all Buffers | ||
|
||
}; | ||
|
||
#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
Oops, something went wrong.