Subversion Repositories f9daq

Rev

Details | Last modification | View Log | RSS feed

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