diff --git a/Software/Arduino/AutomatedMeasurementsControlStepperMotors216/AutomatedMeasurementsControlStepperMotors216.ino b/Software/Arduino/AutomatedMeasurementsControlStepperMotors216/AutomatedMeasurementsControlStepperMotors216.ino index 3103442..e4aaf94 100644 --- a/Software/Arduino/AutomatedMeasurementsControlStepperMotors216/AutomatedMeasurementsControlStepperMotors216.ino +++ b/Software/Arduino/AutomatedMeasurementsControlStepperMotors216/AutomatedMeasurementsControlStepperMotors216.ino @@ -37,6 +37,10 @@ - the laser is initially on the strips corresponding to Beetle channels 216/220; - +30 brings the laser on the strips corresponding to the Beetle channels 16/20; - +40 brings the laser on the strips corresponding to the Beetle channels 216/220. +For Hans320 sensor: +- the laser is initially on the strips corresponding to Beetle channels 192/196; +- +30 brings the laser on the strips corresponding to the Beetle channels 32/36; +- +40 brings the laser on the strips corresponding to the Beetle channels 192/196. */ #include <Wire.h> @@ -98,11 +102,17 @@ Serial.println("Moved backward along x."); } else if (moveX == 3) { - myMotorX->step(1900,BACKWARD,DOUBLE); - Serial.println("Moved at the opposite edge of the silicon sensor (along x)."); + // Hans410. + // myMotorX->step(1900,BACKWARD,DOUBLE); + // Hans320. + myMotorX->step(1500,BACKWARD,DOUBLE); + Serial.println("Moved at the opposite edge of the silicon sensor (along x)."); } else if (moveX == 4) { - myMotorX->step(1900,FORWARD,DOUBLE); + // Hans410. + // myMotorX->step(1900,FORWARD,DOUBLE); + // Hans320. + myMotorX->step(1500,FORWARD,DOUBLE); Serial.println("Moved back."); } if (moveZ == 1) { diff --git a/Software/AutomatedMeasurements/ElectronicMonkeyCCEScan.py b/Software/AutomatedMeasurements/ElectronicMonkeyCCEScan.py index 26a3ea5..ec604eb 100644 --- a/Software/AutomatedMeasurements/ElectronicMonkeyCCEScan.py +++ b/Software/AutomatedMeasurements/ElectronicMonkeyCCEScan.py @@ -9,6 +9,7 @@ After the measurement, the position of the laser along x and z is reset. Parameters: +- <sensor>, the type of sensor; - <measurement>, the type of measurement; - <firstpar>, the first value of the parameter identifying the measurement; - <lastpar>, the last value of the parameter identifying the measurement; @@ -30,10 +31,10 @@ If the measurement is of type "CCEDelayScan" we need a different configuration file for each value of the delay. All these files are in "CCEDelayScanConfig" folder. How to run it: -python ElectronicMonkeyCCEScan.py --m <measurement> --fp <firstpar> --lp <lastpar> --sp <steppar> --z <z> --fx <firstx> --lx <lastx> --sx <stepx> --date <yyyymmdd> +python ElectronicMonkeyCCEScan.py --s <sensor> --m <measurement> --fp <firstpar> --lp <lastpar> --sp <steppar> --z <z> --fx <firstx> --lx <lastx> --sx <stepx> --date <yyyymmdd> For example: -python ElectronicMonkeyCCEScan.py --m CCEBiasVoltageScan --fp 100 --lp 200 --sp 20 --z 176 --fx 0 --lx 50 --sx 2 --date 20150106 +python ElectronicMonkeyCCEScan.py --s Hans410 --m CCEBiasVoltageScan --fp 100 --lp 200 --sp 20 --z 176 --fx 0 --lx 50 --sx 2 --date 20150106 Arduino device ID: DEVICE ID 2341:0042 on Bus 001 Address 045, Communications Device (in hexadecimal) @@ -55,6 +56,7 @@ parser = argparse.ArgumentParser(description='Define the parameters of the automated measurement for CCE scan.') +parser.add_argument('--s',help='type of sensor') parser.add_argument('--m',help='type of measurement') # Meaurements of type "CCEBiasVoltageScan" and "CCEDelayScan" have int parameters but measurements of type "CCEAttenuationScan" have float parameters. So float are used all the time, but casting them to int if necessary. @@ -73,6 +75,7 @@ args = parser.parse_args() # Parameters and configuration. +sensor = args.s measurement = args.m firstpar = args.fp @@ -93,6 +96,7 @@ filename = '' config = '/home/hep/flionett/TestStand/Repository/TestStandRepository/Software/AutomatedMeasurements' +print 'Type of sensor: ', sensor print 'Type of measurement: ', measurement print 'First value of the parameter identifying the measurement: %.1f steps' % firstpar @@ -138,9 +142,9 @@ time.sleep(1) # Take a pedestal run. -if not os.path.exists(folder+"/Hans410/"+measurement): - os.makedirs(folder+"/Hans410/"+measurement) -filename = folder+"/Hans410/"+measurement+"/"+str(yyyymmdd)+"-216-"+"ped.ali" +if not os.path.exists(folder+"/"+sensor+"/"+measurement): + os.makedirs(folder+"/"+sensor+"/"+measurement) +filename = folder+"/"+sensor+"/"+measurement+"/"+str(yyyymmdd)+"-216-"+"ped.ali" configped = config+"/FocusingConfig" printcommand = "echo alibava-gui --no-gui --nevts="+str(nevents)+" --out="+filename+" --pedestal "+configped @@ -161,13 +165,13 @@ print 'Position along z: %i steps' % z if (measurement == "CCEBiasVoltageScan") : - filename = folder+"/Hans410/"+measurement+"/"+str(yyyymmdd)+"-"+str(int(pospar))+"V"+"-216-"+str(posx)+"x-"+str(z)+"z-las.ali" + filename = folder+"/"+sensor+"/"+measurement+"/"+str(yyyymmdd)+"-"+str(int(pospar))+"V"+"-216-"+str(posx)+"x-"+str(z)+"z-las.ali" elif (measurement == "CCEAttenuationScan") : - filename = folder+"/Hans410/"+measurement+"/"+str(yyyymmdd)+"-"+str(pospar)+"dB"+"-216-"+str(posx)+"x-"+str(z)+"z-las.ali" + filename = folder+"/"+sensor+"/"+measurement+"/"+str(yyyymmdd)+"-"+str(pospar)+"dB"+"-216-"+str(posx)+"x-"+str(z)+"z-las.ali" elif (measurement == "CCEDelayScan") : - filename = folder+"/Hans410/"+measurement+"/"+str(yyyymmdd)+"-"+str(int(pospar))+"ns"+"-216-"+str(posx)+"x-"+str(z)+"z-las.ali" + filename = folder+"/"+sensor+"/"+measurement+"/"+str(yyyymmdd)+"-"+str(int(pospar))+"ns"+"-216-"+str(posx)+"x-"+str(z)+"z-las.ali" else : - filename = folder+"/Hans410/"+measurement+"/"+str(yyyymmdd)+"-216-"+str(posx)+"x-"+str(z)+"z-las.ali" + filename = folder+"/"+sensor+"/"+measurement+"/"+str(yyyymmdd)+"-216-"+str(posx)+"x-"+str(z)+"z-las.ali" printcommand = "echo alibava-gui --no-gui --nevts="+str(nevents)+" --out="+filename+" --laser "+configlas command = "alibava-gui --no-gui --nevts="+str(nevents)+" --out="+filename+" --laser "+configlas diff --git a/Software/CCE/CCE.C b/Software/CCE/CCE.C index aaf019c..cb3479d 100644 --- a/Software/CCE/CCE.C +++ b/Software/CCE/CCE.C Binary files differ diff --git a/Software/CheckAlignment/CheckAlignment.C b/Software/CheckAlignment/CheckAlignment.C index a12f348..e21e4ea 100644 --- a/Software/CheckAlignment/CheckAlignment.C +++ b/Software/CheckAlignment/CheckAlignment.C @@ -220,7 +220,7 @@ // Read noise. for (int iChannel=0; iChannel<N; ++iChannel) { - fscanf(inputText,"%*d%*c%*f%*c%f%*c",&(noise[iChannel])); + fscanf(inputText,"%*d%*c%*f%*c%*f%*c%f%*c%*f%*c",&(noise[iChannel])); // cout << iChannel << ", " << noise[iChannel] << endl; } diff --git a/Software/ComputePedestals/ComputePedestals.C b/Software/ComputePedestals/ComputePedestals.C index 3fcbee0..65bbd52 100644 --- a/Software/ComputePedestals/ComputePedestals.C +++ b/Software/ComputePedestals/ComputePedestals.C @@ -12,10 +12,12 @@ - distribution of the pedestals of each Beetle; - distribution of the noise of each Beetle. -It also creates a text file with three columns: +It also creates a text file with five columns: - Beetle channel, from 0 to 255; - pedestal; -- noise. +- pedestal uncertainty; +- noise; +- noise uncertainty. Compile with: @@ -78,11 +80,13 @@ cout << "- RMS of the above distribution as a function of the Beetle channel (the noise);" << endl; cout << "- distribution of the pedestals of each Beetle;" << endl; cout << "- distribution of the noise of each Beetle." << endl; - cout << "It also creates a text file with three columns:" << endl; + cout << "It also creates a text file with five columns:" << endl; cout << "- Beetle channel, from 0 to 255;" << endl; cout << "- pedestal;" << endl; - cout << "- noise." << endl; - + cout << "- pedestal uncertainty;" << endl; + cout << "- noise;" << endl; + cout << "- noise uncertainty." << endl; + cout << "**************************************************" << endl; cout << "Compile with:" << endl; @@ -279,7 +283,9 @@ TCanvas *cADC[N]; float pedestal[N]; + float upedestal[N]; // Uncertainty. float noise[N]; + float unoise[N]; // Uncertainty. for (int ch=0;ch<N;++ch) { hADC[ch] = new TH1F(Form("hADC%d",ch),"",1024,0,1024); @@ -298,7 +304,9 @@ // Get mean and RMS (that is, pedestal and noise). pedestal[ch] = hADC[ch]->GetMean(); + upedestal[ch] = hADC[ch]->GetMeanError(); noise[ch] = hADC[ch]->GetRMS(); + unoise[ch] = hADC[ch]->GetRMSError(); } // Mean and RMS as a function of the strip number. @@ -377,7 +385,7 @@ // Write output pedestal text file. for (int ch=0;ch<N;++ch) { - fprintf(output_text,"%d %.2f %.2f\n",ch,pedestal[ch],noise[ch]); + fprintf(output_text,"%d %.2f %.2f %.2f %.2f\n",ch,pedestal[ch],upedestal[ch],noise[ch],unoise[ch]); } // Write output ROOT file. diff --git a/Software/Focusing/Focusing.C b/Software/Focusing/Focusing.C index 4a4afb3..f5accd5 100644 --- a/Software/Focusing/Focusing.C +++ b/Software/Focusing/Focusing.C @@ -306,7 +306,7 @@ // Read noise. for (int iChannel=0; iChannel<N; ++iChannel) { - fscanf(inputText,"%*d%*c%*f%*c%f%*c",&(noise[iChannel])); + fscanf(inputText,"%*d%*c%*f%*c%*f%*c%f%*c%*f%*c",&(noise[iChannel])); // cout << iChannel << ", " << noise[iChannel] << endl; } @@ -454,7 +454,7 @@ DrawGraphErrors(cmuRight,gmuRight,"AP",path_to_figures); // Sigma - style for fit results. - gStyle->SetStatX(0.75); + gStyle->SetStatX(0.65); gStyle->SetStatY(0.9); // Sigma - parameters. diff --git a/Software/Monitoring/Monitoring.py b/Software/Monitoring/Monitoring.py new file mode 100644 index 0000000..e84b4a9 --- /dev/null +++ b/Software/Monitoring/Monitoring.py @@ -0,0 +1,170 @@ +""" +Author: Federica Lionetto +Date: March 30th, 2015 + +Description: +Monitoring of the environmental variables. + +Parameters: +- <sensor>, the type of sensor; +- <date>, the date according to the yyyymmdd format. + +How to run it: +python Monitoring --s <sensor> --d <date> + +For example: +python Monitoring --s Hans320 --d 20150330 +""" + +import argparse +import os +import serial +import sys +import time + +parser = argparse.ArgumentParser(description='Define the parameters of the monitoring of the environmental variables.') + +parser.add_argument('--s',help='type of sensor',required=True) +parser.add_argument('--d',type=int,help='date according to the yyyymmdd format',required=True) + +args = parser.parse_args() + +# Configuration. + +# Type of sensor. +sensor = args.s +# Date according to the yyyymmdd format. +yyyymmdd = args.d + +# Header to be written in the output text file. +header = 'Date&Time T (C) RH (%) DP (C)\n' +# Maximum number of output text files. +nFiles = 0 +maxNFiles = 2 +# Maximum size of the output text file (number of rows). Once this is reached, a new output text file will be created. +nRows = 0 +maxNRows = 10 + +# Sleep time between two consecutive measurements (s). +wait = 5 + +# Variables to be monitored. +T = -1. +RH = -1. +DP = -1. + +# Connection to Sensirion sensor. +# It should be ttyS4 or ttyS5. +ser = serial.Serial() +ser.port = '/dev/ttyS5' +ser.baudrate = 9600 +ser.bytesize = serial.EIGHTBITS +ser.parity = serial.PARITY_NONE +ser.stopbits = serial.STOPBITS_ONE +ser.timeout = 1 + +ser.open() +print "================================================================================================" +print "Serial port connected to Sensirion sensor: " +print ser.portstr +print "================================================================================================" + +if (ser.isOpen()) : + print "================================================================================================" + print "Serial port listening." + print "================================================================================================" + + # ser.write('GO\r') + # command = ser.read(2) + # print "Sending the command...", command + + ''' + trash = ser.read(3) + H = ser.read(5) + percent = ser.read(1) # Read the % symbol. + trash = ser.read(4) + T = ser.read(5) + degrees = ser.read(1) + print H + print percent + print T + print degrees + print "Relative humidity...", H, percent + print "Temperature...", T, degrees + ''' + + # Loop until the user presses Ctrl+C... + try : + while True : + # Sleep between two consecutive measurements. + time.sleep(wait) + # Read current time. + currentTime = time.ctime() + # Reset. + T = -1. + RH = -1. + DP = -1. + # Measure. + ser.write('GET\r') + command = ser.read(4) + # print "Sending the command...", command + trash1 = ser.read(2) + # Relative humidity (RH). + RH = ser.read(5) + percent = ser.read(1) # Read the % symbol. + trash2 = ser.read(4) + # Temperature (T). + T = ser.read(5) + degrees = ser.read(1) + trash3 = ser.read(4) + # Dew point (DP). + DP = -1 + # Write row in the output text file. + if (nRows%maxNRows==0) : + # Close previous output text file, if exists. + if (nFiles > 0) : + file.close() + if (nFiles == maxNFiles) : + print "================================================================================================" + print "Maximum number of output text files reached." + print "Terminating monitoring." + print "================================================================================================" + sys.exit(0) + # Create and open output text file. + # Filename (complete path or not) given through a parser. + path = "/disk/groups/hep/flionett/TestStand/Data/"+sensor+"/Monitoring" + if not os.path.exists(path) : + os.makedirs(path) + filename = path+"/Monitoring-"+str(yyyymmdd)+"-"+str(int(nRows/maxNRows))+".dat" + print "================================================================================================" + print "Opening new output text file: " + print filename + print "================================================================================================" + + file = open(filename,"w") + file.write(header) + nFiles = nFiles+1 + + ''' + print RH + print percent + print T + print degrees + print "Relative humidity...", RH, percent + print "Temperature...", T, degrees + print "Dew point...", DP, degrees + ''' + + row = currentTime + " " + str(T) + " " + str(RH) + " " + str(DP) + "\n" + print row + file.write(row) + nRows = nRows+1 + except KeyboardInterrupt : + # ser.write('S') + # command = ser.read(1) + # print "Sending the command...", command + sys.exit(0) + + # Close output text file. + file.close() + ser.close() diff --git a/Software/ProcessRawData/ProcessRawData.C b/Software/ProcessRawData/ProcessRawData.C index 5ef3c1c..501dbc0 100644 --- a/Software/ProcessRawData/ProcessRawData.C +++ b/Software/ProcessRawData/ProcessRawData.C @@ -180,7 +180,7 @@ float ped[N]; for (int iChannel=0; iChannel<N; ++iChannel) { - fscanf(inputText,"%*d%*c%f%*c%*f%*c",&(ped[iChannel])); + fscanf(inputText,"%*d%*c%f%*c%*f%*c%*f%*c%*f%*c",&(ped[iChannel])); // cout << iChannel << ", " << ped[iChannel] << endl; } diff --git a/Software/Tools/FindStrip.C b/Software/Tools/FindStrip.C index 2ab4f37..570fe08 100644 --- a/Software/Tools/FindStrip.C +++ b/Software/Tools/FindStrip.C @@ -116,7 +116,7 @@ int right = hmap->GetBinContent(stripRight+1); // The +1 is necessary to take the number scheme of the histogram into account. cout << "Adjacent Beetle channel on the left: " << stripLeft << ", " << left << endl; cout << "Adjacent Beetle channel on the right: " << stripRight << ", " << right << endl; - if (left < right) + if (left <= right) *direction = "right"; else *direction = "left"; diff --git a/Software/Tools/SCurve.C b/Software/Tools/SCurve.C index 793f99b..b02ee31 100644 --- a/Software/Tools/SCurve.C +++ b/Software/Tools/SCurve.C @@ -469,7 +469,7 @@ // fitLeft->SetParLimits(3,150.,220.); } - else if (filename == "ProcessRawData-201503232-216") { + else if ((filename == "ProcessRawData-201503232-216") || (filename == "ProcessRawData-20150325-216") || (filename == "ProcessRawData-201503252-67ns-216") || (filename == "ProcessRawData-201503252-68ns-216") || (filename == "ProcessRawData-201503252-69ns-216") || (filename == "ProcessRawData-201503252-70ns-216") || (filename == "ProcessRawData-201503252-71ns-216") || (filename == "ProcessRawData-201503252-72ns-216") || (filename == "ProcessRawData-201503252-73ns-216") || (filename == "ProcessRawData-201503252-74ns-216") || (filename == "ProcessRawData-201503252-75ns-216") || (filename == "ProcessRawData-201503253-150V-216") || (filename == "ProcessRawData-201503253-170V-216") || (filename == "ProcessRawData-201503253-190V-216") || (filename == "ProcessRawData-201503253-210V-216") || (filename == "ProcessRawData-201503253-230V-216") || (filename == "ProcessRawData-201503253-250V-216") || (filename == "ProcessRawData-20150326-24.5dB-216") || (filename == "ProcessRawData-20150326-25.0dB-216") || (filename == "ProcessRawData-20150326-25.5dB-216") || (filename == "ProcessRawData-20150326-26.0dB-216") || (filename == "ProcessRawData-20150326-26.5dB-216") || (filename == "ProcessRawData-20150326-27.0dB-216") || (filename == "ProcessRawData-20150326-27.5dB-216") || (filename == "ProcessRawData-20150326-28.0dB-216") || (filename == "ProcessRawData-20150326-28.5dB-216")) { // Right. if (zvalue < 150.) { *minRight = 120.; @@ -523,6 +523,60 @@ // fitLeft->SetParLimits(3,150.,220.); } + else if (filename == "ProcessRawData-201503273-216"){ + // Right. + if (zvalue < 210.) { + *minRight = 90.; + *maxRight = 170.; + } + else { + *minRight = 80.; + *maxRight = 170.; + } + + // Left. + if (zvalue < 90.) { + *minLeft = 200.; + *maxLeft = 300.; + } + else if (zvalue < 210.) { + *minLeft = 200.; + *maxLeft = 290.; + } + else { + *minLeft = 200.; + *maxLeft = 280.; + } + + // Right. + parSCurves[0] = 2.5; + parSCurves[1] = 120.; + parSCurves[2] = 10.; + parSCurves[3] = 3.; + + // parSCurves[4] = 10.; + // parSCurves[5] = 20.; + parSCurves[6] = 100.; + parSCurves[7] = 150.; + parSCurves[8] = 3.; + parSCurves[9] = 20.; + // parSCurves[10] = 8.; + // parSCurves[11] = 18.; + + // Left. + parSCurves[12] = 2.5; + parSCurves[13] = 275.; + parSCurves[14] = 10.; + parSCurves[15] = 3.; + + // fitLeft->SetParLimits(0,90.,170.); + parSCurves[18] = 250.; + parSCurves[19] = 300.; + parSCurves[20] = 3.; + parSCurves[21] = 20.; + // fitLeft->SetParLimits(3,150.,220.); + } + return; } @@ -622,7 +676,7 @@ // parSigma[17] = ?.; } - else if (filename == "ProcessRawData-201503232-216") { + else if ((filename == "ProcessRawData-201503232-216") || (filename == "ProcessRawData-201503273-216")) { // Sigma left. parSigma[0] = 0.01; parSigma[1] = 550.; @@ -681,6 +735,25 @@ */ } + else if ((filename == "ProcessRawData-20150325-216") || (filename == "ProcessRawData-201503252-67ns-216") || (filename == "ProcessRawData-201503252-68ns-216") || (filename == "ProcessRawData-201503252-69ns-216") || (filename == "ProcessRawData-201503252-70ns-216") || (filename == "ProcessRawData-201503252-71ns-216") || (filename == "ProcessRawData-201503252-72ns-216") || (filename == "ProcessRawData-201503252-73ns-216") || (filename == "ProcessRawData-201503252-74ns-216") || (filename == "ProcessRawData-201503252-75ns-216")|| (filename == "ProcessRawData-201503253-150V-216") || (filename == "ProcessRawData-201503253-170V-216") || (filename == "ProcessRawData-201503253-190V-216") || (filename == "ProcessRawData-201503253-210V-216") || (filename == "ProcessRawData-201503253-230V-216") || (filename == "ProcessRawData-201503253-250V-216") || (filename == "ProcessRawData-20150326-24.5dB-216") || (filename == "ProcessRawData-20150326-25.0dB-216") || (filename == "ProcessRawData-20150326-25.5dB-216") || (filename == "ProcessRawData-20150326-26.0dB-216") || (filename == "ProcessRawData-20150326-26.5dB-216") || (filename == "ProcessRawData-20150326-27.0dB-216") || (filename == "ProcessRawData-20150326-27.5dB-216") || (filename == "ProcessRawData-20150326-28.0dB-216") || (filename == "ProcessRawData-20150326-28.5dB-216")) { + parEta[0] = 1.; + parEta[1] = 200.; + parEta[2] = 6.; + parEta[3] = 0.; + + // parEta[4] = 0.5; + // parEta[5] = 2.5; + + parEta[6] = 180.; + parEta[7] = 220.; + + parEta[8] = 2.; + parEta[9] = 10.; + + // parEta[10] = -0.2; + // parEta[11] = 0.2; + } + return; } diff --git a/Software/Tools/Style.C b/Software/Tools/Style.C index 5777485..8af0827 100644 --- a/Software/Tools/Style.C +++ b/Software/Tools/Style.C @@ -53,6 +53,10 @@ void DrawGraphFunc2(TCanvas *canvas, TGraph *graph, TF1 *func1, TF1 *func2, TString option = "APC", TString folder = ""); +void DrawGraphErrorsFunc(TCanvas *canvas, TGraphErrors *graph, TF1 *func, TString option = "APC", TString folder = ""); + +void DrawGraphErrorsFunc2(TCanvas *canvas, TGraphErrors *graph, TF1 *func1, TF1 *func2, TString option = "APC", TString folder = ""); + void DrawGraphCompare(TCanvas *canvas, TMultiGraph *graph, TLegend *leg, TString title = "", TString x = "", TString y = "", TString option = "APE", TString folder = ""); TLegend *CreateLegend2(TObject *obj1, TString lab1, TObject *obj2, TString lab2, TString option = "lpfw", Double_t x1 = 0.64, Double_t y1 = 0.59, Double_t x2 = 0.94, Double_t y2 = 0.89); @@ -552,6 +556,70 @@ return; } +// DrawGraphErrorsFunc draws the "graph" graph and the "func" function in the "canvas" canvas and saves the result in the "folder" folder, in a pdf file named "canvas.pdf". +void DrawGraphErrorsFunc(TCanvas *canvas, TGraphErrors *graph, TF1 *func, TString option, TString folder) { + TString path; + path = folder; + TString name = canvas->GetName(); + canvas->cd(); + canvas->SetTickx(1); + canvas->SetTicky(1); + graph->Draw(option); + graph->SetFillColor(38); + graph->SetMarkerSize(1); + graph->SetMarkerStyle(20); + graph->SetMarkerColor(1); + graph->SetLineWidth(2); + graph->SetLineStyle(1); + graph->SetLineColor(2); + func->Draw("SAME"); + func->SetLineWidth(2); + func->SetLineStyle(1); + func->SetLineColor(kMagenta); + gPad->Modified(); + canvas->Update(); + canvas->Write(); + name = path + "/" + name + ".pdf"; + canvas->SaveAs(name); + canvas->Close(); + + return; +} + +// DrawGraphErrorsFunc2 draws the "graph" graph and the "func1" and "func2" functions in the "canvas" canvas and saves the result in the "folder" folder, in a pdf file named "canvas.pdf". +void DrawGraphErrorsFunc2(TCanvas *canvas, TGraphErrors *graph, TF1 *func1, TF1 *func2, TString option, TString folder) { + TString path; + path = folder; + TString name = canvas->GetName(); + canvas->cd(); + canvas->SetTickx(1); + canvas->SetTicky(1); + graph->Draw(option); + graph->SetFillColor(38); + graph->SetMarkerSize(1); + graph->SetMarkerStyle(20); + graph->SetMarkerColor(1); + graph->SetLineWidth(2); + graph->SetLineStyle(1); + graph->SetLineColor(2); + func1->Draw("SAME"); + func1->SetLineWidth(2); + func1->SetLineStyle(1); + func1->SetLineColor(kOrange); + func2->Draw("SAME"); + func2->SetLineWidth(2); + func2->SetLineStyle(1); + func2->SetLineColor(kMagenta); + gPad->Modified(); + canvas->Update(); + canvas->Write(); + name = path + "/" + name + ".pdf"; + canvas->SaveAs(name); + canvas->Close(); + + return; +} + // DrawGraphCompare draws the "graph" graph in the "canvas" canvas and saves the result in the "folder" folder, in a pdf file named "canvas.pdf". void DrawGraphCompare(TCanvas *canvas, TMultiGraph *graph, TLegend *leg, TString title, TString x, TString y, TString option, TString folder) { TString path;