musrfit 1.10.0
musrFT.cpp File Reference
#include <sys/time.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <memory>
#include <TApplication.h>
#include <TROOT.h>
#include <TString.h>
#include <TObjArray.h>
#include <TObjString.h>
#include <TSAXParser.h>
#include "PMusr.h"
#include "PStartupHandler.h"
#include "PMsrHandler.h"
#include "PRunDataHandler.h"
#include "PPrepFourier.h"
#include "PFourier.h"
#include "PFourierCanvas.h"
Include dependency graph for musrFT.cpp:

Go to the source code of this file.

Classes

struct  musrFT_startup_param
 

Functions

void musrFT_syntax ()
 
void musrFT_init (musrFT_startup_param &startupParam)
 
Bool_t musrFT_filter_histo (Int_t &i, Int_t argc, Char_t *argv[], musrFT_startup_param &startupParam)
 
Int_t musrFT_parse_options (Int_t argc, Char_t *argv[], musrFT_startup_param &startupParam)
 
void musrFT_getMetaInfo (const TString fln, PRawRunData *rawRunData, TString &metaInfo)
 
void musrFT_estimateT0 (musrFT_data &rd)
 
void musrFT_cleanup (TH1F *h)
 
Int_t musrFT_dumpData (TString fln, std::vector< PFourier * > &fourierData, Double_t start, Double_t end)
 
Int_t musrFT_groupHistos (PRunDataHandler *runDataHandler, PMsrGlobalBlock *global, PMsrRunBlock &run, musrFT_data &rd)
 
void musrFT_dumpMsrFile (musrFT_startup_param &param)
 
Double_t millitime ()
 
Int_t main (Int_t argc, Char_t *argv[])
 

Function Documentation

◆ main()

Int_t main ( Int_t argc,
Char_t * argv[] )

musrFT is used to do a Fourier transform of uSR data without any fitting. It directly Fourier transforms the raw histogram data (exception see –lifetimecorrection), and hence only will give staisfactory results for applied fields of larger a couple of kGauss. It is meant to be used to get a feeling what time-domain model will be appropriate. It is NOT meant for ANY quantitative analysis!

Parameters
argcnumber of command line arguments
argvcommand line argument array

Definition at line 996 of file musrFT.cpp.

References PPrepFourier::AddData(), musrFT_startup_param::apodization, musrFT_startup_param::bkg, musrFT_startup_param::bkg_range, musrFT_startup_param::dataFileFormat, musrFT_startup_param::dataFln, musrFT_data::dataSetTag, PPrepFourier::DoBkgCorrection(), PPrepFourier::DoLifeTimeCorrection(), PPrepFourier::DoPacking(), musrFT_startup_param::dumpFln, PStartupOptions::estimateN0, F_APODIZATION_MEDIUM, F_APODIZATION_NONE, F_APODIZATION_STRONG, F_APODIZATION_WEAK, PMsrFourierStructure::fApodization, PMsrFourierStructure::fFourierBlockPresent, PMsrFourierStructure::fFourierPower, FOURIER_APOD_MEDIUM, FOURIER_APOD_STRONG, FOURIER_APOD_WEAK, FOURIER_PLOT_IMAG, FOURIER_PLOT_NOT_GIVEN, FOURIER_PLOT_PHASE, FOURIER_PLOT_PHASE_OPT_REAL, FOURIER_PLOT_POWER, FOURIER_PLOT_REAL, FOURIER_PLOT_REAL_AND_IMAG, FOURIER_UNIT_CYCLES, FOURIER_UNIT_FREQ, FOURIER_UNIT_GAUSS, FOURIER_UNIT_NOT_GIVEN, FOURIER_UNIT_TESLA, musrFT_startup_param::fourierOpt, musrFT_startup_param::fourierPower, musrFT_startup_param::fourierRange, musrFT_startup_param::fourierUnits, PMsrFourierStructure::fPlotRange, PMsrFourierStructure::fPlotTag, PMsrFourierStructure::fUnits, PPrepFourier::GetData(), PRawRunData::GetDataBin(), PPrepFourier::GetDataSetTag(), PPrepFourier::GetNoOfData(), PRawRunData::GetNoOfHistos(), PMsrGlobalBlock::GetPacking(), PRawRunData::GetTimeResolution(), musrFT_startup_param::graphicFormat, musrFT_startup_param::histo, musrFT_data::info, musrFT_startup_param::initialPhase, musrFT_startup_param::lifetimecorrection, millitime(), musrFT_startup_param::msrFln, musrFT_startup_param::msrFlnOut, musrFT_dumpData(), musrFT_dumpMsrFile(), musrFT_estimateT0(), musrFT_getMetaInfo(), musrFT_groupHistos(), musrFT_init(), musrFT_parse_options(), musrFT_syntax(), musrFT_startup_param::packing, parseXmlFile(), PMUSR_DATA_FILE_READ_ERROR, PMUSR_MSR_ALLOCATION_ERROR, PMUSR_MSR_FILE_NOT_FOUND, PMUSR_MSR_SYNTAX_ERROR, PMUSR_SUCCESS, PMUSR_UNSUPPORTED_FEATURE, PMUSR_WRONG_STARTUP_SYNTAX, musrFT_data::rawData, PPrepFourier::SetBkgRange(), PPrepFourier::SetPacking(), musrFT_startup_param::showAverage, musrFT_startup_param::showAveragePerDataSet, startup_path_name, status, musrFT_data::t0, musrFT_startup_param::t0, musrFT_startup_param::timeout, musrFT_data::timeRange, musrFT_startup_param::timeRange, musrFT_data::timeResolution, musrFT_startup_param::title, and PStartupOptions::writeExpectedChisq.

