Message: Re: Create a new 1D histogram at each run in the same ROOT file Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Create a new 1D histogram at each run in the same ROOT file 

Forum: Analysis
Re: None Create a new 1D histogram at each run in the same ROOT file (Delaune Olivier)
Re: None Re: Create a new 1D histogram at each run in the same ROOT file (Ivana Hrivnacova)
Re: None Re: Create a new 1D histogram at each run in the same ROOT file (Delaune Olivier)
Date: 07 Sep, 2017
From: Ivana Hrivnacova <Ivana Hrivnacova>

Hello,

First, you need to move this line in your RunAction destructor:

    delete G4AnalysisManager::Instance();

so that you use the same analysis manager over all runs.

Then, as you want to activate one histogram per each run, you can do it in your macro for each run (after the first one)

  /analysis/h1/setActivation n-1 false 
  /analysis/h1/setActivation n true

And finally, to get all histogram written in your file, add activation of all histograms before calling Write in EndOfRunAction:

    if(fCloseFile) {
        analysisManager->SetH1Activation(true);
        analysisManager->Write();
        analysisManager->CloseFile();
    }

Best regards,

 Add Message Add Message
to: "Re: Create a new 1D histogram at each run in the same ROOT file"

 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 ]