Subversion Repositories f9daq

Rev

Blame | Last modification | View Log | RSS feed


{
  int map[8][8]={{32,34,53,55,40,42,61,63},
                 {48,50,37,39,56,58,45,47},
                 {33,35,52,54,41,43,60,62},
                 {49,51,36,38,57,59,44,46},
                 {17,19,4,6,25,27,12,14},
                 {1,3,20,22,9,11,28,30},
                 {16,18,5,7,24,26,13,15},
                 {0,2,21,23,8,10,29,31}
                };
  TCanvas* canvas = new TCanvas("canvas","",1200,1200);
  canvas->cd();
  //canvas->Divide(4,4);
  TVirtualPad *main = new TPad("main","main",0,0,1,1,10,1);
  main->Draw();
  main->Divide(4,4);
  
  TH1F* h_thrProj[16];
  for(int i=0; i<4; i++) {
    for(int j=0; j<4; j++) {
      int channel = map[i][j];
      printf("%d ", channel);
      TH1D* histogram = h_threshold->ProjectionY("",channel+1,channel+1);
      int nBins = histogram->GetXaxis()->GetNbins();
      char name[128];
      int current = i*4+j;
      sprintf(name,"histo%d",current);
      //h_thrProj[i*4+j] = (TH1F*)gROOT->FindObject(name);
      if (h_thrProj[i*4+j]) delete h_thrProj[i*4+j];
      h_thrProj[current] = new TH1F(name, name, nBins,0,nBins);
      for(int k=0; k< nBins; k++){
        int signal = histogram->GetBinContent(k);
        h_thrProj[current]->Fill(k,signal);
      }
      int canvasPosition = i+4*(3-j)+1;
      main->cd(canvasPosition);
      //printf("%d \n", canvasPosition);
      h_thrProj[current]->Draw();
    }
  }

}