Message: problem getting data in sensitive detector when using multithreading mode Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None problem getting data in sensitive detector when using multithreading mode 

Forum: Multithreading
Date: 26 Jul, 2017
From: Jaafar EL Bakkali <Jaafar EL Bakkali>

Hi everyone,

I'm using Geant4.10.3 to build my application that uses sensitive detector, I use PhantomROGeometry derived from G4VUserParallelWorld class,
 but I can't score data from ProcessHits method. I added the following line to test if it work correctely:

G4bool PhantomSD::ProcessHits(G4Step* aStep,
G4TouchableHistory*ROhist )
{
 auto id_thread = std::to_string(G4Threading::G4GetThreadId()); 

 
if (!ROhist){

G4cout<<"ROhist doesn't exist " <<  id_thread  <<G4endl; 
return false ;
} 

so it's seems that ROhist doesn't exist in all of threads.


In my detector Construction class  I have implemented the following code:

void DetectorConstruction::ConstructSDandField(){
  G4SDManager* pSDManager         = G4SDManager::GetSDMpointer();
  G4String SdName           = "Phantom";
mPhantomSD = new PhantomSD(SdName, G4ThreeVector( this->phantomSizeX, this->phantomSizeY, this->phantomSizeZ), this->numberOfVoxelsAlongX, this-> numberOfVoxelsAlongY,  this->numberOfVoxelsAlongZ);

G4String ROGeometryName   = "PhantomROGeometry";
phantomROGeometry         = new PhantomROGeometry(ROGeometryName);
           phantomROGeometry-> SetPhantomROGeometry(this->phantomSizeX,this->phantomSizeY,this->phantomSizeZ,numberOfVoxelsAlongX,numberOfVoxelsAlongY,numberOfVoxelsAlongZ);
       phantomROGeometry -> Construct();
       pSDManager-> AddNewDetector(mPhantomSD);

SetSensitiveDetector("Detector",mPhantomSD);


}


Can anyone help me ?


Jaafar

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

1 None: Re: problem getting data in sensitive detector when using multithreading mode   (Makoto Asai - 26 Jul, 2017)
(_ None: Re: problem getting data in sensitive detector when using multithreading mode   (Jaafar EL Bakkali - 27 Jul, 2017)
(_ None: Re: problem getting data in sensitive detector when using multithreading mode   (Makoto Asai - 27 Jul, 2017)
(_ None: Re: problem getting data in sensitive detector when using multithreading mode   (Jaafar EL Bakkali - 29 Jul, 2017)
 Add Message Add Message
to: "problem getting data in sensitive detector when using multithreading mode"

 Subscribe Subscribe

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