diff --git a/Software/Arduino/ControlStepperMotors216/ControlStepperMotors216.ino b/Software/Arduino/ControlStepperMotors216/ControlStepperMotors216.ino index 6cbdcde..f3c950a 100644 --- a/Software/Arduino/ControlStepperMotors216/ControlStepperMotors216.ino +++ b/Software/Arduino/ControlStepperMotors216/ControlStepperMotors216.ino @@ -28,8 +28,8 @@ +40 ---> move back; +01 ---> move one step forward along z; +02 ---> move one step backward along z; -+03 ---> do not do anything; -+04 ---> do not do anything. ++03 ---> move 0.1 mm forward along z; ++04 ---> move 0.1 mm backward along z. Distances in microns. @@ -114,10 +114,12 @@ Serial.println("Moved backward along z."); } else if (moveZ == 3) { - Serial.println("Nothing done."); + myMotorZ->step(20,FORWARD,DOUBLE); + Serial.println("Moved 0.1 mm forward along z."); } else if (moveZ == 4) { - Serial.println("Nothing done."); + myMotorZ->step(20,BACKWARD,DOUBLE); + Serial.println("Moved 0.1 mm backward along z."); } } diff --git a/Software/AttenuationScan/AttenuationScan.C b/Software/AttenuationScan/AttenuationScan.C index b5e4c5c..5136823 100644 --- a/Software/AttenuationScan/AttenuationScan.C +++ b/Software/AttenuationScan/AttenuationScan.C @@ -18,7 +18,6 @@ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" #include "../Tools/Style.C" -#include "../Tools/Useful.C" #include "../Tools/FindStrip.C" #include "../Tools/Par.C" diff --git a/Software/BiasVoltageScan/BiasVoltageScan b/Software/BiasVoltageScan/BiasVoltageScan deleted file mode 100755 index 7c82942..0000000 --- a/Software/BiasVoltageScan/BiasVoltageScan +++ /dev/null Binary files differ diff --git a/Software/BiasVoltageScan/BiasVoltageScan.C b/Software/BiasVoltageScan/BiasVoltageScan.C index cbddaac..1458827 100644 --- a/Software/BiasVoltageScan/BiasVoltageScan.C +++ b/Software/BiasVoltageScan/BiasVoltageScan.C @@ -16,7 +16,6 @@ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" #include "../Tools/Style.C" -#include "../Tools/Useful.C" #include "../Tools/FindStrip.C" #include "../Tools/Par.C" diff --git a/Software/CheckAlignment/CheckAlignment.C b/Software/CheckAlignment/CheckAlignment.C index d56ba86..6f1c8d1 100644 --- a/Software/CheckAlignment/CheckAlignment.C +++ b/Software/CheckAlignment/CheckAlignment.C @@ -10,6 +10,7 @@ The alignment data taking is identified by the following information: - , that is, the type of sensor (Hans410, ...); - , that is, the filename excluding the position value and the run type. +- , that is, the position along z; - , that is, the first position along x; - , that is, the last position along x; - , that is, the step between two subsequent data acquisitions (1 step = 5 microns). @@ -20,11 +21,11 @@ Run with: -./CheckAlignment [sensor] [filename] [firstx] [lastx] [stepx] [additional folder] +./CheckAlignment [sensor] [filename] [z] [firstx] [lastx] [stepx] [additional folder] For example: -./CheckAlignment Hans410 20141121 0 75 3 Hans410/Alignment +./CheckAlignment Hans410 ProcessRawData-20141121 0 0 75 3 A folder named AnalysisResults will be created in a fixed location and a ROOT file will be saved in there. A folder named Figures will be created inside the folder named AnalysisResults, with some monitoring plots. @@ -34,12 +35,11 @@ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" #include "../Tools/Style.C" -#include "../Tools/Useful.C" #include "../Tools/FindStrip.C" #include "../Tools/Par.C" -void CheckAlignment(char *sensor, char *filename, const Float_t firstx, const Float_t lastx, const Float_t stepx, char *externalPath=0); +void CheckAlignment(char *sensor, char *filename, const Float_t z, const Float_t firstx, const Float_t lastx, const Float_t stepx, char *externalPath=0); int main(int argc, char *argv[]) { @@ -56,20 +56,21 @@ return 0; } - else if (argc < 6) + else if (argc < 7) { cout << "**************************************************" << endl; cout << "Error! Arguments missing..." << endl; cout << "Please use the following format:" << endl; - cout << "./CheckAlignment [1] [2] [3] [4] [5] [6]" << endl; + cout << "./CheckAlignment [1] [2] [3] [4] [5] [6] [7]" << endl; cout << "with:" << endl; cout << "[1] = Type of sensor (Hans410, ...);" << endl; cout << "[2] = Filename, excluding the position value and the run type;" << endl; - cout << "[3] = First position along x;" << endl; - cout << "[4] = Last position along x" << endl; - cout << "[5] = Step between two subsequent data acquisitions (1 step = 5 microns);" << endl; - cout << "[6] = Additional folder, optional." << endl; + cout << "[3] = Position along z;" << endl; + cout << "[4] = First position along x;" << endl; + cout << "[5] = Last position along x" << endl; + cout << "[6] = Step between two subsequent data acquisitions (1 step = 5 microns);" << endl; + cout << "[7] = Additional folder, optional." << endl; cout << "Type ./CheckAlignment --info for more information." << endl; cout << "**************************************************" << endl; @@ -80,13 +81,14 @@ { cout << "Type of sensor: " << argv[1] << endl; cout << "Filename: " << argv[2] << endl; - cout << "First position along x: " << argv[3] << endl; - cout << "Last position along x: " << argv[4] << endl; - cout << "Step between two subsequent data acquisitions: " << argv[5] << endl; - if (argc == 6) - CheckAlignment(argv[1],argv[2],atoi(argv[3]),atoi(argv[4]),atoi(argv[5])); - else if (argc == 7) - CheckAlignment(argv[1],argv[2],atoi(argv[3]),atoi(argv[4]),atoi(argv[5]),argv[6]); + cout << "Position along z: " << argv[3] << endl; + cout << "First position along x: " << argv[4] << endl; + cout << "Last position along x: " << argv[5] << endl; + cout << "Step between two subsequent data acquisitions: " << argv[6] << endl; + if (argc == 7) + CheckAlignment(argv[1],argv[2],atoi(argv[3]),atoi(argv[4]),atoi(argv[5]),atoi(argv[6])); + else if (argc == 8) + CheckAlignment(argv[1],argv[2],atoi(argv[3]),atoi(argv[4]),atoi(argv[5]),atoi(argv[6]),argv[7]); else { cout << "Error! Too many arguments given..." << endl; @@ -98,7 +100,7 @@ } } -void CheckAlignment(char *sensor, char *filename, const Float_t firstx, const Float_t lastx, const Float_t stepx, char *externalPath) +void CheckAlignment(char *sensor, char *filename, const Float_t z, const Float_t firstx, const Float_t lastx, const Float_t stepx, char *externalPath) { cout << "**************************************************" << endl; cout << "Checking alignment..." << endl; @@ -108,8 +110,10 @@ gROOT->ProcessLine("#include "); // Do some fanciness to get the directory right. - string inputDirectory = "~/TestStand/AnalysisResults/"+string(sensor)+"/Alignment"; - string outputDirectory = "~/TestStand/AnalysisResults/"+string(sensor)+"/Alignment"; + // string inputDirectory = "~/TestStand/AnalysisResults/"+string(sensor)+"/Alignment"; + string inputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensor)+"/Alignment"; + // string outputDirectory = "~/TestStand/AnalysisResults/"+string(sensor)+"/Alignment"; + string outputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensor)+"/Alignment"; if (externalPath!=0) outputDirectory = string(outputDirectory+"/"+externalPath); cout << "The input directory is: " << inputDirectory << endl; @@ -119,10 +123,19 @@ string path_to_make = "mkdir -p "+outputDirectory; system(path_to_make.c_str()); - cout << "Figures stored in: " << outputDirectory+"/Figures/"+filename << endl; + ostringstream convertx; + ostringstream convertz; + string tempx; + string tempz; + + convertz.str(""); + convertz << z; + tempz = convertz.str(); + + cout << "Figures stored in: " << outputDirectory+"/Figures/"+filename+"-"+tempz+"z" << endl; // Create a directory named Figures inside the directory named outputDirectory if it does not exist. - string path_to_make_figures = "mkdir -p "+outputDirectory+"/Figures/"+filename; + string path_to_make_figures = "mkdir -p "+outputDirectory+"/Figures/"+filename+"-"+tempz+"z"; system(path_to_make_figures.c_str()); TString path_to_figures = (string(path_to_make_figures)).substr((string(path_to_make_figures)).find_last_of(' ')+1); @@ -132,17 +145,17 @@ char char_input_ROOT[200]; string input_ROOT; - string output_ROOT = outputDirectory+"/Alignment-"+filename+".root"; + string output_ROOT; + string inputFindStrip; string outputFindStrip; - ostringstream convert; - string temp; const Int_t steps = (Int_t)((lastx-firstx)/stepx+1); Float_t x[steps]; Float_t mean4ADC[steps]; // Open output ROOT file. + output_ROOT = outputDirectory+"/Alignment-"+filename+"-"+tempz+"z.root"; TFile *output = TFile::Open(TString(output_ROOT),"RECREATE"); for (Int_t step=0;step, TH1F *hdMixBeetle, and TH1F *hdLasBeetle, respectively) and the 2D distribution of the observables ped(ped run 2) and ped(las run 2) (TH2F *h2pedLasBeetle), where ={1,2}. -It shows the same distributions as above, but for Beetle channels connected to silicon and Beetle channels not connected to silicon, instead of Beetle 1 and Beetle 2 (TH1F *hdPedConn, TH1F *hdMixConn, TH1F *hdLasConn, TH2F *h2pedLasConn, TH1F *hdPedNotConn, TH1F *hdMixNotConn, TH1F *hdLasNotConn, and TH2F *h2pedLasNotConn). -It shows the dMix as a function of the Beetle channel (TH1F *hdMixvsstrip). - -Compile with: - -make - -Run with: - -./CheckBaselineShift [additional folder] - -where: -- [additional folder] is the optional additional folder where the output will be saved. -*/ - -#include "../Tools/Lib.C" -#include "../Tools/lhcbStyle.C" -#include "../Tools/Style.C" -#include "../Tools/Useful.C" - -#include "../Tools/Par.C" - -void CheckBaselineShift(char *externalPath=0); - -int main(int argc, char *argv[]) -{ - getLHCbStyle(); - PersonalStyle(); - - if ((argc ==2) && (string(argv[1]) == "--info")) - { - cout << "**************************************************" << endl; - - cout << "Some comments." << endl; - - cout << "**************************************************" << endl; - - return 0; - } - else if (argc==1) - { - CheckBaselineShift(); - - return 0; - } - else if (argc==2) - { - CheckBaselineShift(argv[1]); - - return 0; - } - else - { - cout << "Error! Too many arguments given..." << endl; - - return 0; - } -} - -void CheckBaselineShift(char *externalPath) -{ - cout << "**************************************************" << endl; - cout << "Checking baseline shift between pedestal run mode and laser run mode..." << endl; - cout << "**************************************************" << endl; - - // Do some fanciness to get the directory right. - string analysis = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/CheckBaselineShift"; - if (externalPath!=0) - analysis = string(analysis+"/"+externalPath); - string figures = analysis+"/Figures"; - - // Create the folder. Do not worry, nothing bad is going to happen if the folder already exists. - string path_to_make = "mkdir -p "+analysis; - system(path_to_make.c_str()); - cout << "Setting output to: " << path_to_make << endl; - - // Create a folder named Figures inside the folder named . - string path_to_make_figures = "mkdir "+figures; - system(path_to_make_figures.c_str()); - cout << "Setting figures to: " << path_to_make_figures << endl; - - TString path_to_figures = (string(path_to_make_figures)).substr((string(path_to_make_figures)).find_last_of(' ')+1); - - cout << path_to_figures << endl; - - // Input pedestal text files. - // string inputPed1Filename = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/AttenuationScan/ComputePedestals-20141110-ped.dat"; - // string inputPed2Filename = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/AttenuationScan/ComputePedestals-20141110-2-ped.dat"; - // string inputLas1Filename = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/AttenuationScan/ComputePedestals-20141112-laserOffSensor-las.dat"; - // string inputLas2Filename = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/AttenuationScan/ComputePedestals-20141112-2-laserOffSensor-las.dat"; - - string inputPed1Filename = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/AttenuationScan/ComputePedestals-20141113-ped.dat"; - string inputPed2Filename = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/AttenuationScan/ComputePedestals-20141113-2-ped.dat"; - string inputLas1Filename = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/AttenuationScan/ComputePedestals-20141113-laserOffSensor-las.dat"; - string inputLas2Filename = "/home/hep/flionett/TestStand/AnalysisResults/Hans410/AttenuationScan/ComputePedestals-20141113-2-laserOffSensor-las.dat"; - - cout << "First pedestal run: " << inputPed1Filename << endl; - cout << "Second pedestal run: " << inputPed2Filename << endl; - - cout << "First laser run: " << inputLas1Filename << endl; - cout << "Second laser run: " << inputLas2Filename << endl; - - // Open input pedestal text files. - FILE *inputPed1 = fopen(TString(inputPed1Filename),"r"); - FILE *inputPed2 = fopen(TString(inputPed2Filename),"r"); - FILE *inputLas1 = fopen(TString(inputLas1Filename),"r"); - FILE *inputLas2 = fopen(TString(inputLas2Filename),"r"); - - // Read pedestals. - float ped1[N]; - float ped2[N]; - float las1[N]; - float las2[N]; - - for (int iChannel=0; iChannelFill(ped2[iChannel]-ped1[iChannel]); - hdMixBeetle1->Fill(las2[iChannel]-ped1[iChannel]); - hdLasBeetle1->Fill(las2[iChannel]-las1[iChannel]); - h2pedLasBeetle1->Fill(ped2[iChannel],las2[iChannel]); - } - - DrawHistCompare3(cdBeetle1,hdPedBeetle1,hdMixBeetle1,hdLasBeetle1,legd,path_to_figures); - DrawHist2(cpedLasBeetle1,h2pedLasBeetle1,"colz",path_to_figures); - - - - // Beetle 2. - - TH1F *hdPedBeetle2 = new TH1F("hdPedBeetle2","",60,-30,30); - TH1F *hdMixBeetle2 = new TH1F("hdMixBeetle2","",60,-30,30); - TH1F *hdLasBeetle2 = new TH1F("hdLasBeetle2","",60,-30,30); - TH2F *h2pedLasBeetle2 = new TH2F("h2pedLasBeetle2","",150,450,600,150,450,600); - - InitHist(hdPedBeetle2, "Shift in pedestals - Beetle 2","ADC counts",""); - InitHist(hdMixBeetle2,"Shift in pedestals - Beetle 2","ADC counts",""); - InitHist(hdLasBeetle2,"Shift in pedestals - Beetle 2","ADC counts",""); - InitHist2(h2pedLasBeetle2,"Pedestals - Beetle 2","pedestal run (ADC counts)","laser run (ADC counts)",""); - - TCanvas *cdBeetle2 = new TCanvas("cdBeetle2","",400,300); - TCanvas *cpedLasBeetle2 = new TCanvas("cpedLasBeetle2","",400,300); - - for (int iChannel=NBeetle;iChannelFill(ped2[iChannel]-ped1[iChannel]); - hdMixBeetle2->Fill(las2[iChannel]-ped1[iChannel]); - hdLasBeetle2->Fill(las2[iChannel]-las1[iChannel]); - h2pedLasBeetle2->Fill(ped2[iChannel],las2[iChannel]); - } - - DrawHistCompare3(cdBeetle2,hdPedBeetle2,hdMixBeetle2,hdLasBeetle2,legd,path_to_figures); - DrawHist2(cpedLasBeetle2,h2pedLasBeetle2,"colz",path_to_figures); - - - - // Strips connected to the silicon. - - TH1F *hdPedConn = new TH1F("hdPedConn","",60,-30,30); - TH1F *hdMixConn = new TH1F("hdMixConn","",60,-30,30); - TH1F *hdLasConn = new TH1F("hdLasConn","",60,-30,30); - TH2F *h2pedLasConn = new TH2F("h2pedLasConn","",150,450,600,150,450,600); - - InitHist(hdPedConn,"Shift in pedestals - connected to Si","ADC counts",""); - InitHist(hdMixConn,"Shift in pedestals - connected to Si","ADC counts",""); - InitHist(hdLasConn,"Shift in pedestals - connected to Si","ADC counts",""); - InitHist2(h2pedLasConn,"Pedestals - connected to Si","pedestal run (ADC counts)","laser run (ADC counts)",""); - - TCanvas *cdConn = new TCanvas("cdConn","",400,300); - TCanvas *cpedLasConn = new TCanvas("cpedLasConn","",400,300); - - for (int iChannel=0;iChannelFill(ped2[iChannel]-ped1[iChannel]); - hdMixConn->Fill(las2[iChannel]-ped1[iChannel]); - hdLasConn->Fill(las2[iChannel]-las1[iChannel]); - h2pedLasConn->Fill(ped2[iChannel],las2[iChannel]); - } - } - - DrawHistCompare3(cdConn,hdPedConn,hdMixConn,hdLasConn,legd,path_to_figures); - DrawHist2(cpedLasConn,h2pedLasConn,"colz",path_to_figures); - - - - // Strips not connected to the silicon. - - TH1F *hdPedNotConn = new TH1F("hdPedNotConn","",60,-30,30); - TH1F *hdMixNotConn = new TH1F("hdMixNotConn","",60,-30,30); - TH1F *hdLasNotConn = new TH1F("hdLasNotConn","",60,-30,30); - TH2F *h2pedLasNotConn = new TH2F("h2pedLasNotConn","",150,450,600,150,450,600); - - InitHist(hdPedNotConn,"Shift in pedestals - not connected to Si","ADC counts",""); - InitHist(hdMixNotConn,"Shift in pedestals - not connected to Si","ADC counts",""); - InitHist(hdLasNotConn,"Shift in pedestals - not connected to Si","ADC counts",""); - InitHist2(h2pedLasNotConn,"Pedestals - not connected to Si","pedestal run (ADC counts)","laser run (ADC counts)",""); - - TCanvas *cdNotConn = new TCanvas("cdNotConn","",400,300); - TCanvas *cpedLasNotConn = new TCanvas("cpedLasNotConn","",400,300); - - for (int iChannel=0;iChannelFill(ped2[iChannel]-ped1[iChannel]); - hdMixNotConn->Fill(las2[iChannel]-ped1[iChannel]); - hdLasNotConn->Fill(las2[iChannel]-las1[iChannel]); - h2pedLasNotConn->Fill(ped2[iChannel],las2[iChannel]); - } - } - - DrawHistCompare3(cdNotConn,hdPedNotConn,hdMixNotConn,hdLasNotConn,legd,path_to_figures); - DrawHist2(cpedLasNotConn,h2pedLasNotConn,"colz",path_to_figures); - - - - // dMix as a function of the Beetle channel (TH1F *hdMixvsstrip). - float strip[N]; - for (int iChannel=0;iChannelFill(iChannel,las2[iChannel]-ped2[iChannel]); - } - hdMixvsstrip->SetMinimum(-30); - hdMixvsstrip->SetMaximum(30); - TCanvas *cdMixvsstrip = new TCanvas("cdMixvsstrip","",400,300); - DrawHist(cdMixvsstrip,hdMixvsstrip,"",path_to_figures); - - // Write output ROOT file. - output->Write(); - - // Close output ROOT files. - output->Close(); - - return; -} diff --git a/Software/CheckBaselineShift/Makefile~ b/Software/CheckBaselineShift/Makefile~ deleted file mode 100755 index 685aba4..0000000 --- a/Software/CheckBaselineShift/Makefile~ +++ /dev/null @@ -1,34 +0,0 @@ -# -CC=$(CXX) -glib_cflags=$(shell pkg-config --cflags glib-2.0 gio-2.0) -glib_libs=$(shell pkg-config --libs glib-2.0 gio-2.0) - -ROOTC=$(shell root-config --cflags) -ROOTL=$(shell root-config --libs) -OPT=-g -fno-inline #-std=c++11 -CppFLAGS=$(OPT) -I. $(glib_cflags) -CXXFLAGS=-fPIC $(CppFLAGS) - - -UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Linux) - SO=so - SO_FLAGS=-shared - CXXFLAGS += -D LINUX -endif -ifeq ($(UNAME_S),Darwin) - SO=dylib - SO_FLAGS=-dynamiclib -undefined dynamic_lookup -install_name @rpath/$@ - CXXFLAGS += -D OSX -endif - -all: ProcessRawData - -ProcessRawData: ProcessRawData.C - c++ -I$(OPT) $(CXXFLAGS) $(ROOTC) -o $@ $^ $(LDLIBS) $(ROOTL) $(gliblibs) - - -clean: - rm -f *.o ProcessRawData - rm -rf *.dSYM - diff --git a/Software/ComputePedestals/ComputePedestals.C b/Software/ComputePedestals/ComputePedestals.C index 5da17e2..845e4f8 100644 --- a/Software/ComputePedestals/ComputePedestals.C +++ b/Software/ComputePedestals/ComputePedestals.C @@ -41,7 +41,6 @@ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" #include "../Tools/Style.C" -#include "../Tools/Useful.C" #include "../Tools/Par.C" diff --git a/Software/Focusing/Focusing.C b/Software/Focusing/Focusing.C new file mode 100644 index 0000000..5790df2 --- /dev/null +++ b/Software/Focusing/Focusing.C @@ -0,0 +1,338 @@ +//************************************************ +// Author: Federica Lionetto +// Created on: 19/12/2014 +//************************************************ + +/* +Focusing reads all the ROOT files of a given focusing data taking and calculates the z coordinate of the focus. +For each z position, it fits the s-curve with two erf functions, one for the left side and one for the right side, and returns the mu and sigma, that will be used to determine the focus. + +The focusing data taking is identified by the following information: +- , that is, the type of sensor (Hans410, ...); +- , that is, the filename excluding the position value and the run type. +- , that is, the first position along x; +- , that is, the last position along x; +- , that is, the step between two subsequent data acquisitions in x (1 step = 5 microns); +- , that is, the first position along z; +- , that is, the last position along z; +- , that is, the step between two subsequent data acquisitions in z (1 step = 5 microns). + +Compile with: + +make + +Run with: + +./Focusing [sensor] [filename] [firstx] [lastx] [stepx] [firstz] [lastz] [stepz] [additional folder] + +For example: + +./Focusing Hans410 ProcessRawData-20141219 0 50 2 -400 -200 20 + +A folder named AnalysisResults will be created in a fixed location and a ROOT file will be saved in there. A folder named Figures will be created inside the folder named AnalysisResults, with some monitoring plots. + +If needed, an additional folder can be specified, that will be created inside the folder named AnalysisResults. +*/ + +#include "../Tools/Lib.C" +#include "../Tools/lhcbStyle.C" +#include "../Tools/Style.C" + +#include "../Tools/FindStrip.C" +#include "../Tools/Par.C" + +void Focusing(char *sensor, char *filename, const Float_t firstx, const Float_t lastx, const Float_t stepx, const Float_t firstz, const Float_t lastz, const Float_t stepz, char *externalPath=0); + +Double_t fLeft(Double_t *x, Double_t *par); +Double_t fRight(Double_t *x, Double_t *par); + +int main(int argc, char *argv[]) +{ + getLHCbStyle(); + PersonalStyle(); + + if ((argc == 2) && (string(argv[1]) == "--info")) + { + cout << "**************************************************" << endl; + + cout << "Some comments." << endl; + + cout << "**************************************************" << endl; + + return 0; + } + else if (argc < 9) + { + cout << "**************************************************" << endl; + + cout << "Error! Arguments missing..." << endl; + cout << "Please use the following format:" << endl; + cout << "./Focusing [1] [2] [3] [4] [5] [6] [7] [8] [9]" << endl; + cout << "with:" << endl; + cout << "[1] = Type of sensor (Hans410, ...);" << endl; + cout << "[2] = Filename, excluding the position value and the run type;" << endl; + cout << "[3] = First position along x;" << endl; + cout << "[4] = Last position along x" << endl; + cout << "[5] = Step between two subsequent data acquisitions in x (1 step = 5 microns);" << endl; + cout << "[6] = First position along z;" << endl; + cout << "[7] = Last position along z" << endl; + cout << "[8] = Step between two subsequent data acquisitions in z (1 step = 5 microns);" << endl; + cout << "[9] = Additional folder, optional." << endl; + cout << "Type ./Focusing --info for more information." << endl; + + cout << "**************************************************" << endl; + + return 0; + } + else + { + cout << "Type of sensor: " << argv[1] << endl; + cout << "Filename: " << argv[2] << endl; + cout << "First position along x: " << argv[3] << endl; + cout << "Last position along x: " << argv[4] << endl; + cout << "Step between two subsequent data acquisitions in x: " << argv[5] << endl; + cout << "First position along z: " << argv[6] << endl; + cout << "Last position along z: " << argv[7] << endl; + cout << "Step between two subsequent data acquisitions in z: " << argv[8] << endl; + if (argc == 9) + Focusing(argv[1],argv[2],atoi(argv[3]),atoi(argv[4]),atoi(argv[5]),atoi(argv[6]),atoi(argv[7]),atoi(argv[8])); + else if (argc == 10) + Focusing(argv[1],argv[2],atoi(argv[3]),atoi(argv[4]),atoi(argv[5]),atoi(argv[6]),atoi(argv[7]),atoi(argv[8]),argv[9]); + else + { + cout << "Error! Too many arguments given..." << endl; + + return 0; + } + + return 0; + } +} + +void Focusing(char *sensor, char *filename, const Float_t firstx, const Float_t lastx, const Float_t stepx, const Float_t firstz, const Float_t lastz, const Float_t stepz, char *externalPath) +{ + cout << "**************************************************" << endl; + cout << "Focusing..." << endl; + cout << "**************************************************" << endl; + + // Do not comment this line. + gROOT->ProcessLine("#include "); + + // Do some fanciness to get the directory right. + string inputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensor)+"/Alignment"; + string outputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensor)+"/Focusing"; + if (externalPath!=0) + outputDirectory = string(outputDirectory+"/"+externalPath); + cout << "The input directory is: " << inputDirectory << endl; + cout << "The output directory is: " << outputDirectory << endl; + + // Create the outputDirectory directory if it does not exist. + string path_to_make = "mkdir -p "+outputDirectory; + system(path_to_make.c_str()); + + // Necessary to access the input ROOT files. + ostringstream convertx; + ostringstream convertz; + string tempx; + string tempz; + + cout << "Figures stored in: " << outputDirectory+"/Figures/"+filename << endl; + + // Create a directory named Figures inside the directory named outputDirectory if it does not exist. + string path_to_make_figures = "mkdir -p "+outputDirectory+"/Figures/"+filename; + system(path_to_make_figures.c_str()); + + TString path_to_figures = (string(path_to_make_figures)).substr((string(path_to_make_figures)).find_last_of(' ')+1); + + // Necessary to find the strips hit by the laser. + int strip; + string direction; + + char char_input_ROOT[200]; + string input_ROOT; + string output_ROOT; + + string inputFindStrip; + string outputFindStrip; + + const Int_t stepsx = (Int_t)((lastx-firstx)/stepx+1); + Float_t x[stepsx]; + Float_t mean4ADC[stepsx]; + + const Int_t stepsz = (Int_t)((lastz-firstz)/stepz+1); + Float_t z[stepsz]; + Float_t muLeft[stepsz]; + Float_t sigmaLeft[stepsz]; + Float_t muRight[stepsz]; + Float_t sigmaRight[stepsz]; + + + + // Open output ROOT file. + output_ROOT = outputDirectory+"/Focusing-"+filename+".root"; + TFile *output = TFile::Open(TString(output_ROOT),"RECREATE"); + + TGraph *gcheckAlignment4[stepsz]; + TCanvas *ccheckAlignment4[stepsz]; + + for (Int_t zcounter=0;zcounterGet(Form("hADCPedSub%d",strip)); + TH1D *hist2 = (TH1D *)input->Get(Form("hADCPedSub%d",strip+NSkip)); + TH1D *hist3 = (TH1D *)input->Get(Form("hADCPedSub%d",strip-NSkip)); + TH1D *hist4; + if (direction == "left") + hist4 = (TH1D *)input->Get(Form("hADCPedSub%d",strip-2*NSkip)); + else if (direction == "right") + hist4 = (TH1D *)input->Get(Form("hADCPedSub%d",strip+2*NSkip)); + mean4ADC[xcounter] = hist1->GetMean()+hist2->GetMean()+hist3->GetMean()+hist4->GetMean(); + + // Close input data ROOT files. + input->Close(); + } + + output->cd(); + + for (Int_t xcounter=0;xcounterSetParameter(0,100.); + fitRight->SetParameter(1,80.); + fitRight->SetParameter(2,10.); + fitRight->SetParameter(3,200.); + fitRight->SetParLimits(1,60.,100.); + fitRight->SetParLimits(2,0.,20.); + gcheckAlignment4[zcounter]->Fit(fitRight,"BR"); + + muRight[zcounter] = fitRight->GetParameter(1); + sigmaRight[zcounter] = fitRight->GetParameter(2); + cout << "Right side, z = " << zcounter << ", mu = " << muRight[zcounter] << ", sigma = " << sigmaRight[zcounter] << endl; + + + // Left side. + Float_t minLeft = 140.; + Float_t maxLeft = 240.; + TF1 *fitLeft = new TF1("fitLeft",fLeft,minLeft,maxLeft,4); + fitLeft->SetParameter(0,100.); + fitLeft->SetParameter(1,210.); + fitLeft->SetParameter(2,10.); + fitLeft->SetParameter(3,200.); + fitLeft->SetParLimits(1,200.,240.); + fitLeft->SetParLimits(2,0.,20.); + gcheckAlignment4[zcounter]->Fit(fitLeft,"BR"); + + muLeft[zcounter] = fitLeft->GetParameter(1); + sigmaLeft[zcounter] = fitLeft->GetParameter(2); + cout << "Left side, z = " << zcounter << ", mu = " << muLeft[zcounter] << ", sigma = " << sigmaLeft[zcounter] << endl; + + + + ccheckAlignment4[zcounter] = new TCanvas(Form("ccheckAlignment4-%s-%dz",filename,(int)z[zcounter]),"",400,300); + DrawGraphFunc2(ccheckAlignment4[zcounter],gcheckAlignment4[zcounter],fitRight,fitLeft,"AP",path_to_figures); + + + + } + + + + for (Int_t zcounter=0;zcounterWrite(); + + // Close output ROOT file. + output->Close(); + + return; +} + +// fLeft has four parameters. +Double_t fLeft(Double_t *x, Double_t *par) +{ + return par[0]*(1.-erf((x[0]-par[1])/(sqrt(2.)*par[2])))+par[3]; +} + +// fRight has four parameters. +Double_t fRight(Double_t *x, Double_t *par) +{ +return par[0]*erf((x[0]-par[1])/(sqrt(2.)*par[2]))+par[3]; +} diff --git a/Software/Focusing/Makefile b/Software/Focusing/Makefile new file mode 100755 index 0000000..d993a73 --- /dev/null +++ b/Software/Focusing/Makefile @@ -0,0 +1,34 @@ +# +CC=$(CXX) +glib_cflags=$(shell pkg-config --cflags glib-2.0 gio-2.0) +glib_libs=$(shell pkg-config --libs glib-2.0 gio-2.0) + +ROOTC=$(shell root-config --cflags) +ROOTL=$(shell root-config --libs) +OPT=-g -fno-inline #-std=c++11 +CppFLAGS=$(OPT) -I. $(glib_cflags) +CXXFLAGS=-fPIC $(CppFLAGS) + + +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) + SO=so + SO_FLAGS=-shared + CXXFLAGS += -D LINUX +endif +ifeq ($(UNAME_S),Darwin) + SO=dylib + SO_FLAGS=-dynamiclib -undefined dynamic_lookup -install_name @rpath/$@ + CXXFLAGS += -D OSX +endif + +all: Focusing + +Focusing: Focusing.C + c++ -I$(OPT) $(CXXFLAGS) $(ROOTC) -o $@ $^ $(LDLIBS) $(ROOTL) $(gliblibs) + + +clean: + rm -f *.o Focusing + rm -rf *.dSYM + diff --git a/Software/IVScan/IVScan b/Software/IVScan/IVScan deleted file mode 100755 index 8c511c8..0000000 --- a/Software/IVScan/IVScan +++ /dev/null Binary files differ diff --git a/Software/IVScan/IVScan.C b/Software/IVScan/IVScan.C index c951be3..6910d1d 100644 --- a/Software/IVScan/IVScan.C +++ b/Software/IVScan/IVScan.C @@ -29,7 +29,6 @@ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" #include "../Tools/Style.C" -#include "../Tools/Useful.C" #include "../Tools/Par.C" diff --git a/Software/IVScan/IVScan.C~ b/Software/IVScan/IVScan.C~ deleted file mode 100644 index cbe4171..0000000 --- a/Software/IVScan/IVScan.C~ +++ /dev/null @@ -1,305 +0,0 @@ -//************************************************ -// Author: Federica Lionetto -// Created on: 20/11/2014 -//************************************************ - -/* -IVScan reads two text files (containing the bias voltage and the current values) and creates a ROOT file with the following information: -- current as a function of the bias voltage. - -Compile with: - -make - -Run with: - -./IVScan [input text file 1] [input text file 2] [additional folder] - -where - -- [input text file 1] is the complete path, including the folder and the filename, of the text file one wants to process (increasing bias voltage); -- [input text file 2] is the complete path, including the folder and the filename, of the text file one wants to process (decreasing bias voltage); -- [additional folder] is the optional additional folder where the output will be saved. - -A folder named AnalysisResults will be created in a fixed location and a ROOT file will be saved in there. A folder named Figures will be created inside the folder named AnalysisResults, with some monitoring plots. - -If needed, an additional folder can be specified, that will be created inside the folder named AnalysisResults. -*/ - -#include "../Tools/Lib.C" -#include "../Tools/lhcbStyle.C" -#include "../Tools/Style.C" -#include "../Tools/Useful.C" - -#include "../Tools/Par.C" - -void IVScan(char *filename1, char *filename2, char *externalPath=0); - -int main(int argc, char *argv[]) -{ - getLHCbStyle(); - PersonalStyle(); - - if ((argc ==2) && (string(argv[1]) == "--info")) - { - cout << "**************************************************" << endl; - - cout << "Some comments." << endl; - - cout << "**************************************************" << endl; - - return 0; - } - else if (argc < 3) - { - cout << "**************************************************" << endl; - - cout << "Error! Input files missing..." << endl; - cout << "Please use the following format:" << endl; - cout << "./IVScan [1] [2] [3]" << endl; - cout << "with:" << endl; - cout << "[1] = Input text file 1, complete path (increasing bias voltage);" << endl; - cout << "[2] = Input text file 2, complete path (decreasing bias voltage);" << endl; - cout << "[3] = Additional folder, optional." << endl; - cout << "Type ./IVScan --info for more information." << endl; - - cout << "**************************************************" << endl; - - return 0; - } - else - { - cout << "File 1 to process: " << argv[1] << endl; - cout << "File 2 to process: " << argv[2] << endl; - if (argc == 3) - IVScan(argv[1],argv[2]); - else if (argc == 4) - IVScan(argv[1],argv[2],argv[3]); - else - { - cout << "Error! Too many arguments given..." << endl; - - return 0; - } - - return 0; - } -} - -void IVScan(char *filename1, char *filename2, char *externalPath) -{ - cout << "**************************************************" << endl; - cout << "Working on the IV scan..." << endl; - cout << "**************************************************" << endl; - - // Do not comment this line. - gROOT->ProcessLine("#include "); - - int found; - - string filename1_as_string = string(filename1); - // Check that the filename provided corresponds to a text file. - found = filename1_as_string.find(".dat"); - if (found==string::npos) { - cout << "Error! The filename provided is not associated to a text file." << endl; - return; - } - - string filename2_as_string = string(filename2); - // Check that the filename provided corresponds to a text file. - found = filename2_as_string.find(".dat"); - if (found==string::npos) { - cout << "Error! The filename provided is not associated to a text file." << endl; - return; - } - - // Open input text file. - ifstream datFile; - std::string line; - - // Number of rows to be read from the text files. - int rows1; - int rows2; - - // Open file 1. - // Determine number of rows to be read from the text file. - datFile.open(filename1_as_string.c_str()); - if (datFile.is_open()) { - rows1 = 0; - while (getline(datFile,line)) - rows1++; - cout << "Number of rows in the input text file 1: " << rows1 << endl; - datFile.close(); - } - else - { - cout << "Unable to open file." << endl; - return; - } - - // Open file 2. - // Determine number of rows to be read from the text file. - datFile.open(filename2_as_string.c_str()); - if (datFile.is_open()) { - rows2 = 0; - while (getline(datFile,line)) - rows2++; - cout << "Number of rows in the input text file 2: " << rows2 << endl; - datFile.close(); - } - else - { - cout << "Unable to open file." << endl; - return; - } - - // Read the text file. - // Remember that the first row must be skipped. - float V; - float I; - float IErr; - - Int_t i; - - // Read text file 1. - vector vV1; - vector vI1; - vector vVErr1; - vector vIErr1; - - // Save information. - datFile.open(filename1_as_string.c_str()); - if (datFile.is_open()) { - i = 0; - while (getline(datFile,line)) { - if (i>0) { - // cout << line << endl; - istringstream iss(line); - iss >> V >> I >> IErr; - vV1.push_back(V); - vI1.push_back(I); - vVErr1.push_back(0.); - vIErr1.push_back(IErr); - } - i++; - } - datFile.close(); - } - else - { - cout << "Unable to open file." << endl; - return; - } - - float *aV1 = &vV1[0]; - float *aI1 = &vI1[0]; - float *aVErr1 = &vVErr1[0]; - float *aIErr1 = &vIErr1[0]; - - /* - cout << aV1[0] << endl; - cout << aV1[1] << endl; - cout << aI1[0] << endl; - cout << aI1[1] << endl; - cout << aVErr1[0] << endl; - cout << aVErr1[1] << endl; - cout << aIErr1[0] << endl; - cout << aIErr1[1] << endl; - */ - - // Read text file 2. - vector vV2; - vector vI2; - vector vVErr2; - vector vIErr2; - - // Save information. - datFile.open(filename2_as_string.c_str()); - if (datFile.is_open()) { - i = 0; - while (getline(datFile,line)) { - if (i>0) { - // cout << line << endl; - istringstream iss(line); - iss >> V >> I >> IErr; - vV2.push_back(V); - vI2.push_back(I); - vVErr2.push_back(0.); - vIErr2.push_back(IErr); - } - i++; - } - datFile.close(); - } - else - { - cout << "Unable to open file." << endl; - return; - } - - float *aV2 = &vV2[0]; - float *aI2 = &vI2[0]; - float *aVErr2 = &vVErr2[0]; - float *aIErr2 = &vIErr2[0]; - - /* - cout << aV2[0] << endl; - cout << aV2[1] << endl; - cout << aI2[0] << endl; - cout << aI2[1] << endl; - cout << aVErr2[0] << endl; - cout << aVErr2[1] << endl; - cout << aIErr2[0] << endl; - cout << aIErr2[1] << endl; - */ - - // Do some fanciness to get the directory right. - string analysis = "/home/hep/flionett/TestStand/AnalysisResults"; - if (externalPath!=0) - analysis = string(analysis+"/"+externalPath); - - string filename_as_string_no_path = filename1_as_string.substr(filename1_as_string.find_last_of('/')+1); - string filename_as_string_no_path_no_extension = filename_as_string_no_path.substr(0,filename_as_string_no_path.length()-18); - - // Create a folder named AnalysisResults. Do not worry, nothing bad is going to happen if the folder already exists. - string path_to_make = "mkdir -p "+analysis; - system(path_to_make.c_str()); - cout << "Setting output to: " << path_to_make << endl; - - // Create a folder named Figures inside the folder named AnalysisResults. - string path_to_make_figures = "mkdir "+analysis+"/Figures"; - system(path_to_make_figures.c_str()); - path_to_make_figures = "mkdir "+analysis+"/Figures"+"/IVScan"; - system(path_to_make_figures.c_str()); - path_to_make_figures = "mkdir "+analysis+"/Figures"+"/IVScan"+"/"+filename_as_string_no_path_no_extension; - system(path_to_make_figures.c_str()); - cout << "Setting figures to: " << path_to_make_figures << endl; - - TString path_to_figures = (string(path_to_make_figures)).substr((string(path_to_make_figures)).find_last_of(' ')+1); - - // Open output ROOT file. - TFile *output = TFile::Open(analysis+"/IVScan-"+TString(filename_as_string_no_path_no_extension)+".root","RECREATE"); - - TCanvas *cIVScan = new TCanvas("cIVScan","",400,300); - - int rowsData1 = rows1-1; - int rowsData2 = rows2-1; - - TGraphErrors *gIVScan1 = new TGraphErrors(rowsData1,aV1,aI1,aVErr1,aIErr1); - - InitGraphErrors(gIVScan1,"IV scan","Bias voltage (V)","Current (#muA)"); - DrawGraphErrors(cIVScan,gIVScan1,"AP",path_to_figures); - - output->Close(); - - // Add 2 and TMultiGraph. - - - - - - - - - return; -} diff --git a/Software/IVScan/Makefile~ b/Software/IVScan/Makefile~ deleted file mode 100755 index 47be985..0000000 --- a/Software/IVScan/Makefile~ +++ /dev/null @@ -1,34 +0,0 @@ -# -CC=$(CXX) -glib_cflags=$(shell pkg-config --cflags glib-2.0 gio-2.0) -glib_libs=$(shell pkg-config --libs glib-2.0 gio-2.0) - -ROOTC=$(shell root-config --cflags) -ROOTL=$(shell root-config --libs) -OPT=-g -fno-inline #-std=c++11 -CppFLAGS=$(OPT) -I. $(glib_cflags) -CXXFLAGS=-fPIC $(CppFLAGS) - - -UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Linux) - SO=so - SO_FLAGS=-shared - CXXFLAGS += -D LINUX -endif -ifeq ($(UNAME_S),Darwin) - SO=dylib - SO_FLAGS=-dynamiclib -undefined dynamic_lookup -install_name @rpath/$@ - CXXFLAGS += -D OSX -endif - -all: IV - -IV: IV.C - c++ -I$(OPT) $(CXXFLAGS) $(ROOTC) -o $@ $^ $(LDLIBS) $(ROOTL) $(gliblibs) - - -clean: - rm -f *.o IV - rm -rf *.dSYM - diff --git a/Software/LaserDelayScan/LaserDelayScan.C b/Software/LaserDelayScan/LaserDelayScan.C index fa059f7..00612af 100644 --- a/Software/LaserDelayScan/LaserDelayScan.C +++ b/Software/LaserDelayScan/LaserDelayScan.C @@ -28,7 +28,6 @@ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" #include "../Tools/Style.C" -#include "../Tools/Useful.C" #include "../Tools/Par.C" diff --git a/Software/ProcessRawData/ProcessRawData.C b/Software/ProcessRawData/ProcessRawData.C index 5cc9669..5ef3c1c 100644 --- a/Software/ProcessRawData/ProcessRawData.C +++ b/Software/ProcessRawData/ProcessRawData.C @@ -32,7 +32,6 @@ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" #include "../Tools/Style.C" -#include "../Tools/Useful.C" #include "../Tools/Par.C" @@ -99,7 +98,8 @@ gROOT->ProcessLine("#include "); // Do some fanciness to get the directory right. - string analysis = "/home/hep/flionett/TestStand/AnalysisResults"; + // string analysis = "/home/hep/flionett/TestStand/AnalysisResults"; + string analysis = "/disk/groups/hep/flionett/TestStand/AnalysisResults"; if (externalPath!=0) analysis = string(analysis+"/"+externalPath); diff --git a/Software/PulseShapevsV/PulseShapevsV b/Software/PulseShapevsV/PulseShapevsV deleted file mode 100755 index 699dffb..0000000 --- a/Software/PulseShapevsV/PulseShapevsV +++ /dev/null Binary files differ diff --git a/Software/PulseShapevsV/PulseShapevsV.C b/Software/PulseShapevsV/PulseShapevsV.C index 7db37f7..d1cccd2 100644 --- a/Software/PulseShapevsV/PulseShapevsV.C +++ b/Software/PulseShapevsV/PulseShapevsV.C @@ -30,7 +30,6 @@ #include "../Tools/Lib.C" #include "../Tools/lhcbStyle.C" #include "../Tools/Style.C" -#include "../Tools/Useful.C" #include "../Tools/Par.C" diff --git a/Software/Tools/FindStrip.C b/Software/Tools/FindStrip.C index 8f29b54..2ab4f37 100644 --- a/Software/Tools/FindStrip.C +++ b/Software/Tools/FindStrip.C @@ -18,7 +18,6 @@ #include "lhcbStyle.C" #include "Style.C" #include "Par.C" -#include "Useful.C" void FindStrip(string inputFilename, string outputFilename, TString path_to_figures, int *strip, string *direction); diff --git a/Software/Tools/Style.C b/Software/Tools/Style.C index 7c8921a..c424e6e 100644 --- a/Software/Tools/Style.C +++ b/Software/Tools/Style.C @@ -47,6 +47,10 @@ void DrawGraphErrors(TCanvas *canvas, TGraphErrors *graph, TString option = "APC", TString folder = ""); +void DrawGraphFunc(TCanvas *canvas, TGraph *graph, TF1 *func, TString option = "APC", TString folder = ""); + +void DrawGraphFunc2(TCanvas *canvas, TGraph *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 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); @@ -464,6 +468,70 @@ return; } +// DrawGraphFunc 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 DrawGraphFunc(TCanvas *canvas, TGraph *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(2); + gPad->Modified(); + canvas->Update(); + canvas->Write(); + name = path + "/" + name + ".pdf"; + canvas->SaveAs(name); + canvas->Close(); + + return; +} + +// DrawGraphFunc2 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 DrawGraphFunc2(TCanvas *canvas, TGraph *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 folder) { TString path; diff --git a/Software/Tools/Useful.C b/Software/Tools/Useful.C deleted file mode 100644 index cbe6bf7..0000000 --- a/Software/Tools/Useful.C +++ /dev/null @@ -1,35 +0,0 @@ -//************************************************ -// Author: Federica Lionetto -// Created on: 06/11/2014 -//************************************************ - -/* -List of useful tools. -*/ - -// Header guard. -#ifndef __USEFUL_C_INCLUDED__ -#define __USEFUL_C_INCLUDED__ - -#include "Lib.C" - -//************************************************ -// -// Declarations. -// - -// bool file_exists(const char *filename); - -//************************************************ -// -// Definitions. -// - -/* -bool file_exists(const char *filename) { - ifstream ifile(filename); - return ifile; -} -*/ - -#endif