Message: /control/foreach possible bug Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning /control/foreach possible bug 

Forum: (Graphical) User Interfaces
Date: 19 Mar, 2014
From: C Mos <C Mos>

Hello I did a quick search on google and I did not find any postings about this so here it goes...

After seeing Makoto's presentation early this month, I was please to see /control/loop and /control/foreach commands implemented. However I run the following example and I found some unwanted behaviour:

  LINE1: /control/foreach Runtest.mac materialUSR "G4_POLYETHYLENE TNT WetSand5ppc isoN14 Graphite"
  LINE2: /control/foreach Runtest.mac materialUSR "G4_POLYETHYLENE TNT WetSand5ppc isoN14 Graphite " <- NOTE: 'extra spc

Notice the difference btw L1 and L2 is the space at the end of the listing. Notice Runtest.mac is defined as:

  /APIsetup/target/setTargetMat   {materialUSR}
  REMARK: This command is handle by my own DetectorConstruction Messenger class.

When I run L1, I get the following error when running the fifth element of my list (At this point I have four output files: polyEt.root tnt.root wsand5.root n14.root):

  parameter value is not listed in the candidate List.
  ***** Illegal parameter (0) </APIsetup/target/setTargetMat {materialUSR}> *****

Based on experience, I took a guess and I assumed there is a problem with the tokenizer implemented for the UI cmd "/control/foreach". Hence I added an extra space at the end of the listing. It partially solved the problem EXCEPT now I output 6 files instead of the expected 5.

Output files: 
  polyEt.root tnt.root wsand5.root n14.root graphite.root graphite_0001.root

Adding the extra space makes the last item in the list run twice. It would be great to have it fix. i did not trace the source code and I am totally assuming it is not dependent on my platform:

  uname -a
  Linux [xxxxHIDDENxxxxxx] 3.11.10-100.fc18.x86_64 #1 SMP Mon Dec 2 20:28:38 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Regards, Chris

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: /control/foreach possible bug   (C Mos - 17 Apr, 2014)
1 Idea: Re: /control/foreach possible bug   (Michael H. Kelsey - 17 Apr, 2014)
2 None: Re: /control/foreach possible bug   (John Allison - 18 Apr, 2014)
1 None: Re: /control/foreach possible bug   (Michael H. Kelsey - 18 Apr, 2014)
... 1 Message(s)
3 More: Re: /control/foreach possible bug   (C Mos - 26 Apr, 2014)
2 None: Re: /control/foreach possible bug   (Makoto Asai - 03 May, 2014)
 Add Message Add Message
to: "/control/foreach possible bug"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]