updated Class_MuSR_PSI from A.Amato/A.Raselli. Added support for MDU PSI binary format. Not rigorously tested yet.

This commit is contained in:
nemu 2009-11-12 11:26:10 +00:00
parent c2b898a246
commit e9cb6ded30
6 changed files with 3312 additions and 1894 deletions

View File

@ -1,5 +1,5 @@
AC_PREREQ(2.59)
AC_INIT(musrfit, 0.5.2, andreas.suter@psi.ch)
AC_INIT(musrfit, 0.6.0, andreas.suter@psi.ch)
AC_CONFIG_AUX_DIR(admin)
dnl -----------------------------------------------
@ -14,8 +14,8 @@ MUD_LIBRARY_NAME=mud
#release versioning
MUSR_MAJOR_VERSION=0
MUSR_MINOR_VERSION=5
MUSR_MICRO_VERSION=2
MUSR_MINOR_VERSION=6
MUSR_MICRO_VERSION=0
#release versioning
LEM_MAJOR_VERSION=1
@ -24,7 +24,7 @@ LEM_MICRO_VERSION=0
#release versioning
PSIBIN_MAJOR_VERSION=0
PSIBIN_MINOR_VERSION=0
PSIBIN_MINOR_VERSION=1
PSIBIN_MICRO_VERSION=0
#release versioning

View File

