diff --git a/CS_analysis.cpp b/CS_analysis.cpp index a3e8458..84f8369 100644 --- a/CS_analysis.cpp +++ b/CS_analysis.cpp @@ -1231,7 +1231,7 @@ int main(int argc, char* argv[]) { } } - if (r0_adc.size() > 1 && r1_adc.size() > 1 && r2_adc.size() > 1) { + if ((r0_adc.size() > 1 && r1_adc.size() > 1) || (r1_adc.size() > 1 && r2_adc.size() > 1)) { if ((i >= 58000 && i < 58000+10) || // bulk (i >= 10 && i < 10+10) || // edge (i >= 1024+10 && i < 1024+10+10) || // inner edge @@ -1255,22 +1255,27 @@ int main(int argc, char* argv[]) { pixel_type = "q"; } - grap_g0->SetMarkerStyle(20); - grap_g1->SetMarkerStyle(20); - grap_g2->SetMarkerStyle(20); - grap_g0->SetMarkerColor(kBlue); - grap_g1->SetMarkerColor(kGreen+2); - grap_g2->SetMarkerColor(kRed); - grap_g0->SetLineColor(kBlue); - grap_g1->SetLineColor(kGreen+2); - grap_g2->SetLineColor(kRed); + if (r0_adc.size() > 1) { + grap_g0->SetMarkerStyle(20); + grap_g0->SetMarkerColor(kBlue); + grap_g0->SetLineColor(kBlue); + grap_g0->GetFunction("fit_g0")->Delete(); + grap_g0->FindObject("stats")->Delete(); + } - grap_g0->GetFunction("fit_g0")->Delete(); - grap_g0->FindObject("stats")->Delete(); + grap_g1->SetMarkerStyle(20); + grap_g1->SetMarkerColor(kGreen+2); + grap_g1->SetLineColor(kGreen+2); grap_g1->GetFunction("fit_g1")->Delete(); grap_g1->FindObject("stats")->Delete(); - grap_g2->GetFunction("fit_g2")->Delete(); - grap_g2->FindObject("stats")->Delete(); + + if (r2_adc.size() > 1) { + grap_g2->SetMarkerStyle(20); + grap_g2->SetMarkerColor(kRed); + grap_g2->SetLineColor(kRed); + grap_g2->GetFunction("fit_g2")->Delete(); + grap_g2->FindObject("stats")->Delete(); + } if (module_str == "021" || module_str == "029" || module_str == "035" || module_str == "039" || module_str == "045" || module_str == "048" || module_str == "050" || module_str == "057" || module_str == "062" || module_str == "064" || module_str == "067" || module_str == "080" || module_str == "086" || module_str == "100" || module_str == "102" || module_str == "103" || module_str == "104" || module_str == "108" || module_str == "109" || module_str == "110" || module_str == "113" || module_str == "119" || module_str == "121" || module_str == "124" || module_str == "126" || module_str == "226") { grap_g1->GetXaxis()->SetLimits(0.009,5E2); @@ -1285,8 +1290,12 @@ int main(int argc, char* argv[]) { grap_g1->GetYaxis()->SetTitle("ADC [ADU]"); grap_g1->GetYaxis()->SetTitleOffset(0.9); grap_g1->Draw("AP"); - grap_g2->Draw("P"); - grap_g0->Draw("P"); + if (r2_adc.size() > 1) { + grap_g2->Draw("P"); + } + if (r0_adc.size() > 1) { + grap_g0->Draw("P"); + } mapcanvas->SetLogx(); sprintf(savename,"plots/M%s/CurrentSource/pixel_%s_%d_M%s.png", module_str.c_str(), pixel_type.c_str(), i, module_str.c_str()); mapcanvas->SaveAs((const char *)(savename));