Message: Re: histogram Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: histogram 

Forum: Analysis
Re: Question histogram (Dipanwita Banerjee)
Re: None Re: histogram (Ivana Hrivnacova)
Re: None Re: histogram (Dipanwita Banerjee)
Date: 16 Jul, 2013
From: Dipanwita Banerjee <Dipanwita Banerjee>

Hello,
      I fixed the previous problem as I already mentioned. Now I am trying to create a 2D histogram with a quantity deltaL in the y-axis and vec_x in the x axis. I created the 1D histogram of deltaL and it worked fine. I also checked my calculation of vec_x and its printing it fine with G4cout. I used the B4 example so my code in run action is:

BeginOfRunAction:

 G4AnalysisManager* man = G4AnalysisManager::Instance();
  man->SetVerboseLevel(4);
  G4cout << "Using " << man->GetType() 
         << " analysis manager" << G4endl;

  man->OpenFile("annhisto");
  man->SetFirstHistoId(1);

 man->CreateH1("1","deltaX",2000,-100*mm,100*mm);
 man->CreateH1("2","X0",2000,-100*mm,100*mm);
 man->CreateH1("3","Z0",2000,-100*mm,100*mm);
 man->CreateH2("4","CorrelationX",1000,-100*mm,100*mm,1000,-100*mm,100*mm);

EndOfRunAction:

G4AnalysisManager* man = G4AnalysisManager::Instance();

 man->Write();
 man->CloseFile();

and its filling in the Tracking action as:

PostUserTrackingAction:

G4AnalysisManager* man = G4AnalysisManager::Instance();

    man->FillH1(1,deltaL);
    man->FillH1(2,x0);
    man->FillH1(3,z0);
    man->FillH2(4, vec_x, deltaL);

the problem is its filling the 1D histograms but not the 2D ones. I have included

#include "ExN02Analysis.hh"
#include "G4AnalysisMessenger.hh"
#include "G4RootAnalysisManager.hh"

My ExN02Analysis.hh is the same like B4Analysis.hh in example B4.

it is creating the 2D histograms as I checked with the verbose, but not filling it. The error I am getting while its trying to fill the 2D histogram is:

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : Analysis_W007
      issued by : G4RootAnalysisManager::FillH2
      histogram 4 does not exist.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

I don't know what the problem is. Please if anyone can help me with this.

Thanks, Dipanwita

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

1 None: Re: histogram   (Ivana Hrivnacova - 16 Jul, 2013)
(_ None: Re: histogram   (Dipanwita Banerjee - 16 Jul, 2013)
 Add Message Add Message
to: "Re: histogram"

 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 ]