I tried modify the TMVAClassification.C macro to analysis for single electron data
and I get the following message.
: Dataset[dataset] : ERROR while preparing training and testing trees:
: Dataset[dataset] : multiple array-type expressions of different length were encountered
: Dataset[dataset] : location of error: event 0 in tree Signal_Tree of file SingleElectron.root
: Dataset[dataset] : expression track_R has Dataset[dataset] : 3 entries, while
: Dataset[dataset] : expression track_Eta has Dataset[dataset] : 6 entries
: Dataset[dataset] : Need to abort
***> abort program execution
terminate called after throwing an instance of ‘std::runtime_error’
what(): FATAL error
The data file I used have variable which is consist of vector of different size.
According to error message, that fact seems to be causing error.
I saw the above topic on ROOT forum.
And found the something I want. In the end of topic kialbert saied “If the vector is of variable size we need to consider another approach.”
But I have no idea how the problem can solve.
Please give me some advice.
Could you elaborate on why the two variables have different length? In a single event there should be a set number of tracks, and all variables referring to track data should have an entry for each track.
I don’t see why the branch track_R should have only 3 entries while track_Eta should have 6 entries.
The most straight forward solution is to reformat your data so that each branch corresponds to a TMVA variable.
I am learning to use the TMVA classification and facing the similar problem. I have a vector branch with different size for different events, I am wondering if it’s possible to add this branch into the dataloader? and how can I do this?
Thank you very much in advance!
Best regards,
Dexu
(In the future, please post a new question instead of reviving an old one. This to help keep better order in the forum. )
Unfortunately, the answer is a negative: This is not something TMVA is designed to handle. You can add array elements (e.g. dataloader->AddVariable("myArrayBranch[0]")), but not variable length arrays.