t0 unsigned int -> double. Add dummy musrview
This commit is contained in:
parent
2a924374c7
commit
e02f761c5f
100
src/Makefile.musrview
Normal file
100
src/Makefile.musrview
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
#---------------------------------------------------
|
||||||
|
# Makefile.musrview
|
||||||
|
#
|
||||||
|
# Author: Andreas Suter
|
||||||
|
# e-mail: andreas.suter@psi.ch
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#---------------------------------------------------
|
||||||
|
|
||||||
|
#---------------------------------------------------
|
||||||
|
# get compilation and library flags from root-config
|
||||||
|
|
||||||
|
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
|
||||||
|
ROOTLIBS = $(shell $(ROOTSYS)/bin/root-config --libs)
|
||||||
|
ROOTGLIBS = $(shell $(ROOTSYS)/bin/root-config --glibs)
|
||||||
|
|
||||||
|
#---------------------------------------------------
|
||||||
|
# depending on the architecture, choose the compiler,
|
||||||
|
# linker, and the flags to use
|
||||||
|
#
|
||||||
|
|
||||||
|
OSTYPE = linux
|
||||||
|
|
||||||
|
ifeq ($(OSTYPE),linux)
|
||||||
|
OS = LINUX
|
||||||
|
endif
|
||||||
|
ifeq ($(OSTYPE),linux-gnu)
|
||||||
|
OS = LINUX
|
||||||
|
endif
|
||||||
|
ifeq ($(OSTYPE),darwin)
|
||||||
|
OS = DARWIN
|
||||||
|
endif
|
||||||
|
|
||||||
|
# -- Linux
|
||||||
|
ifeq ($(OS),LINUX)
|
||||||
|
CXX = g++
|
||||||
|
CXXFLAGS = -g -Wall -fPIC
|
||||||
|
PMUSRPATH = ./include
|
||||||
|
MNPATH = $(ROOTSYS)/include
|
||||||
|
GSLPATH = /usr/include/gsl
|
||||||
|
INCLUDES = -I $(PMUSRPATH) -I $(MNPATH) -I $(GSLPATH)
|
||||||
|
LD = g++
|
||||||
|
LDFLAGS = -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
# -- Darwin
|
||||||
|
ifeq ($(OS),DARWIN)
|
||||||
|
CXX = g++
|
||||||
|
CXXFLAGS = -g -Wall -fPIC
|
||||||
|
INCLUDES = -I../include
|
||||||
|
LD = g++
|
||||||
|
LDFLAGS = -g
|
||||||
|
endif
|
||||||
|
|
||||||
|
# the output from the root-config script:
|
||||||
|
CXXFLAGS += $(ROOTCFLAGS)
|
||||||
|
LDFLAGS +=
|
||||||
|
|
||||||
|
# the ROOT libraries (G = graphic)
|
||||||
|
LIBS = $(ROOTLIBS) -lXMLParser
|
||||||
|
GLIBS = $(ROOTGLIBS) -lXMLParser
|
||||||
|
|
||||||
|
# PSI libs
|
||||||
|
PSILIBS = -lTLemRunHeader -lPMusr
|
||||||
|
# Minuit2 lib
|
||||||
|
MNLIB = -L$(ROOTSYS)/lib -lMinuit2
|
||||||
|
# GSL lib
|
||||||
|
GSLLIB = -lgslcblas -lgsl
|
||||||
|
|
||||||
|
|
||||||
|
EXEC = musrview
|
||||||
|
|
||||||
|
# some definitions: headers, sources, objects,...
|
||||||
|
OBJS =
|
||||||
|
OBJS += $(EXEC).o
|
||||||
|
|
||||||
|
# make the executable:
|
||||||
|
#
|
||||||
|
all: $(EXEC)
|
||||||
|
|
||||||
|
$(EXEC): $(OBJS)
|
||||||
|
@echo "---> Building $(EXEC) ..."
|
||||||
|
/bin/rm -f $(SHLIB)
|
||||||
|
$(LD) $(OBJS) -o $(EXEC) $(GLIBS) $(PSILIBS) $(MNLIB) $(GSLLIB)
|
||||||
|
@echo "done"
|
||||||
|
|
||||||
|
# clean up: remove all object file (and core files)
|
||||||
|
# semicolon needed to tell make there is no source
|
||||||
|
# for this target!
|
||||||
|
#
|
||||||
|
clean:; @rm -f $(OBJS)
|
||||||
|
@echo "---> removing $(OBJS)"
|
||||||
|
|
||||||
|
#
|
||||||
|
$(OBJS): %.o: %.cpp
|
||||||
|
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
|
||||||
|
|
||||||
|
install: all
|
||||||
|
@echo "doesn't do anything yet ..."
|
||||||
|
|
87
src/include/PMusrCanvas.h
Normal file
87
src/include/PMusrCanvas.h
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
PMusrCanvas.h
|
||||||
|
|
||||||
|
Author: Andreas Suter
|
||||||
|
e-mail: andreas.suter@psi.ch
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 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. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef _PMUSRCANVAS_H_
|
||||||
|
#define _PMUSRCANVAS_H_
|
||||||
|
|
||||||
|
#include <TObject.h>
|
||||||
|
#include <TQObject.h>
|
||||||
|
#include <TCanvas.h>
|
||||||
|
#include <TPaveText.h>
|
||||||
|
#include <TPad.h>
|
||||||
|
|
||||||
|
#define YINFO 0.1
|
||||||
|
#define YTITLE 0.95
|
||||||
|
#define XTHEO 0.75
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*/
|
||||||
|
class PMusrCanvas : public TObject, public TQObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PMusrCanvas();
|
||||||
|
PMusrCanvas(const char* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh);
|
||||||
|
virtual ~PMusrCanvas();
|
||||||
|
|
||||||
|
virtual Bool_t IsValid() { return fValid; }
|
||||||
|
|
||||||
|
virtual void Done(Int_t status=0); // *SIGNAL*
|
||||||
|
virtual void HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected); // SLOT
|
||||||
|
|
||||||
|
private:
|
||||||
|
Bool_t fValid;
|
||||||
|
|
||||||
|
TCanvas *fMainCanvas;
|
||||||
|
TPaveText *fTitlePad;
|
||||||
|
TPad *fDataTheoryPad;
|
||||||
|
TPaveText *fParameterTheoryPad;
|
||||||
|
TPaveText *fInfoPad;
|
||||||
|
|
||||||
|
TPaveText *fKeyboardHandlerText;
|
||||||
|
|
||||||
|
ClassDef(PMusrCanvas, 1)
|
||||||
|
};
|
||||||
|
|
||||||
|
// root dictionary stuff --------------------------------------------------
|
||||||
|
#ifdef __CINT__
|
||||||
|
|
||||||
|
#pragma link off all globals;
|
||||||
|
#pragma link off all classes;
|
||||||
|
#pragma link off all functions;
|
||||||
|
|
||||||
|
#pragma link C++ class PMusrCanvas+;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// root dictionary stuff --------------------------------------------------
|
||||||
|
|
||||||
|
#endif // _PMUSRCANVAS_H_
|
@ -86,7 +86,7 @@ class PRunBase
|
|||||||
|
|
||||||
PRunData fData; ///< data to be fitted
|
PRunData fData; ///< data to be fitted
|
||||||
double fTimeResolution; ///< time resolution
|
double fTimeResolution; ///< time resolution
|
||||||
vector<int> fT0s; ///< all t0's of a run! The derived classes will handle it
|
vector<double> fT0s; ///< all t0's of a run! The derived classes will handle it
|
||||||
|
|
||||||
virtual bool PrepareData() = 0; // pure virtual, i.e. needs to be implemented by the deriving class!!
|
virtual bool PrepareData() = 0; // pure virtual, i.e. needs to be implemented by the deriving class!!
|
||||||
|
|
||||||
|
@ -54,9 +54,9 @@ void musrfit_syntax()
|
|||||||
{
|
{
|
||||||
cout << endl << "usage: musrfit [<msr-file> [--debug] | [--dump <type>]] | --version | --help";
|
cout << endl << "usage: musrfit [<msr-file> [--debug] | [--dump <type>]] | --version | --help";
|
||||||
cout << endl << " <msr-file>: msr input file";
|
cout << endl << " <msr-file>: msr input file";
|
||||||
cout << endl << " 'msrfit <msf-file>' will execute msrfit";
|
cout << endl << " 'musrfit <msr-file>' will execute msrfit";
|
||||||
cout << endl << " 'msrfit' or 'msrfit --help' will show this help";
|
cout << endl << " 'musrfit' or 'musrfit --help' will show this help";
|
||||||
cout << endl << " 'msrfit --version' will print the msrfit version";
|
cout << endl << " 'musrfit --version' will print the msrfit version";
|
||||||
cout << endl << " --debug is used to print additional infos";
|
cout << endl << " --debug is used to print additional infos";
|
||||||
cout << endl << " --dump <type> is writing a data file with the fit data and the theory";
|
cout << endl << " --dump <type> is writing a data file with the fit data and the theory";
|
||||||
cout << endl << " <type> can be 'ascii', 'root'";
|
cout << endl << " <type> can be 'ascii', 'root'";
|
||||||
@ -467,7 +467,7 @@ int main(int argc, char *argv[])
|
|||||||
// check syntax
|
// check syntax
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
if (!strcmp(argv[1], "--version")) {
|
if (!strcmp(argv[1], "--version")) {
|
||||||
cout << endl << "msrfit version: $Id$";
|
cout << endl << "musrfit version: $Id$";
|
||||||
cout << endl << endl;
|
cout << endl << endl;
|
||||||
return PMUSR_SUCCESS;
|
return PMUSR_SUCCESS;
|
||||||
} else if (!strcmp(argv[1], "--help")) {
|
} else if (!strcmp(argv[1], "--help")) {
|
||||||
|
108
src/musrview.cpp
Normal file
108
src/musrview.cpp
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
|
||||||
|
musrview.cpp
|
||||||
|
|
||||||
|
Author: Andreas Suter
|
||||||
|
e-mail: andreas.suter@psi.ch
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* Copyright (C) 2007 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 <iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
#include <TApplication.h>
|
||||||
|
|
||||||
|
#include "PMusr.h"
|
||||||
|
#include "PMusrCanvas.h"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void musrview_syntax()
|
||||||
|
{
|
||||||
|
cout << endl << "usage: musrview <msr-file> | --version | --help";
|
||||||
|
cout << endl << " <msr-file>: msr input file";
|
||||||
|
cout << endl << " 'musrview <msr-file>' will execute msrfit";
|
||||||
|
cout << endl << " 'musrview' or 'msrfit --help' will show this help";
|
||||||
|
cout << endl << " 'musrview --version' will print the msrfit version";
|
||||||
|
cout << endl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
bool show_syntax = false;
|
||||||
|
|
||||||
|
switch (argc) {
|
||||||
|
case 1:
|
||||||
|
show_syntax = true;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (strstr(argv[1], "--version")) {
|
||||||
|
cout << endl << "musrview version: $Id$";
|
||||||
|
cout << endl << endl;
|
||||||
|
return PMUSR_SUCCESS;
|
||||||
|
} else if (strstr(argv[1], "--help")) {
|
||||||
|
show_syntax = true;
|
||||||
|
} else {
|
||||||
|
// check if filename has extension msr
|
||||||
|
if (!strstr(argv[1], ".msr")) {
|
||||||
|
cout << endl << "ERROR: " << argv[1] << " is not a msr-file!" << endl;
|
||||||
|
show_syntax = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
show_syntax = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (show_syntax) {
|
||||||
|
musrview_syntax();
|
||||||
|
return PMUSR_WRONG_STARTUP_SYNTAX;
|
||||||
|
}
|
||||||
|
|
||||||
|
TApplication app("App", &argc, argv);
|
||||||
|
|
||||||
|
PMusrCanvas *musrCanvas = new PMusrCanvas("musr canvas dummy", 10, 10, 800, 600);
|
||||||
|
if (!musrCanvas->IsValid()) {
|
||||||
|
cout << endl << "**SEVERE ERROR** Couldn't invoke all necessary objects, will quit.";
|
||||||
|
cout << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
musrCanvas->Connect("Done(Int_t)", "TApplication", &app, "Terminate(Int_t)");
|
||||||
|
|
||||||
|
app.Run();
|
||||||
|
|
||||||
|
// clean up
|
||||||
|
if (musrCanvas) {
|
||||||
|
delete musrCanvas;
|
||||||
|
musrCanvas = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -10,10 +10,10 @@ channels, 66601
|
|||||||
t0, 3300, 3300, 3300, 3300
|
t0, 3300, 3300, 3300, 3300
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# asym's
|
# asym's
|
||||||
asym, 0.26, 0.26, 0.26, 0.26
|
asym, 0.24, 0.24, 0.24, 0.24
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# phases in (°)
|
# phases in (°)
|
||||||
phase, 0.0, 90.0, 180.0, 270.0
|
phase, 10.0, 90.0, 170.0, 270.0
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# N0's
|
# N0's
|
||||||
N0, 110, 100, 102, 99
|
N0, 110, 100, 102, 99
|
||||||
|
Loading…
x
Reference in New Issue
Block a user