Message: access to a Hit Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None access to a Hit 

Forum: Hits, Digitization and Pileup
Date: 06 Feb, 2003
From: Jerome Roccaz <>

Hi everyone,

Let's first have a look at these code lines :

G4HCofThisEvent* HCE=evt->GetHCofThisEvent();
  SimpleGeHitsCollection* CHC=0;
  G4int n_hit=0;
  G4double totEAbs=0, EHit1=0;
  G4double dumb=0;
  G4ThreeVector Hit1, Hit2;

  if(HCE) CHC=(SimpleGeHitsCollection*)(HCE->GetHC(simpleGeCollID));
      //geRun->fillLong(Hit1, Hit2);

    for(G4int i=0;i<n_hit;i++) {totEAbs+=(*CHC)[i]->GetEdepAbs();EHit1=(*CHC)[i]->GetEdep();};

When the line : EHit1=(*CHC)[1]->GetEdep(); is in comment, i have no problem executing my program. But when it is not, I obtain a "bus error" when i start a run. as you can see, I've also placed this line in the for loop, and no problem with it.

I don't have any error during compilation. I'd like to understand what can happen, and of course find a solution.


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

 Add Message Add Message
to: "access to a Hit"

 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 ]