//INTT calibration_ana_code //Cheng-Wei Shih, NCU, Taiwan #include #include #include "TRandom.h" #include "TMath.h" #include "TFile.h" #include "TH1.h" #include "TH2.h" #include "TH3.h" #include "TProfile.h" #include "TRandom.h" #include "TTree.h" #include #include #include #include #include #include #include #include #include #include #include "TGraphErrors.h" #include #include #include #include #include #include "Riostream.h" #include #include #include //to add string with the tree name #include #include #include #include #include #include //#include "untuplizer.h" //#include "sigmaEff.h" double RC_eq1 ( double *t, double *par ) { return par[0]*t[0]+par[1]; } //void name with "copy" is correct void calibration_ana_code_multi_copy (TString folder_name,int module_number, bool run_option, bool assembly_check,int noise_level_check,bool new_check, bool unbound_check, bool noise_channel_check, bool multi_run) { TString list_buffer; vector list_array; list_array.clear(); TString the_name; ifstream data_list; data_list.open(Form("%s/total_file.txt",folder_name.Data())); while ( 1 ) { data_list >> list_buffer ; list_array.push_back(list_buffer); if ( !data_list.good() ) { break; } } cout<<"test list size : "<Get("tree"); TString data_buffer_a, data_buffer_b, data_buffer_c, data_buffer_d, data_buffer_e; vectordata_a; data_a.clear(); vectordata_b; data_b.clear(); vectordata_c; data_c.clear(); vectordata_d; data_d.clear(); vectordata_e; data_e.clear(); // TString DB_NB, DB_ND; // double DB_NA, DB_NC, DB_NE; // vectorD_NA; D_NA.clear(); // vectorD_NB; D_NB.clear(); // vectorD_NC; D_NC.clear(); // vectorD_ND; D_ND.clear(); // vectorD_NE; D_NE.clear(); // TString DB_EB, DB_ED; // double DB_EA, DB_EC, DB_EE; // vectorD_EA; D_EA.clear(); // vectorD_EB; D_EB.clear(); // vectorD_EC; D_EC.clear(); // vectorD_ED; D_ED.clear(); // vectorD_EE; D_EE.clear(); int chip_N, chan_N; int chip_E, chan_E, level_E; int chip_U, chan_U; int chip_W, chan_W; double level_N, level_U,level_W; //TString source_name; TFile *file_output = new TFile (Form("%s/%s/%s_summary.root",folder_name.Data(),the_name.Data(),the_name.Data()),"RECREATE"); //file_output->cd(); TTree *tree_output1 = new TTree ("Noise_check" ,"With bias 100V, noise level > 4"); TTree *tree_output2 = new TTree ("Entries_check" ,"With bias 100V, Entries > 400 or entries < 280"); TTree *tree_output3 = new TTree ("Unbonded_check","Without bias, Noise level < 4"); TTree *tree_output4 = new TTree ("chan_gaus_width","gaus width of each channel"); tree_output1 -> Branch ("source_id", &run_file); tree_output1 -> Branch ("chip_id", &chip_N); tree_output1 -> Branch ("chan_id", &chan_N); tree_output1 -> Branch ("noise_level", &level_N); tree_output2 -> Branch ("source_id", &run_file); tree_output2 -> Branch ("chip_id", &chip_E); tree_output2 -> Branch ("chan_id", &chan_E); tree_output2 -> Branch ("entries", &level_E); tree_output3 -> Branch ("source_id", &run_file); tree_output3 -> Branch ("chip_id", &chip_U); tree_output3 -> Branch ("chan_id", &chan_U); tree_output3 -> Branch ("noise_level", &level_U); tree_output4 -> Branch ("source_id", &run_file); tree_output4 -> Branch ("chip_id", &chip_W); tree_output4 -> Branch ("chan_id", &chan_W); tree_output4 -> Branch ("Gaus_width", &level_W); if (multi_run==true) { ifstream input_data; input_data.open(Form("%s/multi_run_status.txt",folder_name.Data())); while ( 1 ) { input_data >> data_buffer_a >> data_buffer_b >> data_buffer_c >> data_buffer_d >> data_buffer_e ; data_a.push_back(data_buffer_a); data_b.push_back(data_buffer_b); data_c.push_back(data_buffer_c); data_d.push_back(data_buffer_d); data_e.push_back(data_buffer_e); if ( !input_data.good() ) { break; } //the_test_event.push_back(n+1); } // ifstream input_data_N; // input_data_N.open(Form("%s/multi_run_noise.txt")); // while ( 1 ) // { // input_data_N >> DB_NA >> DB_NB >> DB_NC >> DB_ND >> DB_NE ; // D_NA.push_back(DB_NA); // D_NB.push_back(DB_NB); // D_NC.push_back(DB_NC); // D_ND.push_back(DB_ND); // D_NE.push_back(DB_NE); // if ( !input_data_N.good() ) // { // break; // } // //the_test_event.push_back(n+1); // } // ifstream input_data_E; // input_data_E.open(Form("%s/multi_run_entries.txt")); // while ( 1 ) // { // input_data_E >> DB_EA >> DB_EB >> DB_EC >> DB_ED >> DB_EE ; // D_EA.push_back(DB_EA); // D_EB.push_back(DB_EB); // D_EC.push_back(DB_EC); // D_ED.push_back(DB_ED); // D_EE.push_back(DB_EE); // if ( !input_data_E.good() ) // { // break; // } // //the_test_event.push_back(n+1); // } } ofstream multi_txt; if (multi_run==true) { multi_txt.open(Form("%s/multi_run_status.txt",folder_name.Data()), ios::out);//¶}±ÒÀÉ®× if(!multi_txt) { //¦pªG¶}±ÒÀÉ®×¥¢±Ñ¡Afp¬°0¡F¦¨¥\¡Afp¬°«D0 cout<<"Fail to open file: "< adc_memory; adc_memory.clear(); vector ampl_memory; ampl_memory.clear(); vector chip_id_memory; chip_id_memory.clear(); vector fpga_id_memory; fpga_id_memory.clear(); vector module_memory; module_memory.clear(); vector chan_id_memory; chan_id_memory.clear(); vector fem_id_memory; fem_id_memory.clear(); vector bco_memory; bco_memory.clear(); vector bco_full_memory; bco_full_memory.clear(); vector event_memory; event_memory.clear(); vector chip_adc[26][128]; //chip_adc.clear(); vector chip_ampl[26][128]; //chip_ampl.clear(); vector ampl_adc_slope[26]; vector ampl_adc_offset[26]; vector ampl_adc_chiNDF[26]; vector unbound_chip; unbound_chip.clear(); vector unbound_channel; unbound_channel.clear(); vector unbound_width; unbound_width.clear(); vector noise_chip; noise_chip.clear(); vector noise_channel; noise_channel.clear(); vector noise_width; noise_width.clear(); vector entries_chip; entries_chip.clear(); vector entries_channel; entries_channel.clear(); vector entries_entries; entries_entries.clear(); for (int i=0; i <26; i++) { ampl_adc_slope[i].clear(); ampl_adc_offset[i].clear(); ampl_adc_chiNDF[i].clear(); for (int i1=0; i1<128; i1++) { chip_adc[i][i1].clear(); chip_ampl[i][i1].clear(); } } Gettree->SetBranchAddress("adc",&adc); Gettree->SetBranchAddress("ampl",&l); Gettree->SetBranchAddress("chip_id",&chip_id); Gettree->SetBranchAddress("fpga_id",&fpga_id); Gettree->SetBranchAddress("module",&module); Gettree->SetBranchAddress("chan_id",&chan_id); Gettree->SetBranchAddress("fem_id",&fem_id); Gettree->SetBranchAddress("bco",&bco); Gettree->SetBranchAddress("bco_full",&bco_full); Gettree->SetBranchAddress("event",&event); int total_size=Gettree->GetEntriesFast(); cout<<" total event : "<GetEntry(i); //if (chan_id == 127)cout << event <<" : "<< ampl <<" : "<< adc <<" : "<< chip_id <<" : "<< chan_id<0 && chip_id < 27 && chan_id > -1 && chan_id<128 && module==module_number) { chip_ampl[chip_id-1][chan_id] .push_back(ampl); chip_adc [chip_id-1][chan_id] .push_back(adc); } else { if (module ==module_number ) { cout <<" the weird event : "<< event <<" : "<< ampl <<" : "<< adc <<" : "<< chip_id <<" : "<< chan_id<Divide(13,2); TCanvas *c5=new TCanvas("c5","channel to adc",1625,250); c5->Divide(13,2); TF1*slope = new TF1 ("slope",RC_eq1,0,70,2); TH2F * ampl_adc [26]; TLatex *tex111 = new TLatex(); tex111 -> SetNDC (); //tex11 -> SetTextFont (42); tex111 -> SetTextSize (0.028); TH1F*noise_level = new TH1F ("",Form("noise_level : %d",noise_level_check),70,0,70); TF1*gaus_function = new TF1 ("gaus_function","gaus",0,70); gaus_function->SetLineColor(2); TF1*gaus_fit = new TF1 ("gaus_fit","gaus",0.0,0.18); vector chip_slope; chip_slope.clear(); vector chip_index; chip_index.clear(); cout<<"==============fitting data of 128_combine_ampladc =========="<cd(i4+1); ampl_adc[i4] = new TH2F ("",Form("chip_id=%d",i4+1),70,0,70,8,0,8); ampl_adc[i4]->SetStats(0); for (int i2=0; i2<128; i2++) { for (int i3=0; i30) { ampl_adc[i4]->Fill(chip_ampl[i4][i2][i3],chip_adc[i4][i2][i3]); if (chip_adc[i4][i2][i3] == noise_level_check) noise_level->Fill(chip_ampl[i4][i2][i3]); } } } ampl_adc[i4]->Draw("COLZ0"); ampl_adc[i4]->Fit("slope","NQ"); //cout<GetParameter(0)<<" offset : "<< slope->GetParameter(1)<<" chi2/NDF "<GetChisquare()/slope->GetNDF()<GetParameter(0)<<" "<< slope->GetParameter(1)<<" "<GetChisquare()/slope->GetNDF()<<"\r"<Draw("lsame"); chip_slope.push_back(slope->GetParameter(0)); chip_index.push_back(i4+1); //cout<<"TESTTESTTEST"< cd(); tex111 -> DrawLatex (0.12, 0.80-(i4*0.03), Form("chip_id=%d, slope : %.4f, offset : %.3f, chi2/NDF : %.2f",i4+1,slope->GetParameter(0),slope->GetParameter(1),slope->GetChisquare()/slope->GetNDF())); //cout<<"TESTTESTTEST"<Reset("ICESM"); } c4->Print(Form("%s/%s/128_combine_ampladc.pdf",folder_name.Data(),the_name.Data())); //c1->Print(Form("%s/%s/128_combine_ampladc_detail.pdf",the_name.Data())); cout<<"==============fitting data of 128_combine_ampladc =========="<Clear(); c1 ->Clear(); //fpall.close(); //cout<<"\r\n"<<"#the file fpall rewriting is finish#"<<"\r\n"<Reset("ICESM"); cout<<" "<cd(); noise_level->Draw("hist"); noise_level->Fit("gaus_function","NQ"); TLatex *texnoise_level = new TLatex(); texnoise_level -> SetNDC (); //tex11 -> SetTextFont (42); texnoise_level -> SetTextSize (0.04); texnoise_level ->DrawLatex(0.12, 0.750, Form("Gaus width : %.4f", gaus_function->GetParameter(2)));; gaus_function->Draw("lsame"); c1->Print(Form("%s/%s/128_combine_noise_level_check_%d.pdf",folder_name.Data(),the_name.Data(),noise_level_check)); c1->Clear(); TGraph * slop_chip_TG = new TGraph (26,&chip_index[0],&chip_slope[0]); slop_chip_TG->GetXaxis()->SetTitle("chip_id"); slop_chip_TG->GetYaxis()->SetTitle("slope"); //slop_chip_TG->GetYaxis()->SetRangeUser(-0.01,0.01); slop_chip_TG -> GetYaxis() -> SetTitleOffset (1.8); slop_chip_TG->SetTitle(""); slop_chip_TG->SetMarkerStyle(20); slop_chip_TG->SetMarkerSize(1.5); slop_chip_TG->SetMarkerColor(2); TCanvas *c3=new TCanvas("c3","c3",1200,1200); //c1->SetRightMargin(0 ); c3 -> SetLeftMargin (0.120); c3 -> SetRightMargin (0.075); c3->cd(); slop_chip_TG->Draw("apl"); c3->Print(Form("%s/%s/chip_slope_TG.pdf",folder_name.Data(),the_name.Data())); cout<<"==============information of 128_combine_chanampl =========="<Divide(13,2); for (int i4=0; i4<26; i4++) { chan_ampl[i4] = new TH2F ("",Form("chip_id=%d",i4+1),140,0,140,70,0,70); chan_ampl[i4]->SetStats(0); chan_ampl[i4]->SetMaximum(20); chan_ampl[i4]->SetMinimum(0); chan_adc[i4] = new TH2F ("",Form("chip_id=%d",i4+1),140,0,140,8,0,8); chan_adc[i4]->SetStats(0); //chan_adc[i4]->SetMaximum(20); chan_adc[i4]->SetMinimum(0); for (int i2=0; i2<128; i2++) { if (chip_ampl[i4][i2].size()>700 || chip_ampl[i4][i2].size()<200) cout<<" Need to check, the entries of each channel, chip : "<0) { //if (i4+1==16 && i2==0) cout<Fill(i2,chip_ampl[i4][i2][i3]); chan_adc[i4]->Fill(i2,chip_adc[i4][i2][i3]); } } } c4->cd(i4+1); chan_ampl[i4]->Draw("COLZ0"); c5->cd(i4+1); chan_adc[i4]->Draw("COLZ0"); //ampl_adc->Reset("ICESM"); } c4->Print(Form("%s/%s/128_combine_chanampl.pdf",folder_name.Data(),the_name.Data())); cout<<"==============information of 128_combine_chanampl =========="<Print(Form("%s/%s/128_combine_chanadc.pdf",folder_name.Data(),the_name.Data())); cout<<"==============information of 128_combine_chanadc =========="<Clear(); c5 ->Clear(); for(int i5=0; i5<26; i5++) chan_ampl[i5]->Reset("ICESM"); cout<<" "< SetNDC (); //tex11 -> SetTextFont (42); tex11 -> SetTextSize (0.028); TH2F*ampladc_detail = new TH2F ("","",70,0,70,8,0,8); TH1F*check_new = new TH1F ("","",70,0,70); check_new->GetXaxis()->SetTitle("offset_ampl"); check_new->GetYaxis()->SetTitle("entries"); TF1*gaus_fit_new = new TF1 ("gaus_fit_new","gaus",0,70); vector response_width[26]; TH1F*channel_entries_check = new TH1F ("","# of event each channel",50,280,400); channel_entries_check->GetXaxis()->SetTitle("channel event"); channel_entries_check->GetYaxis()->SetTitle("entries"); TH2F*slope_TH2 = new TH2F ("","",128,0,128,128,0.04,0.15); slope_TH2->SetStats(0); TH2F*offset_TH2 = new TH2F ("","",128,0,128,128,0.04,0.15); offset_TH2->SetStats(0); TH2F*ChiNDF_TH2 = new TH2F ("","",128,0,128,128,0.04,0.15); ChiNDF_TH2->SetStats(0); TCanvas *c2=new TCanvas("c2","c2",1200,1200); TH1F*slop_detail_TH = new TH1F ("","",100,0.08,0.18); slop_detail_TH->GetYaxis()->SetTitle("entries"); slop_detail_TH->GetXaxis()->SetTitle("fit slope "); slop_detail_TH -> GetYaxis() -> SetTitleOffset (1.6); c2 -> SetLeftMargin (0.120); c2 -> SetRightMargin (0.075); gStyle->SetOptStat(111111); double average_adc[8]; // double average_adc1; // double average_adc2; // double average_adc3; // double average_adc4; // double average_adc5; // double average_adc6; // double average_adc7; double sum_adc[8]; // double sum_adc1; // double sum_adc2; // double sum_adc3; // double sum_adc4; // double sum_adc5; // double sum_adc6; // double sum_adc7; double count_adc[8]; // double count_adc1; // double count_adc2; // double count_adc3; // double count_adc4; // double count_adc5; // double count_adc6; // double count_adc7; //ampladc_detail->SetStats(0); TCanvas* c6 = new TCanvas ("c6","c6",1200,1200); int channel_entries_outsider=0; for (int i4=0; i4<26; i4++) { if (run_option == true) {c1->cd(); c1->Print(Form("%s/%s/chip%d_detail_ampladc.pdf(",folder_name.Data(),the_name.Data(),i4+1));} if (new_check == true) {c6->cd(); c6->Print(Form("%s/%s/chip%d_detail_amploffset.pdf(",folder_name.Data(),the_name.Data(),i4+1));} for (int i2=0; i2<128; i2++) { ampladc_detail->SetTitle(Form("chip_id=%d, chan_id = %d",i4+1,i2)); check_new->SetTitle(Form("chip_id=%d, chan_id = %d",i4+1,i2)); //if (chip_ampl[i4][i2].size()>700 || chip_ampl[i4][i2].size()<200) cout<<" Need to check, the entries of each channel, chip : "<0) { //if (i4+1==16 && i2==0) cout<Fill(chip_ampl[i4][i2][i3],chip_adc[i4][i2][i3]); sum_adc[chip_adc[i4][i2][i3]]+=chip_ampl[i4][i2][i3]; count_adc[chip_adc[i4][i2][i3]]+=1; } } for(int i7=0; i7<8; i7++) { if (count_adc[i7]==0) { average_adc[i7]=sum_adc[i7]/1.; } else { average_adc[i7]=sum_adc[i7]/count_adc[i7]; } } for (int i3=0; i30) { //cout<<"line : 427 check "<Fill(chip_ampl[i4][i2][i3]-(average_adc[chip_adc[i4][i2][i3]]-average_adc[0])); } } c1->cd(); ampladc_detail->Draw("COLZ0"); ampladc_detail->Fit("slope","NQ"); c1->cd(); slope->Draw("lsame"); slope_TH2->Fill(i2,slope->GetParameter(0)); ampl_adc_slope[i4].push_back(slope->GetParameter(0)); ampl_adc_offset[i4].push_back(slope->GetParameter(1)); //ampl_adc_chiNDF[i4].push_back(slope->GetChisquare()/slope->GetNDF()); //fp<GetParameter(0)<<" "<GetParameter(1)<<" "<GetChisquare()/slope->GetNDF()<<"\r"<Fill(slope->GetParameter(0)); if (assembly_check == true) { if (i4==0 && i2==0)cout<<" =========== pad performance check ========="<GetParameter(0)>0.115) { //cout<<" the error pads check, chip_id : "<GetParameter(0)<GetParameter(0)<GetParameter(0)<GetParameter(0)<GetParameter(0)<cd(); tex11 -> DrawLatex (0.12, 0.750, Form("slope : %.4f", slope->GetParameter(0))); c1->cd(); tex11 -> DrawLatex (0.12, 0.720, Form("offset : %.2f", slope->GetParameter(1))); //c1->cd(); tex11 -> DrawLatex (0.12, 0.690, Form("chi2/NDF : %.2f", slope->GetChisquare()/slope->GetNDF())); if (run_option == true) {c1->cd(); c1->Print(Form("%s/%s/chip%d_detail_ampladc.pdf",folder_name.Data(),the_name.Data(),i4+1));} c6->cd(); check_new->Draw("hist"); check_new->Fit("gaus_fit_new","NQ"); c6->cd(); gaus_fit_new->Draw("lsame"); c6->cd(); tex11 -> DrawLatex (0.12, 0.750, Form("gaus width : %.4f", gaus_fit_new->GetParameter(2))); c6->cd(); tex11 -> DrawLatex (0.12, 0.720, Form("gaus size : %.2f", gaus_fit_new->GetParameter(0))); c6->cd(); tex11 -> DrawLatex (0.12, 0.690, Form("gaus mean : %.2f", gaus_fit_new->GetParameter(1))); response_width[i4].push_back(gaus_fit_new->GetParameter(2)); channel_entries_check->Fill(check_new->GetEntries()); if (check_new->GetEntries()<280 || check_new->GetEntries()>400) { //cout<<"Outsider entries, please check : "<GetEntries()<GetEntries()); channel_entries_outsider+=1; } if (new_check == true) {c6->cd(); c6->Print(Form("%s/%s/chip%d_detail_amploffset.pdf",folder_name.Data(),the_name.Data(),i4+1));} ampladc_detail->Reset("ICESM"); check_new->Reset("ICESM"); c1->Clear(); c6->Clear(); if (assembly_check == true && i4==25 && i2==127)cout<<" =========== pad performance check done ========="<cd(); c1->Print(Form("%s/%s/chip%d_detail_ampladc.pdf)",folder_name.Data(),the_name.Data(),i4+1));} if (new_check == true) {c6->cd(); c6->Print(Form("%s/%s/chip%d_detail_amploffset.pdf)",folder_name.Data(),the_name.Data(),i4+1));} } cout<<"==============information of ampladc_detail =========="<Clear(); c1->cd(); slope_TH2->Draw("COLZ0"); c1->Print(Form("%s/%s/ampl_adc_slope_TH2.pdf",folder_name.Data(),the_name.Data())); c1->Clear(); cout<<" TH2 plot "<Fit("gaus_fit","N"); c2->cd (); slop_detail_TH->Draw("hist"); TLatex *tex2 = new TLatex(); tex2 -> SetNDC (); tex2 -> SetTextFont (42); tex2 -> SetTextSize (0.032); tex2 -> DrawLatex (0.2, 0.840, Form("Gaus Mean : %.4f", gaus_fit->GetParameter(1))); tex2 -> DrawLatex (0.2, 0.80, Form("Gaus Sigma : %.4f", gaus_fit->GetParameter(2))); gaus_fit->Draw("lsame"); c2->Print(Form("%s/%s/slop_detail_TH.pdf",folder_name.Data(),the_name.Data())); c2->Clear(); cout<<"==============information of rest plots =========="< xaxis_plot; xaxis_plot.clear(); for (int i6=0; i6<128; i6++) xaxis_plot.push_back(i6); c1->Print(Form("%s/%s/ampl_adc_slope_detail.pdf(",folder_name.Data(),the_name.Data())); cout<<" the size of file : "<Clear(); c4->Divide(13,2); for (int i4=0; i4<26; i4++) { c4->cd(i4+1); grr[i4] = new TGraph (128,&xaxis_plot[0],&l_adc_slope[i4][0]); grr[i4]->GetYaxis()->SetRangeUser(0.04,0.15); grr[i4]->SetTitle(Form("S_chip_id=%d",i4+1)); grr[i4]->GetXaxis()->SetLimits(-5,135); grr[i4]->SetMarkerStyle(20); grr[i4]->SetMarkerColor(2); grr[i4]->SetMarkerSize(1.5); grr[i4]->Draw("al"); c1->cd (); grr[i4]->Draw("apl"); c1->Print(Form("%s/%s/ampl_adc_slope_detail.pdf",folder_name.Data(),the_name.Data())); //ampl_adc->Reset("ICESM"); } c4->Print(Form("%s/%s/ampl_adc_slope.pdf",folder_name.Data(),the_name.Data())); c4 ->Clear(); for (int i6=0; i6<26; i6++) delete grr[i6]; c1->Print(Form("%s/%s/ampl_adc_slope_detail.pdf)",folder_name.Data(),the_name.Data())); c1->Clear(); c6->Clear(); c6->Print(Form("%s/%s/ampl_adc_width_detial.pdf(",folder_name.Data(),the_name.Data())); TGraph * grr_new[26]; TH2F * width_TH2= new TH2F ("","",128,0,128,128,0.00,13); width_TH2->SetStats(0); for (int i9=0; i9<26; i9++) { grr_new[i9] = new TGraph (128,&xaxis_plot[0],&response_width[i9][0]); grr_new[i9]->GetYaxis()->SetRangeUser(0.00,13); grr_new[i9]->SetTitle(Form("S_chip_id=%d",i9+1)); grr_new[i9]->GetXaxis()->SetLimits(-5,135); grr_new[i9]->SetMarkerStyle(20); grr_new[i9]->SetMarkerColor(2); grr_new[i9]->SetMarkerSize(1.5); for (int i10=0; i10Fill(xaxis_plot[i10],response_width[i9][i10]); //cout<<"TESTTEST : "<Fill(); if (response_width[i9][i10]<4) { unbound_chip.push_back(i9+1); unbound_channel.push_back(i10); unbound_width.push_back(response_width[i9][i10]); } else if (response_width[i9][i10]>4) { noise_chip.push_back(i9+1); noise_channel.push_back(i10); noise_width.push_back(response_width[i9][i10]); } } } c6->cd(); grr_new[i9]->Draw("apl"); c6->Print(Form("%s/%s/ampl_adc_width_detial.pdf",folder_name.Data(),the_name.Data())); } c6->Print(Form("%s/%s/ampl_adc_width_detial.pdf)",folder_name.Data(),the_name.Data())); c6->Clear(); c6->cd(); width_TH2->Draw("COLZ0"); c6->Print(Form("%s/%s/ampl_adc_width_detial_TH2.pdf",folder_name.Data(),the_name.Data())); c6->Clear(); c1->Print(Form("%s/%s/ampl_adc_offset_detail.pdf(",folder_name.Data(),the_name.Data())); //TGraph * grr[26]; c4->Divide(13,2); for (int i4=0; i4<26; i4++) { c4->cd(i4+1); grr[i4] = new TGraph (128,&xaxis_plot[0],&l_adc_offset[i4][0]); grr[i4]->SetTitle(Form("O_chip_id=%d",i4+1)); grr[i4]->GetXaxis()->SetLimits(-5,135); grr[i4]->SetMarkerStyle(20); grr[i4]->SetMarkerColor(2); grr[i4]->SetMarkerSize(1.5); grr[i4]->Draw("al"); c1->cd (); grr[i4]->Draw("apl"); c1->Print(Form("%s/%s/ampl_adc_offset_detail.pdf",folder_name.Data(),the_name.Data())); //ampl_adc->Reset("ICESM"); } c4->Print(Form("%s/%s/ampl_adc_offset.pdf",folder_name.Data(),the_name.Data())); c4 ->Clear(); c1->Print(Form("%s/%s/ampl_adc_offset_detail.pdf)",folder_name.Data(),the_name.Data())); c1->Clear(); for (int i6=0; i6<26; i6++) delete grr[i6]; // c1->Print(Form("%s/%s/ampl_adc_ChiNDF_detail.pdf(",the_name.Data())); // TGraph * grr[26]; // c4->Divide(13,2); // for (int i4=0; i4<26; i4++) // { // c4->cd(i4+1); // grr[i4] = new TGraph (128,&xaxis_plot[0],&l_adc_chiNDF[i4][0]); // grr[i4]->SetTitle(Form("C_chip_id=%d",i4+1)); // grr[i4]->GetXaxis()->SetLimits(-5,135); // grr[i4]->SetMarkerStyle(20); // grr[i4]->SetMarkerColor(2); // grr[i4]->SetMarkerSize(1.5); // grr[i4]->Draw("al"); // c1->cd (); grr[i4]->Draw("apl"); // c1->Print(Form("%s/%s/ampl_adc_ChiNDF_detail.pdf",the_name.Data())); // //ampl_adc->Reset("ICESM"); // } // c4->Print(Form("%s/%s/ampl_adc_chiNDF.pdf",the_name.Data())); // c4 ->Clear(); // for (int i6=0; i6<26; i6++) delete grr[i6]; // cout<<"==============information of rest plots =========="<Clear(); // c1->Print(Form("%s/%s/ampl_adc_ChiNDF_detail.pdf)",the_name.Data())); // c1 ->Clear(); c4 ->Clear(); c1 ->Clear(); //fp.close();//Ãö³¬ÀÉ®× for(int i11=0; i11Fill(); } for(int i11=0; i11Fill(); } for(int i11=0; i11Fill(); } if(unbound_check==true) { cout<<"======unbound_check======"<cd(); channel_entries_check->Draw("hist"); c1->Print(Form("%s/%s/channel_entries.pdf",folder_name.Data(),the_name.Data())); c1 ->Clear(); cout<<"Number of channel entries outsider : "<Write("", TObject::kOverwrite); tree_output2 ->Write("", TObject::kOverwrite); tree_output3 ->Write("", TObject::kOverwrite); tree_output4 ->Write("", TObject::kOverwrite); // delete tree_output1; // delete tree_output2; //delete tree_output3; //delete file_output; file_output->Close(); cout<<"\r\n"<<"#the file rewriting is finish#"<<"\r\n"<