◆ millitime()

Double_t millitime ( )

Gets time a time stamp in msec. Used to measure the calculation time.

return: time stamp with msec resolution.

Definition at line 977 of file musrFT.cpp.

Referenced by main().

◆ musrFT_cleanup()

void musrFT_cleanup ( TH1F * h)

deletes a histogram.

Parameters
hpoint to a ROOT histogram object

Definition at line 688 of file musrFT.cpp.

Referenced by musrFT_dumpData().

◆ musrFT_dumpData()

Int_t musrFT_dumpData ( TString fln,
std::vector< PFourier * > & fourierData,
Double_t start,
Double_t end )

Dump the Fourier transformed data into an ascii file.

Parameters
flndump file name
fourierDatacollection of all the Fourier transformed data.
startstarting point from where the data shall be written to file.
endending point up to where the data shall be written to file.

Definition at line 705 of file musrFT.cpp.

References musrFT_cleanup().

Referenced by main().

◆ musrFT_dumpMsrFile()

void musrFT_dumpMsrFile ( musrFT_startup_param & param)

Dumps an msr-file according to the given command line settings. This is meant to generate an initial msr-file for a given data-file. This routine is 'stupid' in the sense that it knows nothing about the data-files. Hence when feeding it with senseless command line settings, the resulting msr-file fed back to musrFT might do funny things!

Parameters
paramcommand line options

Definition at line 876 of file musrFT.cpp.

References musrFT_startup_param::apodization, musrFT_startup_param::bkg_range, musrFT_startup_param::dataFileFormat, musrFT_startup_param::dataFln, musrFT_startup_param::fourierOpt, musrFT_startup_param::fourierPower, musrFT_startup_param::fourierRange, musrFT_startup_param::fourierUnits, musrFT_startup_param::histo, musrFT_startup_param::msrFlnOut, musrFT_startup_param::packing, musrFT_startup_param::t0, musrFT_startup_param::timeRange, and musrFT_startup_param::title.

Referenced by main().

◆ musrFT_estimateT0()

void musrFT_estimateT0 ( musrFT_data & rd)

Estimates the t0's of the raw-data-files. It simply is looking for the maximum of the raw-data (assuming a prompt peak). This will fail for LEM and ISIS data for sure.

Parameters
rdraw-data-file collection (see PPrepFourier.h)

Definition at line 664 of file musrFT.cpp.

References musrFT_data::info, musrFT_data::rawData, and musrFT_data::t0.

Referenced by main().

◆ musrFT_filter_histo()

Bool_t musrFT_filter_histo ( Int_t & i,
Int_t argc,
Char_t * argv[],
musrFT_startup_param & startupParam )

Parses the musrFT –histo options. Allowed –histo options are: <h0> <h1> ... <hN>, e.g. –histo 1 3 5 <h0>-<hN>, e.g. –histo 1-16 or a combination of both e.g. –histo 1 3 7-12 15

return: true if everything is OK, false otherwise.

Parameters
iposition of the –histo option within argv. At return it will be shifted to the last element of the –histo option.
argcnumber of elements in argv
argvlist of command line tokens
startupParamstartup parameter structure

Definition at line 205 of file musrFT.cpp.

References musrFT_startup_param::histo.

Referenced by musrFT_parse_options().

◆ musrFT_getMetaInfo()

void musrFT_getMetaInfo ( const TString fln,
PRawRunData * rawRunData,
TString & metaInfo )

Collects the meta information form the raw-data-file.

Parameters
flnfile name of the raw-data-file
rawRunDataraw-data-file object
metaInforeturn string which will contain the meta information.

Definition at line 619 of file musrFT.cpp.

References PRawRunData::GetCryoName(), PRawRunData::GetEnergy(), PRawRunData::GetField(), PRawRunData::GetNoOfTemperatures(), PRawRunData::GetSample(), PRawRunData::GetTemperature(), and PMUSR_UNDEFINED.

Referenced by main().

◆ musrFT_groupHistos()

Int_t musrFT_groupHistos ( PRunDataHandler * runDataHandler,
PMsrGlobalBlock * global,
PMsrRunBlock & run,
musrFT_data & rd )

Groups the histograms before Fourier transform. This is used to group detectors.

Parameters
runDataHandlerraw-run-data object containing the data
globalpointer to the GLOBAL block of the msr-file
runreference to the relevant RUN block of the msr-file
rddata collection which will hold the grouped histograms.

Definition at line 787 of file musrFT.cpp.

References PRawRunData::GetDataBin(), PMsrRunBlock::GetForwardHistoNo(), PMsrRunBlock::GetForwardHistoNoSize(), PRunDataHandler::GetRunData(), PMsrRunBlock::GetRunName(), PMsrGlobalBlock::GetT0Bin(), PMsrRunBlock::GetT0Bin(), PMsrGlobalBlock::GetT0BinSize(), PMsrRunBlock::GetT0BinSize(), musrFT_data::rawData, and musrFT_data::t0.

Referenced by main().

◆ musrFT_init()

◆ musrFT_parse_options()

◆ musrFT_syntax()

void musrFT_syntax ( )

prints the musrFT usage.

Definition at line 94 of file musrFT.cpp.

Referenced by main(), and musrFT_parse_options().