Message: Re: Problems with SteppingAction.cc Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

News Re: Problems with SteppingAction.cc 

Forum: Event and Track Management
Re: None Problems with SteppingAction.cc (Chaw)
Re: None Re: Problems with SteppingAction.cc (Chaw)
Date: 05 Apr, 2011
From: Chaw <Chaw>

Hi,

In fact, I always have this problem. When I put fEventAction->AddEdep ( aStep->GetTotalEnergyDeposit()) before the if ( aStep->GetTrack()->GetVolume()->GetName() == detName.Data()). I have A good histo but it contains all the detectors (see attachement).

void SteppingAction::UserSteppingAction(const G4Step* aStep)
  {
    TString detName="";
    int pixel;

    for (int i=0;i<36;i++)
    { 
    	pixel=i+1;

     	detName = TString(Form("inter%d_phys",i+1));
     // fEventAction->AddEdep ( aStep->GetTotalEnergyDeposit());

   if ( aStep->GetTrack()->GetVolume()->GetName() == detName.Data())
      { 

    fEventAction->AddEdep ( aStep->GetTotalEnergyDeposit()) ;  .....}

When I put fEventAction->AddEdep ( aStep->GetTotalEnergyDeposit()) after the if ( aStep->GetTrack()->GetVolume()->GetName() == detName.Data()), I have a bad histo. I don't understand why... (see a previous posts) I would like to draw one histo per detector so 36 histograms with a energy total deposit.

Thanks you for your help.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2011/04/05/00.00-21341-energy.pdf

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

1 None: Re: Problems with SteppingAction.cc   (Makoto Asai - 05 Apr, 2011)
(_ None: Re: Problems with SteppingAction.cc   (Chaw - 05 Apr, 2011)
(_ None: Re: Problems with SteppingAction.cc   (Makoto Asai - 05 Apr, 2011)
(_ None: Re: Problems with SteppingAction.cc   (Chaw - 05 Apr, 2011)
(_ None: Re: Problems with SteppingAction.cc   (Marc Verderi - 11 Apr, 2011)
(_ None: Re: Problems with SteppingAction.cc   (Chaw - 11 Apr, 2011)
 Add Message Add Message
to: "Re: Problems with SteppingAction.cc"

 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 ]