Message: Re: How to re-install sensitive detector after modified geometry? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: How to re-install sensitive detector after modified geometry? 

Forum: Hits, Digitization and Pileup
Re: Question How to re-install sensitive detector after modified geometry? (Poer)
Re: None Re: How to re-install sensitive detector after modified geometry? (Tsukasa Aso)
Date: 29 Nov, 2013
From: Poer <Poer>

Hi, Tsukasa,

I've tried your solution but still faced break-segmentation error. Instead, I just comment the G4Runmanager::Initialize() statement in main.cc and then do initialization in the marco file with /run/initialize. In this way, I can reset some parameters of the detector geometry via macro file, all setting cmd of course should be ahead of the initial cmd.

Anyway, thank you very much! Best regards, Poer

On Fri, 29 Nov 2013 15:42:35 GMT, Tsukasa Aso wrote:

> Hi,
> 
>  The G4SDManager  maintains the objects of sensitive detector.
> Therefore, you can ask SDManager about your sensitive detector by using its name,
> and reuse it if it is available. If not you have to create it again.
> 
>  For example.
> 
>   G4SDManager *sdm = G4SDManager::GetSDMpointer();
>   MySD* sd = dynamic_cast<MySD*>(sdm->FindSensitiveDetector("MySDName",false));
>   if ( !sd ) {
>       sd = new MySD("MySDName");
>       sdm->AddNewDetector(sd);
>   }
>   log->SetSensitiveDetector(sd);
> 
> Best regards,
> Tsukasa Aso
> 

 Add Message Add Message
to: "Re: How to re-install sensitive detector after modified geometry?"

 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 ]