I am trying to loop over time and store the value of entries after every time interval of 1.2e9 secs, and plot for beam run after every 1.2e9 secs, however what I am getting is a cumulative plot for all the entries, and what I am looking for is a fragmented plot for each beam run and to register each entries. I am attaching the block of the for loop I implemented.
for (double t=0; t<RecoHitPos[nHit][3];t+=1.2e9)
{
if (RecoHitPos[nHit][0] != -999)
{
cout<<" RecoHitPos[nHit][3]"<<RecoHitPos[nHit][3]<<endl;
h2D_spill->Fill(RecoHitPos[nHit][2],RecoHitPos[nHit][0]);
}
}
}
What should I do to get a plot that way and store all the values of entries for each run?
the t variable is only used on the first line. What is the point of the loop if t is not used inside the loop? Each iteration will be exactly the same…
Hi Yus,
I want to actually some conditon for t inside the if {}, but I am not being able to understand what condition to I put that gives me the result after every the fixed time interval,
I tried this too :
if (RecoHitPos[iHit][0] != -999) {
for (double t=0; t<RecoHitPos[iHit][3];t+=1.2e12)
but the it won’t loop over and returns to be zero only, howevwe if I do a cout with RecoHitPos[iHit][3] then it loops over all the values. Is the for loop correct in terms of of assigning the t value to an array?
for (double t=0; t<RecoHitPos[iHit][3];t+=1.2e14)
cout<<" RecoHitPos[iHit][3]"<<RecoHitPos[iHit][3]<<endl;
, then how come RecoHitPos[iHit][3] changes inside that loop? Or is there another loop over something else outside this one? Please also show the values of t and iHit with something like