I have a question: How can I add an array to an element of a tuple column in Geant4.
I have several value, and I want to put them into a array.
But I meet a error:
B4a/src/B4aEventAction.cc:92:46: error: no matching function for call to ‘G4RootAnalysisManager :: FillNtupleDColumn(int, double ).
The array can’t be stored in a tuple?
Can you tell me ?
Yes, the array can’t be stored in a ntuple. But you can use std::vector instead which is supported.
Please, look at the relevant section in the Application Developer Guide.
ok, I see.
Thank you so much .
I saw the relevant sections given in the reply and was able to create a column of type std::vector. But I still can’t fill them and I can’t find any reference regarding it in the Application Developer Guide. Can you please also point out on how to fill an std::vector type ntuple using G4root?
@jishun How did you fill up the
std::vector type ntuple columns?
An example of an ntuple with
std::vector ntuple columns types is provided at the basic B5 example.
and the ANALYSIS section.
There is indeed missing mentioning this example in the Application Developers Guide.
As the ntuple column takes the
std::vector reference, there is no need to call an extra
Fill method to fill a column, and the vector content is automatically saved in the ntuple when calling