Commit 6c480de9 authored by Vratislav Chudoba's avatar Vratislav Chudoba

User interface was optimalized.

parent 6e1dd979
This diff is collapsed.
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <iomanip> #include <iomanip>
#include <sstream> #include <sstream>
#include "../TELoss/TELoss.h"
#define DEFAULTNOPEAKS 20 #define DEFAULTNOPEAKS 20
#define ADDRESSNUMBER 32 #define ADDRESSNUMBER 32
...@@ -44,9 +46,9 @@ public: ...@@ -44,9 +46,9 @@ public:
//???? - pocet nespravne zkalibrovanych spekter //???? - pocet nespravne zkalibrovanych spekter
//fEnergy[4] - tabulka s energiemi piku, nacita se zvenci //fEnergy[4] - tabulka s energiemi piku, nacita se zvenci
//private: private:
//todo: following variables should be deleted
// TObjArray *fHRawList; //list of raw histograms, list is set to owner // TObjArray *fHRawList; //list of raw histograms, list is set to owner
TObjArray fHRawList; //list of raw histograms, list is set to owner TObjArray fHRawList; //list of raw histograms, list is set to owner
TObjArray fHAnalyzedList; //list of fitted and analyzed histograms, list is set to owner TObjArray fHAnalyzedList; //list of fitted and analyzed histograms, list is set to owner
...@@ -74,20 +76,17 @@ public: ...@@ -74,20 +76,17 @@ public:
Double_t fFitMinSigma; //pouziva se, private Double_t fFitMinSigma; //pouziva se, private
Double_t fFitPeakThreshold; //pouziva se, private, prozkoumat, k cemu vlastne slouzi ve fci ShowPeaks, popremyslet o vhodnem prednastaveni v konstruktoru Double_t fFitPeakThreshold; //pouziva se, private, prozkoumat, k cemu vlastne slouzi ve fci ShowPeaks, popremyslet o vhodnem prednastaveni v konstruktoru
//these variables are the main for the class
// Double_t fAOld[BLOCKSNUMBER][ADDRESSNUMBER]; //calibration parameter, f(x) = fAOld*x + fBOld
// Double_t fBOld[BLOCKSNUMBER][ADDRESSNUMBER]; //calibration parameter, f(x) = fAOld*x + fBOld
// Double_t fC[BLOCKSNUMBER][ADDRESSNUMBER]; //treti kalibracni parametr, jine zavislosti nez pol1
// Double_t fD[BLOCKSNUMBER][ADDRESSNUMBER]; //ctvrty kalibracni parametr
private: private:
TArrayD fA; //these variables are the main for the class
TArrayD fB; TArrayD fA; //calibration parameter, f(x) = fA*x + fB
TArrayD fB; //calibration parameter, f(x) = fA*x + fB
// TArrayD fC; // TArrayD fC;
// TArrayD fD; // TArrayD fD;
TELoss fAlphaSi;
public: public:
//smysl je velmi pochybny //it is very doubtful that we need this class variable
TFile *fCalInformation; TFile *fCalInformation;
Double_t GetA(Int_t i); //to obtain calib parameter A Double_t GetA(Int_t i); //to obtain calib parameter A
...@@ -99,8 +98,11 @@ private: ...@@ -99,8 +98,11 @@ private:
public: public:
AculCalibration(); AculCalibration();
//default constructor //default constructor
AculCalibration(const char* parfile); // AculCalibration(const char* calfile); //
virtual ~AculCalibration(); virtual ~AculCalibration();
ClassDef(AculCalibration, 1);
void Init();
Bool_t SetInputParameters(const char* inputparfile = "parforcal.par"); Bool_t SetInputParameters(const char* inputparfile = "parforcal.par");
// Function which loads text file containing parameters for calibration // Function which loads text file containing parameters for calibration
...@@ -226,17 +228,19 @@ public: ...@@ -226,17 +228,19 @@ public:
//dodelat funkce TTree* Get...(...) pro raw, anal i E spectra //dodelat funkce TTree* Get...(...) pro raw, anal i E spectra
Bool_t AddCalFileToList(const char* calfilelist = "CalFileList.log");
// Bool_t AddCalFileToList(const char* calfilelist = "CalFileList.log");
void ClearHistograms(Option_t* option = ""); void ClearHistograms(Option_t* option = "");
void DeleteStacks(Option_t* option = ""); void DeleteStacks(Option_t* option = "");
void MakeCalibrationFile(Char_t* calibrationfile, Char_t* calfilelist); // void MakeCalibrationFile(Char_t* calibrationfile, Char_t* calfilelist);
void Reset(); void Reset();
//reset calibration parameters fA, fB to zero
//private: private:
void SetELosses();
ClassDef(AculCalibration, 1);
}; };
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# AculData input with some variables # AculData input with some variables
################################################################################ ################################################################################
ACULDATALIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMathCore -lGpad -lGraf -lSpectrum ACULDATALIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMathCore -lGpad -lGraf -lSpectrum -lTELoss
# Add inputs and outputs from these tool invocations to the build variables # Add inputs and outputs from these tool invocations to the build variables
ACULDATA_HEADERS += \ ACULDATA_HEADERS += \
......
{ {
gSystem->Load("/home/dariak/AculUtils/libAculData.so"); // gSystem->Load("/home/dariak/AculUtils/libAculData.so");
// gSystem->Load("/home/vratik/workspace/AculUtils/libAculData.so"); gSystem->Load("/home/vratik/workspace/AculUtils/libAculData.so");
AculCalibration cal; AculCalibration cal;
cal.SetInputParameters(); //from .par cal.SetInputParameters("../../parforcal.par"); //from .par
// cal.CalculateCalibParameters("clb08_0001.root", "SQ22", "AnalysisxTree", 100, 4095); // cal.CalculateCalibParameters("clb08_0001.root", "SQ22", "AnalysisxTree", 100, 4095);
cal.CalculateCalibParameters("clb08_0001.root", "SQ22", "AnalysisxTree", 100, 4095); cal.CalculateCalibParameters("../../clb_raw_files/clb08_0001.root", "SQ22", "AnalysisxTree", 100, 4095);
// CalculateCalibParameters(const char* inputfile, const char* block, const Int_t address, const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t uppersubaddress = ADDRESSNUMBER-1); // CalculateCalibParameters(const char* inputfile, const char* block, const Int_t address, const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t uppersubaddress = ADDRESSNUMBER-1);
TFile fr("SQ22[]E.root"); // TFile fr("SQ22[]E.root");
cout << fr.GetListOfKeys()->GetEntries() << " histograms" << endl; // cout << fr.GetListOfKeys()->GetEntries() << " histograms" << endl;
TList *histList = fr.GetListOfKeys(); // TList *histList = fr.GetListOfKeys();
TH1 *hWork = 0; // TH1 *hWork = 0;
for (Int_t i = 0; i < 32; i++) // for (Int_t i = 0; i < 32; i++)
{ // {
fr.GetObject(histList->At(i)->GetName(), hWork); // fr.GetObject(histList->At(i)->GetName(), hWork);
cal->PeaksFitting(hWork); // cal->PeaksFitting(hWork);
} // }
} }
...@@ -61,10 +61,10 @@ $(TELOSS)/TELossCint.cpp: ...@@ -61,10 +61,10 @@ $(TELOSS)/TELossCint.cpp:
-@echo ' ' -@echo ' '
#*.so files #*.so files
libAculData.so: $(ACULDATAOBJS) libAculData.so: libTELoss.so $(ACULDATAOBJS)
@echo 'Building target: $@' @echo 'Building target: $@'
@echo 'Invoking: GCC C++ Linker' @echo 'Invoking: GCC C++ Linker'
$(CC) -L $(ROOTLIBS) -shared -o"libAculData.so" $(ACULDATAOBJS) $(ACULDATALIBS) $(CC) -L . -L $(ROOTLIBS) -shared -o"libAculData.so" $(ACULDATAOBJS) $(ACULDATALIBS)
@echo 'Finished building target: $@' @echo 'Finished building target: $@'
@echo ' ' @echo ' '
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment