diff --git a/AculCalib/AculCalPars.cpp b/AculCalib/AculCalPars.cpp index 5b48ab7103e652b0cc7ea155e6837a5a3e1b4ca9..fcce0a249252c59591628e37c02fcd128e72a09f 100644 --- a/AculCalib/AculCalPars.cpp +++ b/AculCalib/AculCalPars.cpp @@ -33,3 +33,8 @@ void AculCalPars::SetParFile(const char* parfile) { fParFileName = parfile; return; } + +void AculCalPars::Reset() { + fParFileName = ""; + fEtab.clear(); +} diff --git a/AculCalib/AculCalPars.h b/AculCalib/AculCalPars.h index 4ed59ee75c93724877a5de968e85d66d2fd4c410..f98b7eb6e4970e2779db8ba93697915ee9b7209e 100644 --- a/AculCalib/AculCalPars.h +++ b/AculCalib/AculCalPars.h @@ -18,6 +18,7 @@ #include "TCutG.h" using std::cout; +using std::cerr; using std::endl; using std::vector; @@ -27,26 +28,11 @@ protected: //general TString fParFileName; - + vector fEtab; //energy which will be used for calibration //todo energies used for calibration should be in this class -//CsI parameters -// Int_t fNoCrystals; -// -// TString fDetName; -// -// Int_t fNoFiles; -// vector fFileName; -// -// Int_t fEnergyPoints; -// TArrayD fE; -// - -//Si parameteres - //first - //second - //others + public: AculCalPars(); @@ -77,7 +63,7 @@ public: void SetParFile(const char* parfile); virtual void PrintParameters(const char* option = "") {}; - virtual void Reset() {}; + virtual void Reset(); protected: virtual void SetPars() {}; diff --git a/AculCalib/AculCalib.h b/AculCalib/AculCalib.h index 4a771ed49cfe83a7946b4aaa827bc5f07e73c350..aa093a0b8c99c9f24f2c7c414d58bb9cbee3bb6c 100644 --- a/AculCalib/AculCalib.h +++ b/AculCalib/AculCalib.h @@ -37,6 +37,7 @@ public: virtual void Init(); void SetParFile(const char* parfile); + const char* GetParFileName() {return fParFileName.Data();} void PrintParameters(const char* option = ""); void PrintCalibParameters(); diff --git a/AculCalib/AculCalib.mk b/AculCalib/AculCalib.mk index 46a76cbe83f634a43e9e05e6f7502f8440e53dcc..290cb589e0ef667929f9c95253cb79472da6ffa4 100755 --- a/AculCalib/AculCalib.mk +++ b/AculCalib/AculCalib.mk @@ -8,31 +8,39 @@ ACULCALIBLIBS := -lCore -lCint -lRIO -lTree -lNet -lThread -lHist -lMatrix -lMat ACULCALIB_HEADERS += \ $(ACULCALIB)/AculCalib.h \ $(ACULCALIB)/AculCalibScint.h \ +$(ACULCALIB)/AculCalibSi.h \ $(ACULCALIB)/AculCalPars.h \ $(ACULCALIB)/AculCalParsScint.h \ $(ACULCALIB)/AculCalParsScintFile.h \ +$(ACULCALIB)/AculCalParsSi.h \ $(ACULCALIB)/linkdef.h ACULCALIBCPP_SRCS += \ $(ACULCALIB)/AculCalib.cpp \ $(ACULCALIB)/AculCalibScint.cpp \ +$(ACULCALIB)/AculCalibSi.cpp \ $(ACULCALIB)/AculCalPars.cpp \ $(ACULCALIB)/AculCalParsScint.cpp \ $(ACULCALIB)/AculCalParsScintFile.cpp \ +$(ACULCALIB)/AculCalParsSi.cpp \ $(ACULCALIB)/AculCalibCint.cpp ACULCALIBOBJS += \ $(ACULCALIB)/AculCalib.o \ $(ACULCALIB)/AculCalibScint.o \ +$(ACULCALIB)/AculCalibSi.o \ $(ACULCALIB)/AculCalPars.o \ $(ACULCALIB)/AculCalParsScint.o \ $(ACULCALIB)/AculCalParsScintFile.o \ +$(ACULCALIB)/AculCalParsSi.o \ $(ACULCALIB)/AculCalibCint.o ACULCALIBCPP_DEPS += \ $(ACULCALIB)/AculCalib.d \ $(ACULCALIB)/AculCalibScint.d \ +$(ACULCALIB)/AculCalibSi.d \ $(ACULCALIB)/AculCalPars.d \ $(ACULCALIB)/AculCalParsScint.d \ $(ACULCALIB)/AculCalParsScintFile.d \ +$(ACULCALIB)/AculCalParsSi.d \ $(ACULCALIB)/AculCalibCint.d \ No newline at end of file diff --git a/AculCalib/AculCalibSi.cpp b/AculCalib/AculCalibSi.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0ffbc6f6a0681d28007695ba76d76a2d70159d57 --- /dev/null +++ b/AculCalib/AculCalibSi.cpp @@ -0,0 +1,35 @@ +/* + * 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()); +} diff --git a/AculCalib/AculCalibSi.h b/AculCalib/AculCalibSi.h new file mode 100644 index 0000000000000000000000000000000000000000..7db4e3e3c763bed4f566784459f1922cf2daf06c --- /dev/null +++ b/AculCalib/AculCalibSi.h @@ -0,0 +1,44 @@ +/* + * 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_ */ diff --git a/AculCalib/linkdef.h b/AculCalib/linkdef.h index 9743125beff81bfc93ca8a0fa935bbb0b5c0672a..b444014dde9dbceef9bc0c0310cf8ed1bbdacd8e 100755 --- a/AculCalib/linkdef.h +++ b/AculCalib/linkdef.h @@ -7,9 +7,11 @@ //#pragma link C++ class AculConvert; #pragma link C++ class AculCalib; #pragma link C++ class AculCalibScint; +#pragma link C++ class AculCalibSi; #pragma link C++ class AculCalPars; #pragma link C++ class AculCalParsScint; #pragma link C++ class AculCalParsScintFile; +#pragma link C++ class AculCalParsSi; #endif diff --git a/macros/myMacros/SQ13Alpha.par b/macros/myMacros/SQ13Alpha.par index de6e14e3540e88d64d3228423dee0f70ea938e2a..96df96a0d62f80f0886d2d6eb5bbcd09dae751c4 100644 --- a/macros/myMacros/SQ13Alpha.par +++ b/macros/myMacros/SQ13Alpha.par @@ -2,6 +2,7 @@ energies 4 #number of energy points crystals 16 #number of crystals in detector files 4 #fileID fileName +#fileID not implemented yet data/csi_13_Ealpha16.root data/csi_13_Ealpha21.root data/csi_13_Ealpha26.root diff --git a/macros/myMacros/parTest.cxx b/macros/myMacros/parTest.cxx index 5e0d20a6f63a612623f3c968cba64144693b272e..f87c60e705bcb90ee07ab63f781f51d0df15c710 100644 --- a/macros/myMacros/parTest.cxx +++ b/macros/myMacros/parTest.cxx @@ -1,5 +1,6 @@ //#include "../../AculCalib/AculCalPars.h" //#include "../../AculCalib/AculCalibScint.h" +//#include "../../AculCalib/AculCalibSi.h" //#include "TSystem.h" //#include // @@ -8,11 +9,19 @@ using std::endl; void parTest() { + gSystem->Load("../../libTELoss.so"); gSystem->Load("../../libAculCalib.so"); - AculCalParsScintFile pp; - pp.SetNoCrystals(16); - pp.Init(); +/* AculCalibSi ps; + ps.SetParFile("parforcal.par"); + ps.Init(); + ps.PrintParameters(); + return; +*/ + +// AculCalParsScintFile pp; +// pp.SetNoCrystals(16); +// pp.Init(); // return; cout << "-----------------------" << endl; @@ -31,10 +40,13 @@ void parTest() p.PrintParameters(""); // return; + cout << "-----------------------" << endl; + AculCalibScint c; c.SetParFile("SQ13Alpha.par"); c.Init(); -// return; + c.PrintParameters(); + return; // c.PrintParameters("all");