Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-08 08:36:28

0001 // A C++ script to read data from a CSV file and plot multiple files on the same graph
0002 // using the ROOT framework.
0003 
0004 #include <iostream>
0005 #include <fstream>
0006 #include <string>
0007 #include <vector>
0008 
0009 // Include necessary ROOT headers
0010 #include "TGraph.h"
0011 #include "TMultiGraph.h"
0012 #include "TCanvas.h"
0013 #include "TFile.h"
0014 #include "TAxis.h"
0015 #include "TLegend.h"
0016 #include "TLatex.h"
0017 
0018 //=================================================================================
0019 // The main function to execute the plotting.
0020 //=================================================================================
0021 void plotDataSiPMIrrad( TString rootFileName = "") {
0022 
0023     // Create a TMultiGraph to hold all the individual graphs.
0024     TMultiGraph* mg1mm      = new TMultiGraph();
0025     TMultiGraph* mg1mmVoV   = new TMultiGraph();
0026     TMultiGraph* mg1mmVPeak = new TMultiGraph();
0027     TMultiGraph* mg3mm      = new TMultiGraph();
0028     TMultiGraph* mg3mmVoV   = new TMultiGraph();
0029     TMultiGraph* mg3mmVPeak = new TMultiGraph();
0030     TMultiGraph* mg1mmNP[7];
0031     TMultiGraph* mg1mmNPVoV[7];
0032     TMultiGraph* mg3mmNP[7];
0033     TMultiGraph* mg3mmNPVoV[7];
0034     for (Int_t k = 0; k < 7; k++){
0035         mg1mmNP[k]    = new TMultiGraph();
0036         mg1mmNPVoV[k] = new TMultiGraph();
0037         mg3mmNP[k]    = new TMultiGraph();
0038         mg3mmNPVoV[k] = new TMultiGraph();
0039     }
0040     TMultiGraph* mg1mmSiPM[4];
0041     TMultiGraph* mg1mmSiPMVoV[4];
0042     TMultiGraph* mg3mmSiPM[4];
0043     TMultiGraph* mg3mmSiPMVoV[4];
0044     for (Int_t k = 0; k < 4; k++){
0045         mg1mmSiPM[k]    = new TMultiGraph();
0046         mg1mmSiPMVoV[k] = new TMultiGraph();
0047         mg3mmSiPM[k]    = new TMultiGraph();
0048         mg3mmSiPMVoV[k] = new TMultiGraph();
0049     }
0050 
0051     // Define an array of colors and markers to use for the plots.
0052     int colors[] = {kRed+1, kBlue+1, kGreen + 2, kCyan+2}; //, kOrange, kMagenta
0053     int markers[] = {kFullCircle, kFullSquare, 33, 28, 34, 24, 25, 27, 42, 46, 43, 47, 29, 30};
0054     
0055     Int_t l[4] = {-1, -1, -1, -1};
0056     TString labelsNP[7] =  {"10^{0}", "10^{8}", "10^{9}", "10^{10}", "10^{11}", "10^{12}", "10^{13}"}; 
0057     TString outNP[7] =  {"10_0", "10_8", "10_9", "10_10", "10_11", "10_12", "10_13"}; 
0058     
0059     TString labelsSiPM[4] =  {"A", "B", "C", "D"}; 
0060     Double_t textSizeRel = 0.035;
0061   
0062     // Create a legend to identify the different plots.
0063     TLegend* legend1mm = GetAndSetLegend2( 0.13, 0.74, 0.44, 0.96,textSizeRel*0.85, 3, "#bf{S14160-1315}", 42,0.2);
0064     TLegend* legend3mm = GetAndSetLegend2( 0.13, 0.74, 0.44, 0.96,textSizeRel*0.85, 3, "#bf{S14160-3015}", 42,0.2);
0065       
0066     TLegend* legend1mmSiPM[4];
0067     TLegend* legend3mmSiPM[4];
0068     for (Int_t s = 0; s < 4; s++){
0069         legend1mmSiPM[s] = GetAndSetLegend2( 0.13, 0.75, 0.34, 0.90,textSizeRel*0.85, 2, "", 42,0.2);
0070         legend3mmSiPM[s] = GetAndSetLegend2( 0.13, 0.75, 0.34, 0.90,textSizeRel*0.85, 2, "", 42,0.2);
0071     }
0072     
0073     TFile* inputRootFile = new TFile(rootFileName.Data());
0074     // Loop through the list of filenames, create a graph for each, and add it to the TMultiGraph.
0075     for (Int_t s = 0; s < 4; s++){
0076       for (Int_t r = 0; r< 7; r++){
0077         TGraph* graph = (TGraph*)inputRootFile->Get(Form("S14160-1315/%s_%s",labelsSiPM[s].Data(), outNP[r].Data()));
0078         if (graph){
0079           SetMarkerDefaultsTGraph(graph, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0080           mg1mm->Add(graph);
0081           legend1mm->AddEntry(graph, Form("%s %s", labelsSiPM[s].Data(), labelsNP[r].Data() ), "p");
0082           
0083           TGraph* graph2 = (TGraph*)graph->Clone(Form("S14160-1315/%s_%s_2",labelsSiPM[s].Data(), outNP[r].Data()));
0084           SetMarkerDefaultsTGraph(graph2, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0085           mg1mmNP[r]->Add(graph2);
0086           
0087           TGraph* graph3 = (TGraph*)graph->Clone(Form("S14160-1315/%s_%s_3",labelsSiPM[s].Data(), outNP[r].Data()));
0088           SetMarkerDefaultsTGraph(graph3, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0089           legend1mmSiPM[s]->AddEntry(graph, labelsNP[r].Data(), "p");
0090           mg1mmSiPM[s]->Add(graph3);
0091         }
0092         TGraph* graphPeak1mm = (TGraph*)inputRootFile->Get(Form("S14160-1315/%s_%s_Log_Derivative",labelsSiPM[s].Data(), outNP[r].Data()));
0093         if (graphPeak1mm){
0094           SetMarkerDefaultsTGraph(graphPeak1mm, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0095           mg1mmVPeak->Add(graphPeak1mm);
0096         }
0097         TGraph* graphVoV = (TGraph*)inputRootFile->Get(Form("S14160-1315/%s_%s_VoV",labelsSiPM[s].Data(), outNP[r].Data()));
0098         if (graphVoV){
0099           SetMarkerDefaultsTGraph(graphVoV, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0100           mg1mmVoV->Add(graphVoV);
0101           
0102           TGraph* graph2VoV = (TGraph*)graphVoV->Clone(Form("S14160-1315/%s_%s_VoV_2",labelsSiPM[s].Data(), outNP[r].Data()));
0103           SetMarkerDefaultsTGraph(graph2VoV, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0104           mg1mmNPVoV[r]->Add(graph2VoV);
0105           
0106           TGraph* graph3VoV = (TGraph*)graphVoV->Clone(Form("S14160-1315/%s_%s_VoV_3",labelsSiPM[s].Data(), outNP[r].Data()));
0107           SetMarkerDefaultsTGraph(graph3VoV, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0108           mg1mmSiPMVoV[s]->Add(graph3VoV);
0109         }
0110         
0111         TGraph* graph3mm = (TGraph*)inputRootFile->Get(Form("S14160-3015/%s_%s",labelsSiPM[s].Data(), outNP[r].Data()));
0112         if (graph3mm){
0113           SetMarkerDefaultsTGraph(graph3mm, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0114           mg3mm->Add(graph3mm);
0115           legend3mm->AddEntry(graph3mm, Form("%s %s", labelsSiPM[s].Data(), labelsNP[r].Data() ), "p");
0116           
0117           TGraph* graph3mm2 = (TGraph*)graph3mm->Clone(Form("S14160-3015/%s_%s_2",labelsSiPM[s].Data(), outNP[r].Data()));
0118           SetMarkerDefaultsTGraph(graph3mm2, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0119           mg3mmNP[r]->Add(graph3mm2);
0120           
0121           TGraph* graph3mm3 = (TGraph*)graph3mm->Clone(Form("S14160-3015/%s_%s_3",labelsSiPM[s].Data(), outNP[r].Data()));
0122           SetMarkerDefaultsTGraph(graph3mm3, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0123           legend3mmSiPM[s]->AddEntry(graph3mm, labelsNP[r].Data(), "p");
0124           mg3mmSiPM[s]->Add(graph3mm3);
0125         }
0126         TGraph* graphPeak3mm = (TGraph*)inputRootFile->Get(Form("S14160-3015/%s_%s_Log_Derivative",labelsSiPM[s].Data(), outNP[r].Data()));
0127         if (graphPeak3mm){
0128           SetMarkerDefaultsTGraph(graphPeak3mm, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0129           mg3mmVPeak->Add(graphPeak3mm);
0130         }
0131         TGraph* graph3mmVoV = (TGraph*)inputRootFile->Get(Form("S14160-3015/%s_%s_VoV",labelsSiPM[s].Data(), outNP[r].Data()));
0132         if (graph3mmVoV){
0133           SetMarkerDefaultsTGraph(graph3mmVoV, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0134           mg3mmVoV->Add(graph3mmVoV);
0135           
0136           TGraph* graph3mmVoV2 = (TGraph*)graph3mmVoV->Clone(Form("S14160-3015/%s_%s_VoV_2",labelsSiPM[s].Data(), outNP[r].Data()));
0137           SetMarkerDefaultsTGraph(graph3mmVoV2, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0138           mg3mmNPVoV[r]->Add(graph3mmVoV2);
0139           
0140           TGraph* graph3mmVoV3 = (TGraph*)graph3mmVoV->Clone(Form("S14160-3015/%s_%s_VoV_3",labelsSiPM[s].Data(), outNP[r].Data()));
0141           SetMarkerDefaultsTGraph(graph3mmVoV3, markers[r], 1, colors[s], colors[s], 1, 1, kFALSE, 0, kFALSE);
0142           mg3mmSiPMVoV[s]->Add(graph3mmVoV3);
0143         } 
0144       }
0145     }
0146     
0147     //*************************************************
0148     // Combined plot for all S14160-1315
0149     //*************************************************
0150     TCanvas* canvas = new TCanvas("canvas", "", 800, 600);
0151     DefaultCancasSettings(canvas, 0.075, 0.01, 0.01, 0.075);
0152     canvas->SetLogy();
0153       // Set multigraph properties (e.g., title, axis labels).
0154       SetStyleMultiGraph( mg1mm, "#it{V}_{op} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0155       // Draw the TMultiGraph.
0156       mg1mm->Draw("APL");
0157       // Draw the legend.
0158       legend1mm->Draw();
0159     canvas->Update();
0160     canvas->SaveAs("figsIrrad/S14160_1315_combined_plot.pdf");
0161     canvas->SetLogy();
0162       // Set multigraph properties (e.g., title, axis labels).
0163       SetStyleMultiGraph( mg1mmVoV, "#it{V}_{ov} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0164       // Draw the TMultiGraph.
0165       mg1mmVoV->Draw("APL");
0166       // Draw the legend.
0167       legend1mm->Draw();
0168     canvas->Update();
0169     canvas->SaveAs("figsIrrad/S14160_1315_combined_plot_VoV.pdf");
0170     canvas->SetLogy(kFALSE);
0171       mg1mmVPeak->GetYaxis()->SetRangeUser(0,10);
0172       // Set multigraph properties (e.g., title, axis labels).
0173       SetStyleMultiGraph( mg1mmVPeak, "#it{V}_{op} (V)", "d(ln(#it{I}_{D})/dV", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0174       // Draw the TMultiGraph.
0175       mg1mmVPeak->Draw("APL");
0176       // Draw the legend.
0177       legend1mm->Draw();
0178     canvas->Update();
0179     canvas->SaveAs("figsIrrad/S14160_1315_combined_plot_Derivative.pdf");
0180 
0181     //*************************************************
0182     // Combined plot for all S14160-1315
0183     //*************************************************
0184    canvas->SetLogy();
0185       SetStyleMultiGraph( mg3mm, "#it{V}_{op} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0186       // Draw the TMultiGraph.
0187       mg3mm->Draw("APL");
0188       // Draw the legend.
0189       legend3mm->Draw();
0190     canvas->Update();
0191     canvas->SaveAs("figsIrrad/S14160_3015_combined_plot.pdf");
0192     canvas->SetLogy();
0193       SetStyleMultiGraph( mg3mmVoV, "#it{V}_{ov} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0194       // Draw the TMultiGraph.
0195       mg3mmVoV->Draw("APL");
0196       // Draw the legend.
0197       legend3mm->Draw();
0198     canvas->Update();
0199     canvas->SaveAs("figsIrrad/S14160_3015_combined_plot_VoV.pdf");
0200     canvas->SetLogy(kFALSE);  
0201       // Set multigraph properties (e.g., title, axis labels).
0202       mg3mmVPeak->GetYaxis()->SetRangeUser(0,10);
0203       SetStyleMultiGraph( mg3mmVPeak, "#it{V}_{op} (V)", "d(ln(#it{I}_{D})/dV", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0204       // Draw the TMultiGraph.
0205       mg3mmVPeak->Draw("APL");
0206       // Draw the legend.
0207       legend3mm->Draw();
0208     canvas->Update();
0209     canvas->SaveAs("figsIrrad/S14160_3015_combined_plot_Derivative.pdf");
0210 
0211     //*************************************************
0212     // Combined plot per radiation dose
0213     //*************************************************
0214     TCanvas* canvas2 = new TCanvas("canvas2", "", 800, 600);
0215     DefaultCancasSettings(canvas2, 0.075, 0.01, 0.01, 0.075);
0216     canvas2->SetLogy();
0217     
0218     for (Int_t k = 0; k < 7; k++){
0219         canvas2->cd();
0220         std::cout << "k\t" << k << std::endl;
0221         if (mg1mmNP[k]->GetListOfGraphs()){
0222           SetStyleMultiGraph( mg1mmNP[k], "#it{V}_{op} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0223           mg1mmNP[k]->Draw("APL");
0224           DrawLatex(0.13, 0.92, Form("S14160-1315 %s  N_{p^{+}}",labelsNP[k].Data()), false, 0.044, 42);
0225           canvas2->Update();
0226           canvas2->SaveAs(Form("figsIrrad/S14160_1315_plot_%s.pdf",outNP[k].Data()));
0227         }
0228         if (mg1mmNPVoV[k]->GetListOfGraphs()){
0229           SetStyleMultiGraph( mg1mmNPVoV[k], "#it{V}_{ov} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0230           mg1mmNPVoV[k]->Draw("APL");
0231           DrawLatex(0.13, 0.92, Form("S14160-1315 %s  N_{p^{+}}",labelsNP[k].Data()), false, 0.044, 42);
0232           canvas2->Update();
0233           canvas2->SaveAs(Form("figsIrrad/S14160_1315_plot_%s_VoV.pdf",outNP[k].Data()));
0234         }
0235         if (mg3mmNP[k]->GetListOfGraphs()){
0236           SetStyleMultiGraph( mg3mmNP[k], "#it{V}_{op} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0237           mg3mmNP[k]->Draw("APL");
0238           DrawLatex(0.13, 0.92, Form("S14160-3015 %s  N_{p^{+}}",labelsNP[k].Data()), false, 0.044, 42);
0239           canvas2->Update();
0240           canvas2->SaveAs(Form("figsIrrad/S14160_3015_plot_%s.pdf",outNP[k].Data()));        
0241         }
0242         if (mg3mmNPVoV[k]->GetListOfGraphs()){
0243           SetStyleMultiGraph( mg3mmNPVoV[k], "#it{V}_{ov} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0244           mg3mmNPVoV[k]->Draw("APL");
0245           DrawLatex(0.13, 0.92, Form("S14160-3015 %s  N_{p^{+}}",labelsNP[k].Data()), false, 0.044, 42);
0246           canvas2->Update();
0247           canvas2->SaveAs(Form("figsIrrad/S14160_3015_plot_%s_VoV.pdf",outNP[k].Data()));        
0248         }
0249     }
0250 
0251     //*************************************************
0252     // Combined plot per SiPM 
0253     //*************************************************    
0254     TCanvas* canvas3 = new TCanvas("canvas3", "", 800, 600);
0255     DefaultCancasSettings(canvas3, 0.075, 0.01, 0.01, 0.075);
0256     canvas3->SetLogy();
0257     
0258     for (Int_t s = 0; s < 4; s++){
0259         canvas3->cd();
0260         std::cout << "s\t" << s << std::endl;
0261         if (mg1mmSiPM[s]->GetListOfGraphs()){
0262           SetStyleMultiGraph( mg1mmSiPM[s], "#it{V}_{op} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0263           mg1mmSiPM[s]->Draw("APL");
0264           // Draw the legend.
0265           DrawLatex(0.13, 0.92, Form("S14160-1315 %s",labelsSiPM[s].Data()), false, 0.044, 42);
0266           legend1mmSiPM[s]->Draw();
0267           canvas3->SaveAs(Form("figsIrrad/S14160_1315_plot_%s.pdf",labelsSiPM[s].Data()));
0268         } 
0269         if (mg1mmSiPMVoV[s]->GetListOfGraphs()){
0270           SetStyleMultiGraph( mg1mmSiPMVoV[s], "#it{V}_{ov} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0271           mg1mmSiPMVoV[s]->Draw("APL");
0272           // Draw the legend.
0273           DrawLatex(0.13, 0.92, Form("S14160-1315 %s",labelsSiPM[s].Data()), false, 0.044, 42);
0274           legend1mmSiPM[s]->Draw();
0275           canvas3->SaveAs(Form("figsIrrad/S14160_1315_plot_%s_VoV.pdf",labelsSiPM[s].Data()));
0276         } 
0277         if (mg3mmSiPM[s]->GetListOfGraphs()){
0278           SetStyleMultiGraph( mg3mmSiPM[s], "#it{V}_{op} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0279           mg3mmSiPM[s]->Draw("APL");
0280           // Draw the legend.
0281           DrawLatex(0.13, 0.92, Form("S14160-3015 %s",labelsSiPM[s].Data()), false, 0.044, 42);
0282           legend3mmSiPM[s]->Draw();
0283           canvas3->SaveAs(Form("figsIrrad/S14160_3015_plot_%s.pdf",labelsSiPM[s].Data()));
0284         } 
0285         if (mg3mmSiPMVoV[s]->GetListOfGraphs()){
0286           SetStyleMultiGraph( mg3mmSiPMVoV[s], "#it{V}_{ov} (V)", "#it{I}_{D} (A)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0287           mg3mmSiPMVoV[s]->Draw("APL");
0288           // Draw the legend.
0289           DrawLatex(0.13, 0.92, Form("S14160-3015 %s",labelsSiPM[s].Data()), false, 0.044, 42);
0290           legend3mmSiPM[s]->Draw();
0291           canvas3->SaveAs(Form("figsIrrad/S14160_3015_plot_%s_VoV.pdf",labelsSiPM[s].Data()));
0292         } 
0293     }
0294     
0295     Float_t VoV[8]    = {2.0, 2.5, 3., 3.5, 4.0, 4.5, 5.0, 5.5};
0296     int colorsVoV[8]  = {kGray+1, kGray+2, kRed+1, kBlue+1, kGreen+2, kCyan+2, kBlue-8, kBlue-5};
0297     int markersVoV[8] = {24, 25, kFullCircle, kFullSquare, 33, 34, 28,  27}; //, 42, 46, 43, 47, 29, 30};
0298 
0299     TLegend* legendDCR1mm = GetAndSetLegend2( 0.13, 0.84, 0.44, 0.96,textSizeRel*0.85, 2, "#bf{S14160-1315}", 42,0.2);
0300     // TLegend* legendDCR1mm = GetAndSetLegend2( 0.13, 0.74, 0.44, 0.96,textSizeRel*0.85, 2, "#bf{S14160-1315}", 42,0.2);
0301     TLegend* legendDCR3mm = GetAndSetLegend2( 0.13, 0.84, 0.44, 0.96,textSizeRel*0.85, 2, "#bf{S14160-3015}", 42,0.2);
0302     // TLegend* legendDCR3mm = GetAndSetLegend2( 0.13, 0.74, 0.44, 0.96,textSizeRel*0.85, 2, "#bf{S14160-3015}", 42,0.2);
0303     
0304     TGraph* graphDCR1mm[8];
0305     TGraph* graphDCR3mm[8];
0306     TMultiGraph* mgDCR1mm   = new TMultiGraph();
0307     TMultiGraph* mgDCR3mm   = new TMultiGraph();
0308     for (Int_t v = 0; v< 8; v++){
0309       graphDCR1mm[v] = (TGraph*)inputRootFile->Get(Form("S14160-1315/DCR_%1.1fV", VoV[v]));
0310       graphDCR1mm[v]->Sort();
0311       graphDCR1mm[v]->Scale(1/1e6); // Convert to MHz
0312       SetMarkerDefaultsTGraph(graphDCR1mm[v], markersVoV[v], 1, colorsVoV[v], colorsVoV[v], 1, 1, kFALSE, 0, kFALSE);
0313       if (v == 0 || v == 2 || v == 4 || v == 6){
0314         legendDCR1mm->AddEntry(graphDCR1mm[v], Form("%1.1f V", VoV[v]), "p");
0315         mgDCR1mm->Add(graphDCR1mm[v]);
0316       }
0317       graphDCR1mm[v]->Print();
0318       
0319       graphDCR3mm[v] = (TGraph*)inputRootFile->Get(Form("S14160-3015/DCR_%1.1fV", VoV[v]));
0320       graphDCR3mm[v]->Sort();
0321       graphDCR3mm[v]->Scale(1/1e6); // Convert to MHz
0322       SetMarkerDefaultsTGraph(graphDCR3mm[v], markersVoV[v], 1, colorsVoV[v], colorsVoV[v], 1, 1, kFALSE, 0, kFALSE);
0323       if (v == 0 || v == 2 || v == 4 || v == 6){
0324         legendDCR3mm->AddEntry(graphDCR3mm[v], Form("%1.1f V", VoV[v]), "p");
0325         mgDCR3mm->Add(graphDCR3mm[v]);
0326       }
0327       graphDCR3mm[v]->Print();
0328     }
0329 
0330     
0331     TCanvas* canvas4 = new TCanvas("canvas4", "", 800, 600);
0332     DefaultCancasSettings(canvas4, 0.075, 0.01, 0.01, 0.075);
0333         
0334     mgDCR1mm->GetYaxis()->SetRangeUser(1e5,1e12); 
0335     
0336     canvas4->SetLogy();
0337       SetStyleMultiGraph( mgDCR1mm, "log(1 MEQ Neutron Fluence) (cm^{-2})", "#it{DCR} (MHz)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0338       // Draw the TMultiGraph.
0339       mgDCR1mm->Draw("AP");
0340       // Draw the legend.
0341       legendDCR1mm->Draw();
0342     canvas4->Update();
0343     canvas4->SaveAs("figsIrrad/DCR_S14160_1315.pdf");
0344     
0345     // mgDCR1mm->GetYaxis()->SetRangeUser(1e5,1e12); 
0346     mgDCR1mm->GetYaxis()->SetRangeUser(1e-1,3e6); 
0347     mgDCR1mm->GetXaxis()->SetRangeUser(7,14); 
0348       // SetStyleMultiGraph( mgDCR1mm, "log(1 MEQ Neutron Fluence) (cm^{-2})", "#it{DCR} (Hz)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0349       // Draw the TMultiGraph.
0350       mgDCR1mm->Draw("AP");
0351       // Draw the legend.
0352       legendDCR1mm->Draw();
0353     canvas4->Update();
0354     canvas4->SaveAs("figsIrrad/DCR_S14160_1315_zoomed.pdf");
0355 
0356     // mgDCR3mm->GetYaxis()->SetRangeUser(1e5,1e12); 
0357     mgDCR3mm->GetYaxis()->SetRangeUser(1e-1,3e6); 
0358     canvas4->SetLogy();
0359       SetStyleMultiGraph( mgDCR3mm, "log(1 MEQ Neutron Fluence) (cm^{-2})", "#it{DCR} (MHz)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0360       // Draw the TMultiGraph.
0361       mgDCR3mm->Draw("AP");
0362       // Draw the legend.
0363       legendDCR3mm->Draw();
0364     canvas4->Update();
0365     canvas4->SaveAs("figsIrrad/DCR_S14160_3015.pdf");
0366     mgDCR3mm->GetXaxis()->SetRangeUser(7,14); 
0367       // SetStyleMultiGraph( mgDCR3mm, "log(1 MEQ Neutron Fluence) (cm^{-2})", "#it{DCR} (Hz)", 0.85*textSizeRel, textSizeRel, 0.85*textSizeRel, textSizeRel, 1., 1.1, 510, 510, 42, 62);
0368       // Draw the TMultiGraph.
0369       mgDCR3mm->Draw("AP");
0370       // Draw the legend.
0371       legendDCR3mm->Draw();
0372     canvas4->Update();
0373     canvas4->SaveAs("figsIrrad/DCR_S14160_3015_zoomed.pdf");
0374   
0375 }