Skip to content
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

Implement musun input generator #26

Merged

Conversation

MoritzNeuberger
Copy link
Collaborator

Overview:

  • Added class to generate muons using a MUSUN file input
  • Added class to read a MUSUN file (singleton)
  • Added example to experiment with the new generator based on 02-HPGe
  • Added an example MUSUN input file with 10000 muons (MUSUN_10k_events.dat)

Copy link
Member

@gipert gipert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I left a couple of comments.

examples/05-MUSUN/MUSUN_10k_events.dat Outdated Show resolved Hide resolved
include/RMGReaderMUSUN.hh Outdated Show resolved Hide resolved
@gipert
Copy link
Member

gipert commented Jul 5, 2023

What is the status here? Only need to better handle the header as we discussed?

@@ -0,0 +1,9 @@
// other useful GEANT4 exported variables:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be removed, it has been replaced by the (git-excluded) RMGConfig.hh


#include "G4ThreeVector.hh"

#include "ProjectInfo.hh"

This comment was marked as outdated.

Copy link
Collaborator

@ManuelHu ManuelHu May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that import is completely unnecessary here (i.e. none of the RMG_HAS_* constants are actually used) , isn't it?

@MoritzNeuberger MoritzNeuberger force-pushed the implement_MUSUN_input_generator branch from 6758b15 to 793337c Compare May 2, 2024 12:57
@ManuelHu
Copy link
Collaborator

ManuelHu commented May 2, 2024

Now there are some parts of recent main branch changes duplicated in this PR... (and ProjectInfo.hh is still there, which is the cause for the slim build failures...) Maybe a rebase on the latest main would help :-)


#include "G4ThreeVector.hh"

#include "ProjectInfo.hh"
Copy link
Collaborator

@ManuelHu ManuelHu May 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that import is completely unnecessary here (i.e. none of the RMG_HAS_* constants are actually used) , isn't it?

@MoritzNeuberger
Copy link
Collaborator Author

MoritzNeuberger commented May 2, 2024

So, there is a problem with the multithreaded implementation. The G4CsvAnalysisReader instance is currently initialized in the BeginRunAction of the generator class, so each thread will spawn a separate instance, meaning that each thread will go through all entries in the input file. Could we instead initialize it for example in the manager?

@MoritzNeuberger
Copy link
Collaborator Author

MoritzNeuberger commented May 2, 2024

At this point I am thinking of working with a singelton and mutex similar to this Geant4 example.

@MoritzNeuberger
Copy link
Collaborator Author

Multithreaded seems to work now.

@MoritzNeuberger
Copy link
Collaborator Author

In the example I now get this seg violation:

 *** Break *** segmentation violation
WARNING - Attempt to delete the physical volume store while geometry closed !
WARNING - Attempt to delete the logical volume store while geometry closed !
WARNING - Attempt to delete the solid store while geometry closed !
WARNING - Attempt to delete the region store while geometry closed !

I guess I messed up somewhere.

@MoritzNeuberger
Copy link
Collaborator Author

MoritzNeuberger commented May 3, 2024

Seems to not throw the seg violation anymore. It was probably related to an automatic delete of the G4CsvAnalysisReader at the end of the program, making the manual delete unnecessary?

Anyway, I think the pull request is now feature-complete. What do you guys think?

@gipert gipert requested review from ManuelHu and removed request for gipert May 6, 2024 12:48
Copy link
Collaborator

@ManuelHu ManuelHu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some macro commands will not work on current main

examples/05-MUSUN/run.mac Outdated Show resolved Hide resolved
examples/05-MUSUN/vis-traj.mac Outdated Show resolved Hide resolved
src/RMGGeneratorMUSUNCosmicMuons.cc Outdated Show resolved Hide resolved
src/RMGGeneratorMUSUNCosmicMuons.cc Show resolved Hide resolved
src/RMGGeneratorMUSUNCosmicMuons.cc Outdated Show resolved Hide resolved
src/RMGGeneratorMUSUNCosmicMuons.cc Outdated Show resolved Hide resolved
include/RMGGeneratorMUSUNCosmicMuons.hh Outdated Show resolved Hide resolved
@ManuelHu ManuelHu merged commit acc2a76 into legend-exp:main May 6, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants