musrfit
1.9.2
|
#include <PRunDataHandler.h>
Public Member Functions | |
PRunDataHandler () | |
PRunDataHandler (TString fileName, const TString fileFormat) | |
PRunDataHandler (TString fileName, const TString fileFormat, const PStringVector dataPath) | |
PRunDataHandler (TString fileName, const TString fileFormat, const TString dataPath, PRawRunData &runData) | |
PRunDataHandler (PAny2ManyInfo *any2ManyInfo) | |
PRunDataHandler (PAny2ManyInfo *any2ManyInfo, const PStringVector dataPath) | |
PRunDataHandler (PMsrHandler *msrInfo) | |
PRunDataHandler (PMsrHandler *msrInfo, const PStringVector dataPath) | |
virtual | ~PRunDataHandler () |
virtual void | ReadData () |
virtual void | ConvertData () |
virtual Bool_t | WriteData (TString fileName="") |
virtual Bool_t | IsAllDataAvailable () const |
virtual PRawRunData * | GetRunData (const TString &runName) |
virtual PRawRunData * | GetRunData (const UInt_t idx=0) |
virtual Int_t | GetNoOfRunData () |
virtual Bool_t | SetRunData (PRawRunData *data, UInt_t idx=0) |
Private Member Functions | |
virtual void | Init (const Int_t tag=0) |
virtual Bool_t | ReadFilesMsr () |
virtual Bool_t | ReadWriteFilesList () |
virtual Bool_t | FileAlreadyRead (TString runName) |
virtual void | TestFileName (TString &runName, const TString &ext) |
virtual Bool_t | FileExistsCheck (PMsrRunBlock &runInfo, const UInt_t idx) |
virtual Bool_t | FileExistsCheck (const Bool_t fileName, const Int_t idx) |
virtual Bool_t | FileExistsCheck (const TString fileName) |
virtual Bool_t | ReadRootFile () |
virtual Bool_t | ReadNexusFile () |
virtual Bool_t | ReadWkmFile () |
virtual Bool_t | ReadPsiBinFile () |
virtual Bool_t | ReadMudFile () |
virtual Bool_t | ReadMduAsciiFile () |
virtual Bool_t | ReadAsciiFile () |
virtual Bool_t | ReadDBFile () |
virtual Bool_t | ReadDatFile () |
virtual Bool_t | WriteMusrRootFile (TString fln="") |
virtual Bool_t | WriteRootFile (TString fln="") |
virtual Bool_t | WriteNexusFile (TString fln="") |
virtual Bool_t | WriteWkmFile (TString fln="") |
virtual Bool_t | WritePsiBinFile (TString fln="") |
virtual Bool_t | WriteMudFile (TString fln="") |
virtual Bool_t | WriteAsciiFile (TString fln="") |
virtual Bool_t | StripWhitespace (TString &str) |
virtual Bool_t | IsWhitespace (const Char_t *str) |
virtual Double_t | ToDouble (TString &str, Bool_t &ok) |
virtual Int_t | ToInt (TString &str, Bool_t &ok) |
virtual Int_t | GetDataTagIndex (TString &str, const PStringVector *fLabels) |
virtual TString | GenerateOutputFileName (const TString fileName, const TString extension, Bool_t &ok) |
virtual TString | GetFileName (const TString extension, Bool_t &ok) |
virtual TString | FileNameFromTemplate (TString &fileNameTemplate, Int_t run, TString &year, Bool_t &ok) |
virtual bool | DateToISO8601 (std::string inDate, std::string &iso8601Date) |
virtual void | SplitTimeDate (TString timeDate, TString &time, TString &date, Bool_t &ok) |
virtual TString | GetMonth (Int_t month) |
virtual TString | GetYear (Int_t month) |
Private Attributes | |
PMsrHandler * | fMsrInfo |
pointer to the msr-file handler More... | |
PAny2ManyInfo * | fAny2ManyInfo |
pointer to the any2many data structure More... | |
PStringVector | fDataPath |
vector containing all the search paths where to look for data files More... | |
Bool_t | fAllDataAvailable |
flag indicating if all data sets could be read More... | |
TString | fFileFormat |
keeps the file format if explicitly given More... | |
TString | fRunName |
current run name More... | |
TString | fRunPathName |
current path file name More... | |
PRawRunDataList | fData |
keeping all the raw data More... | |
Handler class needed to read/handle raw data files.
Definition at line 41 of file PRunDataHandler.h.
PRunDataHandler::PRunDataHandler | ( | ) |
PRunDataHandler::PRunDataHandler | ( | TString | fileName, |
const TString | fileFormat | ||
) |
Constructor which just reads a single muSR data file.
fileName | |
fileFormat |
Definition at line 107 of file PRunDataHandler.cpp.
References FileExistsCheck(), and Init().
PRunDataHandler::PRunDataHandler | ( | TString | fileName, |
const TString | fileFormat, | ||
const PStringVector | dataPath | ||
) |
Constructor which just reads a single muSR data file.
fileName | |
fileFormat | |
dataPath |
Definition at line 124 of file PRunDataHandler.cpp.
References FileExistsCheck(), and Init().
PRunDataHandler::PRunDataHandler | ( | TString | fileName, |
const TString | fileFormat, | ||
const TString | dataPath, | ||
PRawRunData & | runData | ||
) |
Constructor which just writes a single muSR data file.
fileName | |
fileFormat | |
dataPath | |
runData |
Definition at line 142 of file PRunDataHandler.cpp.
References Init().
PRunDataHandler::PRunDataHandler | ( | PAny2ManyInfo * | any2ManyInfo | ) |
Constructor, reading the data histogramm files.
msrInfo | pointer to the msr-file handler |
Definition at line 155 of file PRunDataHandler.cpp.
References Init(), and PHR_INIT_ANY2MANY.
PRunDataHandler::PRunDataHandler | ( | PAny2ManyInfo * | any2ManyInfo, |
const PStringVector | dataPath | ||
) |
Constructor, reading the data histogramm files.
any2ManyInfo | pointer to the PAny2ManyInfo structure needed to convert data |
dataPath | contains all data search paths. |
Definition at line 169 of file PRunDataHandler.cpp.
References Init(), and PHR_INIT_ANY2MANY.
PRunDataHandler::PRunDataHandler | ( | PMsrHandler * | msrInfo | ) |
Constructor, reading the data histogramm files.
msrInfo | pointer to the msr-file handler |
Definition at line 183 of file PRunDataHandler.cpp.
References Init(), and PHR_INIT_MSR.
PRunDataHandler::PRunDataHandler | ( | PMsrHandler * | msrInfo, |
const PStringVector | dataPath | ||
) |
Constructor, reading the data histogramm files, and keeping a copy of potential search paths.
msrInfo | pointer to the msr-file handler |
dataPath | vector containing search paths where to find raw data files. |
Definition at line 198 of file PRunDataHandler.cpp.
References Init(), and PHR_INIT_MSR.
|
virtual |
|
virtual |
Read data and convert it. This routine is used by any2many.
Definition at line 321 of file PRunDataHandler.cpp.
References fAllDataAvailable, and ReadWriteFilesList().
|
privatevirtual |
If possible converts a inDate, into a ISO8601 standard date.
return: true if conversion was successfull otherwise false.
inDate | input date which should be converted to an ISO 8601 date. |
iso8601Date | on success the converted iso8601Date, otherwise an empty string |
Definition at line 6394 of file PRunDataHandler.cpp.
Referenced by ReadPsiBinFile().
|
privatevirtual |
Checks if a file has been already read in order to prevent multiple reading of data files.
return:
runName | run name to be check if the corresponding file is already read. |
Definition at line 922 of file PRunDataHandler.cpp.
References fData.
Referenced by ReadFilesMsr().
|
privatevirtual |
Checks if a given data file exists.
return:
runInfo | reference to the msr-run-structure |
idx | index of the run (needed for ADDRUN feature). |
Definition at line 1049 of file PRunDataHandler.cpp.
References fDataPath, fMsrInfo, fRunPathName, PMsrRunBlock::GetBeamline(), PMsrRunBlock::GetFileFormat(), PMsrRunBlock::GetInstitute(), PMsrHandler::GetMsrFileDirectoryPath(), PMsrRunBlock::GetRunName(), PMsrRunBlock::SetBeamline(), PMsrRunBlock::SetFileFormat(), PMsrRunBlock::SetInstitute(), and TestFileName().
Referenced by PRunDataHandler(), ReadFilesMsr(), and ReadWriteFilesList().
|
privatevirtual |
Checks if a given data file exists. Used for the any2many program.
return:
fileName | flag showing if a file name shall be handled or a run number |
idx | index of the run. idx == -1 means that a single input data file name is given. |
Definition at line 1258 of file PRunDataHandler.cpp.
References fAny2ManyInfo, fDataPath, FileNameFromTemplate(), fRunPathName, PAny2ManyInfo::inFileName, PAny2ManyInfo::inTemplate, PAny2ManyInfo::outTemplate, PAny2ManyInfo::runList, and PAny2ManyInfo::year.
|
privatevirtual |
Checks if a given data file exists. Used for the any2many program.
return:
fileName | file name |
Definition at line 1354 of file PRunDataHandler.cpp.
References fDataPath, and fRunPathName.
|
privatevirtual |
Will, based on the fileNameTemplate construct a file name. The file name template has a run tag and a year tag. The run tag has the form [rrrr], whereas the number of 'r' defines the length of this string part. If the run number is shorter, leading zeros will be filled, e.g. [rrrrrr] and run==123 will lead to '000123'. The same is true for the year tag [yy], except that the length must agree. For example: fileNameTemplate = d[yyyy]/deltat_tdc_gps_[rrrr].bin, run = 123, year = 2009 will result in 'd2009/deltat_tdc_gps_0123.bin'.
return:
template | template string |
run | run number |
year | year |
ok | true if operation went smooth, otherwise false |
Definition at line 6305 of file PRunDataHandler.cpp.
Referenced by FileExistsCheck(), and ReadWriteFilesList().
|
privatevirtual |
Generates the output file name (any2many). It also makes sure that the generated output file name does not coincidentally is identical to an already existing file.
return:
fileName | |
extension | if the file name to be constructed |
ok | flag which is 'true' if the file name could be constructed, 'false' otherwise |
Definition at line 6198 of file PRunDataHandler.cpp.
References PAny2ManyInfo::compressionTag, fAny2ManyInfo, GetFileName(), PAny2ManyInfo::outPath, PAny2ManyInfo::outPathFileName, and PAny2ManyInfo::useStandardOutput.
Referenced by WriteAsciiFile(), WriteMudFile(), WriteMusrRootFile(), WriteNexusFile(), WritePsiBinFile(), WriteRootFile(), and WriteWkmFile().
|
privatevirtual |
Checks if str is in a list of data tags
return:
str | data tag string (see description of nonMusr db-data) |
dataTags | vector of all data tags |
Definition at line 6166 of file PRunDataHandler.cpp.
Referenced by ReadDBFile().
|
privatevirtual |
Construct the file name based on the any2many request.
return:
extension | if the file name to be constructed |
ok | flag which is 'true' if the file name could be constructed, 'false' otherwise |
Definition at line 6254 of file PRunDataHandler.cpp.
References fAny2ManyInfo, fRunPathName, PAny2ManyInfo::inFormat, PAny2ManyInfo::outFormat, PAny2ManyInfo::outPath, and PAny2ManyInfo::rebin.
Referenced by GenerateOutputFileName().
|
privatevirtual |
given the month as number, convert it to a 3 character month. If month is out of range (i.e. not between 1 and 12) a '???' will be returned.
month | as number |
Definition at line 6451 of file PRunDataHandler.cpp.
Referenced by WritePsiBinFile().
|
inlinevirtual |
Definition at line 61 of file PRunDataHandler.h.
References fData.
|
virtual |
Checks if runName is found, and if so return these data. runName is as given in the msr-file.
return:
runName | run name, e.g. 2009/lem09_his_1234 |
Definition at line 229 of file PRunDataHandler.cpp.
References fData.
Referenced by PRunListCollection::GetEnergy(), PRunListCollection::GetField(), PRunMuMinus::GetProperT0(), PRunSingleHistoRRF::GetProperT0(), PRunAsymmetryRRF::GetProperT0(), PRunSingleHisto::GetProperT0(), PRunAsymmetry::GetProperT0(), PRunListCollection::GetSetup(), PRunListCollection::GetTemp(), PRunListCollection::GetXAxisTitle(), PRunListCollection::GetYAxisTitle(), PRunSingleHistoRRF::PrepareData(), PRunMuMinus::PrepareData(), PRunAsymmetryRRF::PrepareData(), PRunAsymmetry::PrepareData(), PRunSingleHisto::PrepareData(), and PRunNonMusr::PRunNonMusr().
|
virtual |
return data-set with index idx.
return:
idx | index of the raw data set. |
Definition at line 256 of file PRunDataHandler.cpp.
References fData.
|
privatevirtual |
given the year as number, convert it to a 2 character year. If year is out of range '??' will be returned. This routine will break in the year 2100 or later ;-)
year | as number |
Definition at line 6509 of file PRunDataHandler.cpp.
Referenced by WritePsiBinFile().
|
privatevirtual |
Common initializer.
Definition at line 433 of file PRunDataHandler.cpp.
References fAllDataAvailable, fAny2ManyInfo, fFileFormat, fMsrInfo, fRunName, fRunPathName, PHR_INIT_ALL, PHR_INIT_ANY2MANY, and PHR_INIT_MSR.
Referenced by PRunDataHandler().
|
inlinevirtual |
Definition at line 58 of file PRunDataHandler.h.
References fAllDataAvailable.
|
privatevirtual |
Check if a string consists only of white spaces, i.e. spaces and/or ctrl-characters.
return:
str | string to be checked |
Definition at line 6037 of file PRunDataHandler.cpp.
Referenced by ReadWkmFile().
|
privatevirtual |
Reads ascii files. Intended for the nonMuSR data.
The file format definition is: Comment lines start with a '#' or '' character. The file can start with some header info. The header is optional, as all its tags, but if present it has the following format:
* HEADER * TITLE: title * X-AXIS-TITLE: x-axis title * Y-AXIS-TITLE: y-axis title * SETUP: setup * FIELD: field * TEMP: temperature * ENERGY: energy *
field is assumed to be given in (G), the temperature in (K), the energy in (keV)
The data are read column like and start with the data tag DATA, followed by the data columns, i.e.:
* DATA * x, y [, error y] *
where spaces, column, are a tab are possible separations. If no error in y is present, the weighting in the fit will be equal.
return:
Definition at line 3696 of file PRunDataHandler.cpp.
References PNonMusrRawRunData::AppendData(), PNonMusrRawRunData::AppendErrData(), PNonMusrRawRunData::AppendLabel(), fData, PRawRunData::fDataNonMusr, fRunName, fRunPathName, PMUSR_UNDEFINED, PRawRunData::SetEnergy(), PRawRunData::SetField(), PNonMusrRawRunData::SetFromAscii(), PNonMusrRawRunData::SetLabel(), PRawRunData::SetRunName(), PRawRunData::SetRunTitle(), PRawRunData::SetSetup(), PRawRunData::SetTemperature(), and PRawRunData::SetTransport().
Referenced by ReadFilesMsr().
|
virtual |
Read data. Used to read data, either msr-file triggered, or a single explicit data file should be read.
Definition at line 271 of file PRunDataHandler.cpp.
References fAllDataAvailable, fFileFormat, fMsrInfo, fRunPathName, ReadFilesMsr(), ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), and ReadWkmFile().
|
privatevirtual |
Reads column like data sets as generated by msr2data with the option 'data'. This can be used for the 'non muSR fit' type.
return:
Definition at line 4353 of file PRunDataHandler.cpp.
References PNonMusrRawRunData::AppendDataTag(), PNonMusrRawRunData::AppendLabel(), PNonMusrRawRunData::AppendSubData(), PNonMusrRawRunData::AppendSubErrData(), fData, PRawRunData::fDataNonMusr, fRunName, fRunPathName, PNonMusrRawRunData::GetData(), PNonMusrRawRunData::GetErrData(), PNonMusrRawRunData::SetFromAscii(), PRawRunData::SetRunName(), and PNonMusrRawRunData::SetSize().
Referenced by ReadFilesMsr().
|
privatevirtual |
Reads triumf db-files. Intended for the nonMuSR data.
The file format definition is: The following is a description of the features of the TRIUMF .db file format that are currently recognized by musrfit/musrview. The available commands include: title, abstract, comments, labels, and data.
* TITLE * The following line must contain the title. * * * ABSTRACT * The abstract is read in starting with the following line until an empty line is reached. * * COMMENTS * The comments are read in starting with the following line until an empty line is reached. * * * LABELS * One label must occupy each subsequent line until an empty line is reached. The number * of labels should preferably match the number of variables in the data. * * DATA * On the same line as the DATA command, there must appear a comma-delimited list of variable * names. These names should be kept short (some applications truncate to 4 characters). The * numerical data is read in beginning with the following line until an empty line is reached. * * In every line, there must appear exactly 3 comma-delimited fields for each specified name. * The first field is the value, the second is the positive error, and the third is the negative * error. If you leave the last field blank (the comma is still required), then the positive error * will be interpreted as a symmetric error. If you include only the value, then the errors will be * set to zero. * * To reiterate, if you provide a DATA command with 2 names, e.g. "DATA 1st, 2nd", then every subsequent * line must contain 2*3 - 1 = 5 commas. If you give 3 names, then there must be 3*3 - 1 = 8 commas. * * Example * TITLE * Most Excellent Fake Data * * ABSTRACT * This data was collected over * many minutes of light work * that was required to make it up. * * COMMENTS * This data was generated using C++. * The file was formatted with Emacs. * * LABEL * Randomized Linear * Randomized Gaussian * Randomized Lorentzian * Run * * DATA line, gauss, lrntz, run * -1.966, -0.168, -0.106, 0.048, 0.002, 0.005, 0.184, 0.010, 0.017, 1001, , , run 1001 title * -1.895, -0.151, -0.128, 0.014, 0.001, 0.001, 0.259, 0.017, 0.015, 1002, , , run 1002 title * -1.836, -0.127, -0.184, 0.013, 0.001, 0.001, 0.202, 0.017, 0.020, 1003, , , run 1003 title * -1.739, -0.064, -0.166, 0.057, 0.003, 0.004, 0.237, 0.016, 0.018, 1004, , , run 1004 title * -1.601, -0.062, -0.147, 0.104, 0.008, 0.006, 0.271, 0.012, 0.025, 1005, , , run 1005 title * . . . . . . . . . * . . . . . . . . . * . . . . . . . . . * Alternatively, the data often utilizes the continuation character ('\') and is labelled like * DATA line, gauss, lrntz * linear = -1.966, -0.168, -0.106, \ * gaussn = 0.048, 0.002, 0.005, \ * lorntz = 0.184, 0.010, 0.017, \ * 1001,,, run 1001 title * linear = -1.895, -0.151, -0.128, \ * gaussn = 0.014, 0.001, 0.001, \ * lorntz = 0.259, 0.017, 0.015, | * 1002,,, run 1002 title * linear = -1.836, -0.127, -0.184, \ * gaussn = 0.013, 0.001, 0.001, \ * lorntz = 0.202, 0.017, 0.020, | * 1003,,, run 1003 title * . . . . * . . . . * . . . . * If there is a run line as in the above examples, it must be at the end of the data and given * in this just slight odd manner (do not blame me, I haven't invented this format ;-) ). *
WARNING:For the row like data representation (the top DATA representation shown) it is essential that there are always at least one space inbetween commas (the reason is that I am too lazy to write my own tokenizer), e.g.
* -1.966, -0.168, , 0.048, , , 0.184, 0.010, 0.017, 1001, , , run 1001 title *
which is ok, but
* -1.966, -0.168,, 0.048,,, 0.184, 0.010, 0.017, 1001,,, run 1001 title *
will not work!
Some db-files do have a '\-e' or '\e' label just between the DATA tag line and the real data. This tag will just be ignored.
return:
Definition at line 4007 of file PRunDataHandler.cpp.
References PNonMusrRawRunData::AppendData(), PNonMusrRawRunData::AppendDataTag(), PNonMusrRawRunData::AppendErrData(), PNonMusrRawRunData::AppendLabel(), PNonMusrRawRunData::AppendSubData(), PNonMusrRawRunData::AppendSubErrData(), fData, PRawRunData::fDataNonMusr, fRunName, fRunPathName, PNonMusrRawRunData::GetData(), GetDataTagIndex(), PNonMusrRawRunData::GetDataTags(), PNonMusrRawRunData::GetErrData(), PNonMusrRawRunData::GetLabels(), PNonMusrRawRunData::SetFromAscii(), PRawRunData::SetRunName(), and PRawRunData::SetRunTitle().
Referenced by ReadFilesMsr().
|
privatevirtual |
The main read file routine which is filtering what read sub-routine needs to be called. Called when the input is a msr-file.
return:
Definition at line 457 of file PRunDataHandler.cpp.
References FileAlreadyRead(), FileExistsCheck(), fMsrInfo, fRunName, PMsrHandler::GetMsrRunList(), PRH_PPC_OFFSET, ReadAsciiFile(), ReadDatFile(), ReadDBFile(), ReadMduAsciiFile(), ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), and ReadWkmFile().
Referenced by ReadData().
|
privatevirtual |
Reads the mdu ascii files (PSI). Needed to work around PSI-BIN limitations.
Lines starting with '#' or '' are considered as comment lines. The file has the following structure:
* HEADER * TITLE: title-string * SETUP: setup-string * FIELD: val-string (G) or (T) (e.g. 123456 (G)) * TEMP: val-string (K) * GROUPS: # of histograms written * CHANNELS: # of bins per histogram written * RESOLUTION: timeresolution (fs) or (ps) or (ns) or (us) *
followed by the data, which are written in column format, starting with the DATA tag, i.e.
* DATA * *
return:
Definition at line 3383 of file PRunDataHandler.cpp.
References PRawRunDataSet::Clear(), fData, fRunName, fRunPathName, PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetField(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetRunName(), PRawRunData::SetRunTitle(), PRawRunData::SetSetup(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), and PRawRunDataSet::SetTimeZeroBinEstimated().
Referenced by ReadFilesMsr().
|
privatevirtual |
Reads the triumf mud-file format.
return:
Definition at line 3021 of file PRunDataHandler.cpp.
References PRawRunDataSet::Clear(), fData, fRunName, fRunPathName, PMUSR_UNDEFINED, PRawRunData::SetBeamline(), PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetEnergy(), PRawRunData::SetField(), PRawRunDataSet::SetFirstBkgBin(), PRawRunDataSet::SetFirstGoodBin(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetInstrument(), PRawRunData::SetLaboratory(), PRawRunDataSet::SetLastBkgBin(), PRawRunDataSet::SetLastGoodBin(), PRawRunData::SetRunName(), PRawRunData::SetRunNumber(), PRawRunData::SetRunTitle(), PRawRunData::SetSample(), PRawRunData::SetSetup(), PRawRunData::SetStartDate(), PRawRunData::SetStartDateTime(), PRawRunData::SetStartTime(), PRawRunData::SetStopDate(), PRawRunData::SetStopDateTime(), PRawRunData::SetStopTime(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), PRawRunDataSet::SetTimeZeroBin(), PRawRunDataSet::SetTimeZeroBinEstimated(), and PRawRunData::SetTransport().
Referenced by ReadData(), ReadFilesMsr(), and ReadWriteFilesList().
|
privatevirtual |
Will read the NeXuS File Format as soon as PSI will have an implementation.
return:
Definition at line 2107 of file PRunDataHandler.cpp.
References PRawRunDataSet::Clear(), fData, fRunName, fRunPathName, PMUSR_UNDEFINED, PRawRunData::SetBeamline(), PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetEnergy(), PRawRunData::SetField(), PRawRunDataSet::SetFirstGoodBin(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetInstrument(), PRawRunData::SetLaboratory(), PRawRunDataSet::SetLastGoodBin(), PRawRunData::SetMuonSource(), PRawRunData::SetMuonSpecies(), PRawRunData::SetOrientation(), PRawRunData::SetRingAnode(), PRawRunData::SetRunName(), PRawRunData::SetRunNumber(), PRawRunData::SetRunTitle(), PRawRunData::SetSample(), PRawRunData::SetSetup(), PRawRunData::SetStartDate(), PRawRunData::SetStartTime(), PRawRunData::SetStopDate(), PRawRunData::SetStopTime(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), PRawRunDataSet::SetTimeZeroBin(), PRawRunDataSet::SetTimeZeroBinEstimated(), PRawRunData::SetTransport(), and SplitTimeDate().
Referenced by ReadData(), ReadFilesMsr(), and ReadWriteFilesList().
|
privatevirtual |
Reads the old-fashioned PSI-BIN data-files. The MuSR_td_PSI_bin class of Alex Amato is used. In case of problems, please contact alex.. amat o@psi .ch
return:
Definition at line 2775 of file PRunDataHandler.cpp.
References PRawRunDataSet::Clear(), DateToISO8601(), fData, fRunName, fRunPathName, PMUSR_UNDEFINED, PRawRunData::SetBeamline(), PRawRunData::SetComment(), PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetEnergy(), PRawRunData::SetField(), PRawRunData::SetFileName(), PRawRunDataSet::SetFirstGoodBin(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetInstrument(), PRawRunData::SetLaboratory(), PRawRunDataSet::SetLastGoodBin(), PRawRunData::SetMuonSource(), PRawRunData::SetMuonSpecies(), PRawRunDataSet::SetName(), PRawRunData::SetOrientation(), PRawRunData::SetRunName(), PRawRunData::SetRunNumber(), PRawRunData::SetRunTitle(), PRawRunData::SetSample(), PRawRunData::SetSetup(), PRawRunData::SetStartDate(), PRawRunData::SetStartTime(), PRawRunData::SetStopDate(), PRawRunData::SetStopTime(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), PRawRunDataSet::SetTimeZeroBin(), PRawRunDataSet::SetTimeZeroBinEstimated(), PRawRunData::SetTransport(), and status.
Referenced by ReadData(), ReadFilesMsr(), and ReadWriteFilesList().
|
privatevirtual |
Reads both, the "old" LEM-data ROOT-files with TLemRunHeader, and the more general new MusrRoot file.
return:
Definition at line 1420 of file PRunDataHandler.cpp.
References PRawRunDataSet::Clear(), PRawRunData::ClearTemperature(), fAny2ManyInfo, fData, fRunName, fRunPathName, TMusrRunPhysicalQuantity::GetError(), TMusrRunPhysicalQuantity::GetUnit(), TMusrRunPhysicalQuantity::GetValue(), PAny2ManyInfo::groupHistoList, MRH_UNDEFINED, POST_PILEUP_HISTO_OFFSET, PRH_LEM_ROOT, PRH_MUSR_ROOT, PRawRunData::SetBeamline(), PRawRunData::SetComment(), PRawRunData::SetCryoName(), PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetEnergy(), PRawRunData::SetField(), PRawRunData::SetFileName(), PRawRunDataSet::SetFirstGoodBin(), PRawRunData::SetGenerator(), PRawRunData::SetGenericValidatorUrl(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetInstrument(), PRawRunData::SetLaboratory(), PRawRunDataSet::SetLastGoodBin(), PRawRunData::SetMagnetName(), PRawRunData::SetMuonBeamMomentum(), PRawRunData::SetMuonSource(), PRawRunData::SetMuonSpecies(), PRawRunData::SetMuonSpinAngle(), PRawRunDataSet::SetName(), PRawRunData::SetRedGreenOffset(), PRawRunData::SetRingAnode(), PRawRunData::SetRunName(), PRawRunData::SetRunNumber(), PRawRunData::SetRunTitle(), PRawRunData::SetSample(), PRawRunData::SetSetup(), PRawRunData::SetSpecificValidatorUrl(), PRawRunData::SetStartDate(), PRawRunData::SetStartDateTime(), PRawRunData::SetStartTime(), PRawRunData::SetStopDate(), PRawRunData::SetStopDateTime(), PRawRunData::SetStopTime(), PRawRunData::SetTemperature(), PRawRunData::SetTimeResolution(), PRawRunDataSet::SetTimeZeroBin(), PRawRunDataSet::SetTimeZeroBinEstimated(), PRawRunData::SetTransport(), and PRawRunData::SetVersion().
Referenced by ReadData(), ReadFilesMsr(), and ReadWriteFilesList().
|
privatevirtual |
Reads, for backwards compatibility, the ascii-wkm-file data format. The routine is clever enough to distinguish the different wkm-flavours (argh).
return:
Definition at line 2469 of file PRunDataHandler.cpp.
References PRawRunDataSet::Clear(), fData, fRunName, fRunPathName, PRawRunData::GetDataBin(), PRawRunData::GetNoOfHistos(), PRawRunData::GetTimeResolution(), IsWhitespace(), PRawRunDataSet::SetData(), PRawRunData::SetDataSet(), PRawRunData::SetField(), PRawRunDataSet::SetHistoNo(), PRawRunData::SetRunName(), PRawRunData::SetRunNumber(), PRawRunData::SetRunTitle(), PRawRunData::SetSetup(), PRawRunData::SetTemperature(), PRawRunData::SetTempError(), PRawRunData::SetTimeResolution(), PRawRunDataSet::SetTimeZeroBinEstimated(), StripWhitespace(), ToDouble(), and ToInt().
Referenced by ReadData(), ReadFilesMsr(), and ReadWriteFilesList().
|
privatevirtual |
The main read file routine which is filtering what read sub-routine needs to be called. Called when the input is a list of runs. Used with any2many. If the input data file is successfully read, it will write the converted data file.
return:
Definition at line 566 of file PRunDataHandler.cpp.
References A2M_ASCII, A2M_MUD, A2M_MUSR_ROOT, A2M_NEXUS, A2M_PSIBIN, A2M_PSIMDU, A2M_ROOT, A2M_UNDEFINED, A2M_WKM, PAny2ManyInfo::compressFileName, PAny2ManyInfo::compressionTag, fAny2ManyInfo, fData, FileExistsCheck(), FileNameFromTemplate(), fRunPathName, PAny2ManyInfo::inFileName, PAny2ManyInfo::inFormat, PAny2ManyInfo::outFileName, PAny2ManyInfo::outFormat, PAny2ManyInfo::outPath, PAny2ManyInfo::outPathFileName, PAny2ManyInfo::outTemplate, ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), ReadWkmFile(), PAny2ManyInfo::runList, PAny2ManyInfo::useStandardOutput, WriteAsciiFile(), WriteMudFile(), WriteMusrRootFile(), WriteNexusFile(), WritePsiBinFile(), WriteRootFile(), WriteWkmFile(), and PAny2ManyInfo::year.
Referenced by ConvertData().
|
virtual |
Set a raw run data set.
data | pointer to the raw run data set |
idx | index to where to write it. |
Definition at line 340 of file PRunDataHandler.cpp.
References fData.
|
privatevirtual |
splits an ISO 8601 timeDate into seperate time and data. The flag ok shows if it was successfull.
timeData | ISO 8601 timeData |
time | part of timeData |
date | part of timeData |
ok | flag showing if the splitting was successfull |
Definition at line 6424 of file PRunDataHandler.cpp.
Referenced by ReadNexusFile().
|
privatevirtual |
Strip white spaces from a string. The hope is that future TString implementations of ROOT will make this routine obsolate.
str | string to be stripped. It will be modified directly on success. |
return:
Definition at line 5965 of file PRunDataHandler.cpp.
Referenced by ReadWkmFile().
|
privatevirtual |
Tests if a file exists (with or without given extension). The given file-name string will be modified to show the found file name or an empty string if no file is found.
runName | run name with full path to be checked |
ext | extension to be checked |
Definition at line 943 of file PRunDataHandler.cpp.
Referenced by FileExistsCheck().
|
privatevirtual |
Convert a string to a Double_t.
return:
str | string to be converted |
ok | true on success, otherwise false. |
Definition at line 6066 of file PRunDataHandler.cpp.
References status.
Referenced by ReadWkmFile().
|
privatevirtual |
Convert a string to an Int_t.
return:
str | string to be converted |
ok | true on success, otherwise false. |
Definition at line 6116 of file PRunDataHandler.cpp.
References status.
Referenced by ReadWkmFile().
|
privatevirtual |
Write the ascii-file format.
return:
fln | file name. If empty, the routine will try to construct one |
Definition at line 5824 of file PRunDataHandler.cpp.
References PAny2ManyInfo::compressionTag, fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PRawRunDataSet::GetTimeZeroBin(), PMUSR_UNDEFINED, PAny2ManyInfo::rebin, and PAny2ManyInfo::useStandardOutput.
Referenced by ReadWriteFilesList().
|
virtual |
Write data. This routine is used to write a single file.
Definition at line 361 of file PRunDataHandler.cpp.
References A2M_MUD, A2M_MUSR_ROOT, A2M_NEXUS, A2M_PSIBIN, A2M_PSIMDU, A2M_UNDEFINED, fAny2ManyInfo, PAny2ManyInfo::outFileName, PAny2ManyInfo::outFormat, WriteMudFile(), WriteMusrRootFile(), WriteNexusFile(), and WritePsiBinFile().
|
privatevirtual |
Write the mud-file format.
return:
fln | file name. If empty, the routine will try to construct one |
Definition at line 5664 of file PRunDataHandler.cpp.
References PAny2ManyInfo::compressionTag, fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PRawRunDataSet::GetFirstGoodBin(), PRawRunDataSet::GetLastGoodBin(), PRawRunDataSet::GetName(), PRawRunDataSet::GetTimeZeroBin(), PAny2ManyInfo::rebin, and PAny2ManyInfo::useStandardOutput.
Referenced by ReadWriteFilesList(), and WriteData().
|
privatevirtual |
Write the MusrRoot file format. Only the required entries will be handled.
return:
fln | file name. If empty, the routine will try to construct one |
Definition at line 4502 of file PRunDataHandler.cpp.
References PAny2ManyInfo::compressionTag, fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PRawRunDataSet::GetFirstGoodBin(), PRawRunDataSet::GetHistoNo(), PRawRunDataSet::GetLastGoodBin(), PRawRunDataSet::GetName(), PRawRunDataSet::GetTimeZeroBin(), MRH_UNDEFINED, PAny2ManyInfo::rebin, TMusrRunPhysicalQuantity::Set(), and PAny2ManyInfo::useStandardOutput.
Referenced by ReadWriteFilesList(), and WriteData().
|
privatevirtual |
Write the nexus-file format.
return:
fln | file name. If empty, the routine will try to construct one |
Definition at line 4948 of file PRunDataHandler.cpp.
References fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PRawRunDataSet::GetFirstGoodBin(), PRawRunDataSet::GetLastGoodBin(), PRawRunDataSet::GetTimeZeroBin(), PAny2ManyInfo::idf, PAny2ManyInfo::outFormat, PAny2ManyInfo::rebin, and PAny2ManyInfo::useStandardOutput.
Referenced by ReadWriteFilesList(), and WriteData().
|
privatevirtual |
Write the psi-bin-file format.
return:
fln | file name. If empty, the routine will try to construct one |
Definition at line 5424 of file PRunDataHandler.cpp.
References fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PRawRunDataSet::GetFirstGoodBin(), PRawRunDataSet::GetLastGoodBin(), GetMonth(), PRawRunDataSet::GetName(), PRawRunDataSet::GetTimeZeroBin(), GetYear(), PAny2ManyInfo::groupHistoList, PAny2ManyInfo::rebin, status, and PAny2ManyInfo::useStandardOutput.
Referenced by ReadWriteFilesList(), and WriteData().
|
privatevirtual |
Write the PSI LEM root-file format.
return:
fln | file name. If empty, the routine will try to construct one |
Definition at line 4758 of file PRunDataHandler.cpp.
References PAny2ManyInfo::compressionTag, fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PRawRunDataSet::GetTimeZeroBin(), PAny2ManyInfo::rebin, and PAny2ManyInfo::useStandardOutput.
Referenced by ReadWriteFilesList().
|
privatevirtual |
Write the wkm-file format.
return:
fln | file name. If empty, the routine will try to construct one |
Definition at line 5279 of file PRunDataHandler.cpp.
References PAny2ManyInfo::compressionTag, fAny2ManyInfo, fData, GenerateOutputFileName(), PRawRunDataSet::GetData(), PAny2ManyInfo::groupHistoList, PMUSR_UNDEFINED, PAny2ManyInfo::rebin, and PAny2ManyInfo::useStandardOutput.
Referenced by ReadWriteFilesList().
|
private |
flag indicating if all data sets could be read
Definition at line 70 of file PRunDataHandler.h.
Referenced by ConvertData(), Init(), IsAllDataAvailable(), and ReadData().
|
private |
pointer to the any2many data structure
Definition at line 67 of file PRunDataHandler.h.
Referenced by FileExistsCheck(), GenerateOutputFileName(), GetFileName(), Init(), ReadRootFile(), ReadWriteFilesList(), WriteAsciiFile(), WriteData(), WriteMudFile(), WriteMusrRootFile(), WriteNexusFile(), WritePsiBinFile(), WriteRootFile(), and WriteWkmFile().
|
private |
keeping all the raw data
Definition at line 74 of file PRunDataHandler.h.
Referenced by FileAlreadyRead(), GetNoOfRunData(), GetRunData(), ReadAsciiFile(), ReadDatFile(), ReadDBFile(), ReadMduAsciiFile(), ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), ReadWkmFile(), ReadWriteFilesList(), SetRunData(), WriteAsciiFile(), WriteMudFile(), WriteMusrRootFile(), WriteNexusFile(), WritePsiBinFile(), WriteRootFile(), WriteWkmFile(), and ~PRunDataHandler().
|
private |
vector containing all the search paths where to look for data files
Definition at line 68 of file PRunDataHandler.h.
Referenced by FileExistsCheck(), and ~PRunDataHandler().
|
private |
keeps the file format if explicitly given
Definition at line 71 of file PRunDataHandler.h.
Referenced by Init(), and ReadData().
|
private |
pointer to the msr-file handler
Definition at line 66 of file PRunDataHandler.h.
Referenced by FileExistsCheck(), Init(), ReadData(), and ReadFilesMsr().
|
private |
current run name
Definition at line 72 of file PRunDataHandler.h.
Referenced by Init(), ReadAsciiFile(), ReadDatFile(), ReadDBFile(), ReadFilesMsr(), ReadMduAsciiFile(), ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), and ReadWkmFile().
|
private |
current path file name
Definition at line 73 of file PRunDataHandler.h.
Referenced by FileExistsCheck(), GetFileName(), Init(), ReadAsciiFile(), ReadData(), ReadDatFile(), ReadDBFile(), ReadMduAsciiFile(), ReadMudFile(), ReadNexusFile(), ReadPsiBinFile(), ReadRootFile(), ReadWkmFile(), and ReadWriteFilesList().