Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4RootMainNtupleManager.hh
이 파일의 문서화 페이지로 가기
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 // $Id:$
27 
28 // Class for Root main ntuple management.
29 //
30 // Author: Ivana Hrivnacova, 04/10/2016 (ivana@ipno.in2p3.fr)
31 
32 #ifndef G4RootMainNtupleManager_h
33 #define G4RootMainNtupleManager_h 1
34 
35 #include "G4BaseAnalysisManager.hh"
36 #include "G4TNtupleDescription.hh"
37 #include "G4RootNtupleManager.hh"
38 #include "globals.hh"
39 
40 #include <vector>
41 
43 
44 namespace tools {
45 namespace wroot {
46 class file;
47 class ntuple;
48 }
49 }
50 
52 {
53  friend class G4RootPNtupleManager;
54  friend class G4RootNtupleManager;
55 
56  public:
57  explicit G4RootMainNtupleManager(G4RootNtupleManager* ntupleBuilder,
58  G4bool rowWise,
59  const G4AnalysisManagerState& state);
61 
62  protected:
63  // Types alias
66 
67  // Methods to manipulate ntuples
68  void CreateNtuple(const tools::ntuple_booking& ntupleBooking, G4bool warn = true);
70  G4bool Merge();
71  G4bool Reset(G4bool deleteNtuple);
72 
73  // Set methods
74  void SetNtupleFile(std::shared_ptr<tools::wroot::file> rfile);
75  void SetNtupleDirectory(tools::wroot::directory* directory);
76  std::shared_ptr<tools::wroot::file> GetNtupleFile() const;
77  tools::wroot::directory* GetNtupleDirectory() const;
78 
79  // Access functions
80  const std::vector<NtupleDescriptionType*>& GetNtupleDescriptionVector()
82  const std::vector<tools::wroot::ntuple*>& GetNtupleVector()
83  { return fNtupleVector; }
84  unsigned int GetBasketSize() const;
85 
86  private:
87  // Data members
90  std::shared_ptr<tools::wroot::file> fNtupleFile;
91  tools::wroot::directory* fNtupleDirectory;
92  std::vector<tools::wroot::ntuple*> fNtupleVector;
93 };
94 
95 inline void G4RootMainNtupleManager::SetNtupleFile(std::shared_ptr<tools::wroot::file> rfile)
96 { fNtupleFile = rfile; }
97 
98 inline void G4RootMainNtupleManager::SetNtupleDirectory(tools::wroot::directory* directory)
99 { fNtupleDirectory = directory; }
100 
101 inline std::shared_ptr<tools::wroot::file> G4RootMainNtupleManager::GetNtupleFile() const
102 { return fNtupleFile; }
103 
104 inline tools::wroot::directory* G4RootMainNtupleManager::GetNtupleDirectory() const
105 { return fNtupleDirectory; }
106 
107 #endif
108 
std::vector< tools::wroot::ntuple * > fNtupleVector
unsigned int GetBasketSize() const
TTree * ntuple
void SetNtupleFile(std::shared_ptr< tools::wroot::file > rfile)
void CreateNtuple(const tools::ntuple_booking &ntupleBooking, G4bool warn=true)
std::shared_ptr< tools::wroot::file > GetNtupleFile() const
const std::vector< NtupleDescriptionType * > & GetNtupleDescriptionVector()
G4bool Reset(G4bool deleteNtuple)
bool G4bool
Definition: G4Types.hh:79
tools::wroot::directory * GetNtupleDirectory() const
std::shared_ptr< tools::wroot::file > fNtupleFile
const std::vector< NtupleDescriptionType * > & GetNtupleDescriptionVector() const
const std::vector< tools::wroot::ntuple * > & GetNtupleVector()
G4RootNtupleManager * fNtupleBuilder
TFile * file
tools::wroot::ntuple NtupleType
tools::wroot::directory * fNtupleDirectory
void SetNtupleDirectory(tools::wroot::directory *directory)
G4RootMainNtupleManager(G4RootNtupleManager *ntupleBuilder, G4bool rowWise, const G4AnalysisManagerState &state)