Hi rooters,
i have a TNTuple which is filled with different float values:
for (Int_t icl =0; icl<fclarray->GetEntriesFast();icl++){
cout <<"icl= "<<icl<<endl;
AliTRDcluster *cl = (AliTRDcluster*)fclarray->UncheckedAt(icl);
cout<<"cl= "<<cl<<endl;
if (!cl) continue;
Int_t localTimeBin=cl->GetLocalTimeBin();
Float_t charge = cl->GetQ();
Float_t lx = cl->GetX();
Float_t ly = cl->GetY();
Float_t lz = cl->GetZ();
Float_t pcenter = cl->GetCenter();
Int_t Npads = cl->GetNPads();
printf("charge= %f, lx= %f, ly= %f, lz= %f, pcenter= %f, Npads= %f \n",charge,lx,ly,lz,pcenter,Npads);
signtp[0]=Float_t(iEntry);
signtp[1]=Float_t(icl);
signtp[2]=Float_t(localTimeBin);
signtp[3]=Float_t(charge);
signtp[4]=Float_t(lx);
signtp[5]=Float_t(ly);
signtp[6]=Float_t(lz);
signtp[7]=Float_t(pcenter);
signtp[8]=Float_t(iEntry%540);
signtp[9]=Float_t(Npads);
signal->Fill(signtp);
}
Now how can i process these value arrays, one by one?
Best regards.
ps: i want to make a linear fit for the (x,y) points, then discard the value arrays which have a high deviation ( in y) from the fitting.
signal = new TNtuple("sig","test","ientry:clus:t:q:x:y:z:ctr:det:clusize");
Float_t signtp[10];
for (Int_t iEntry = 0; iEntry < nevents; iEntry++) {
chain.GetEvent(iEntry);
cout<<"chain.GetEvent(iEntry)= "<<chain.GetEvent(iEntry)<<endl;
cout <<"fclarray->GetEntriesFast()= "<<fclarray->GetEntriesFast()<<endl;
for (Int_t icl =0; icl<fclarray->GetEntriesFast();icl++){
cout <<"icl= "<<icl<<endl;
AliTRDcluster *cl = (AliTRDcluster*)fclarray->UncheckedAt(icl);
cout<<"cl= "<<cl<<endl;
if (!cl) continue;
Int_t localTimeBin=cl->GetLocalTimeBin();
Float_t charge = cl->GetQ();
Float_t lx = cl->GetX();
Float_t ly = cl->GetY();
Float_t lz = cl->GetZ();
Float_t pcenter = cl->GetCenter();
Int_t Npads = cl->GetNPads();
printf("charge= %f, lx= %f, ly= %f, lz= %f, pcenter= %f, Npads= %f \n",charge,lx,ly,lz,pcenter,Npads);
signtp[0]=Float_t(iEntry);
signtp[1]=Float_t(icl);
signtp[2]=Float_t(localTimeBin);
signtp[3]=Float_t(charge);
signtp[4]=Float_t(lx);
signtp[5]=Float_t(ly);
signtp[6]=Float_t(lz);
signtp[7]=Float_t(pcenter);
signtp[8]=Float_t(iEntry%540);
signtp[9]=Float_t(Npads);
signal->Fill(signtp);
}
pcanal
February 11, 2008, 6:31pm
4
[quote]Now how can i process these value arrays, one by one? [/quote]I am not sure what you mean? (Did you try any of the techniques described in the user’s guide? How far are they from what you need?)
Cheers,
Philippe.
as the values stored in the Ntuple are correlated, i want to work with them array by array. E.g. print the ntuple as in the fprint line. How about ntuple->GetEntry?
pcanal
February 13, 2008, 7:01pm
6
I still ponder “Did you try any of the techniques described in the user’s guide? How far are they from what you need?” …
Anyway try chain->Scan(“x:y”); for printf
try chain->Draw(“x”); for histogramming …
Cheers,
Philippe.