added any2many, an attempt to write the universial musr-data-file converter. Still some work needed. Added the possibility to show the t0 saved in the data file.

This commit is contained in:
nemu
2010-12-23 13:16:57 +00:00
parent 2735116ab7
commit 452018bedf
11 changed files with 2117 additions and 169 deletions

View File

@@ -276,6 +276,7 @@ class PRawRunData {
virtual ~PRawRunData();
virtual const TString* GetRunName() { return &fRunName; }
virtual const Int_t GetRunNumber() { return fRunNumber; }
virtual const TString* GetRunTitle() { return &fRunTitle; }
virtual const TString* GetSetup() { return &fSetup; }
virtual const Double_t GetField() { return fField; }
@@ -299,6 +300,7 @@ class PRawRunData {
virtual const PNonMusrRawRunData* GetDataNonMusr() { return &fDataNonMusr; }
virtual void SetRunName(const TString &str) { fRunName = str; }
virtual void SetRunNumber(const Int_t &val) { fRunNumber = val; }
virtual void SetRunTitle(const TString str) { fRunTitle = str; }
virtual void SetSetup(const TString str) { fSetup = str; }
virtual void SetField(const Double_t dval) { fField = dval; }
@@ -321,6 +323,7 @@ class PRawRunData {
private:
TString fRunName; ///< name of the run
Int_t fRunNumber; ///< run number
TString fRunTitle; ///< run title
TString fSetup; ///< description of the setup of this run
Double_t fField; ///< magnetic field value
@@ -560,4 +563,22 @@ typedef struct {
UInt_t fNdf; ///< number of degrees of freedom
} PMsrStatisticStructure;
//-------------------------------------------------------------
/**
* <p>Holds 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
PIntVector runList; ///< holds the run number list to be converted
TString inFileName; ///< holds the file name of the input data file
TString outFileName; ///< holds the file name of the output data file
TString outPath; ///< holds the output path
UInt_t rebin; ///< holds the number of bins to be packed
} PAny2ManyInfo;
#endif // _PMUSR_H_

View File

@@ -82,6 +82,7 @@ class PMusrT0Data {
virtual UInt_t GetAddT0Entries() { return fAddT0.size(); }
virtual UInt_t GetAddT0Size(UInt_t idx);
virtual Int_t GetAddT0(UInt_t addRunIdx, UInt_t idx);
virtual Int_t GetT0Data() { return fT0Data; }
virtual void SetSingleHisto(const Bool_t flag) { fSingleHisto = flag; }
virtual void SetRawRunData(const vector<PRawRunData*> rawRunData) { fRawRunData = rawRunData; }
@@ -93,6 +94,7 @@ class PMusrT0Data {
virtual void SetCmdTag(const UInt_t cmdTag) { fCmdTag = cmdTag; }
virtual void SetT0(UInt_t val, UInt_t idx);
virtual void SetAddT0(UInt_t val, UInt_t addRunIdx, UInt_t idx);
virtual void SetT0Data(UInt_t val) { fT0Data = val; }
private:
Bool_t fSingleHisto; ///< true if single histo fit, false for asymmetry fit
@@ -105,6 +107,7 @@ class PMusrT0Data {
Int_t fCmdTag; ///< command tag. 0=get t0, 1=get data-/bkg-range, 2=get t0, and data-/bkg-range
PIntVector fT0; ///< holding the t0's of the run
vector<PIntVector> fAddT0; ///< holding the t0's of the addruns
Int_t fT0Data; ///< holding the t0 found in the current data set
};
@@ -150,6 +153,7 @@ class PMusrT0 : public TObject, public TQObject
Bool_t fDataAndBkgEnabled; ///< enable/disable data and background range handling (necessary in connection with grouping and addrun)
Bool_t fT0Enabled; ///< enable/disable t0 handling (necessary in connection with grouping and addrun)
Int_t fT0Estimated; ///< estimated t0 value (in bins)
Bool_t fShowT0DataChannel;
// canvas related variables
TCanvas *fMainCanvas; ///< main canvas for the graphical user interface
@@ -161,6 +165,7 @@ class PMusrT0 : public TObject, public TQObject
TLatex *fToDoInfo; ///< clear text user instruction string
TLine *fT0Line; ///< line showing the position of t0
TLine *fT0DataLine; ///< line showing the position of t0 found in the data file
TLine *fFirstBkgLine; ///< line showing the start of the background
TLine *fLastBkgLine; ///< line showing the end of the background
TLine *fFirstDataLine; ///< line showing the start of the data (first good data bin)
@@ -172,6 +177,8 @@ class PMusrT0 : public TObject, public TQObject
Int_t fDataRange[2]; ///< data range (first good bin, last good bin)
Int_t fBkgRange[2]; ///< background range (first bkg bin, last bkg bin)
void ShowDataFileT0Channel();
void HideDataFileT0Channel();
void SetT0Channel();
void SetEstimatedT0Channel();
void SetDataFirstChannel();

View File

@@ -46,6 +46,7 @@ using namespace std;
class PRunDataHandler
{
public:
PRunDataHandler(PAny2ManyInfo *any2ManyInfo, const PStringVector dataPath);
PRunDataHandler(PMsrHandler *msrInfo);
PRunDataHandler(PMsrHandler *msrInfo, const PStringVector dataPath);
virtual ~PRunDataHandler();
@@ -55,6 +56,7 @@ class PRunDataHandler
private:
PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler
PAny2ManyInfo *fAny2ManyInfo; ///< pointer to the any2many data structure
PStringVector fDataPath; ///< vector containing all the search paths where to look for data files
Bool_t fAllDataAvailable; ///< flag indicating if all data sets could be read
@@ -62,10 +64,12 @@ class PRunDataHandler
TString fRunPathName; ///< current path file name
PRawRunDataList fData; ///< keeping all the raw data
virtual Bool_t ReadFile();
virtual Bool_t ReadFilesMsr();
virtual Bool_t ReadWriteFilesList();
virtual Bool_t FileAlreadyRead(TString runName);
virtual Bool_t FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx);
virtual Bool_t ReadRootFile(Bool_t notPostPileup);
virtual Bool_t FileExistsCheck(const Int_t idx);
virtual Bool_t ReadRootFile(UInt_t tag);
virtual Bool_t ReadNexusFile();
virtual Bool_t ReadWkmFile();
virtual Bool_t ReadPsiBinFile();
@@ -74,11 +78,21 @@ class PRunDataHandler
virtual Bool_t ReadAsciiFile();
virtual Bool_t ReadDBFile();
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 WritePsiMduFile(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 FileNameFromTemplate(TString &fileNameTemplate, Int_t run, TString &year, Bool_t &ok);
};
#endif // _PRUNDATAHANDLER_H_