FLUKA error: Invalid operator in sub-expr

Dear Fluka experts,

I am trying to simulate energy deposition by using flair and shell script. But whenever i tried to simulate MUON+, the error file(“fluka_somenumber”, it contains “core” file) shown up and as my understanding it is originated from flair which does not recognise MUON+ as a particle type.
Also, " Invalid operator at the beginning/end of a subexpression, execution termina
ted ***
MUON+
Abort called from EXPREV reason INVALID OPERATOR IN SUB-EXPR! Run stopped!
STOP INVALID OPERATOR IN SUB-EXPR!" is written in the .log and .err file.
Even i wrote it with quotation marks( and double quotation marks, i tried many versions) in the script file. When i use quotation mark, the error file does not exist but the program is not processing(running) anyway. There must be a fort_ file to process the calculated data but it is not exist. The problem is on only MUON+ because for other particles the script file is working good and the results are consistent with the previous simulation datas which is made by hand, not by a script file.
I will be waiting for your helps. Thank you in advance.

Best regards,
Sevgi ILGAR

image
image


Dear @silgar

you’ve hit a limitation of the expressions in both fluka/flair.
For FLUKA/flair to accept the MUON+ in the define as a string you need to put it inside quotes “”, otherwise it will treat the “+” as a plus operator leading to an error

#define particle "MUON+"
BEAM .... $particle

however if you place the “MUON+” inside an array/tuple as you correctly did

#define particles ("PROTON", "MUON+")

and then address it as

#define part particles[1]

internally it will be substituted as

#define part MUON+

without the quotes “” leading to a FLUKA expression error

We are looking if we can find a solution for that from the flair side.

Thank you Vasilis, i did as you said and it worked.