Message: Somentimes I get no energy deposition in multithreaded code Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Somentimes I get no energy deposition in multithreaded code 

Forum: Multithreading
Date: 20 Nov, 2016
From: Oscar Putignano <Oscar Putignano>

Dear all,
I am running a simulation using G4MTRunManager. I have a volume that is registered as sensitive detector in my DetectorConstruction.cc via the following function:

void DetectorConstruction::ConstructSDandField ()
{
SensitiveDetector* sensitive = new SensitiveDetector("/myDet/ArCO2") ;
SetSensitiveDetector(logicArDet, sensitive) ;
}

When a hit happens in the sensitive detector volume the total energy deposited during the run is updated in the function SensitiveDetector().
When I run the simulation in multi-threaded mode I get 0 eV deposited energy during the whole run sometimes, while some other I get around 9 MeV.
If I use G4RunManager instead I get about 9 MeV all the time.

I am using MTwistEngine, which I understand is the same pseudo-random number generator as ROOT's TRandom3, and I am setting it via this line of code

G4Random::setTheEngine(new CLHEP::MTwistEngine()) ;

at the beginning of my main function.

Does anyone have an idea of why this is happening?

Thank you,
Oscar

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

1 None: Re: Somentimes I get no energy deposition in multithreaded code   (Oscar Putignano - 29 Nov, 2016)
 Add Message Add Message
to: "Somentimes I get no energy deposition in multithreaded code"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews