Message: possible bug in G4HCofThisEvent Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning possible bug in G4HCofThisEvent 

Keywords: G4HCofThisEvent
Forum: Hits, Digitization and Pileup
Date: 27 Sep, 2003
From: Jeremy McCormick <Jeremy McCormick>

I may have found a pointer-related bug in G4HCofThisEvent.

GetHC(G4int i) is supposed to return a NULL when the collection ID does not exist.

Here is the code (from UserEventAction):

  G4VHitsCollection *vHC = 0;
  vHC = HCE->GetHC(collID);

  // doesn't work when HC does not exist!
  if(!vHC || vHC == NULL || vHC == 0)
    G4cerr << "HC not found" << G4endl;

I am getting "0x9" as my pointer value for vHC instead of "0x0".

This means that I'm having a hard time checking whether or not a hits collection actually exists as GetHC is not correctly giving back a NULL when it doesn't.

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

1 None: Re: possible bug in G4HCofThisEvent   (Makoto Asai - 27 Sep, 2003)
(_ None: Re: possible bug in G4HCofThisEvent   (Jeremy - 01 Oct, 2003)
 Add Message Add Message
to: "possible bug in G4HCofThisEvent"

 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 ]