ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4BaseNtupleManager.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4BaseNtupleManager.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, 20/07/2017 (ivana@ipno.in2p3.fr)
28 
29 #include "G4BaseNtupleManager.hh"
30 
31 //_____________________________________________________________________________
33  : G4VNtupleManager(state),
34  fFirstNtupleColumnId(0),
35  fLockFirstNtupleColumnId(false)
36 {}
37 
38 //_____________________________________________________________________________
40 {
41 }
42 
43 //
44 // private methods
45 //
46 
47 //_____________________________________________________________________________
49 {
50  return GetNofNtupleBookings() + fFirstId - 1;
51 }
52 
53 //
54 // protected methods
55 //
56 
57 //_____________________________________________________________________________
59  std::vector<int>* vector)
60 {
61  return CreateNtupleIColumn(GetCurrentNtupleId(), name, vector);
62 }
63 
64 //_____________________________________________________________________________
66  std::vector<float>* vector)
67 {
68  return CreateNtupleFColumn(GetCurrentNtupleId(), name, vector);
69 }
70 
71 //_____________________________________________________________________________
73  std::vector<double>* vector)
74 {
75  return CreateNtupleDColumn(GetCurrentNtupleId(), name, vector);
76 }
77 
78 //_____________________________________________________________________________
80 {
82 }
83 
84 //_____________________________________________________________________________
86 {
88 }
89 
90 //_____________________________________________________________________________
92 {
93  return FillNtupleIColumn(fFirstId, id, value);
94 }
95 
96 //_____________________________________________________________________________
98 {
99  return FillNtupleFColumn(fFirstId, id, value);
100 }
101 
102 //_____________________________________________________________________________
104 {
105  return FillNtupleDColumn(fFirstId, id, value);
106 }
107 
108 //_____________________________________________________________________________
110 {
111  return FillNtupleSColumn(fFirstId, id, value);
112 }
113 
114 //_____________________________________________________________________________
116 {
117  return AddNtupleRow(fFirstId);
118 }
119 
120 //_____________________________________________________________________________
122 {
123  if ( fLockFirstNtupleColumnId ) {
124  G4ExceptionDescription description;
125  description
126  << "Cannot set FirstNtupleColumnId as its value was already used.";
127  G4Exception("G4BaseNtupleManager::SetFirstNtupleColumnId()",
128  "Analysis_W013", JustWarning, description);
129  return false;
130  }
131 
132  fFirstNtupleColumnId = firstId;
133  return true;
134 }
135