ROOT Version : 6.26
Platform : Debian 11
Compiler : GCC 10.2
#include <iostream>
#include "TFile.h"
#include "TTree.h"
struct Event{
int NParticle;
double b, PsiEP;
};
int main(int argc, char **argv){
TFile File("test.root", "recreate");
TTree Tree("Events", "Event Info");
Event E;
Tree.Branch("Event", &E, "NParticle/I:b/D:PsiEP/D");
E = {10, 0.5, -0.5};
Tree.Fill();
File.Write();
File.Close();
return 0;
}
Not getting stored in test.root. Am I missing something here ? What is the correct
procedure to store C-like structs in a Tree ? (Apart from creating branches for each
member variable separately )