Feature #768

File IO for beam maker

Added by Rogers, Chris over 12 years ago. Updated about 12 years ago.

Target version:
Start date:
24 October 2011
Due date:
% Done:


Estimated time:


Can we have a beam maker option that just reads a file? Should be easy using xboa...


Updated by Rogers, Chris over 12 years ago

  • Assignee changed from Rogers, Chris to Rajaram, Durga

Updated by Rogers, Chris over 12 years ago

File formats to implement are all the ones in xboa...for009, for003 (ICOOL) G4BLTrackFile), anything else that comes up. Event number splits into different spills.


Updated by Rogers, Chris over 12 years ago

Hi Durga, what's the status on this?


Updated by Rajaram, Durga over 12 years ago

Hi Chris,
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

To do:
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 Rogers, Chris about 12 years ago

Did this ever get finished?


Updated by Rajaram, Durga about 12 years ago

  • Workflow set to New Issue

Yes, the code is in my branch. and
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

I would like to test with a real MICE G4BL file - where can I get one?


Updated by Rogers, Chris about 12 years ago

  • Workflow changed from New Issue to Under Review

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
Merged with trunk. I made a few minor changes during the merge -
  • 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

Updated by Rogers, Chris about 12 years ago

  • Target version changed from Future MAUS release to MAUS-v0.1.2

Also available in: Atom PDF