Message: Re: Merging all ROOT H1 problem Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Merging all ROOT H1 problem 

Forum: Analysis
Re: Question Merging all ROOT H1 problem (Abhijit Bhattacharyya)
Re: None Re: Merging all ROOT H1 problem (Ivana Hrivnacova)
Date: 20 Aug, 2018
From: Abhijit Bhattacharyya <Abhijit Bhattacharyya>

Well, I am providing some of code snippets here for your perusal.

NeutRunAction::NeutRunAction():G4UserRunAction(){
  BookHistogram();   
}

G4Run* NeutRunAction::GenerateRun(){
  Return new NeutRun;
}

void NeutRun::BeginOfRunAction(const G4Run* thisRun){
  G4AnalysisManager* fAnalysisManager = G4AnalysisManager::Instance();
  G4cout <<"Run # " << thisRun->GetRunID() << " starts." << G4endl;
  fAnalysisManager->OpenFile();
}

void NeutRunAction::EndOfRunAction(const G4Run* thisRun){
  const NeutRun* nRun = static_cast<const NeutRun*>(thisRun);
  G4AnalysisManager* fAnalysisManager = G4AnalysisManager::Instance();
  if (IsMaster()){
     G4cout << nRun->GetNumberOfEvent() << " events processed." << G4endl;
     ...
  }
  fAnalysisManager->Write();  //<---- causes error :: outside IsMaster()
  fAnalysisManager->CloseFile();
}

void NeutRunAction::BookHistogram(){
  G4AnalysisManager* fAnalysisManager = G4AnalysisManager::Instance();
  fAnalysisManager->SetNtupleMerging(true);
  fAnalysisManager->SetFileName(fAnalysisFileName);
  fAnalysisManager->CreateH1("Gamma", "Gamma Edep (eV)", 2e4, 1.0e3, 1e9);
  ....
  fAnalysisManager->CreateNtuple("N_ET", "NEutron Energy Time");
  fAnalysisManager->CreateNtupleDColumn("energy");
  fAnalysisManager->CreateNtupleDColumn("time");
  fAnalysisManager->CreateNtupleDColumn("primary");
  fAnalysisManager->FinishNtuple();
}

Using fAnalysisManager->SetVerboseLevel(4), I tried to check numbers produced for tuples whether there is any "nan".

Thanks you for your kind attention. Best Abhijit

On Mon, 20 Aug 2018 13:41:49 GMT, Ivana Hrivnacova wrote:

> Hello,
> 
> Could you check if you create the analysis manager (call G4AnalysisManager::Instance()) also on master?
> If so, we will need more information to understand your problem.
> Did you follow some of the existing Geant4 examples? If so, let us know please, which one. Otherwise let us know at which phases of simulation you call:
> - CreateNtuple
> - OpenFile
> - Write
> - CloseFile
> 
> Thank you,
> 

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

1 None: Re: Merging all ROOT H1 problem   (Ivana Hrivnacova - 21 Aug, 2018)
(_ Feedback: Re: Merging all ROOT H1 problem   (Abhijit Bhattacharyya - 21 Aug, 2018)
(_ None: Re: Merging all ROOT H1 problem   (Ivana Hrivnacova - 21 Aug, 2018)
(_ Feedback: Re: Merging all ROOT H1 problem   (Abhijit Bhattacharyya - 21 Aug, 2018)
(_ None: Re: Merging all ROOT H1 problem   (Ivana Hrivnacova - 21 Aug, 2018)
(_ Feedback: Re: Merging all ROOT H1 problem   (Abhijit Bhattacharyya - 21 Aug, 2018)
1 More: Re: Merging all ROOT H1 problem   (Abhijit Bhattacharyya - 22 Aug, 2018)
1 None: Re: Merging all ROOT H1 problem   (Ivana Hrivnacova - 22 Aug, 2018)
2 None: Re: Merging all ROOT H1 problem   (Ivana Hrivnacova - 22 Aug, 2018)
2 None: Re: Merging all ROOT H1 problem   (Ivana Hrivnacova - 22 Aug, 2018)
1 Feedback: Re: Merging all ROOT H1 problem   (Abhijit Bhattacharyya - 22 Aug, 2018)
2 Feedback: Re: Merging all ROOT H1 problem   (Abhijit Bhattacharyya - 22 Aug, 2018)
... 11 Message(s)
 Add Message Add Message
to: "Re: Merging all ROOT H1 problem"

 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 ]