Project

General

Profile

Bug #1110

Icool beams into MAUS

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
Fields
Target version:
Start date:
21 August 2012
Due date:
% Done:

100%

Estimated time:
Workflow:
New Issue

Description

Posted by Tim:

I'm trying to input beam files (icool format, attached) into Maus via:

simulate_mice.py --configuration_file config.py  

where config.py is:

 
simulation_geometry_filename = "Test.dat" ####"StepIV_none__8m.dat" 

output_root_file_name = "TC_output.root" 
output_json_file_name ="THIS_IS_OUTPUT" 
output_json_file_type = "gzip" 

beam = {
    "particle_generator":"file",
    "random_seed":5, # random seed for beam generation; controls also how the MC
                     # seeds are generated
    "beam_file_format":"icool_for003",
   # "beam_file":"$MAUS_ROOT_DIR/bin/for003_TC.dat",   ### 13 events in this file
    "beam_file":"for003_TC.dat",
    "file_particles_per_spill" : "4" 
   }

but Maus doesn’t seem to be reading from the file, and is processing 10 events (does this mean n_events = 10 OR n_spills = 10 & n_events =1?), I’m clearly missing some stuff out...error message:

INPUT: Reading input
HINT: MAUS will process 1 event only at first...
TRANSFORM: Setting up transformer (this can take a while...)
MERGE: Setting up merger
OUTPUT: Setting up outputer
PIPELINE: Get event, TRANSFORM, MERGE, OUTPUT, repeat
Traceback (most recent call last):
  File "/home/carlisle/maus2/devel_2/build/MapPyBeamMaker.py", line 219, in process
    new_particles = self.__process_gen_empty(spill)
  File "/home/carlisle/maus2/devel_2/build/MapPyBeamMaker.py", line 266, in __process_gen_empty
    for i in range(self.file_particles_per_spill):
TypeError: range() integer end argument expected, got unicode.

Thanks for any help (again), shouldn’t be long till I’ve got the hang of things.


Files

for003_TC.dat (987 Bytes) for003_TC.dat Rogers, Chris, 21 August 2012 11:50
StepIV_none__8m.dat (539 Bytes) StepIV_none__8m.dat Carlisle, Timothy, 21 August 2012 17:12
FieldMapRead_StepIV_8m.dat (512 Bytes) FieldMapRead_StepIV_8m.dat Carlisle, Timothy, 21 August 2012 17:13
bfield_StepIV_8m.map (15.3 MB) bfield_StepIV_8m.map Carlisle, Timothy, 22 August 2012 10:25
carlisle_field_maps.tgz (6.53 MB) carlisle_field_maps.tgz Rogers, Chris, 22 August 2012 10:42
err (86 Bytes) err Carlisle, Timothy, 22 August 2012 13:19
std (14.7 KB) std Carlisle, Timothy, 22 August 2012 13:19
segfault_crash.rtf (16.6 KB) segfault_crash.rtf Carlisle, Timothy, 22 August 2012 13:19
#2

Updated by Rogers, Chris over 11 years ago

"file_particles_per_spill" : "4" 

Should be an integer

"file_particles_per_spill" : 4
#3

Updated by Carlisle, Timothy over 11 years ago

ah duh, integer indeed. Maus still seem to want to run 10 particles through. Am I missing another datacard? I hit the following error also:

INT: MAUS will process 1 event only at first...
TRANSFORM: Setting up transformer (this can take a while...)
MERGE: Setting up merger
OUTPUT: Setting up outputer
PIPELINE: Get event, TRANSFORM, MERGE, OUTPUT, repeat
TRANSFORM/MERGE/OUTPUT: Processed 1 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT: Processed 2 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT: Processed 3 events so far, 1 events in buffer.
Traceback (most recent call last):
File "/home/carlisle/maus2/devel_2/build/MapPyBeamMaker.py", line 224, in process
self.bm_fh)
File "/home/carlisle/maus2/devel_2/third_party/install/lib/python2.7/site-packages/xboa/Hit.py", line 110, in new_from_read_builtin
hit.read_builtin_formatted(format, filehandle)
File "/home/carlisle/maus2/devel_2/third_party/install/lib/python2.7/site-packages/xboa/Hit.py", line 406, in read_builtin_formatted
self.
_read_formatted(self.__file_formats[format], self.__file_units[format], filehandle)
File "/home/carlisle/maus2/devel_2/third_party/install/lib/python2.7/site-packages/xboa/Hit.py", line 695, in _read_formatted
raise EOFError("End of file reached")
EOFError: End of file reached
Traceback (most recent call last):
File "/home/carlisle/maus2/devel_2/src/common_py/ErrorHandler.py", line 159, in HandleCppException
raise(CppError(error_message))
ErrorHandler.CppError: Property position not found in Json object lookup at JsonWrapper::GetPropertyStrict
Traceback (most recent call last):
File "/home/carlisle/maus2/devel_2/src/common_py/ErrorHandler.py", line 159, in HandleCppException
raise(CppError(error_message))
ErrorHandler.CppError: St9exception

