Message: Quitting without error message when creating multiple Sensitive Detector volumes Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Sad Quitting without error message when creating multiple Sensitive Detector volumes 

Keywords: sensitive detector logical volumes segmentation error
Forum: Hits, Digitization and Pileup
Date: 29 Oct, 2005
From: Blair Smith <bmsmith@lsu.edu>

I need some help urgently!

In my Construct() method I am using a G4VSensitiveDetector class called CZTEcrdSD to set up a few volumes as sensitive regions. I want to use the same G4VHit class say CZTEcrdHit for storing hit collections for each sensitive detector. From reading previous posts I think this is OK. However, when I try to set up the sensitive regions in Construct() like this:

G4SDManager* SDman = G4SDManager::GetSDMpointer(); CZTEcrdSD* ecrdShieldSD = new CZTEcrdSD( "ECRD/Shield" ); SDman->AddNewDetector( ecrdShieldSD ); logicShield->SetSensitiveDetector( ecrdShieldSD ); CZTEcrdSD* ecrdHouseSD = new CZTEcrdSD( "ECRD/House" ); SDman->AddNewDetector( ecrdHouseSD ); logicHouse->SetSensitiveDetector( ecrdHouseSD ); CZTEcrdSD* ecrdAsicSD = new CZTEcrdSD( "ECRD/ASIC" ); SDman->AddNewDetector( ecrdAsicSD ); logicASIC->SetSensitiveDetector( ecrdAsicSD ); CZTEcrdSD* ecrdVoxelSD = new CZTEcrdSD( "ECRD/Voxel" ); SDman->AddNewDetector( ecrdVoxelSD ); logicVoxelElement->SetSensitiveDetector( ecrdVoxelSD );

I see that the CZTEcrdSD constructor gets executed twice, but after the second SD volume ecrdHouseSD = new CZTEcrdSD( "ECRD/House" ); constructor call my application quits. There is no error message given!

There does not appear to be any invocation of my

CZTEcrdSD::Initialize()

method, and the constructor exits seemlingly without error for the ecrdHouseSD, but my aplication never gets to the next line of code in Construct() which is the notification to the SDman:

SDman->AddNewDetector( ecrdHouseSD );

This line never gets executed, the application just halts without any given reason.

So I tried running under gdb. It said the error was a segmentation error, but I could not see what pointer address or assignment was causing the problem (I'm not very good at interpreting the gdb messages). Here is the gdb output:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -188163680 (LWP 4351)] 
0xf6fc3bb5 in G4LogicalVolume::SetSensitiveDetector (this=0x0, pSDetector=0x93b9818)
    at G4LogicalVolume.icc:281 
281       fSensitiveDetector = pSDetector;
(gdb) backtrace
#0  0xf6fc3bb5 in G4LogicalVolume::SetSensitiveDetector (this=0x0,
    pSDetector=0x93b9818) at G4LogicalVolume.icc:281 
#1  0xf6fc0224 in CZTDetectorConstruction::Construct (this=0x9396518)
    at src/CZTDetectorConstruction.cc:704 
#2  0xf56ff0a0 in G4RunManager::InitializeGeometry (this=0x9385220)
    at src/G4RunManager.cc:322
#3  0xf56ff001 in G4RunManager::Initialize (this=0x9385220) at src/G4RunManager.cc:308
#4  0x0804ab16 in main (argc=1, argv=0xfee335d4) at simpleCZT.cc:181

As far as I can tell me geometry is OK, there were no overaps, and the logicHouse volume should be fine, I have no reason to doubt that it's SetSensitiveDetector method would not work.

One thing I worry about is that my LogicHouse has daughter volumes that I also want to set up as SD volumes.

If someone could give my a hint at how to fix this problem I'd be most grateful.

Thanks, Blair.

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

1 Question: Re: Quitting without error message when creating multiple Sensitive Detector volumes   (Blair Smith - 29 Oct, 2005)
 Add Message Add Message
to: "Quitting without error message when creating multiple Sensitive Detector volumes"

 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 ]