-
Notifications
You must be signed in to change notification settings - Fork 98
Add support for TVirtualMCSensitiveDetector. #889
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
base: dev
Are you sure you want to change the base?
Changes from all commits
d814770
0197d72
da87fd5
9af52a8
6196ba0
3938cbd
9b9d611
17b1c99
e34b574
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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() | ||||||||||||||||||
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. Fix typo in comment. "DEPRACTED" should be "DEPRECATED". /**
- DEPRACTED method, currently called by void FairDetector::ProcessHits()
+ DEPRECATED method, currently called by void FairDetector::ProcessHits()
*/ 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||
*/ | ||||||||||||||||||
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 | ||||||||||||||||||
|
||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -39,6 +39,7 @@ class FairRootManager; | |||||||||||||||||
class FairTask; | ||||||||||||||||||
class FairTrajFilter; | ||||||||||||||||||
class FairVolume; | ||||||||||||||||||
class FairModule; | ||||||||||||||||||
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. Remove duplicate forward declaration
-class FairModule; 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||
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) | ||||||||||||||||||
*/ | ||||||||||||||||||
|
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*)".