@ -161,6 +161,8 @@ Bool_t PRunDataHandler::ReadFile()
success = ReadNexusFile();
else if (!runList->at(i).GetFileFormat(j)->CompareTo("psi-bin"))
success = ReadPsiBinFile();
else if (!runList->at(i).GetFileFormat(j)->CompareTo("psi-mdu"))
success = ReadPsiBinFile();
else if (!runList->at(i).GetFileFormat(j)->CompareTo("mud"))
success = ReadMudFile();
else if (!runList->at(i).GetFileFormat(j)->CompareTo("wkm"))
@ -251,6 +253,8 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
ext = TString("nexus");
else if (!runInfo.GetFileFormat(idx)->CompareTo("psi-bin"))
ext = TString("bin");
else if (!runInfo.GetFileFormat(idx)->CompareTo("psi-mdu"))
ext = TString("mdu");
else if (!runInfo.GetFileFormat(idx)->CompareTo("mud"))
ext = TString("msr");
else if (!runInfo.GetFileFormat(idx)->CompareTo("wkm")) {
@ -282,6 +286,7 @@ Bool_t PRunDataHandler::FileExistsCheck(PMsrRunBlock &runInfo, const UInt_t idx)
cerr << endl << " ROOT-PPC -> root post pileup corrected for lem";
cerr << endl << " NEXUS -> nexus file format";
cerr << endl << " PSI-BIN -> psi bin file format";
cerr << endl << " PSI-MDU -> psi mdu file format (see also MDU-ASCII)";
cerr << endl << " MUD -> triumf mud file format";
cerr << endl << " WKM -> wkm ascii file format";
cerr << endl << " MDU-ASCII -> psi mdu ascii file format";

View File

@ -1,10 +1,9 @@
## Process this file with automake to create Makefile.in
h_sources = MuSR_td_PSI_bin.h tydefs.h
h_sources = MuSR_td_PSI_bin.h
cpp_sources = MuSR_td_PSI_bin.cpp
include_HEADERS = MuSR_td_PSI_bin.h
noinst_HEADERS = tydefs.h
INCLUDES = -I.
AM_CXXFLAGS = $(LOCAL_PSIBIN_LIB_CXXFLAGS)

File diff suppressed because it is too large Load Diff

View File

@ -4,12 +4,12 @@
declaration file of the class 'MuSR_td_PSI_bin'
Main class to read td_bin PSI MuSR data.
Main class to read mdu and td_bin PSI MuSR data.
***************************************************************************************
begin : Alex Amato, October 2005
modfied: :
modified : Andrea Raselli, October 2009
copyright : (C) 2005 by
email : alex.amato@psi.ch
@ -37,7 +37,15 @@ using namespace std ;
#include <string>
#include <vector>
#include "tydefs.h"
/* ------------------------------------------------------------------ */
const int MAXHISTO = 32; // maximum number of histos to process/store
const int MAXSCALER = 32; // maximum number of scalers to proces/store
const int MAXTEMPER = 4; // maximum number of average temperatures
const int MAXLABELSIZE = 12; // maximum size of labels
/* ------------------------------------------------------------------ */
class MuSR_td_PSI_bin {
@ -47,9 +55,14 @@ class MuSR_td_PSI_bin {
private:
// ------------------------------------start of the variables
string filename;
string readstatus;
bool readingok;
char format_id[3] ;
Int16 num_run ;
int num_run ;
char sample[11] ;
char temp[11] ;
@ -62,50 +75,62 @@ class MuSR_td_PSI_bin {
char time_start[9] ;
char time_stop[9] ;
Float32 bin_width ;
Int16 tdc_resolution ;
Int16 tdc_overflow ;
float bin_width ;
Int16 number_histo ;
Int16 length_histo ;
char labels_histo[16][5] ;
int number_histo ;
int length_histo ;
char labels_histo[MAXHISTO][MAXLABELSIZE] ;
Int32 total_events ;
Int32 events_per_histo[16] ;
int total_events ;
int events_per_histo[MAXHISTO] ;
Int16 integer_t0[16] ;
Int16 first_good[16] ;
Int16 last_good[16] ;
Float32 real_t0[17] ;
int default_binning ;
Int32 scalers[18] ;
char labels_scalers[18][5] ;
float real_t0[MAXHISTO] ;
int integer_t0[MAXHISTO] ;
int first_good[MAXHISTO] ;
int last_good[MAXHISTO] ;
Float32 temper[4] ;
Float32 temp_deviation[4] ;
Float32 mon_low[4] ;
Float32 mon_high[4] ;
Int32 mon_num_events ;
char mon_dev[13] ;
int number_scaler ;
int scalers[MAXSCALER] ;
char labels_scalers[MAXSCALER][MAXLABELSIZE] ;
Int16 num_data_records_file ;
Int16 length_data_records_bins ;
Int16 num_data_records_histo ;
int number_temper ;
float temper[MAXTEMPER] ;
float temp_deviation[MAXTEMPER] ;
Int32 period_save ;
Int32 period_mon ;
Int32 **histo ;
int **histo ;
public:
vector< vector<double> > histos_vector ; /*!< this public variables provides a direct access to the histograms
/*!< this public variable provides a direct read/write access to the histograms.
However all public methods use the protected variable histo.
Histogram information returned by ..._vector or ..._array methods return
information based on histo bin .
NOTE: Histogram information returned by pointer_to_array = ..._array() methods
should be freed by delete [] pointer_to_array;
*/
vector< vector<double> > histos_vector ;
// ------------------------------------end of the variables
public:
int read(const char* fileName);
int read(const char* fileName); // generic read
int readbin(const char* fileName); // read MuSR PSI bin format
int readmdu(const char* fileName); // read MuSR mdu format
bool readingOK() const;
string ReadStatus() const;
string Filename() const;
int Show() const;
int Clear();
int get_histo_int(int histo_num, int j);
double get_histo(int histo_num, int j);
int *get_histo_array_int(int histo_num);
double *get_histo_array(int histo_num , int binning) ;
@ -241,9 +266,11 @@ class MuSR_td_PSI_bin {
long get_totalEvents_long();
int get_numberScaler_int();
vector<long> get_scalers_vector() ;
vector<string> get_scalersNames_vector() ;
int get_default_binning() ;
int get_t0_int(int i) ;
vector<int> get_t0_vector() ;
double get_t0_double(int i) ;
@ -278,13 +305,17 @@ class MuSR_td_PSI_bin {
vector<string> get_timeStart_vector() ;
vector<string> get_timeStop_vector() ;
vector<double> get_devTemperatures_vector() ;
int get_numberTemperature_int() ;
vector<double> get_temperatures_vector() ;
vector<double> get_devTemperatures_vector() ;
private:
int max(int x, int y) ;
int min(int x, int y) ;
int tmax(int x, int y) ;
int tmin(int x, int y) ;
} ;
#endif
/************************************************************************************
* EOF MuSR_td_PSI_bin.h *
************************************************************************************/

View File

@ -1,283 +0,0 @@
#ifndef __tydefs_h__
#define __tydefs_h__
/*
* +--------------------------------------------------------------+
* | Paul Scherrer Institut |
* | Computing Division |
* | |
* | This software may be used freely by non-profit organizations.|
* | It may be copied provided that the name of P.S.I. and of the |
* | author is included. Neither P.S.I. nor the author assume any |
* | responsibility for the use of this software outside of P.S.I.|
* +--------------------------------------------------------------+
*
* Project . . . . . . . . . . : Musr support software
* Component/Facility . . . . . : Define basic data types and functions
* File Name . . . . . . . . . : tydefs.h
* Title . . . . . . . . . . . :
* Abstract . . . . . . . . . . :
*
*
* Author . . . . . . . . . . . : RA84
* Date of creation . . . . . . : March 1998
*
* Date Name Modification
* -----------------------------------------------------------------
* 04-MAY-1998 RA84 Header indluded
* 22-MAY-2002 RA95 && !defined(OS_OSF1) added for TRU64
* 17-NOV-2005 RA36
*/
/* --------------------------------------------------------------------- */
/* --- OpenVMS (DECC or VAXC),(AXP or VAX) --- */
#ifdef _WIN32
#define INT64_SUPPORT
#endif
#if ((defined(__DECC) || defined(__VAXC)) && !defined(unix) && !defined(OS_OSF1))
#if defined (__ALPHA)
#define MODEFS_CC_SYS "Compiled for VAXC or DECC OpenVMS ALPHA"
typedef int Int16;
typedef unsigned int UInt16;
typedef long int Int32;
typedef unsigned long int UInt32;
typedef Int16 * Int16Ptr;
typedef UInt16 * UInt16Ptr;
typedef Int32 * Int32Ptr;
typedef UInt32 * UInt32Ptr;
#ifdef INCLUDE_CHARDEFS
typedef char Char;
typedef char * CharPtr;
typedef char * Str;
#endif
#ifdef INCLUDE_BOOLDEF
typedef unsigned char BoolEnum;
#endif
#else /* !defined( __ALPHA) */
#define MODEFS_CC_SYS "Compiled for VAXC or DECC OpenVMS VAX"
typedef short int Int16;
typedef unsigned short int UInt16;
typedef int Int32;
typedef unsigned int UInt32;
typedef Int16 * Int16Ptr;
typedef UInt16 * UInt16Ptr;
typedef Int32 * Int32Ptr;
typedef UInt32 * UInt32Ptr;
#ifdef INCLUDE_CHARDEFS
typedef char Char;
typedef char * CharPtr;
typedef char * Str;
#endif
#ifdef INCLUDE_BOOLDEF
typedef unsigned char BoolEnum;
#endif
#endif /* #else __ALPHA */
#define VMS_SUCCESS 1
#define VMS_ERROR 2
/* --- DEC UNIX or OFS/1 (AXP or else) --- */
#elif defined (__osf__)
#if defined (__alpha)
#define MODEFS_CC_SYS "Compiled for (DEC) OSF/1 or UNIX Alpha"
typedef short int Int16;
typedef unsigned short int UInt16;
typedef int Int32;
typedef unsigned int UInt32;
typedef Int16 * Int16Ptr;
typedef UInt16 * UInt16Ptr;
typedef Int32 * Int32Ptr;
typedef UInt32 * UInt32Ptr;
#ifdef INCLUDE_CHARDEFS
typedef char Char;
typedef char * CharPtr;
typedef char * Str;
#endif
#ifdef INCLUDE_BOOLDEF
typedef unsigned char BoolEnum;
#endif
#else /* !defined ( __alpha) */
#define MODEFS_CC_SYS "Compiled for (DEC) OSF/1 or UNIX NON Alpha"
typedef int Int16;
typedef unsigned int UInt16;
typedef long int Int32;
typedef unsigned long int UInt32;
typedef Int16 * Int16Ptr;
typedef UInt16 * UInt16Ptr;
typedef Int32 * Int32Ptr;
typedef UInt32 * UInt32Ptr;
#ifdef INCLUDE_CHARDEFS
typedef char Char;
typedef char * CharPtr;
typedef char * Str;
#endif
#ifdef INCLUDE_BOOLDEF
typedef unsigned char BoolEnum;
#endif
#endif /* #else __alpha */
/* --- other operating system --- */
#else /* other operating system */
//#ifdef _WIN32
#if (defined(_WIN32) || defined(__linux__) || defined(_WIN32GCC))
#define MODEFS_CC_SYS "Compiled for Microsoft Windows 32-bit or Linux operating system"
typedef short Int16;
typedef unsigned short UInt16;
typedef int Int32;
typedef unsigned int UInt32;
typedef Int16 * Int16Ptr;
typedef UInt16 * UInt16Ptr;
typedef Int32 * Int32Ptr;
typedef UInt32 * UInt32Ptr;
#ifdef INT64_SUPPORT
#define INT64_SUPPORTED
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
typedef Int64 * Int64Ptr;
typedef UInt64 * UInt64Ptr;
#endif
#ifdef INCLUDE_CHARDEFS
typedef char Char;
typedef char * CharPtr;
typedef char * Str;
#endif
#ifdef INCLUDE_BOOLDEF
typedef unsigned char BoolEnum;
#endif
#else
#define MODEFS_CC_SYS "Compiled for other (#else) operating system"
typedef int Int16;
typedef unsigned int UInt16;
typedef long int Int32;
typedef unsigned long int UInt32;
typedef Int16 * Int16Ptr;
typedef UInt16 * UInt16Ptr;
typedef Int32 * Int32Ptr;
typedef UInt32 * UInt32Ptr;
#ifdef INT64_SUPPORT
#define INT64_SUPPORTED
//typedef long int Int64;
//typedef unsigned long int UInt64;
typedef Int64 * Int64Ptr;
typedef UInt64 * UInt64Ptr;
#endif
#ifdef INCLUDE_CHARDEFS
typedef char Char;
typedef char * CharPtr;
typedef char * Str;
#endif
#ifdef INCLUDE_BOOLDEF
typedef unsigned char BoolEnum;
#endif
#endif
#endif
/* --------------------------------------------------------------------- */
/* not operating system specific (does not have to be portable) */
typedef float Float;
typedef double Double;
typedef float Float32;
typedef double Float64;
#ifdef FLOAT128_SUPPORT
#define FLOAT128_SUPPORTED
typedef double Float128;
#endif
/* --------------------------------------------------------------------- */
#define MAXUINT16 0xffff
#define MAXUINT32 0xffffffff
#ifdef INT64_SUPPORT
#define MAXUINT64 0xffffffffffffffff
#endif
#define MAXINT16 0x7fff
#define MININT16 (-MAXINT16)
#define MAXINT32 0x7fffffff
#define MININT32 (-MAXINT32)
#ifdef INT64_SUPPORT
#define MAXINT64 0x7fffffffffffffff
#define MININT64 (-MAXINT64)
#endif
/* --------------------------------------------------------------------- */
#define BOOL_TRUE 1
#define BOOL_FALSE 0
#define ERRORRET -1
#define MOSUCCESS 0
#define MOERROR 1
/* --------------------------------------------------------------------- */
#define MOMESSAGEMAX 255
/* --------------------------------------------------------------------- */
#define SPRINTF sprintf
#define PRINTF printf
#define SSCANF sscanf
#define STRLEN strlen
#define STRCMP strcmp
#define STRCPY strcpy
#define STRCAT strcat
#define STRNCPY strncpy
#define STRNCMP strncmp
#define ATOL atol
#define MEMCPY memcpy
#define MALLOCF malloc
#define FREEF free
#define FOPENR fopen
#define FCLOSER fclose
#define FWRITER fwrite
/* --------------------------------------------------------------------- */
#endif /* __modefs_h__ */