ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VFileManager.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VFileManager.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 
27 // Author: Ivana Hrivnacova, 18/06/2013 (ivana@ipno.in2p3.fr)
28 
29 #include "G4VFileManager.hh"
31 
32 #include "G4Threading.hh"
33 
34 //_____________________________________________________________________________
36  : G4BaseFileManager(state),
37  fIsOpenFile(false),
38  fHistoDirectoryName(""),
39  fNtupleDirectoryName(""),
40  fLockFileName(false),
41  fLockHistoDirectoryName(false),
42  fLockNtupleDirectoryName(false)
43 {}
44 
45 //_____________________________________________________________________________
47 {}
48 
49 //
50 // public methods
51 //
52 
53 //_____________________________________________________________________________
55 {
56  if ( fLockFileName ) {
57  G4ExceptionDescription description;
58  description
59  << "Cannot set File name as its value was already used.";
60  G4Exception("G4VFileManager::SetFileName()",
61  "Analysis_W012", JustWarning, description);
62  return false;
63  }
64 
65  return G4BaseFileManager::SetFileName(fileName);
66 }
67 
68 //_____________________________________________________________________________
70 {
72  G4ExceptionDescription description;
73  description
74  << "Cannot set Histo directory name as its value was already used.";
75  G4Exception("G4VFileManager::SetHistoDirectoryName()",
76  "Analysis_W012", JustWarning, description);
77  return false;
78  }
79 
80  fHistoDirectoryName = dirName;
81  return true;
82 }
83 
84 //_____________________________________________________________________________
86 {
88  G4ExceptionDescription description;
89  description
90  << "Cannot set Ntuple directory name as its value was already used.";
91  G4Exception("G4VFileManager::SetNtupleDirectoryName()",
92  "Analysis_W012", JustWarning, description);
93  return false;
94  }
95 
96  fNtupleDirectoryName = dirName;
97  return true;
98 }