#4

Updated by Rogers, Chris over 11 years ago

The file_particles_per_spill controls the number of particles fired in each spill. The spill_generator_number_of_spills controls the number of spills.

#5

Updated by Carlisle, Timothy over 11 years ago

setting spill_generator_number_of_spills = 27 seems to tell Maus to process 27 "events", meaning spills?

#6

Updated by Rogers, Chris over 11 years ago

Yes, a MAUS event is a spill in MC. The reason it's vague is because a MAUS event in recon is a DAQ event - which goes like header start_of_burst spill end_of_burst start_of_burst spill end_of_burst ... <etc> ... footer

#7

Updated by Carlisle, Timothy over 11 years ago

I've tried reading in a fieldmap, placing it in various places that seem sensible (common_cpp/Simulation etc) but Maus can't seem to find it...where should it go? Thanks

#8

Updated by Rogers, Chris over 11 years ago

  • Category changed from Input to Fields

Could you give me sample configuration? There are many ways to read in field map files.

#9

Updated by Carlisle, Timothy over 11 years ago

Thanks Chris - attached.

#10

Updated by Carlisle, Timothy over 11 years ago

comment out the FieldMapCHECKER module in the config, just there to make sure the fields aren't calculated twice.

#11

Updated by Rogers, Chris over 11 years ago


Configuration Step IV
{
  Dimensions 6. 6. 31. m 
  PropertyString Material Galactic
  PropertyDouble G4StepMax 100 mm

Module Tests/VirtualPlane.dat
{
  Position 0. 0. -5.8 m
  Rotation 0. 0. 0. degree
  PropertyString IndependentVariable Z
  PropertyBool   RepeatModule 1
  PropertyInt    NumberOfRepeats 117
  PropertyHep3Vector RepeatTranslation 0 0 5 cm
  PropertyHep3Vector RepeatRotation 0 0 0
  PropertyDouble RepeatScaleFactor 1
}

Module FieldMaps/FieldMapRead_StepIV_8m.dat
{
}

Module FieldMaps/FieldMapCHECKER.dat
{
}

}

I will also need contents of FieldMaps.

#12

Updated by Rogers, Chris over 11 years ago

Sorry... replying too fast!

#13

Updated by Rogers, Chris over 11 years ago

Did you mean

$MICE_ROOT_DIR/bin/bfield_StepIV_8m.map

or

$MAUS_ROOT_DIR/bin/bfield_StepIV_8m.map

Also, I'm not sure if the routines see environment variables - just worth being a bit cautious.

#14

Updated by Carlisle, Timothy over 11 years ago

well previously in G4MICE you just dump the bfield.map files in Applications/Simulation/ and all is well, no need for environment variables.

Yep, I tried adding $MAUS_ROOT_DIR/bin/bfield.map etc but it didn't work.

#15

Updated by Rogers, Chris over 11 years ago

Okay, will have to wait until tomorrow... but should just look in current working directory same as G4MICE.

#16

Updated by Rogers, Chris over 11 years ago

You will have to give me the field map file as well!

#18

Updated by Rogers, Chris over 11 years ago

It just worked for me, no problem. I attach a tarball of the configuration I used. Running against 0.3.2 release version, but this stuff hasn't changed in years.

Note that the field map write routine that you call (FieldMapChecker.dat) is still available, but probably a better way is now to access the fields directly from python API (since 0.3.1). So for example see ${MAUS_ROOT_DIR}/bin/examples/make_field_map.py.

For the record here is the run log (also included in the tarball):

MAUS_ROOT_DIR = /home/cr67/MAUS/maus_release
Current working directory = /home/cr67/MAUS/work/user/carlisle_field_maps

