Message: Manually creating PMT hits like in the LXe example Not Logged In (login)

Question Manually creating PMT hits like in the LXe example 

Forum: Processes Involving Optical Photons
Date: 26 Mar, 2009
From: Clarisse <Clarisse>

Hi, I have written a code for a NaI detector covered with teflon and coupled to one PMT. I implemented the optical photon and the code compiled and ran fine until I tried to make the PMT a sensitive detector and collect some information about my optical photons.

What happens now is that the code compiles fine, and runs fine if no optical photons are generated. However I get a "Segmentation Fault" when the event involves optical photons. My hunch is that I am making some mistake when I try to "manually create a hit" at my photocathode interface (I tried to follow what is being done for LXe), i.e. in my file. Another file where there may be a mistake is or (this also follows what is done in LXe).

I reread those files, however I am not able to spot my mistake. I am attaching the files where I think the problem may be. I would appreciate if you could please look at the above mentioned files in particular (i.e.,, and let me know where you think my mistake is and how to correct for it.

Thank you, Clarisse


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

Feedback Re: Manually creating PMT hits like in the LXe example  by Gumplinger Peter <Gumplinger Peter>,   26 Mar, 2009
Re: Question Manually creating PMT hits like in the LXe example (Clarisse)
Dear Clarisse,

You can't really expect me to debug your code, but I did....

Also, do you know about gdb? You can run it:

> gdb ../../../bin/Linux-g++/executable core.###


(gdb) where

It'll tell you at least which method/class it segment faulted.

The LXe example reads:

  G4int n=pmtHitCollection->entries();

  LXePMTHit* hit=NULL;

  for(G4int i=0;i<n;i++){






You only have:

  myDetPMTHit* hit = (*pmtHitCollection)[0];

I can see why this happened - the comment: "//Find the correct hit collection" is misleading - wrong; we are looking for how many hits have already been collected. G4int n is the number of hits already stored in the pmtHitCollection.


 Add Message Add Message
to: "Manually creating PMT hits like in the LXe example"

 Subscribe Subscribe

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