Message: RE: Changing Hit Info During Event Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None RE: Changing Hit Info During Event 

Forum: Hits, Digitization and Pileup
Re: Question Changing Hit Info During Event (Derek Mackay)
Date: 22 Jul, 2010
From: Makoto Asai <Makoto Asai>

Please check the validity of the pointer "LXeHC".
If it is null, you are trying to access to your
EXOLXeHitsCollection object before it is instantiated
and registered to "HCE".

Hope this helps.
Makoto

> -----Original Message-----
> From: Derek Mackay [mailto:dcmackay@stanford.edu]
> Sent: Thursday, July 22, 2010 3:51 PM
> To: hitsdigits-g4hn
> Subject: Changing Hit Info During Event
> 
> 
> *** Discussion title: Hits, Digitization and Pileup
> 
> Hi,
> 
> I'd like to change hit info for a SD during the event - is this
> possible? I want to change the energy deposit from the current step in
> the PostStepDoIt of a Physics class I wrote. I tried:
> 
>     G4SDManager *fSDM = G4SDManager::GetSDMpointer();
>     LXeHitCollectionID = fSDM->GetCollectionID("LXeHitsCollection");
> 
>     G4RunManager* fRM = G4RunManager::GetRunManager();
>     const G4Event* currentEvent = fRM->GetCurrentEvent();
> 
>     G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
>     EXOLXeHitsCollection* LXeHC = (EXOLXeHitsCollection*)(HCE-
> >GetHC(LXeHitCollectionID));
> 
> And then with the line:
> 
> G4int nhits = LXeHC->entries();
> 
> I get a seg. fault. I assume it's because I'm using the way that you
> retrieve hit info after the completion of the event during the event.
> 
> Any suggestions?
> 
> Thanks, Derek.
> 
> -------------------------------------------------------------
> Visit this GEANT4 at hypernews.slac.stanford.edu message (to reply or
> unsubscribe) at:
> http://hypernews.slac.stanford.edu/HyperNews/geant4/get/hitsdigits/248.
> html

 Add Message Add Message
to: "RE: Changing Hit Info During Event"

 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 ]