-
Notifications
You must be signed in to change notification settings - Fork 96
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
base: dev
Are you sure you want to change the base?
Conversation
10f4ab5
to
b7cd258
Compare
b7cd258
to
3cd6899
Compare
Could you please summarize shortly what is the idea behind this change? Will it be backward compatible/optional or will it lead to deep changes? |
It is still work in progress. Idea is to simplify handling of sensitive detectors in FairRoot. Currently foreseen as a default solution. Would require changes in FairDetector interface, which are not backward compatible. Changes are in ProcessHits method. |
3cd6899
to
c6ffc2e
Compare
1a157c0
to
bd19c48
Compare
@MohammadAlTurany , Looking into it again, I have realised that the experiments will need to change ProcessHits method in every detector class |
can you shortly describe, what the changes would have to be? |
The declaration:
will be changed to:
|
Looking at the code, you've also moved the function from FairDetector to FairModule. |
This change is needed only if you went to use the sensitive detector or did I miss something here? |
I thought there was a wrapper in FairRoot which calls the old function if the new one isn't available. |
@karabowi We used to take care about bookkeeping of sensitive volumes in FairRoot. Idea of this PR is to let VMC do it. The new function is VMC requirement. |
One could get the current volume and the corresponding FairVolume and call the old method, at least for some time to allow the experiments to move smoothly to the new one! |
With the current state of this branch, there seems to be no any MC points stored in the output files. |
@karabowi thanks for testing. Probably something went wrong while rebasing. The whole thing will be revisited completely. I will open another PR soon. |
51bffcc
to
011da54
Compare
I started testing the Pull Request for CbmRoot and had several problems which are spread over the whole application stack. For my tests I used FairSoft apr21p2 and FairRoot v18.6.7 as baseline since these are the default versions used by CbmRoot. To compare to the PR I cherry-picked the changes from the PR into v18.6.7. Compilation of the patches FairRoot as well as CbmRoot worked but when running out transport tests all of them failed with an assertion in the Initialize() function of one of our detector classes. The assertion checked that the function was only called once but obviously it was called twice. Preliminary comparison of execution times of the patched and unpatched FairRoot versions don't show any observable difference. |
@fuhlig1 |
sorry but I think I messed up the PR a minute ago. There was a conflict which I tried to solve using the web editor but it seems to me that instead off doing a rebase the webpage did a merge. Could you please have a look. |
ad6983f
to
011da54
Compare
@fuhlig1, I reverted back your merge action. Now we need to resolve conflicts properly. |
thanks. Could you solve the conflicts. I fear if I do it from the web frontend we run into the same problem. |
a96f67f
to
2259768
Compare
We noticed in this morning's meeting, that we should consider raising the minimum required geant3 version to the one containing some fixes relevant to this pull request. If we do so, it should be done in the CMakeLists.txt. |
Also before we merge this one, we probably should do a rebase/cleanup of the commits. And before we merge it, we should get clear on our release planning (this currently targets 19.2, not 19.0). |
2259768
to
2ab950f
Compare
Remove the double function definition.
Define the void FairDetector::ProcessHits() function, which calls the depracated Bool_t ProcessHits(FairVolume*) of derived classes. Update the FairMCApplication to match the update of the VMC: introduction of EndOfEvent function called before the TVirtualMCSensitiveDetectors->EndOfEvent(). Implement the temporary FairMCApplication::GetFairVolume() function to keep the backward compability. Cleanup of FairModule, FairMCApplication double code.
FairRoot allows for construction of clones volumes using the volume_name#{clone_number} scheme. Changing FairMCApplication::ConstructSensitiveDetectors() to support this.
96b1b31
to
0612207
Compare
Since VMC is initializing TVirtualMCSensitiveDetector, removed detector->Initialize() from FairMCApplication. Removed the GetFairVolume function used by FairDetector::ProcessHits(). It now calls the deprecated function with NULL argument. Changed the propagator example to use the new ProcessHits().
0612207
to
b64b2fd
Compare
base/sim/FairMCApplication.cxx
Outdated
std::map<std::string, FairModule*>::iterator it; | ||
it = cloneVolumeMap.find(volName); |
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.
std::map<std::string, FairModule*>::iterator it; | |
it = cloneVolumeMap.find(volName); | |
auto it = cloneVolumeMap.find(volName); |
base/sim/FairMCApplication.cxx
Outdated
Int_t id = fMC->CurrentVolID(copyNo); | ||
id = fMC->CurrentVolID(copyNo); |
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.
You're assigning twice the same?
Int_t id = fMC->CurrentVolID(copyNo); | |
id = fMC->CurrentVolID(copyNo); | |
Int_t id = fMC->CurrentVolID(copyNo); |
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 have added a few minor comments.
In reality, I would like to discuss the whole design with people interested. Because I think, it's making things more and more complex and unmaintainable in the long run. It took me a few iterations to start to understand why things are done this way. And I have some ideas / questions about this.
b64b2fd
to
e3810cc
Compare
Removed FairDetector::DefineSensitiveVolumes() function, the functionality moved to FairMCApplication private special copy constructor. Removed detector initialization from FairMCApplication::RegisterOutput(), the detectors are initialized in the VMC. Added few overrides for ProcessHits.
Removed the IsSensitive() function. Increase the number of events to run in the MT mode to 20.
e3810cc
to
e34b574
Compare
Inherit FairModule from TVirtualMCSensitiveDetector, which allows to use VMC stepping.
Tested with Tutorial1.
Requires changes in detector interface.