//------------------------------------------------------------------------// // P0DLI ADC analysis program // // Tomasz Wachala, Sep 2012 // //------------------------------------------------------------------------// #include #include #include #include #include #include #include #include #include #include #include #include "TROOT.h" #include "TGraph.h" #include "TStyle.h" #include "TH1F.h" #include "TH2F.h" #include "TCanvas.h" #include "TChain.h" #include "TFile.h" #include "TLegend.h" #include "TMultiGraph.h" int s2i( std::string s ) { std::stringstream istr(s); int i; istr >> i; return i; } int main(int argc, char* argv[]){ /*This is the ROOT's time format that will be used in the plots for date : %a abbreviated weekday name %b abbreviated month name %d day of the month (01-31) %m month (01-12) %y year without century for time : %H hour (24-hour clock) %I hour (12-hour clock) %p local equivalent of AM or PM %M minute (00-59) %S seconds (00-61) %% % */ //const string timeFormat("%d-%H%F1995-01-01 9:00:00"); std::string timeFormatHead("%d-%H"); std::string timeFormatApp("%F2000-01-01 00:00:00"); std::string timeFormat = timeFormatHead+timeFormatApp; /*Plot options for graphs Graphs can be drawn with the following options: "L" A simple polyline is drawn "F" A fill area is drawn ('CF' draw a smoothed fill area) "C" A smooth Curve is drawn "*" A Star is plotted at each point "P" The current marker is plotted at each point "B" A Bar chart is drawn "1" When a graph is drawn as a bar chart, this option makes the bars start from the bottom of the pad. By default they start at 0. "X+" The X-axis is drawn on the top side of the plot. "Y+" The Y-axis is drawn on the right side of the plot. */ const std::string plotFormat("LP"); gROOT->SetStyle("Plain"); gStyle->SetHistLineWidth(1); gStyle->SetPalette(1); gStyle->SetPaperSize(20,26); // Turn off some borders gStyle->SetCanvasBorderMode(0); gStyle->SetFrameBorderMode(0); gStyle->SetPadBorderMode(0); gStyle->SetDrawBorder(0); gStyle->SetCanvasBorderSize(0); gStyle->SetFrameBorderSize(0); gStyle->SetPadBorderSize(1); gStyle->SetTitleBorderSize(0); // Say it in black and white! gStyle->SetAxisColor(1, "xyz"); gStyle->SetCanvasColor(0); gStyle->SetFrameFillColor(0); gStyle->SetFrameLineColor(1); gStyle->SetHistFillColor(0); gStyle->SetHistLineColor(1); //gStyle->SetPadColor(1); gStyle->SetPadColor(kWhite); gStyle->SetStatColor(0); gStyle->SetStatTextColor(1); gStyle->SetTitleColor(1); gStyle->SetTitleTextColor(1); gStyle->SetLabelColor(1,"xyz"); gStyle->SetLabelOffset(0.02); // Show functions in red... gStyle->SetFuncColor(2); //------------------------------------------------------------------------------------- // Get command line arguments //------------------------------------------------------------------------------------- std::vector files; std::string outfile = "p0d-li-adc-analysis.root"; int ampCut = 0; int c; while ( (c = getopt(argc, argv, "a:o:")) != -1 ) { switch (c) { case 'a': ampCut = s2i(optarg); break; case 'o': outfile = optarg; break; } } while (optind -a file1.root file2.root ..." << std::endl; std::cout << " : a cut on the P0DLI amplitude setting" << std::endl; return -1; } //Load trees from the input files TChain *LITree = new TChain("LI"); for ( std::vector::iterator it = files.begin(); it != files.end(); it++ ) { LITree->Add( (*it).c_str() ); } //Print the tree content and number of entries... int n_entries = LITree->GetEntries(); //LITree->Print(); std::cout << "----> LI tree entries: " << n_entries << std::endl; if(n_entries == 0){ std::cout << "ERROR: LI tree has NO entries! Bailing..." << std::endl; exit(1); } //Tree Variables float fHighADCMean, fHighADCRMS, fLowADCMean, fLowADCRMS, fTDCMean, fTDCRMS, fTDCMaxBin; int fRMM,fTFB,fTripT,fChannel,fP0dule,fBar,fLayer,fPulser,fAmplitude,fFlashes,fRunId; double fTime; LITree->SetBranchAddress("RunNumber",&fRunId); LITree->SetBranchAddress("HighADCMean",&fHighADCMean); LITree->SetBranchAddress("HighADCRMS",&fHighADCRMS); LITree->SetBranchAddress("LowADCMean",&fLowADCMean); LITree->SetBranchAddress("LowADCRMS",&fLowADCRMS); LITree->SetBranchAddress("TDCMean",&fTDCMean); LITree->SetBranchAddress("TDCRMS",&fTDCRMS); LITree->SetBranchAddress("TDCMaxBin",&fTDCMaxBin); LITree->SetBranchAddress("RMM",&fRMM); LITree->SetBranchAddress("TFB",&fTFB); LITree->SetBranchAddress("TripT",&fTripT); LITree->SetBranchAddress("Channel",&fChannel); LITree->SetBranchAddress("P0dule",&fP0dule); LITree->SetBranchAddress("Bar",&fBar); LITree->SetBranchAddress("Layer",&fLayer); LITree->SetBranchAddress("Pulser",&fPulser); LITree->SetBranchAddress("Amplitude",&fAmplitude); LITree->SetBranchAddress("Flashes",&fFlashes); LITree->SetBranchAddress("Time",&fTime); /////////////////////////////////////////////////////////////////////////// ///////Get the number of data points in time/////////////////////////////// /////////////////////////////////////////////////////////////////////////// std::cout << "----> Creating the map time <--> point number... " << std::endl; //Map time<->point number (on graph) std::map Datapoint_Time; //Array of all times std::vector Time_Data; //Point number int counter = 0; //Get the number of data points in time for(int i = 0; i < n_entries; i++){ LITree->GetEntry(i); //Not sure why it's only for p0dule = 0, layer=0 and amplitude = 0 //It fails sometimes (eg. in run 17468) if(fP0dule == 0 && fBar == 0 && fLayer == 0 && fAmplitude == ampCut){ Datapoint_Time[static_cast(fTime)] = counter; Time_Data.push_back(fTime); std::cout << std::setprecision(15) << "Time = " << fTime << "<----->" << "Point = " << Datapoint_Time[static_cast(fTime)] << std::endl; counter++; } } std::cout << "<---- Done!" << std::endl; /////////////////////////////////////////////////////////////////////////// /////// Booking histograms /////////////////////////////// /////////////////////////////////////////////////////////////////////////// std::cout << "----> Booking histograms..." << std::endl; const int set_size = counter; char temptitle[50]; //Basic ADC histograms TH1F *RMMadc[6][set_size]; TH1F *TFBadc[6][48][set_size]; TH1F *Pulseradc[4][set_size]; TH1F *P0duleadc[40][2][set_size]; std::cout << "--> RMMs and TFBs..." << std::endl; for(int rmm = 0; rmm < 6; rmm++){ for(int tfb = 0; tfb < 48; tfb++){ for(int dp = 0; dp < set_size; dp++){ if(tfb == 0){ sprintf(temptitle,"RMM-%d-Datapoint-%d",rmm,dp); RMMadc[rmm][dp] = new TH1F(temptitle,temptitle,50,0,1024); } sprintf(temptitle,"RMM-%d-TFB-%d-Datapoint-%d",rmm,tfb,dp); TFBadc[rmm][tfb][dp] = new TH1F(temptitle,temptitle,50,0,1024); }//end of for(int dp.. }//end of for(int tfb... }//end of for(int rmm... std::cout << "<-- Done!" << std::endl; std::cout << "--> Pulsers..." << std::endl; for(int pulser = 0; pulser < 4; pulser++){ for(int datapoint = 0; datapoint < set_size; datapoint++){ sprintf(temptitle,"Pulser-%d-Datapoint-%d",pulser,datapoint); Pulseradc[pulser][datapoint] = new TH1F(temptitle,temptitle,50,0,1024); } } std::cout << "<-- Done!" << std::endl; std::cout << "--> P0Dules..." << std::endl; for(int p0dule=0;p0dule<40;p0dule++){ for(int layer=0;layer<2;layer++){ for(int datapoint=0;datapoint Looping over " << n_entries << " entries..." << std::endl; for(int i = 0; i < n_entries; i++){ LITree->GetEntry(i); if((i) % (n_entries / 10) == 0) std::cout << "--> Entries processed: " << i << "(" << (100*i)/n_entries << " %) " << std::endl; if(fAmplitude == ampCut && fLowADCMean != 0){ if(Datapoint_Time.find(static_cast(fTime)) == Datapoint_Time.end()){ std::cout << "# ERROR: Time=" << fTime << " is not mapped!" << std::endl; continue; } RMMadc[fRMM][Datapoint_Time[static_cast(fTime)]]->Fill(fLowADCMean); TFBadc[fRMM][fTFB][Datapoint_Time[static_cast(fTime)]]->Fill(fLowADCMean); Pulseradc[fPulser-1][Datapoint_Time[static_cast(fTime)]]->Fill(fLowADCMean); P0duleadc[fP0dule][fLayer][Datapoint_Time[static_cast(fTime)]]->Fill(fLowADCMean); } } std::cout << "<---- Done! " << std::endl; /////////////////////////////////////////////////////////////////////////// /////// Declare graphs and fill them /////////////////////////////// /////////////////////////////////////////////////////////////////////////// std::cout << "----> Graph filling..." << std::endl; TLegend *RMMLeg = new TLegend(0.8,0.8,0.99,0.99); TLegend *TFBLeg[6]; TLegend *PulserLeg= new TLegend(0.8,0.8,0.99,0.99); TLegend *P0duleLeg[2]; TLegend *PulserDiffLeg = new TLegend(0.8,0.8,0.99,0.99); TGraph *RMMadc_graph[6]; TGraph *TFBadc_graph[6][48]; TGraph *Pulseradc_graph[4]; TGraph *P0duleadc_graph[40][2]; TH1F *pulseradcDiff[3]; for(int box=0;box<3;box++){ sprintf(temptitle,"Pulser%d-Pulser1_Amplitude%d",box+2,ampCut); pulseradcDiff[box] = new TH1F(temptitle,temptitle,600,-75,75); pulseradcDiff[box]->SetLineColor(box*10+40); pulseradcDiff[box]->SetLineWidth(2); PulserDiffLeg->AddEntry(pulseradcDiff[box],""); } std::cout << "----> Filling RMMADC graphs..." << std::endl; for(int rmm=0;rmm<6;rmm++){ TFBLeg[rmm] = new TLegend(0.9,0.5,0.99,0.99); for(int tfb=0;tfb<48;tfb++){ int counter2=0; if(tfb==0){ RMMadc_graph[rmm] = new TGraph(); RMMadc_graph[rmm]->SetMarkerStyle(7); RMMadc_graph[rmm]->SetMarkerColor(rmm*5+40); RMMadc_graph[rmm]->SetLineColor(rmm*5+40); //RMMadc_graph[rmm]->SetMinimum(660); //RMMadc_graph[rmm]->SetMaximum(700); sprintf(temptitle,"RMM-%d",rmm); RMMLeg->AddEntry(RMMadc_graph[rmm],temptitle,"P"); for(unsigned int j=0;j 2) std::cout << std::setprecision(15) << rmm << " " << j << " " << counter2 << " " << j-counter2 << " " << Time_Data[j] << " " << RMMadc[rmm][j]->GetMean() << std::endl; */ if(RMMadc[rmm][j]->GetMean()!=0){ RMMadc_graph[rmm]->SetPoint(j-counter2,Time_Data[j],RMMadc[rmm][j]->GetMean()); } else{ counter2++; } } sprintf(temptitle,"RMM%d_Amplitude%d",rmm,ampCut); RMMadc_graph[rmm]->SetTitle(temptitle); } /* double meanSum = 0; for(int i = 0; i < Time_Data.size(); i++) meanSum+=TFBadc[rmm][tfb][0]->GetMean(); if(meanSum == 0) continue; */ if(TFBadc[rmm][tfb][0]->GetMean()==0) continue; TFBadc_graph[rmm][tfb] = new TGraph(); TFBadc_graph[rmm][tfb]->SetMarkerStyle(7); TFBadc_graph[rmm][tfb]->SetMarkerColor(tfb+50); //TFBadc_graph[rmm][tfb]->SetLineColor(kBlack); //TFBadc_graph[rmm][tfb]->SetMinimum(650); //TFBadc_graph[rmm][tfb]->SetMaximum(700); sprintf(temptitle,"TFB-%d",tfb); TFBLeg[rmm]->AddEntry(TFBadc_graph[rmm][tfb],temptitle,"P"); int counter=0; for(unsigned int k=0;kGetMean()!=0){ TFBadc_graph[rmm][tfb]->SetPoint(k-counter,Time_Data[k],TFBadc[rmm][tfb][k]->GetMean()); } else{ counter++; } } } } counter=0; for(int pulser=0;pulser<4;pulser++){ Pulseradc_graph[pulser] = new TGraph(); Pulseradc_graph[pulser]->SetMarkerStyle(7); Pulseradc_graph[pulser]->SetMarkerColor(pulser*5+50); //Pulseradc_graph[pulser]->SetLineColor(kBlack); Pulseradc_graph[pulser]->SetLineColor(pulser*5+50); sprintf(temptitle,"Pulser-%d",pulser+1); PulserLeg->AddEntry(Pulseradc_graph[pulser],temptitle,"P"); int counter=0; for(unsigned int k=0;kGetMean()!=0){ Pulseradc_graph[pulser]->SetPoint(k-counter,Time_Data[k],Pulseradc[pulser][k]->GetMean()); } else{ counter++; } if(Pulseradc[pulser][k]->GetMean() != 0 && pulser != 0 && Pulseradc[0][k]->GetMean() != 0){ pulseradcDiff[pulser-1]->Fill(Pulseradc[pulser][k]->GetMean()-Pulseradc[0][k]->GetMean()); } } } P0duleLeg[0] = new TLegend(0.8,0.8,0.99,0.99); P0duleLeg[1] = new TLegend(0.8,0.8,0.99,0.99); for(int p0dule=0;p0dule<40;p0dule++){ for(int layer=0;layer<2;layer++){ int counter=0; P0duleadc_graph[p0dule][layer] = new TGraph(); P0duleadc_graph[p0dule][layer]->SetMarkerStyle(7); P0duleadc_graph[p0dule][layer]->SetMarkerColor(p0dule+50); //P0duleadc_graph[p0dule][layer]->SetLineColor(kBlack); sprintf(temptitle,"P0dule-%d-Layer-%d",p0dule,layer); P0duleLeg[layer]->AddEntry(P0duleadc_graph[p0dule][layer],temptitle,"P"); for(unsigned int k=0;kGetMean()!=0){ P0duleadc_graph[p0dule][layer]->SetPoint(k-counter,Time_Data[k],P0duleadc[p0dule][layer][k]->GetMean()); } else{ counter++; } } } } TMultiGraph *allRMMadc = new TMultiGraph(Form("RMM_MeanADC_Amplitude%d",ampCut),Form("RMM_MeanADC_Amplitude%d",ampCut)); TMultiGraph *allTFBadc[6]; TMultiGraph *allPulseradc = new TMultiGraph(Form("Pulser_MeanADC_Amplitude%d",ampCut),Form("Pulser_MeanADC_Amplitude%d",ampCut)); TMultiGraph *allP0dule[4][2]; for(int rmm=0;rmm<6;rmm++){ sprintf(temptitle,"TFB_MeanADC_RMM%d_Amplitude%d",rmm,ampCut); allTFBadc[rmm] = new TMultiGraph(temptitle,temptitle); //allRMMadc->Add(RMMadc_graph[rmm],"P"); allRMMadc->Add(RMMadc_graph[rmm],plotFormat.c_str()); for(int tfb=0;tfb<48;tfb++){ if(TFBadc[rmm][tfb][0]->GetMean()==0) continue; //allTFBadc[rmm]->Add(TFBadc_graph[rmm][tfb],plotFormat.c_str()); allTFBadc[rmm]->Add(TFBadc_graph[rmm][tfb],"P"); } } for(int layer=0;layer<2;layer++){ for(int i=0;i<4;i++){ sprintf(temptitle,"Layer%d_SuperP0Dule%d_Amplitude%d",layer,i,ampCut); allP0dule[i][layer]=new TMultiGraph(temptitle,temptitle); } for(int p0dule=0;p0dule<40;p0dule++){ if(p0dule>=0 && p0dule<7){ allP0dule[0][layer]->Add(P0duleadc_graph[p0dule][layer],"P"); } else if(p0dule>=7&&p0dule<20){ allP0dule[1][layer]->Add(P0duleadc_graph[p0dule][layer],"P"); } else if(p0dule>=20&&p0dule<31){ allP0dule[2][layer]->Add(P0duleadc_graph[p0dule][layer],"P"); } else if(p0dule>=31){ allP0dule[3][layer]->Add(P0duleadc_graph[p0dule][layer],"P"); } } } for(int pulser=0;pulser<4;pulser++){ allPulseradc->Add(Pulseradc_graph[pulser],plotFormat.c_str()); } std::cout << "<---- Done!" << std::endl; /////////////////////////////////////////////////////////////// // Plotting /////////////////////////////////////////////////////////////// std::cout << "----> Plotting..." << std::endl; //gROOT->SetStyle("Plain"); TFile out( outfile.c_str(),"RECREATE"); TCanvas *c0 = new TCanvas("MeanADC_AllRMM","MeanADC_AllRMM",10,10,1000,700); //allRMMadc->Draw("AP"); allRMMadc->Draw("ALP"); allRMMadc->GetXaxis()->SetTimeDisplay(1); allRMMadc->GetXaxis()->SetTimeFormat(timeFormat.c_str()); allRMMadc->SetMinimum(0); allRMMadc->SetMaximum(1024); allRMMadc->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); allRMMadc->GetYaxis()->SetTitle("Mean ADC"); RMMLeg->Draw("SAME"); /* if(savePlots){ c0->Print((outputDirName+"/MeanADC_AllRMM.eps").c_str()); c0->Print((outputDirName+"/MeanADC_AllRMM.png").c_str()); c0->Print((outputDirName+"/MeanADC_AllRMM.C").c_str()); } */ c0->Write(); TCanvas *c1 = new TCanvas("RMMADC","RMMADC",10,10,1000,700); c1->Divide(3,2); for(int i=0;i<6;i++){ c1->cd(i+1); //RMMadc_graph[i]->Draw("AP"); RMMadc_graph[i]->Draw((std::string("A")+plotFormat).c_str()); RMMadc_graph[i]->GetXaxis()->SetTimeDisplay(1); RMMadc_graph[i]->GetXaxis()->SetTimeFormat(timeFormat.c_str()); RMMadc_graph[i]->SetMinimum(0); RMMadc_graph[i]->SetMaximum(1024); RMMadc_graph[i]->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); RMMadc_graph[i]->GetYaxis()->SetTitle("Mean ADC"); RMMLeg->Draw("SAME"); } /* if(savePlots){ c1->Print((outputDirName+"/RMMADC.eps").c_str()); c1->Print((outputDirName+"/RMMADC.png").c_str()); c1->Print((outputDirName+"/RMMADC.C").c_str()); } */ c1->Write(); TCanvas *c2 = new TCanvas("AllTFB","AllTFB",10,10,1000,700); c2->Divide(3,2); for(int i=0;i<6;i++){ c2->cd(i+1); //allTFBadc[i]->Draw("AP"); allTFBadc[i]->Draw("ALP"); allTFBadc[i]->GetXaxis()->SetTimeDisplay(1); allTFBadc[i]->GetXaxis()->SetTimeFormat(timeFormat.c_str()); allTFBadc[i]->SetMinimum(0); allTFBadc[i]->SetMaximum(1024); allTFBadc[i]->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); allTFBadc[i]->GetYaxis()->SetTitle("Mean ADC"); TFBLeg[i]->Draw("SAME"); } /* if(savePlots){ c2->Print((outputDirName+"/AllTFB.eps").c_str()); c2->Print((outputDirName+"/AllTFB.png").c_str()); c2->Print((outputDirName+"/AllTFB.C").c_str()); } */ c2->Write(); TCanvas *c3 = new TCanvas("AllPulser","AllPulser",10,10,1000,700); //allPulseradc->Draw("AP"); allPulseradc->Draw("ALP"); allPulseradc->GetXaxis()->SetTimeDisplay(1); allPulseradc->GetXaxis()->SetTimeFormat(timeFormat.c_str()); allPulseradc->SetMinimum(0); allPulseradc->SetMaximum(1024); allPulseradc->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); allPulseradc->GetYaxis()->SetTitle("Mean ADC"); PulserLeg->Draw("SAME"); /* if(savePlots){ c3->Print((outputDirName+"/AllPulser.eps").c_str()); c3->Print((outputDirName+"/AllPulser.png").c_str()); c3->Print((outputDirName+"/AllPulser.C").c_str()); } */ c3->Write(); TCanvas *c5 = new TCanvas("Layer0","Layer0",10,10,1000,700); c5->Divide(2,2); for(int i=0;i<4;i++){ c5->cd(i+1); allP0dule[i][0]->SetMinimum(0); allP0dule[i][0]->SetMaximum(1024); allP0dule[i][0]->Draw("AP"); //allP0dule[i][0]->Draw("ALP"); allP0dule[i][0]->GetXaxis()->SetTimeDisplay(1); allP0dule[i][0]->GetXaxis()->SetTimeFormat(timeFormat.c_str()); allP0dule[i][0]->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); allP0dule[i][0]->GetYaxis()->SetTitle("Mean ADC"); P0duleLeg[0]->Draw("SAME"); } /* if(savePlots){ c5->Print((outputDirName+"/AllP0Dule_Layer0.eps").c_str()); c5->Print((outputDirName+"/AllP0Dule_Layer0.png").c_str()); c5->Print((outputDirName+"/AllP0Dule_Layer0.C").c_str()); } */ c5->Write(); TCanvas *c6 = new TCanvas("Layer1","Layer1",10,10,1000,700); c6->Divide(2,2); for(int i=0;i<4;i++){ c6->cd(i+1); allP0dule[i][1]->SetMinimum(0); allP0dule[i][1]->SetMaximum(1024); allP0dule[i][1]->Draw("AP"); //allP0dule[i][1]->Draw("ALP"); allP0dule[i][1]->GetXaxis()->SetTimeDisplay(1); allP0dule[i][1]->GetXaxis()->SetTimeFormat(timeFormat.c_str()); allP0dule[i][1]->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); allP0dule[i][1]->GetYaxis()->SetTitle("Mean ADC"); P0duleLeg[1]->Draw("SAME"); } /* if(savePlots){ c6->Print((outputDirName+"/AllP0Dule_Layer1.eps").c_str()); c6->Print((outputDirName+"/AllP0Dule_Layer1.png").c_str()); c6->Print((outputDirName+"/AllP0Dule_Layer1.C").c_str()); } */ c6->Write(); TCanvas *c7 = new TCanvas("PulserDiff","PulserDiff",10,10,1000,700); pulseradcDiff[0]->Draw(); //pulseradcDiff[0]->GetXaxis()->SetTimeDisplay(1); //pulseradcDiff[0]->GetXaxis()->SetTimeFormat(timeFormat.c_str()); //pulseradcDiff[0]->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); pulseradcDiff[0]->GetXaxis()->SetTitle("#Delta ADC"); pulseradcDiff[1]->Draw("SAME"); //pulseradcDiff[1]->GetXaxis()->SetTimeDisplay(1); //pulseradcDiff[1]->GetXaxis()->SetTimeFormat(timeFormat.c_str()); //pulseradcDiff[1]->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); pulseradcDiff[1]->GetXaxis()->SetTitle("#Delta ADC"); pulseradcDiff[2]->Draw("SAME"); //pulseradcDiff[2]->GetXaxis()->SetTimeDisplay(1); //pulseradcDiff[2]->GetXaxis()->SetTimeFormat(timeFormat.c_str()); //pulseradcDiff[2]->GetXaxis()->SetTitle(Form("Time (%s)",timeFormatHead.c_str())); pulseradcDiff[2]->GetXaxis()->SetTitle("#Delta ADC"); PulserDiffLeg->Draw("SAME"); /* if(savePlots){ c7->Print((outputDirName+"/PulserDiff.eps").c_str()); c7->Print((outputDirName+"/PulserDiff.png").c_str()); c7->Print((outputDirName+"/PulserDiff.C").c_str()); } */ c7->Write(); /* TCanvas *c8 = new TCanvas("MeanHighGainADC","MeanHighGainADC",10,10,1000,700); c8->Divide(2,3); c8->cd(1); LITree->Draw("HighADCMean",Form("RMM==0 && Amplitude==%d",ampCut)); c8->cd(2); LITree->Draw("HighADCMean",Form("RMM==1 && Amplitude==%d",ampCut)); c8->cd(3); LITree->Draw("HighADCMean",Form("RMM==2 && Amplitude==%d",ampCut)); c8->cd(4); LITree->Draw("HighADCMean",Form("RMM==3 && Amplitude==%d",ampCut)); c8->cd(5); LITree->Draw("HighADCMean",Form("RMM==4 && Amplitude==%d",ampCut)); c8->cd(6); LITree->Draw("HighADCMean",Form("RMM==5 && Amplitude==%d",ampCut)); c8->Write(); TCanvas *c9 = new TCanvas("MeanLowGainADC","MeanLowGainADC",10,10,1000,700); c9->Divide(2,3); c9->cd(1); LITree->Draw("LowADCMean",Form("RMM==0 && Amplitude==%d",ampCut)); c9->cd(2); LITree->Draw("LowADCMean",Form("RMM==1 && Amplitude==%d",ampCut)); c9->cd(3); LITree->Draw("LowADCMean",Form("RMM==2 && Amplitude==%d",ampCut)); c9->cd(4); LITree->Draw("LowADCMean",Form("RMM==3 && Amplitude==%d",ampCut)); c9->cd(5); LITree->Draw("LowADCMean",Form("RMM==4 && Amplitude==%d",ampCut)); c9->cd(6); LITree->Draw("LowADCMean",Form("RMM==5 && Amplitude==%d",ampCut)); c9->Write(); TCanvas *c10 = new TCanvas("MeanHighGainADCRMS","MeanHighGainADCRMS",10,10,1000,700); c10->Divide(2,3); c10->cd(1); LITree->Draw("HighADCRMS",Form("RMM==0 && Amplitude==%d",ampCut)); c10->cd(2); LITree->Draw("HighADCRMS",Form("RMM==1 && Amplitude==%d",ampCut)); c10->cd(3); LITree->Draw("HighADCRMS",Form("RMM==2 && Amplitude==%d",ampCut)); c10->cd(4); LITree->Draw("HighADCRMS",Form("RMM==3 && Amplitude==%d",ampCut)); c10->cd(5); LITree->Draw("HighADCRMS",Form("RMM==4 && Amplitude==%d",ampCut)); c10->cd(6); LITree->Draw("HighADCRMS",Form("RMM==5 && Amplitude==%d",ampCut)); c10->Write(); TCanvas *c11 = new TCanvas("MeanLowGainADCRMS","MeanLowGainADCRMS",10,10,1000,700); c11->Divide(2,3); c11->cd(1); LITree->Draw("LowADCRMS",Form("RMM==0 && Amplitude==%d",ampCut)); c11->cd(2); LITree->Draw("LowADCRMS",Form("RMM==1 && Amplitude==%d",ampCut)); c11->cd(3); LITree->Draw("LowADCRMS",Form("RMM==2 && Amplitude==%d",ampCut)); c11->cd(4); LITree->Draw("LowADCRMS",Form("RMM==3 && Amplitude==%d",ampCut)); c11->cd(5); LITree->Draw("LowADCRMS",Form("RMM==4 && Amplitude==%d",ampCut)); c11->cd(6); LITree->Draw("LowADCRMS",Form("RMM==5 && Amplitude==%d",ampCut)); c11->Write(); */ out.Close(); std::cout << "<---- Done!" << std::endl; ////////////////////// }