Subversion Repositories f9daq

Rev

Rev 36 | Rev 40 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36 Rev 38
Line 9... Line 9...
9
#include "TPad.h"
9
#include "TPad.h"
10
#include "TF1.h"
10
#include "TF1.h"
11
#include "TGraph.h"
11
#include "TGraph.h"
12
#include "TSpectrum.h"
12
#include "TSpectrum.h"
13
#include "stdio.h"
13
#include "stdio.h"
-
 
14
#include "THStack.h"
14
 
15
 
15
#include "include/RTUtil.h"
16
#include "include/RTUtil.h"
16
 
17
 
17
double getNoise(TH2F*, int, int);
18
double getNoise(TH2F*, int, int);
18
 
19
 
Line 30... Line 31...
30
                 {1,3,20,22,9,11,28,30},
31
                 {1,3,20,22,9,11,28,30},
31
                 {16,18,5,7,24,26,13,15},
32
                 {16,18,5,7,24,26,13,15},
32
                 {0,2,21,23,8,10,29,31}
33
                 {0,2,21,23,8,10,29,31}
33
                };
34
                };
34
               
35
               
35
               
36
  // Set draw style              
36
  RTSetStyle(gStyle);
37
  RTSetStyle(gStyle);
37
 
38
 
38
  // open the file with histograms
39
  // open the file with histograms
39
  char fnameroot[256];
40
  char fnameroot[256];
40
  TFile* rootfile;
41
  TFile* rootfile;
Line 43... Line 44...
43
        if(rootfile==NULL) rootfile = new TFile(fnameroot);
44
        if(rootfile==NULL) rootfile = new TFile(fnameroot);
44
        if(rootfile==NULL) {
45
        if(rootfile==NULL) {
45
          printf("Cannot open root file %s!!!\n",fnameroot);
46
          printf("Cannot open root file %s!!!\n",fnameroot);
46
          return(0);
47
          return(0);
47
        }
48
        }
48
 
49
 
