Commit c1566d0a authored by Vratislav Chudoba's avatar Vratislav Chudoba

Very beginning of new class for calibration of Si detectors added.

Some cosmetic changes in Acul*Scint classes.
parent 51b9c968
...@@ -33,3 +33,8 @@ void AculCalPars::SetParFile(const char* parfile) { ...@@ -33,3 +33,8 @@ void AculCalPars::SetParFile(const char* parfile) {
fParFileName = parfile; fParFileName = parfile;
return; return;
} }
void AculCalPars::Reset() {
fParFileName = "";
fEtab.clear();
}
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "TCutG.h" #include "TCutG.h"
using std::cout; using std::cout;
using std::cerr;
using std::endl; using std::endl;
using std::vector; using std::vector;
...@@ -27,26 +28,11 @@ protected: ...@@ -27,26 +28,11 @@ protected:
//general //general
TString fParFileName; TString fParFileName;
vector<Double_t> fEtab; //energy which will be used for calibration
//todo energies used for calibration should be in this class //todo energies used for calibration should be in this class
//CsI parameters
// Int_t fNoCrystals;
//
// TString fDetName;
//
// Int_t fNoFiles;
// vector<TString> fFileName;
//
// Int_t fEnergyPoints;
// TArrayD fE;
//
//Si parameteres
//first
//second
//others
public: public:
AculCalPars(); AculCalPars();
...@@ -77,7 +63,7 @@ public: ...@@ -77,7 +63,7 @@ public:
void SetParFile(const char* parfile); void SetParFile(const char* parfile);
virtual void PrintParameters(const char* option = "") {}; virtual void PrintParameters(const char* option = "") {};
virtual void Reset() {}; virtual void Reset();
protected: protected:
virtual void SetPars() {}; virtual void SetPars() {};
......
...@@ -37,6 +37,7 @@ public: ...@@ -37,6 +37,7 @@ public:
virtual void Init(); virtual void Init();
void SetParFile(const char* parfile); void SetParFile(const char* parfile);
const char* GetParFileName() {return fParFileName.Data();}
void PrintParameters(const char* option = ""); void PrintParameters(const char* option = "");
void PrintCalibParameters(); void PrintCalibParameters();
......
...@@ -8,31 +8,39 @@ ACULCALIBLIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMat ...@@ -8,31 +8,39 @@ ACULCALIBLIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMat
ACULCALIB_HEADERS += \ ACULCALIB_HEADERS += \
$(ACULCALIB)/AculCalib.h \ $(ACULCALIB)/AculCalib.h \
$(ACULCALIB)/AculCalibScint.h \ $(ACULCALIB)/AculCalibScint.h \
$(ACULCALIB)/AculCalibSi.h \
$(ACULCALIB)/AculCalPars.h \ $(ACULCALIB)/AculCalPars.h \
$(ACULCALIB)/AculCalParsScint.h \ $(ACULCALIB)/AculCalParsScint.h \
$(ACULCALIB)/AculCalParsScintFile.h \ $(ACULCALIB)/AculCalParsScintFile.h \
$(ACULCALIB)/AculCalParsSi.h \
$(ACULCALIB)/linkdef.h $(ACULCALIB)/linkdef.h
ACULCALIBCPP_SRCS += \ ACULCALIBCPP_SRCS += \
$(ACULCALIB)/AculCalib.cpp \ $(ACULCALIB)/AculCalib.cpp \
$(ACULCALIB)/AculCalibScint.cpp \ $(ACULCALIB)/AculCalibScint.cpp \
$(ACULCALIB)/AculCalibSi.cpp \
$(ACULCALIB)/AculCalPars.cpp \ $(ACULCALIB)/AculCalPars.cpp \
$(ACULCALIB)/AculCalParsScint.cpp \ $(ACULCALIB)/AculCalParsScint.cpp \
$(ACULCALIB)/AculCalParsScintFile.cpp \ $(ACULCALIB)/AculCalParsScintFile.cpp \
$(ACULCALIB)/AculCalParsSi.cpp \
$(ACULCALIB)/AculCalibCint.cpp $(ACULCALIB)/AculCalibCint.cpp
ACULCALIBOBJS += \ ACULCALIBOBJS += \
$(ACULCALIB)/AculCalib.o \ $(ACULCALIB)/AculCalib.o \
$(ACULCALIB)/AculCalibScint.o \ $(ACULCALIB)/AculCalibScint.o \
$(ACULCALIB)/AculCalibSi.o \
$(ACULCALIB)/AculCalPars.o \ $(ACULCALIB)/AculCalPars.o \
$(ACULCALIB)/AculCalParsScint.o \ $(ACULCALIB)/AculCalParsScint.o \
$(ACULCALIB)/AculCalParsScintFile.o \ $(ACULCALIB)/AculCalParsScintFile.o \
$(ACULCALIB)/AculCalParsSi.o \
$(ACULCALIB)/AculCalibCint.o $(ACULCALIB)/AculCalibCint.o
ACULCALIBCPP_DEPS += \ ACULCALIBCPP_DEPS += \
$(ACULCALIB)/AculCalib.d \ $(ACULCALIB)/AculCalib.d \
$(ACULCALIB)/AculCalibScint.d \ $(ACULCALIB)/AculCalibScint.d \
$(ACULCALIB)/AculCalibSi.d \
$(ACULCALIB)/AculCalPars.d \ $(ACULCALIB)/AculCalPars.d \
$(ACULCALIB)/AculCalParsScint.d \ $(ACULCALIB)/AculCalParsScint.d \
$(ACULCALIB)/AculCalParsScintFile.d \ $(ACULCALIB)/AculCalParsScintFile.d \
$(ACULCALIB)/AculCalParsSi.d \
$(ACULCALIB)/AculCalibCint.d $(ACULCALIB)/AculCalibCint.d
\ No newline at end of file
/*
* AculCalibSi.cpp
*
* Created on: Oct 26, 2016
* Author: vratik
*/
#include "AculCalibSi.h"
#include "AculCalParsSi.h"
ClassImp(AculCalibSi);
AculCalibSi::AculCalibSi() {
printf("AculCalibScint::Default constructor called.\n");
// fInFiles = 0;
// fTrees = 0;
// fCutFile = 0;
}
AculCalibSi::AculCalibSi(const char* parfile) {
printf("AculCalibScint::Constructor called.\n");
SetParFile(parfile);
Init();
}
AculCalibSi::~AculCalibSi() {
printf("AculCalibScint::Destructor called.\n");
}
void AculCalibSi::Init() {
fPars = new AculCalParsSi(fParFileName.Data());
}
/*
* AculCalibSi.h
*
* Created on: Oct 26, 2016
* Author: vratik
*/
#ifndef ACULCALIB_ACULCALIBSI_H_
#define ACULCALIB_ACULCALIBSI_H_
#include "AculCalib.h"
class AculCalibSi: public AculCalib {
private:
// Double_t something;
public:
AculCalibSi();
AculCalibSi(const char* parfile);
virtual ~AculCalibSi();
ClassDef(AculCalibSi, 1);
void Init();
// Bool_t CalculateCalibParameters(const char* inputfile, const char* block,
// const char* treename, Int_t lowerchannel = 0,
// Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0,
// Int_t uppersubaddress = ADDRESSNUMBER-1); //calculate calibration parameters for given block in given file
//function is not completely ready to use
//
//function for calculation of calibrate parameters for DAQ system based on "Go4"
//
// inputfile: root file with calibration spectra
// block: block name to be calibrated
// lowerchannel: minimal channel from which the spectrum will be analysed
// upperchannel: maximal channel up to which the spectrum will be analysed
// lowersubaddress: block subaddress
// uppersubaddress: block subbaddress
};
#endif /* ACULCALIB_ACULCALIBSI_H_ */
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
//#pragma link C++ class AculConvert; //#pragma link C++ class AculConvert;
#pragma link C++ class AculCalib; #pragma link C++ class AculCalib;
#pragma link C++ class AculCalibScint; #pragma link C++ class AculCalibScint;
#pragma link C++ class AculCalibSi;
#pragma link C++ class AculCalPars; #pragma link C++ class AculCalPars;
#pragma link C++ class AculCalParsScint; #pragma link C++ class AculCalParsScint;
#pragma link C++ class AculCalParsScintFile; #pragma link C++ class AculCalParsScintFile;
#pragma link C++ class AculCalParsSi;
#endif #endif
...@@ -2,6 +2,7 @@ energies 4 #number of energy points ...@@ -2,6 +2,7 @@ energies 4 #number of energy points
crystals 16 #number of crystals in detector crystals 16 #number of crystals in detector
files 4 files 4
#fileID fileName #fileID fileName
#fileID not implemented yet
data/csi_13_Ealpha16.root data/csi_13_Ealpha16.root
data/csi_13_Ealpha21.root data/csi_13_Ealpha21.root
data/csi_13_Ealpha26.root data/csi_13_Ealpha26.root
......
//#include "../../AculCalib/AculCalPars.h" //#include "../../AculCalib/AculCalPars.h"
//#include "../../AculCalib/AculCalibScint.h" //#include "../../AculCalib/AculCalibScint.h"
//#include "../../AculCalib/AculCalibSi.h"
//#include "TSystem.h" //#include "TSystem.h"
//#include <iostream> //#include <iostream>
// //
...@@ -8,11 +9,19 @@ using std::endl; ...@@ -8,11 +9,19 @@ using std::endl;
void parTest() void parTest()
{ {
gSystem->Load("../../libTELoss.so");
gSystem->Load("../../libAculCalib.so"); gSystem->Load("../../libAculCalib.so");
AculCalParsScintFile pp; /* AculCalibSi ps;
pp.SetNoCrystals(16); ps.SetParFile("parforcal.par");
pp.Init(); ps.Init();
ps.PrintParameters();
return;
*/
// AculCalParsScintFile pp;
// pp.SetNoCrystals(16);
// pp.Init();
// return; // return;
cout << "-----------------------" << endl; cout << "-----------------------" << endl;
...@@ -31,10 +40,13 @@ void parTest() ...@@ -31,10 +40,13 @@ void parTest()
p.PrintParameters(""); p.PrintParameters("");
// return; // return;
cout << "-----------------------" << endl;
AculCalibScint c; AculCalibScint c;
c.SetParFile("SQ13Alpha.par"); c.SetParFile("SQ13Alpha.par");
c.Init(); c.Init();
// return; c.PrintParameters();
return;
// c.PrintParameters("all"); // c.PrintParameters("all");
......
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