From 0625bc008fcb46376f67448ab817c7d07cf59aad Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Fri, 27 May 2022 13:14:30 +0200 Subject: [PATCH 1/6] fixed a typo, and tell the user if the file format info is not provided MusrRoot is assumed. --- src/dump_header.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dump_header.cpp b/src/dump_header.cpp index b92378089..ecb89d089 100644 --- a/src/dump_header.cpp +++ b/src/dump_header.cpp @@ -87,7 +87,7 @@ void dump_header_syntax() std::cout << std::endl << " -rn, --runNo : run number of the header to be dumped."; std::cout << std::endl << " -fn, --fileName : muSR data file name."; std::cout << std::endl << " -ff, --fileFormat : where can be:"; - std::cout << std::endl << " MusrRoot, NeXus, ROOT (old LEM), PSI-BIN, PSI-MDU, MUD, WKM"; + std::cout << std::endl << " MusrRoot (default), NeXus, ROOT (old LEM), PSI-BIN, PSI-MDU, MUD, WKM"; std::cout << std::endl << " NeXus is only supported if enabled."; std::cout << std::endl << " -y, --year : has to be 4 digit, e.g. 2005, if provided it is used to"; std::cout << std::endl << " generate the file name for the given , otherwise the current"; @@ -884,7 +884,7 @@ int main(int argc, char *argv[]) } if (strcmp(argv[i+2], "gps") && strcmp(argv[i+2], "ltf") && strcmp(argv[i+2], "dolly") && strcmp(argv[i+2], "gpd") && strcmp(argv[i+2], "hifi")) { - std::cerr << std::endl << "**ERROR** found --psi-bulk with 2nd argument '" << argv[i+1] << "'! This is an unkown instrument." << std::endl; + std::cerr << std::endl << "**ERROR** found --psi-bulk with 2nd argument '" << argv[i+2] << "'! This is an unkown instrument." << std::endl; dump_header_syntax(); return 1; } From eefc49bd253151aad53cc1ccf58698e642ef34ee Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sat, 28 May 2022 14:05:55 +0200 Subject: [PATCH 2/6] add search facility for runs via musrfit_startup.xml template entries. --- src/classes/PFindRun.cpp | 149 +++++++++++++++++++++++++++++++++++++++ src/include/PFindRun.h | 56 +++++++++++++++ 2 files changed, 205 insertions(+) create mode 100644 src/classes/PFindRun.cpp create mode 100644 src/include/PFindRun.h diff --git a/src/classes/PFindRun.cpp b/src/classes/PFindRun.cpp new file mode 100644 index 000000000..1876c7a10 --- /dev/null +++ b/src/classes/PFindRun.cpp @@ -0,0 +1,149 @@ +/*************************************************************************** + + PFindRun.cpp + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2022 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include + +#include "PFindRun.h" + +//---------------------------------------------------------------------------- +/** + * @brief PFindRun::PFindRun + * @param runNameTemplateList + */ +PFindRun::PFindRun(const PStringVector path, const PRunNameTemplateList runNameTemplateList) : + fPath(path), fRunNameTemplateList(runNameTemplateList) +{ + // nothing to be done here +} + +//---------------------------------------------------------------------------- +/** + * @brief PFindRun::PFindRun + * + * @param path + * @param runNameTemplateList + * @param instrument + * @param year + * @param run + */ +PFindRun::PFindRun(const PStringVector path, const PRunNameTemplateList runNameTemplateList, + const TString &instrument, const UInt_t year, const UInt_t run) : + fPath(path), fRunNameTemplateList(runNameTemplateList), fInstrument(instrument), fYear(year), fRun(run) +{ + // nothing to be done here +} + +//---------------------------------------------------------------------------- +/** + * @brief PFindRun::DumpTemplateList + */ +void PFindRun::DumpTemplateList() +{ + std::cout << "debug> instrument: " << fInstrument << std::endl; + std::cout << "debug> year: " << fYear << std::endl; + std::cout << "debug> run: " << fRun << std::endl; + std::cout << "debug> ++++" << std::endl; + std::cout << "debug> run name template list:" << std::endl; + for (UInt_t i=0; i ++++" << std::endl; +} + +//---------------------------------------------------------------------------- +/** + * @brief PFindRun::CreatePathName + * @param path + * @param runNameTemplate + * @return + */ +TString PFindRun::CreatePathName(const TString path, const TString runNameTemplate) +{ + TString pathName{""}; + TString runName = runNameTemplate; + TString yearStr = TString::Format("%d", fYear); + TString yyStr; + if (fYear < 2000) + yyStr = TString::Format("%02d", fYear-1900); + else + yyStr = TString::Format("%02d", fYear-2000); + runName.ReplaceAll("%yyyy%", yearStr); + runName.ReplaceAll("%yy%", yyStr); + + // run handling slightly more complicated, since various number of digits possible + Int_t idx=-1; + TString rr{""}; + for (Int_t i=2; i<10; i++) { + rr ="%"; + for (Int_t j=0; j Date: Sat, 28 May 2022 14:08:04 +0200 Subject: [PATCH 3/6] refactor PSI-BIN lib. Fix a couple of bugs and start to adopt to more modern c++. --- .../Class_MuSR_PSI/CMakeLists.txt | 2 +- .../Class_MuSR_PSI/MuSR_td_PSI_bin.cpp | 2367 ++++++++--------- .../Class_MuSR_PSI/MuSR_td_PSI_bin.h | 374 ++- 3 files changed, 1250 insertions(+), 1493 deletions(-) diff --git a/src/external/MuSR_software/Class_MuSR_PSI/CMakeLists.txt b/src/external/MuSR_software/Class_MuSR_PSI/CMakeLists.txt index 6822f6000..e3df5938d 100644 --- a/src/external/MuSR_software/Class_MuSR_PSI/CMakeLists.txt +++ b/src/external/MuSR_software/Class_MuSR_PSI/CMakeLists.txt @@ -5,7 +5,7 @@ set(prefix "${CMAKE_INSTALL_PREFIX}") set(exec_prefix "\$\{prefix\}") set(libdir "\$\{exec_prefix\}/lib") set(includedir "\$\{prefix\}/include") -set(PSIBIN_VERSION "0.1.0") +set(PSIBIN_VERSION "0.2.0") set(PSIBIN_LIBRARY_NAME "Class_MuSR_PSI") configure_file("Class_MuSR_PSI.pc.in" "Class_MuSR_PSI.pc" @ONLY) diff --git a/src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.cpp b/src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.cpp index 99bd5af03..2e52e0909 100644 --- a/src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.cpp +++ b/src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.cpp @@ -10,6 +10,7 @@ begin : Alex Amato, October 2005 modified : Andrea Raselli, October 2009 + : Andreas Suter, May 2020 copyright : (C) 2005 by email : alex.amato@psi.ch @@ -41,7 +42,6 @@ MuSR_td_PSI_bin::MuSR_td_PSI_bin() { - histo = nullptr; Clear(); } @@ -60,7 +60,7 @@ MuSR_td_PSI_bin::MuSR_td_PSI_bin() //******************************* -//Implementation read (generic read) +//Implementation Read (generic read) //******************************* /*! \brief Method to read a PSI-bin or an MDU file @@ -78,25 +78,25 @@ MuSR_td_PSI_bin::MuSR_td_PSI_bin() * be opened. */ - int MuSR_td_PSI_bin::read(const char * fileName) + int MuSR_td_PSI_bin::Read(const char * fileName) { std::ifstream file_name; Clear(); - filename = fileName; + fFilename = fileName; file_name.open(fileName, std::ios_base::binary); // open file if (file_name.fail()) { - readstatus = "ERROR Open "+filename+" failed!"; + fReadStatus = "ERROR Open "+fFilename+" failed!"; return 1; // ERROR open failed } char *buffer_file = new char[3]; if (!buffer_file) { - readstatus = "ERROR Allocating data buffer"; + fReadStatus = "ERROR Allocating data buffer"; return 3; // ERROR allocating data buffer } @@ -106,45 +106,45 @@ MuSR_td_PSI_bin::MuSR_td_PSI_bin() { file_name.close(); delete [] buffer_file; - readstatus = "ERROR Reading "+filename+" header failed!"; + fReadStatus = "ERROR Reading "+fFilename+" header failed!"; return 1; // ERROR reading header failed } - strncpy(format_id,buffer_file,2); - format_id[2] = '\0'; + strncpy(fFormatId,buffer_file,2); + fFormatId[2] = '\0'; file_name.close(); delete [] buffer_file; - if (format_id[0] == '1') { - if (format_id[1] != 'N') { - std::cout << "**WARNING** found '" << format_id << "'. Will change it to '1N'" << std::endl; - format_id[1] = 'N'; + if (fFormatId[0] == '1') { + if (fFormatId[1] != 'N') { + std::cout << "**WARNING** found '" << fFormatId << "'. Will change it to '1N'" << std::endl; + fFormatId[1] = 'N'; } } // file may either be PSI binary format - if (strncmp(format_id,"1N",2) == 0) + if (strncmp(fFormatId,"1N",2) == 0) { - return readbin(fileName); // then read it as PSI bin + return ReadBin(fileName); // then read it as PSI bin } // or MDU format (pTA, TDC or 32 channel TDC) - else if ((strncmp(format_id,"M3",2) == 0) ||(strncmp(format_id,"T4",2) == 0) || - (strncmp(format_id,"T5",2) == 0)) + else if ((strncmp(fFormatId,"M3",2) == 0) ||(strncmp(fFormatId,"T4",2) == 0) || + (strncmp(fFormatId,"T5",2) == 0)) { - return readmdu(fileName); // else read it as MDU + return ReadMdu(fileName); // else read it as MDU } else { - readstatus = "ERROR Unknown file format in "+filename+"!"; + fReadStatus = "ERROR Unknown file format in "+fFilename+"!"; return 2; // ERROR unsupported version } } //******************************* - //Implementation write (generic write) + //Implementation Write (generic write) //******************************* /*! \brief Method to write a PSI-bin or an MDU file @@ -162,7 +162,7 @@ MuSR_td_PSI_bin::MuSR_td_PSI_bin() * be opened. */ -int MuSR_td_PSI_bin::write(const char *fileName) +int MuSR_td_PSI_bin::Write(const char *fileName) { std::string fln = fileName; size_t found = fln.find_last_of("."); @@ -172,9 +172,9 @@ int MuSR_td_PSI_bin::write(const char *fileName) std::string ext = fln.substr(found+1); int status = 0; if (ext == "bin") - status = writebin(fileName); + status = WriteBin(fileName); else if (ext == "mdu") - status = writemdu(fileName); + status = WriteMdu(fileName); else return 2; @@ -224,7 +224,7 @@ typedef long int Int32; typedef float Float32; //******************************* -//Implementation readbin +//Implementation ReadBin //******************************* /*! \brief Method to read a PSI-bin file @@ -242,7 +242,7 @@ typedef float Float32; * be opened. */ -int MuSR_td_PSI_bin::readbin(const char * fileName) +int MuSR_td_PSI_bin::ReadBin(const char * fileName) { std::ifstream file_name; Int16 *dum_Int16; @@ -269,35 +269,35 @@ int MuSR_td_PSI_bin::readbin(const char * fileName) if (sizeof(Int16) != 2) { - readstatus = "ERROR Size of Int16 data type is not 2 bytes!"; + fReadStatus = "ERROR Size of Int16 data type is not 2 bytes!"; return 1; // ERROR open failed } if (sizeof(Int32) != 4) { - readstatus = "ERROR Sizeof Int32 data type is not 4 bytes"; + fReadStatus = "ERROR Sizeof Int32 data type is not 4 bytes"; return 1; // ERROR open failed } if (sizeof(Float32) != 4) { - readstatus = "ERROR Sizeof Float32 data type is not 4 bytes"; + fReadStatus = "ERROR Sizeof Float32 data type is not 4 bytes"; return 1; // ERROR open failed } - filename = fileName; + fFilename = fileName; file_name.open(fileName, std::ios_base::binary); // open PSI bin file if (file_name.fail()) { - readstatus = "ERROR Open "+filename+" failed!"; + fReadStatus = "ERROR Open "+fFilename+" failed!"; return 1; // ERROR open failed } char *buffer_file = new char[1024]; if (!buffer_file) { - readstatus = "ERROR Allocating buffer to read header failed!"; + fReadStatus = "ERROR Allocating buffer to read header failed!"; return 3; // ERROR allocating data buffer } @@ -306,21 +306,21 @@ int MuSR_td_PSI_bin::readbin(const char * fileName) { file_name.close(); delete [] buffer_file; - readstatus = "ERROR Reading "+filename+" header failed!"; + fReadStatus = "ERROR Reading "+fFilename+" header failed!"; return 1; // ERROR reading header failed } // fill header data into member variables - strncpy(format_id,buffer_file,2); - format_id[2] = '\0'; + strncpy(fFormatId,buffer_file,2); + fFormatId[2] = '\0'; - if (format_id[1] != 'N') // the warning is already issued in read() - format_id[1] = 'N'; + if (fFormatId[1] != 'N') // the warning is already issued in read() + fFormatId[1] = 'N'; - if (strcmp(format_id,"1N") != 0) + if (strcmp(fFormatId,"1N") != 0) { file_name.close(); delete [] buffer_file; - readstatus = "ERROR Unknown file format in "+filename+"!"; + fReadStatus = "ERROR Unknown file format in "+fFilename+"!"; return 2; // ERROR unsupported version } @@ -331,109 +331,104 @@ int MuSR_td_PSI_bin::readbin(const char * fileName) tdc_overflow = *dum_Int16; dum_Int16 = (Int16 *) &buffer_file[6]; - num_run = *dum_Int16; + fNumRun = *dum_Int16; dum_Int16 = (Int16 *) &buffer_file[28]; - length_histo = *dum_Int16; + fLengthHisto = *dum_Int16; dum_Int16 = (Int16 *) &buffer_file[30]; - number_histo = *dum_Int16; + fNumberHisto = *dum_Int16; - strncpy(sample,buffer_file+138,10); - sample[10] = '\0'; + strncpy(fSample,buffer_file+138,10); + fSample[10] = '\0'; - strncpy(temp,buffer_file+148,10); - temp[10] = '\0'; + strncpy(fTemp,buffer_file+148,10); + fTemp[10] = '\0'; - strncpy(field,buffer_file+158,10); - field[10] = '\0'; + strncpy(fField,buffer_file+158,10); + fField[10] = '\0'; - strncpy(orient,buffer_file+168,10); - orient[10] = '\0'; + strncpy(fOrient,buffer_file+168,10); + fOrient[10] = '\0'; - strncpy(setup, buffer_file+178, 10); - setup[10] = '\0'; + strncpy(fSetup, buffer_file+178, 10); + fSetup[10] = '\0'; - strncpy(comment,buffer_file+860,62); - comment[62] = '\0'; + strncpy(fComment,buffer_file+860,62); + fComment[62] = '\0'; - strncpy(date_start,buffer_file+218,9); - date_start[9] = '\0'; + strncpy(fDateStart,buffer_file+218,9); + fDateStart[9] = '\0'; - strncpy(date_stop,buffer_file+227,9); - date_stop[9] = '\0'; + strncpy(fDateStop,buffer_file+227,9); + fDateStop[9] = '\0'; - strncpy(time_start,buffer_file+236,8); - time_start[8] = '\0'; + strncpy(fTimeStart,buffer_file+236,8); + fTimeStart[8] = '\0'; - strncpy(time_stop,buffer_file+244,8); - time_stop[8] = '\0'; + strncpy(fTimeStop,buffer_file+244,8); + fTimeStop[8] = '\0'; dum_Int32 = (Int32 *) &buffer_file[424]; - total_events = *dum_Int32; + fTotalEvents = *dum_Int32; - for (i=0; i<=15; i++) - { - strncpy(labels_histo[i],buffer_file+948+i*4,4); - labels_histo[i][4] = '\0'; + for (i=0; i<=15; i++) { + strncpy(fLabelsHisto[i],buffer_file+948+i*4,4); + fLabelsHisto[i][4] = '\0'; dum_Int32 = (Int32 *) &buffer_file[296+i*4]; - events_per_histo[i] = *dum_Int32; + fEventsPerHisto[i] = *dum_Int32; dum_Int16 = (Int16 *) &buffer_file[458+i*2]; - integer_t0[i] = *dum_Int16; + fIntegerT0[i] = *dum_Int16; dum_Int16 = (Int16 *) &buffer_file[490+i*2]; - first_good[i] = *dum_Int16; + fFirstGood[i] = *dum_Int16; dum_Int16 = (Int16 *) &buffer_file[522+i*2]; - last_good[i] = *dum_Int16; + fLastGood[i] = *dum_Int16; } - for (i=0; i<=15; i++) - { + for (i=0; i<=15; i++) { dum_Float32 = (Float32 *) &buffer_file[792+i*4]; - real_t0[i] = *dum_Float32; + fRealT0[i] = *dum_Float32; } - number_scaler = 18; + fNumberScaler = 18; - for (i=0; i<=5; i++) - { + for (i=0; i<=5; i++) { dum_Int32 = (Int32 *) &buffer_file[670+i*4]; - scalers[i] = *dum_Int32; + fScalers[i] = *dum_Int32; - strncpy(labels_scalers[i],buffer_file+924+i*4,4); - labels_scalers[i][4] = '\0'; + strncpy(fLabelsScalers[i],buffer_file+924+i*4,4); + fLabelsScalers[i][4] = '\0'; } - for (i=6; i(*dum_Float32); + fBinWidth = static_cast(*dum_Float32); - if (bin_width == 0.) + if (fBinWidth == 0.) { - bin_width=0.125*(625.E-6)*pow(static_cast(2.0),static_cast(tdc_resolution)); + fBinWidth=0.125*(625.E-6)*pow(static_cast(2.0),static_cast(tdc_resolution)); } - default_binning = 1; + fDefaultBinning = 1; - number_temper = 4; - for (i=0; i< number_temper; i++) - { + fNumberTemper = 4; + for (i=0; i< fNumberTemper; i++) { dum_Float32 = (Float32 *) &buffer_file[716+i*4]; - temper[i] = *dum_Float32; + fTemper[i] = *dum_Float32; dum_Float32 = (Float32 *) &buffer_file[738+i*4]; - temp_deviation[i] = *dum_Float32; + fTempDeviation[i] = *dum_Float32; dum_Float32 = (Float32 *) &buffer_file[72+i*4]; mon_low[i] = *dum_Float32; @@ -457,14 +452,13 @@ int MuSR_td_PSI_bin::readbin(const char * fileName) num_data_records_histo = *dum_Int16; dum_Int16 = (Int16 *) &buffer_file[134]; // khidaf - if (*dum_Int16 != 1) - { + if (*dum_Int16 != 1) { std::cout << "ERROR number of histograms/record not equals 1!" << " Required algorithm is not implemented!" << std::endl; delete [] buffer_file; file_name.close(); - readstatus = "ERROR Algorithm to read multiple histograms in one block -" - " necessary to read " + filename + " - is not implemented!"; + fReadStatus = "ERROR Algorithm to read multiple histograms in one block -" + " necessary to read " + fFilename + " - is not implemented!"; return 4; // ERROR algorithm not implemented } @@ -476,59 +470,37 @@ int MuSR_td_PSI_bin::readbin(const char * fileName) if (buffer_file) delete [] buffer_file; - if (number_histo <= 0) + if (fNumberHisto <= 0) { file_name.close(); - readstatus = "ERROR Less than 1 histogram in " + filename; + fReadStatus = "ERROR Less than 1 histogram in " + fFilename; return 5; // ERROR number of histograms < 1 } // allocate histograms - histo = new int* [int(number_histo)]; - if (!histo) - { - Clear(); - file_name.close(); - readstatus = "ERROR Allocating histo[] failed!"; - return 3; // ERROR allocating histogram buffer - } + fHisto.resize(fNumberHisto); - for (i=0; i dummy_vector; - histos_vector.clear(); - for (i=0; i(bin_width); + dum_Float32 = static_cast(fBinWidth); memcpy(buffer+1012, (const char*)&dum_Float32, 4); // write header information @@ -720,22 +690,22 @@ int MuSR_td_PSI_bin::writebin(const char *fileName) // handle histograms ----------------------------------------------------------------- // prepare write buffer - if (buffer) { // get rid of the header buffer + if (buffer) { // Get rid of the header buffer delete [] buffer; - buffer = 0; + buffer = nullptr; } buffer = new char[4*MAXREC]; if (!buffer) { - writestatus = "ERROR Allocating buffer to write data failed!"; + fWriteStatus = "ERROR Allocating buffer to write data failed!"; return 3; // ERROR allocating data buffer } // initialize buffer memset(buffer, 0, 4*MAXREC); bool buffer_empty = false; - for (int i=0; i 0) && (j%MAXREC == 0)) { @@ -758,7 +728,7 @@ int MuSR_td_PSI_bin::writebin(const char *fileName) // clean up if (buffer) { delete [] buffer; - buffer = 0; + buffer = nullptr; } return 0; @@ -843,13 +813,13 @@ typedef struct _FeFileHeaderRec { char RunTitle[TITLESTR+1]; char RunSubTitle[SUBTITLESTR+1]; char DataFormat[DATAFORMATSTR];// data format (automatically converted to) - Int32 HistoResolution; // TDC resolution factor for target format + Int32 HistoResolution; // TDC resolution factor for tarGet format // or pTA timespan Int32 BinOffset; Int32 BinsPerHistogram; Int32 NumberOfDetectors; char DetectorNumberList[DETECTLISTSTR]; // list of detectors to be converted - // to the target data format + // to the tarGet data format /* additional information */ char MeanTemp[TEMPLISTSTR]; char TempDev[TEMPLISTSTR]; @@ -882,7 +852,7 @@ typedef struct _pTATagRec { Int32 Histominb; Int32 Histomaxb; Int32 t0b; /* t0, tfirst tlast in [bins] for automatic data conversion */ - Int32 tfb; /* NOTE: t0b, tfb, tlb are in bin units of the target format!! */ + Int32 tfb; /* NOTE: t0b, tfb, tlb are in bin units of the tarGet format!! */ Int32 tlb; } pTATagRec, *pTATagPtr; @@ -1015,7 +985,7 @@ typedef struct _pTATDC32StatisticRec { /* ---------------------------------------------------------------------- */ //******************************* -//Implementation readmdu +//Implementation ReadMdu //******************************* /*! \brief Method to read a MuSR MDU file @@ -1032,7 +1002,7 @@ typedef struct _pTATDC32StatisticRec { * file to be opened. */ -int MuSR_td_PSI_bin::readmdu(const char * fileName) +int MuSR_td_PSI_bin::ReadMdu(const char * fileName) { std::ifstream file_name; int i, j; @@ -1041,16 +1011,16 @@ int MuSR_td_PSI_bin::readmdu(const char * fileName) if (sizeof(Int32) != 4) { - readstatus = "ERROR Sizeof( Int32 ) data type is not 4 bytes"; + fReadStatus = "ERROR Sizeof( Int32 ) data type is not 4 bytes"; return 1; // ERROR open failed } - filename = fileName; + fFilename = fileName; file_name.open(fileName, std::ios_base::binary); // open PSI bin file if (file_name.fail()) { - readstatus = "ERROR Open "+filename+" failed!"; + fReadStatus = "ERROR Open "+fFilename+" failed!"; return 1; // ERROR open failed } @@ -1061,65 +1031,64 @@ int MuSR_td_PSI_bin::readmdu(const char * fileName) if (file_name.fail()) { file_name.close(); - readstatus = "ERROR Reading "+filename+" header failed!"; + fReadStatus = "ERROR Reading "+fFilename+" header failed!"; return 1; // ERROR reading header failed } // fill header data into member variables - format_id[0] = gpTAfhead.Header.FmtId; - format_id[1] = gpTAfhead.Header.FmtVersion; - format_id[2] = '\0'; + fFormatId[0] = gpTAfhead.Header.FmtId; + fFormatId[1] = gpTAfhead.Header.FmtVersion; + fFormatId[2] = '\0'; - if ((strcmp(format_id,"M3") != 0) && (strcmp(format_id,"T4") != 0) && - (strcmp(format_id,"T5") != 0)) + if ((strcmp(fFormatId,"M3") != 0) && (strcmp(fFormatId,"T4") != 0) && + (strcmp(fFormatId,"T5") != 0)) { file_name.close(); - readstatus = "ERROR Unknown file format in "+filename+"!"; + fReadStatus = "ERROR Unknown file format in "+fFilename+"!"; return 2; // ERROR unsupported version } if (sizeof(pTAFileHeaderRec) != gpTAfhead.NumBytesHeader) { file_name.close(); - readstatus = "ERROR Reading "+filename+" incorrect pTAFileHeaderRec size"; + fReadStatus = "ERROR Reading "+fFilename+" incorrect pTAFileHeaderRec size"; return 1; // ERROR reading header failed } // header size OK read header information - strncpy(sample,&gpTAfhead.Header.RunTitle[0],10); - sample[10] = '\0'; + strncpy(fSample,&gpTAfhead.Header.RunTitle[0],10); + fSample[10] = '\0'; - strncpy(temp, &gpTAfhead.Header.RunTitle[10],10); - temp[10] = '\0'; + strncpy(fTemp, &gpTAfhead.Header.RunTitle[10],10); + fTemp[10] = '\0'; - strncpy(field, &gpTAfhead.Header.RunTitle[20],10); - field[10] = '\0'; + strncpy(fField, &gpTAfhead.Header.RunTitle[20],10); + fField[10] = '\0'; - strncpy(orient,&gpTAfhead.Header.RunTitle[30],10); - orient[10] = '\0'; + strncpy(fOrient,&gpTAfhead.Header.RunTitle[30],10); + fOrient[10] = '\0'; - strncpy(comment,&gpTAfhead.Header.RunSubTitle[0],62); - comment[62] = '\0'; + strncpy(fComment,&gpTAfhead.Header.RunSubTitle[0],62); + fComment[62] = '\0'; - strncpy(&date_start[0],&gpTAfhead.Header.StartDate[0],7); - strncpy(&date_start[7],&gpTAfhead.Header.StartDate[9],2); - date_start[9] = '\0'; + strncpy(&fDateStart[0],&gpTAfhead.Header.StartDate[0],7); + strncpy(&fDateStart[7],&gpTAfhead.Header.StartDate[9],2); + fDateStart[9] = '\0'; - strncpy(&date_stop[0],&gpTAfhead.Header.EndDate[0],7); - strncpy(&date_stop[7],&gpTAfhead.Header.EndDate[9],2); - date_stop[9] = '\0'; + strncpy(&fDateStop[0],&gpTAfhead.Header.EndDate[0],7); + strncpy(&fDateStop[7],&gpTAfhead.Header.EndDate[9],2); + fDateStop[9] = '\0'; - strncpy(time_start,&gpTAfhead.Header.StartTime[0],8); - time_start[8] = '\0'; + strncpy(fTimeStart,&gpTAfhead.Header.StartTime[0],8); + fTimeStart[8] = '\0'; - strncpy(time_stop,&gpTAfhead.Header.EndTime[0],8); - time_stop[8] = '\0'; + strncpy(fTimeStop,&gpTAfhead.Header.EndTime[0],8); + fTimeStop[8] = '\0'; - num_run = gpTAfhead.Header.RunNumber; + fNumRun = gpTAfhead.Header.RunNumber; - if (sizeof(pTATagRec) != gpTAfhead.NumBytesTag) - { + if (sizeof(pTATagRec) != gpTAfhead.NumBytesTag) { file_name.close(); - readstatus = "ERROR Reading "+filename+" incorrect pTATagRec size"; + fReadStatus = "ERROR Reading "+fFilename+" incorrect pTATagRec size"; return 1; // ERROR reading header failed } @@ -1129,23 +1098,22 @@ int MuSR_td_PSI_bin::readmdu(const char * fileName) #endif // read temperature deviation from header string (td0 [td1 [td2 [td3]]]) - number_temper = sscanf(gpTAfhead.Header.TempDev,"%f %f %f %f", - &temp_deviation[0], &temp_deviation[1], &temp_deviation[2], - &temp_deviation[3]); + fNumberTemper = sscanf(gpTAfhead.Header.TempDev,"%f %f %f %f", + &fTempDeviation[0], &fTempDeviation[1], &fTempDeviation[2], + &fTempDeviation[3]); // fill unused - for (i=number_temper; i 0) length_histo -= 1; + // special case: subtract 1 from stored histogram to Get desired histogram length + if (fLengthHisto > 0) fLengthHisto -= 1; - } - else if (strcmp(format_id,"T4") == 0) - { + } else if (strcmp(fFormatId,"T4") == 0) { - if (sizeof(pTATDCSettingsRec) != gpTAfhead.NumBytesSettings) - { + if (sizeof(pTATDCSettingsRec) != gpTAfhead.NumBytesSettings) { file_name.close(); - readstatus = "ERROR Reading "+filename+" incorrect pTATDCSettingsRec size"; + fReadStatus = "ERROR Reading "+fFilename+" incorrect pTATDCSettingsRec size"; return 1; // ERROR reading header failed } - if (sizeof(pTATDCStatisticRec) != gpTAfhead.NumBytesStatistics) - { + if (sizeof(pTATDCStatisticRec) != gpTAfhead.NumBytesStatistics) { file_name.close(); - readstatus = "ERROR Reading "+filename+" incorrect pTATDCStatisticRec size"; + fReadStatus = "ERROR Reading "+fFilename+" incorrect pTATDCStatisticRec size"; return 1; // ERROR reading header failed } @@ -1347,53 +1298,47 @@ int MuSR_td_PSI_bin::readmdu(const char * fileName) tothist = TDCMAXTAGS16; file_name.read((char *)&gpTAsettdc, sizeof gpTAsettdc);//read settings into buffer - if (file_name.fail()) - { + if (file_name.fail()) { file_name.close(); - readstatus = "ERROR Reading "+filename+" settings failed!"; + fReadStatus = "ERROR Reading "+fFilename+" settings failed!"; return 1; // ERROR reading settings failed } file_name.read((char *)&gpTAstattottdc, sizeof gpTAstattottdc); // read stat into buffer - if (file_name.fail()) - { + if (file_name.fail()) { file_name.close(); - readstatus = "ERROR Reading "+filename+" statistics failed!"; + fReadStatus = "ERROR Reading "+fFilename+" statistics failed!"; return 1; // ERROR reading statistics failed } - number_scaler = TDCMAXTAGS16; - for (i=0; i < number_scaler; i++) - { - strncpy(labels_scalers[i],gpTAsettdc.tag[i].Label,MAXLABELSIZE); - labels_scalers[i][MAXLABELSIZE-1] = '\0'; + fNumberScaler = TDCMAXTAGS16; + for (i=0; i < fNumberScaler; i++) { + strncpy(fLabelsScalers[i],gpTAsettdc.tag[i].Label,MAXLABELSIZE); + fLabelsScalers[i][MAXLABELSIZE-1] = '\0'; - scalers[i] = gpTAstattottdc.TagScaler[i]; + fScalers[i] = gpTAstattottdc.TagScaler[i]; } resolutionfactor = gpTAfhead.Header.HistoResolution; if (gpTAsettdc.resolutioncode == 25) - bin_width = 0.0000244140625; + fBinWidth = 0.0000244140625; else if (gpTAsettdc.resolutioncode == 100) - bin_width = 0.00009765625; + fBinWidth = 0.00009765625; else if (gpTAsettdc.resolutioncode == 200) - bin_width = 0.0001953125; + fBinWidth = 0.0001953125; else if (gpTAsettdc.resolutioncode == 800) - bin_width = 0.0007812500; - else - { + fBinWidth = 0.0007812500; + else { file_name.close(); - readstatus = "ERROR "+filename+" settings resolution code failed!"; + fReadStatus = "ERROR "+fFilename+" settings resolution code failed!"; return 1; // ERROR reading settings failed } - length_histo = 0; - number_histo = 0; - for (i=0; i MAXHISTO) - { + if (tothist > MAXHISTO) { std::cout << "ERROR number of histograms " << tothist << " exceedes maximum " << MAXHISTO << "! - Setting maximum number " << std::endl; tothist = MAXHISTO; } #ifdef MIDEBUG1 - cout << "Number of histograms is " << number_histo << endl; - cout << "Histogram length is " << length_histo << endl; + cout << "Number of histograms is " << fNumberHisto << endl; + cout << "Histogram length is " << fLengthHisto << endl; cout << "Resolutionfactor for t0, fg, lg is " << resolutionfactor << endl; #endif - default_binning = resolutionfactor; + fDefaultBinning = resolutionfactor; // allocate histograms - histo = new int* [int(number_histo)]; - if (!histo) - { - Clear(); - file_name.close(); - readstatus = "ERROR Allocating histo failed!"; - return 3; // ERROR allocating histogram buffer - } + fHisto.resize(int(fNumberHisto)); - for (i=0; i dummy_vector; - histos_vector.clear(); - for (i=0,ihist=0; i< tothist; i++) - { + fHistosVector.clear(); + for (i=0,ihist=0; i< tothist; i++) { file_name.read((char *)&tag, sizeof tag); // read tag into buffer - if (file_name.fail()) - { + if (file_name.fail()) { dummy_vector.clear(); Clear(); if (thist != nullptr) { @@ -1594,12 +1499,11 @@ int MuSR_td_PSI_bin::readmdu(const char * fileName) thist = nullptr; } file_name.close(); - readstatus = "ERROR Reading "+filename+" tag failed!"; + fReadStatus = "ERROR Reading "+fFilename+" tag failed!"; return 6; // ERROR reading tag failed } /* read histogram data */ - if (tag.Type == PTATAGC_POSITRON) - { + if (tag.Type == PTATAGC_POSITRON) { int nbins; #ifdef MIDEBUG1 @@ -1607,75 +1511,69 @@ int MuSR_td_PSI_bin::readmdu(const char * fileName) << " Histomax = " << tag.Histomaxb << endl; #endif // is a histogram there? - if ((nbins=(tag.Histomaxb-tag.Histominb + 1))>1) - { + if ((nbins=(tag.Histomaxb-tag.Histominb + 1))>1) { if (thist == nullptr) thist = new Int32[nbins]; if (thist == nullptr) { Clear(); file_name.close(); - readstatus = "ERROR Allocating histogram buffer failed!"; + fReadStatus = "ERROR Allocating histogram buffer failed!"; return 3; // ERROR allocating histogram buffer } file_name.read((char *)thist, sizeof(Int32)*nbins);// read hist into buffer - if (file_name.fail()) - { + if (file_name.fail()) { Clear(); if (thist != nullptr) { delete [] thist; thist = nullptr; } file_name.close(); - readstatus = "ERROR Reading "+filename+" hist failed!"; + fReadStatus = "ERROR Reading "+fFilename+" hist failed!"; return 6; // ERROR reading hist failed } // for pTA only: use histogram only, if histogram was selected // else take all histos but mark not selected - if (selected[i] || (strcmp(format_id,"M3") != 0)) - { + if (selected[i] || (strcmp(fFormatId,"M3") != 0)) { - if (ihist < MAXHISTO) // max number of histos not yet reached? - { + if (ihist < MAXHISTO) { // max number of histos not yet reached? dummy_vector.clear(); - strncpy(labels_histo[ihist],tag.Label,MAXLABELSIZE); - labels_histo[ihist][MAXLABELSIZE-1] = '\0'; + strncpy(fLabelsHisto[ihist],tag.Label,MAXLABELSIZE); + fLabelsHisto[ihist][MAXLABELSIZE-1] = '\0'; // mark with ** when not selected - if (!selected[i] && (strlen(labels_histo[ihist])= first_good[ihist]) && (j <= last_good[ihist])) - events_per_histo[ihist] += *(thist+j-tag.Histominb); + if ((j >= fFirstGood[ihist]) && (j <= fLastGood[ihist])) + fEventsPerHisto[ihist] += *(thist+j-tag.Histominb); } - histos_vector.push_back(dummy_vector); + fHistosVector.push_back(dummy_vector); // only add selected histo(s) to total events if (selected[i]) - total_events += events_per_histo[ihist]; + fTotalEvents += fEventsPerHisto[ihist]; } ihist++; } @@ -1690,14 +1588,14 @@ int MuSR_td_PSI_bin::readmdu(const char * fileName) file_name.close(); - readstatus = "SUCCESS"; - readingok = true; + fReadStatus = "SUCCESS"; + fReadingOk = true; return 0; } //******************************* -//Implementation writemdu +//Implementation WriteMdu //******************************* /*! \brief Method to write a MuSR MDU file @@ -1714,15 +1612,15 @@ int MuSR_td_PSI_bin::readmdu(const char * fileName) * file to be opened. */ -int MuSR_td_PSI_bin::writemdu(const char * fileName) +int MuSR_td_PSI_bin::WriteMdu(const char * fileName) { - std::cerr << std::endl << "MuSR_td_PSI_bin::writemdu - not yet implemented" << std::endl; + std::cerr << std::endl << "MuSR_td_PSI_bin::WriteMdu - not yet implemented" << std::endl; return 0; } //******************************* -//Implementation readingOK +//Implementation ReadingOK //******************************* /*! \brief Method to obtain if reading and processing of the data file was OK. @@ -1731,13 +1629,13 @@ int MuSR_td_PSI_bin::writemdu(const char * fileName) * - true if reading was OK * - false if reading was NOT OK */ -bool MuSR_td_PSI_bin::readingOK() const +bool MuSR_td_PSI_bin::ReadingOK() const { - return readingok; + return fReadingOk; } //******************************* -//Implementation writingOK +//Implementation WritingOK //******************************* /*! \brief Method to obtain if writing and processing of the data file was OK. @@ -1746,9 +1644,9 @@ bool MuSR_td_PSI_bin::readingOK() const * - true if writing was OK * - false if writing was NOT OK */ -bool MuSR_td_PSI_bin::writingOK() const +bool MuSR_td_PSI_bin::WritingOK() const { - return writingok; + return fWritingOk; } //******************************* @@ -1767,59 +1665,59 @@ bool MuSR_td_PSI_bin::writingOK() const * - true if everything is within the PSI-BIN limitations * - false otherwise * - * \param tag tag provided to tell how strict the tests should be. 0=reasonable, 1=strict + * \param tag tag provided to tell how strict the tests should be. 0=reasonable, 1=strict, 2=loose */ bool MuSR_td_PSI_bin::CheckDataConsistency(int tag) { - if (number_histo <= 0) { - consistencyOk = false; - consistencyStatus = "**ERROR** number histograms is zero or less!"; - return consistencyOk; + if (fNumberHisto <= 0) { + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** number histograms is zero or less!"; + return fConsistencyOk; } - if (number_histo > MAXHISTO) { - consistencyOk = false; - consistencyStatus = "**ERROR** number of histograms requested: "; - consistencyStatus += number_histo; - consistencyStatus += ", which is larger than the possible maximum of 32."; - return consistencyOk; + if (fNumberHisto > MAXHISTO) { + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** number of histograms requested: "; + fConsistencyStatus += fNumberHisto; + fConsistencyStatus += ", which is larger than the possible maximum of 32."; + return fConsistencyOk; } - if (length_histo <= 0) { - consistencyOk = false; - consistencyStatus = "**ERROR** histogram length is zero or less!"; - return consistencyOk; + if (fLengthHisto <= 0) { + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** histogram length is zero or less!"; + return fConsistencyOk; } - if (length_histo > 32767) { - consistencyOk = false; - consistencyStatus = "**ERROR** histogram length is too large (maximum being 32767)!"; - return consistencyOk; + if (fLengthHisto > 32767) { + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** histogram length is too large (maximum being 32767)!"; + return fConsistencyOk; } - if ((length_histo % 256 != 0) && (tag == 1)) { - consistencyOk = false; - consistencyStatus = "**ERROR** histogram length is not a multiple of 256!"; - return consistencyOk; + if ((fLengthHisto % 256 != 0) && (tag == 1)) { + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** histogram length is not a multiple of 256!"; + return fConsistencyOk; } - if (number_histo * length_histo > 65536) { - consistencyOk = false; - consistencyStatus = "**ERROR** number_histo * length_histo > 65536!"; - return consistencyOk; + if ((fNumberHisto * fLengthHisto > 65536) && (tag != 2)) { + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** fNumberHisto * fLengthHisto > 65536!"; + return fConsistencyOk; } - if (histo == 0) { - consistencyOk = false; - consistencyStatus = "**ERROR** no histograms present!"; - return consistencyOk; + if (fHisto.size() == 0) { + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** no histograms present!"; + return fConsistencyOk; } - consistencyOk = true; - consistencyStatus = "SUCCESS"; + fConsistencyOk = true; + fConsistencyStatus = "SUCCESS"; - return consistencyOk; + return fConsistencyOk; } @@ -1835,7 +1733,7 @@ bool MuSR_td_PSI_bin::CheckDataConsistency(int tag) */ std::string MuSR_td_PSI_bin::ReadStatus() const { - return readstatus; + return fReadStatus; } //******************************* @@ -1850,7 +1748,7 @@ std::string MuSR_td_PSI_bin::ReadStatus() const */ std::string MuSR_td_PSI_bin::WriteStatus() const { - return writestatus; + return fWriteStatus; } //******************************* @@ -1865,7 +1763,7 @@ std::string MuSR_td_PSI_bin::WriteStatus() const */ std::string MuSR_td_PSI_bin::ConsistencyStatus() const { - return consistencyStatus; + return fConsistencyStatus; } //******************************* @@ -1875,16 +1773,16 @@ std::string MuSR_td_PSI_bin::ConsistencyStatus() const /*! \brief Method to obtain the file name. * * This method gives back: - * - + * - */ std::string MuSR_td_PSI_bin::Filename() const { - return filename; + return fFilename; } //******************************* -//Implementation get_histo_int +//Implementation GetHistoInt //******************************* /*! \brief Method to return the value of a single bin as integer. @@ -1893,21 +1791,21 @@ std::string MuSR_td_PSI_bin::Filename() const * - bin value as int * - 0 if an invalid histogram number or bin is choosen */ -int MuSR_td_PSI_bin::get_histo_int(int histo_num, int j) +int MuSR_td_PSI_bin::GetHistoInt(int histo_num, int j) { - if (!readingok) return 0; + if (!fReadingOk) return 0; - if (( histo_num < 0) || (histo_num >= int(number_histo)) || - (j < 0 ) || (j >= length_histo)) + if (( histo_num < 0) || (histo_num >= int(fNumberHisto)) || + (j < 0 ) || (j >= fLengthHisto)) return 0; #ifdef MIDEBUG - cout << "histos_vector[0][0] = " << histos_vector[0][0] << endl; + cout << "fHistosVector[0][0] = " << fHistosVector[0][0] << endl; #endif - return histo[histo_num][j]; + return fHisto[histo_num][j]; } //******************************* -//Implementation get_histo +//Implementation GetHisto //******************************* /*! \brief Method to return the value of a single bin as double. @@ -1916,62 +1814,63 @@ int MuSR_td_PSI_bin::get_histo_int(int histo_num, int j) * - bin value as double * - 0 if an invalid histogram number or bin is choosen */ -double MuSR_td_PSI_bin::get_histo(int histo_num, int j) +double MuSR_td_PSI_bin::GetHisto(int histo_num, int j) { - if (!readingok) return 0.; + if (!fReadingOk) return 0.; - if (( histo_num < 0) || (histo_num >= int(number_histo)) || - (j < 0 ) || (j >= length_histo)) + if (( histo_num < 0) || (histo_num >= int(fNumberHisto)) || + (j < 0 ) || (j >= fLengthHisto)) return 0.; #ifdef MIDEBUG - cout << "histos_vector[0][0] = " << histos_vector[0][0] << endl; + cout << "fHistosVector[0][0] = " << fHistosVector[0][0] << endl; #endif - return static_cast(histo[histo_num][j]); + return static_cast(fHisto[histo_num][j]); } //******************************* -//Implementation get_histo_array +//Implementation GetHistoArray //******************************* /*! \brief Method to obtain an array of type double containing the values of the histogram \ with binning \ * * This method gives back: - * - an pointer of a double array - * - the NULL pointer if an invalid histogram number or binning is choosen or + * - a double vector + * - an empty vector if an invalid histogram number or binning is choosen or * allocation failed * * The parameters of the method are the integers \ and \ representing the desired histogram number and binning. */ -double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) +std::vector MuSR_td_PSI_bin::GetHistoArray(int histo_num, int binning) { - if (!readingok) return nullptr; + std::vector histo_array; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) - return nullptr; + if (!fReadingOk) return histo_array; - double *histo_array = new double[int(int(length_histo)/binning)]; + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) + return histo_array; - if (!histo_array) return nullptr; + histo_array.resize((int)(fLengthHisto/binning)); - for (int i = 0; i < int(int(length_histo)/binning); i++) - { + if (histo_array.size() == 0) return histo_array; + + for (int i=0; i > histoData, int tag) + int MuSR_td_PSI_bin::PutHistoArrayInt(std::vector > &histoData, int tag) { // check that the number of histograms are within allowed boundaries if ((histoData.size() == 0) || (histoData.size() > 32)) { - consistencyOk = false; - consistencyStatus = "**ERROR** number of histograms out of range! Must be > 0 and < 32."; + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** number of histograms out of range! Must be > 0 and < 32."; return -1; } @@ -2008,18 +1907,22 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) } } if (!ok) { - consistencyOk = false; - consistencyStatus = "**ERROR** not all histograms have the same length!"; + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** not all histograms have the same length!"; return -2; } - // overwrite number_histo - number_histo = static_cast(histoData.size()); + // overwrite fNumberHisto + fNumberHisto = static_cast(histoData.size()); // calculate the allowed histo length int lengthHisto = (65536 / histoData.size()) - ((65536 / histoData.size()) % 256); if (lengthHisto > 32512) lengthHisto = 32512; + if (tag == 2) { + if (lengthHisto > 32512) + lengthHisto = 32512; + } // calculate the needed data length int dataLength = ((int)histoData[0].size()); @@ -2032,56 +1935,30 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) dataLength = (int)histoData[0].size()/rebin; else dataLength = (((int)histoData[0].size()/rebin/256)+1)*256; - } else if (tag == 1) { + } else if ((tag == 1) || (tag == 2)) { if (((int)histoData[0].size() % 256) != 0) dataLength = (((int)histoData[0].size()/256)+1)*256; } - // overwrite length_histo - length_histo = dataLength; - - // clean up if needed - if (histo) { - for (int i=0; i > data; - data.resize(number_histo); + data.resize(fNumberHisto); int val = 0; - for (int i=0; i0) && (j%rebin == 0)) { data[i].push_back(val); @@ -2092,44 +1969,47 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) } // fill the histograms - for (int i=0; i length_histo) - integer_t0[i] = 0; - real_t0[i] = bin_width*integer_t0[i]; - if (first_good[i] > length_histo) - first_good[i] = 0; - if (last_good[i] > length_histo) - last_good[i] = length_histo-1; + for (int i=0; i fLengthHisto) + fIntegerT0[i] = 0; + fRealT0[i] = fBinWidth*fIntegerT0[i]; + if (fFirstGood[i] > fLengthHisto) + fFirstGood[i] = 0; + if (fLastGood[i] > fLengthHisto) + fLastGood[i] = fLengthHisto-1; } } else { - consistencyOk = false; - consistencyStatus = "**ERROR** found unsupported tag!"; + fConsistencyOk = false; + fConsistencyStatus = "**ERROR** found unsupported tag!"; return -3; } @@ -2137,7 +2017,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) } //******************************* -//Implementation get_histo_vector +//Implementation GetHistoVector //******************************* /*! \brief Method to obtain a vector of double containing the values of the histogram @@ -2151,29 +2031,28 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) representing the desired histogram number and binning. */ - std::vector MuSR_td_PSI_bin::get_histo_vector(int histo_num, int binning) + std::vector MuSR_td_PSI_bin::GetHistoVector(int histo_num, int binning) { - std::vector histo_vector; //(int(length_histo/binning)) + std::vector histo_vector; //(int(fLengthHisto/binning)) - if (!readingok) return histo_vector; + if (!fReadingOk) return histo_vector; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return histo_vector; - for (int i = 0; i < int(length_histo/binning); i++) + for (int i = 0; i < int(fLengthHisto/binning); i++) histo_vector.push_back(0.); - for (int i = 0; i < int(length_histo/binning); i++) - { + for (int i = 0; i < int(fLengthHisto/binning); i++) { for (int j = 0; j < binning; j++) - histo_vector[i] += double(histo[histo_num][i*binning+j]); + histo_vector[i] += double(fHisto[histo_num][i*binning+j]); } return histo_vector; } //******************************* -//Implementation get_histo_vector_no0 +//Implementation GetHistoVectorNo0 //******************************* /*! \brief Method to obtain a vector of double containing the values of the @@ -2188,25 +2067,23 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * representing the desired histogram number and binning. */ - std::vector MuSR_td_PSI_bin::get_histo_vector_no0(int histo_num, int binning) + std::vector MuSR_td_PSI_bin::GetHistoVectorNo0(int histo_num, int binning) { - std::vector histo_vector; //(int(length_histo/binning)); + std::vector histo_vector; //(int(fLengthHisto/binning)); - if (!readingok) return histo_vector; + if (!fReadingOk) return histo_vector; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return histo_vector; - for (int i = 0; i < int(length_histo/binning); i++) + for (int i = 0; i < int(fLengthHisto/binning); i++) histo_vector.push_back(0.); - for (int i = 0; i < int(length_histo/binning); i++) - { + for (int i = 0; i < int(fLengthHisto/binning); i++) { for (int j = 0; j < binning; j++) - histo_vector[i] += double(histo[histo_num][i*binning+j]); + histo_vector[i] += double(fHisto[histo_num][i*binning+j]); - if (histo_vector[i] < 0.5 ) - { + if (histo_vector[i] < 0.5 ) { histo_vector[i] = 0.1; } } @@ -2216,42 +2093,42 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //********************************** -//Implementation get_histo_array_int +//Implementation GetHistoArrayInt //********************************** /*! \brief Method to obtain an array of type integer containing the values of the * histogram \ * * This method gives back: - * - an pointer of an integer array - * - the NULL pointer if an invalid histogram number is choosen or allocate failed + * - integer vectors + * - an vector of size 0 if an invalid histogram number is choosen or allocate failed * * The parameter of the method is the integer \ representing the desired * histogram number. */ - int * MuSR_td_PSI_bin::get_histo_array_int(int histo_num) + std::vector MuSR_td_PSI_bin::GetHistoArrayInt(int histo_num) { - if (!readingok) return nullptr; + std::vector histo_array; - if ( histo_num < 0 || histo_num >= int(number_histo)) - return nullptr; + if (!fReadingOk) return histo_array; - int *histo_array = new int[length_histo]; + if ( histo_num < 0 || histo_num >= int(fNumberHisto)) + return histo_array; - if (!histo_array) return nullptr; + histo_array.resize(fLengthHisto); - for (int i = 0; i < int(length_histo); i++) - { - histo_array[i] = int(histo[histo_num][i]); - } + if (histo_array.size() == 0) + return histo_array; + + histo_array = fHisto[histo_num]; return histo_array; } //******************************* -//Implementation get_histo_fromt0_array +//Implementation GetHistoFromT0Array //******************************* /*! \brief Method to obtain an array of type double containing the values of the @@ -2267,24 +2144,23 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * representing the desired histogram number and binning. */ - double * MuSR_td_PSI_bin::get_histo_fromt0_array(int histo_num, int binning, int offset) + double* MuSR_td_PSI_bin::GetHistoFromT0Array(int histo_num, int binning, int offset) { - if (!readingok) return nullptr; + if (!fReadingOk) return nullptr; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return nullptr; double *histo_fromt0_array = - new double[int((int(length_histo)-get_t0_int(histo_num)-offset+1)/binning)]; + new double[int((int(fLengthHisto)-GetT0Int(histo_num)-offset+1)/binning)]; if (!histo_fromt0_array) return nullptr; - for (int i = 0; i < int((int(length_histo)-get_t0_int(histo_num)-offset)/binning); i++) - { + for (int i = 0; i < int((int(fLengthHisto)-GetT0Int(histo_num)-offset)/binning); i++) { histo_fromt0_array[i] = 0; for (int j = 0; j < binning; j++) histo_fromt0_array[i] += - double(histo[histo_num][i*binning+j+get_t0_int(histo_num)+offset]); + double(fHisto[histo_num][i*binning+j+GetT0Int(histo_num)+offset]); } return histo_fromt0_array; @@ -2292,7 +2168,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_histo_fromt0_vector +//Implementation GetHistoFromT0Vector //******************************* /*! \brief Method to obtain a vector of double containing the values of the histogram @@ -2307,23 +2183,22 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * representing the desired histogram number and binning. */ - std::vector MuSR_td_PSI_bin::get_histo_fromt0_vector(int histo_num, int binning, int offset) + std::vector MuSR_td_PSI_bin::GetHistoFromT0Vector(int histo_num, int binning, int offset) { - std::vector histo_fromt0_vector; // (int((int(length_histo)-get_t0_int(histo_num)+1)/binning)); + std::vector histo_fromt0_vector; // (int((int(fLengthHisto)-GetT0Int(histo_num)+1)/binning)); - if (!readingok) return histo_fromt0_vector; + if (!fReadingOk) return histo_fromt0_vector; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return histo_fromt0_vector; - for (int i = 0; i < int((int(length_histo)-get_t0_int(histo_num)-offset)/binning); i++) + for (int i = 0; i < int((int(fLengthHisto)-GetT0Int(histo_num)-offset)/binning); i++) histo_fromt0_vector.push_back(0.); - for (int i = 0; i < int((int(length_histo)-get_t0_int(histo_num)-offset)/binning); i++) - { + for (int i = 0; i < int((int(fLengthHisto)-GetT0Int(histo_num)-offset)/binning); i++) { for (int j = 0; j < binning; j++) histo_fromt0_vector[i] += - double(histo[histo_num][i*binning+j+get_t0_int(histo_num)+offset]); + double(fHisto[histo_num][i*binning+j+GetT0Int(histo_num)+offset]); } return histo_fromt0_vector; @@ -2331,12 +2206,12 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_histo_goodBins_array +//Implementation GetHistoGoodBinsArray //******************************* /*! \brief Method to obtain an array of type double containing the values of the - * histogram \ with binning \ from the point first_good until - * last_good + * histogram \ with binning \ from the point fFirstGood until + * fLastGood * * This method gives back: * - an pointer of a double array @@ -2346,23 +2221,22 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * representing the desired histogram number and binning. */ - double * MuSR_td_PSI_bin::get_histo_goodBins_array(int histo_num, int binning) + double * MuSR_td_PSI_bin::GetHistoGoodBinsArray(int histo_num, int binning) { - if (!readingok) return nullptr; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if (!fReadingOk) return nullptr; + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return nullptr; double *histo_goodBins_array = - new double[int((get_lastGood_int(histo_num)-get_firstGood_int(histo_num)+1)/binning)]; + new double[int((GetLastGoodInt(histo_num)-GetFirstGoodInt(histo_num)+1)/binning)]; if (!histo_goodBins_array) return nullptr; - for (int i = 0; i < int((get_lastGood_int(histo_num)-get_firstGood_int(histo_num))/binning); i++) - { + for (int i = 0; i < int((GetLastGoodInt(histo_num)-GetFirstGoodInt(histo_num))/binning); i++) { histo_goodBins_array[i] = 0; for (int j = 0; j < binning; j++) histo_goodBins_array[i] += - double(histo[histo_num][i*binning+j+get_firstGood_int(histo_num)]); + double(fHisto[histo_num][i*binning+j+GetFirstGoodInt(histo_num)]); } return histo_goodBins_array; @@ -2370,12 +2244,12 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_histo_goodBins_vector +//Implementation GetHistoGoodBinsVector //******************************* /*! \brief Method to obtain a vector of double containing the values of the - * histogram \ with binning \ from the point first_good until - * last_good + * histogram \ with binning \ from the point fFirstGood until + * fLastGood * * This method gives back: * - a vector of double @@ -2385,23 +2259,22 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * representing the desired histogram number and binning. */ - std::vector MuSR_td_PSI_bin::get_histo_goodBins_vector(int histo_num, int binning) + std::vector MuSR_td_PSI_bin::GetHistoGoodBinsVector(int histo_num, int binning) { std::vector histo_goodBins_vector; - if (!readingok) return histo_goodBins_vector; + if (!fReadingOk) return histo_goodBins_vector; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return histo_goodBins_vector; - for (int i = 0; i < int((get_lastGood_int(histo_num)-get_firstGood_int(histo_num))/binning); i++) + for (int i = 0; i < int((GetLastGoodInt(histo_num)-GetFirstGoodInt(histo_num))/binning); i++) histo_goodBins_vector.push_back(0.); - for (int i = 0; i < int((get_lastGood_int(histo_num)-get_firstGood_int(histo_num))/binning); i++) - { + for (int i = 0; i < int((GetLastGoodInt(histo_num)-GetFirstGoodInt(histo_num))/binning); i++) { for (int j = 0; j < binning; j++) histo_goodBins_vector[i] += - double(histo[histo_num][i*binning+j+get_firstGood_int(histo_num)]); + double(fHisto[histo_num][i*binning+j+GetFirstGoodInt(histo_num)]); } return histo_goodBins_vector; @@ -2409,7 +2282,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_histo_fromt0_minus_bckgrd_array +//Implementation GetHistoFromT0MinusBkgArray //******************************* /*! \brief Method to obtain an array of type double containing the values of the @@ -2431,43 +2304,41 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * between which the background is calculated. */ - double * MuSR_td_PSI_bin::get_histo_fromt0_minus_bckgrd_array(int histo_num, - int lower_bckgrd, int higher_bckgrd, int binning, int offset) + double * MuSR_td_PSI_bin::GetHistoFromT0MinusBkgArray(int histo_num, + int lower_bckgrd, int higher_bckgrd, int binning, int offset) { - if (!readingok) return nullptr; + if (!fReadingOk) return nullptr; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return nullptr; - if ( lower_bckgrd < 0 || higher_bckgrd >= int(length_histo) || lower_bckgrd > higher_bckgrd ) + if ( lower_bckgrd < 0 || higher_bckgrd >= int(fLengthHisto) || lower_bckgrd > higher_bckgrd ) return nullptr; double bckgrd = 0; - for (int k = lower_bckgrd; k <= higher_bckgrd; k++) - { - bckgrd += double(histo[histo_num][k]); + for (int k = lower_bckgrd; k <= higher_bckgrd; k++) { + bckgrd += double(fHisto[histo_num][k]); } bckgrd = bckgrd/(higher_bckgrd-lower_bckgrd+1); double *histo_fromt0_minus_bckgrd_array = - new double[int((int(length_histo)-get_t0_int(histo_num)-offset+1)/binning)]; + new double[int((int(fLengthHisto)-GetT0Int(histo_num)-offset+1)/binning)]; if (!histo_fromt0_minus_bckgrd_array) return NULL; - for (int i = 0; i < int((int(length_histo)-get_t0_int(histo_num)-offset)/binning); i++) - { + for (int i = 0; i < int((int(fLengthHisto)-GetT0Int(histo_num)-offset)/binning); i++) { histo_fromt0_minus_bckgrd_array[i] = 0; for (int j = 0; j < binning; j++) histo_fromt0_minus_bckgrd_array[i] += - double(histo[histo_num][i*binning+j+get_t0_int(histo_num)+offset]) - bckgrd; + double(fHisto[histo_num][i*binning+j+GetT0Int(histo_num)+offset]) - bckgrd; } return histo_fromt0_minus_bckgrd_array; } //******************************* -//Implementation get_histo_fromt0_minus_bckgrd_vector +//Implementation GetHistoFromT0MinusBkgVector //******************************* /*! \brief Method to obtain a vector of double containing the values of the @@ -2488,34 +2359,32 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * between which the background is calculated. */ - std::vector MuSR_td_PSI_bin::get_histo_fromt0_minus_bckgrd_vector(int histo_num, int lower_bckgrd, - int higher_bckgrd, int binning, int offset) + std::vector MuSR_td_PSI_bin::GetHistoFromT0MinusBkgVector(int histo_num, int lower_bckgrd, + int higher_bckgrd, int binning, int offset) { - std::vector histo_fromt0_minus_bckgrd_vector; // (int((int(length_histo)-get_t0_int(histo_num)+1)/binning)); + std::vector histo_fromt0_minus_bckgrd_vector; // (int((int(fLengthHisto)-GetT0Int(histo_num)+1)/binning)); - if (!readingok) return histo_fromt0_minus_bckgrd_vector; + if (!fReadingOk) return histo_fromt0_minus_bckgrd_vector; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return histo_fromt0_minus_bckgrd_vector; - if ( lower_bckgrd < 0 || higher_bckgrd >= int(length_histo) || lower_bckgrd > higher_bckgrd ) + if ( lower_bckgrd < 0 || higher_bckgrd >= int(fLengthHisto) || lower_bckgrd > higher_bckgrd ) return histo_fromt0_minus_bckgrd_vector; double bckgrd = 0; - for (int k = lower_bckgrd; k <= higher_bckgrd; k++) - { - bckgrd += double(histo[histo_num][k]); + for (int k = lower_bckgrd; k <= higher_bckgrd; k++) { + bckgrd += double(fHisto[histo_num][k]); } bckgrd = bckgrd/(higher_bckgrd-lower_bckgrd+1); - for (int i = 0; i < int((int(length_histo)-get_t0_int(histo_num)-offset)/binning); i++) + for (int i = 0; i < int((int(fLengthHisto)-GetT0Int(histo_num)-offset)/binning); i++) histo_fromt0_minus_bckgrd_vector.push_back(0.); - for (int i = 0; i < int((int(length_histo)-get_t0_int(histo_num)-offset)/binning); i++) - { + for (int i = 0; i < int((int(fLengthHisto)-GetT0Int(histo_num)-offset)/binning); i++) { for (int j = 0; j < binning; j++) histo_fromt0_minus_bckgrd_vector[i] += - double(histo[histo_num][i*binning+j+get_t0_int(histo_num)+offset]) - bckgrd; + double(fHisto[histo_num][i*binning+j+GetT0Int(histo_num)+offset]) - bckgrd; } return histo_fromt0_minus_bckgrd_vector; @@ -2523,12 +2392,12 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_histo_goodBins_minus_bckgrd_array +//Implementation GetHistoGoodBinsMinusBkgArray //******************************* /*! \brief Method to obtain an array of type double containing the values of the - * histogram \ with binning \ from the point first_good until - * the point last_good. A background calculated from the points \ and + * histogram \ with binning \ from the point fFirstGood until + * the point fLastGood. A background calculated from the points \ and * \ is subtracted * * This method gives back: @@ -2545,35 +2414,33 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * between which the background is calculated. */ - double * MuSR_td_PSI_bin::get_histo_goodBins_minus_bckgrd_array(int histo_num, int lower_bckgrd, - int higher_bckgrd, int binning) + double * MuSR_td_PSI_bin::GetHistoGoodBinsMinusBkgArray(int histo_num, int lower_bckgrd, + int higher_bckgrd, int binning) { - if (!readingok) return nullptr; + if (!fReadingOk) return nullptr; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return nullptr; - if ( lower_bckgrd < 0 || higher_bckgrd >= int(length_histo) || lower_bckgrd > higher_bckgrd ) + if ( lower_bckgrd < 0 || higher_bckgrd >= int(fLengthHisto) || lower_bckgrd > higher_bckgrd ) return nullptr; double bckgrd = 0; - for (int k = lower_bckgrd; k <= higher_bckgrd; k++) - { - bckgrd += double(histo[histo_num][k]); + for (int k = lower_bckgrd; k <= higher_bckgrd; k++) { + bckgrd += double(fHisto[histo_num][k]); } bckgrd = bckgrd/(higher_bckgrd-lower_bckgrd+1); double *histo_goodBins_minus_bckgrd_array = - new double[int((get_lastGood_int(histo_num)-get_firstGood_int(histo_num)+1)/binning)]; + new double[int((GetLastGoodInt(histo_num)-GetFirstGoodInt(histo_num)+1)/binning)]; if (!histo_goodBins_minus_bckgrd_array) return nullptr; - for (int i = 0; i < int((get_lastGood_int(histo_num)-get_firstGood_int(histo_num))/binning); i++) - { + for (int i = 0; i < int((GetLastGoodInt(histo_num)-GetFirstGoodInt(histo_num))/binning); i++) { histo_goodBins_minus_bckgrd_array[i] = 0; for (int j = 0; j < binning; j++) histo_goodBins_minus_bckgrd_array[i] += - double(histo[histo_num][i*binning+j+get_firstGood_int(histo_num)]) - bckgrd; + double(fHisto[histo_num][i*binning+j+GetFirstGoodInt(histo_num)]) - bckgrd; } return histo_goodBins_minus_bckgrd_array; @@ -2581,11 +2448,11 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_histo_goodBins_minus_bckgrd_vector +//Implementation GetHistoGoodBinsMinusBkgVector //******************************* /*! \brief Method to obtain a vector of double containing the values of the histogram \ - * with binning \ from the point first_good until the point last_good. + * with binning \ from the point fFirstGood until the point fLastGood. * A background calculated from the points \ and \ * is subtracted * @@ -2602,34 +2469,32 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * between which the background is calculated. */ - std::vector MuSR_td_PSI_bin::get_histo_goodBins_minus_bckgrd_vector(int histo_num, int lower_bckgrd, - int higher_bckgrd, int binning) + std::vector MuSR_td_PSI_bin::GetHistoGoodBinsMinusBkgVector(int histo_num, int lower_bckgrd, + int higher_bckgrd, int binning) { std::vector histo_goodBins_minus_bckgrd_vector; ; - if (!readingok) return histo_goodBins_minus_bckgrd_vector; + if (!fReadingOk) return histo_goodBins_minus_bckgrd_vector; - if ( histo_num < 0 || histo_num >= int(number_histo) || binning <= 0 ) + if ( histo_num < 0 || histo_num >= int(fNumberHisto) || binning <= 0 ) return histo_goodBins_minus_bckgrd_vector; - if ( lower_bckgrd < 0 || higher_bckgrd >= int(length_histo) || lower_bckgrd > higher_bckgrd ) + if ( lower_bckgrd < 0 || higher_bckgrd >= int(fLengthHisto) || lower_bckgrd > higher_bckgrd ) return histo_goodBins_minus_bckgrd_vector; double bckgrd = 0; - for (int k = lower_bckgrd; k <= higher_bckgrd; k++) - { - bckgrd += double(histo[histo_num][k]); + for (int k = lower_bckgrd; k <= higher_bckgrd; k++) { + bckgrd += double(fHisto[histo_num][k]); } bckgrd = bckgrd/(higher_bckgrd-lower_bckgrd+1); - for (int i = 0; i < int((get_lastGood_int(histo_num)-get_firstGood_int(histo_num))/binning); i++) + for (int i = 0; i < int((GetLastGoodInt(histo_num)-GetFirstGoodInt(histo_num))/binning); i++) histo_goodBins_minus_bckgrd_vector.push_back(0.); - for (int i = 0; i < int((get_lastGood_int(histo_num)-get_firstGood_int(histo_num))/binning); i++) - { + for (int i = 0; i < int((GetLastGoodInt(histo_num)-GetFirstGoodInt(histo_num))/binning); i++) { for (int j = 0; j < binning; j++) histo_goodBins_minus_bckgrd_vector[i] += - double(histo[histo_num][i*binning+j+get_firstGood_int(histo_num)]) - bckgrd; + double(fHisto[histo_num][i*binning+j+GetFirstGoodInt(histo_num)]) - bckgrd; } return histo_goodBins_minus_bckgrd_vector; @@ -2637,7 +2502,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_asymmetry_array +//Implementation GetAsymmetryArray //******************************* /*! \brief Method to obtain an array of double containing the values of the asymmetry between 2 histograms. @@ -2661,46 +2526,44 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * also required. */ - double * MuSR_td_PSI_bin::get_asymmetry_array(int histo_num_plus, int histo_num_minus, double alpha_param, - int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, - int lower_bckgrd_minus, int higher_bckgrd_minus, int offset, - double y_offset) + double* MuSR_td_PSI_bin::GetAsymmetryArray(int histo_num_plus, int histo_num_minus, double alpha_param, + int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, + int lower_bckgrd_minus, int higher_bckgrd_minus, int offset, + double y_offset) { - int max_t0 = tmax(get_t0_int(histo_num_plus),get_t0_int(histo_num_minus)); + int max_t0 = Tmax(GetT0Int(histo_num_plus),GetT0Int(histo_num_minus)); - if (!readingok) return nullptr; + if (!fReadingOk) return nullptr; - if ( histo_num_plus < 0 || histo_num_plus >= int(number_histo) || binning <= 0 ) + if ( histo_num_plus < 0 || histo_num_plus >= int(fNumberHisto) || binning <= 0 ) return nullptr; - if ( histo_num_minus < 0 || histo_num_minus >= int(number_histo) ) + if ( histo_num_minus < 0 || histo_num_minus >= int(fNumberHisto) ) return nullptr; - if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(length_histo) || lower_bckgrd_plus > higher_bckgrd_plus ) + if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(fLengthHisto) || lower_bckgrd_plus > higher_bckgrd_plus ) return nullptr; - if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(length_histo) || lower_bckgrd_minus > higher_bckgrd_minus ) + if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(fLengthHisto) || lower_bckgrd_minus > higher_bckgrd_minus ) return nullptr; - double *dummy_1 = get_histo_fromt0_minus_bckgrd_array(histo_num_plus, lower_bckgrd_plus, - higher_bckgrd_plus, binning, offset); + double *dummy_1 = GetHistoFromT0MinusBkgArray(histo_num_plus, lower_bckgrd_plus, + higher_bckgrd_plus, binning, offset); if (dummy_1 == nullptr) return nullptr; - double *dummy_2 = get_histo_fromt0_minus_bckgrd_array(histo_num_minus, lower_bckgrd_minus, - higher_bckgrd_minus, binning, offset); - if (dummy_2 == nullptr) - { + double *dummy_2 = GetHistoFromT0MinusBkgArray(histo_num_minus, lower_bckgrd_minus, + higher_bckgrd_minus, binning, offset); + if (dummy_2 == nullptr) { delete [] dummy_1; return nullptr; } - double *asymmetry_array = new double[int((int(length_histo)-max_t0-offset+1)/binning)]; + double *asymmetry_array = new double[int((int(fLengthHisto)-max_t0-offset+1)/binning)]; if (!asymmetry_array) return nullptr; - for (int i = 0; i < int((int(length_histo)-max_t0)/binning); i++) - { + for (int i = 0; i < int((int(fLengthHisto)-max_t0)/binning); i++) { asymmetry_array[i] = (dummy_1[i] - alpha_param * dummy_2[i]) / (dummy_1[i] + alpha_param * dummy_2[i]) + y_offset; } @@ -2713,7 +2576,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_asymmetry_vector +//Implementation GetAsymmetryVector //******************************* /*! \brief Method to obtain a vector of double containing the values of the asymmetry between 2 histograms. @@ -2734,45 +2597,43 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * Integers for the binning and for the background limits for both histograms.are also required. */ - std::vector MuSR_td_PSI_bin::get_asymmetry_vector(int histo_num_plus, int histo_num_minus, double alpha_param, - int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, - int lower_bckgrd_minus, int higher_bckgrd_minus, int offset, double y_offset) + std::vector MuSR_td_PSI_bin::GetAsymmetryVector(int histo_num_plus, int histo_num_minus, double alpha_param, + int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, + int lower_bckgrd_minus, int higher_bckgrd_minus, int offset, double y_offset) { - int max_t0 = tmax(get_t0_int(histo_num_plus),get_t0_int(histo_num_minus)); + int max_t0 = Tmax(GetT0Int(histo_num_plus),GetT0Int(histo_num_minus)); - std::vector asymmetry_vector; // (int((int(length_histo)-max_t0+1)/binning)); + std::vector asymmetry_vector; // (int((int(fLengthHisto)-max_t0+1)/binning)); - if (!readingok) return asymmetry_vector; + if (!fReadingOk) return asymmetry_vector; - if ( histo_num_plus < 0 || histo_num_plus >= int(number_histo) || binning <= 0 ) + if ( histo_num_plus < 0 || histo_num_plus >= int(fNumberHisto) || binning <= 0 ) return asymmetry_vector; - if ( histo_num_minus < 0 || histo_num_minus >= int(number_histo) ) + if ( histo_num_minus < 0 || histo_num_minus >= int(fNumberHisto) ) return asymmetry_vector; - if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(length_histo) || lower_bckgrd_plus > higher_bckgrd_plus ) + if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(fLengthHisto) || lower_bckgrd_plus > higher_bckgrd_plus ) return asymmetry_vector; - if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(length_histo) || lower_bckgrd_minus > higher_bckgrd_minus ) + if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(fLengthHisto) || lower_bckgrd_minus > higher_bckgrd_minus ) return asymmetry_vector; - double *dummy_1 = get_histo_fromt0_minus_bckgrd_array(histo_num_plus, lower_bckgrd_plus, - higher_bckgrd_plus, binning, offset); + double *dummy_1 = GetHistoFromT0MinusBkgArray(histo_num_plus, lower_bckgrd_plus, + higher_bckgrd_plus, binning, offset); if (dummy_1 == nullptr) return asymmetry_vector; - double *dummy_2 = get_histo_fromt0_minus_bckgrd_array(histo_num_minus, lower_bckgrd_minus, - higher_bckgrd_minus, binning, offset); - if (dummy_2 == nullptr) - { + double *dummy_2 = GetHistoFromT0MinusBkgArray(histo_num_minus, lower_bckgrd_minus, + higher_bckgrd_minus, binning, offset); + if (dummy_2 == nullptr) { delete [] dummy_1; return asymmetry_vector; } - for (int i = 0; i < int((int(length_histo)-max_t0-offset)/binning); i++) + for (int i = 0; i < int((int(fLengthHisto)-max_t0-offset)/binning); i++) asymmetry_vector.push_back(0.); - for (int i = 0; i < int((int(length_histo)-max_t0-offset)/binning); i++) - { + for (int i = 0; i < int((int(fLengthHisto)-max_t0-offset)/binning); i++) { asymmetry_vector[i] = (dummy_1[i] - alpha_param * dummy_2[i]) / (dummy_1[i] + alpha_param * dummy_2[i]) + y_offset; } @@ -2785,7 +2646,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_error_asymmetry_array +//Implementation GetErrorAsymmetryArray //******************************* /*! \brief Method to obtain an array of double containing the values of the error of the asymmetry between 2 histograms. @@ -2806,44 +2667,42 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * Integers for the binning and for the background limits for both histograms.are also required. */ - double * MuSR_td_PSI_bin::get_error_asymmetry_array(int histo_num_plus, int histo_num_minus, double alpha_param, - int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, - int lower_bckgrd_minus, int higher_bckgrd_minus, int offset) + double * MuSR_td_PSI_bin::GetErrorAsymmetryArray(int histo_num_plus, int histo_num_minus, double alpha_param, + int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, + int lower_bckgrd_minus, int higher_bckgrd_minus, int offset) { - int max_t0 = tmax(get_t0_int(histo_num_plus),get_t0_int(histo_num_minus)); + int max_t0 = Tmax(GetT0Int(histo_num_plus),GetT0Int(histo_num_minus)); - if (!readingok) return nullptr; + if (!fReadingOk) return nullptr; - if ( histo_num_plus < 0 || histo_num_plus >= int(number_histo) || binning <= 0 ) + if ( histo_num_plus < 0 || histo_num_plus >= int(fNumberHisto) || binning <= 0 ) return nullptr; - if ( histo_num_minus < 0 || histo_num_minus >= int(number_histo) ) + if ( histo_num_minus < 0 || histo_num_minus >= int(fNumberHisto) ) return nullptr; - if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(length_histo) || lower_bckgrd_plus > higher_bckgrd_plus ) + if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(fLengthHisto) || lower_bckgrd_plus > higher_bckgrd_plus ) return nullptr; - if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(length_histo) || lower_bckgrd_minus > higher_bckgrd_minus ) + if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(fLengthHisto) || lower_bckgrd_minus > higher_bckgrd_minus ) return nullptr; - double *dummy_1 = get_histo_fromt0_minus_bckgrd_array(histo_num_plus, lower_bckgrd_plus, - higher_bckgrd_plus, binning, offset); + double *dummy_1 = GetHistoFromT0MinusBkgArray(histo_num_plus, lower_bckgrd_plus, + higher_bckgrd_plus, binning, offset); if (dummy_1 == nullptr) return nullptr; - double *dummy_2 = get_histo_fromt0_minus_bckgrd_array(histo_num_minus, lower_bckgrd_minus, - higher_bckgrd_minus, binning, offset); - if (dummy_2 == nullptr) - { + double *dummy_2 = GetHistoFromT0MinusBkgArray(histo_num_minus, lower_bckgrd_minus, + higher_bckgrd_minus, binning, offset); + if (dummy_2 == nullptr) { delete [] dummy_1; return nullptr; } - double *error_asymmetry_array = new double[int((int(length_histo)-max_t0-offset+1)/binning)]; + double *error_asymmetry_array = new double[int((int(fLengthHisto)-max_t0-offset+1)/binning)]; if (!error_asymmetry_array) return nullptr; - for (int i = 0; i < int((length_histo-max_t0-offset)/binning); i++) - { + for (int i = 0; i < int((fLengthHisto-max_t0-offset)/binning); i++) { if (dummy_1[i] < 0.5 || dummy_2[i] < 0.5 ) error_asymmetry_array[i] = 1.0; else @@ -2859,7 +2718,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_error_asymmetry_vector +//Implementation GetErrorAsymmetryVector //******************************* /*! \brief Method to obtain a vector of double containing the values of the error of the asymmetry between 2 histograms. @@ -2879,45 +2738,43 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * Integers for the binning and for the background limits for both histograms.are also required. */ - std::vector MuSR_td_PSI_bin::get_error_asymmetry_vector(int histo_num_plus, int histo_num_minus, double alpha_param, - int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, - int lower_bckgrd_minus, int higher_bckgrd_minus, int offset) + std::vector MuSR_td_PSI_bin::GetErrorAsymmetryVector(int histo_num_plus, int histo_num_minus, double alpha_param, + int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, + int lower_bckgrd_minus, int higher_bckgrd_minus, int offset) { - int max_t0 = tmax(get_t0_int(histo_num_plus),get_t0_int(histo_num_minus)); + int max_t0 = Tmax(GetT0Int(histo_num_plus),GetT0Int(histo_num_minus)); - std::vector error_asymmetry_vector; //(int((int(length_histo)-max_t0+1)/binning)); + std::vector error_asymmetry_vector; //(int((int(fLengthHisto)-max_t0+1)/binning)); - if (!readingok) return error_asymmetry_vector; + if (!fReadingOk) return error_asymmetry_vector; - if ( histo_num_plus < 0 || histo_num_plus >= int(number_histo) || binning <= 0 ) + if ( histo_num_plus < 0 || histo_num_plus >= int(fNumberHisto) || binning <= 0 ) return error_asymmetry_vector; - if ( histo_num_minus < 0 || histo_num_minus >= int(number_histo) ) + if ( histo_num_minus < 0 || histo_num_minus >= int(fNumberHisto) ) return error_asymmetry_vector; - if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(length_histo) || lower_bckgrd_plus > higher_bckgrd_plus ) + if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(fLengthHisto) || lower_bckgrd_plus > higher_bckgrd_plus ) return error_asymmetry_vector; - if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(length_histo) || lower_bckgrd_minus > higher_bckgrd_minus ) + if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(fLengthHisto) || lower_bckgrd_minus > higher_bckgrd_minus ) return error_asymmetry_vector; - double *dummy_1 = get_histo_fromt0_minus_bckgrd_array(histo_num_plus, lower_bckgrd_plus, - higher_bckgrd_plus, binning, offset); + double *dummy_1 = GetHistoFromT0MinusBkgArray(histo_num_plus, lower_bckgrd_plus, + higher_bckgrd_plus, binning, offset); if (dummy_1 == nullptr) return error_asymmetry_vector; - double *dummy_2 = get_histo_fromt0_minus_bckgrd_array(histo_num_minus, lower_bckgrd_minus, - higher_bckgrd_minus, binning, offset); - if (dummy_2 == nullptr) - { + double *dummy_2 = GetHistoFromT0MinusBkgArray(histo_num_minus, lower_bckgrd_minus, + higher_bckgrd_minus, binning, offset); + if (dummy_2 == nullptr) { delete [] dummy_1; return error_asymmetry_vector; } - for (int i = 0; i < int((int(length_histo)-max_t0-offset)/binning); i++) + for (int i = 0; i < int((int(fLengthHisto)-max_t0-offset)/binning); i++) error_asymmetry_vector.push_back(0.); - for (int i = 0; i < int((int(length_histo-max_t0-offset))/binning); i++) - { + for (int i = 0; i < int((int(fLengthHisto-max_t0-offset))/binning); i++) { if (dummy_1[i] < 0.5 || dummy_2[i] < 0.5 ) error_asymmetry_vector[i] = 1.0; else @@ -2933,13 +2790,13 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_asymmetry_goodBins_array +//Implementation GetAsymmetryGoodBinsArray //******************************* /*! \brief Method to obtain an array of double containing the values of the asymmetry between 2 histograms. * - * The array has a size corresponding to the minimum interval between first_good and last_good. - * It begins at the first_good coming at the latest after the corresponding t_0. + * The array has a size corresponding to the minimum interval between fFirstGood and fLastGood. + * It begins at the fFirstGood coming at the latest after the corresponding t_0. * The asymmetry is calculated between the histograms \ and \ with an alpha parameter * \. This method requires also a binning value \, as well as the background limits for both histograms. * @@ -2955,47 +2812,45 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * Integers for the binning and for the background limits for both histograms.are also required. */ - double * MuSR_td_PSI_bin::get_asymmetry_goodBins_array(int histo_num_plus, int histo_num_minus, double alpha_param, - int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, - int lower_bckgrd_minus, int higher_bckgrd_minus) + double * MuSR_td_PSI_bin::GetAsymmetryGoodBinsArray(int histo_num_plus, int histo_num_minus, double alpha_param, + int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, + int lower_bckgrd_minus, int higher_bckgrd_minus) { - int hsize = int((tmin(get_lastGood_int(histo_num_plus)-get_firstGood_int(histo_num_plus), - get_lastGood_int(histo_num_minus)-get_firstGood_int(histo_num_minus))+1)/binning); + int hsize = int((Tmin(GetLastGoodInt(histo_num_plus)-GetFirstGoodInt(histo_num_plus), + GetLastGoodInt(histo_num_minus)-GetFirstGoodInt(histo_num_minus))+1)/binning); - if (!readingok) return nullptr; + if (!fReadingOk) return nullptr; - if ( histo_num_plus < 0 || histo_num_plus >= int(number_histo) || binning <= 0 ) + if ( histo_num_plus < 0 || histo_num_plus >= int(fNumberHisto) || binning <= 0 ) return nullptr; - if ( histo_num_minus < 0 || histo_num_minus >= int(number_histo) ) + if ( histo_num_minus < 0 || histo_num_minus >= int(fNumberHisto) ) return nullptr; - if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(length_histo) || lower_bckgrd_plus > higher_bckgrd_plus ) + if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(fLengthHisto) || lower_bckgrd_plus > higher_bckgrd_plus ) return nullptr; - if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(length_histo) || lower_bckgrd_minus > higher_bckgrd_minus ) + if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(fLengthHisto) || lower_bckgrd_minus > higher_bckgrd_minus ) return nullptr; - double *dummy_1 = get_histo_fromt0_minus_bckgrd_array(histo_num_plus, lower_bckgrd_plus, - higher_bckgrd_plus, binning); + double *dummy_1 = GetHistoFromT0MinusBkgArray(histo_num_plus, lower_bckgrd_plus, + higher_bckgrd_plus, binning); if (dummy_1 == nullptr) return nullptr; - double *dummy_2 = get_histo_fromt0_minus_bckgrd_array(histo_num_minus, lower_bckgrd_minus, - higher_bckgrd_minus, binning); - if (dummy_2 == nullptr) - { + double *dummy_2 = GetHistoFromT0MinusBkgArray(histo_num_minus, lower_bckgrd_minus, + higher_bckgrd_minus, binning); + if (dummy_2 == nullptr) { delete [] dummy_1; return nullptr; } - int hstart = tmax(get_firstGood_int(histo_num_plus)-get_t0_int(histo_num_plus),get_firstGood_int(histo_num_minus)-get_t0_int(histo_num_minus)); + int hstart = Tmax(GetFirstGoodInt(histo_num_plus)-GetT0Int(histo_num_plus),GetFirstGoodInt(histo_num_minus)-GetT0Int(histo_num_minus)); double *asymmetry_goodBins_array = new double[hsize]; if (!asymmetry_goodBins_array) return nullptr; - for (int i = 0; i < hsize; i++) - { + for (int i = 0; i < hsize; i++) { asymmetry_goodBins_array[i] = (dummy_1[i+hstart] - alpha_param * dummy_2[i+hstart]) / (dummy_1[i+hstart] + alpha_param * dummy_2[i+hstart]); } @@ -3008,13 +2863,13 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_asymmetry_goodBins_vector +//Implementation GetAsymmetryGoodBinsVector //******************************* /*! \brief Method to obtain a vector of double containing the values of the asymmetry between 2 histograms. * - * The vector has a size corresponding to the minimum interval between first_good and last_good. - * It begins at the first_good coming at the latest after the corresponding t_0. + * The vector has a size corresponding to the minimum interval between fFirstGood and fLastGood. + * It begins at the fFirstGood coming at the latest after the corresponding t_0. * The asymmetry is calculated between the histograms \ and \ with an alpha parameter * \. This method requires also a binning value \, as well as the background limits for both histograms. * @@ -3029,37 +2884,36 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * Integers for the binning and for the background limits for both histograms.are also required. */ - std::vector MuSR_td_PSI_bin::get_asymmetry_goodBins_vector(int histo_num_plus, int histo_num_minus, double alpha_param, - int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, - int lower_bckgrd_minus, int higher_bckgrd_minus) + std::vector MuSR_td_PSI_bin::GetAsymmetryGoodBinsVector(int histo_num_plus, int histo_num_minus, double alpha_param, + int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, + int lower_bckgrd_minus, int higher_bckgrd_minus) { - int hsize = int((tmin(get_lastGood_int(histo_num_plus)-get_firstGood_int(histo_num_plus), - get_lastGood_int(histo_num_minus)-get_firstGood_int(histo_num_minus))+1)/binning); + int hsize = int((Tmin(GetLastGoodInt(histo_num_plus)-GetFirstGoodInt(histo_num_plus), + GetLastGoodInt(histo_num_minus)-GetFirstGoodInt(histo_num_minus))+1)/binning); std::vector asymmetry_goodBins_vector; - if (!readingok) return asymmetry_goodBins_vector; + if (!fReadingOk) return asymmetry_goodBins_vector; - if ( histo_num_plus < 0 || histo_num_plus >= int(number_histo) || binning <= 0 ) + if ( histo_num_plus < 0 || histo_num_plus >= int(fNumberHisto) || binning <= 0 ) return asymmetry_goodBins_vector; - if ( histo_num_minus < 0 || histo_num_minus >= int(number_histo) ) + if ( histo_num_minus < 0 || histo_num_minus >= int(fNumberHisto) ) return asymmetry_goodBins_vector; - if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(length_histo) || lower_bckgrd_plus > higher_bckgrd_plus ) + if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(fLengthHisto) || lower_bckgrd_plus > higher_bckgrd_plus ) return asymmetry_goodBins_vector; - if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(length_histo) || lower_bckgrd_minus > higher_bckgrd_minus ) + if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(fLengthHisto) || lower_bckgrd_minus > higher_bckgrd_minus ) return asymmetry_goodBins_vector; - double *dummy_1 = get_histo_fromt0_minus_bckgrd_array(histo_num_plus, lower_bckgrd_plus, - higher_bckgrd_plus, binning); + double *dummy_1 = GetHistoFromT0MinusBkgArray(histo_num_plus, lower_bckgrd_plus, + higher_bckgrd_plus, binning); if (dummy_1 == nullptr) return asymmetry_goodBins_vector; - double *dummy_2 = get_histo_fromt0_minus_bckgrd_array(histo_num_minus, lower_bckgrd_minus, - higher_bckgrd_minus, binning); - if (dummy_2 == nullptr) - { + double *dummy_2 = GetHistoFromT0MinusBkgArray(histo_num_minus, lower_bckgrd_minus, + higher_bckgrd_minus, binning); + if (dummy_2 == nullptr) { delete [] dummy_1; return asymmetry_goodBins_vector; } @@ -3067,10 +2921,9 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) for (int i = 0; i < hsize; i++) asymmetry_goodBins_vector.push_back(0.); - int hstart = tmax(get_firstGood_int(histo_num_plus)-get_t0_int(histo_num_plus),get_firstGood_int(histo_num_minus)-get_t0_int(histo_num_minus)); + int hstart = Tmax(GetFirstGoodInt(histo_num_plus)-GetT0Int(histo_num_plus),GetFirstGoodInt(histo_num_minus)-GetT0Int(histo_num_minus)); - for (int i = 0; i < hsize; i++) - { + for (int i = 0; i < hsize; i++) { asymmetry_goodBins_vector[i] = (dummy_1[i+hstart] - alpha_param * dummy_2[i+hstart]) / (dummy_1[i+hstart] + alpha_param * dummy_2[i+hstart]); } @@ -3082,7 +2935,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_error_asymmetry_goodBins_array +//Implementation GetErrorAsymmetryGoodBinsArray //******************************* /*! \brief Method to obtain an array of double containing the values of the error of the asymmetry between 2 histograms. @@ -3103,49 +2956,47 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * Integers for the binning and for the background limits for both histograms are also required. */ - double * MuSR_td_PSI_bin::get_error_asymmetry_goodBins_array(int histo_num_plus, int histo_num_minus, double alpha_param, - int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, - int lower_bckgrd_minus, int higher_bckgrd_minus) + double * MuSR_td_PSI_bin::GetErrorAsymmetryGoodBinsArray(int histo_num_plus, int histo_num_minus, double alpha_param, + int binning, int lower_bckgrd_plus, int higher_bckgrd_plus, + int lower_bckgrd_minus, int higher_bckgrd_minus) { - int hsize = int((tmin(get_lastGood_int(histo_num_plus) - -get_firstGood_int(histo_num_plus), - get_lastGood_int(histo_num_minus) - -get_firstGood_int(histo_num_minus))+1)/binning); + int hsize = int((Tmin(GetLastGoodInt(histo_num_plus) + -GetFirstGoodInt(histo_num_plus), + GetLastGoodInt(histo_num_minus) + -GetFirstGoodInt(histo_num_minus))+1)/binning); - if (!readingok) return nullptr; + if (!fReadingOk) return nullptr; - if ( histo_num_plus < 0 || histo_num_plus >= int(number_histo) || binning <= 0 ) + if ( histo_num_plus < 0 || histo_num_plus >= int(fNumberHisto) || binning <= 0 ) return nullptr; - if ( histo_num_minus < 0 || histo_num_minus >= int(number_histo) ) + if ( histo_num_minus < 0 || histo_num_minus >= int(fNumberHisto) ) return nullptr; - if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(length_histo) || lower_bckgrd_plus > higher_bckgrd_plus ) + if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(fLengthHisto) || lower_bckgrd_plus > higher_bckgrd_plus ) return nullptr; - if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(length_histo) || lower_bckgrd_minus > higher_bckgrd_minus ) + if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(fLengthHisto) || lower_bckgrd_minus > higher_bckgrd_minus ) return nullptr; - double *dummy_1 = get_histo_fromt0_minus_bckgrd_array(histo_num_plus, - lower_bckgrd_plus, higher_bckgrd_plus, binning); + double *dummy_1 = GetHistoFromT0MinusBkgArray(histo_num_plus, + lower_bckgrd_plus, higher_bckgrd_plus, binning); if (dummy_1 == nullptr) return nullptr; - double *dummy_2 = get_histo_fromt0_minus_bckgrd_array(histo_num_minus, - lower_bckgrd_minus, higher_bckgrd_minus, binning); - if (dummy_2 == nullptr) - { + double *dummy_2 = GetHistoFromT0MinusBkgArray(histo_num_minus, + lower_bckgrd_minus, higher_bckgrd_minus, binning); + if (dummy_2 == nullptr) { delete [] dummy_1; return nullptr; } - int hstart = tmax(get_firstGood_int(histo_num_plus)-get_t0_int(histo_num_plus), - get_firstGood_int(histo_num_minus)-get_t0_int(histo_num_minus)); + int hstart = Tmax(GetFirstGoodInt(histo_num_plus)-GetT0Int(histo_num_plus), + GetFirstGoodInt(histo_num_minus)-GetT0Int(histo_num_minus)); double *error_asymmetry_goodBins_array = new double[hsize]; if (!error_asymmetry_goodBins_array) return nullptr; - for (int i = 0; i < hsize; i++) - { + for (int i = 0; i < hsize; i++) { if (dummy_1[i+hstart] < 0.5 || dummy_2[i+hstart] < 0.5 ) error_asymmetry_goodBins_array[i] = 1.0; else @@ -3163,7 +3014,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_error_asymmetry_goodBins_vector +//Implementation GetErrorAsymmetryGoodBinsVector //******************************* /*! \brief Method to obtain a vector of double containing the values of the error of @@ -3187,39 +3038,38 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * Integers for the binning and for the background limits for both histograms.are also required. */ - std::vector MuSR_td_PSI_bin::get_error_asymmetry_goodBins_vector(int histo_num_plus, - int histo_num_minus, double alpha_param, - int binning, int lower_bckgrd_plus, - int higher_bckgrd_plus, - int lower_bckgrd_minus, int higher_bckgrd_minus) + std::vector MuSR_td_PSI_bin::GetErrorAsymmetryGoodBinsVector(int histo_num_plus, + int histo_num_minus, double alpha_param, + int binning, int lower_bckgrd_plus, + int higher_bckgrd_plus, + int lower_bckgrd_minus, int higher_bckgrd_minus) { - int hsize = int((tmin(get_lastGood_int(histo_num_plus)-get_firstGood_int(histo_num_plus), - get_lastGood_int(histo_num_minus)-get_firstGood_int(histo_num_minus))+1)/binning); + int hsize = int((Tmin(GetLastGoodInt(histo_num_plus)-GetFirstGoodInt(histo_num_plus), + GetLastGoodInt(histo_num_minus)-GetFirstGoodInt(histo_num_minus))+1)/binning); std::vector error_asymmetry_goodBins_vector; - if (!readingok) return error_asymmetry_goodBins_vector; + if (!fReadingOk) return error_asymmetry_goodBins_vector; - if ( histo_num_plus < 0 || histo_num_plus >= int(number_histo) || binning <= 0 ) + if ( histo_num_plus < 0 || histo_num_plus >= int(fNumberHisto) || binning <= 0 ) return error_asymmetry_goodBins_vector; - if ( histo_num_minus < 0 || histo_num_minus >= int(number_histo) ) + if ( histo_num_minus < 0 || histo_num_minus >= int(fNumberHisto) ) return error_asymmetry_goodBins_vector; - if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(length_histo) || lower_bckgrd_plus > higher_bckgrd_plus ) + if ( lower_bckgrd_plus < 0 || higher_bckgrd_plus >= int(fLengthHisto) || lower_bckgrd_plus > higher_bckgrd_plus ) return error_asymmetry_goodBins_vector; - if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(length_histo) || lower_bckgrd_minus > higher_bckgrd_minus ) + if ( lower_bckgrd_minus < 0 || higher_bckgrd_minus >= int(fLengthHisto) || lower_bckgrd_minus > higher_bckgrd_minus ) return error_asymmetry_goodBins_vector; - double *dummy_1 = get_histo_fromt0_minus_bckgrd_array(histo_num_plus, lower_bckgrd_plus, - higher_bckgrd_plus, binning); + double *dummy_1 = GetHistoFromT0MinusBkgArray(histo_num_plus, lower_bckgrd_plus, + higher_bckgrd_plus, binning); if (dummy_1 == nullptr) return error_asymmetry_goodBins_vector; - double *dummy_2 = get_histo_fromt0_minus_bckgrd_array(histo_num_minus, lower_bckgrd_minus, - higher_bckgrd_minus, binning); - if (dummy_2 == nullptr) - { + double *dummy_2 = GetHistoFromT0MinusBkgArray(histo_num_minus, lower_bckgrd_minus, + higher_bckgrd_minus, binning); + if (dummy_2 == nullptr) { delete [] dummy_1; return error_asymmetry_goodBins_vector; } @@ -3227,10 +3077,9 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) for (int i = 0; i < hsize; i++) error_asymmetry_goodBins_vector.push_back(0.); - int hstart = tmax(get_firstGood_int(histo_num_plus)-get_t0_int(histo_num_plus),get_firstGood_int(histo_num_minus)-get_t0_int(histo_num_minus)); + int hstart = Tmax(GetFirstGoodInt(histo_num_plus)-GetT0Int(histo_num_plus),GetFirstGoodInt(histo_num_minus)-GetT0Int(histo_num_minus)); - for (int i = 0; i < hsize; i++) - { + for (int i = 0; i < hsize; i++) { if (dummy_1[i+hstart] < 0.5 || dummy_2[i+hstart] < 0.5 ) error_asymmetry_goodBins_vector[i] = 1.0; else @@ -3247,19 +3096,19 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_numberScaler_int +//Implementation GetNumberScalerInt //******************************* /*! \brief Method returning an integer representing the number of histograms */ - int MuSR_td_PSI_bin::get_numberScaler_int() + int MuSR_td_PSI_bin::GetNumberScalerInt() { - return int(number_scaler); + return int(fNumberScaler); } //******************************* - //Implementation put_numberScaler_int + //Implementation PutNumberScalerInt //******************************* /*! \brief Method seting the number of scalers present @@ -3271,35 +3120,35 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param val the number of scalers present */ - int MuSR_td_PSI_bin::put_numberScaler_int(int val) + int MuSR_td_PSI_bin::PutNumberScalerInt(int val) { if ((val < 0) || (val >= MAXSCALER)) return -1; - number_scaler = val; + fNumberScaler = val; return 0; } //******************************* -//Implementation get_scalers_vector +//Implementation GetScalersVector //******************************* /*! \brief Method providing a vector of long containing the values of the scalers */ - std::vector MuSR_td_PSI_bin::get_scalers_vector() + std::vector MuSR_td_PSI_bin::GetScalersVector() { - std::vector scalers_vect(number_scaler); + std::vector scalers_vect(fNumberScaler); - for ( int i = 0; i < number_scaler; i++ ) - scalers_vect[i] = long(scalers[i]); + for ( int i = 0; i < fNumberScaler; i++ ) + scalers_vect[i] = long(fScalers[i]); return scalers_vect; } //******************************* - //Implementation put_scalers_vector + //Implementation PutScalersVector //******************************* /*! \brief Method set a vector of long containing the values of the scalers @@ -3311,39 +3160,38 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param scalerData vector */ - int MuSR_td_PSI_bin::put_scalers_vector(std::vector scalerData) + int MuSR_td_PSI_bin::PutScalersVector(std::vector scalerData) { if ((int)scalerData.size() > MAXSCALER) return -1; for (unsigned int i=0; i max_t0) - max_t0 = int(integer_t0[i]); + for (int i = 0; i < int(fNumberHisto); i++) { + if (int(fIntegerT0[i]) > max_t0) + max_t0 = int(fIntegerT0[i]); } return max_t0; } //******************************* -//Implementation get_max_2_t0_int +//Implementation GetMax2T0Int //******************************* /*! \brief Method to determine the maximum value of the last good bins of 2 histograms @@ -3351,20 +3199,20 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * returns -1 if the numbers of the histograms are invalid */ - int MuSR_td_PSI_bin::get_max_2_t0_int(int k, int j) + int MuSR_td_PSI_bin::GetMax2T0Int(int k, int j) { - if (( k < 0 || k >= int(number_histo)) || ( j < 0 || j >= int(number_histo))) + if (( k < 0 || k >= int(fNumberHisto)) || ( j < 0 || j >= int(fNumberHisto))) return -1; - int max_t0 = int(integer_t0[j]); - if (int(integer_t0[k]) >= max_t0) - max_t0 = int(integer_t0[k]); + int max_t0 = int(fIntegerT0[j]); + if (int(fIntegerT0[k]) >= max_t0) + max_t0 = int(fIntegerT0[k]); return max_t0; } //******************************* -//Implementation get_min_2_t0_int +//Implementation GetMin2T0Int //******************************* /*! \brief Method to determine the minimum value of the last good bins of 2 histograms @@ -3372,33 +3220,32 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * returns -1 if the numbers of the histograms are invalid */ - int MuSR_td_PSI_bin::get_min_2_t0_int(int k, int j) + int MuSR_td_PSI_bin::GetMin2T0Int(int k, int j) { - if (( k < 0 || k >= int(number_histo)) || ( j < 0 || j >= int(number_histo))) + if (( k < 0 || k >= int(fNumberHisto)) || ( j < 0 || j >= int(fNumberHisto))) return -1; - int min_t0 = int(integer_t0[j]); - if (int(integer_t0[k]) <= min_t0) - min_t0 = int(integer_t0[k]); + int min_t0 = int(fIntegerT0[j]); + if (int(fIntegerT0[k]) <= min_t0) + min_t0 = int(fIntegerT0[k]); return min_t0; } //******************************* -//Implementation get_min_t0_int +//Implementation GetMinT0Int //******************************* /*! \brief Method to determine the minimum value of the t0 bins */ - int MuSR_td_PSI_bin::get_min_t0_int() + int MuSR_td_PSI_bin::GetMinT0Int() { - int min_t0 = int(length_histo); + int min_t0 = int(fLengthHisto); - for (int i = 0; i < int(number_histo); i++) - { - if (int(integer_t0[i]) < min_t0) - min_t0 = int(integer_t0[i]); + for (int i = 0; i < int(fNumberHisto); i++) { + if (int(fIntegerT0[i]) < min_t0) + min_t0 = int(fIntegerT0[i]); } return min_t0; @@ -3406,19 +3253,19 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation get_binWidth_ps +//Implementation GetBinWidthPicoSec //******************************* /*! \brief Method returning a double representing the bin-width in picoseconds */ - double MuSR_td_PSI_bin::get_binWidth_ps() + double MuSR_td_PSI_bin::GetBinWidthPicoSec() { - return bin_width*1.0e6; + return fBinWidth*1.0e6; } //******************************* - //Implementation put_binWidth_ps + //Implementation PutBinWidthPicoSec //******************************* /*! \brief Method setting a double representing the bin-width in picoseconds @@ -3426,25 +3273,25 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param binWidth bin-width given in picoseconds */ - void MuSR_td_PSI_bin::put_binWidth_ps(double binWidth) + void MuSR_td_PSI_bin::PutBinWidthPicoSec(double binWidth) { - bin_width = binWidth*1.0e-6; + fBinWidth = binWidth*1.0e-6; } //******************************* -//Implementation get_binWidth_ns +//Implementation GetBinWidthNanoSec //******************************* /*! \brief Method returning a double representing the bin-width in nanoseconds */ - double MuSR_td_PSI_bin::get_binWidth_ns() + double MuSR_td_PSI_bin::GetBinWidthNanoSec() { - return bin_width*1.0e3; + return fBinWidth*1.0e3; } //******************************* - //Implementation put_binWidth_ns + //Implementation PutBinWidthNanoSec //******************************* /*! \brief Method setting a double representing the bin-width in nanoseconds @@ -3452,25 +3299,25 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param binWidth bin-width given in nanoseconds */ - void MuSR_td_PSI_bin::put_binWidth_ns(double binWidth) + void MuSR_td_PSI_bin::PutBinWidthNanoSec(double binWidth) { - bin_width = binWidth*1.0e-3; + fBinWidth = binWidth*1.0e-3; } //******************************* -//Implementation get_binWidth_us +//Implementation GetBinWidthMicroSec //******************************* /*! \brief Method returning a double representing the bin-width in microseconds */ - double MuSR_td_PSI_bin::get_binWidth_us() + double MuSR_td_PSI_bin::GetBinWidthMicroSec() { - return bin_width; + return fBinWidth; } //******************************* - //Implementation put_binWidth_us + //Implementation PutBinWidthMicroSec //******************************* /*! \brief Method setting a double representing the bin-width in microseconds @@ -3478,49 +3325,13 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param binWidth bin-width given in microseconds */ - void MuSR_td_PSI_bin::put_binWidth_us(double binWidth) + void MuSR_td_PSI_bin::PutBinWidthMicroSec(double binWidth) { - bin_width = binWidth; + fBinWidth = binWidth; } //******************************* -//Implementation get_histoLength_bin -//******************************* - -/*! \brief Method returning an integer representing the histogram length in bins - */ - - int MuSR_td_PSI_bin::get_histoLength_bin() - { - return int(length_histo); - } - -//******************************* -//Implementation get_numberHisto_int -//******************************* - -/*! \brief Method returning an integer representing the number of histograms - */ - - int MuSR_td_PSI_bin::get_numberHisto_int() - { - return int(number_histo); - } - -//******************************* -//Implementation get_totalEvents_long -//******************************* - -/*! \brief Method returning a long representing the total number of events - */ - - long MuSR_td_PSI_bin::get_totalEvents_long() - { - return long(total_events); - } - -//******************************* -//Implementation get_eventsHisto_long +//Implementation GetEventsHistoLong //******************************* /*! \brief Method returning a long representing the number of events in a specified histograms @@ -3528,32 +3339,32 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * A value of -1 is returned if the value of the histogram \ specified is invalid. */ - long MuSR_td_PSI_bin::get_eventsHisto_long(int i) + long MuSR_td_PSI_bin::GetEventsHistoLong(int i) { - if ( i < 0 || i >= number_histo) + if ( i < 0 || i >= fNumberHisto) return -1; else - return long(events_per_histo[i]); + return long(fEventsPerHisto[i]); } //******************************* -//Implementation get_eventsHisto_vector +//Implementation GetEventsHistoVector //******************************* /*! \brief Method returning a vector of long containing the number of events in the histograms */ - std::vector MuSR_td_PSI_bin::get_eventsHisto_vector() + std::vector MuSR_td_PSI_bin::GetEventsHistoVector() { - std::vector eventsHisto(number_histo); + std::vector eventsHisto(fNumberHisto); - for ( int i = 0; i < number_histo; i++ ) - eventsHisto[i] = long(events_per_histo[i]); + for ( int i = 0; i < fNumberHisto; i++ ) + eventsHisto[i] = long(fEventsPerHisto[i]); return eventsHisto; } //******************************* -//Implementation get_t0_double +//Implementation GetT0Double //******************************* /*! \brief Method returning a double representing the t0 point (from the "real" t0 in the header) for a specified histogram @@ -3561,33 +3372,33 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * A value of -1. is returned if the value of the histogram \ specified is invalid. */ - double MuSR_td_PSI_bin::get_t0_double(int i) + double MuSR_td_PSI_bin::GetT0Double(int i) { - if ( i < 0 || i >= int(number_histo)) + if ( i < 0 || i >= int(fNumberHisto)) return -1.; else - return double(real_t0[i]); + return double(fRealT0[i]); } //******************************* -//Implementation get_default_binning +//Implementation GetDefaultBinning //******************************* /*! \brief Method returning an integer representing the default binning * */ - int MuSR_td_PSI_bin::get_default_binning() + int MuSR_td_PSI_bin::GetDefaultBinning() { - if (default_binning < 1) + if (fDefaultBinning < 1) return 1; else - return default_binning; + return fDefaultBinning; } //******************************* -//Implementation get_t0_int +//Implementation GetT0Int //******************************* /*! \brief Method returning an integer representing the t0 point (from the "integer" t0 in the header) for a specified histogram @@ -3595,16 +3406,16 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * A value of -1 is returned if the value of the histogram \ specified is invalid. */ - int MuSR_td_PSI_bin::get_t0_int(int i) + int MuSR_td_PSI_bin::GetT0Int(int i) { - if ( i < 0 || i >= int(number_histo)) + if ( i < 0 || i >= int(fNumberHisto)) return -1; else - return int(integer_t0[i]); + return int(fIntegerT0[i]); } //******************************* - //Implementation put_t0_int + //Implementation PutT0Int //******************************* /*! \brief Method setting an integer representing the t0 point (from the "integer" t0 in the header) for a specified histogram @@ -3617,35 +3428,35 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param t0 t0 bin value */ - int MuSR_td_PSI_bin::put_t0_int(int histoNo, int t0) + int MuSR_td_PSI_bin::PutT0Int(int histoNo, int t0) { if ((histoNo < 0) || (histoNo >= MAXHISTO)) return -1; - integer_t0[histoNo] = t0; + fIntegerT0[histoNo] = t0; return 0; } //******************************* -//Implementation get_t0_vector +//Implementation GetT0Vector //******************************* /*! \brief Method returning a vector of integer containing the t0 values of the histograms specified in the header */ - std::vector MuSR_td_PSI_bin::get_t0_vector() + std::vector MuSR_td_PSI_bin::GetT0Vector() { - std::vector t0(number_histo); + std::vector t0(fNumberHisto); - for ( int i = 0; i < int(number_histo); i++ ) - t0[i] = int(integer_t0[i]); + for ( int i = 0; i < int(fNumberHisto); i++ ) + t0[i] = int(fIntegerT0[i]); return t0; } //******************************* - //Implementation put_t0_vector + //Implementation PutT0Vector //******************************* /*! \brief Method setting a vector of integer containing the t0 values of the histograms specified in the header @@ -3655,19 +3466,19 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * - -1 if t0Data is too long (>MAXHISTO) */ - int MuSR_td_PSI_bin::put_t0_vector(std::vector &t0Data) + int MuSR_td_PSI_bin::PutT0Vector(std::vector &t0Data) { if (static_cast(t0Data.size()) >= MAXHISTO) return -1; for (unsigned int i=0; i specified is invalid. */ - int MuSR_td_PSI_bin::get_firstGood_int(int i) + int MuSR_td_PSI_bin::GetFirstGoodInt(int i) { - if ( i < 0 || i >= int(number_histo)) + if ( i < 0 || i >= int(fNumberHisto)) return -1; else - return int(first_good[i]); + return int(fFirstGood[i]); } //******************************* - //Implementation put_firstGood_int + //Implementation PutFirstGoodInt //******************************* /*! \brief Method setting an integer representing the first good bin specified in the header for a specified histogram @@ -3697,35 +3508,35 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param j first good bin value */ - int MuSR_td_PSI_bin::put_firstGood_int(int i, int j) + int MuSR_td_PSI_bin::PutFirstGoodInt(int i, int j) { if ((i < 0) || (i >= MAXHISTO)) return -1; - first_good[i] = j; + fFirstGood[i] = j; return 0; } //******************************* -//Implementation get_firstGood_vector +//Implementation GetFirstGoodVector //******************************* /*! \brief Method returning a vector of integer containing the first good bin values of the histograms specified in the header */ - std::vector MuSR_td_PSI_bin::get_firstGood_vector() + std::vector MuSR_td_PSI_bin::GetFirstGoodVector() { - std::vector firstGood(number_histo); + std::vector firstGood(fNumberHisto); - for ( int i = 0; i < number_histo; i++ ) - firstGood[i] = int(first_good[i]); + for ( int i = 0; i < fNumberHisto; i++ ) + firstGood[i] = int(fFirstGood[i]); return firstGood; } //******************************* -//Implementation get_lastGood_int +//Implementation GetLastGoodInt //******************************* /*! \brief Method returning an integer representing the last good bin specified in the header for a specified histogram @@ -3733,53 +3544,52 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * A value of -1 is returned if the value of the histogram \ specified is invalid. */ - int MuSR_td_PSI_bin::get_lastGood_int(int i) + int MuSR_td_PSI_bin::GetLastGoodInt(int i) { - if ( i < 0 || i >= int(number_histo)) + if ( i < 0 || i >= int(fNumberHisto)) return -1; else - return int(last_good[i]); + return int(fLastGood[i]); } //******************************* -//Implementation get_lastGood_vector +//Implementation GetLastGoodVector //******************************* /*! \brief Method returning a vector of integer containing the last good bin values of the histograms specified in the header */ - std::vector MuSR_td_PSI_bin::get_lastGood_vector() + std::vector MuSR_td_PSI_bin::GetLastGoodVector() { - std::vector lastGood(number_histo); + std::vector lastGood(fNumberHisto); - for ( int i = 0; i < number_histo; i++ ) - lastGood[i] = int(last_good[i]); + for ( int i = 0; i < fNumberHisto; i++ ) + lastGood[i] = int(fLastGood[i]); return lastGood; } //******************************* -//Implementation get_max_lastGoog_int +//Implementation GetMaxLastGoodInt //******************************* /*! \brief Method returning an integer containing the maximum value of the "last good bins" of all histograms */ - int MuSR_td_PSI_bin::get_max_lastGood_int() + int MuSR_td_PSI_bin::GetMaxLastGoodInt() { int max_lastGood = 0; - for (int i = 0; i < int(number_histo); i++) - { - if (int(last_good[i]) > max_lastGood) - max_lastGood = int(last_good[i]); + for (int i = 0; i < int(fNumberHisto); i++) { + if (int(fLastGood[i]) > max_lastGood) + max_lastGood = int(fLastGood[i]); } return max_lastGood; } //******************************* -//Implementation get_max_2_lastGood_int +//Implementation GetMax2LastGoodInt //******************************* /*! \brief Method to determine the maximum value of the "last good bins" of 2 histograms @@ -3787,43 +3597,41 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * returns -1 if something is invalid */ - int MuSR_td_PSI_bin::get_max_2_lastGood_int(int k, int j) + int MuSR_td_PSI_bin::GetMax2LastGoodInt(int k, int j) { - if (( k < 0 || k >= int(number_histo)) || ( j < 0 || j >= int(number_histo))) + if (( k < 0 || k >= int(fNumberHisto)) || ( j < 0 || j >= int(fNumberHisto))) return -1; - else - { - int max_lastGood = int(last_good[j]); + else { + int max_lastGood = int(fLastGood[j]); - if (int(last_good[k]) > max_lastGood) - max_lastGood = int(last_good[k]); + if (int(fLastGood[k]) > max_lastGood) + max_lastGood = int(fLastGood[k]); return max_lastGood; } } //******************************* -//Implementation get_min_lastGood_int +//Implementation GetMinLastGoodInt //******************************* /*! \brief Method providing the minimum value of the last good bins */ - int MuSR_td_PSI_bin::get_min_lastGood_int() + int MuSR_td_PSI_bin::GetMinLastGoodInt() { - int min_lastGood = int(last_good[0]); + int min_lastGood = int(fLastGood[0]); - for (int i = 1; i < int(number_histo); i++) - { - if (int(last_good[i]) < min_lastGood) - min_lastGood = int(last_good[i]); + for (int i = 1; i < int(fNumberHisto); i++) { + if (int(fLastGood[i]) < min_lastGood) + min_lastGood = int(fLastGood[i]); } return min_lastGood; } //******************************* -//Implementation get_min_2_lastGood_int +//Implementation GetMin2LastGoodInt //******************************* /*! \brief Method to determine the minimum value of the last good bins of 2 histograms @@ -3831,23 +3639,22 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * returns -1 if something is invalid */ - int MuSR_td_PSI_bin::get_min_2_lastGood_int(int k, int j) + int MuSR_td_PSI_bin::GetMin2LastGoodInt(int k, int j) { - if (( k < 0 || k >= int(number_histo)) || ( j < 0 || j >= int(number_histo))) + if (( k < 0 || k >= int(fNumberHisto)) || ( j < 0 || j >= int(fNumberHisto))) return -1; - else - { - int min_lastGood = int(last_good[j]); + else { + int min_lastGood = int(fLastGood[j]); - if (int(last_good[k]) < min_lastGood) - min_lastGood = int(last_good[k]); + if (int(fLastGood[k]) < min_lastGood) + min_lastGood = int(fLastGood[k]); return min_lastGood; } } //******************************* -//Implementation put_lastGood_int +//Implementation PutLastGoodInt //******************************* /*! \brief Method to modify the last good bin (value \) of the histogram \ @@ -3855,32 +3662,18 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * returns -1 if the histogram specified was invalid */ - int MuSR_td_PSI_bin::put_lastGood_int(int i, int j) + int MuSR_td_PSI_bin::PutLastGoodInt(int i, int j) { - if ((i < 0) || (i >= number_histo)) + if ((i < 0) || (i >= fNumberHisto)) return -1; - last_good[i] = j; + fLastGood[i] = j; return 0; } - //******************************* -//Implementation get_runNumber_int -//******************************* - -/*! \brief Method returning an integer containing the run number - */ - - int MuSR_td_PSI_bin::get_runNumber_int() - { - return int(num_run); - } - - -//******************************* -//Implementation put_runNumber_int +//Implementation PutRunNumberInt //******************************* /*! \brief Method to modify the run number (value \) @@ -3888,152 +3681,152 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * returns -1 if the integer specified was wrong */ - int MuSR_td_PSI_bin::put_runNumber_int(int i) + int MuSR_td_PSI_bin::PutRunNumberInt(int i) { if (i <= 0 ) return -1; - num_run = i; + fNumRun = i; return 0; } //******************************* -//Implementation get_sample() +//Implementation GetSample() //******************************* -/*! \brief Method returning a string containing the sample name +/*! \brief Method returning a string containing the fSample name */ - std::string MuSR_td_PSI_bin::get_sample() + std::string MuSR_td_PSI_bin::GetSample() { std::string strData; - strData = sample; + strData = fSample; return strData; } //******************************* - //Implementation put_sample() + //Implementation PutSample() //******************************* - /*! \brief Method setting a string containing the sample name + /*! \brief Method setting a string containing the fSample name * * return: * - 0 on success - * - -1 if the provided sample string is too long (>= 11 char) + * - -1 if the provided fSample string is too long (>= 11 char) * - * \param sample string containing the sample information + * \param fSample string containing the fSample information */ - int MuSR_td_PSI_bin::put_sample(std::string sampleStr) + int MuSR_td_PSI_bin::PutSample(std::string sampleStr) { if (sampleStr.size() >= 11) return -1; - strcpy(sample, sampleStr.c_str()); + strcpy(fSample, sampleStr.c_str()); return 0; } //******************************* -//Implementation get_temp() +//Implementation GetTemp() //******************************* /*! \brief Method returning a string containing the temperature specified in the title */ - std::string MuSR_td_PSI_bin::get_temp() + std::string MuSR_td_PSI_bin::GetTemp() { std::string strData; - strData = temp; + strData = fTemp; return strData; } //******************************* - //Implementation put_temp() + //Implementation PutTemp() //******************************* - /*! \brief Method setting a string containing the sample temperature + /*! \brief Method setting a string containing the fSample temperature * * return: * - 0 on success * - -1 if the provided temperature string is too long (>= 11 char) * - * \param tempStr string containing the sample information + * \param tempStr string containing the fSample information */ - int MuSR_td_PSI_bin::put_temp(std::string tempStr) + int MuSR_td_PSI_bin::PutTemp(std::string tempStr) { if (tempStr.size() >= 11) return -1; - strcpy(temp, tempStr.c_str()); + strcpy(fTemp, tempStr.c_str()); return 0; } //******************************* -//Implementation get_orient() +//Implementation GetOrient() //******************************* /*! \brief Method returning a string containing the orientation specified in the title */ - std::string MuSR_td_PSI_bin::get_orient() + std::string MuSR_td_PSI_bin::GetOrient() { std::string strData; - strData = orient; + strData = fOrient; return strData; } //******************************* - //Implementation put_orient() + //Implementation PutOrient() //******************************* - /*! \brief Method setting a string containing the sample orientation + /*! \brief Method setting a string containing the fSample orientation * * return: * - 0 on success * - -1 if the provided orientation string is too long (>= 11 char) * - * \param orientStr string containing the sample information + * \param orientStr string containing the fSample information */ - int MuSR_td_PSI_bin::put_orient(std::string orientStr) + int MuSR_td_PSI_bin::PutOrient(std::string orientStr) { if (orientStr.size() >= 11) return -1; - strcpy(orient, orientStr.c_str()); + strcpy(fOrient, orientStr.c_str()); return 0; } //******************************* -//Implementation get_field() +//Implementation GetField() //******************************* /*! \brief Method returning a string containing the field specified in the title */ - std::string MuSR_td_PSI_bin::get_field() + std::string MuSR_td_PSI_bin::GetField() { std::string strData; - strData = field; + strData = fField; return strData; } //******************************* - //Implementation put_field() + //Implementation PutField() //******************************* /*! \brief Method setting a string containing the field @@ -4045,34 +3838,34 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param fieldStr string containing the field */ - int MuSR_td_PSI_bin::put_field(std::string fieldStr) + int MuSR_td_PSI_bin::PutField(std::string fieldStr) { if (fieldStr.size() >= 11) return -1; - strcpy(field, fieldStr.c_str()); + strcpy(fField, fieldStr.c_str()); return 0; } //******************************* - //Implementation get_setup() + //Implementation GetSetup() //******************************* /*! \brief Method returning a string containing the setup */ - std::string MuSR_td_PSI_bin::get_setup() + std::string MuSR_td_PSI_bin::GetSetup() { std::string strData; - strData = setup; + strData = fSetup; return strData; } //******************************* - //Implementation put_setup() + //Implementation PutSetup() //******************************* /*! \brief Method setting a string containing the setup @@ -4084,34 +3877,34 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param commentStr string containing the setup */ - int MuSR_td_PSI_bin::put_setup(std::string setupStr) + int MuSR_td_PSI_bin::PutSetup(std::string setupStr) { if (setupStr.size() >= 11) return -1; - strcpy(setup, setupStr.c_str()); + strcpy(fSetup, setupStr.c_str()); return 0; } //******************************* -//Implementation get_comments() +//Implementation GetComment() //******************************* /*! \brief Method returning a string containing the comment specified in the title */ - std::string MuSR_td_PSI_bin::get_comment() + std::string MuSR_td_PSI_bin::GetComment() { std::string strData; - strData = comment; + strData = fComment; return strData; } //******************************* - //Implementation put_comments() + //Implementation PutComment() //******************************* /*! \brief Method setting a string containing the comment @@ -4122,38 +3915,35 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param commentStr string containing the comment */ - int MuSR_td_PSI_bin::put_comment(std::string commentStr) + int MuSR_td_PSI_bin::PutComment(std::string commentStr) { - strncpy(comment, commentStr.c_str(), 62); - comment[62] = '\0'; + strncpy(fComment, commentStr.c_str(), 62); + fComment[62] = '\0'; return 0; } //******************************* -//Implementation get_nameHisto() +//Implementation Get_nameHisto() //******************************* /*! \brief Method returning a string containing the name of the histogram \ * - * returns NULL if the histogram specified is invalid + * returns an empty string if the histogram specified is invalid */ - std::string MuSR_td_PSI_bin::get_nameHisto(int i) + std::string MuSR_td_PSI_bin::GetNameHisto(int i) { - std::string strData; + std::string strData{""}; - if (i < 0 || i >= int(number_histo)) - return nullptr; - else - { - strData = labels_histo[i]; - return strData; - } + if ((i >= 0) && (i < fNumberHisto)) + strData = fLabelsHisto[i]; + + return strData; } //******************************* - //Implementation put_nameHisto() + //Implementation PutNameHisto() //******************************* /*! \brief Method setting a string containing the name of the histogram \ @@ -4167,34 +3957,33 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param i index of the histogram */ - int MuSR_td_PSI_bin::put_nameHisto(std::string histoName, int i) + int MuSR_td_PSI_bin::PutNameHisto(std::string histoName, int i) { - if ((i<0) || (i>=number_histo)) + if ((i<0) || (i>=fNumberHisto)) return -1; if (static_cast(histoName.length()) >= MAXLABELSIZE) return -2; - strcpy(labels_histo[i], histoName.c_str()); + strcpy(fLabelsHisto[i], histoName.c_str()); return 0; } //******************************* -//Implementation get_histoNames_vector() +//Implementation GetHistoNamesVector() //******************************* /*! \brief Method returning a vector of strings containing the names of the histograms */ - std::vector MuSR_td_PSI_bin::get_histoNames_vector() + std::vector MuSR_td_PSI_bin::GetHistoNamesVector() { std::vector str_Vector; std::string strData; - for (int i = 0; i < number_histo; i++) - { - strData = labels_histo[i]; + for (int i = 0; i < fNumberHisto; i++) { + strData = fLabelsHisto[i]; str_Vector.push_back(strData); } @@ -4202,7 +3991,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) } //******************************* - //Implementation put_histoNames_vector() + //Implementation PutHistoNamesVector() //******************************* /*! \brief Method setting a vector containing the names of all the histograms @@ -4215,36 +4004,35 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param histoName name of the histogram */ - int MuSR_td_PSI_bin::put_histoNames_vector(std::vector &histoNames) + int MuSR_td_PSI_bin::PutHistoNamesVector(std::vector &histoNames) { - if (static_cast(histoNames.size()) > number_histo) + if (static_cast(histoNames.size()) > fNumberHisto) return -1; for (unsigned int i=0; i(histoNames[i].length()) >= MAXLABELSIZE) return -2; else - strcpy(labels_histo[i], histoNames[i].c_str()); + strcpy(fLabelsHisto[i], histoNames[i].c_str()); } return 0; } //******************************* -//Implementation get_scalersNames_vector() +//Implementation GetScalersNamesVector() //******************************* /*! \brief Method returning a vector of strings containing the names of the scalers */ - std::vector MuSR_td_PSI_bin::get_scalersNames_vector() + std::vector MuSR_td_PSI_bin::GetScalersNamesVector() { std::vector str_Vector; std::string strData; - for (int i = 0; i < number_scaler; i++) - { - strData = labels_scalers[i]; + for (int i = 0; i < fNumberScaler; i++) { + strData = fLabelsScalers[i]; str_Vector.push_back(strData); } @@ -4252,7 +4040,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) } //******************************* - //Implementation put_scalersNames_vector() + //Implementation PutScalersNamesVector() //******************************* /*! \brief Method setting a vector of strings containing the names of the scalers @@ -4264,33 +4052,21 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param scalersName scaler names */ - int MuSR_td_PSI_bin::put_scalersNames_vector(std::vector scalersName) + int MuSR_td_PSI_bin::PutScalersNamesVector(std::vector scalersName) { if (static_cast(scalersName.size()) > MAXSCALER) return -1; for (unsigned int i=0; i MAXTEMPER)) return -1; - number_temper = noOfTemps; + fNumberTemper = noOfTemps; return 0; } //******************************* -//Implementation get_temperatures_vector() +//Implementation GetTemperaturesVector() //******************************* /*! \brief Method returning a vector of doubles containing monitored values (usually temperatures) */ - std::vector MuSR_td_PSI_bin::get_temperatures_vector() + std::vector MuSR_td_PSI_bin::GetTemperaturesVector() { std::vector dbl_Temper; - for (int i = 0; i < number_temper; i++) - { - dbl_Temper.push_back(double(temper[i])); + for (int i = 0; i < fNumberTemper; i++) { + dbl_Temper.push_back(double(fTemper[i])); } return dbl_Temper; } //******************************* - //Implementation put_temperatures_vector() + //Implementation PutTemperaturesVector() //******************************* /*! \brief Method setting a vector of doubles containing monitored values (usually temperatures) @@ -4344,38 +4119,37 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param tempVals vector containing the monitored values */ - int MuSR_td_PSI_bin::put_temperatures_vector(std::vector &tempVals) + int MuSR_td_PSI_bin::PutTemperaturesVector(std::vector &tempVals) { if (static_cast(tempVals.size()) > MAXTEMPER) return -1; for (unsigned int i=0; i MuSR_td_PSI_bin::get_devTemperatures_vector() + std::vector MuSR_td_PSI_bin::GetDevTemperaturesVector() { std::vector dbl_devTemper; - for (int i = 0; i < number_temper; i++) - { - dbl_devTemper.push_back(double(temp_deviation[i])); + for (int i = 0; i < fNumberTemper; i++) { + dbl_devTemper.push_back(double(fTempDeviation[i])); } return dbl_devTemper; } //******************************* - //Implementation put_devTemperatures_vector() + //Implementation PutDevTemperaturesVector() //******************************* /*! \brief Method setting a vector of doubles containing standard deviations of the monitored values (usually temperatures) @@ -4387,38 +4161,38 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param devTempVals vector containing standard deviations of the monitored values */ - int MuSR_td_PSI_bin::put_devTemperatures_vector(std::vector &devTempVals) + int MuSR_td_PSI_bin::PutDevTemperaturesVector(std::vector &devTempVals) { if (static_cast(devTempVals.size()) > MAXTEMPER) return -1; for (unsigned int i=0; i MuSR_td_PSI_bin::get_timeStart_vector() + std::vector MuSR_td_PSI_bin::GetTimeStartVector() { std::vector timeStart(2); - timeStart[0] = date_start; - timeStart[1] = time_start; + timeStart[0] = fDateStart; + timeStart[1] = fTimeStart; return timeStart; } //******************************* - //Implementation put_timeStart_vector() + //Implementation PutTimeStartVector() //******************************* /*! \brief Method setting a vector of strings containing 1) the date when the run was @@ -4433,7 +4207,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param timeStart vector where [0] contains the date, [1] the time string */ - int MuSR_td_PSI_bin::put_timeStart_vector(std::vector timeStart) + int MuSR_td_PSI_bin::PutTimeStartVector(std::vector timeStart) { if (timeStart.size() != 2) return -1; @@ -4446,32 +4220,32 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) if (timeStart[1].length() > 8) return -3; - strcpy(date_start, timeStart[0].c_str()); - strcpy(time_start, timeStart[1].c_str()); + strcpy(fDateStart, timeStart[0].c_str()); + strcpy(fTimeStart, timeStart[1].c_str()); return 0; } //******************************* -//Implementation get_timeStop_vector() +//Implementation GetTimeStopVector() //******************************* /*! \brief Method returning a vector of strings containing 1) the date when the run was * stopped and 2) the time when the run was stopped */ - std::vector MuSR_td_PSI_bin::get_timeStop_vector() + std::vector MuSR_td_PSI_bin::GetTimeStopVector() { std::vector timeStop(2); - timeStop[0] = date_stop; - timeStop[1] = time_stop; + timeStop[0] = fDateStop; + timeStop[1] = fTimeStop; return timeStop; } //******************************* - //Implementation put_timeStop_vector() + //Implementation PutTimeStopVector() //******************************* /*! \brief Method setting a vector of strings containing 1) the date when the run was @@ -4486,7 +4260,7 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) * \param timeStop vector where [0] contains the date, [1] the time string */ - int MuSR_td_PSI_bin::put_timeStop_vector(std::vector timeStop) + int MuSR_td_PSI_bin::PutTimeStopVector(std::vector timeStop) { if (timeStop.size() != 2) return -1; @@ -4499,8 +4273,8 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) if (timeStop[1].length() > 8) return -3; - strcpy(date_stop, timeStop[0].c_str()); - strcpy(time_stop, timeStop[1].c_str()); + strcpy(fDateStop, timeStop[0].c_str()); + strcpy(fTimeStop, timeStop[1].c_str()); return 0; } @@ -4519,78 +4293,65 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) // NIY maybe flag when histo should not be released // free private histograms - if (histo != nullptr) - { - for (i=0; i < number_histo; i++) - if (*(histo+i) != nullptr) - { - delete[] *(histo+i); - *(histo+i) = nullptr; - } - delete [] histo; - histo = nullptr; - } + fHisto.clear(); // free public vector - histos_vector.clear(); + fHistosVector.clear(); // init other member variables - filename = "?"; - readingok = false; - writingok = false; - consistencyOk = false; - readstatus = ""; - writestatus = ""; - consistencyStatus = ""; + fFilename = "?"; + fReadingOk = false; + fWritingOk = false; + fConsistencyOk = false; + fReadStatus = ""; + fWriteStatus = ""; + fConsistencyStatus = ""; - strcpy(format_id,"??"); + strcpy(fFormatId,"??"); - num_run = 0; + fNumRun = 0; //01234567890 - strcpy(sample, " "); - strcpy(temp, " "); - strcpy(field, " "); - strcpy(orient, " "); - strcpy(setup, " "); - strcpy(comment, " "); - strcpy(date_start," "); - strcpy(time_start," "); - strcpy(date_stop, " "); - strcpy(time_stop, " "); + strcpy(fSample, " "); + strcpy(fTemp, " "); + strcpy(fField, " "); + strcpy(fOrient, " "); + strcpy(fSetup, " "); + strcpy(fComment, " "); + strcpy(fDateStart," "); + strcpy(fTimeStart," "); + strcpy(fDateStop, " "); + strcpy(fTimeStop, " "); - bin_width = 0.; - number_histo = 0; - length_histo = 0; - total_events = 0; - default_binning = 1; + fBinWidth = 0.; + fNumberHisto = 0; + fLengthHisto = 0; + fTotalEvents = 0; + fDefaultBinning = 1; - for (i=0; i < MAXHISTO; i++) - { + for (i=0; i < MAXHISTO; i++) { for (j=0; j < MAXLABELSIZE-1; j++) - labels_histo[i][j] = ' '; - labels_histo[i][MAXLABELSIZE-1] = '\0'; - events_per_histo[i] = 0; - real_t0[i] = 0.f; - integer_t0[i] = 0; - first_good[i] = 0; - last_good[i] = 0; + fLabelsHisto[i][j] = ' '; + fLabelsHisto[i][MAXLABELSIZE-1] = '\0'; + fEventsPerHisto[i] = 0; + fRealT0[i] = 0.f; + fIntegerT0[i] = 0; + fFirstGood[i] = 0; + fLastGood[i] = 0; } - number_scaler = 0; - for (i=0; i < MAXSCALER; i++) - { + fNumberScaler = 0; + for (i=0; i < MAXSCALER; i++) { for (j=0; j < MAXLABELSIZE-1; j++) - labels_scalers[i][j] = ' '; - labels_scalers[i][MAXLABELSIZE-1] = '\0'; + fLabelsScalers[i][j] = ' '; + fLabelsScalers[i][MAXLABELSIZE-1] = '\0'; - scalers[i] = 0; + fScalers[i] = 0; } - number_temper = 0; - for (i=0; i < MAXTEMPER; i++) - { - temper[i] = 0.f; - temp_deviation[i] = 0.f; + fNumberTemper = 0; + for (i=0; i < MAXTEMPER; i++) { + fTemper[i] = 0.f; + fTempDeviation[i] = 0.f; } return 0; @@ -4604,66 +4365,65 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) int MuSR_td_PSI_bin::Show() const { - std::cout << "Filename is " << filename << std::endl; - if (readingok) { + std::cout << "Filename is " << fFilename << std::endl; + if (fReadingOk) { int i; - std::cout << "Format Identifier is " << format_id << std::endl; + std::cout << "Format Identifier is " << fFormatId << std::endl; - std::cout << "Run number is " << num_run << std::endl; - std::cout << "Sample is " << sample << std::endl; - std::cout << "Temperature is " << temp << std::endl; - std::cout << "Field is " << field << std::endl; - std::cout << "Orientation is " << orient << std::endl; - std::cout << "Comment is " << comment << std::endl; + std::cout << "Run number is " << fNumRun << std::endl; + std::cout << "Sample is " << fSample << std::endl; + std::cout << "Temperature is " << fTemp << std::endl; + std::cout << "Field is " << fField << std::endl; + std::cout << "Orientation is " << fOrient << std::endl; + std::cout << "Comment is " << fComment << std::endl; - std::cout << "Start Date is " << date_start << std::endl; - std::cout << "Start Time is " << time_start << std::endl; + std::cout << "Start Date is " << fDateStart << std::endl; + std::cout << "Start Time is " << fTimeStart << std::endl; - std::cout << "End Date is " << date_stop << std::endl; - std::cout << "End Time is " << time_stop << std::endl; + std::cout << "End Date is " << fDateStop << std::endl; + std::cout << "End Time is " << fTimeStop << std::endl; - std::cout << "Bin width is " << bin_width << " [usec]" << std::endl; - std::cout << "Number of histograms is " << number_histo << std::endl; - std::cout << "Histogram length is " << length_histo << std::endl; - std::cout << "Default binning is " << default_binning << std::endl; - std::cout << "Total number of events is " << total_events << std::endl; + std::cout << "Bin width is " << fBinWidth << " [usec]" << std::endl; + std::cout << "Number of histograms is " << fNumberHisto << std::endl; + std::cout << "Histogram length is " << fLengthHisto << std::endl; + std::cout << "Default binning is " << fDefaultBinning << std::endl; + std::cout << "Total number of events is " << fTotalEvents << std::endl; - for (i=0; i < number_histo; i++) { - std::cout << "Histogram " << i << " Name is >" << labels_histo[i] - << "< Events per histogram is " << events_per_histo[i] << std::endl; - std::cout << " real t0 is " << real_t0[i] << std::endl; - std::cout << " t0 is " << integer_t0[i] << std::endl; - std::cout << " first good bin is " << first_good[i] << std::endl; - std::cout << " last good bin is " << last_good[i] << std::endl; + for (i=0; i < fNumberHisto; i++) { + std::cout << "Histogram " << i << " Name is >" << fLabelsHisto[i] + << "< Events per histogram is " << fEventsPerHisto[i] << std::endl; + std::cout << " real t0 is " << fRealT0[i] << std::endl; + std::cout << " t0 is " << fIntegerT0[i] << std::endl; + std::cout << " first good bin is " << fFirstGood[i] << std::endl; + std::cout << " last good bin is " << fLastGood[i] << std::endl; } - std::cout << "Number of scalers is " << number_scaler << std::endl; - for (i=0; i < number_scaler; i++) { - std::cout << "Scaler " << i << " Name is >" << labels_scalers[i] - << "< Value is " << scalers[i] << std::endl; + std::cout << "Number of scalers is " << fNumberScaler << std::endl; + for (i=0; i < fNumberScaler; i++) { + std::cout << "Scaler " << i << " Name is >" << fLabelsScalers[i] + << "< Value is " << fScalers[i] << std::endl; } - std::cout << "Number of temperatures is " << number_temper << std::endl; - for (i=0; i < number_temper; i++) { - std::cout << "Temperature " << i << " is " << temper[i] - << " Deviation is " << temp_deviation[i] << std::endl; + std::cout << "Number of temperatures is " << fNumberTemper << std::endl; + for (i=0; i < fNumberTemper; i++) { + std::cout << "Temperature " << i << " is " << fTemper[i] + << " Deviation is " << fTempDeviation[i] << std::endl; } } else { - std::cout << readstatus << std::endl; + std::cout << fReadStatus << std::endl; } return 0; } //******************************* -//Implementation tmax +//Implementation Tmax //******************************* - int MuSR_td_PSI_bin::tmax(int x, int y) + int MuSR_td_PSI_bin::Tmax(int x, int y) { - if (x >= y) - { + if (x >= y) { return x; } return y; @@ -4671,13 +4431,12 @@ double * MuSR_td_PSI_bin::get_histo_array(int histo_num, int binning) //******************************* -//Implementation tmin +//Implementation Tmin //******************************* - int MuSR_td_PSI_bin::tmin(int x, int y) + int MuSR_td_PSI_bin::Tmin(int x, int y) { - if (x >= y) - { + if (x >= y) { return y; } return x; diff --git a/src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.h b/src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.h index a0fc63f6b..c7657d3d5 100644 --- a/src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.h +++ b/src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.h @@ -10,7 +10,7 @@ begin : Alex Amato, October 2005 modified : Andrea Raselli, October 2009 - : Andreas Suter, April 2019 + : Andreas Suter, April 2019, May 2020 copyright : (C) 2005 by email : alex.amato@psi.ch @@ -56,57 +56,55 @@ class MuSR_td_PSI_bin { ~MuSR_td_PSI_bin(); private: -// ------------------------------------start of the variables + std::string fFilename; + std::string fReadStatus; + std::string fWriteStatus; + std::string fConsistencyStatus; + bool fReadingOk; + bool fWritingOk; + bool fConsistencyOk; - std::string filename; - std::string readstatus; - std::string writestatus; - std::string consistencyStatus; - bool readingok; - bool writingok; - bool consistencyOk; + char fFormatId[3]; - char format_id[3]; + int fNumRun; - int num_run; + char fSample[11]; + char fTemp[11]; + char fField[11]; + char fOrient[11]; + char fSetup[11]; + char fComment[63]; - char sample[11]; - char temp[11]; - char field[11]; - char orient[11]; - char setup[11]; - char comment[63]; + char fDateStart[10]; + char fDateStop[10]; + char fTimeStart[9]; + char fTimeStop[9]; - char date_start[10]; - char date_stop[10]; - char time_start[9]; - char time_stop[9]; + double fBinWidth; - double bin_width; + int fNumberHisto; + int fLengthHisto; + char fLabelsHisto[MAXHISTO][MAXLABELSIZE]; - int number_histo; - int length_histo; - char labels_histo[MAXHISTO][MAXLABELSIZE]; + int fTotalEvents; + int fEventsPerHisto[MAXHISTO]; - int total_events; - int events_per_histo[MAXHISTO]; + int fDefaultBinning; - int default_binning; + float fRealT0[MAXHISTO]; + int fIntegerT0[MAXHISTO]; + int fFirstGood[MAXHISTO]; + int fLastGood[MAXHISTO]; - float real_t0[MAXHISTO]; - int integer_t0[MAXHISTO]; - int first_good[MAXHISTO]; - int last_good[MAXHISTO]; + int fNumberScaler; + int fScalers[MAXSCALER]; + char fLabelsScalers[MAXSCALER][MAXLABELSIZE]; - int number_scaler; - int scalers[MAXSCALER]; - char labels_scalers[MAXSCALER][MAXLABELSIZE]; + int fNumberTemper; + float fTemper[MAXTEMPER]; + float fTempDeviation[MAXTEMPER]; - int number_temper; - float temper[MAXTEMPER]; - float temp_deviation[MAXTEMPER]; - - int **histo; + std::vector< std::vector > fHisto; public: @@ -118,22 +116,22 @@ class MuSR_td_PSI_bin { NOTE: Histogram information returned by \ = ..._array() methods should be freed by delete [] \; */ - std::vector< std::vector > histos_vector ; + std::vector< std::vector > fHistosVector ; // ------------------------------------end of the variables public: - int read(const char* fileName); // generic read - int write(const char *fileName); // generic write + int Read(const char* fileName); // generic read + int Write(const char *fileName); // generic write - int readbin(const char* fileName); // read MuSR PSI bin format - int writebin(const char *fileName); // write MuSR PSI bin format - int readmdu(const char* fileName); // read MuSR mdu format - int writemdu(const char* fileName); // write MuSR mdu format + int ReadBin(const char* fileName); // read MuSR PSI bin format + int WriteBin(const char *fileName); // write MuSR PSI bin format + int ReadMdu(const char* fileName); // read MuSR mdu format + int WriteMdu(const char* fileName); // write MuSR mdu format - bool readingOK() const; - bool writingOK() const; + bool ReadingOK() const; + bool WritingOK() const; bool CheckDataConsistency(int tag=0); // tag: 0=reasonable, 1=strict std::string ReadStatus() const; std::string WriteStatus() const; @@ -143,57 +141,46 @@ class MuSR_td_PSI_bin { int Show() const; int Clear(); - int get_histo_int(int histo_num, int j); - double get_histo(int histo_num, int j); + int GetHistoInt(int histo_num, int j); + double GetHisto(int histo_num, int j); - int *get_histo_array_int(int histo_num); - double *get_histo_array(int histo_num, int binning); - int put_histo_array_int(std::vector< std::vector > histo, int tag = 0); - std::vector get_histo_vector(int histo_num, int binning); - std::vector get_histo_vector_no0(int histo_num, int binning); + std::vector GetHistoArrayInt(int histo_num); + std::vector GetHistoArray(int histo_num, int binning); + int PutHistoArrayInt(std::vector< std::vector > &histo, int tag = 0); + std::vector GetHistoVector(int histo_num, int binning); + std::vector GetHistoVectorNo0(int histo_num, int binning); - double *get_histo_fromt0_array(int histo_num, int binning, int offset = 0); + double *GetHistoFromT0Array(int histo_num, int binning, int offset = 0); - std::vector get_histo_fromt0_vector(int histo_num, int binning, int offset = 0); + std::vector GetHistoFromT0Vector(int histo_num, int binning, int offset = 0); - double *get_histo_goodBins_array(int histo_num, int binning); + double *GetHistoGoodBinsArray(int histo_num, int binning); - std::vector get_histo_goodBins_vector(int histo_num, int binning); + std::vector GetHistoGoodBinsVector(int histo_num, int binning); - double *get_histo_fromt0_minus_bckgrd_array(int histo_num, - int lower_bckgdr, - int higher_bckgdr, - int binning, - int offset = 0); + double *GetHistoFromT0MinusBkgArray(int histo_num, + int lower_bckgdr, + int higher_bckgdr, + int binning, + int offset = 0); - std::vector get_histo_fromt0_minus_bckgrd_vector(int histo_num, - int lower_bckgdr, - int higher_bckgdr, - int binning, - int offset = 0); + std::vector GetHistoFromT0MinusBkgVector(int histo_num, + int lower_bckgdr, + int higher_bckgdr, + int binning, + int offset = 0); - double *get_histo_goodBins_minus_bckgrd_array(int histo_num, - int lower_bckgrd, - int higher_bckgrd, - int binning); + double *GetHistoGoodBinsMinusBkgArray(int histo_num, + int lower_bckgrd, + int higher_bckgrd, + int binning); - std::vector get_histo_goodBins_minus_bckgrd_vector(int histo_num, - int lower_bckgrd, - int higher_bckgrd, - int binning); + std::vector GetHistoGoodBinsMinusBkgVector(int histo_num, + int lower_bckgrd, + int higher_bckgrd, + int binning); - double *get_asymmetry_array(int histo_num_plus, - int histo_num_minus, - double alpha_param, - int binning, - int lower_bckgrd_plus, - int higher_bckgrd_plus, - int lower_bckgrd_minus, - int higher_bckgrd_minus, - int offset = 0, - double y_offset = 0.); - - std::vector get_asymmetry_vector(int histo_num_plus, + double *GetAsymmetryArray(int histo_num_plus, int histo_num_minus, double alpha_param, int binning, @@ -204,7 +191,28 @@ class MuSR_td_PSI_bin { int offset = 0, double y_offset = 0.); - double *get_error_asymmetry_array(int histo_num_plus, + std::vector GetAsymmetryVector(int histo_num_plus, + int histo_num_minus, + double alpha_param, + int binning, + int lower_bckgrd_plus, + int higher_bckgrd_plus, + int lower_bckgrd_minus, + int higher_bckgrd_minus, + int offset = 0, + double y_offset = 0.); + + double *GetErrorAsymmetryArray(int histo_num_plus, + int histo_num_minus, + double alpha_param, + int binning, + int lower_bckgrd_plus, + int higher_bckgrd_plus, + int lower_bckgrd_minus, + int higher_bckgrd_minus, + int offset = 0); + + std::vector GetErrorAsymmetryVector(int histo_num_plus, int histo_num_minus, double alpha_param, int binning, @@ -214,17 +222,7 @@ class MuSR_td_PSI_bin { int higher_bckgrd_minus, int offset = 0); - std::vector get_error_asymmetry_vector(int histo_num_plus, - int histo_num_minus, - double alpha_param, - int binning, - int lower_bckgrd_plus, - int higher_bckgrd_plus, - int lower_bckgrd_minus, - int higher_bckgrd_minus, - int offset = 0); - - double *get_asymmetry_goodBins_array(int histo_num_plus, + double *GetAsymmetryGoodBinsArray(int histo_num_plus, int histo_num_minus, double alpha_param, int binning, @@ -233,16 +231,16 @@ class MuSR_td_PSI_bin { int lower_bckgrd_minus, int higher_bckgrd_minus); - std::vector get_asymmetry_goodBins_vector(int histo_num_plus, - int histo_num_minus, - double alpha_param, - int binning, - int lower_bckgrd_plus, - int higher_bckgrd_plus, - int lower_bckgrd_minus, - int higher_bckgrd_minus); + std::vector GetAsymmetryGoodBinsVector(int histo_num_plus, + int histo_num_minus, + double alpha_param, + int binning, + int lower_bckgrd_plus, + int higher_bckgrd_plus, + int lower_bckgrd_minus, + int higher_bckgrd_minus); - double *get_error_asymmetry_goodBins_array(int histo_num_plus, + double *GetErrorAsymmetryGoodBinsArray(int histo_num_plus, int histo_num_minus, double alpha_param, int binning, @@ -251,103 +249,103 @@ class MuSR_td_PSI_bin { int lower_bckgrd_minus, int higher_bckgrd_minus); - std::vector get_error_asymmetry_goodBins_vector(int histo_num_plus, - int histo_num_minus, - double alpha_param, - int binning, - int lower_bckgrd_plus, - int higher_bckgrd_plus, - int lower_bckgrd_minus, - int higher_bckgrd_minus); + std::vector GetErrorAsymmetryGoodBinsVector(int histo_num_plus, + int histo_num_minus, + double alpha_param, + int binning, + int lower_bckgrd_plus, + int higher_bckgrd_plus, + int lower_bckgrd_minus, + int higher_bckgrd_minus); - double get_binWidth_ps(); - void put_binWidth_ps(double binWidth); - double get_binWidth_ns(); - void put_binWidth_ns(double binWidth); - double get_binWidth_us(); - void put_binWidth_us(double binWidth); + double GetBinWidthPicoSec(); + void PutBinWidthPicoSec(double binWidth); + double GetBinWidthNanoSec(); + void PutBinWidthNanoSec(double binWidth); + double GetBinWidthMicroSec(); + void PutBinWidthMicroSec(double binWidth); - int get_histoLength_bin(); - void put_histoLength_bin(int val) { length_histo = val; } + int GetHistoLengthBin() { return fLengthHisto; } + void PutHistoLengthBin(int val) { fLengthHisto = val; } - int get_numberHisto_int(); - void put_numberHisto_int(int val) { number_histo = val; } + int GetNumberHistoInt() { return fNumberHisto; } + void PutNumberHistoInt(int val) { fNumberHisto = val; } - std::string get_nameHisto(int i); - int put_nameHisto(std::string histoName, int i); - std::vector get_histoNames_vector(); - int put_histoNames_vector(std::vector &histoNames); + std::string GetNameHisto(int i); + int PutNameHisto(std::string histoName, int i); + std::vector GetHistoNamesVector(); + int PutHistoNamesVector(std::vector &histoNames); - long get_eventsHisto_long(int i); - std::vector get_eventsHisto_vector(); + long GetEventsHistoLong(int i); + std::vector GetEventsHistoVector(); - long get_totalEvents_long(); + long GetTotalEventsLong() { return long(fTotalEvents); } - int get_numberScaler_int(); - int put_numberScaler_int(int val); - std::vector get_scalers_vector(); - int put_scalers_vector(std::vector scalerData); - std::vector get_scalersNames_vector(); - int put_scalersNames_vector(std::vector scalersName); + int GetNumberScalerInt(); + int PutNumberScalerInt(int val); + std::vector GetScalersVector(); + int PutScalersVector(std::vector scalerData); + std::vector GetScalersNamesVector(); + int PutScalersNamesVector(std::vector scalersName); - int get_default_binning(); - int get_t0_int(int i); - int put_t0_int(int histoNo, int t0); - std::vector get_t0_vector(); - int put_t0_vector(std::vector &t0Data); - double get_t0_double(int i); + int GetDefaultBinning(); + int GetT0Int(int i); + int PutT0Int(int histoNo, int t0); + std::vector GetT0Vector(); + int PutT0Vector(std::vector &t0Data); + double GetT0Double(int i); - int get_max_t0_int (); - int get_max_2_t0_int (int k, int j); - int get_min_t0_int (); - int get_min_2_t0_int (int k, int j); + int GetMaxT0Int(); + int GetMax2T0Int (int k, int j); + int GetMinT0Int(); + int GetMin2T0Int (int k, int j); - int get_firstGood_int(int i); - std::vector get_firstGood_vector(); - int put_firstGood_int(int i, int j); + int GetFirstGoodInt(int i); + std::vector GetFirstGoodVector(); + int PutFirstGoodInt(int i, int j); - int get_lastGood_int(int i); - std::vector get_lastGood_vector(); - int put_lastGood_int(int i, int j); + int GetLastGoodInt(int i); + std::vector GetLastGoodVector(); + int PutLastGoodInt(int i, int j); - int get_max_lastGood_int (); - int get_max_2_lastGood_int (int k, int j); - int get_min_lastGood_int (); - int get_min_2_lastGood_int (int k, int j); + int GetMaxLastGoodInt(); + int GetMax2LastGoodInt (int k, int j); + int GetMinLastGoodInt(); + int GetMin2LastGoodInt (int k, int j); - int get_runNumber_int(); - int put_runNumber_int(int i); + int GetRunNumberInt() { return fNumRun; } + int PutRunNumberInt(int i); - std::string get_sample(); - int put_sample(std::string sample); - std::string get_field(); - int put_field(std::string field); - std::string get_orient(); - int put_orient(std::string orientation); - std::string get_temp(); - int put_temp(std::string temp); - std::string get_setup(); - int put_setup(std::string setup); - std::string get_comment(); - int put_comment(std::string comment); + std::string GetSample(); + int PutSample(std::string sample); + std::string GetField(); + int PutField(std::string field); + std::string GetOrient(); + int PutOrient(std::string orientation); + std::string GetTemp(); + int PutTemp(std::string temp); + std::string GetSetup(); + int PutSetup(std::string setup); + std::string GetComment(); + int PutComment(std::string comment); - std::vector get_timeStart_vector(); - int put_timeStart_vector(std::vector timeStart); - std::vector get_timeStop_vector(); - int put_timeStop_vector(std::vector timeStop); + std::vector GetTimeStartVector(); + int PutTimeStartVector(std::vector timeStart); + std::vector GetTimeStopVector(); + int PutTimeStopVector(std::vector timeStop); - int get_numberTemperature_int(); - int put_numberTemperature_int(int noOfTemps); - std::vector get_temperatures_vector(); - int put_temperatures_vector(std::vector &temps); - std::vector get_devTemperatures_vector(); - int put_devTemperatures_vector(std::vector &devTemps); + int GetNumberTemperatureInt() { return fNumberTemper; } + int PutNumberTemperatureInt(int noOfTemps); + std::vector GetTemperaturesVector(); + int PutTemperaturesVector(std::vector &temps); + std::vector GetDevTemperaturesVector(); + int PutDevTemperaturesVector(std::vector &devTemps); private: - int tmax(int x, int y); - int tmin(int x, int y); + int Tmax(int x, int y); + int Tmin(int x, int y); } ; #endif From 06d20d40863cc293f00e54faeea36bd9064a1a24 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sat, 28 May 2022 14:10:15 +0200 Subject: [PATCH 4/6] adopted to new PSI-BIN lib. Added facility for finding runs via musrfit_startup.xml templates. --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 13 + src/addRun.cpp | 851 ++++++++++++++++++++++++++++++++ src/classes/CMakeLists.txt | 3 +- src/classes/PRunDataHandler.cpp | 206 ++++++-- src/classes/PStartupHandler.cpp | 67 +++ src/dump_header.cpp | 42 +- src/include/PMusr.h | 47 +- src/include/PRunDataHandler.h | 4 +- src/include/PStartupHandler.h | 5 +- 10 files changed, 1148 insertions(+), 92 deletions(-) create mode 100644 src/addRun.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b643b121..a6973b265 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if (CMAKE_VERSION GREATER_EQUAL 3.12) cmake_policy(SET CMP0075 NEW) endif (CMAKE_VERSION GREATER_EQUAL 3.12) -project(musrfit VERSION 1.7.6 LANGUAGES C CXX) +project(musrfit VERSION 1.8.0 LANGUAGES C CXX) #--- musrfit specific options ------------------------------------------------- option(nexus "build optional NeXus support. Needed for ISIS" OFF) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index efea361e5..81922bebd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,6 +55,18 @@ endif (IS_GIT_REPO) #--- end create git-revision.h ------------------------------------------------ #--- add all executables ------------------------------------------------------ +add_executable(addRun ${GIT_REV_H} addRun.cpp) +target_compile_options(addRun BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}") +target_include_directories(addRun + BEFORE PRIVATE + $ + $ + $ + $ + $ +) +target_link_libraries(addRun ${ROOT_LIBRARIES} ${MUSRFIT_LIBS} ${Boost_LIBRARIES}) + add_executable(any2many ${GIT_REV_H} any2many.cpp) target_compile_options(any2many BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}") target_include_directories(any2many @@ -176,6 +188,7 @@ target_link_libraries(write_musrRoot_runHeader ${ROOT_LIBRARIES} ${MUSRFIT_LIBS} #--- installation info -------------------------------------------------------- install( TARGETS + addRun any2many dump_header msr2data diff --git a/src/addRun.cpp b/src/addRun.cpp new file mode 100644 index 000000000..00c64a0ba --- /dev/null +++ b/src/addRun.cpp @@ -0,0 +1,851 @@ +/*************************************************************************** + + addRun.cpp + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2022 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#ifdef HAVE_GIT_REV_H +#include "git-revision.h" +#endif + +#include "PMusr.h" +#include "PStartupHandler.h" +#include "PRunDataHandler.h" +#include "PFindRun.h" + +struct PAddRunInfo { + std::string fPathFileName{""}; + PIntVector fT0; + std::string fFileFormat{""}; +}; + + +//-------------------------------------------------------------------------- +/** + *

Sends the usage description to the standard output. + */ +void addRun_syntax() +{ + std::cout << std::endl; + std::cout << "usage0: addRun [--help | -h] | [--version | -v]" << std::endl; + std::cout << "usage1: addRun -rl " << std::endl; + std::cout << "usage2: addRun -in " << std::endl; + std::cout << std::endl; + std::cout << " :" << std::endl; + std::cout << " -t0 : is a comma separted list of global t0-bin's, or" << std::endl; + std::cout << " is a comma separted list of '-1', then it is assumed that there is a prompt peak." << std::endl; + std::cout << " Under this condition the t0-bin will be determined automatically by" << std::endl; + std::cout << " the position of the max-value of the corresponing histograms." << std::endl; + std::cout << " If t0's are not provided, t0-bin will be taken from the file." << std::endl; + std::cout << " -f : is the output file format to be used." << std::endl; + std::cout << " For supported formats see below." << std::endl; + std::cout << " -y : the year at which runs were measured. Format yyyy." << std::endl; + std::cout << " If not provided, the current year is used." << std::endl; + std::cout << " -i : is one of gps, ltf, flame, gpd, hifi, dolly, lem" << std::endl; + std::cout << " -m : is pta or tdc (only needed for bulk). Default: tdc" << std::endl; + std::cout << " -o : output file name." << std::endl; + std::cout << " -rl can be:" << std::endl ; + std::cout << " (i) ... : run numbers, e.g. 123 124" << std::endl; + std::cout << " (ii) - : a range, e.g. 123-125 -> 123 124 125" << std::endl; + std::cout << " (iii) :: : a sequence, e.g. 123:127:2 -> 123 125 127" << std::endl; + std::cout << " will give the step width and has to be a positive number!" << std::endl; + std::cout << " a can also combine (i)-(iii), e.g. 123 128-130 133, etc." << std::endl; + std::cout << std::endl; + std::cout << " :" << std::endl; + std::cout << " -f : is file format of the output-file to be used." << std::endl; + std::cout << " -o : output file name." << std::endl; + std::cout << " -in : the file name of the file containing the necessary run information" << std::endl; + std::cout << " to add runs with various t0's, fgb's, lgb's, different years, etc." << std::endl; + std::cout << " The structure of the is:" << std::endl; + std::cout << " Lines starting with a '%' and empty lines are ignored." << std::endl; + std::cout << " A single run needs to provide the following information:" << std::endl; + std::cout << " file : needs to be a full path name" << std::endl; + std::cout << " t0 : needs to be the t0 bin or " << std::endl; + std::cout << " 0 to take the t0 bin from the file, or" << std::endl; + std::cout << " -1 for automatic determination via prompt peak (see above)." << std::endl; + std::cout << " Example:" << std::endl; + std::cout << " % file 1. 6 histos present, hence 6 t0-bins" << std::endl; + std::cout << " file /home/test/data/deltat_tdc_gps_4324.bin" << std::endl; + std::cout << " t0 401, 400, 399, 400, 358, 400" << std::endl; + std::cout << " % file 2, take t0-bins from the file" << std::endl; + std::cout << " file /home/test/data/deltat_tdc_gps_4325.bin" << std::endl; + std::cout << " % file 3, deduce to t0-bin's from the prompt peak" << std::endl; + std::cout << " file /home/test/data/deltat_tdc_gps_4325.bin" << std::endl; + std::cout << " t0 -1, -1, -1, -1, -1, -1" << std::endl; + std::cout << std::endl; + std::cout << " Supported uSR file formats:" << std::endl; + std::cout << " MusrRoot, PSI-BIN, PSI-MDU, MUD, NeXus" << std::endl; + std::cout << std::endl; +} + +//-------------------------------------------------------------------------- +/** + *

check if the requested format is supported. + * + * @param format requested format string + * + * @return true if supported, false otherwise + */ +bool addRun_checkFormat(std::string &format) { + bool result = false; + boost::to_lower(format); + + if (format == "psi-bin") + format = "psibin"; + if (format == "psi-mud") + format = "psimdu"; + + if (format == "musrroot") { + result = true; + } else if (format == "psibin") { + result = true; + } else if (format == "psimdu") { + result = true; + } else if (format == "mud") { + result = true; + } else if (format == "nexus") { + result = true; + } else if (format == "root") { + result = true; + } + + return result; +} + +//-------------------------------------------------------------------------- +/** + *

Reads the inputFile to extract the necessary information. + * @param fileName + * @param infoVec + * @return + */ +bool addRun_readInputFiles(const std::string fileName, std::vector &infoVec) +{ + PAddRunInfo info; + char buf[256], str[256]; + std::ifstream fin(fileName.c_str(), std::ifstream::in); + std::string line; + char *tok{nullptr}; + int status, ival; + bool lastWasFile{false}; + while (fin.good()) { + fin.getline(buf, 256); + line = buf; + boost::trim_left(line); + if (line.empty()) + continue; + if (line[0] == '%') + continue; + strcpy(buf, line.c_str()); + tok = strtok(buf, " "); + if (!strcmp(tok, "file")) { + if (lastWasFile) { + infoVec.push_back(info); + info.fPathFileName = ""; + info.fT0.clear(); + } + tok = strtok(NULL, " "); + if (tok == NULL) { + std::cerr << std::endl; + std::cerr << "**ERROR** found label 'file' without argument." << std::endl; + std::cerr << std::endl; + fin.close(); + return false; + } + info.fPathFileName = tok; + lastWasFile = true; + } else if (!strcmp(tok, "t0")) { + while ((tok = strtok(NULL, ",")) != NULL) { + status = sscanf(tok, "%d%s", &ival, str); + if (status != 1) { + std::cerr << std::endl; + std::cerr << "**ERROR** found t0 argument '" << tok << "' which is not a number." << std::endl; + std::cerr << std::endl; + fin.close(); + return false; + } + info.fT0.push_back(ival); + } + } else { + std::cerr << std::endl; + std::cerr << "**ERROR** found unrecognized token '" << tok << "'." << std::endl; + std::cerr << std::endl; + fin.close(); + return false; + } + } + infoVec.push_back(info); + + fin.close(); + + // checks + for (int i=0; iAutomatically determines the t0-bin. This assumes that there is a + * prompt peak in the data! + * + * @param vec histo data + * @return maximum of the histo data + */ +UInt_t addRun_getPromptPeakPos(PDoubleVector *vec) +{ + UInt_t pos=0; + Double_t max=vec->at(0); + + for (UInt_t i=0; isize(); i++) { + if (max < vec->at(i)) { + max = vec->at(i); + pos = i; + } + } + + return pos; +} + +//-------------------------------------------------------------------------- +/** + *

Filters the t0 arguments. Allowed is a comma separeted list of + * integers > -2. + * + * @param argc argument counter + * @param argv argument list + * @param idx argument index from which to start + * @param t0 vector + * + * @return true on success, false otherwise + */ +bool addRun_filter_t0(int argc, char *argv[], int &idx, PIntVector &t0) +{ + int pos{idx}, status, ival; + PIntVector tt0; + // collect run list string from input + for (int i=idx; i -2 + for (int i=0; iFilters the runList arguments. Allowed are: (i) run1 run2 ... runN + * (ii) runStart-runEnd, and (iii) runStart:runEnd:step + * + * @param argc argument counter + * @param argv argument list + * @param idx argument index from which to start + * @param runList vector + * + * @return true on success, false otherwise + */ +bool addRun_filter_runList(int argc, char *argv[], int &idx, PUIntVector &runList) +{ + int pos{idx}; + std::string runStr{""}; + // collect run list string from input + for (int i=idx; iaddRun is used to add various runs. + * + * @param argc number of input arguments + * @param argv list of input arguments + * + * @return PMUSR_SUCCESS if everthing went smooth, otherwise and error number + */ +int main(int argc, char *argv[]) +{ + // check for --help or --version + if (argc == 2) { + if (!strncmp(argv[1], "--help", 128) || !strncmp(argv[1], "-h", 128)) { + addRun_syntax(); + return PMUSR_SUCCESS; + } else if (!strncmp(argv[1], "--version", 128) || !strncmp(argv[1], "-v", 128)) { +#ifdef HAVE_CONFIG_H +#ifdef HAVE_GIT_REV_H + std::cout << std::endl << "addRun version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl; +#else + std::cout << std::endl << "addRun version: " << PACKAGE_VERSION << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl; +#endif +#else +#ifdef HAVE_GIT_REV_H + std::cout << std::endl << "addRun git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl; +#else + std::cout << std::endl << "addRun version: unkown." << std::endl << std::endl; +#endif +#endif + return PMUSR_SUCCESS; + } else { + std::cerr << std::endl; + std::cerr << "**ERROR** missing required input." << std::endl; + std::cerr << std::endl; + addRun_syntax(); + return -1; + } + } + + // filter arguments + PIntVector t0; + Int_t ival; + UInt_t yearNum{0}; + std::string flnOut{""}; + std::string format{""}, year{""}, instrument{""}, dev{"tdc"}; + PUIntVector runList; + std::string inputFln{""}; + int status; + std::vector addRunInfo; + + for (int i=1; i= argc) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -t0 without value." << std::endl; + std::cerr << std::endl; + return -1; + } + // deal with run-list here + int idx=i+1; + if (!addRun_filter_t0(argc, argv, idx, t0)) { + return -2; + } + i=idx; + } else if (!strcmp(argv[i], "-f")) { + if (i+1 >= argc) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -f without argument." << std::endl; + std::cerr << std::endl; + return -1; + } + format = argv[i+1]; + if (!addRun_checkFormat(format)) { + format = ""; + std::cerr << std::endl; + std::cerr << "**ERROR** found -f with unsupported format: '" << format << "'" << std::endl; + std::cerr << std::endl; + return -2; + } + i++; + } else if (!strcmp(argv[i], "-y")) { + if (i+1 >= argc) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -y without value." << std::endl; + std::cerr << std::endl; + return -1; + } + status = sscanf(argv[i+1], "%d", &ival); + if (status != 1) { + std::cerr << std::endl; + std::cerr << "**ERROR** found invalid -y value: " << argv[i+1] << "." << std::endl; + std::cerr << std::endl; + return -2; + } + if (1900 - ival > 0) { + std::cerr << std::endl; + std::cerr << "**ERROR** found invalid -y value: " << argv[i+1] << "." << std::endl; + std::cerr << " Format has to be YYYY." << std::endl; + std::cerr << std::endl; + return -2; + } + yearNum = ival; + year = argv[i+1]; + i++; + } else if (!strcmp(argv[i], "-i")) { + if (i+1 >= argc) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -i without argument." << std::endl; + std::cerr << std::endl; + return -1; + } + instrument = argv[i+1]; + boost::to_lower(instrument); + i++; + } else if (!strcmp(argv[i], "-m")) { + if (i+1 >= argc) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -m without argument." << std::endl; + std::cerr << std::endl; + return -1; + } + std::string str(argv[i+1]); + boost::to_lower(str); + if ((str != "pta") && (str != "tdc")) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -m with unsupported argument '" << argv[i+1] << "'. Possible arguments are 'pta' or 'tdc'." << std::endl; + std::cerr << std::endl; + return -2; + } + dev = str; + i++; + } else if (!strcmp(argv[i], "-o")) { + if (i+1 >= argc) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -o without argument." << std::endl; + std::cerr << std::endl; + return -1; + } + flnOut = argv[i+1]; + i++; + } else if (!strcmp(argv[i], "-rl")) { + if (i+1 >= argc) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -rl without argument." << std::endl; + std::cerr << std::endl; + return -1; + } + // deal with run-list here + int idx=i+1; + if (!addRun_filter_runList(argc, argv, idx, runList)) { + return -2; + } + i=idx; + } else if (!strcmp(argv[i], "-in")) { + if (i+1 >= argc) { + std::cerr << std::endl; + std::cerr << "**ERROR** found -in without argument." << std::endl; + std::cerr << std::endl; + return -1; + } + inputFln = argv[i+1]; + i++; + } else { // error + std::cerr << std::endl; + std::cerr << "**ERROR** found unexpected command line element '" << argv[i] << "'" << std::endl; + std::cerr << std::endl; + addRun_syntax(); + return -1; + } + } + + // test for usage1 or usage2 + if (inputFln.empty() && (runList.size() == 0)) { + std::cerr << std::endl; + std::cerr << "**ERROR** essential input for usage1 and usage2 is missing." << std::endl; + std::cerr << std::endl; + addRun_syntax(); + return -3; + } + if (!inputFln.empty() && (runList.size() > 0)) { + std::cerr << std::endl; + std::cerr << "**ERROR** cannot decide if usage1 or usage2." << std::endl; + std::cerr << std::endl; + addRun_syntax(); + return -3; + } + + // read startup file + char startup_path_name[128]; + TSAXParser *saxParser = new TSAXParser(); + PStartupHandler *startupHandler = new PStartupHandler(); + if (!startupHandler->StartupFileFound()) { + std::cerr << std::endl << ">> addRun **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data(); + std::cerr << std::endl; + // clean up + if (saxParser) { + delete saxParser; + saxParser = nullptr; + } + if (startupHandler) { + delete startupHandler; + startupHandler = nullptr; + } + } else { + strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data()); + saxParser->ConnectToHandler("PStartupHandler", startupHandler); + //status = saxParser->ParseFile(startup_path_name); + // parsing the file as above seems to lead to problems in certain environments; + // use the parseXmlFile function instead (see PStartupHandler.cpp for the definition) + status = parseXmlFile(saxParser, startup_path_name); + // check for parse errors + if (status) { // error + std::cerr << std::endl << ">> addRun **WARNING** Reading/parsing musrfit_startup.xml failed."; + std::cerr << std::endl; + // clean up + if (saxParser) { + delete saxParser; + saxParser = nullptr; + } + if (startupHandler) { + delete startupHandler; + startupHandler = nullptr; + } + } else { + startupHandler->CheckLists(); + } + } + + // additional tests needed for usage1 (currently for PSI use only) + if (runList.size() > 0) { + if (t0.empty()) { + std::cout << ">> t0 not provided."; + } else { + std::cout << ">> t0: "; + for (int i=0; i> format: " << format << std::endl; + std::cout << ">> year: " << year << std::endl; + std::cout << ">> instrument: " << instrument << std::endl; + std::cout << ">> fln out: " << flnOut << std::endl; + std::cout << ">> runList: "; + for (int i=0; iGetDataPathList(), startupHandler->GetRunNameTemplateList(), instrument, yearNum, runList[i]); + if (findRun.FoundPathName()) { + std::cout << ">> found path name: " << findRun.GetPathName() << std::endl; + addRun.fPathFileName = findRun.GetPathName(); + addRunInfo.push_back(addRun); + } else { + std::cout << "**WARNING** run: " << runList[i] << " for instrument '" << instrument << "' and year '" << year << "' not found" << std::endl; + } + } + } + + // additional tests needed for usage2 + if (!inputFln.empty()) { + // check if file exists + if (!boost::filesystem::exists(inputFln)) { + std::cerr << std::endl; + std::cerr << "**ERROR** file '" << inputFln << "' seems not to exist." << std::endl; + std::cerr << std::endl; + return -1; + } + // read input-file and data sets + if (!addRun_readInputFiles(inputFln, addRunInfo)) { + return -2; + } + } + + for (int i=0; i> run " << i+1 << ": " << std::endl; + std::cout << ">> fln : " << addRunInfo[i].fPathFileName << std::endl; + if (addRunInfo[i].fT0.empty()) { + std::cout << ">> t0 not provided."; + } else { + std::cout << ">> t0: "; + for (int j=0; j runDataHandler; + runDataHandler.resize(addRunInfo.size()); + Bool_t isGood{true}; + for (UInt_t i=0; iGetDataPathList()); + if (runDataHandler[i] == nullptr) { + isGood = false; + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't invoke PRunDataHandler (i=" << i << ")." << std::endl; + std::cerr << std::endl; + break; + } + runDataHandler[i]->ReadData(); + if (!runDataHandler[i]->IsAllDataAvailable()) { + isGood = false; + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't read data for PRunDataHandler (i=" << i << ")." << std::endl; + std::cerr << std::endl; + break; + } + } else { + runDataHandler[i] = new PRunDataHandler(addRunInfo[i].fPathFileName, addRunInfo[i].fFileFormat); + if (runDataHandler[i] == nullptr) { + isGood = false; + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't invoke PRunDataHandler (i=" << i << ")." << std::endl; + std::cerr << std::endl; + break; + } + runDataHandler[i]->ReadData(); + if (!runDataHandler[i]->IsAllDataAvailable()) { + isGood = false; + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't read data for PRunDataHandler (i=" << i << ")." << std::endl; + std::cerr << std::endl; + break; + } + } + } + + // make sure that the number of provided t0's are matching the number of histos from the run-file + + // 1st make sure all the runs have the same number run data (==1 here) + PAny2ManyInfo *info{nullptr}; + PRunDataHandler *dataOut{nullptr}; + if (isGood) { + for (UInt_t i=1; iGetNoOfRunData() != runDataHandler[i]->GetNoOfRunData()) { + isGood = false; + std::cerr << std::endl; + std::cerr << "**ERROR** can only handle same number of run data per run handler." << std::endl; + std::cerr << std::endl; + break; + } + } + info = new PAny2ManyInfo(); + if (info == nullptr) { + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't invoke PAny2ManyInfo." << std::endl; + std::cerr << std::endl; + isGood = false; + } + } + + if (isGood) { + // prepare for the new added run data sets + info->outFormat = format; + info->year = year; + info->outFileName = flnOut; + dataOut = new PRunDataHandler(info); + if (dataOut == nullptr) { + std::cerr << std::endl; + std::cerr << "**ERROR** couldn't invoke PRunDataHandler for the output file." << std::endl; + std::cerr << std::endl; + isGood = false; + } + } + + if (isGood) { + // check that all runs have the same number of histograms + for (UInt_t i=1; iGetRunData()->GetNoOfHistos() != runDataHandler[0]->GetRunData()->GetNoOfHistos()) { + std::cerr << std::endl; + std::cerr << "**ERROR** can only add runs with the same number of histograms." << std::endl; + std::cerr << std::endl; + isGood = false; + } + } + } + + if (isGood) { + // add all the runs + // take first run as the reference for the data + std::vector addedHistos; + addedHistos.resize(runDataHandler[0]->GetRunData()->GetNoOfHistos()); + for (UInt_t i=0; iGetRunData()->GetNoOfHistos(); i++) { + addedHistos[i] = runDataHandler[0]->GetRunData()->GetDataSet(i, false)->GetData(); + } + // get the t0's for all the reference histos + PIntVector t0Vec; + t0Vec.resize(runDataHandler[0]->GetRunData()->GetNoOfHistos()); + if (addRunInfo[0].fT0.empty()) { // i.e. take t0's from data file + for (UInt_t i=0; iGetRunData()->GetNoOfHistos(); i++) { + t0Vec[i] = runDataHandler[0]->GetRunData()->GetT0Bin(i+1); + } + addRunInfo[0].fT0 = t0Vec; + } else { // t0 vector present + // make sure that the number of t0's fit the number of histos + if (addRunInfo[0].fT0.size() < runDataHandler[0]->GetRunData()->GetNoOfHistos()) { + UInt_t counts=runDataHandler[0]->GetRunData()->GetNoOfHistos()-addRunInfo[0].fT0.size(); + for (UInt_t i=0; iGetRunData()->GetT0Bin(i+1); + } else if (addRunInfo[0].fT0[i] == -1) { // get t0 from prompt peak + addRunInfo[0].fT0[i] = addRun_getPromptPeakPos(runDataHandler[0]->GetRunData()->GetDataSet(i, false)->GetData()); + } + } + } + + // loop over the remaining runs, determine t0's if needed and add the data + for (int i=1; iGetRunData()->GetNoOfHistos()); + if (addRunInfo[i].fT0.empty()) { // i.e. take t0's from data file + for (UInt_t j=0; jGetRunData()->GetNoOfHistos(); j++) { + t0Vec[j] = runDataHandler[i]->GetRunData()->GetT0Bin(j+1); + } + addRunInfo[i].fT0 = t0Vec; + } else { // t0 vector present + // make sure that the number of t0's fit the number of histos + if (addRunInfo[i].fT0.size() < runDataHandler[i]->GetRunData()->GetNoOfHistos()) { + UInt_t counts=runDataHandler[i]->GetRunData()->GetNoOfHistos()-addRunInfo[i].fT0.size(); + for (UInt_t j=0; jGetRunData()->GetT0Bin(j+1); + } else if (addRunInfo[i].fT0[j] == -1) { // get t0 from prompt peak + addRunInfo[i].fT0[j] = addRun_getPromptPeakPos(runDataHandler[i]->GetRunData()->GetDataSet(j, false)->GetData()); + } + } + } + + // calculate the offset due to potential differences in t0's between runs + PIntVector diff; + diff.resize(addRunInfo[i].fT0.size()); + for (UInt_t j=0; jGetRunData()->GetNoOfHistos(); j++) { // loop over all histos + addData = runDataHandler[i]->GetRunData()->GetDataSet(j, false)->GetData(); + for (int k=0; ksize(); k++) { // loop over all elements of a histo + idx = k + diff[j]; + if ((idx >= 0) && (idx < addData->size())) { + addedHistos[j]->at(k) += addData->at(idx); + } + } + } + } + + // feed all the necessary information for the data file + PRawRunData *rawRunData = new PRawRunData(); + rawRunData = runDataHandler[0]->GetRunData(); // copy all + rawRunData->SetGenerator("addRun"); + // overwrite the t0 values with the new ones + for (UInt_t i=0; iGetNoOfHistos(); i++) { + rawRunData->GetDataSet(i, false)->SetTimeZeroBin(addRunInfo[0].fT0[i]); + } + // write histos + for (UInt_t i=0; iGetNoOfHistos(); i++) { + rawRunData->GetDataSet(i, false)->SetData(*addedHistos[i]); + } + + // feed run data handler with new data + if (dataOut->SetRunData(rawRunData)) { + // write output file + dataOut->WriteData(); + } + } + + // clean up + if (startupHandler) { + delete startupHandler; + } + if (info) { + delete info; + } + if (dataOut) { + delete dataOut; + } + for (int i=0; iSet a raw run data set. + * + * @param data pointer to the raw run data set + * @param idx index to where to write it. + * + * @return true in case of success, false otherwise. + */ +Bool_t PRunDataHandler::SetRunData(PRawRunData *data, UInt_t idx) +{ + if ((idx == 0) && (fData.size() == 0)) { + fData.resize(1); + } + if (idx >= fData.size()) { + std::cerr << std::endl << ">>PRunDataHandler::SetRunData(): **ERROR** idx=" << idx << " is out-of-range (0.." << fData.size() << ")." << std::endl; + return false; + } + + fData[idx] = *data; + + return true; +} + //-------------------------------------------------------------------------- // WriteData //-------------------------------------------------------------------------- /** *

Write data. This routine is used to write a single file. */ -void PRunDataHandler::WriteData() +Bool_t PRunDataHandler::WriteData(TString fileName) { + if ((fAny2ManyInfo == nullptr) && (fileName="")) { + std::cerr << std::endl << ">> PRunDataHandler::WriteData(): **ERROR** insufficient information: no fileName nor fAny2ManyInfo object."; + std::cerr << std::endl << " Cannot write data under this conditions." << std::endl; + return false; + } + // get output file format tag, first try via fAny2ManyInfo + Int_t outTag = A2M_UNDEFINED; + if (fAny2ManyInfo != nullptr) { + if (!fAny2ManyInfo->outFormat.CompareTo("musrroot", TString::kIgnoreCase)) + outTag = A2M_MUSR_ROOT; + else if (!fAny2ManyInfo->outFormat.CompareTo("psibin", TString::kIgnoreCase)) + outTag = A2M_PSIBIN; + else if (!fAny2ManyInfo->outFormat.CompareTo("psimdu", TString::kIgnoreCase)) + outTag = A2M_PSIMDU; + else if (!fAny2ManyInfo->outFormat.CompareTo("mud",TString::kIgnoreCase)) + outTag = A2M_MUD; + else if (fAny2ManyInfo->outFormat.BeginsWith("nexus", TString::kIgnoreCase)) + outTag = A2M_NEXUS; + else + outTag = A2M_UNDEFINED; + } else { // only fileName is given, try to guess from the extension + // STILL MISSING + } + + if (outTag == A2M_UNDEFINED) { + std::cerr << std::endl << ">> PRunDataHandler::WriteData(): **ERROR** no valid output data file format found: '" << fAny2ManyInfo->outFormat.Data() << "'" << std::endl; + return false; + } + + Bool_t success{true}; + switch (outTag) { + case A2M_MUSR_ROOT: + if (fAny2ManyInfo->outFileName.Length() == 0) + success = WriteMusrRootFile(fileName); + else + success = WriteMusrRootFile(fAny2ManyInfo->outFileName); + break; + case A2M_PSIBIN: + case A2M_PSIMDU: + if (fAny2ManyInfo->outFileName.Length() == 0) + success = WritePsiBinFile(fileName); + else + success = WritePsiBinFile(fAny2ManyInfo->outFileName); + break; + case A2M_MUD: + if (fAny2ManyInfo->outFileName.Length() == 0) + success = WriteMudFile(fileName); + else + success = WriteMudFile(fAny2ManyInfo->outFileName); + break; + case A2M_NEXUS: + if (fAny2ManyInfo->outFileName.Length() == 0) + success = WriteNexusFile(fileName); + else + success = WriteNexusFile(fAny2ManyInfo->outFileName); + break; + default: + break; + } + + return success; } //-------------------------------------------------------------------------- @@ -2683,7 +2785,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile() Bool_t success; // read psi bin file - status = psiBin.read(fRunPathName.Data()); + status = psiBin.Read(fRunPathName.Data()); switch (status) { case 0: // everything perfect success = true; @@ -2772,32 +2874,32 @@ Bool_t PRunDataHandler::ReadPsiBinFile() // keep run name runData.SetRunName(fRunName); // get run title - runData.SetRunTitle(TString(psiBin.get_comment().c_str())); // run title + runData.SetRunTitle(TString(psiBin.GetComment().c_str())); // run title // get run number - runData.SetRunNumber(psiBin.get_runNumber_int()); + runData.SetRunNumber(psiBin.GetRunNumberInt()); // get setup - runData.SetSetup(TString(psiBin.get_comment().c_str())); + runData.SetSetup(TString(psiBin.GetComment().c_str())); // get sample - runData.SetSample(TString(psiBin.get_sample().c_str())); + runData.SetSample(TString(psiBin.GetSample().c_str())); // get orientation - runData.SetOrientation(TString(psiBin.get_orient().c_str())); + runData.SetOrientation(TString(psiBin.GetOrient().c_str())); // get comment - runData.SetComment(TString(psiBin.get_comment().c_str())); + runData.SetComment(TString(psiBin.GetComment().c_str())); // set LEM specific information to default value since it is not in the file and not used... runData.SetEnergy(PMUSR_UNDEFINED); runData.SetTransport(PMUSR_UNDEFINED); // get field Double_t scale = 0.0; - if (psiBin.get_field().rfind("G") != std::string::npos) + if (psiBin.GetField().rfind("G") != std::string::npos) scale = 1.0; - if (psiBin.get_field().rfind("T") != std::string::npos) + if (psiBin.GetField().rfind("T") != std::string::npos) scale = 1.0e4; - status = sscanf(psiBin.get_field().c_str(), "%lf", &dval); + status = sscanf(psiBin.GetField().c_str(), "%lf", &dval); if (status == 1) runData.SetField(scale*dval); // get temperature - PDoubleVector tempVec(psiBin.get_temperatures_vector()); - PDoubleVector tempDevVec(psiBin.get_devTemperatures_vector()); + PDoubleVector tempVec(psiBin.GetTemperaturesVector()); + PDoubleVector tempDevVec(psiBin.GetDevTemperaturesVector()); if ((tempVec.size() > 1) && (tempDevVec.size() > 1) && tempVec[0] && tempVec[1]) { // take only the first two values for now... //maybe that's not enough - e.g. in older GPD data I saw the "correct values in the second and third entry..." @@ -2807,16 +2909,16 @@ Bool_t PRunDataHandler::ReadPsiBinFile() tempVec.clear(); tempDevVec.clear(); } else { - status = sscanf(psiBin.get_temp().c_str(), "%lfK", &dval); + status = sscanf(psiBin.GetTemp().c_str(), "%lfK", &dval); if (status == 1) runData.SetTemperature(0, dval, 0.0); } // get time resolution (ns) - runData.SetTimeResolution(psiBin.get_binWidth_ns()); + runData.SetTimeResolution(psiBin.GetBinWidthNanoSec()); // get start/stop time - std::vector sDateTime = psiBin.get_timeStart_vector(); + std::vector sDateTime = psiBin.GetTimeStartVector(); if (sDateTime.size() < 2) { std::cerr << std::endl << ">> **WARNING** psi-bin file: couldn't obtain run start date/time" << std::endl; } @@ -2830,7 +2932,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile() runData.SetStartTime(sDateTime[1]); sDateTime.clear(); - sDateTime = psiBin.get_timeStop_vector(); + sDateTime = psiBin.GetTimeStopVector(); if (sDateTime.size() < 2) { std::cerr << std::endl << ">> **WARNING** psi-bin file: couldn't obtain run stop date/time" << std::endl; } @@ -2845,7 +2947,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile() sDateTime.clear(); // get t0's - PIntVector t0 = psiBin.get_t0_vector(); + PIntVector t0 = psiBin.GetT0Vector(); if (t0.empty()) { std::cerr << std::endl << ">> **ERROR** psi-bin file: couldn't obtain any t0's"; @@ -2854,7 +2956,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile() } // get first good bin - PIntVector fgb = psiBin.get_firstGood_vector(); + PIntVector fgb = psiBin.GetFirstGoodVector(); if (fgb.empty()) { std::cerr << std::endl << ">> **ERROR** psi-bin file: couldn't obtain any fgb's"; std::cerr << std::endl; @@ -2862,7 +2964,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile() } // get last good bin - PIntVector lgb = psiBin.get_lastGood_vector(); + PIntVector lgb = psiBin.GetLastGoodVector(); if (lgb.empty()) { std::cerr << std::endl << ">> **ERROR** psi-bin file: couldn't obtain any lgb's"; std::cerr << std::endl; @@ -2872,13 +2974,12 @@ Bool_t PRunDataHandler::ReadPsiBinFile() // fill raw data PRawRunDataSet dataSet; PDoubleVector histoData; - Int_t *histo; - for (Int_t i=0; i histo; + for (Int_t i=0; i(t0.size())) dataSet.SetTimeZeroBin(t0[i]); @@ -5195,15 +5296,15 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) // fill header information // run number - psibin.put_runNumber_int(fData[0].GetRunNumber()); + psibin.PutRunNumberInt(fData[0].GetRunNumber()); // length of histograms UInt_t histo0 = 1; if (fAny2ManyInfo->groupHistoList.size() != 0) { // red/green list found histo0 = fAny2ManyInfo->groupHistoList[0]+1; // take the first available red/green entry } - psibin.put_histoLength_bin(static_cast(fData[0].GetDataBin(histo0)->size()/fAny2ManyInfo->rebin)); + psibin.PutHistoLengthBin(static_cast(fData[0].GetDataBin(histo0)->size()/fAny2ManyInfo->rebin)); // number of histograms - psibin.put_numberHisto_int(static_cast(fData[0].GetNoOfHistos())); + psibin.PutNumberHistoInt(static_cast(fData[0].GetNoOfHistos())); // run title = sample (10 char) / temp (10 char) / field (10 char) / orientation (10 char) char cstr[11]; // sample @@ -5212,35 +5313,35 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) else strcpy(cstr, "??"); cstr[10] = '\0'; - psibin.put_sample(cstr); + psibin.PutSample(cstr); // temp if (fData[0].GetNoOfTemperatures() > 0) snprintf(cstr, 10, "%.1f K", fData[0].GetTemperature(0)); else strcpy(cstr, "?? K"); cstr[10] = '\0'; - psibin.put_temp(cstr); + psibin.PutTemp(cstr); // field if (fData[0].GetField() > 0) snprintf(cstr, 10, "%.1f G", fData[0].GetField()); else strcpy(cstr, "?? G"); cstr[10] = '\0'; - psibin.put_field(cstr); + psibin.PutField(cstr); // orientation if (fData[0].GetOrientation()->Length() > 0) strncpy(cstr, fData[0].GetOrientation()->Data(), 10); else strcpy(cstr, "??"); cstr[10] = '\0'; - psibin.put_orient(cstr); + psibin.PutOrient(cstr); // setup if (fData[0].GetSetup()->Length() > 0) strncpy(cstr, fData[0].GetSetup()->Data(), 10); else strcpy(cstr, "??"); cstr[10] = '\0'; - psibin.put_setup(cstr); + psibin.PutSetup(cstr); // handle PSI-BIN start/stop Time/Date. PSI-BIN requires: Time -> HH:MM:SS, and Date -> DD-MMM-YY // internally given: Time -> HH:MM:SS, and Date -> YYYY-MM-DD @@ -5251,7 +5352,7 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) int year, month, day; // 28-Aug-2014, TP: the following line does not work, it generates the wrong date - //dt.Set(fData[0].GetStartDateTime()); + //dt.Set(fData[0].GetStartDateTime()); //as35 // the following generates the correct date entry date.Append(*fData[0].GetStartDate()); sscanf((const char*)date.Data(),"%04d-%02d-%02d", &year, &month, &day); @@ -5268,7 +5369,7 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) strncpy(cstr, fData[0].GetStartTime()->Data(), 8); cstr[8] = '\0'; svec.push_back(cstr); - psibin.put_timeStart_vector(svec); + psibin.PutTimeStartVector(svec); svec.clear(); // run stop date @@ -5291,32 +5392,32 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) strncpy(cstr, fData[0].GetStopTime()->Data(), 8); cstr[8] = '\0'; svec.push_back(cstr); - psibin.put_timeStop_vector(svec); + psibin.PutTimeStopVector(svec); svec.clear(); // number of measured temperatures - psibin.put_numberTemperature_int(fData[0].GetNoOfTemperatures()); + psibin.PutNumberTemperatureInt(fData[0].GetNoOfTemperatures()); // mean temperatures std::vector dvec; for (UInt_t i=0; iData()); + psibin.PutComment(fData[0].GetRunTitle()->Data()); // write time resolution - psibin.put_binWidth_ns(fData[0].GetTimeResolution()*fAny2ManyInfo->rebin); + psibin.PutBinWidthNanoSec(fData[0].GetTimeResolution()*fAny2ManyInfo->rebin); // write scaler dummies - psibin.put_numberScaler_int(0); + psibin.PutNumberScalerInt(0); // feed detector related info like, histogram names, t0, fgb, lgb Int_t ival = 0; @@ -5334,16 +5435,16 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) str = dataSet->GetName(); if (!str.CompareTo("n/a")) str.Form("Detector%3d", i+1); - psibin.put_nameHisto(str.Data(), i); + psibin.PutNameHisto(str.Data(), i); // time zero bin ival = static_cast(dataSet->GetTimeZeroBin()/fAny2ManyInfo->rebin); - psibin.put_t0_int(i, ival); + psibin.PutT0Int(i, ival); // first good bin ival = static_cast(dataSet->GetFirstGoodBin()/fAny2ManyInfo->rebin); - psibin.put_firstGood_int(i, ival); + psibin.PutFirstGoodInt(i, ival); // last good bin ival = static_cast(dataSet->GetLastGoodBin()/fAny2ManyInfo->rebin); - psibin.put_lastGood_int(i, ival); + psibin.PutLastGoodInt(i, ival); } // feed histos @@ -5386,19 +5487,19 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) } } } - status = psibin.put_histo_array_int(histos); + status = psibin.PutHistoArrayInt(histos, 2); // tag 2 means: lift histo length restriction on only make sure it is < 32512 if (status != 0) { std::cerr << std::endl << ">> PRunDataHandler::WritePsiBinFile(): " << psibin.ConsistencyStatus() << std::endl; return false; } - if (!psibin.CheckDataConsistency()) { + if (!psibin.CheckDataConsistency(2)) { std::cerr << std::endl << ">> PRunDataHandler::WritePsiBinFile(): " << psibin.ConsistencyStatus() << std::endl; return false; } // write data to file - status = psibin.write(fln.Data()); + status = psibin.Write(fln.Data()); if (status != 0) { std::cerr << std::endl << ">> PRunDataHandler::WritePsiBinFile(): " << psibin.WriteStatus() << std::endl; @@ -5959,6 +6060,9 @@ TString PRunDataHandler::GenerateOutputFileName(const TString fileName, const TS TString fln = fileName; ok = true; + if (fAny2ManyInfo == nullptr) + return fln; + // generate output file name if needed if (!fAny2ManyInfo->useStandardOutput || (fAny2ManyInfo->compressionTag > 0)) { if (fln.Length() == 0) { diff --git a/src/classes/PStartupHandler.cpp b/src/classes/PStartupHandler.cpp index dc844d120..2978af0e4 100644 --- a/src/classes/PStartupHandler.cpp +++ b/src/classes/PStartupHandler.cpp @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include "PStartupHandler.h" @@ -173,6 +175,7 @@ PStartupHandler::~PStartupHandler() fDataPathList.clear(); fMarkerList.clear(); fColorList.clear(); + fRunNameTemplate.clear(); } //-------------------------------------------------------------------------- @@ -224,6 +227,15 @@ void PStartupHandler::OnStartElement(const Char_t *str, const TList *attributes) { if (!strcmp(str, "data_path")) { fKey = eDataPath; + } else if (!strcmp(str, "run_name_template")) { + fKey = eRunNameTemplate; + TXMLAttr *attr; + TIter next(attributes); + while ((attr = (TXMLAttr*) next())) { + if (!strcmp(attr->GetName(), "inst")) { + fCurrentInstrumentName = attr->GetValue(); + } + } } else if (!strcmp(str, "marker")) { fKey = eMarker; } else if (!strcmp(str, "color")) { @@ -272,12 +284,19 @@ void PStartupHandler::OnCharacters(const Char_t *str) TString tstr; Int_t color, r, g, b, ival; + PRunNameTemplate tmpl; switch (fKey) { case eDataPath: // check that str is a valid path // add str to the path list fDataPathList.push_back(str); break; + case eRunNameTemplate: + tmpl.instrument = fCurrentInstrumentName; + tmpl.runNameTemplate = str; + fRunNameTemplate.push_back(tmpl); + fCurrentInstrumentName="???"; + break; case eMarker: // check that str is a number tstr = TString(str); @@ -636,6 +655,54 @@ Bool_t PStartupHandler::WriteDefaultStartupFile() fout << " /afs/psi.ch/project/bulkmusr/data/alc" << std::endl; fout << " /afs/psi.ch/project/bulkmusr/data/hifi" << std::endl; fout << " /afs/psi.ch/project/bulkmusr/data/lem" << std::endl; + fout << " " << std::endl; + fout << " d%yyyy%/pie1/deltat_flc_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/pie3/deltat_flc_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_flc_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_pta_dolly_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/tdc/deltat_tdc_dolly_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/tdc/root/deltat_tdc_dolly_%rrrr%.root" << std::endl; + fout << " " << std::endl; + fout << " d%yyyy%/tdc/root/deltat_tdc_flame_%yyyy%_%rrrr%.bin" << std::endl; + fout << " " << std::endl; + fout << " d%yyyy%/deltat_mue1_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_fq_si_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_strobo_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_hp_ni_ht_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_hp_ni_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_ccr2_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_gpd_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_janis_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_janis_gpd_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_pta_gpd_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/tdc/deltat_tdc_gpd_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/tdc/root/deltat_tdc_gpd_%rrrr%.root" << std::endl; + fout << " " << std::endl; + fout << " d%yyyy%/deltat_ccr_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_he3_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_stutt_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_ltf_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_flc_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_flc2_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_oven_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_oven2_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_pta_gps_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/tdc/deltat_tdc_gps_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/tdc/root/deltat_tdc_gps_%yyyy%_%rrrr%.root" << std::endl; + fout << " " << std::endl; + fout << " d%yyyy%/tdc/deltat_hifi_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/tdc/tdc_hifi_%yyyy%_%rrrrr%.mdu" << std::endl; + fout << " d%yyyy%/tdc/root/deltat_tdc_hifi_%yyyy%_%rrrr%.mdu" << std::endl; + fout << " " << std::endl; + fout << " d%yyyy%/deltat_ltf_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/deltat_pta_ltf_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/pta/deltat_pta_ltf_%rrrr%.bin" << std::endl; + fout << " d%yyyy%/tdc/deltat_tdc_ltf_%rrrr%.bin" << std::endl; + fout << " " << std::endl; + fout << " %yyyy%/lem%yy%_his_%rrrr%.root" << std::endl; + fout << " d%yyyy%/tdc/lem%yy%_his_%rrrr%.root" << std::endl; fout << " " << std::endl; fout << " Gauss" << std::endl; fout << " 0" << std::endl; diff --git a/src/dump_header.cpp b/src/dump_header.cpp index ecb89d089..98697e991 100644 --- a/src/dump_header.cpp +++ b/src/dump_header.cpp @@ -321,7 +321,7 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat bool success = false; // read psi bin file - status = psiBin.read(fileName.c_str()); + status = psiBin.Read(fileName.c_str()); switch (status) { case 0: // everything perfect success = true; @@ -357,15 +357,15 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat std::cout << std::endl << "-------------------"; std::cout << std::endl << "fileName = " << fileName << ", fileFormat = " << fileFormat; std::cout << std::endl << "-------------------"; - std::cout << std::endl << "Run Title : " << psiBin.get_comment(); - std::cout << std::endl << "Run Number : " << psiBin.get_runNumber_int(); - vstr = psiBin.get_timeStart_vector(); + std::cout << std::endl << "Run Title : " << psiBin.GetComment(); + std::cout << std::endl << "Run Number : " << psiBin.GetRunNumberInt(); + vstr = psiBin.GetTimeStartVector(); if (vstr.size() < 2) { std::cout << std::endl << "**ERROR** couldn't obtain \"Run Start Time\" will quit." << std::endl << std::endl; return 1; } std::cout << std::endl << "Run Start Time : " << vstr[0] << "; " << vstr[1]; - vstr = psiBin.get_timeStop_vector(); + vstr = psiBin.GetTimeStopVector(); if (vstr.size() < 2) { std::cout << std::endl << "**ERROR** couldn't obtain \"Run Stop Time\" will quit." << std::endl << std::endl; return 1; @@ -382,31 +382,31 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat std::cout << std::endl << "Muon Beam Momentum : " << vstr[2]; std::cout << std::endl << "Muon Species : " << vstr[3]; std::cout << std::endl << "Muon Source : " << vstr[4]; - std::cout << std::endl << "Setup : " << psiBin.get_comment(); + std::cout << std::endl << "Setup : " << psiBin.GetComment(); std::cout << std::endl << "Comment : n/a"; - std::cout << std::endl << "Sample Name : " << psiBin.get_sample(); - std::cout << std::endl << "Sample Orientation : " << psiBin.get_orient(); - dVal = psiBin.get_temperatures_vector(); - dErrVal = psiBin.get_devTemperatures_vector(); + std::cout << std::endl << "Sample Name : " << psiBin.GetSample(); + std::cout << std::endl << "Sample Orientation : " << psiBin.GetOrient(); + dVal = psiBin.GetTemperaturesVector(); + dErrVal = psiBin.GetDevTemperaturesVector(); if (dVal.size() != dErrVal.size()) { - std::cout << std::endl << "Sample Temperature : " << psiBin.get_temp(); + std::cout << std::endl << "Sample Temperature : " << psiBin.GetTemp(); } else { for (unsigned int i=0; iHolds the informations for the any2many converter program */ typedef struct { - Bool_t useStandardOutput; ///< flag showing if the converted shall be sent to the standard output - TString inFormat; ///< holds the information about the input data file format - TString outFormat; ///< holds the information about the output data file format - TString inTemplate; ///< holds the input file template - TString outTemplate; ///< holds the output file template - TString year; ///< holds the information about the year to be used - PUIntVector runList; ///< holds the run number list to be converted - PIntVector groupHistoList; ///< holds the histo group list offset (used to define for MusrRoot files, what to be exported) - PStringVector inFileName; ///< holds the file name of the input data file - TString outFileName; ///< holds the output file name - PStringVector outPathFileName; ///< holds the out path/file name - TString outPath; ///< holds the output path - UInt_t rebin; ///< holds the number of bins to be packed - UInt_t compressionTag; ///< 0=no compression, 1=gzip compression, 2=bzip2 compression - TString compressFileName; ///< holds the name of the outputfile name in case of compression is used - UInt_t idf; ///< IDF version for NeXus files. + Bool_t useStandardOutput{false}; ///< flag showing if the converted shall be sent to the standard output + TString inFormat{""}; ///< holds the information about the input data file format + TString outFormat{""}; ///< holds the information about the output data file format + TString inTemplate{""}; ///< holds the input file template + TString outTemplate{""}; ///< holds the output file template + TString year{""}; ///< holds the information about the year to be used + PUIntVector runList; ///< holds the run number list to be converted + PIntVector groupHistoList; ///< holds the histo group list offset (used to define for MusrRoot files, what to be exported) + PStringVector inFileName; ///< holds the file name of the input data file + TString outFileName{""}; ///< holds the output file name + PStringVector outPathFileName; ///< holds the out path/file name + TString outPath{""}; ///< holds the output path + UInt_t rebin{1}; ///< holds the number of bins to be packed + UInt_t compressionTag{0}; ///< 0=no compression, 1=gzip compression, 2=bzip2 compression + TString compressFileName{""}; ///< holds the name of the outputfile name in case of compression is used + UInt_t idf{0}; ///< IDF version for NeXus files. } PAny2ManyInfo; //------------------------------------------------------------- @@ -874,4 +874,19 @@ class PStringNumberList { virtual void StripSpaces(); }; +//------------------------------------------------------------- +/** + *

Run name template structure. + */ +typedef struct { + TString instrument{""}; + TString runNameTemplate{""}; +} PRunNameTemplate; + +//------------------------------------------------------------- +/** + *

typedef to make to code more readable: list of run name templates. + */ +typedef std::vector PRunNameTemplateList; + #endif // _PMUSR_H_ diff --git a/src/include/PRunDataHandler.h b/src/include/PRunDataHandler.h index 16ef4657a..81b8284ac 100644 --- a/src/include/PRunDataHandler.h +++ b/src/include/PRunDataHandler.h @@ -53,13 +53,15 @@ class PRunDataHandler virtual void ReadData(); virtual void ConvertData(); - virtual void WriteData(); + virtual Bool_t WriteData(TString fileName=""); virtual Bool_t IsAllDataAvailable() const { return fAllDataAvailable; } virtual PRawRunData* GetRunData(const TString &runName); virtual PRawRunData* GetRunData(const UInt_t idx=0); virtual Int_t GetNoOfRunData() {return fData.size(); } + virtual Bool_t SetRunData(PRawRunData *data, UInt_t idx=0); + private: PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler PAny2ManyInfo *fAny2ManyInfo; ///< pointer to the any2many data structure diff --git a/src/include/PStartupHandler.h b/src/include/PStartupHandler.h index 5f878495d..767331761 100644 --- a/src/include/PStartupHandler.h +++ b/src/include/PStartupHandler.h @@ -74,12 +74,13 @@ class PStartupHandler : public TObject, public TQObject virtual void CheckLists(); virtual PMsrFourierStructure GetFourierDefaults() { return fFourierDefaults; } ///< returns the Fourier defaults + virtual const PRunNameTemplateList GetRunNameTemplateList() { return fRunNameTemplate; } virtual const PStringVector GetDataPathList() const { return fDataPathList; } ///< returns the search data path list virtual const PIntVector GetMarkerList() const { return fMarkerList; } ///< returns the marker list virtual const PIntVector GetColorList() const { return fColorList; } ///< returns the color list private: - enum EKeyWords {eEmpty, eComment, eDataPath, eOptions, + enum EKeyWords {eEmpty, eComment, eDataPath, eRunNameTemplate, eOptions, eFourierSettings, eUnits, eFourierPower, eApodization, ePlot, ePhase, ePhaseIncrement, eRootSettings, eMarkerList, eMarker, @@ -88,8 +89,10 @@ class PStartupHandler : public TObject, public TQObject Bool_t fStartupFileFound; ///< startup file found flag TString fStartupFilePath; ///< full musrfit_startup.xml startup file paths + TString fCurrentInstrumentName; ///< current instrument name PMsrFourierStructure fFourierDefaults; ///< Fourier defaults PStringVector fDataPathList; ///< search data path list + PRunNameTemplateList fRunNameTemplate; ///< run name template vector PIntVector fMarkerList; ///< marker list PIntVector fColorList; ///< color list From e0ec00deabe016bdc9df84107de47152f46bcc97 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sun, 29 May 2022 11:31:41 +0200 Subject: [PATCH 5/6] update ChangeLog --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5c4e7727d..608243c78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,13 @@ or https://bitbucket.org/muonspin/musrfit/commits/all +Release of V1.8.0, 2022/05/22 +============================= + +new: addRun - allows to add runs and write it to file +refactoring of Class_MuSR_PSI: (i) class variables and methods renamed according to ROOT +rules. (ii) start to modernize to newer c++ standards. + Release of V1.7.6, 2021/10/02 ============================= From 7e830a0c12db5e439e7c1111258a7995d9c51b44 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sun, 29 May 2022 12:52:13 +0200 Subject: [PATCH 6/6] update of the docu. --- doc/html/_static/alert_info_32.png | Bin 1128 -> 1168 bytes doc/html/_static/alert_warning_32.png | Bin 944 -> 1060 bytes doc/html/_static/basic.css | 393 +--- doc/html/_static/bg-page.png | Bin 82 -> 164 bytes doc/html/_static/bullet_orange.png | Bin 165 -> 365 bytes doc/html/_static/doctools.js | 110 +- doc/html/_static/file.png | Bin 286 -> 392 bytes doc/html/_static/haiku.css | 10 +- doc/html/_static/jquery.js | 4 +- doc/html/_static/minus.png | Bin 90 -> 199 bytes doc/html/_static/nature.css | 89 +- doc/html/_static/plus.png | Bin 90 -> 199 bytes doc/html/_static/pygments.css | 7 +- doc/html/_static/searchtools.js | 382 ++-- doc/html/acknowledgement.html | 79 +- doc/html/any2many.html | 65 +- doc/html/bugtracking.html | 57 +- doc/html/cite.html | 75 +- doc/html/genindex.html | 1280 +++++++---- doc/html/index.html | 83 +- doc/html/msr2data.html | 423 ++-- doc/html/mupp.html | 243 +- doc/html/musr-root.html | 866 +++---- doc/html/musredit.html | 470 ++-- doc/html/objects.inv | Bin 2197 -> 2043 bytes doc/html/search.html | 77 +- doc/html/searchindex.js | 2 +- doc/html/setup-dks.html | 205 +- doc/html/setup-standard.html | 1006 ++++----- doc/html/tutorial.html | 359 +-- doc/html/user-libs.html | 516 ++--- doc/html/user-manual.html | 3008 +++++++++++++------------ 32 files changed, 4981 insertions(+), 4828 deletions(-) diff --git a/doc/html/_static/alert_info_32.png b/doc/html/_static/alert_info_32.png index ea4d1baf7001be1d988ca82c2ac4d65803589915..05b4fe898c39c93ca6041650c49dcb67e6595432 100644 GIT binary patch delta 1147 zcmV->1cdwO2#^VoB!5>)L_t(o!@ZYpXjOF>$3OHUN_x?or&qsvae8r!6Bil{7MFot zWZZ_VvAoGHyJV9!G~9$cHB{2H`9J@pY2qK2j)b7Bur#R@sf7GTqGSr<)J>+&=AUg| z-QBkr=S;6lV$i)k@bKeu4m_Xpe4gL$oD2URV}KUm7;q=dqkljqyjIkB8aP38t}OAB ztn!#B-zOp)1W5rW!h4DmV}O&y+vS@2<;@zBYwDM!&dcJz3U7yC(lA6(I*}ndPi}fv z)oZ0Cd!*`hlAE5D)tnL~-wInJs8Xn-;BnNdevvmjC_bcM^=3JVi=2-_f-A>c?c z0J1jWPq`VvlYigqzzoSIo)x9v3tK0wRY0~l02PO14Lx!*rN|t~&6KR6N0vAy{4WK| zg)J%?z!9R`WR=HdsSC3D?qIDv9z4CJ zrNU~8GK7x;8O#aZ7Pd*at-;D_!Gf@OgK(7s4g-@534d@p*055kwl4XJ=5VWJ!j`uN zZMPa>X;E@e_@4<-Apumjct|x{a!PIMQ+Z~uyz=S7d|?scH41;5C_O47yTYy%7{F_~ zBG;0WKl85QOS7t6eN*uTJt}Fsq)56$uIhx$ZxbvLtSUIbTX+?+Nq@*qyDQh2m8&06 zY*xP#%YSYvmN_nqtOy2?rGhmD2LN~hoZLHExrVGP-7ibtl8wJEct03KT7$EIkBR~S zAU8ED*Kk`_*DsrJQzUvrfQ5oZf)#>~iwH0!E33aPtL>9j-w+jltfus5MbE_)xH3&{i;j zQ?V)QRoC9D^p2cr+XiLnf&1Gpeoe%#hW>{SpiczbhXK++azwrcyb2_M*TYNzF9A>f zV}Iyki*rhTn$w$~=agz6ytn=C`Hx-6^S?&0N!U)|S_P3oU_US)c;g{3BXa`q?1NLE z$;mYjs`R}(s@Zrq^dGi=Y>z0r68c{*SS#!s;hz!F4&k2`-cDgt1za8lKoY2a;4Nt7 z%jN1X$Tg1eKQ8oNdO6SkF5ym!$Qj|E6Mxb3L3)RWm5c`9m66{8Q^2~de4}h)SKz-g z&wuIVVES#3utUQAF1%C1KP#f=hHwW3yGIM~GVu7rhVcntF6IwV)-Ec#?zg|BTVCR% zqUm$;>pJAuo|m8MR3zCc+<~xotAGn5TtAElEu$b__5M>udNw@GX$#kpg zR$226mCxx{Sxc{6?113A{Nj@VzfcF02W-d23vZY3FN#Q)h;+(Jbjy|O4d$Up#q;Au zU^kW)-j5=3QA9cgUxjBwaf|0i9QX~JCcJ~;(ft1v&wp7Zfz$uB_}`Ee_LL!%8YBP! N002ovPDHLkV1g+fFPZ=V delta 1107 zcmV-Z1g!gz3FrurB!4eSL_t(|0kziyjAU6K1@QBIYx8b&SG7q7Z!<=3Dr41lCS%*S zZQHhO+qP}nGtIMSQZJdx81??iFE`D5-v2c5hWSz&$Zm;t?UMTPB|M&A@vAF($_3_c|3!sUe*@Q5)ms1qbkr) zuoE6klqqnOwjuT8Asf)krtm2u^-{tNkd6cp+i5D^q-{hdXilA^UZx4`CY)IW zx)Y|8X90F1$$vPS$bDM*d75%psgrs+`1E!Jf%b%H?pXy5U`h~4<`VwZM8*v|*92d- zBMEdMOjpV0$rs_LQXj?=s6?3IgdG(;(MQ_3msccgBmwM@@(AM`^H=P}Vq-4R3DkDK z)#|$|?z5VSuVpH02ba=tG)3_lWGb zLjrV>UNYFj0F`xlna4DRwfksyy%k4ki z4Y&W!(o+V>n6L#n;;%Z0B_`Zq$;ojnIwn@@fBfv*PwR(Y0nj1j2hb21FQAl^g3rk< z|4Kmey8@C*zQ=Pzf9E(B92>{d)8bfcf&!Fyu7CgakpBD1aKg+ctX_u%u>jUc8!03O z-+!Qh{DqLAtsh5QJC>oq1F8b% zs!2DLrtqa;|B=u74+iK#m?g5EuzLyL5r4utrOVI6!)_+9_-zCHBVP!fpRc6_jPn=~ z6SV$I&(@#fDt&>2Oj7a;of2p16g@|$*hMBNc#*K{+{-%(&Og_6q7c8m?f(+LNN*TF z;mlNk3seBYxlCWKtBk09kLj8}Vnl;Gw0>QVMWL6M7YAV)pNxmeN%+*eqaX<`$xKCU z<0@^6Wds&@c6sO|m&Gt86=bCXD2PG;bEJdkmxoSf*#=WnK{gX;=gsAB@yn{99Q)AA Z{{xT|_LL{n|0e(d002ovPDHLkV1kdZ8-)M> diff --git a/doc/html/_static/alert_warning_32.png b/doc/html/_static/alert_warning_32.png index a687c3dca8d5241b584f69e28b230d9ec78a5a03..f13611cde4d261522e7bedfbeed1a5c0e0127dbf 100644 GIT binary patch delta 1039 zcmV+q1n~Q?2c!s)B!BBkL_t(og|(JVOk7nI$A9k)Zz#hMC}kifV0BfS5O!?r!p789 zW8=n6H*IKQ;?6{uZrmt!p_nv^M$qHLfkG1~EmT?tD>;BK@~tbAP!}9 zqi+3b0B!}GV)n`|`N1y!_J+~i2!K-d$^)RC%D^puq<>Lcpo-ax5yE3Y!?2z@z@7I#y2_2k7~0MkPk=b3qX|$k zp<%#w%73m4AmB6i>BQuk{n}BcZI)8`4aQp>`<|7>aWUJbmwE@V&X%L09 zMo__4bS8zflOVehV{YaSDwX1J`xd4N`=1{mbaK9C0RQ)Za-fjLNX2OqjkF)c?CQqc z*TP_1m_j^?y5CGF1g8H=bpmKl_fvU{&3T$MnC%A%bRB?n2Ay2RFx%==uL__%jmLBR z%zxcmm_T}Mo`4nk|4ldqYy*cLvtk^W2Nr>Rb%1j7QI*?ID%0hsm;o5&r4E$F1Z{9N*B!Ck7EWpnOL+r{{G!K@P9c_*ds&~_|XqQ19QOW_;hk*WGvp_((H8h zMS^sMi{;MkXs#|PPJFoGil_G|o(3)fIX{3$L1r>5BV&pFmS)}A7YQD% JPDHLkV1i`@_ecN$ delta 922 zcmV;L17-ZA2(Sl`B!72FL_t(|0kxL{up>zThQFRXV|})5+qP}He70@dwzanH&3bde zbDZh!>#dnepYLJjulgz}&HuFqbRw0&dBA)i4txk)0c-&{gce&o?|}#I*NYa-*R3rv zJ#oTN{mz@u=!-5qMFYP9AM`{>@b59j4{Ut;>8G>adTWDrfqxR{ydh`E(AE+o8lB6` z8M7HQbTY5LIXDii9+ZIA=`WySeTb}KXaHUG1u`D09dtV?n<6)9APonCS)ldg`Gm)P=h1|GziRc8~iSyqA+Mqy5a9bcf3gYiV^f_2Qkhbq$ zCOhmVD9r#t7=HrFM}k_3Ybb$ihn6wO*v9|}2una?ihW8RvS@HY8vuldAk-OfK^bHT zgD>M^1BmLt1?<#ID`0*t<>_C=Ku7}G^(aded;tYuS0NMurTkL6{^iZ66}COJP3YP} zRrGOvBsO7fLVNV=)O(}%u?RZfQXQqh1vb0mi4nJMd(6k2f6EvK zk57=xc{5-oyi8dPr#>D9xG+e8bNAY1?YqZ*bvAcjyA$&kWI5!z!F)V0MXJ>ka3y>+ z7ViBZ$$#iMGyx(=fmc6&^K^FJb2HZ3Vk6Eye-A!=T4pSyZ*|KgGw&1tK!tuvP)wF#rSe$bAL5;b>P@51t_3O2Kx{aiK$d5aEwS~ zKz~SQQSFNmP9qS8fV2-D?D4~Cor?pcmrf;8xyoPfgckxSU^D)nI4~8M1r+{Qz&?Du zaw`GYS23URrTTmPV^#wW0rmrC15+ISJ@X%YeGZFP6eqHb4del18FPJ4UtJ>=5WH3bhTUp9|Fs}`4F`t wKqIz%B(N0N6Ih3T&riUVpuV2_(8K%=vJ;o_vrmzF{{R3007*qoM6N<$f{Es;{Qv*} diff --git a/doc/html/_static/basic.css b/doc/html/_static/basic.css index ff8b534fd..967e36ce0 100644 --- a/doc/html/_static/basic.css +++ b/doc/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -15,12 +15,6 @@ div.clearer { clear: both; } -div.section::after { - display: block; - content: ''; - clear: left; -} - /* -- relbar ---------------------------------------------------------------- */ div.related { @@ -58,8 +52,6 @@ div.sphinxsidebar { width: 230px; margin-left: -100%; font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; } div.sphinxsidebar ul { @@ -87,26 +79,14 @@ div.sphinxsidebar input { font-size: 1em; } -div.sphinxsidebar #searchbox form.search { - overflow: hidden; -} - div.sphinxsidebar #searchbox input[type="text"] { - float: left; - width: 80%; - padding: 0.25em; - box-sizing: border-box; + width: 170px; } div.sphinxsidebar #searchbox input[type="submit"] { - float: left; - width: 20%; - border-left: none; - padding: 0.25em; - box-sizing: border-box; + width: 30px; } - img { border: 0; max-width: 100%; @@ -144,8 +124,6 @@ ul.keywordmatches li.goodmatch a { table.contentstable { width: 90%; - margin-left: auto; - margin-right: auto; } table.contentstable p.biglink { @@ -173,14 +151,9 @@ table.indextable td { vertical-align: top; } -table.indextable ul { +table.indextable dl, table.indextable dd { margin-top: 0; margin-bottom: 0; - list-style-type: none; -} - -table.indextable > tbody > tr > td > ul { - padding-left: 0em; } table.indextable tr.pcap { @@ -212,51 +185,19 @@ div.genindex-jumpbox { padding: 0.4em; } -/* -- domain module index --------------------------------------------------- */ - -table.modindextable td { - padding: 2px; - border-collapse: collapse; -} - /* -- general body styles --------------------------------------------------- */ -div.body { - min-width: 59em; - max-width: 70em; -} - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - a.headerlink { visibility: hidden; } -a.brackets:before, -span.brackets > a:before{ - content: "["; -} - -a.brackets:after, -span.brackets > a:after { - content: "]"; -} - h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, h4:hover > a.headerlink, h5:hover > a.headerlink, h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { +dt:hover > a.headerlink { visibility: visible; } @@ -268,6 +209,10 @@ div.body td { text-align: left; } +.field-list ul { + padding-left: 1em; +} + .first { margin-top: 0 !important; } @@ -295,12 +240,6 @@ img.align-center, .figure.align-center, object.align-center { margin-right: auto; } -img.align-default, .figure.align-default { - display: block; - margin-left: auto; - margin-right: auto; -} - .align-left { text-align: left; } @@ -309,10 +248,6 @@ img.align-default, .figure.align-default { text-align: center; } -.align-default { - text-align: center; -} - .align-right { text-align: right; } @@ -322,27 +257,21 @@ img.align-default, .figure.align-default { div.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; - padding: 7px; + padding: 7px 7px 0 7px; background-color: #ffe; width: 40%; float: right; - clear: right; - overflow-x: auto; } p.sidebar-title { font-weight: bold; } -div.admonition, div.topic, blockquote { - clear: left; -} - /* -- topics ---------------------------------------------------------------- */ div.topic { border: 1px solid #ccc; - padding: 7px; + padding: 7px 7px 0 7px; margin: 10px 0 10px 0; } @@ -364,6 +293,10 @@ div.admonition dt { font-weight: bold; } +div.admonition dl { + margin-bottom: 0; +} + p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; @@ -374,49 +307,13 @@ div.body p.centered { margin-top: 25px; } -/* -- content of sidebars/topics/admonitions -------------------------------- */ - -div.sidebar > :last-child, -div.topic > :last-child, -div.admonition > :last-child { - margin-bottom: 0; -} - -div.sidebar::after, -div.topic::after, -div.admonition::after, -blockquote::after { - display: block; - content: ''; - clear: both; -} - /* -- tables ---------------------------------------------------------------- */ table.docutils { - margin-top: 10px; - margin-bottom: 10px; border: 0; border-collapse: collapse; } -table.align-center { - margin-left: auto; - margin-right: auto; -} - -table.align-default { - margin-left: auto; - margin-right: auto; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - table.docutils td, table.docutils th { padding: 1px 8px 1px 5px; border-top: 0; @@ -425,6 +322,10 @@ table.docutils td, table.docutils th { border-bottom: 1px solid #aaa; } +table.field-list td, table.field-list th { + border: 0 !important; +} + table.footnote td, table.footnote th { border: 0 !important; } @@ -443,67 +344,6 @@ table.citation td { border-bottom: none; } -th > :first-child, -td > :first-child { - margin-top: 0px; -} - -th > :last-child, -td > :last-child { - margin-bottom: 0px; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - -/* -- field list styles ----------------------------------------------------- */ - -table.field-list td, table.field-list th { - border: 0 !important; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.field-name { - -moz-hyphens: manual; - -ms-hyphens: manual; - -webkit-hyphens: manual; - hyphens: manual; -} - -/* -- hlist styles ---------------------------------------------------------- */ - -table.hlist { - margin: 1em 0; -} - -table.hlist td { - vertical-align: top; -} - - /* -- other body styles ----------------------------------------------------- */ ol.arabic { @@ -526,78 +366,11 @@ ol.upperroman { list-style: upper-roman; } -:not(li) > ol > li:first-child > :first-child, -:not(li) > ul > li:first-child > :first-child { - margin-top: 0px; -} - -:not(li) > ol > li:last-child > :last-child, -:not(li) > ul > li:last-child > :last-child { - margin-bottom: 0px; -} - -ol.simple ol p, -ol.simple ul p, -ul.simple ol p, -ul.simple ul p { - margin-top: 0; -} - -ol.simple > li:not(:first-child) > p, -ul.simple > li:not(:first-child) > p { - margin-top: 0; -} - -ol.simple p, -ul.simple p { - margin-bottom: 0; -} - -dl.footnote > dt, -dl.citation > dt { - float: left; - margin-right: 0.5em; -} - -dl.footnote > dd, -dl.citation > dd { - margin-bottom: 0em; -} - -dl.footnote > dd:after, -dl.citation > dd:after { - content: ""; - clear: both; -} - -dl.field-list { - display: grid; - grid-template-columns: fit-content(30%) auto; -} - -dl.field-list > dt { - font-weight: bold; - word-break: break-word; - padding-left: 0.5em; - padding-right: 5px; -} - -dl.field-list > dt:after { - content: ":"; -} - -dl.field-list > dd { - padding-left: 0.5em; - margin-top: 0em; - margin-left: 0em; - margin-bottom: 0em; -} - dl { margin-bottom: 15px; } -dd > :first-child { +dd p { margin-top: 0px; } @@ -611,30 +384,26 @@ dd { margin-left: 30px; } -dl > dd:last-child, -dl > dd:last-child > :last-child { - margin-bottom: 0; -} - -dt:target, span.highlighted { +dt:target, .highlighted { background-color: #fbe54e; } -rect.highlighted { - fill: #fbe54e; -} - dl.glossary dt { font-weight: bold; font-size: 1.1em; } -.optional { - font-size: 1.3em; +.field-list ul { + margin: 0; + padding-left: 1em; } -.sig-paren { - font-size: larger; +.field-list p { + margin: 0; +} + +.optional { + font-size: 1.3em; } .versionmodified { @@ -675,12 +444,6 @@ dl.glossary dt { font-style: oblique; } -.classifier:before { - font-style: normal; - margin: 0.5em; - content: ":"; -} - abbr, acronym { border-bottom: dotted 1px; cursor: help; @@ -693,110 +456,37 @@ pre { overflow-y: hidden; /* fixes display issues on Chrome browsers */ } -pre, div[class*="highlight-"] { - clear: both; -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; -} - -div[class*="highlight-"] { - margin: 1em 0; -} - td.linenos pre { + padding: 5px 0px; border: 0; background-color: transparent; color: #aaa; } table.highlighttable { - display: block; -} - -table.highlighttable tbody { - display: block; -} - -table.highlighttable tr { - display: flex; + margin-left: 0.5em; } table.highlighttable td { - margin: 0; - padding: 0; + padding: 0 0.5em 0 0.5em; } -table.highlighttable td.linenos { - padding-right: 0.5em; -} - -table.highlighttable td.code { - flex: 1; - overflow: hidden; -} - -.highlight .hll { - display: block; -} - -div.highlight pre, -table.highlighttable pre { - margin: 0; -} - -div.code-block-caption + div { - margin-top: 0; -} - -div.code-block-caption { - margin-top: 1em; - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -table.highlighttable td.linenos, -span.linenos, -div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - margin: 1em 0; -} - -code.descname { +tt.descname { background-color: transparent; font-weight: bold; font-size: 1.2em; } -code.descclassname { +tt.descclassname { background-color: transparent; } -code.xref, a code { +tt.xref, a tt { background-color: transparent; font-weight: bold; } -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { background-color: transparent; } @@ -828,15 +518,6 @@ span.eqno { float: right; } -span.eqno a.headerlink { - position: absolute; - z-index: 1; -} - -div.math:hover a.headerlink { - visibility: visible; -} - /* -- printout stylesheet --------------------------------------------------- */ @media print { diff --git a/doc/html/_static/bg-page.png b/doc/html/_static/bg-page.png index fe0a6dc896e0e3a5b7a5cdf37d07bcbc5c9a00cf..c6f3bc477c157a0b57bb96e77af53e84f60474cf 100644 GIT binary patch delta 146 zcmWGq!Z<;)o{52h!Kcl32+VA$Bt{U?zX$mcBZh%9Dc;1&j9Muu5)B!GhK zC7!;n>^C{Y1-OI+wSNi$g^WF2978;gzrC=LmqCGtWn;sQ`m5n)2`np=mh>>Rct$tB{~d4T#EJYD@<);T3K0Ra7HD&7D9 delta 63 zcmZ3&7&JlBk^u-FRQr_!DM?Qk$B+ufgKEEmrSJg4#epawewOK?KyydX0* OkYZ0)KbLh*2~7Z0cM})@ diff --git a/doc/html/_static/bullet_orange.png b/doc/html/_static/bullet_orange.png index 1cb8097ce9b7592811e6ca10397ffe913e62503a..ad5d02f341dfcd8fec482e500170bb711257f0b9 100644 GIT binary patch literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^Y#_|R3?#1$$yWiXgaDrq*9Uc4|IbYRzdQHA%KGnb zp8lU>{{P{#za{Vg>DGTApT26<`oGZT|IxPp5BL1v zU-JLUi^r?#|Ns9FG!HA7@@RewP=YbZ+ucQ;l~-Udki%Kv5m^kRJ;2!QWVRhhu&lr_ z9Y}+n$uRZe&q+XzzNd?02*-8SgPcqZ0vs#{O4}y1{I|c#qqlle!_6Z7fZ4}QmsI^> zTd~_#Zi!CI4@OlM##wA?*5`m)RZCnWN>UO_QmvAUQh^kMk%6Isu7RPhfq96bk(G(1 rm4TVIfuWUwfz`yy6DS&T^HVa@DsgM@K69`HsDZ)L)z4*}Q$iB}`ILMr delta 148 zcmV;F0Bis40;K_v8Gix*003{Ucpm@&0BlJ_K~#7FWBC8&#s8z-{}{#zO$YIC<)@9ZvDT%n>@{?9T0e`7U>zdQH;(Y6P5S`0w_ zK=nX*ApifCyvM8R8Gz;i^}lM>0?I#FS^xdbQvfudPv9AIg$--~0000= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span = document.createElement("span"); + span.className = className; span.appendChild(document.createTextNode(val.substr(pos, text.length))); node.parentNode.insertBefore(span, node.parentNode.insertBefore( document.createTextNode(val.substr(pos + text.length)), node.nextSibling)); node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } } } else if (!jQuery(node).is("button, select, textarea")) { jQuery.each(node.childNodes, function() { - highlight(this, addItems); + highlight(this); }); } } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); + return this.each(function() { + highlight(this); }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; }; -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - /** * Small JavaScript module for the documentation. */ @@ -149,30 +100,27 @@ var Documentation = { this.fixFirefoxAnchorBug(); this.highlightSearchWords(); this.initIndexTable(); - if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { - this.initOnKeyListeners(); - } }, /** * i18n support */ TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, LOCALE : 'unknown', // gettext and ngettext don't access this so that the functions // can safely bound to a different name (_ = Documentation.gettext) gettext : function(string) { var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated === 'undefined') + if (typeof translated == 'undefined') return string; - return (typeof translated === 'string') ? translated : translated[0]; + return (typeof translated == 'string') ? translated : translated[0]; }, ngettext : function(singular, plural, n) { var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated === 'undefined') + if (typeof translated == 'undefined') return (n == 1) ? singular : plural; return translated[Documentation.PLURALEXPR(n)]; }, @@ -204,7 +152,6 @@ var Documentation = { /** * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 */ fixFirefoxAnchorBug : function() { if (document.location.hash && $.browser.mozilla) @@ -243,7 +190,7 @@ var Documentation = { var src = $(this).attr('src'); var idnum = $(this).attr('id').substr(7); $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) === 'minus.png') + if (src.substr(-9) == 'minus.png') $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); else $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); @@ -275,36 +222,11 @@ var Documentation = { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this === '..') + if (this == '..') parts.pop(); }); var url = parts.join('/'); return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keydown(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box, textarea, dropdown or button - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' - && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey - && !event.shiftKey) { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); } }; diff --git a/doc/html/_static/file.png b/doc/html/_static/file.png index a858a410e4faa62ce324d814e4b816fff83a6fb3..d18082e397e7e54f20721af768c4c2983258f1b4 100644 GIT binary patch delta 365 zcmV-z0h0cn0*C{UB!32COGiWi{{a60|De66lK=n!32;bRa{vGf6951U69E94oEQKA z00(qQO+^RQ3l0qj0V%dr8~^|T6-h)vR5;76k+Dj|KoEw%NpdJB7zkSnA|@Po*x6ZH z34&PoFoGdze1-#GK(W;K5CoNUrxDXc#O4IgT?@G*xx{!8|9@(BnEB_M9T^M;7g?4a z&`yV87@h+VMUiQ%D2mL)$(aOso};w}Kt!gaCb5WM+cvK2mQbb!T5FOdDK!)&BJ_H_ z$}Udv5d=XaL7kjpVUb`~a}oHyUo-I?V-~P1tC;}cw0$7nfnFKc7MR@WeNaVDy;r#|UFy>2CCEKe)0& zXMMX=(3!bJBf-($3L;XuL^1cHf#-SrMUGPHDvsmbHcd*YGyY3oRjYJ=I7WWQ00000 LNkvXXu0mjfYdD&R delta 258 zcmV+d0sa1n1D*nqB!A^eL_t(|0j-mRQU(DOh4(3Yg>2U#+qMST9A?`+K(6HroI1a` zzBAwYe&?=){{H^C^73+6Bth^O4_GbsLfARhO4f6Bz6M)BwD2h-NCBA@-2L}f@ zJUj$BIywsD`1sgR5S8jrCXyuS3)mQ)Y<_}R_w3`1`{pLd8GF6fMOVNSUNp6L0a1Oz z&cgu)wqE?07u5I7qrQIu4Fij)Y3c&0@0u_#NH6I?Mk(n;dT}d~^JfiX^GbOlHe=Ae4>0m)d(f|Me07*qo IM6N<$g13lzp8x;= diff --git a/doc/html/_static/haiku.css b/doc/html/_static/haiku.css index 2ffc219f3..25f6e5905 100644 --- a/doc/html/_static/haiku.css +++ b/doc/html/_static/haiku.css @@ -16,7 +16,7 @@ * Braden Ewing * Humdinger * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -307,7 +307,7 @@ td { vertical-align: top; } -code { +tt { background-color: #e2e2e2; font-size: 1.0em; font-family: monospace; @@ -319,6 +319,7 @@ pre { border-width: thin; margin: 0 0 12px 0; padding: 0.8em; + background-color: #f0f0f0; } hr { @@ -367,9 +368,4 @@ div.viewcode-block:target { border-bottom: 1px solid #ac9; margin: -1px -10px; padding: 0 12px; -} - -/* math display */ -div.math p { - text-align: center; } \ No newline at end of file diff --git a/doc/html/_static/jquery.js b/doc/html/_static/jquery.js index b0614034a..83589daa7 100644 --- a/doc/html/_static/jquery.js +++ b/doc/html/_static/jquery.js @@ -1,2 +1,2 @@ -/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="

",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
t
",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
","
"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/doc/html/_static/minus.png b/doc/html/_static/minus.png index d96755fdaf8bb2214971e0db9c1fd3077d7c419d..da1c5620d10c047525a467a425abe9ff5269cfc2 100644 GIT binary patch delta 181 zcmaz#&NxA`o{52hLG9dwLLkLi;1OBOz`!jG!i)^F=12eq*-JcqUD>a*a|m!V+N`s9 z3KZffag8W(&d<$F%`0K}c4pdspjeQni(`nyV(FCY15|7D01(Yb6sIkr~k*|j;xQ5&xyQ6)2uJlbR0`fOi0*K d{$5VbnBju0eCX!rK0ToE44$rjF6*2UngDj|KxY5| delta 71 zcmX@k7&SrCkpT#Lj%)k^Qi`4~jv*C{$rjBFJn4202dy=J%PMYDV-Z;WPgbPi1_uK} W?3*;BJn27vAWfdGelF{r5}E+#a}|03 diff --git a/doc/html/_static/nature.css b/doc/html/_static/nature.css index c4768af7f..6bc03af19 100644 --- a/doc/html/_static/nature.css +++ b/doc/html/_static/nature.css @@ -4,19 +4,19 @@ * * Sphinx stylesheet -- nature theme. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ - + @import url("basic.css"); - + /* -- page layout ----------------------------------------------------------- */ - + body { font-family: Arial, sans-serif; font-size: 100%; - background-color: #fff; + background-color: #111; color: #555; margin: 0; padding: 0; @@ -34,18 +34,18 @@ div.bodywrapper { hr { border: 1px solid #B1B4B6; } - + div.document { background-color: #eee; } - + div.body { background-color: #ffffff; color: #3E4349; padding: 0 30px 30px 30px; font-size: 0.9em; } - + div.footer { color: #555; width: 100%; @@ -53,12 +53,12 @@ div.footer { text-align: center; font-size: 75%; } - + div.footer a { color: #444; text-decoration: underline; } - + div.related { background-color: #6BA81E; line-height: 32px; @@ -66,11 +66,11 @@ div.related { text-shadow: 0px 1px 0 #444; font-size: 0.9em; } - + div.related a { color: #E2F3CC; } - + div.sphinxsidebar { font-size: 0.75em; line-height: 1.5em; @@ -79,7 +79,7 @@ div.sphinxsidebar { div.sphinxsidebarwrapper{ padding: 20px 0; } - + div.sphinxsidebar h3, div.sphinxsidebar h4 { font-family: Arial, sans-serif; @@ -95,53 +95,52 @@ div.sphinxsidebar h4 { div.sphinxsidebar h4{ font-size: 1.1em; } - + div.sphinxsidebar h3 a { color: #444; } - - + + div.sphinxsidebar p { color: #888; padding: 5px 20px; } - + div.sphinxsidebar p.topless { } - + div.sphinxsidebar ul { margin: 10px 20px; padding: 0; color: #000; } - + div.sphinxsidebar a { color: #444; } - + div.sphinxsidebar input { border: 1px solid #ccc; font-family: sans-serif; font-size: 1em; } -div.sphinxsidebar .searchformwrapper { +div.sphinxsidebar input[type=text]{ margin-left: 20px; - margin-right: 20px; } - + /* -- body styles ----------------------------------------------------------- */ - + a { color: #005B81; text-decoration: none; } - + a:hover { color: #E32E00; text-decoration: underline; } - + div.body h1, div.body h2, div.body h3, @@ -156,63 +155,69 @@ div.body h6 { padding: 5px 0 5px 10px; text-shadow: 0px 1px 0 white } - + div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; } div.body h2 { font-size: 150%; background-color: #C8D5E3; } div.body h3 { font-size: 120%; background-color: #D8DEE3; } div.body h4 { font-size: 110%; background-color: #D8DEE3; } div.body h5 { font-size: 100%; background-color: #D8DEE3; } div.body h6 { font-size: 100%; background-color: #D8DEE3; } - + a.headerlink { color: #c60f0f; font-size: 0.8em; padding: 0 4px 0 4px; text-decoration: none; } - + a.headerlink:hover { background-color: #c60f0f; color: white; } - + div.body p, div.body dd, div.body li { line-height: 1.5em; } - + div.admonition p.admonition-title + p { display: inline; } +div.highlight{ + background-color: white; +} + div.note { background-color: #eee; border: 1px solid #ccc; } - + div.seealso { background-color: #ffc; border: 1px solid #ff6; } - + div.topic { background-color: #eee; } - + div.warning { background-color: #ffe4e4; border: 1px solid #f66; } - + p.admonition-title { display: inline; } - + p.admonition-title:after { content: ":"; } - + pre { padding: 10px; + background-color: White; + color: #222; line-height: 1.2em; border: 1px solid #C6C9CB; font-size: 1.1em; @@ -220,8 +225,8 @@ pre { -webkit-box-shadow: 1px 1px 1px #d8d8d8; -moz-box-shadow: 1px 1px 1px #d8d8d8; } - -code { + +tt { background-color: #ecf0f3; color: #222; /* padding: 1px 2px; */ @@ -237,10 +242,4 @@ div.viewcode-block:target { background-color: #f4debf; border-top: 1px solid #ac9; border-bottom: 1px solid #ac9; -} - -div.code-block-caption { - background-color: #ddd; - color: #222; - border: 1px solid #C6C9CB; } \ No newline at end of file diff --git a/doc/html/_static/plus.png b/doc/html/_static/plus.png index 7107cec93a979b9a5f64843235a16651d563ce2d..b3cb37425ea68b39ffa7b2e5fb69161275a87541 100644 GIT binary patch delta 181 zcmaz#&NxA`o{52hLG9dwLLkLi;1OBOz`!jG!i)^F=12eq*-JcqUD>a*a|m!5GUr%w z0EIY8Tq8=H^K)}k^GX=Lotd^DC>G@D;us=vIoYQ884q*ZfkOulELgOtDfHd_{q^79 z-A#59-nwOri*RC+0t?6Lgo7qB=j^J!XgD4HsQ>u*!%GF<_SgSk@q(`-vtakcodKdi d9fygTe~DWM4fyQ>r5 diff --git a/doc/html/_static/pygments.css b/doc/html/_static/pygments.css index de7af262f..20c4814dc 100644 --- a/doc/html/_static/pygments.css +++ b/doc/html/_static/pygments.css @@ -1,10 +1,5 @@ -pre { line-height: 125%; } -td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } -span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } -td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } -span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } -.highlight { background: #eeffcc; } +.highlight { background: #eeffcc; } .highlight .c { color: #408090; font-style: italic } /* Comment */ .highlight .err { border: 1px solid #FF0000 } /* Error */ .highlight .k { color: #007020; font-weight: bold } /* Keyword */ diff --git a/doc/html/_static/searchtools.js b/doc/html/_static/searchtools.js index 6fc9e7f33..6e1f06bd1 100644 --- a/doc/html/_static/searchtools.js +++ b/doc/html/_static/searchtools.js @@ -1,54 +1,230 @@ /* - * searchtools.js + * searchtools.js_t * ~~~~~~~~~~~~~~~~ * - * Sphinx JavaScript utilities for the full-text search. + * Sphinx JavaScript utilties for the full-text search. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ -if (!Scorer) { - /** - * Simple result scoring code. - */ - var Scorer = { - // Implement the following function to further tweak the score for each result - // The function takes a result array [filename, title, anchor, descr, score] - // and returns the new score. - /* - score: function(result) { - return result[4]; - }, - */ - // query matches the full name of an object - objNameMatch: 11, - // or matches in the last dotted part of the object name - objPartialMatch: 6, - // Additive scores depending on the priority of the object - objPrio: {0: 15, // used to be importantResults - 1: 5, // used to be objectResults - 2: -5}, // used to be unimportantResults - // Used when the priority is not in the mapping. - objPrioDefault: 0, +/** + * Porter Stemmer + */ +var Stemmer = function() { - // query found in title - title: 15, - partialTitle: 7, - // query found in terms - term: 5, - partialTerm: 2 + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' }; -} -if (!splitQuery) { - function splitQuery(query) { - return query.split(/\s+/); + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; } } + + +/** + * Simple result scoring code. + */ +var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [filename, title, anchor, descr, score] + // and returns the new score. + /* + score: function(result) { + return result[4]; + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: {0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5}, // used to be unimportantResults + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + // query found in terms + term: 5 +}; + + /** * Search Module */ @@ -58,19 +234,6 @@ var Search = { _queued_query : null, _pulse_status : -1, - htmlToText : function(htmlString) { - var virtualDocument = document.implementation.createHTMLDocument('virtual'); - var htmlElement = $(htmlString, virtualDocument); - htmlElement.find('.headerlink').remove(); - docContent = htmlElement.find('[role=main]')[0]; - if(docContent === undefined) { - console.warn("Content block not found. Sphinx search tries to obtain it " + - "via '[role=main]'. Could you check your theme or template."); - return ""; - } - return docContent.textContent || docContent.innerText; - }, - init : function() { var params = $.getQueryParameters(); if (params.q) { @@ -135,7 +298,7 @@ var Search = { this.out = $('#search-results'); this.title = $('

' + _('Searching') + '

').appendTo(this.out); this.dots = $('').appendTo(this.title); - this.status = $('

 

').appendTo(this.out); + this.status = $('

').appendTo(this.out); this.output = $('
- +
+ +
1D-London-Meissner +
+ +

A

- - + +
+ +
acknowledgment +
+ + +
addrun +
+ + +
addRunApp +
+ + +
addt0-asymmetry +
+ + +
addt0-single-histo +
+ +
+ +
alpha-beta +
+ + +
any2many, [1] +
+ + +
asymmetry-fit +
+ + +
asymmetry-rrf-fit +
+ +

B

- - + +
+ +
backgr.fit +
+ + +
backgr.fix +
+ + +
background-asymmetry +
+ + +
background-single-histo +
+ + +
BMW-libs +
+ +
+ +
BMWlibs-XML +
+ + +
bnmr-asymmetry-fit +
+ + +
BNMR-libs +
+ + +
boost-c++ +
+ + +
bugtracking +
+ +

C

- - + +
+ +
cite +
+ +
+ +
cuda-install +
+ +

D

- - + +
+ +
data-asymmetry +
+ + +
data-single-histo +
+ + +
dks +
+ + +
dks-command-overview +
+ + +
dks-install +
+ +
+ +
dks-opencl-macOS +
+ + +
dks-setup-amd-graphic-card +
+ + +
dks-setup-tesla +
+ + +
dump_header +
+ +

E

- +
+ +
ExpRlx +
+ +

F

- - + +
+ +
fftw +
+ + +
fink +
+ + +
fit +
+ + +
fit-types +
+ + +
fittype +
+ + +
forward +
+ + +
forward-backward +
+ + +
fourier-block-apodization +
+ +
+ +
fourier-block-dc-corrected +
+ + +
fourier-block-fourier_power +
+ + +
fourier-block-phase +
+ + +
fourier-block-plot +
+ + +
fourier-block-range +
+ + +
fourier-block-range_for_phase_correction +
+ + +
fourier-block-units +
+ +

G

- - + +
+ +
gnu-gsl +
+ + +
gnu-linux +
+ +
+ +
gnu-linux-requirements +
+ +

H

- - + +
+ +
hdf4 +
+ +
+ +
hdf5 +
+ +

I

- - + +
+ +
Ianiso +
+ +
+ +
Iax +
+ +

L

- - + +
+ +
libBNMR +
+ + +
libFitPofB +
+ + +
libLineProfile +
+ + +
libxml2 +
+ + +
lifetime +
+ +
+ +
LineGauss +
+ + +
LineLaplace +
+ + +
LineLorentzian +
+ + +
LineSkewLorentzian +
+ + +
LineSkewLorentzian2 +
+ +

M

- - + +
+ +
macports +
+ + +
map +
+ + +
meta-information +
+ + +
minixml +
+ + +
minuit2-command-overview +
+ + +
msr-commands-block +
+ + +
msr-commands-block-dks +
+ + +
msr-file-format +
+ + +
msr-fitparameter-block +
+ + +
msr-fourier-block +
+ + +
msr-functions-block +
+ + +
msr-global-block +
+ + +
msr-plot-block +
+ + +
msr-plot-block-lifetimecorrection +
+ + +
msr-plot-block-logx +
+ + +
msr-plot-block-logy +
+ + +
msr-plot-block-range +
+ + +
msr-plot-block-rrf_freq +
+ + +
msr-plot-block-rrf_packing +
+ + +
msr-plot-block-rrf_phase +
+ + +
msr-plot-block-runs +
+ + +
msr-plot-block-sub_ranges +
+ + +
msr-plot-block-use_fit_ranges +
+ + +
msr-plot-block-view_packing +
+ + +
msr-run-block +
+ + +
msr-statistc-block +
+ + +
msr-theory-block +
+ + +
msr-title-block +
+ + +
msr2-data-global-mode +
+ + +
msr2data +
+ + +
msr2data-global-extended +
+ + +
msr2data-global-param-extraction +
+ + +
msr2msr +
+ + +
mupp +
+ +
+ +
mupp-gui +
+ + +
mupp-scripting +
+ + +
mupp-usage +
+ + +
musredit +
+ + +
musredit-build-macos +
+ + +
musredit-features +
+ + +
musredit-install-linux +
+ + +
musredit_startup +
+ + +
musrfit +
+ + +
musrfit-build-cmake-linux +
+ + +
musrfit-build-cmake-macos +
+ + +
musrfit-build-linux +
+ + +
musrfit-build-macos +
+ + +
musrfit-command-block-details +
+ + +
musrfit-post-install-linux +
+ + +
musrfit-startup +
+ + +
musrFT +
+ + +
musrFT-key-shortcuts +
+ + +
MusrRoot +
+ + +
MusrRoot-Overview +
+ + +
MusrRoot-TMusrRunPhysicalQuantity +
+ + +
MusrRoot-Validation +
+ + +
musrStep +
+ + +
musrt0 +
+ + +
musrview +
+ + +
musrview-key-shortcuts +
+ + +
musrWiz +
+ + +
musrWiz-Create +
+ + +
musrWiz-FitInfo +
+ + +
musrWiz-FitParam +
+ + +
musrWiz-Functions +
+ + +
musrWiz-Introduction +
+ + +
musrWiz-Maps +
+ + +
musrWiz-Theory +
+ +

N

- - + +
+ +
negative-muon-musr-fit +
+ + +
nexus +
+ + +
nexus-build-fink +
+ + +
nexus-build-linux +
+ +
+ +
nexus-build-macports +
+ + +
non-musr-fit +
+ + +
norm +
+ +

O

- +
+ +
os-restrictions +
+ +

P

- - + +
+ +
packing +
+ + +
PowderLineAsymGss +
+ + +
PowderLineAsymLor +
+ +
+ +
PowderLineAxialGss +
+ + +
PowderLineAxialLor +
+ +

Q

- +
    -
  • qt -
  • -
+ +
qt +
+ +

R

- - + +
+ +
rge-handler +
+ + +
root-build-fink +
+ + +
root-build-linux +
+ +
+ +
root-build-macports +
+ + +
root-cern +
+ +

S

- - + +
+ +
setup +
+ + +
SExpRlx +
+ + +
single-histogram-fit +
+ +
+ +
single-histogram-rrf-fit +
+ + +
SLR +
+ + +
supported-operating-systems +
+ +

T

- - + +
+ +
t0-asymmetry +
+ + +
t0-single-histo +
+ + +
technical-musrfit +
+ + +
TLondon1D1L +
+ +
+ +
TLondon1D2L +
+ + +
TLondon1D3L +
+ + +
TLondon1DHS +
+ + +
tutorial +
+ +

U

- - + +
+ +
user-functions +
+ + +
user-functions-with-global-part +
+ + +
user-functions-without-global-part +
+ +
+ +
user-libs +
+ + +
user-manual +
+ +

V

- - + +
+ +
Vortex-Analytic-GL +
+ + +
Vortex-Gaussian-CutOff +
+ + +
Vortex-London-modified +
+ +
+ +
Vortex-Numeric-GL +
+ + +
Vortex-State-Isotropic +
+ +

X

- +
+ +
xy-data +
+ +
-