Message: Re: Root file with NTuples treated as empty again Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Root file with NTuples treated as empty again 

Forum: Analysis
Re: Question Root file with NTuples treated as empty again (Eduard Friske)
Date: 28 Apr, 2015
From: Ivana Hrivnacova <Ivana Hrivnacova>

Hi Eduard,

Your use case was not considered in the analysis manager design, though it makes sense to be supported. Can you please, try to make the following change in source/analysis/root/src/G4RootAnalysisManager.cc:

the code starts on the line #505 (in geant4-10-01-patch-01):
// Delete files if empty in MT mode
  if ( ( fState.GetIsMaster() && 
         fH1Manager->IsEmpty() && fH2Manager->IsEmpty() && fH3Manager->IsEmpty() &&
         fP1Manager->IsEmpty() && fP2Manager->IsEmpty() ) || 
       ( ( ! fState.GetIsMaster() ) && fNtupleManager->IsEmpty() ) ) {
    result = ! std::remove(fFileManager->GetFullFileName());

change to
 // Delete files if empty in MT mode
  if ( ( fState.GetIsMaster() && 
         fH1Manager->IsEmpty() && fH2Manager->IsEmpty() && fH3Manager->IsEmpty() &&
         fP1Manager->IsEmpty() && fP2Manager->IsEmpty() && fNtupleManager->IsEmpty() ) ||
       ( ( ! fState.GetIsMaster() ) && fNtupleManager->IsEmpty() ) ) {
    result = ! std::remove(fFileManager->GetFullFileName());

This should prevent from deleting the file when ntuple is filled on master. A similar check is also present in geant4-10-00-patch-02, so the file should be also deleted with this version.

Can you, please, let us know if the proposed changed works for you? If so, we will include it in the next patch to 10.01 release.

Thank you,

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

1 Ok: Re: Root file with NTuples treated as empty again   (Eduard Friske - 28 Apr, 2015)
 Add Message Add Message
to: "Re: Root file with NTuples treated as empty again"

 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 ]