Cosmic-ray shower library(CRY) and Geant4

Dear experts,

First, I’m sorry I can’t guarantee that I wrote the question in the right category.

I have a problem. I want to use the Cosmic-ray Shower Library (CRY) as my particle source, I think I’ve connected CRY to Geant4 correctly, but I don’t know how to use CRY to emit particles next.
I try to emit particles like GPS’s, /run/beam 10, But the following error was reported:
I don’t know how to solve the error report content “CRY library was not successfully initialized”.

When I used GPS in the past, it was direct setted up in “run.mac” so I can emit the particles I setted.
But for now, CRY is a library that simulates natural cosmic ray showers, and my understanding is that it automatically generates a source of natural particles, but how do I use it? I don’t know.

If you know any information or can provide any reference on CRY, I would be very grateful!

My English is a little weak, I hope I have described my problem clearly.Thank you very much!

I feel deep sympathy for you.

I saw same error report when I tried to apply CRY library v1.7 to optical example in Geant4.
The successful method to execute this is below.

$./LXe cmd2.file

Here, cmd2file is copied from the geant folder ( /cry_v1.7/geant/cmd2.file, Edited as described below ).
Once checking its file content, Meaning of the error report is clear.
The cmd2.file call a setup.file, and it specifies the parameters in CRY ( altitude, return particles … ).
That’s requirement.

I needed to add /run/initialize statement in cmd2.file after /CRY/file setup.file statement.
The Lesson made me feel that the order of Geant4 initialization( /run/initialize) is important after CRY library initialization.
Note that Qt Window that you displayed is automatically execute /run/initialize statement.

The outline of this method is wrote in /cry_v1.7/geant/README and /cry_v1.7/doc .

Thank you very much for your reply! You showed me how to use it, and it worked!
But when I exeucuted the method below
$./LXe cmd2.file
Here is another problem. In case I missed some details, I’ve put everything that’s been run in pictures below:

u can see the problem on the last picture. **** COMAND NOT FOUND </CRY/file setup.file>***

the statements in my cmd2.file are:
/CRY//file setup.file
/tracking/verbose 1
/run/beamOn 1

the statements in my setup.file are:
returnNeutrons 0
returnProtons 0
returnGammas 0
returnElectrons 0
returnMuon 1
date 7-1-2021
latitude 90.0
altitude 0
subboxlength 100

Do you have a solution to this problem?

Hello, chenruolin324

Did you solve the problem?
And where did you get the Cosmic-ray Shower Library?
I also meet the problem

Hello PingchuanZhoug.
Here CRY is
Today, I was able to visit and download this.

First, there is one more slash in your statement :
/CRY//file setup.file

A similar problem has been reported here, but no solution has been found yet. And in my program this problem is not reproduced. I don’t know the cause.

I don’t know if it’s right track, but I’ll post the main changed parts of the file that was able to cry in the /extend/optical/LXe example. The Geant4 environment uses G4VM-20.03 for VMWare distributed in a web site(,
so you may easy to replicate the experiment .
file extension changed to txt.The folder structure is as follows.

work – 2020 – 0404LXeCry - LXe : include , src …
└ cry_v1.7

Good luck, Guys.
CMakeLists.txt (2.1 KB) cmd2.txt (74 Bytes) setup.txt (104 Bytes) (3.0 KB) (7.2 KB) (3.6 KB) LXeActionInitialization.hh (2.2 KB) LXePrimaryGeneratorAction.hh (3.3 KB) PrimaryGeneratorMessenger.hh (2.6 KB)

Thank you very much for you kind help! But there is a problem that I can not solve. Would you please help me? :smiley:

I used the the above documents to build my own project. But when I did the “make”, the terminal appeared the following errors:

Mac 10.13.4
MacPorts gcc9 9.3.0_1
Xcode 9.3.1

I used to use the gcc in my Xcode. The project could work very well . But oneway I updated the gcc into the gcc9 and set gcc9 as my new gcc. It did’t work anymore. It seems that I did a very stupid decision :disappointed_relieved:

I had solved it. Thank you! I returned the gcc to the original version and then compiled the cry and geant4 at the same time. It works.

Wish you have a good day! :smiley: