Subversion Repositories f9daq

Rev

Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 f9daq 1
//---------------------------------------------------
2
int plot2d(char *opt="colz", float max=0){
3
char hname[50];
4
  char hn[50];
5
  TCanvas *c;
6
  TH1I *gICh = (TH1I * ) gDirectory->Get("mapping");  
7
  for (int i=0;i<4;i++) {
8
    sprintf(hname,"cz%d",i);
9
    sprintf(hn,"Corr Pmt %d",i);
10
    c =new TCanvas(hname,hn, 1000,1000);
11
    c->Divide(4,4);
12
    for (int j=0;j<16;j++){
13
      c->cd(gICh->GetBinContent(j+1)+1);
14
      sprintf(hn,"corrch%d",i*16+j);
15
       TH1F*h=    (TH1F * ) gDirectory->Get(hn);
16
      if (max>0) h->SetMaximum(max);
17
      h->Draw(opt);
18
    }
19
    c->Modified();
20
    c->Update();
21
  }
22
return 0;
23
}
24
 
25
//---------------------------------------------------
26
int plot( char *fname=NULL, float max=0){
27
  if (fname!=NULL){
28
    cout << "Rootname:" << fname << endl;
29
    delete gROOT->GetListOfFiles()->FindObject(fname); // clear memory of file name
30
    if( gSystem->AccessPathName(fname) ) {
31
      cout << endl << "File: " << fname << " not there!!!" << endl << endl;
32
      return 0;
33
    }
34
    TFile *rootfile = new TFile(fname);
35
  }
36
 //if (buf)  delete buf;
37
  char hn[255];
38
 
39
  TCanvas *c1;
40
  for (int i=0;i<4;i++){
41
    sprintf(hn,"csumadc%d",i);
42
    c1=new TCanvas(hn,hn,1200,1200);
43
    c1->Divide(9,9,0,0);
44
    sprintf(hn,"sumadc%d",i);
45
    TH2F *h = ((TH2F * )gDirectory->Get(hn));
46
    for (int j=0;j<81;j++){
47
      c1->cd(1+j);
48
      TH1D *h0 = h->ProjectionX(" ",1+j,1+j);
49
      h0->DrawCopy();
50
    }
51
    c1->Modified();
52
    c1->Update();
53
  }  
54
 
55
 
56
 
57
  TCanvas *c2=new TCanvas("c2","c2",800,800);
58
  c2->Divide(2,2);
59
  for (int i=0;i<4;i++){
60
    c2->cd(1+i);
61
    sprintf(hn,"pmt1%d",i);
62
     ((TH1F * ) gDirectory->Get(hn))->Draw("colz");
63
  }
64
  c2->Modified();
65
  c2->Update();
66
 
67
  TCanvas *c6=new TCanvas("c6","c6",800,800);
68
  c6->Divide(2,2);
69
  for (int i=0;i<4;i++){
70
    c6->cd(1+i);
71
    sprintf(hn,"pmt3%d",i);
72
     ((TH1F * ) gDirectory->Get(hn))->Draw("colz");
73
  }
74
  c6->Modified();
75
  c6->Update();
76
 
77
  TCanvas *c5=new TCanvas("c5","c5",800,800);
78
 
79
 
80
  ((TH1F * ) gDirectory->Get("globalxy"))->Draw("colz");
81
 
82
  c5->Modified();
83
  c5->Update();
84
 
85
 
86
  TCanvas *c3=new TCanvas("c3","c3",800,800);
87
  c3->Divide(2,2);
88
  for (int i=0;i<4;i++){
89
    c3->cd(1+i);
90
    sprintf(hn,"pmt2%d",i);
91
     ((TH1F * ) gDirectory->Get(hn))->Draw("colz");
92
  }
93
 
94
 
95
  c3->Modified();
96
  c3->Update();
97
 
98
  TCanvas *c4=new TCanvas("c4","c4",800,800);
99
  c4->Divide(4,4);
100
  for (int i=0;i<16;i++){
101
    c4->cd(1+i)->SetLogy();
102
    sprintf(hn,"ach%d",i);
103
     ((TH1F * ) gDirectory->Get(hn))->Draw();
104
  }
105
  c4->Modified();
106
  c4->Update();
107
  plot2d("colz",max);
108
  return 0;
109
}
110
 
111
//---------------------------------------------------
112
int plotadc(){
113
  char hn[255];
114
  TCanvas *c;
115
  char hname[50];
116
  char hn[50];
117
  TH1I *gICh = (TH1I * ) gDirectory->Get("mapping");
118
  for (int i=0;i<4;i++) {
119
    sprintf(hname,"cx%d",i);
120
    sprintf(hn,"Pmt %d",i);
121
    c =new TCanvas(hname,hn, 1000,1000);
122
    c->Divide(4,4);
123
    for (int j=0;j<16;j++){
124
      c->cd(gICh->GetBinContent(j+1)+1)->SetLogy();
125
      sprintf(hn,"ach%d",i*16+j);  
126
       ((TH1F * ) gDirectory->Get(hn))->Draw();
127
    }
128
    c->Modified();
129
    c->Update();
130
  }
131
 
132
  return 0;
133
}
134
 
135
//---------------------------------------------------
136
int plotsingles(char *opt="colz", float max=0){
137
 char hname[50];
138
 char hn[50];
139
 TCanvas *c;
140
  TH1I *gICh = (TH1I * ) gDirectory->Get("mapping");
141
 for (int i=0;i<4;i++) {
142
    sprintf(hname,"cy%d",i);
143
    sprintf(hn,"Single Pmt %d",i);
144
    c =new TCanvas(hname,hn, 1000,1000);
145
    c->Divide(4,4);
146
    for (int j=0;j<16;j++){
147
       c->cd(gICh->GetBinContent(j+1)+1);
148
      sprintf(hn,"singlech%d",i*16+j);
149
      TH1F*h=    (TH1F * ) gDirectory->Get(hn);
150
      if (max>0) gHistoSingle[i*16+j]->SetMaximum(max);
151
      h->Draw(opt);
152
    }
153
    c->Modified();
154
    c->Update();
155
  }
156
 
157
  return 0;
158
}
159
 
160
 
161
 
162
 
163
//---------------------------------------------------
164
int plotcut(char *opt="", float max=0){
165
char hname[50];
166
  char hn[50];
167
  TCanvas *c;
168
  TH1I *gICh = (TH1I * ) gDirectory->Get("mapping");
169
  for (int i=0;i<4;i++) {
170
    sprintf(hname,"cz%d",i);
171
    sprintf(hn,"Cut Pmt %d",i);
172
    c =new TCanvas(hname,hn, 1000,1000);
173
    c->Divide(4,4);
174
    for (int j=0;j<16;j++){
175
       c->cd(gICh->GetBinContent(j+1)+1)->SetLogy();
176
       sprintf(hn,"corrch%d",i);
177
       TH1F*h=    (TH1F * ) gDirectory->Get(hn);
178
      if (max>0) h->SetMaximum(max);
179
      h->Draw(opt);
180
    }
181
    c->Modified();
182
    c->Update();
183
  }
184
return 0;
185
}
186
//---------------------------------------------------