File indexing completed on 2024-04-06 12:02:01
0001 void CSCGainsStudy_MakePlots(int debug){
0002
0003
0004
0005
0006
0007
0008
0009 TFile *file = TFile::Open("csc_strip_gains.root");
0010
0011
0012 TString suffixps = ".jpg";
0013
0014
0015 for (int i = 1; i < 37; i++ ) {
0016 int j = 0;
0017 if ( j == i ) TString chamber = "All_CSC";
0018 if (++j == i ) TString chamber = "ME_11_27";
0019 if (++j == i ) TString chamber = "ME_11_28";
0020 if (++j == i ) TString chamber = "ME_11_29";
0021 if (++j == i ) TString chamber = "ME_11_30";
0022 if (++j == i ) TString chamber = "ME_11_31";
0023 if (++j == i ) TString chamber = "ME_11_32";
0024 if (++j == i ) TString chamber = "ME_12_27";
0025 if (++j == i ) TString chamber = "ME_12_28";
0026 if (++j == i ) TString chamber = "ME_12_29";
0027 if (++j == i ) TString chamber = "ME_12_30";
0028 if (++j == i ) TString chamber = "ME_12_31";
0029 if (++j == i ) TString chamber = "ME_12_32";
0030 if (++j == i ) TString chamber = "ME_13_27";
0031 if (++j == i ) TString chamber = "ME_13_28";
0032 if (++j == i ) TString chamber = "ME_13_29";
0033 if (++j == i ) TString chamber = "ME_13_30";
0034 if (++j == i ) TString chamber = "ME_13_31";
0035 if (++j == i ) TString chamber = "ME_13_32";
0036 if (++j == i ) TString chamber = "ME_21_14";
0037 if (++j == i ) TString chamber = "ME_21_15";
0038 if (++j == i ) TString chamber = "ME_21_16";
0039 if (++j == i ) TString chamber = "ME_22_27";
0040 if (++j == i ) TString chamber = "ME_22_28";
0041 if (++j == i ) TString chamber = "ME_22_29";
0042 if (++j == i ) TString chamber = "ME_22_30";
0043 if (++j == i ) TString chamber = "ME_22_31";
0044 if (++j == i ) TString chamber = "ME_22_32";
0045 if (++j == i ) TString chamber = "ME_31_14";
0046 if (++j == i ) TString chamber = "ME_31_15";
0047 if (++j == i ) TString chamber = "ME_31_16";
0048 if (++j == i ) TString chamber = "ME_32_27";
0049 if (++j == i ) TString chamber = "ME_32_28";
0050 if (++j == i ) TString chamber = "ME_32_29";
0051 if (++j == i ) TString chamber = "ME_32_30";
0052 if (++j == i ) TString chamber = "ME_32_31";
0053 if (++j == i ) TString chamber = "ME_32_32";
0054
0055
0056
0057 hGains = (TH1F *) file->Get("hGain_"+chamber);
0058 hGaindiff = (TH1F *) file->Get("hGaindiff_"+chamber);
0059 hGainvsch = (TH2F *) file->Get("hGainvsch_"+chamber);
0060
0061 gStyle->SetOptFit(0111);
0062
0063
0064 TString plot1 = "strip_weight_"+chamber+suffixps;
0065 gStyle->SetOptStat(kTRUE);
0066 TCanvas *c1 = new TCanvas("c1","");
0067 c1->SetFillColor(10);
0068 c1->SetLogy(1);
0069 hGains->Draw();
0070 c1->Print(plot1);
0071
0072
0073
0074 TString plot2 = "delta_strip_weight_"+chamber+suffixps;
0075 gStyle->SetOptStat(kTRUE);
0076 TCanvas *c1 = new TCanvas("c1","");
0077 c1->SetLogy(1);
0078 c1->SetFillColor(10);
0079 hGaindiff->Draw();
0080 hGaindiff->Fit("gaus");
0081 c1->Print(plot2);
0082
0083 if (i > 0) {
0084
0085 TString plot3 = "strip_weight_vs_channel_"+chamber+suffixps;
0086 gStyle->SetOptStat(kTRUE);
0087 TCanvas *c1 = new TCanvas("c1","");
0088 c1->SetLogy(0);
0089 c1->SetFillColor(10);
0090 hGainvsch->Draw("BOX");
0091 c1->Print(plot3);
0092 }
0093 }
0094
0095
0096
0097 }