Welcome to MAUS:
    Process ID (PID): 1593
    Program Arguments: ['/home/cr67/MAUS/maus_release/bin/simulate_mice.py', '--configuration_file', 'configuration.py']
    Version: MAUS release version 0.3.2
Initialising Globals
MagneticFieldMap FileType: g4micetext FileName: bfield_StepIV_8m.map ZMin: -8500 ZMax: 8500 RMin: 0 RMax: 500 scaleFactor: 1 position: (0,0,0) rotationVector: (0,0,1) angle: 0 name: Field1
Initiating Execution
INPUT: Reading input
HINT: MAUS will process 1 event only at first...
TRANSFORM: Setting up transformer (this can take a while...)
Setting the phase 
Made 0 attempts to phase 0 cavities with 0 remaining
Fields:
MagneticFieldMap FileType: g4micetext FileName: bfield_StepIV_8m.map ZMin: -8500 ZMax: 8500 RMin: 0 RMax: 500 scaleFactor: 1 position: (0,0,0) rotationVector: (0,0,1) angle: 0 name: Field1
MERGE: Setting up merger
OUTPUT: Setting up outputer
PIPELINE: Get event, TRANSFORM, MERGE, OUTPUT, repeat
TRANSFORM/MERGE/OUTPUT:  Processed 1 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 2 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 3 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 4 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 5 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 6 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 7 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 8 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 9 events so far, 1 events in buffer.
TRANSFORM/MERGE/OUTPUT:  Processed 10 events so far, 0 events in buffer.
TRANSFORM: Shutting down transformer
MERGE: Shutting down merger
OUTPUT: Shutting down outputer
Written 10 event(s) to file.
Clearing Globals
DONE

#19

Updated by Carlisle, Timothy over 11 years ago

ok so I downloaded the tarball, and ran with configuration.py, which didn't work giving a bizarre error.

I then did (meaning Chris T. did):

~/maus2/devel_2/bin/carlisle_field_maps ../simulate_mice.py --simulation_geometry_filename StepIV_none_8m.dat 1>std 2>err

where the logs are attached.

running with ~/maus2/devel_2/bin/carlisle_field_maps ../simulate_mice.py --configuration_file configuration.py

also caused a load of errors, screen output saved in segfault_crash.rtf

#20

Updated by Tunnell, Christopher over 11 years ago

There's some error thrown in legacy's 3Dfieldmap reader I think. It looks like there's some special character in an environmental variable maybe? Can't figure out why it would be evaluating that though...

#21

Updated by Rogers, Chris over 11 years ago

Okay, you need to wrap your environment variable in curly brackets

${ENVIRONMENT_VARIABLE}/fieldmap.map
#22

Updated by Carlisle, Timothy over 11 years ago

which variable? I don't use any in my geometry/cards files...

