31 #ifndef G4RootPNtupleManager_h
32 #define G4RootPNtupleManager_h 1
56 class mutex :
public virtual tools::wroot::imutex {
113 const G4String&
name, std::vector<int>* vector)
override;
115 const G4String&
name, std::vector<float>* vector)
override;
117 const G4String&
name, std::vector<double>* vector)
override;
157 tools::wroot::base_pntuple*
162 template <typename
T>
166 template <typename
T>
168 const
G4String& name, std::vector<
T>* vector);
170 template <typename
T>
173 template <typename
T>
188 template <typename
T>
195 description << name <<
" ntupleId " << ntupleId;
204 auto& ntupleBooking = ntupleDescription->fNtupleBooking;
205 auto index = ntupleBooking.columns().size();
207 ntupleBooking.template add_column<T>(
name);
209 ntupleBooking.template add_column<T>(
name, *vector);
216 description << name <<
" ntupleId " << ntupleId;
226 template <
typename T>
231 return CreateNtupleTColumn<T>(ntupleId,
name, vector);
240 G4cout <<
"Skipping FillNtupleIColumn for " << ntupleId <<
G4endl;
247 description <<
" ntupleId " << ntupleId
248 <<
" columnId " << columnId <<
" value " <<
value;
254 if ( !
ntuple )
return false;
257 if ( index < 0 || index >=
G4int(
ntuple->columns().size()) ) {
259 description <<
" " <<
"ntupleId " << ntupleId
260 <<
" columnId " << columnId <<
" does not exist.";
261 G4Exception(
"G4RootNtupleManager::FillNtupleTColumn()",
266 auto icolumn =
ntuple->columns()[index];
267 auto column =
dynamic_cast<tools::wroot::base_pntuple::column_string*
>(icolumn);
270 description <<
" Column type does not match: "
271 <<
" ntupleId " << ntupleId
272 <<
" columnId " << columnId <<
" value " <<
value;
273 G4Exception(
"G4RootNtupleManager:FillNtupleColumn",
283 description <<
" ntupleId " << ntupleId
284 <<
" columnId " << columnId <<
" value " <<
value;
292 template <
typename T>
297 G4cout <<
"Skipping FillNtupleIColumn for " << ntupleId <<
G4endl;
304 description <<
" ntupleId " << ntupleId
305 <<
" columnId " << columnId <<
" value " <<
value;
312 if ( !
ntuple )
return false;
316 if ( index < 0 || index >=
G4int(
ntuple->columns().size()) ) {
318 description <<
" " <<
"ntupleId " << ntupleId
319 <<
" columnId " << columnId <<
" does not exist.";
320 G4Exception(
"G4TNtupleManager::FillNtupleTColumn()",
324 auto icolumn =
ntuple->columns()[index];
327 auto column =
dynamic_cast<tools::wroot::base_pntuple::column<T>*
>(icolumn);
330 description <<
" Column type does not match: "
331 <<
" ntupleId " << ntupleId
332 <<
" columnId " << columnId <<
" value " <<
value;
343 description <<
" ntupleId " << ntupleId
344 <<
" columnId " << columnId <<
" value " <<
value;
352 template <
typename T>