Message: issue modifying geometry between runs Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None issue modifying geometry between runs 

Forum: Run Management
Date: 23 Jun, 2015
From: A.T. <A.T.>

Hi

I am a novice in Geant4, I need to do few calculations on a fluid meter system using a gamma source.

I would like to change some parameters (such as the position of a scintillator, the position of the source, etc.) of the meter between two runs, I found many possibilities to do that I choose this one: - a messenger class to retrieve new values, - a setting method to set new values, e.g.:

inline void SetSourcePosition(G4ThreeVector Pos) { SourcePosition = Pos; G4RunManager::GetRunManager()->ReinitializeGeometry(true); }

So I understood that the reinitialization will automatically run the construct() method of my detector, and I can see it through a simple debug cout:

G4VPhysicalVolume* B1DetectorConstruction::Construct()
{
	return MF_system_Construct();
}

In the macro, I simply execute these commands in order to test several configurations:

/MFG4/detector/Scintillator/Position 0.0 0.0 81.0 /run/initialize /run/beamOn 100000

/MFG4/detector/Scintillator/Position 0.0 0.0 81.0 /run/beamOn 100000

/MFG4/detector/Scintillator/Position 0.0 0.0 82.0 /run/beamOn 100000

/MFG4/detector/Scintillator/Position 0.0 0.0 100.0 /run/beamOn 100000

I understood I don't need update because I use the ReinitializeGeometry() method.

For the first two runs everything seems ok. I obtain "consistent" results but for the third one nothing happens (see below). I can add more configurations, only the first two are properly working. I am sure to miss something but I checked many times the process and I can't see my mistakes.

Thank you very much for your help and your patience.

... snip ...

...........FIRST RUN
 The run consists of 100000 gamma of 662 keV
 Dose in scoring volume : 26.0209 picoGy  +- 2.89959 picoGy
 energy deposed: 46.0223 MeV
 detector Position (x, y, z): (0, 0, 81)
------------------------------------------------------------

...........SECOND RUN
 ------------- DEBUG: Construct detector
Checking overlaps for volume Envelope ... OK!
----- new construction, pipe is at the position: 25, 38, 169.1
Checking overlaps for volume Pipe ... OK!
Checking overlaps for volume PipeContent ... OK!
----- new construction, detector is at the position: 0, 0, 81
Checking overlaps for volume Scintillator_pl ... OK!
----- new construction, source is at the position: 0, 0, -166.8
Checking overlaps for volume SH_pl ... OK!
 ------------- DEBUG: Construct detector end: 6 volumes created
... create Csv file : output2_nt_HitPos.csv - done
... write Csv file : output2_h1_Edep.csv - done
... close Csv file : output2_nt_HitPos.csv - done

 The run consists of 100000 gamma of 662 keV
 Dose in scoring volume : 6.35703 picoGy  +- 1.05625 picoGy
 energy deposed: 11.2435 MeV
 detector Position (x, y, z): (0, 0, 81)
------------------------------------------------------------

...........THIRD RUN
 ------------- DEBUG: Construct detector
Checking overlaps for volume Envelope ... OK!
----- new construction, pipe is at the position: 25, 38, 169.1
Checking overlaps for volume Pipe ... OK!
Checking overlaps for volume PipeContent ... OK!
----- new construction, detector is at the position: 0, 0, 82
Checking overlaps for volume Scintillator_pl ... OK!
----- new construction, source is at the position: 0, 0, -166.8
Checking overlaps for volume SH_pl ... OK!
 ------------- DEBUG: Construct detector end: 6 volumes created
... create Csv file : output3_nt_HitPos.csv - done
... write Csv file : output3_h1_Edep.csv - done
... close Csv file : output3_nt_HitPos.csv - done

 The run consists of 100000 gamma of 662 keV
 Dose in scoring volume : 0 picoGy  +- 0 picoGy
 energy deposed: 0 eV
 detector Position (x, y, z): (0, 0, 82)
------------------------------------------------------------

...........FOURTH RUN
 ------------- DEBUG: Construct detector
Checking overlaps for volume Envelope ... OK!
----- new construction, pipe is at the position: 25, 38, 169.1
Checking overlaps for volume Pipe ... OK!
Checking overlaps for volume PipeContent ... OK!
----- new construction, detector is at the position: 0, 0, 100
Checking overlaps for volume Scintillator_pl ... OK!
----- new construction, source is at the position: 0, 0, -166.8
Checking overlaps for volume SH_pl ... OK!
 ------------- DEBUG: Construct detector end: 6 volumes created
... create Csv file : output4_nt_HitPos.csv - done
... write Csv file : output4_h1_Edep.csv - done
... close Csv file : output4_nt_HitPos.csv - done

 The run consists of 100000 gamma of 662 keV
 Dose in scoring volume : 0 picoGy  +- 0 picoGy
 energy deposed: 0 eV
 detector Position (x, y, z): (0, 0, 100)
------------------------------------------------------------

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

1 None: Re: issue modifying geometry between runs   (Daren Sawkey - 30 Jun, 2015)
(_ None: Re: issue modifying geometry between runs   (A.T. - 01 Jul, 2015)
 Add Message Add Message
to: "issue modifying geometry between runs"

 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 ]