~/maus2/devel_2/bin/carlisle_field_maps env
@G4LEVELGAMMADATA=/home/carlisle/maus2/devel_2/third_party/install/share/Geant4-9.5.1/data/PhotonEvaporation2.2/
MANPATH=/home/carlisle/maus2/devel_2/third_party/build/root_v5.30.03/man:/home/carlisle/maus2/devel_2/third_party/install/man:/usr/local/share/man:/usr/share/man/overrides:/usr/share/man
KDE_MULTIHEAD=false
G4INSTALL=/home/carlisle/maus2/devel_2/third_party/build/geant4.9.2.p04
TERM=xterm
SHELL=/bin/bash
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/carlisle/.gtkrc-2.0:/home/carlisle/.kde/share/config/gtkrc-2.0
SSH_CLIENT=163.1.244.6 51733 22
GTK_RC_FILES=/etc/gtk/gtkrc:/home/carlisle/.gtkrc:/home/carlisle/.kde/share/config/gtkrc
GS_LIB=/home/carlisle/.fonts
G4INCLUDE=/home/carlisle/maus2/devel_2/third_party/build/geant4.9.2.p04/include/
WINDOWID=23068679
maus_assert_active=0
OLDPWD=/home/carlisle/maus2/devel_2/bin
SSH_TTY=/dev/pts/70
KDE_FULL_SESSION=true
G4LEDATA=/home/carlisle/maus2/devel_2/third_party/install/share/Geant4-9.5.1/data/G4EMLOW6.23/
MAUS_ROOT_DIR=/home/carlisle/maus2/devel_2
USER=carlisle
LD_LIBRARY_PATH=/home/carlisle/maus2/devel_2/third_party/install/lib64:/home/carlisle/maus2/devel_2/third_party/build/root_v5.30.03/lib:/home/carlisle/maus2/devel_2/third_party/build/geant4.9.2.p04/lib/Linux-g++:/home/carlisle/maus2/devel_2/src/common_py:/home/carlisle/maus2/devel_2/build:/home/carlisle/maus2/devel_2/third_party/install/lib:/opt/Minuit2/lib:.:/system/SL5/cern/root/x86_64/root-5.30.03/lib/root
OGLHOME=/usr/X11R6
G4VIS_USE_DAWNFILE=1
G4VIS_USE=0
maus_no_optimize=0
LIBPATH=/home/carlisle/maus2/devel_2/third_party/build/root_v5.30.03/lib
G4TMP=/home/carlisle/maus2/devel_2/third_party/build/geant4.9.2.p04
G4RADIOACTIVEDATA=/home/carlisle/maus2/devel_2/third_party/install/share/Geant4-9.5.1/data/RadioactiveDecay3.4/
SESSION_MANAGER=local/pplxint6:/tmp/.ICE-unix/28483
G4ABLADATA=/home/carlisle/maus2/devel_2/third_party/install/share/Geant4-9.5.1/data/G4ABLA3.0/
XDG_CONFIG_DIRS=/etc/kde/xdg:/etc/xdg
KONSOLE_DCOP=DCOPRef(konsole-28523,konsole)
MAIL=/var/mail/carlisle
PATH=/home/carlisle/maus2/devel_2/third_party/build/root_v5.30.03/bin:/home/carlisle/maus2/devel_2/third_party/install/bin:/usr/local/bin:/bin:/usr/bin:.
G4LIB=/home/carlisle/maus2/devel_2/third_party/build/geant4.9.2.p04/lib
CELERY_CONFIG_MODULE=mauscelery.celeryconfig
KONSOLE_DCOP_SESSION=DCOPRef(konsole-28523,session-5)
PWD=/home/carlisle/maus2/devel_2/bin/carlisle_field_maps
maus_debug=0
MAUS_THIRD_PARTY=/home/carlisle/maus2/devel_2
PS1=\n\w
G4DATA=/home/carlisle/maus2/devel_2/third_party/install/share/Geant4-9.5.1/data
ROOTSYS=/home/carlisle/maus2/devel_2/third_party/build/root_v5.30.03
SHLVL=3
HOME=/home/carlisle
G4NEUTRONDATA=/home/carlisle/maus2/devel_2/third_party/install/share/Geant4-9.5.1/data/G4NDL3.13/
G4SYSTEM=-g++
G4DEBUG=1
MICEFILES=/home/carlisle/maus2/devel_2/src/legacy/FILES
G4VIS_BUILD_DAWNFILE_DRIVER=1
XCURSOR_THEME=default
DYLD_LIBRARY_PATH=/home/carlisle/maus2/devel_2/third_party/build/root_v5.30.03/lib
PYTHONPATH=/home/carlisle/maus2/devel_2/third_party/build/root_v5.30.03/lib:/home/carlisle/maus2/devel_2/src/common_py:/home/carlisle/maus2/devel_2/build
LOGNAME=carlisle
SSH_CONNECTION=163.1.244.6 51733 163.1.136.49 22
G4VERS=geant4.9.5.p01
SHLIB_PATH=/home/carlisle/maus2/devel_2/third_party/build/root_v5.30.03/lib
DISPLAY=localhost:39.0
G4OPTIMISE=2
maus_gprof=0
maus_lcov=0
COLORTERM=
_=/bin/env
#23

Updated by Rogers, Chris over 11 years ago

The field map file name is

$MICE_ROOT_DIR/bin/bfield_StepIV_8m.map

Perhaps it is taking this from a file in

src/legacy/FILES/Models/Modules/FieldMaps/
#24

Updated by Rogers, Chris over 11 years ago

Okay, I pushed a fix to the trunk in r797. MAUS should now give a polite error message and exit when environment variable is not wrapped in {}

#25

Updated by Rogers, Chris over 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
#26

Updated by Rogers, Chris about 11 years ago

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

Also available in: Atom PDF