Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. //plot ROOT TH1F for each channel of the supplied array with "samples" bins
  2. void PlotTH1F(TFile* rootFile, double *plotArray, int channels, int samples, TString name)
  3. {
  4.     int i, j;
  5.     TString fullName;
  6.     TH1F **histArray = new TH1F*[channels];
  7.  
  8.     for (j = 0; j < channels; j++) {
  9.             fullName = name;
  10.             fullName += j;
  11.         histArray[j] = new TH1F(fullName,fullName,samples,0,samples);
  12.         for (i = 0; i < samples; i++) {
  13.             histArray[j]->Fill(i,plotArray[j*samples+i]);
  14.         }
  15.         histArray[j]->Draw();
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement