Dear ROOTers:
A cordial greeting for everybody. It is my first time here and i would like to begin the contact with an small problem which is devouring my head this morning. I have a loop along one histogram, i compute a sum over the contents of all bins, i define a magnitude “prueba” just to perform a cut, then i apply the cut and i create one new sum which take into account the cut. My question is if i am performing the loop correctly 'cause i dont obtain the result i expect in the whole code (i get an empty file due to this implementation).
Thanks a lot in advance and the subset of the code is as follow:
Int_t bin1 = h_om_time[iom][ifloor]->FindBin(Tmin);
Int_t bin2 = h_om_time[iom][ifloor]->FindBin(Tnoise);
Int_t nbin = 0;
Double_t sumN=0, sumN2=0;
Double_t BinSize = (Tmax - Tmin)/h_om_time[iom][ifloor]->GetXaxis()->GetNbins();
Double_t prueba;
Double_t suma = 0, suma2 = 0;
for (Int_t ibin = bin1; ibin <= bin2; ibin++) {
Double_t bincon = h_om_time[iom][ifloor]->GetBinContent(ibin);
sumN += bincon;
sumN2 += binconbincon;
prueba = 1e6(sumN/nbin)/BinSize*numberOfEvents);
nbin++;
h_om_noise[iom][ifloor]->Fill(bincon);
if (prueba<=100) {
Double_t bincon = h_om_time[iom][ifloor]->GetBinContent(ibin);
suma += bincon;
suma2 += bincon*bincon;
nbin++;
}