mcr/calib/tofino/ShowTofCalib.C

00001 /*
00002 ======================================================================
00003   ShowTofCalib(const TString &fname)
00004     Show histograms, which is produced by FillTofCalib.
00005 ======================================================================
00006 */
00007 #include "TFile.h"
00008 #include "TCanvas.h"
00009 #include "TH1F.h"
00010 
00011 #include "TFndHdt.h"
00012 
00013 using namespace FROOT;
00014 
00015 void ShowTofCalib(const TString &fname){
00016   TFile *file = new TFile(fname.Data());
00017 
00018   if (!file) return;
00019 
00020   TString hname;
00021   TH1F* histo;
00022 
00023   TCanvas *c1 = new TCanvas("c1","raw ADC (e)",0,0,1024,768);
00024   c1->Divide(4,3);
00025 
00026   for (Int_t sl=0; sl<K_N_TOFINO_SLABS; sl++){
00027     c1->cd(sl+1);
00028     hname.Form("TofinoAdcEBha_%d",sl+1);
00029     histo = (TH1F*) file->Get(hname.Data());
00030     histo->SetLineColor(kRed);
00031     histo->Draw();
00032 
00033     hname.Form("TofinoAdcE_%d",sl+1);
00034     histo = (TH1F*) file->Get(hname.Data());
00035     histo->Draw("same");
00036 
00037     hname.Form("TofinoAdcEKaon_%d",sl+1);
00038     histo = (TH1F*) file->Get(hname.Data());
00039     histo->SetLineColor(kBlue);
00040     histo->Draw("same");
00041   }
00042 
00043   TCanvas *c2 = new TCanvas("c2","raw ADC (p)",40,40,1024,768);
00044   c2->Divide(4,3);
00045 
00046   for (Int_t sl=0; sl<K_N_TOFINO_SLABS; sl++){
00047     c2->cd(sl+1);
00048     hname.Form("TofinoAdcPBha_%d",sl+1);
00049     histo = (TH1F*) file->Get(hname.Data());
00050     histo->SetLineColor(kRed);
00051     histo->Draw();
00052 
00053     hname.Form("TofinoAdcP_%d",sl+1);
00054     histo = (TH1F*) file->Get(hname.Data());
00055     histo->Draw("same");
00056 
00057     hname.Form("TofinoAdcPKaon_%d",sl+1);
00058     histo = (TH1F*) file->Get(hname.Data());
00059     histo->SetLineColor(kBlue);
00060     histo->Draw("same");
00061 
00062   }
00063 
00064   TCanvas *c3 = new TCanvas("c3","subtracted ADC (e)",40*2,40*2,1024,768);
00065   c3->Divide(4,3);
00066 
00067   for (Int_t sl=0; sl<K_N_TOFINO_SLABS; sl++){
00068     c3->cd(sl+1);
00069     hname.Form("TofinoAdcEBhaSubtr_%d",sl+1);
00070     histo = (TH1F*) file->Get(hname.Data());
00071     histo->SetLineColor(kRed);
00072     histo->Draw();
00073 
00074     hname.Form("TofinoAdcESubtr_%d",sl+1);
00075     histo = (TH1F*) file->Get(hname.Data());
00076     histo->Draw("same");
00077 
00078     hname.Form("TofinoAdcEKaonSubtr_%d",sl+1);
00079     histo = (TH1F*) file->Get(hname.Data());
00080     histo->SetLineColor(kBlue);
00081     histo->Draw("same");
00082 
00083   }
00084 
00085   TCanvas *c4 = new TCanvas("c4","subtracted ADC (p)",40*3,40*3,1024,768);
00086   c4->Divide(4,3);
00087 
00088   for (Int_t sl=0; sl<K_N_TOFINO_SLABS; sl++){
00089     c4->cd(sl+1);
00090     hname.Form("TofinoAdcPBhaSubtr_%d",sl+1);
00091     histo = (TH1F*) file->Get(hname.Data());
00092     histo->SetLineColor(kRed);
00093     histo->Draw();
00094 
00095     hname.Form("TofinoAdcPSubtr_%d",sl+1);
00096     histo = (TH1F*) file->Get(hname.Data());
00097     histo->Draw("same");
00098 
00099     hname.Form("TofinoAdcPKaonSubtr_%d",sl+1);
00100     histo = (TH1F*) file->Get(hname.Data());
00101     histo->SetLineColor(kBlue);
00102     histo->Draw("same");
00103 
00104   }
00105   
00106   TCanvas *c5 = new TCanvas("c5","equalized ADC (e)",40*4,40*4,1024,768);
00107   c5->Divide(4,3);
00108 
00109   for (Int_t sl=0; sl<K_N_TOFINO_SLABS; sl++){
00110     c5->cd(sl+1);
00111     hname.Form("TofinoAdcEBhaEqu_%d",sl+1);
00112     histo = (TH1F*) file->Get(hname.Data());
00113     histo->SetLineColor(kRed);
00114     histo->Draw();
00115 
00116     hname.Form("TofinoAdcEEqu_%d",sl+1);
00117     histo = (TH1F*) file->Get(hname.Data());
00118     histo->Draw("same");
00119 
00120     hname.Form("TofinoAdcEKaonEqu_%d",sl+1);
00121     histo = (TH1F*) file->Get(hname.Data());
00122     histo->SetLineColor(kBlue);
00123     histo->Draw("same");
00124 
00125   }
00126 
00127   TCanvas *c6 = new TCanvas("c6","equalized ADC (p)",40*5,40*5,1024,768);
00128   c6->Divide(4,3);
00129 
00130   for (Int_t sl=0; sl<K_N_TOFINO_SLABS; sl++){
00131     c6->cd(sl+1);
00132     hname.Form("TofinoAdcPBhaEqu_%d",sl+1);
00133     histo = (TH1F*) file->Get(hname.Data());
00134     histo->SetLineColor(kRed);
00135     histo->Draw();
00136 
00137     hname.Form("TofinoAdcPEqu_%d",sl+1);
00138     histo = (TH1F*) file->Get(hname.Data());
00139     histo->Draw("same");
00140 
00141     hname.Form("TofinoAdcPKaonEqu_%d",sl+1);
00142     histo = (TH1F*) file->Get(hname.Data());
00143     histo->SetLineColor(kBlue);
00144     histo->Draw("same");
00145 
00146   }
00147 
00148 }
00149   

Generated on Tue Oct 16 15:40:47 2007 by  doxygen 1.5.2