49
  if(strstr(plopt, "tdc") != NULL) {
50
  if(strstr(plopt, "tdc") != NULL) {
50
    TCanvas *canvas21 = new TCanvas("canvas21","canvas21",1600,800);
51
    TCanvas *canvas21 = new TCanvas("canvas21","canvas21",1600,800);
51
    TH3F* h0 = (TH3F*) rootfile->Get("h_correctedTDC");
52
    TH3F* h0 = (TH3F*) rootfile->Get("h_correctedTDC");
52
          Int_t binsX = h0->GetXaxis()->GetNbins();
53
          Int_t binsX = h0->GetXaxis()->GetNbins();
53
    Int_t minX  = h0->GetXaxis()->GetFirst();
54
    Int_t minX  = h0->GetXaxis()->GetFirst();
Line 127... Line 128...
127
 
128
 
128
  if(strstr(plopt,"16") != NULL)
129
  if(strstr(plopt,"16") != NULL)
129
  {
130
  {
130
  TH2F* h_threshold = (TH2F*) rootfile->Get("h_bias");
131
  TH2F* h_threshold = (TH2F*) rootfile->Get("h_bias");
131
  TCanvas* canvas = new TCanvas("canvas","",1600,1600);
132
  TCanvas* canvas = new TCanvas("canvas","",1600,1600);
-
 
133
  TCanvas* canvas11 = new TCanvas("canvas11","",800,800);
132
  canvas->cd();
134
  canvas->cd();
133
  TVirtualPad *main = new TPad("main","main",0,0,1,1,10,1);
135
  TVirtualPad *main = new TPad("main","main",0,0,1,1,10,1);
134
  main->Draw();
136
  main->Draw();
-
 
137
  main->cd();
135
  main->Divide(4,4);
138
  main->Divide(4,4);
136
  for(int i=chXstart; i<chXend; i++) {
139
  for(int i=chXstart; i<chXend; i++) {
137
    for(int j=chYstart; j<chYend; j++) {
140
    for(int j=chYstart; j<chYend; j++) {
138
      int channel = map[i][j];
141
      int channel = map[i][j];
139
      TH1D* h_projection = h_threshold->ProjectionY("",channel+1,channel+1);
142
      TH1D* h_projection = h_threshold->ProjectionY("",channel+1,channel+1);
140
      int canvasPosition = i-chXend+4*(chYend-j)+1;
143
      int canvasPosition = i-chXend+4*(chYend-j)+1;
141
      printf(" %d ", canvasPosition);
144
      printf(" %d ", canvasPosition);
142
      main->cd(canvasPosition);
145
      main->cd(canvasPosition);
-
 
146
      gPad->SetMargin(0.08, 0.08, 0.08, 0.08);
143
      char name[128];
147
      char name[128];
144
      sprintf(name,"Channel %d",channel);
148
      sprintf(name,"Channel %d",channel);
145
      h_projection->SetTitle(name);
149
      h_projection->SetTitle(name);
-
 
150
      h_projection->GetYaxis()->SetRangeUser(0,10000);
146
      h_projection->DrawCopy("ex0");
151
      h_projection->DrawCopy("pe1x0");
-
 
152
      canvas11->cd();
-
 
153
      if (canvasPosition == 1) {
-
 
154
        h_projection->SetMarkerStyle(kFullDotMedium);
-
 
155
        h_projection->GetYaxis()->SetRangeUser(0,10000);
-
 
156
        h_projection->DrawCopy("Pl");
-
 
157
        }
-
 
158
      else {
-
 
159
        h_projection->SetMarkerStyle(kFullDotMedium);
-
 
160
        h_projection->SetLineColor(canvasPosition);
-
 
161
        h_projection->SetMarkerColor(canvasPosition);
-
 
162
        h_projection->SetTitle("");
-
 
163
        h_projection->DrawCopy("plsame");
-
 
164
        }
147
    }
165
    }
-
 
166
 
148
  }
167
  }
149
  printf("\n");
168
  printf("\n");
150
  }
169
  }
151
 
170
 
152
  if(strstr(plopt, "1ch") != NULL)
171
  if(strstr(plopt, "1ch") != NULL)
153
  {
172
  {
154
    TH2F* h_bias = (TH2F*) rootfile->Get("h_bias");
173
    TH2F* h_bias = (TH2F*) rootfile->Get("h_bias");
155
    TCanvas* canvas = new TCanvas("canvas","",1600,1600);
174
    TCanvas* canvas = new TCanvas("canvas","",800,800);
156
    canvas->cd();
175
    canvas->cd();
157
    int channel = map[chXstart][chXend];
176
    int channel = map[chXstart][chXend];
158
    TH1D* h_projection = h_bias->ProjectionY("",channel+1,channel+1);
177
    TH1D* h_projection = h_bias->ProjectionY("",channel+1,channel+1);
159
    char name[128];
178
    char name[128];
160
    sprintf(name,"Channel %d",channel);
179
    sprintf(name,"Channel %d",channel);
161
    h_projection->SetTitle(name);
180
    h_projection->SetTitle(name);
-
 
181
    h_projection->SetMarkerStyle(kFullDotMedium);
-
 
182
    //h_projection->SetMarkerSize(8);
-
 
183
    gPad->SetMargin(0.1,0.1,0.1,0.1);
162
    h_projection->DrawCopy("ex0");
184
    h_projection->Draw("pe1x0");
163
  }
185
  }
164
 
186
 
165
  if( strstr(plopt, "all") != NULL ) {
187
  if( strstr(plopt, "all") != NULL ) {
166
    TCanvas *canvas2 = new TCanvas("canvas2","Hits x;;",2000,2000);
188
    TCanvas *canvas2 = new TCanvas("canvas2","Hits x;;",2000,2000);
167
    TCanvas *canvas3 = new TCanvas("canvas3","Hits y;;",2000,2000);
189
    TCanvas *canvas3 = new TCanvas("canvas3","Hits y;;",2000,2000);