// Your own function to generate and print the histogram // Inputs : // 1. Data array (pointer to float) // 2. Size of data array (cont int) // 3. Number of bins (int) // 4. Lower limit of the histogram (float) // 5. Upper limit of the histogram (float) // void myhist(float *data, const int N, const int H, float low, float high){ float range = high - low; // Range of the histogram float width = range/float(H); // Width of each bins float w[H+2]={0}, X[H+2]={0}; // Arrays containing counts for bins and // bin centers for(int ii=0; iihigh) jj=H; // Over flow check w[jj+1] = w[jj+1] + 1.; // Increase the bin count } for(int jj=0; jjSetSeed(43540); // Generation of the data and filling the ROOT histogram float mean = 0.0; for(int ii=0; iiUniform(); mean +=r1[ii]; hr->Fill(r1[ii]); } mean = mean/double(N); // Mean calculated from raw data cout<<"Mean = "<Draw(); // Generating the historam using myhist cout<<"dumping myhist"<GetBinContent(j); //ROOT command X[j] = hr->GetBinCenter(j); //ROOT command hmean += w[j]*X[j]; } hmean = hmean/double(N); for(int j=0; j