-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add support for TVirtualMCSensitiveDetector. #889
Draft
kresan
wants to merge
9
commits into
FairRootGroup:dev
Choose a base branch
from
kresan:feature_sensitive_volumes
base: dev
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.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d814770
Add support for TVirtualMCSensitiveDetector.
kresan 0197d72
Fix Pixel detector
karabowi da87fd5
Update the feature_sensitive_volumes PR
karabowi 9af52a8
Apply format
karabowi 6196ba0
Fix the construction of cloned sensitive volumes
karabowi 3938cbd
Override two functions in FairMCApplication
karabowi 9b9d611
Fix the double initialization of FairDetector
karabowi 17b1c99
TVirtualMCSensitiveDetector: Cleanup of functions
karabowi e34b574
TVirtualMCSensitiveDetector: example/Tutorial1 fixup
karabowi 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 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,5 @@ | ||||||||||||||||||
/******************************************************************************** | ||||||||||||||||||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * | ||||||||||||||||||
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * | ||||||||||||||||||
* * | ||||||||||||||||||
* This software is distributed under the terms of the * | ||||||||||||||||||
* GNU Lesser General Public Licence (LGPL) version 3, * | ||||||||||||||||||
|
@@ -45,9 +45,13 @@ class FairDetector : public FairModule | |||||||||||||||||
*/ | ||||||||||||||||||
virtual void Initialize(); | ||||||||||||||||||
/** | ||||||||||||||||||
this method is called for each step during simulation (see FairMCApplication::Stepping()) | ||||||||||||||||||
this method is called for each step during simulation by the VMC | ||||||||||||||||||
*/ | ||||||||||||||||||
virtual Bool_t ProcessHits(FairVolume* v = 0) = 0; | ||||||||||||||||||
virtual void ProcessHits(); | ||||||||||||||||||
/** | ||||||||||||||||||
DEPRACTED method, currently called by void FairDetector::ProcessHits() | ||||||||||||||||||
*/ | ||||||||||||||||||
virtual Bool_t ProcessHits(FairVolume* v = 0) { return false; } | ||||||||||||||||||
Comment on lines
+51
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please consider Doxygen and C++ deprecation annotations?
Suggested change
|
||||||||||||||||||
/** | ||||||||||||||||||
this is called at the end of an event after the call to tree fill in the FairRootManager | ||||||||||||||||||
*/ | ||||||||||||||||||
|
@@ -105,8 +109,6 @@ class FairDetector : public FairModule | |||||||||||||||||
/** Assignment operator */ | ||||||||||||||||||
FairDetector& operator=(const FairDetector&); | ||||||||||||||||||
|
||||||||||||||||||
void DefineSensitiveVolumes(); | ||||||||||||||||||
|
||||||||||||||||||
Int_t fDetId; // Detector Id has to be set from ctr. | ||||||||||||||||||
FairLogger* fLogger; //! /// FairLogger | ||||||||||||||||||
|
||||||||||||||||||
|
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 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -39,6 +39,7 @@ class FairRootManager; | |||||||||||||||||
class FairTask; | ||||||||||||||||||
class FairTrajFilter; | ||||||||||||||||||
class FairVolume; | ||||||||||||||||||
class FairModule; | ||||||||||||||||||
class FairRunSim; | ||||||||||||||||||
class TChain; | ||||||||||||||||||
class TIterator; | ||||||||||||||||||
|
@@ -105,6 +106,12 @@ class FairMCApplication : public TVirtualMCApplication | |||||||||||||||||
Bool_t MisalignGeometry() override; | ||||||||||||||||||
/** Define parameters for optical processes (optional) */ | ||||||||||||||||||
void ConstructOpGeometry() override; // MC Application | ||||||||||||||||||
|
||||||||||||||||||
/** set sensitive detectors following TVirtualMCSensitiveDetector logic */ | ||||||||||||||||||
void ConstructSensitiveDetectors() override; // MC Application | ||||||||||||||||||
|
||||||||||||||||||
/** Define actions just before sensitive->EndOfEvent */ | ||||||||||||||||||
void EndOfEvent() override; // MC Application | ||||||||||||||||||
/** Define actions at the end of event */ | ||||||||||||||||||
void FinishEvent() override; // MC Application | ||||||||||||||||||
/** Define actions at the end of primary track */ | ||||||||||||||||||
|
@@ -222,6 +229,11 @@ class FairMCApplication : public TVirtualMCApplication | |||||||||||||||||
*/ | ||||||||||||||||||
FairMCApplicationState GetState() const { return fState; } | ||||||||||||||||||
|
||||||||||||||||||
/** | ||||||||||||||||||
* Add module to the list of sensitive detectors. | ||||||||||||||||||
*/ | ||||||||||||||||||
void AddSensitiveModule(std::string volName, FairModule* module); | ||||||||||||||||||
|
||||||||||||||||||
/** | ||||||||||||||||||
* Return non-owning pointer to FairRadGridManager | ||||||||||||||||||
*/ | ||||||||||||||||||
|
@@ -232,6 +244,11 @@ class FairMCApplication : public TVirtualMCApplication | |||||||||||||||||
*/ | ||||||||||||||||||
auto GetIsMT() { return fMC ? fMC->IsMT() : false; } | ||||||||||||||||||
|
||||||||||||||||||
/** | ||||||||||||||||||
* Method introduced temporarily. It should go awway with DEPRACATED Bool_t FairDetector::ProcessHits() | ||||||||||||||||||
*/ | ||||||||||||||||||
FairVolume* GetFairVolume(); | ||||||||||||||||||
Comment on lines
+247
to
+250
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about using C++ deprecations?
Suggested change
(And doxygen deprecations in addition?) |
||||||||||||||||||
|
||||||||||||||||||
private: | ||||||||||||||||||
// methods | ||||||||||||||||||
Int_t GetIonPdg(Int_t z, Int_t a) const; | ||||||||||||||||||
|
@@ -333,6 +350,12 @@ class FairMCApplication : public TVirtualMCApplication | |||||||||||||||||
*/ | ||||||||||||||||||
std::vector<FairModule*> fListModules{}; //! | ||||||||||||||||||
|
||||||||||||||||||
/** | ||||||||||||||||||
* List of sensitive detectors. | ||||||||||||||||||
* To be used with TVirtualMCSensitiveDetector. | ||||||||||||||||||
*/ | ||||||||||||||||||
std::map<std::string, FairModule*> fMapSensitiveDetectors; | ||||||||||||||||||
|
||||||||||||||||||
/** | ||||||||||||||||||
* Owned Modules (inside the worker) | ||||||||||||||||||
*/ | ||||||||||||||||||
|
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.
I am confused…
The message says not to call the method with
(FairVolume* vol)
and recommends to call the()
one.But this warning message is shown inside the
()
one?What am I missing? I guess, I must have misunderstood something?
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.
Okay, having looked at it again… Now I understand more!
Maybe rephrase to somethig like "Please override / implement ProcessHits on " << GetName() << " instead of the old ProcessHits(FairVolume*)".