Message: RE: Problem with Sensitive Detectors using Primitve Scorer Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: Problem with Sensitive Detectors using Primitve Scorer 

Forum: Hits, Digitization and Pileup
Re: Question Problem with Sensitive Detectors using Primitve Scorer (Slawomir Suchy)
Date: 13 Sep, 2007
From: Makoto Asai <Makoto Asai>

Hi, Could you please check the validity of the pointer
"CZT_1_Logical_Module1"?

Makoto

> -----Original Message-----
> From: Slawomir Suchy [mailto:ssuchy@ucsd.edu] 
> Sent: Wednesday, September 12, 2007 7:03 PM
> To: publichypernews
> Subject: Problem with Sensitive Detectors using Primitve Scorer
> 
> *** Discussion title: Hits, Digitization and Pileup
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/hitsdigits/176"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> Hello Everybody, 
> 
> I ran into a problem when I tried to make my detectors Sensitive. 
> I used Example N07 as a guideline to figure out how this works and 
> implemented it on my program. Example N07 compiles and runs 
> without problems. 
> (At least with no Seg Fault)
> My program compiles without an error message, but 
> when I run the program I get an segmentation fault at line:
> 
>   CZT_1_Logical_Module1->SetSensitiveDetector(myScorer);
> 
> I doublechecked that the logic is defined and now I am 
> running out of ideas.
> 
> My code for this part looks like that: I am looping through 
> multiple detectors, 
> each having 4 logical volumes. For this test I just used 
> Module 1 and Detector 1. 
> 
> for (int j=1;j<2;j++)
>     {
>       for (int i=1;i<5;i++)
>         {
>           sprintf(detName,"CZT_%i_Logical_Module%i_Scorer",i,j);
>           G4MultiFunctionalDetector* myScorer 
>             = new G4MultiFunctionalDetector(detName);
>           
>            G4VPrimitiveScorer* primitive;
>            primitive = new G4PSEnergyDeposit("eDep");
>            myScorer->RegisterPrimitive(primitive);
> 
>            G4SDManager::GetSDMpointer()->AddNewDetector(myScorer);
> 
>            // Segmentation fault occurs here
>            CZT_1_Logical_Module1->SetSensitiveDetector(myScorer);
>            
>         }
>     }
> 
> Thanks for your help, Slawo
> 
> 

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

1 None: RE: Problem with Sensitive Detectors using Primitve Scorer   (Slawomir Suchy - 13 Sep, 2007)
 Add Message Add Message
to: "RE: Problem with Sensitive Detectors using Primitve Scorer"

 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 ]