| Summary: | Huge delays in events with many primaries due to (unnecessary?) loop | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Vlasios Vasileiou <vlasisva> |
| Component: | particles | Assignee: | asai |
| Status: | RESOLVED WONTFIX | ||
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 8.0 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Vlasios Vasileiou
2006-06-23 02:14:28 CEST
The "default" design assumes a small number of verticies (with potentialy huge number of primaries sharing the same vertices). For your case, I presume each vertex has just a couple of particles but you have millions of vertices. If it is the case, you can use an alternative method of G4EventManager::ProcessOneEvent() which takes G4TrackVector, i.e. a vector of G4Track pointers of primary tracks. You have to do: 1) Create your own RunManager deriving from G4RunManager or just utilizing G4RunManagerKernel, so that you do not have to have PrimaryGeneratorAction. 2) In your RunManager, create a G4TrackVector and fill primary G4Track objects taken from Corsika. Then you are free from G4PrimaryVertex class. Thanks for your prompt reply, First, a detail about our simulation: We have hundreds of thousands of different primary particles each own having its own vertex. My understanding is that one of the aims of the Geant4 collaboration is to provide a simulation toolkit that is generic enough to accomodate most of the reasonable user requirements. In this case, I don't think that being able to efficiently simulate events with multiple different primaries is an unreasonable requirement. Furthermore, the average user shouldn't spend his/her time and effort writing code to bypass the main Geant4 routines, espessially when a concrete example on how to do that is not available. (Should I submit a new user requirement?) I think it would be easier for me to try to patch the main Geant4 code than to use the method you proposed. After all, it seems like an easy thing to fix. Again, thanks for your time and help Vlasios Vasileiou |