diff --git a/Software/AutomatedMeasurements/ElectronicMonkeyCCEScan.py b/Software/AutomatedMeasurements/ElectronicMonkeyCCEScan.py index 5ffbef1..d48742f 100644 --- a/Software/AutomatedMeasurements/ElectronicMonkeyCCEScan.py +++ b/Software/AutomatedMeasurements/ElectronicMonkeyCCEScan.py @@ -149,7 +149,7 @@ 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" +configped = config+"/FocusingConfig"+sensor printcommand = "echo alibava-gui --no-gui --nevts="+str(nevents)+" --out="+filename+" --pedestal "+configped command = "alibava-gui --no-gui --nevts="+str(nevents)+" --out="+filename+" --pedestal "+configped diff --git a/Software/CCE/CCE.C b/Software/CCE/CCE.C index cb3479d..1686612 100644 --- a/Software/CCE/CCE.C +++ b/Software/CCE/CCE.C Binary files differ diff --git a/Software/Monitoring/PlotTrends.C b/Software/Monitoring/PlotTrends.C index cf29651..caaf513 100644 --- a/Software/Monitoring/PlotTrends.C +++ b/Software/Monitoring/PlotTrends.C @@ -5,35 +5,35 @@ /* -PlotTrends creates a ROOT file with temperature, relative humidity, and dew point trends. + PlotTrends creates a ROOT file with temperature, relative humidity, and dew point trends. -Compile with: + Compile with: -make + make -Run with: + Run with: -./PlotTrends [sensor] [from] [to] [additional folder] + ./PlotTrends [sensor] [from] [to] [additional folder] -where + where -- [sensor] is the type of sensor (Hans410, ...); -- [from] is the optional starting time from which one wants to display the trends, according to the "ddd mmm d hh:mm:ss yyyy" format; -- [to] is the optional stopping time to which one wants to display the trends, according to the "ddd mmm d hh:mm:ss yyyy" format; -- [additional folder] is the optional additional folder where the output will be saved. + - [sensor] is the type of sensor (Hans410, ...); + - [from] is the optional starting time from which one wants to display the trends, according to the "ddd mmm d hh:mm:ss yyyy" format; + - [to] is the optional stopping time to which one wants to display the trends, according to the "ddd mmm d hh:mm:ss yyyy" format; + - [additional folder] is the optional additional folder where the output will be saved. -For example: + For example: -./PlotTrends Hans320 + ./PlotTrends Hans320 -or + or -./PlotTrends Hans320 "Thu Apr 9 16:55:00 2015" "Thu Apr 9 16:55:52 2015" + ./PlotTrends Hans320 "Thu Apr 9 16:55:00 2015" "Thu Apr 9 16:55:52 2015" -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. + 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. -*/ + If needed, an additional folder can be specified, that will be created inside the folder named AnalysisResults. + */ #include "../Tools/Lib.C" #include "../Tools/UsefulFunctions.C" @@ -49,491 +49,491 @@ int main(int argc, char *argv[]) { - getLHCbStyle(); - PersonalStyle(); + getLHCbStyle(); + PersonalStyle(); - if ((argc ==2) && (string(argv[1]) == "--info")) - { - cout << "**************************************************" << endl; - - cout << "PlotTrends creates a ROOT file with temperature, relative humidity, and dew point trends." << endl; - - cout << "Compile with:" << endl; - - cout << "make" << endl; - - cout << "Run with:" << endl; - - cout << "./PlotTrends [sensor] [from] [to] [additional folder]" << endl; - - cout << "where" << endl; - - cout << "- [sensor] is the type of sensor (Hans410, ...);" << endl; - cout << "- [from] is the optional starting time from which one wants to display the trends, according to the 'ddd mmm d hh:mm:ss yyyy' format;" << endl; - cout << "- [to] is the optional stopping time to which one wants to display the trends, according to the 'ddd mmm d hh:mm:ss yyyy' format;" << endl; - cout << "- [additional folder] is the optional additional folder where the output will be saved." << endl; - - cout << "For example:" << endl; - - cout << "./PlotTrends Hans320" << endl; - - cout << "or" << endl; - - cout << "./PlotTrends Hans320 'Thu Apr 9 16:55:00 2015' 'Thu Apr 9 16:55:52 2015'" << endl; - - cout << "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." << endl; - - cout << "If needed, an additional folder can be specified, that will be created inside the folder named AnalysisResults." << endl; - - cout << "**************************************************" << endl; - - return 0; - } - else if (argc < 2) - { - cout << "**************************************************" << endl; - - cout << "Error! Input information missing..." << endl; - cout << "Please use the following format:" << endl; - cout << "./PlotTrends [1] [2] [3] [4]" << endl; - cout << "with:" << endl; - cout << "[1] = Type of sensor (Hans410, ...);" << endl; - cout << "[2] = Starting time, optional;" << endl; - cout << "[3] = Stopping time, optional;" << endl; - cout << "[4] = Additional folder, optional." << endl; - cout << "Type ./PlotTrends --info for more information." << endl; - - cout << "**************************************************" << endl; - - return 0; - } - else - { - cout << "Type of sensor: " << argv[1] << endl; - if (argc == 2) - PlotTrends(argv[1]); - else if (argc == 3) + if ((argc ==2) && (string(argv[1]) == "--info")) { - cout << "**************************************************" << endl; + cout << "**************************************************" << endl; - cout << "Error! Stopping time not specified..." << endl; - - cout << "**************************************************" << endl; - - return 0; + cout << "PlotTrends creates a ROOT file with temperature, relative humidity, and dew point trends." << endl; + + cout << "Compile with:" << endl; + + cout << "make" << endl; + + cout << "Run with:" << endl; + + cout << "./PlotTrends [sensor] [from] [to] [additional folder]" << endl; + + cout << "where" << endl; + + cout << "- [sensor] is the type of sensor (Hans410, ...);" << endl; + cout << "- [from] is the optional starting time from which one wants to display the trends, according to the 'ddd mmm d hh:mm:ss yyyy' format;" << endl; + cout << "- [to] is the optional stopping time to which one wants to display the trends, according to the 'ddd mmm d hh:mm:ss yyyy' format;" << endl; + cout << "- [additional folder] is the optional additional folder where the output will be saved." << endl; + + cout << "For example:" << endl; + + cout << "./PlotTrends Hans320" << endl; + + cout << "or" << endl; + + cout << "./PlotTrends Hans320 'Thu Apr 9 16:55:00 2015' 'Thu Apr 9 16:55:52 2015'" << endl; + + cout << "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." << endl; + + cout << "If needed, an additional folder can be specified, that will be created inside the folder named AnalysisResults." << endl; + + cout << "**************************************************" << endl; + + return 0; } - else if (argc == 4) + else if (argc < 2) { - cout << "Starting time: " << argv[2] << endl; - cout << "Stopping time: " << argv[3] << endl; - PlotTrends(argv[1],argv[2],argv[3]); - } - else if (argc == 5) - { - cout << "Staring time: " << argv[2] << endl; - cout << "Stopping time: " << argv[3] << endl; - cout << "Additional folder: " << argv[4] << endl; - PlotTrends(argv[1],argv[2],argv[3],argv[4]); + cout << "**************************************************" << endl; + + cout << "Error! Input information missing..." << endl; + cout << "Please use the following format:" << endl; + cout << "./PlotTrends [1] [2] [3] [4]" << endl; + cout << "with:" << endl; + cout << "[1] = Type of sensor (Hans410, ...);" << endl; + cout << "[2] = Starting time, optional;" << endl; + cout << "[3] = Stopping time, optional;" << endl; + cout << "[4] = Additional folder, optional." << endl; + cout << "Type ./PlotTrends --info for more information." << endl; + + cout << "**************************************************" << endl; + + return 0; } else { - cout << "Error! Too many arguments given..." << endl; - - return 0; - } - - return 0; - } + cout << "Type of sensor: " << argv[1] << endl; + if (argc == 2) + PlotTrends(argv[1]); + else if (argc == 3) + { + cout << "**************************************************" << endl; + + cout << "Error! Stopping time not specified..." << endl; + + cout << "**************************************************" << endl; + + return 0; + } + else if (argc == 4) + { + cout << "Starting time: " << argv[2] << endl; + cout << "Stopping time: " << argv[3] << endl; + PlotTrends(argv[1],argv[2],argv[3]); + } + else if (argc == 5) + { + cout << "Staring time: " << argv[2] << endl; + cout << "Stopping time: " << argv[3] << endl; + cout << "Additional folder: " << argv[4] << endl; + PlotTrends(argv[1],argv[2],argv[3],argv[4]); + } + else + { + cout << "Error! Too many arguments given..." << endl; + + return 0; + } + + return 0; + } } void PlotTrends(char *sensor, char *from, char *to, char *externalPath) { - cout << "**************************************************" << endl; - cout << "Plotting trends..." << endl; - cout << "**************************************************" << endl; + cout << "**************************************************" << endl; + cout << "Plotting trends..." << endl; + cout << "**************************************************" << endl; - // Do not comment this line. - gROOT->ProcessLine("#include "); + // Do not comment this line. + gROOT->ProcessLine("#include "); - // Adjust time format for output ROOT file and figures. - string s_from = ""; - string s_to = ""; - - struct tm tm_from; - time_t t_from; + // Adjust time format for output ROOT file and figures. + string s_from = ""; + string s_to = ""; - struct tm tm_to; - time_t t_to; + struct tm tm_from; + time_t t_from; - if ((from != 0) && (to != 0)) - { - s_from = string(from); - s_to = string(to); + struct tm tm_to; + time_t t_to; - // Remove white spaces from s_from and s_to. - s_from.erase(remove(s_from.begin(), s_from.end(), ' '), s_from.end()); - s_to.erase(remove(s_to.begin(), s_to.end(), ' '), s_to.end()); - - // Convert the string with date and time to something that is interpreted as date and time. tm_from is a tm object, t_from is a time_t object and corresponds to the number of seconds since epoch. The format specifier %c stands for date and time representation. - - memset(&tm_from, 0, sizeof(struct tm)); - strptime(from,"%c",&tm_from); - t_from = mktime(&tm_from); - - /* - cout << tm_from.tm_year << endl; - cout << t_from << endl; - */ - - memset(&tm_to, 0, sizeof(struct tm)); - strptime(to,"%c",&tm_to); - t_to = mktime(&tm_to); - - /* - cout << tm_to.tm_year << endl; - cout << t_to << endl; - */ - - // Check that the starting time is earlier than the stopping time. - if (t_from >= t_to) + if ((from != 0) && (to != 0)) { - cout << "Error! Starting time earlier than stopping time..." << endl; - return; + s_from = string(from); + s_to = string(to); + + // Remove white spaces from s_from and s_to. + s_from.erase(remove(s_from.begin(), s_from.end(), ' '), s_from.end()); + s_to.erase(remove(s_to.begin(), s_to.end(), ' '), s_to.end()); + + // Convert the string with date and time to something that is interpreted as date and time. tm_from is a tm object, t_from is a time_t object and corresponds to the number of seconds since epoch. The format specifier %c stands for date and time representation. + + memset(&tm_from, 0, sizeof(struct tm)); + strptime(from,"%c",&tm_from); + t_from = mktime(&tm_from); + + /* + cout << tm_from.tm_year << endl; + cout << t_from << endl; + */ + + memset(&tm_to, 0, sizeof(struct tm)); + strptime(to,"%c",&tm_to); + t_to = mktime(&tm_to); + + /* + cout << tm_to.tm_year << endl; + cout << t_to << endl; + */ + + // Check that the starting time is earlier than the stopping time. + if (t_from >= t_to) + { + cout << "Error! Starting time earlier than stopping time..." << endl; + return; + } } - } - // Do some fanciness to get the directory right. - string inputDirectory = "/disk/groups/hep/flionett/TestStand/Data/"+string(sensor)+"/Monitoring"; - string outputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensor)+"/Monitoring"; - if (externalPath!=0) - outputDirectory = string(outputDirectory+"/"+externalPath); - cout << "The input directory is: " << inputDirectory << endl; - cout << "The output directory is: " << outputDirectory << endl; + // Do some fanciness to get the directory right. + string inputDirectory = "/disk/groups/hep/flionett/TestStand/Data/"+string(sensor)+"/Monitoring"; + string outputDirectory = "/disk/groups/hep/flionett/TestStand/AnalysisResults/"+string(sensor)+"/Monitoring"; + 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()); + // Create the outputDirectory directory if it does not exist. + string path_to_make = "mkdir -p "+outputDirectory; + system(path_to_make.c_str()); - cout << "Figures stored in: " << outputDirectory+"/Figures" << endl; + cout << "Figures stored in: " << outputDirectory+"/Figures" << 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"; - if ((from != 0) && (to != 0)) - path_to_make_figures = path_to_make_figures+"/PlotTrends-"+"from"+s_from+"to"+s_to; - else - path_to_make_figures = path_to_make_figures+"/PlotTrends-all"; - system(path_to_make_figures.c_str()); + // Create a directory named Figures inside the directory named outputDirectory if it does not exist. + string path_to_make_figures = "mkdir -p "+outputDirectory+"/Figures"; + if ((from != 0) && (to != 0)) + path_to_make_figures = path_to_make_figures+"/PlotTrends-"+"from"+s_from+"to"+s_to; + else + path_to_make_figures = path_to_make_figures+"/PlotTrends-all"; + 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); + TString path_to_figures = (string(path_to_make_figures)).substr((string(path_to_make_figures)).find_last_of(' ')+1); - TDatime *time; - vector vtime; + TDatime *time; + vector vtime; - double T; - vector vT; + double T; + vector vT; - double RH; - vector vRH; + double RH; + vector vRH; - double DP; - vector vDP; + double DP; + vector vDP; - string trash1; - string trash2; - string trash3; - string trash4; - string trash5; + string trash1; + string trash2; + string trash3; + string trash4; + string trash5; - // Given starting and stopping time, find the corresponding input text files. - vector list_of_files; - vector list_of_selected_files; + // Given starting and stopping time, find the corresponding input text files. + vector list_of_files; + vector list_of_selected_files; - list_of_files = open(inputDirectory); - if ((from != 0) && (to != 0)) - list_of_selected_files = SelectFiles(inputDirectory, list_of_files, t_from, t_to); - else - list_of_selected_files = list_of_files; + list_of_files = open(inputDirectory); + if ((from != 0) && (to != 0)) + list_of_selected_files = SelectFiles(inputDirectory, list_of_files, t_from, t_to); + else + list_of_selected_files = list_of_files; - if (list_of_selected_files.size() == 0) { - cout << "Error! No input text file selected..." << endl; + if (list_of_selected_files.size() == 0) { + cout << "Error! No input text file selected..." << endl; + return; + } + + ifstream file; + string header; + string line; + struct tm tm_time_in_line; + time_t t_time_in_line; + + // Read data from selected input text files. + for (vector::const_iterator i = list_of_selected_files.begin(); i != list_of_selected_files.end(); ++i) + { + // Open file. + cout << "Selected input text file #" << i-list_of_selected_files.begin() << ": " << *i << endl; + file.open((inputDirectory+"/"+*i).c_str()); + if (file.is_open()) + { + // cout << "Great! File opened..." << endl; + + // Skip header. + if (getline(file,header)) + { + // Read time in each line. + while (getline(file,line)) + { + memset(&tm_time_in_line, 0, sizeof(struct tm)); + strptime(line.c_str(),"%c",&tm_time_in_line); + t_time_in_line = mktime(&tm_time_in_line); + + if ((from != 0) && (to != 0)) + { + if ((t_time_in_line <= t_to) && (t_time_in_line >= t_from)) + { + // cout << "Time in line: " << t_time_in_line << " from epoch time" << endl; + time = new TDatime(tm_time_in_line.tm_year,tm_time_in_line.tm_mon+1,tm_time_in_line.tm_mday,tm_time_in_line.tm_hour+1,tm_time_in_line.tm_min,tm_time_in_line.tm_sec); + // cout << "Time going in the ROOT file: " << time->Convert() << endl; + // Get time, temperature, humidity, and dew point. + istringstream iss(line); + iss >> trash1 >> trash2 >> trash3 >> trash4 >> trash5 >> T >> RH >> DP; + vtime.push_back(time->Convert()); + vT.push_back(T); + vRH.push_back(RH); + vDP.push_back(DP); + } + } + else + { + // cout << "Time in line: " << t_time_in_line << " from epoch time" << endl; + time = new TDatime(tm_time_in_line.tm_year,tm_time_in_line.tm_mon+1,tm_time_in_line.tm_mday,tm_time_in_line.tm_hour+1,tm_time_in_line.tm_min,tm_time_in_line.tm_sec); + // cout << "Time going in the ROOT file: " << time->Convert() << endl; + // Get time, temperature, humidity, and dew point. + istringstream iss(line); + iss >> trash1 >> trash2 >> trash3 >> trash4 >> trash5 >> T >> RH >> DP; + vtime.push_back(time->Convert()); + vT.push_back(T); + vRH.push_back(RH); + vDP.push_back(DP); + } + } + } + else + { + cout << "Error! Unable to read header..." << endl; + // return; + } + + // Close file. + file.close(); + } + else { + cout << "Error! Unable to open file." << endl; // To be modified to stop everything if there is a problem. + // return; + } + } + + double *aT = &vT[0]; + double *aRH = &vRH[0]; + double *aDP = &vDP[0]; + double *atime = &vtime[0]; + + /* + cout << vT.size() << endl; + cout << vtime.size() << endl; + + cout << vT[0] << endl; + cout << vtime[0] << endl; + + cout << vT[10] << endl; + cout << vtime[10] << endl; + */ + + // Open output ROOT file. + string output_ROOT; + if ((from != 0) && (to !=0)) + output_ROOT = outputDirectory+"/PlotTrends-"+"from"+s_from+"to"+s_to+".root"; + else + output_ROOT = outputDirectory+"/PlotTrends-all.root"; + TFile *output = TFile::Open(TString(output_ROOT),"RECREATE"); + + // Temperature trends. + TCanvas *cT = new TCanvas("PlotTrends-T","",400,300); + + cT->SetLeftMargin(0.1363636); + cT->SetRightMargin(0.08808081); + cT->SetBottomMargin(0.2095588); + + TGraph *gT = new TGraph(vT.size(),atime,aT); + InitGraph(gT,"Temperature trends","Time","Temperature (#circC)"); + gT->GetXaxis()->SetTimeDisplay(1); + gT->GetXaxis()->SetLabelOffset(0.04); + gT->GetXaxis()->SetTitleOffset(1.50); + gT->GetYaxis()->SetTitleOffset(0.95); + gT->GetXaxis()->SetTimeFormat("#splitline{%Y-%m-%d}{%H:%M:%S}"); + gT->GetXaxis()->SetNdivisions(-503); + gT->GetXaxis()->SetTimeOffset(0,"gmt"); + DrawGraph(cT,gT,"AP",path_to_figures); + + // Relative humidity trends. + TCanvas *cRH = new TCanvas("PlotTrends-RH","",400,300); + + cRH->SetLeftMargin(0.1363636); + cRH->SetRightMargin(0.08808081); + cRH->SetBottomMargin(0.2095588); + + TGraph *gRH = new TGraph(vRH.size(),atime,aRH); + InitGraph(gRH,"Relative humidity trends","Time","Relative humidity (%)"); + gRH->GetXaxis()->SetTimeDisplay(1); + gRH->GetXaxis()->SetLabelOffset(0.04); + gRH->GetXaxis()->SetTitleOffset(1.50); + gRH->GetYaxis()->SetTitleOffset(0.95); + gRH->GetXaxis()->SetTimeFormat("#splitline{%Y-%m-%d}{%H:%M:%S}"); + gRH->GetXaxis()->SetNdivisions(-503); + gRH->GetXaxis()->SetTimeOffset(0,"gmt"); + DrawGraph(cRH,gRH,"AP",path_to_figures); + + // Dew point trends. + TCanvas *cDP = new TCanvas("PlotTrends-DP","",400,300); + + cDP->SetLeftMargin(0.1363636); + cDP->SetRightMargin(0.08808081); + cDP->SetBottomMargin(0.2095588); + + TGraph *gDP = new TGraph(vDP.size(),atime,aDP); + InitGraph(gDP,"Dew point trends","Time","Dew point (#circC)"); + gDP->GetXaxis()->SetTimeDisplay(1); + gDP->GetXaxis()->SetLabelOffset(0.04); + gDP->GetXaxis()->SetTitleOffset(1.50); + gDP->GetYaxis()->SetTitleOffset(0.95); + gDP->GetXaxis()->SetTimeFormat("#splitline{%Y-%m-%d}{%H:%M:%S}"); + gDP->GetXaxis()->SetNdivisions(-503); + gDP->GetXaxis()->SetTimeOffset(0,"gmt"); + DrawGraph(cDP,gDP,"AP",path_to_figures); + + // Temperature and dew point trends. + TCanvas *cTandDP = new TCanvas("PlotTrends-TandDP","",400,300); + + cTandDP->SetLeftMargin(0.1363636); + cTandDP->SetRightMargin(0.08808081); + cTandDP->SetBottomMargin(0.2095588); + + TMultiGraph *mgTandDP = new TMultiGraph(); + + gT->SetMarkerColor(kGreen); + gT->SetLineColor(kGreen); + gDP->SetMarkerColor(kRed); + gDP->SetLineColor(kRed); + + TLegend *legTandDP = CreateLegend2(gT,"temperature",gDP,"dew point","lpw",0.63,0.59,0.88,0.84); + + mgTandDP->Add(gT); + mgTandDP->Add(gDP); + + cTandDP->cd(); + mgTandDP->Draw("AP"); + + mgTandDP->GetXaxis()->SetTimeDisplay(1); + mgTandDP->GetXaxis()->SetLabelOffset(0.04); + mgTandDP->GetXaxis()->SetTitleOffset(1.50); + mgTandDP->GetYaxis()->SetTitleOffset(0.95); + mgTandDP->GetXaxis()->SetTimeFormat("#splitline{%Y-%m-%d}{%H:%M:%S}"); + mgTandDP->GetXaxis()->SetNdivisions(-503); + mgTandDP->GetXaxis()->SetTimeOffset(0,"gmt"); + + DrawGraphCompare(cTandDP,mgTandDP,legTandDP,"Temperature and dew point trends","Time","Temperature (#circC)","AP",path_to_figures); + + + + // Write output ROOT file. + output->Write(); + + // Close output ROOT file. + output->Close(); + return; - } - - ifstream file; - string header; - string line; - struct tm tm_time_in_line; - time_t t_time_in_line; - - // Read data from selected input text files. - for (vector::const_iterator i = list_of_selected_files.begin(); i != list_of_selected_files.end(); ++i) - { - // Open file. - cout << "Selected input text file #" << i-list_of_selected_files.begin() << ": " << *i << endl; - file.open((inputDirectory+"/"+*i).c_str()); - if (file.is_open()) - { - // cout << "Great! File opened..." << endl; - - // Skip header. - if (getline(file,header)) - { - // Read time in each line. - while (getline(file,line)) - { - memset(&tm_time_in_line, 0, sizeof(struct tm)); - strptime(line.c_str(),"%c",&tm_time_in_line); - t_time_in_line = mktime(&tm_time_in_line); - - if ((from != 0) && (to != 0)) - { - if ((t_time_in_line <= t_to) && (t_time_in_line >= t_from)) - { - // cout << "Time in line: " << t_time_in_line << " from epoch time" << endl; - time = new TDatime(tm_time_in_line.tm_year,tm_time_in_line.tm_mon+1,tm_time_in_line.tm_mday,tm_time_in_line.tm_hour+1,tm_time_in_line.tm_min,tm_time_in_line.tm_sec); - // cout << "Time going in the ROOT file: " << time->Convert() << endl; - // Get time, temperature, humidity, and dew point. - istringstream iss(line); - iss >> trash1 >> trash2 >> trash3 >> trash4 >> trash5 >> T >> RH >> DP; - vtime.push_back(time->Convert()); - vT.push_back(T); - vRH.push_back(RH); - vDP.push_back(DP); - } - } - else - { - // cout << "Time in line: " << t_time_in_line << " from epoch time" << endl; - time = new TDatime(tm_time_in_line.tm_year,tm_time_in_line.tm_mon+1,tm_time_in_line.tm_mday,tm_time_in_line.tm_hour+1,tm_time_in_line.tm_min,tm_time_in_line.tm_sec); - // cout << "Time going in the ROOT file: " << time->Convert() << endl; - // Get time, temperature, humidity, and dew point. - istringstream iss(line); - iss >> trash1 >> trash2 >> trash3 >> trash4 >> trash5 >> T >> RH >> DP; - vtime.push_back(time->Convert()); - vT.push_back(T); - vRH.push_back(RH); - vDP.push_back(DP); - } - } - } - else - { - cout << "Error! Unable to read header..." << endl; - return; - } - - // Close file. - file.close(); - } - else { - cout << "Error! Unable to open file." << endl; // To be modified to stop everything if there is a problem. - return; - } - } - - double *aT = &vT[0]; - double *aRH = &vRH[0]; - double *aDP = &vDP[0]; - double *atime = &vtime[0]; - - /* - cout << vT.size() << endl; - cout << vtime.size() << endl; - - cout << vT[0] << endl; - cout << vtime[0] << endl; - - cout << vT[10] << endl; - cout << vtime[10] << endl; - */ - - // Open output ROOT file. - string output_ROOT; - if ((from != 0) && (to !=0)) - output_ROOT = outputDirectory+"/PlotTrends-"+"from"+s_from+"to"+s_to+".root"; - else - output_ROOT = outputDirectory+"/PlotTrends-all.root"; - TFile *output = TFile::Open(TString(output_ROOT),"RECREATE"); - - // Temperature trends. - TCanvas *cT = new TCanvas("PlotTrends-T","",400,300); - - cT->SetLeftMargin(0.1363636); - cT->SetRightMargin(0.08808081); - cT->SetBottomMargin(0.2095588); - - TGraph *gT = new TGraph(vT.size(),atime,aT); - InitGraph(gT,"Temperature trends","Time","Temperature (#circC)"); - gT->GetXaxis()->SetTimeDisplay(1); - gT->GetXaxis()->SetLabelOffset(0.04); - gT->GetXaxis()->SetTitleOffset(1.50); - gT->GetYaxis()->SetTitleOffset(0.95); - gT->GetXaxis()->SetTimeFormat("#splitline{%Y-%m-%d}{%H:%M:%S}"); - gT->GetXaxis()->SetNdivisions(-503); - gT->GetXaxis()->SetTimeOffset(0,"gmt"); - DrawGraph(cT,gT,"AP",path_to_figures); - - // Relative humidity trends. - TCanvas *cRH = new TCanvas("PlotTrends-RH","",400,300); - - cRH->SetLeftMargin(0.1363636); - cRH->SetRightMargin(0.08808081); - cRH->SetBottomMargin(0.2095588); - - TGraph *gRH = new TGraph(vRH.size(),atime,aRH); - InitGraph(gRH,"Relative humidity trends","Time","Relative humidity (%)"); - gRH->GetXaxis()->SetTimeDisplay(1); - gRH->GetXaxis()->SetLabelOffset(0.04); - gRH->GetXaxis()->SetTitleOffset(1.50); - gRH->GetYaxis()->SetTitleOffset(0.95); - gRH->GetXaxis()->SetTimeFormat("#splitline{%Y-%m-%d}{%H:%M:%S}"); - gRH->GetXaxis()->SetNdivisions(-503); - gRH->GetXaxis()->SetTimeOffset(0,"gmt"); - DrawGraph(cRH,gRH,"AP",path_to_figures); - - // Dew point trends. - TCanvas *cDP = new TCanvas("PlotTrends-DP","",400,300); - - cDP->SetLeftMargin(0.1363636); - cDP->SetRightMargin(0.08808081); - cDP->SetBottomMargin(0.2095588); - - TGraph *gDP = new TGraph(vDP.size(),atime,aDP); - InitGraph(gDP,"Dew point trends","Time","Dew point (#circC)"); - gDP->GetXaxis()->SetTimeDisplay(1); - gDP->GetXaxis()->SetLabelOffset(0.04); - gDP->GetXaxis()->SetTitleOffset(1.50); - gDP->GetYaxis()->SetTitleOffset(0.95); - gDP->GetXaxis()->SetTimeFormat("#splitline{%Y-%m-%d}{%H:%M:%S}"); - gDP->GetXaxis()->SetNdivisions(-503); - gDP->GetXaxis()->SetTimeOffset(0,"gmt"); - DrawGraph(cDP,gDP,"AP",path_to_figures); - - // Temperature and dew point trends. - TCanvas *cTandDP = new TCanvas("PlotTrends-TandDP","",400,300); - - cTandDP->SetLeftMargin(0.1363636); - cTandDP->SetRightMargin(0.08808081); - cTandDP->SetBottomMargin(0.2095588); - - TMultiGraph *mgTandDP = new TMultiGraph(); - - gT->SetMarkerColor(kGreen); - gT->SetLineColor(kGreen); - gDP->SetMarkerColor(kRed); - gDP->SetLineColor(kRed); - - TLegend *legTandDP = CreateLegend2(gT,"temperature",gDP,"dew point","lpw",0.63,0.59,0.88,0.84); - - mgTandDP->Add(gT); - mgTandDP->Add(gDP); - - cTandDP->cd(); - mgTandDP->Draw("AP"); - - mgTandDP->GetXaxis()->SetTimeDisplay(1); - mgTandDP->GetXaxis()->SetLabelOffset(0.04); - mgTandDP->GetXaxis()->SetTitleOffset(1.50); - mgTandDP->GetYaxis()->SetTitleOffset(0.95); - mgTandDP->GetXaxis()->SetTimeFormat("#splitline{%Y-%m-%d}{%H:%M:%S}"); - mgTandDP->GetXaxis()->SetNdivisions(-503); - mgTandDP->GetXaxis()->SetTimeOffset(0,"gmt"); - - DrawGraphCompare(cTandDP,mgTandDP,legTandDP,"Temperature and dew point trends","Time","Temperature (#circC)","AP",path_to_figures); - - - - // Write output ROOT file. - output->Write(); - - // Close output ROOT file. - output->Close(); - - return; } vector SelectFiles(string inputDirectory, vector list_of_files, time_t t_from, time_t t_to) { - ifstream file; + ifstream file; - string header; - string first_line; - string last_line; + string header; + string first_line; + string last_line; - struct tm tm_time_in_first_line; - struct tm tm_time_in_last_line; + struct tm tm_time_in_first_line; + struct tm tm_time_in_last_line; - time_t t_time_in_first_line; - time_t t_time_in_last_line; + time_t t_time_in_first_line; + time_t t_time_in_last_line; - vector list_of_selected_files; + vector list_of_selected_files; - for (vector::const_iterator i = list_of_files.begin(); i != list_of_files.end(); ++i) - { - cout << "Input text file #" << i-list_of_files.begin() << ": " << *i << endl; - - // Check whether this input text file must be selected. - file.open((inputDirectory+"/"+*i).c_str()); - if (file.is_open()) + for (vector::const_iterator i = list_of_files.begin(); i != list_of_files.end(); ++i) { - // cout << "Great! File opened..." << endl; + cout << "Input text file #" << i-list_of_files.begin() << ": " << *i << endl; - // Skip header. - if (getline(file,header)) + // Check whether this input text file must be selected. + file.open((inputDirectory+"/"+*i).c_str()); + if (file.is_open()) + { + // cout << "Great! File opened..." << endl; + + // Skip header. + if (getline(file,header)) + { + // Read time in first line. + if (getline(file,first_line)) + { + memset(&tm_time_in_first_line, 0, sizeof(struct tm)); + strptime(first_line.c_str(),"%c",&tm_time_in_first_line); + t_time_in_first_line = mktime(&tm_time_in_first_line); + + // cout << "Time in first line: " << t_time_in_first_line << " from epoch time" << endl; + } + else + { + cout << "Error! Cannot read time in first line..." << endl; + return vector(); + } + // Read time in last line. + last_line = getLastLine(file); + memset(&tm_time_in_last_line, 0, sizeof(struct tm)); + strptime(last_line.c_str(),"%c",&tm_time_in_last_line); + t_time_in_last_line = mktime(&tm_time_in_last_line); + + // cout << "Time in last line: " << t_time_in_last_line << " from epoch time" << endl; + + // Decide if this input text file must be selected. + + if ((t_time_in_first_line <= t_to) && (t_time_in_last_line >= t_from)) + { + // Select the input text file. + list_of_selected_files.push_back(*i); + } + + } + else + { + cout << "Error! Unable to read header..." << endl; + return vector(); + } + + file.close(); + } + else { + cout << "Error! Unable to open file." << endl; // To be modified to stop everything if there is a problem. + return vector(); + } + } + + // cout << "Selected input text files" << endl; + for (vector::const_iterator i = list_of_selected_files.begin(); i != list_of_selected_files.end(); ++i) { - // Read time in first line. - if (getline(file,first_line)) - { - memset(&tm_time_in_first_line, 0, sizeof(struct tm)); - strptime(first_line.c_str(),"%c",&tm_time_in_first_line); - t_time_in_first_line = mktime(&tm_time_in_first_line); - - // cout << "Time in first line: " << t_time_in_first_line << " from epoch time" << endl; - } - else - { - cout << "Error! Cannot read time in first line..." << endl; - return vector(); - } - // Read time in last line. - last_line = getLastLine(file); - memset(&tm_time_in_last_line, 0, sizeof(struct tm)); - strptime(last_line.c_str(),"%c",&tm_time_in_last_line); - t_time_in_last_line = mktime(&tm_time_in_last_line); - - // cout << "Time in last line: " << t_time_in_last_line << " from epoch time" << endl; - - // Decide if this input text file must be selected. - - if ((t_time_in_first_line <= t_to) && (t_time_in_last_line >= t_from)) - { - // Select the input text file. - list_of_selected_files.push_back(*i); - } - + // cout << "Selected input text file #" << i-list_of_selected_files.begin() << ": " << *i << endl; } - else - { - cout << "Error! Unable to read header..." << endl; - return vector(); - } - - file.close(); - } - else { - cout << "Error! Unable to open file." << endl; // To be modified to stop everything if there is a problem. - return vector(); - } - } - // cout << "Selected input text files" << endl; - for (vector::const_iterator i = list_of_selected_files.begin(); i != list_of_selected_files.end(); ++i) - { - // cout << "Selected input text file #" << i-list_of_selected_files.begin() << ": " << *i << endl; - } - - return list_of_selected_files; + return list_of_selected_files; } diff --git a/Software/Tools/SCurve.C b/Software/Tools/SCurve.C index 24a1d35..1a01849 100644 --- a/Software/Tools/SCurve.C +++ b/Software/Tools/SCurve.C @@ -320,14 +320,14 @@ parSCurves[2] = 6.; parSCurves[3] = 12.; - // parSCurves[4] = 10.; - // parSCurves[5] = 20.; + parSCurves[4] = -999.; + parSCurves[5] = -999.; parSCurves[6] = 70.; parSCurves[7] = 110.; parSCurves[8] = 3.; parSCurves[9] = 15.; - // parSCurves[10] = 8.; - // parSCurves[11] = 18.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; // Left. parSCurves[12] = 17.; @@ -379,14 +379,14 @@ else parSCurves[3] = 10.; - // parSCurves[4] = 10.; - // parSCurves[5] = 20.; + parSCurves[4] = -999.; + parSCurves[5] = -999.; parSCurves[6] = 120.; parSCurves[7] = 200.; parSCurves[8] = 3.; parSCurves[9] = 15.; - // parSCurves[10] = 8.; - // parSCurves[11] = 18.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; // Left. parSCurves[12] = 16.; @@ -440,14 +440,14 @@ parSCurves[2] = 6.; parSCurves[3] = 10.; - // parSCurves[4] = 10.; - // parSCurves[5] = 20.; + parSCurves[4] = -999.; + parSCurves[5] = -999.; parSCurves[6] = 20.; parSCurves[7] = 100.; parSCurves[8] = 3.; parSCurves[9] = 20.; - // parSCurves[10] = 8.; - // parSCurves[11] = 18.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; // Left. if (zvalue < 130.) @@ -500,14 +500,14 @@ parSCurves[2] = 10.; parSCurves[3] = 3.; - // parSCurves[4] = 10.; - // parSCurves[5] = 20.; + parSCurves[4] = -999.; + parSCurves[5] = -999.; parSCurves[6] = 120.; parSCurves[7] = 180.; parSCurves[8] = 3.; parSCurves[9] = 20.; - // parSCurves[10] = 8.; - // parSCurves[11] = 18.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; // Left. parSCurves[12] = 2.5; @@ -554,14 +554,14 @@ parSCurves[2] = 10.; parSCurves[3] = 3.; - // parSCurves[4] = 10.; - // parSCurves[5] = 20.; + parSCurves[4] = -999.; + parSCurves[5] = -999.; parSCurves[6] = 100.; parSCurves[7] = 150.; parSCurves[8] = 3.; parSCurves[9] = 20.; - // parSCurves[10] = 8.; - // parSCurves[11] = 18.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; // Left. parSCurves[12] = 2.5; @@ -624,14 +624,14 @@ parSCurves[2] = 10.; parSCurves[3] = -45.; - // parSCurves[4] = 10.; - // parSCurves[5] = 20.; + parSCurves[4] = -999.; + parSCurves[5] = -999.; parSCurves[6] = 50.; parSCurves[7] = 60.; parSCurves[8] = 3.; parSCurves[9] = 20.; - // parSCurves[10] = 8.; - // parSCurves[11] = 18.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; // Left. parSCurves[12] = 20.; // 15. @@ -650,6 +650,260 @@ // fitLeft->SetParLimits(3,150.,220.); } + else if (filename == "ProcessRawData-20150725-216"){ + // Right. + if (zvalue < -70.) { + *minRight = 25.; + *maxRight = 65.; + } + else if (zvalue < -50.) { + *minRight = 20.; + *maxRight = 60.; + } + else if (zvalue < -40.) { + *minRight = 15.; + *maxRight = 55.; + } + else if (zvalue < -30.) { + *minRight = 20.; + *maxRight = 55.; + } + else if (zvalue < -20.) { + *minRight = 25.; + *maxRight = 55.; + } + else if (zvalue < 50.) { + *minRight = 30.; + *maxRight = 55.; + } + else if (zvalue < 60.) { + *minRight = 25.; + *maxRight = 60.; + } + else if (zvalue < 80.) { + *minRight = 20.; + *maxRight = 60.; + } + else { + *minRight = 25.; + *maxRight = 55.; + } + + // Left. + if (zvalue < -70.) { + *minLeft = -10.; + *maxLeft = 25.; + } + else if (zvalue < -50.) { + *minLeft = -15.; + *maxLeft = 20.; + } + else if (zvalue < -40.) { + *minLeft = -15.; + *maxLeft = 15.; + } + else if (zvalue < 40.) { + *minLeft = -15.; + *maxLeft = 10.; + } + else if (zvalue < 60.) { + *minLeft = -15.; + *maxLeft = 11.; + } + else if (zvalue < 80.) { + *minLeft = -15.; + *maxLeft = 30.; + } + else { + *minLeft = -15.; + *maxLeft = 25.; + } + + // Right. + parSCurves[0] = 6.; + parSCurves[1] = 50.; + parSCurves[2] = 10.; + parSCurves[3] = -29.; + + parSCurves[4] = -999.; + parSCurves[5] = -999.; + parSCurves[6] = 30.; + parSCurves[7] = 60.; + parSCurves[8] = 3.; + parSCurves[9] = 20.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; + + // Left. + parSCurves[12] = 6.; + parSCurves[13] = 5.; + parSCurves[14] = 10.; + parSCurves[15] = -29.; + + // fitLeft->SetParLimits(0,90.,170.); + parSCurves[18] = -10.; + parSCurves[19] = 20.; + parSCurves[20] = 3.; + parSCurves[21] = 20.; + // fitLeft->SetParLimits(3,150.,220.); + } + + else if ((filename == "ProcessRawData-201507252-216") || (filename == "ProcessRawData-201507253-56ns-216") || (filename == "ProcessRawData-201507253-57ns-216") || (filename == "ProcessRawData-201507253-58ns-216") || (filename == "ProcessRawData-201507253-59ns-216") || (filename == "ProcessRawData-201507253-60ns-216") || (filename == "ProcessRawData-201507253-61ns-216") || (filename == "ProcessRawData-201507253-62ns-216") || (filename == "ProcessRawData-201507253-63ns-216") || (filename == "ProcessRawData-201507253-64ns-216") || (filename == "ProcessRawData-20150726--250V-216") || (filename == "ProcessRawData-20150726--230V-216") || (filename == "ProcessRawData-20150726--210V-216") || (filename == "ProcessRawData-20150726--190V-216") || (filename == "ProcessRawData-20150726--170V-216") || (filename == "ProcessRawData-20150726--150V-216") || (filename == "ProcessRawData-201507262-24.5dB-216") || (filename == "ProcessRawData-201507262-25.0dB-216") || (filename == "ProcessRawData-201507262-25.5dB-216") || (filename == "ProcessRawData-201507262-26.0dB-216") || (filename == "ProcessRawData-201507262-26.5dB-216") || (filename == "ProcessRawData-201507262-27.0dB-216") || (filename == "ProcessRawData-201507262-27.5dB-216") || (filename == "ProcessRawData-201507262-28.0dB-216") || (filename == "ProcessRawData-201507262-28.5dB-216") || (filename == "ProcessRawData-201507263-56ns-216") || (filename == "ProcessRawData-201507263-57ns-216") || (filename == "ProcessRawData-201507263-58ns-216") || (filename == "ProcessRawData-201507263-59ns-216") || (filename == "ProcessRawData-201507263-60ns-216") || (filename == "ProcessRawData-201507263-61ns-216") || (filename == "ProcessRawData-201507263-62ns-216") || (filename == "ProcessRawData-201507263-63ns-216") || (filename == "ProcessRawData-201507263-64ns-216")){ + // Right. + *minRight = 30.; + *maxRight = 55.; + + // Left. + *minLeft = -20.; + *maxLeft = 5.; + + // Right. + parSCurves[0] = 15.; + parSCurves[1] = 50.; + parSCurves[2] = 10.; + parSCurves[3] = -23.; + + parSCurves[4] = -999.; + parSCurves[5] = -999.; + parSCurves[6] = 30.; + parSCurves[7] = 60.; + parSCurves[8] = 2.; + parSCurves[9] = 20.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; + + if (filename == "ProcessRawData-201507262-27.5dB-216") { + *maxRight = 60.; + *maxLeft = 10.; + parSCurves[0] = 11.; + parSCurves[1] = 45.; + parSCurves[2] = 4.; + parSCurves[3] = -17.; + } + + else if (filename == "ProcessRawData-201507262-28.0dB-216") { + *maxRight = 60.; + *maxLeft = 10.; + parSCurves[0] = 11.; + parSCurves[1] = 49.; + parSCurves[2] = 13.; + parSCurves[3] = -15.; + parSCurves[4] = 10.; + parSCurves[5] = 12.; + parSCurves[6] = 46.; + parSCurves[7] = 50.; + parSCurves[8] = 4.; + parSCurves[9] = 20.; + parSCurves[10] = -20.; + parSCurves[11] = -10.; + } + + if (filename == "ProcessRawData-201507263-58ns-216") { + parSCurves[1] = 45.; + parSCurves[2] = 4.; + parSCurves[4] = 10.; + parSCurves[5] = 18.; + parSCurves[10] = -25.; + parSCurves[11] = -15.; + } + + // Left. + parSCurves[12] = 15.; + parSCurves[13] = -10.; + parSCurves[14] = 10.; + parSCurves[15] = -23.; + + // fitLeft->SetParLimits(0,90.,170.); + parSCurves[18] = -20.; + parSCurves[19] = 10.; + parSCurves[20] = 2.; + parSCurves[21] = 20.; + // fitLeft->SetParLimits(3,150.,220.); + + /* + if ((filename == "ProcessRawData-201507262-27.5dB-216") || (filename == "ProcessRawData-201507262-28.0dB-216")) { + parSCurves[12] = 11.; + parSCurves[13] = -10.; + parSCurves[14] = 4.; + parSCurves[15] = -17.; + // parSCurves[18] = -7.; + // parSCurves[19] = 1.; + } + */ + + } + + else if (filename == "ProcessRawData-201507273-216"){ + // Right. + // z = -80, -70, -60, -50, -40, -30, -20, -10, 0 + if (zvalue < 10.) { + *minRight = 95.; + *maxRight = 135.; + } + // z = 10, 20, 30, 40, 50, 60, 70, 80 + else { + *minRight = 95.; + *maxRight = 130.; + } + + // Left. + // z = -80, -70, -60, -50, -40 + if (zvalue < -30.) { + *minLeft = 60.; + *maxLeft = 95.; + } + // z = -30, -20, -10, 0, 10, 20 + else if (zvalue < 30.) { + *minLeft = 55.; + *maxLeft = 95.; + } + // z = 30, 40, 50, 60 + else if (zvalue < 70.) { + *minLeft = 55.; + *maxLeft = 90.; + } + // z = 70, 80 + else { + *minLeft = 55.; + *maxLeft = 100.; + } + + // Right. + parSCurves[0] = 14.; + parSCurves[1] = 125.; + parSCurves[2] = 10.; + parSCurves[3] = -35.; + + parSCurves[4] = -999.; + parSCurves[5] = -999.; + parSCurves[6] = 110.; + parSCurves[7] = 140.; + parSCurves[8] = 3.; + parSCurves[9] = 20.; + parSCurves[10] = -999.; + parSCurves[11] = -999.; + + // Left. + parSCurves[12] = 14.; + parSCurves[13] = 70.; + parSCurves[14] = 10.; + parSCurves[15] = -35.; + + // fitLeft->SetParLimits(0,90.,170.); + parSCurves[18] = 50.; + parSCurves[19] = 80.; + parSCurves[20] = 3.; + parSCurves[21] = 20.; + // fitLeft->SetParLimits(3,150.,220.); + + if (zvalue == 30.) { + parSCurves[12] = 20.; + parSCurves[13] = 65.; + parSCurves[14] = 10.; + parSCurves[15] = -30.; + } + } + return; } @@ -809,6 +1063,66 @@ // parSigma[17] = ?.; } + else if (filename == "ProcessRawData-20150725-216") { + // Sigma left. + parSigma[0] = 0.03; + parSigma[1] = 100.; + parSigma[2] = 2.; + + parSigma[3] = 0.; + parSigma[4] = 10.; + + parSigma[5] = 0.; + parSigma[6] = 200.; + + parSigma[7] = 1.; + parSigma[8] = 4.; + + // Sigma right. + parSigma[9] = 0.02; + parSigma[10] = 100.; + parSigma[11] = 2.; + + parSigma[12] = 0.; + parSigma[13] = 10.; + + parSigma[14] = 0.; + parSigma[15] = 200.; + + parSigma[16] = 1.; + parSigma[17] = 4.; + } + + else if (filename == "ProcessRawData-201507273-216") { + // Sigma left. + parSigma[0] = 0.02; + parSigma[1] = 70.; + parSigma[2] = 3.; + + parSigma[3] = 0.; + parSigma[4] = 2.; + + parSigma[5] = 0.; + parSigma[6] = 200.; + + parSigma[7] = 1.; + parSigma[8] = 5.; + + // Sigma right. + parSigma[9] = 0.02; + parSigma[10] = 60.; + parSigma[11] = 3.2; + + parSigma[12] = 0.; + parSigma[13] = 2.; + + parSigma[14] = 0.; + parSigma[15] = 200.; + + parSigma[16] = 1.; + parSigma[17] = 5.; + } + return; } @@ -857,6 +1171,41 @@ // parEta[11] = 0.2; } + else if ((filename == "ProcessRawData-201507252-216") || (filename == "ProcessRawData-201507253-56ns-216") || (filename == "ProcessRawData-201507253-57ns-216") || (filename == "ProcessRawData-201507253-58ns-216") || (filename == "ProcessRawData-201507253-59ns-216") || (filename == "ProcessRawData-201507253-60ns-216") || (filename == "ProcessRawData-201507253-61ns-216") || (filename == "ProcessRawData-201507253-62ns-216") || (filename == "ProcessRawData-201507253-63ns-216") || (filename == "ProcessRawData-201507253-64ns-216") || (filename == "ProcessRawData-20150726--250V-216") || (filename == "ProcessRawData-20150726--230V-216") || (filename == "ProcessRawData-20150726--210V-216") || (filename == "ProcessRawData-20150726--190V-216") || (filename == "ProcessRawData-20150726--170V-216") || (filename == "ProcessRawData-20150726--150V-216") || (filename == "ProcessRawData-201507262-24.5dB-216") || (filename == "ProcessRawData-201507262-25.0dB-216") || (filename == "ProcessRawData-201507262-25.5dB-216") || (filename == "ProcessRawData-201507262-26.0dB-216") || (filename == "ProcessRawData-201507262-26.5dB-216") || (filename == "ProcessRawData-201507262-27.0dB-216") || (filename == "ProcessRawData-201507262-27.5dB-216") || (filename == "ProcessRawData-201507262-28.0dB-216") || (filename == "ProcessRawData-201507262-28.5dB-216")) { + parEta[0] = 1.; + parEta[1] = 20.; + parEta[2] = 6.; + parEta[3] = 0.; + + // parEta[4] = 0.5; + // parEta[5] = 2.5; + + parEta[6] = 0.; + parEta[7] = 30.; + + parEta[8] = 2.; + parEta[9] = 10.; + + // parEta[10] = -0.2; + // parEta[11] = 0.2; + } + + else if ((filename == "ProcessRawData-201507263-56ns-216") || (filename == "ProcessRawData-201507263-57ns-216") || (filename == "ProcessRawData-201507263-58ns-216") || (filename == "ProcessRawData-201507263-59ns-216") || (filename == "ProcessRawData-201507263-60ns-216") || (filename == "ProcessRawData-201507263-61ns-216") || (filename == "ProcessRawData-201507263-62ns-216") || (filename == "ProcessRawData-201507263-63ns-216") || (filename == "ProcessRawData-201507263-64ns-216")) { + parEta[0] = 0.8; + parEta[1] = 19.; + parEta[2] = 6.; + parEta[3] = 0.; + + parEta[4] = 0.5; + parEta[5] = 1.5; + parEta[6] = 10.; + parEta[7] = 25.; + parEta[8] = 2.; + parEta[9] = 20.; + parEta[10] = -0.2; + parEta[11] = 0.2; + } + return; } @@ -873,10 +1222,12 @@ f->SetParameter(1,parSCurves[1]); f->SetParameter(2,parSCurves[2]); f->SetParameter(3,parSCurves[3]); - // f->SetParLimits(0,parSCurves[4],parSCurves[5]); + if ((parSCurves[4] != -999) && (parSCurves[5] != -999)) + f->SetParLimits(0,parSCurves[4],parSCurves[5]); f->SetParLimits(1,parSCurves[6],parSCurves[7]); f->SetParLimits(2,parSCurves[8],parSCurves[9]); - // f->SetParLimits(3,parSCurves[10],parSCurves[11]); + if ((parSCurves[10] != -999) && (parSCurves[11] != -999)) + f->SetParLimits(3,parSCurves[10],parSCurves[11]); } else if ((edge == "left") && (lengthParSCurves>12)) { f->SetParameter(0,parSCurves[12]);