Message: Retrieving G4THitsMap from EndOfRunAction Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Retrieving G4THitsMap from EndOfRunAction 

Forum: Hits, Digitization and Pileup
Date: 13 Jun, 2007
From: Michael L. <leunm@hotmail.com>

I've been getting different error messages when I try to access the G4THitsMap object outside the class it was defined in.

For illustration, if I make the following two changes to example N07:

In ExN07Run.cc, at the end...

...
    inline G4double GetEMinElectron(G4int i) const
    { return FindMinimum(mapMin[i][1]); }
    inline G4double GetEMinPositron(G4int i) const
    { return FindMinimum(mapMin[i][2]); }

    // I ADDED THIS
    G4THitsMap<G4double> GetDoseMap() const
    { return mapSum[6][6]; }
...

In ExN07RunAction.cc, near the end...

...
    G4cout << " Total number of steps of e+/e- in an event :" << G4endl << "   "
           << " Absorber " << (theRun->GetNStep(ih1))/nEvt
           << "      Gap " << (theRun->GetNStep(ih2))/nEvt
           << G4endl;
    G4cout
    << "############################################################" << G4endl;

    // I ADDED THIS
    G4THitsMap<G4double> myMAP = theRun->GetDoseMap();
...

The program will compile. However, when I run: $G4EXE/exampleN07 exampleN07.in

I get: *** glibc detected *** corrupted double-linked list: 0x00b36878 ***

In my own application, I try to do something similar, and I get a segmentation fault.

Is there a bug in the code?

Thank you in advance.

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

 Add Message Add Message
to: "Retrieving G4THitsMap from EndOfRunAction"

 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 ]