Hello PyROOT experts,
How to implement this code snippet in python
void tclwrite()
{
struct Prob{
Electron
Pion
Muon
Kaon
Proton
}
TFile f("tcl.root","recreate");
f.SetCompressionLevel(1);
TTree T("T","test tcl");
TClonesArray *arr = new TClonesArray("Prob");
TClonesArray &ar = *arr;
T.Branch("tcl",&arr,256000);
for (Int_t ev=0;ev<1000;ev++) {
ar.Clear();
Int_t nlines = Int_t(gRandom->Gaus(50,10));
if(nlines < 0) nlines = 1;
for (Int_t i=0;i<nlines;i++) {
Float_t x1 = gRandom->Rndm();
Float_t x2 = gRandom->Rndm();
Float_t x3 = gRandom->Rndm();
Float_t x4 = gRandom->Rndm();
new(ar[i]) Prob(x1,x2,x3,x4);
}
T.Fill();
}
T.Print();
T.Write();
}
Thank you in advance