From c1566d0ad42951aafa5a0fb5db5640c96b6f6495 Mon Sep 17 00:00:00 2001 From: Vratislav Chudoba Date: Tue, 1 Nov 2016 13:20:03 +0300 Subject: [PATCH] Very beginning of new class for calibration of Si detectors added. Some cosmetic changes in Acul*Scint classes. --- AculCalib/AculCalPars.cpp | 5 ++++ AculCalib/AculCalPars.h | 22 ++++-------------- AculCalib/AculCalib.h | 1 + AculCalib/AculCalib.mk | 8 +++++++ AculCalib/AculCalibSi.cpp | 35 ++++++++++++++++++++++++++++ AculCalib/AculCalibSi.h | 44 +++++++++++++++++++++++++++++++++++ AculCalib/linkdef.h | 2 ++ macros/myMacros/SQ13Alpha.par | 1 + macros/myMacros/parTest.cxx | 20 ++++++++++++---- 9 files changed, 116 insertions(+), 22 deletions(-) create mode 100644 AculCalib/AculCalibSi.cpp create mode 100644 AculCalib/AculCalibSi.h diff --git a/AculCalib/AculCalPars.cpp b/AculCalib/AculCalPars.cpp index 5b48ab7..fcce0a2 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 4ed59ee..f98b7eb 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 4a771ed..aa093a0 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 46a76cb..290cb58 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 0000000..0ffbc6f --- /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 0000000..7db4e3e --- /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 9743125..b444014 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 de6e14e..96df96a 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 5e0d20a..f87c60e 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"); -- 2.18.1