Hello all, I’m new to root and basically stuck in a code algorithm because my knowledge in C is very minimum to non-existent.
here is the code that looping on all events and tracks of the event
for(int ipart=0;ipart<p.Ntracks;ipart++)
{
//CALCULATE A VARIABLE AND FILL IT INTO A HISTOGRAM
double pt = sqrt(p.px[ipart]*p.px[ipart]+p.py[ipart]*p.py[ipart])*1.1;
double phi0 = atan2(p.py[ipart],p.px[ipart]);
double phiRP = phi0-p.ReactionPlane;
if(phiRP<-M_PI) phiRP += 2*M_PI;
if(phiRP>M_PI) phiRP -= 2*M_PI;
if(phiRP<-M_PI/2) phiRP += M_PI;
if(phiRP>M_PI/2) phiRP -= M_PI;
ptdist->Fill(pt);
phidist->Fill(phiRP);
}
double pt = sqrt(p.px[ipart]*p.px[ipart]+p.py[ipart]*p.py[ipart])*1.1;
calculates the transverse momentum
while double phiRP = phi0-p.ReactionPlane;
flow angle.
The objective is I need do this phiRP (phi angle) code for tracks in various pT transverse momentum intervals, say: 2-300, 3-400, MeV/c, etc. After this I need to fill result into an angle distribution, separate for each pT.
The question is how to implement this? I tried like ptdist[nPART] intervals but it gives me error. So since my knowledge in C is non-existence compared to my python knowledge, I need help?
ROOT Version: 6.26.02
Platform: wsl
Compiler: emacs___