35 #ifndef G4RootMpiPNtupleManager_h
36 #define G4RootMpiPNtupleManager_h 1
44 #include "tools/wroot/base_pntuple"
66 tools::impi* impi,
G4int mpiRank,
G4int destinationRank);
78 void SetFileManager(std::shared_ptr<G4RootFileManager> fileManager);
93 const G4String&
name, std::vector<double>* vector)
final;
126 tools::wroot::base_pntuple*
129 template <typename
T>
133 template <typename
T>
135 const
G4String& name, std::vector<
T>* vector);
137 template <typename
T>
155 { fNtupleDirectory = directory; }
161 inline const std::vector<G4RootMpiPNtupleDescription*>&
167 template <
typename T>
174 description << name <<
" ntupleId " << ntupleId;
183 auto& ntupleBooking = ntupleDescription->fNtupleBooking;
184 auto index = ntupleBooking.columns().size();
186 ntupleBooking.template add_column<T>(
name);
188 ntupleBooking.template add_column<T>(
name, *vector);
195 description << name <<
" ntupleId " << ntupleId;
210 G4cout <<
"Skipping FillNtupleIColumn for " << ntupleId <<
G4endl;
217 description <<
" ntupleId " << ntupleId
218 <<
" columnId " << columnId <<
" value " <<
value;
224 if ( !
ntuple )
return false;
227 if ( index < 0 || index >=
G4int(
ntuple->columns().size()) ) {
229 description <<
" " <<
"ntupleId " << ntupleId
230 <<
" columnId " << columnId <<
" does not exist.";
231 G4Exception(
"G4RootNtupleManager::FillNtupleTColumn()",
236 auto icolumn =
ntuple->columns()[index];
237 auto column =
dynamic_cast<tools::wroot::base_pntuple::column_string*
>(icolumn);
240 description <<
" Column type does not match: "
241 <<
" ntupleId " << ntupleId
242 <<
" columnId " << columnId <<
" value " <<
value;
243 G4Exception(
"G4RootNtupleManager:FillNtupleColumn",
253 description <<
" ntupleId " << ntupleId
254 <<
" columnId " << columnId <<
" value " <<
value;
262 template <
typename T>
267 G4cout <<
"Skipping FillNtupleIColumn for " << ntupleId <<
G4endl;
274 description <<
" ntupleId " << ntupleId
275 <<
" columnId " << columnId <<
" value " <<
value;
282 if ( !
ntuple )
return false;
286 if ( index < 0 || index >=
G4int(
ntuple->columns().size()) ) {
288 description <<
" " <<
"ntupleId " << ntupleId
289 <<
" columnId " << columnId <<
" does not exist.";
290 G4Exception(
"G4TNtupleManager::FillNtupleTColumn()",
294 auto icolumn =
ntuple->columns()[index];
297 auto column =
dynamic_cast<tools::wroot::base_pntuple::column<T>*
>(icolumn);
300 description <<
" Column type does not match: "
301 <<
" ntupleId " << ntupleId
302 <<
" columnId " << columnId <<
" value " <<
value;
313 description <<
" ntupleId " << ntupleId
314 <<
" columnId " << columnId <<
" value " <<
value;