TrackSrim::RndmEnergyLoss: Input parameters not valid


I am a newbie for Garfield++, and I tried to simulate an alpha track in the diamond. I’ve input the result from SRIM into Garfield++. But I get the error message : TrackSrim::RndmEnergyLoss: Input parameters are not valid. Please find the SRIM input file and Garfeild++ file attached. Thank you!

Kind regards,
planar.C (9.5 KB)
aindiamond.txt (7.2 KB)


It seems like you’re encountering a common issue with the TrackSrim::RndmEnergyLoss function in Garfield++. This error typically indicates that there’s a problem with the input parameters provided to the function. Here are a few steps you can take to troubleshoot and resolve this error:

Check the SRIM Input File: Ensure that the SRIM input file is formatted correctly and that all the required data is present. The error might be due to missing or incorrect values in the file.

Validate Parameter Values: Verify that the parameters passed to the TrackSrim::RndmEnergyLoss function are within the expected range and that they are of the correct type.

Consult Documentation: Review the Garfield++ documentation for the TrackSrim class to understand the requirements for the input parameters.

Seek Community Help: If you’re still stuck, consider reaching out to the Garfield++ community. There’s a discussion on the ROOT Forum where users have encountered similar issues, and you might find solutions or suggestions there.

Example Code Review: Look at example codes or tutorials that use TrackSrim to see how the function is implemented correctly.

Remember, it’s important to ensure that the environment for your simulation is set up correctly, including the gas pressure and temperature if applicable, as these can affect the behavior of TrackSrim.

I hope the information may helps you.

your active area extends from y = 0 to y = d, and you start the track at y = d with a direction vector (0, 1, 0) so the immediately leaves the active area.

Start the track at y = 0 (and keep the direction vector) or keep the starting point (y = d) and change the direction vector to (0, -1, 0).

I’ve just pushed a fix such that the function terminates without throwing the somewhat confusing error message that you got:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.