File IO for beam maker
Can we have a beam maker option that just reads a file? Should be easy using xboa...
Updated by Rajaram, Durga over 12 years ago
I have a python+xboa patchwork that seems to be working on an icool_for003 beam file --
loads bunch_dict from file at birth; process iterates over hits and stuffs N primaries into each spill.
Reads fine, particle parameters in spills are consistent with input file, and other maps are not complaining.
analyzing the sim.out to verify
checks/traps for errors/failures
write and run test_
get a MICE G4BL file, check, and make it the default(?)
code clean up [ ugly and probably convoluted learn-as-you-go python/xboa stuff right now]
Updated by Rajaram, Durga about 12 years ago
- Workflow set to New Issue
Yes, the code is in my branch.
MapPyBeamMaker.py and ConfigurationDefaults.py
Verified it with for003 and g4bl_track_file formatted files
Test files are in MapPyBeamMaker/ in my branch
-> New flags in ConfigurationDefaults
#use_beam_file = True/False
#beam_file = filename
#beam_file_format = IO format (only tested with for003 & g4bl_track_file)
#nbm_particles_per_spill = #particles to put in a spill
Opens file -> skips headers/comments -> read in beam particles via Hit.read..
I would like to test with a real MICE G4BL file - where can I get one?
Updated by Rogers, Chris about 12 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
- Workflow changed from Under Review to Closed
- I added tests for the file IO stuff (it passed everything first time incidentally)
- I switched the format of the sample G4bl track file - this has changed, I don't know when, but I made it current for G4BL 2.06
- I set the use_beam_file flag according to particle_generator == "file" - I didn't see the use in having two flags to control the same thing