-
Notifications
You must be signed in to change notification settings - Fork 2
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
Process for veto analysis #20
Open
lobis
wants to merge
13
commits into
master
Choose a base branch
from
lobis-prepare-for-multithreading
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
23b950c
Added process to analyze veto system events (work in progress)
lobis 020831d
Fixed test
lobis 55dcdcf
Added quenching and attenuation
lobis 84fb469
Added option for drift velocity in veto signal process
lobis cc8f113
work in progress on alternative shaping process
lobis 517314c
merge
lobis 03a969b
Merge remote-tracking branch 'origin/lobis-detector-to-raw-calibratio…
lobis cddbe6a
TRestGeant4ToDetectorSignalVetoProcess - fixed bug with trigger time
lobis 35c1086
Added documentation (addressed https://github.com/rest-for-physics/co…
lobis 13b1683
removed fmt dependency and updated prints
lobis e506611
temp change to pass pipeline
lobis bc9fe63
Merge remote-tracking branch 'origin/master' into lobis-prepare-for-m…
lobis e7216d7
updated validation workflow back to master
lobis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,96 @@ | ||
|
||
#include <TRestDetectorSignalEvent.h> | ||
#include <TRestEventProcess.h> | ||
#include <TRestGeant4Event.h> | ||
#include <TRestGeant4Metadata.h> | ||
|
||
#ifndef RestCore_TRestGeant4ToRawSignalVetoProcess | ||
#define RestCore_TRestGeant4ToRawSignalVetoProcess | ||
|
||
class TRestGeant4ToDetectorSignalVetoProcess : public TRestEventProcess { | ||
private: | ||
TString fVetoVolumesExpression; | ||
TString fVetoDetectorsExpression; | ||
double fVetoDetectorOffsetSize = 0; | ||
double fVetoLightAttenuation = 0; | ||
double fVetoQuenchingFactor = 1.0; | ||
|
||
public: | ||
inline TString GetVetoVolumesExpression() const { return fVetoVolumesExpression; } | ||
inline TString GetVetoDetectorExpression() const { return fVetoDetectorsExpression; } | ||
inline double GetVetoDetectorOffsetSize() const { return fVetoDetectorOffsetSize; } | ||
inline double GetVetoLightAttenuation() const { return fVetoLightAttenuation; } | ||
inline double GetVetoQuenchingFactor() const { return fVetoQuenchingFactor; } | ||
inline std::map<TString, Int_t> GetVetoVolumeToSignalIdMap() const { return fVetoVolumesToSignalIdMap; } | ||
|
||
inline void SetVetoVolumesExpression(const TString& expression) { fVetoVolumesExpression = expression; } | ||
inline void SetVetoDetectorsExpression(const TString& expression) { | ||
fVetoDetectorsExpression = expression; | ||
} | ||
inline void SetVetoDetectorOffsetSize(double offset) { fVetoDetectorOffsetSize = offset; } | ||
inline void SetVetoLightAttenuation(double attenuation) { | ||
if (attenuation < 0) { | ||
std::cerr << "Light attenuation factor must be positive" << std::endl; | ||
exit(1); | ||
} | ||
fVetoLightAttenuation = attenuation; | ||
} | ||
inline void SetVetoQuenchingFactor(double quenchingFactor) { | ||
if (quenchingFactor < 0 || quenchingFactor > 1) { | ||
std::cerr << "Quenching factor must be between 0 and 1" << std::endl; | ||
exit(1); | ||
} | ||
fVetoQuenchingFactor = quenchingFactor; | ||
} | ||
|
||
private: | ||
TRestGeant4Event* fInputEvent = nullptr; //! | ||
TRestDetectorSignalEvent* fOutputEvent = nullptr; //! | ||
const TRestGeant4Metadata* fGeant4Metadata = nullptr; //! | ||
|
||
std::vector<TString> fVetoVolumes; | ||
std::vector<TString> fVetoDetectorVolumes; | ||
std::map<TString, TVector3> fVetoDetectorBoundaryPosition; | ||
std::map<TString, TVector3> fVetoDetectorBoundaryDirection; | ||
|
||
std::map<TString, Int_t> fVetoVolumesToSignalIdMap; | ||
std::set<TString> fParticlesNotQuenched = {"gamma", "e-", "e-", "mu-", "mu+"}; | ||
|
||
bool fDriftEnabled = false; | ||
std::string fDriftVolume; | ||
std::string fDriftReadoutVolume; | ||
double fDriftReadoutOffset = 0; | ||
TVector3 fDriftReadoutNormalDirection = TVector3(0, 0, 1); | ||
double fDriftVelocity = 0; | ||
|
||
void InitFromConfigFile() override; | ||
void Initialize() override; | ||
void LoadDefaultConfig(); | ||
|
||
public: | ||
any GetInputEvent() const override { return fInputEvent; } | ||
any GetOutputEvent() const override { return fOutputEvent; } | ||
|
||
inline void SetGeant4Metadata(const TRestGeant4Metadata* metadata) { | ||
fGeant4Metadata = metadata; | ||
} // TODO: We should not need this! but `GetMetadata<TRestGeant4Metadata>()` is not working early in the | ||
// processing (look at the tests for more details) | ||
|
||
void InitProcess() override; | ||
TRestEvent* ProcessEvent(TRestEvent* inputEvent) override; | ||
void EndProcess() override; | ||
|
||
void LoadConfig(const std::string& configFilename, const std::string& name = ""); | ||
|
||
void PrintMetadata() override; | ||
|
||
const char* GetProcessName() const override { return "Geant4ToDetectorSignalVetoProcess"; } | ||
|
||
TRestGeant4ToDetectorSignalVetoProcess(); | ||
TRestGeant4ToDetectorSignalVetoProcess(const char* configFilename); | ||
~TRestGeant4ToDetectorSignalVetoProcess(); | ||
|
||
ClassDefOverride(TRestGeant4ToDetectorSignalVetoProcess, 1); | ||
}; | ||
|
||
#endif // RestCore_TRestGeant4ToRawSignalVetoProcess |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The process has access to
TRestGeant4Metadata
throughTRestRun
.It is enough to do
fGeant4Metada = GetMetadata<TRestGeant4Metadata>();
as it is done in other processes.Why do you want to set it externally?