Please help me to make the following program to run

Hi experts!

Merry Christmas! :partying_face:

Thank you very much for helping me :grin:. I am trying to use some skills of variance reduction. However because of my poor level of everything, it seems very hard for me to finish it. :persevere:

((1)) I cannot run my codes as follow:
cmd2.txt (72 Bytes) (7.2 KB) (3.6 KB) (7.8 KB)
DetectorConstruction.hh (2.5 KB)
PrimaryGeneratorAction.hh (3.3 KB)
PrimaryGeneratorMessenger.hh (2.6 KB) (5.2 KB)

The primary particle was linked to the cosmic ray library where I learn form the Cosmic-ray shower library(CRY) and Geant4. Usually, I used the instructions “./example1 cmd.txt” to run.
And I copied some code in /extended/biasing/B01 to my code. Unfortunately, I cannot run my code any more. I am pretty sorry for my poor level. :pleading_face:

((2)) What is more. I also want to change the “Importance” of the mu- and mu+, and the value of importance is different form the neutrons’ in each cell. I do not know how to achieve it :worried: Please help me. Thank you very much for your kind help. :smiley:

((3))I also want to used some kills which are like “sb”(the angular and energy distribution of primary particles) and “WGT”(primary particle weight) in MCNP. I do not kown where to find examples like those because of my poor level.

Thank you very much!! :star_struck:
Wish you and your family have a good holiday :partying_face: :partying_face:


Hi experts
I have solved the question((1)) by changing UImanager into “/control/execute cmd2.mac”.But I meet another question that is

*** Fatal Exception *** core dump ***
G4Track (0x7fa7fd794db0) - track ID = 230, parent ID = 201
Particle type : neutron - creator process : neutronInelastic, creator model : Undefined
Kinetic energy : 2.09 MeV - Momentum direction : (-0.848191,-0.330955,-0.41357)
Step length : 2.79624 cm - total energy deposit : 0 eV
Pre-step point : (-2102.6,-1242.91,-3388.44) - Physical volume : cell_71 (rock)

  • defined by : hadElastic - step status : 4
    Post-step point : (-2126.32,-1252.17,-3400) - Physical volume : cell_72 (rock)
  • defined by : Transportation - step status : 1
    *** Note: Step information might not be properly updated.

-------- EEEE -------- G4Exception-END --------- EEEE -------

*** G4Exception: Aborting execution ***
Abort trap: 6

That is so weird. I used the shielding physical list. I do not know where the problem is. Thank you very much for your kind help :smiley:

Hello! I have a question to ask you: How do you ensure that CRY outputs all the particles that can reach the detector you set up?Since CRY emits a lot of particles in its simulation of the real sky, Not all of these particles are what they want. How do you get all of CRY’s particles to the detector?

So far, many of the particles in my simulation that don’t fit the criteria still occupy the output of Eventid. In this case, if I want to get a certain number of particles to reach the detector, I have to shoot a lot more than that number of particles to get the data I want from it, which is very troublesome because there is a finite number of particles that Geant4 can emit.