From 3f011decf658723722732eeddaee00b4e35d4810 Mon Sep 17 00:00:00 2001 From: Vratislav Chudoba Date: Wed, 2 Nov 2016 18:07:14 +0300 Subject: [PATCH] Comments to some classes added. --- AculCalib/AculCalib.cpp | 21 ++++++++--- AculCalib/AculCalib.h | 29 ++++++++++----- AculCalib/AculCalibScint.h | 73 ++++++++++++++++++++++++++++++++------ html.cxx | 11 ------ htmldoc.cxx | 18 ++++++++++ makefile | 6 +++- 6 files changed, 122 insertions(+), 36 deletions(-) delete mode 100755 html.cxx create mode 100755 htmldoc.cxx diff --git a/AculCalib/AculCalib.cpp b/AculCalib/AculCalib.cpp index 0773c1f..16b9147 100644 --- a/AculCalib/AculCalib.cpp +++ b/AculCalib/AculCalib.cpp @@ -1,23 +1,24 @@ #include "AculCalib.h" -ClassImp(AculCalib); - +//---------------------------------------------------------------------------- AculCalib::AculCalib() { - +//documentation example printf("AculCalib::Default constructor called.\n"); Init(); } -AculCalib::AculCalib(const char* parfile) { +//---------------------------------------------------------------------------- +/*AculCalib::AculCalib(const char* parfile) { printf("AculCalib::Constructor called.\n"); SetParFile(parfile); Init(); -} +}*/ +//---------------------------------------------------------------------------- AculCalib::~AculCalib() { printf("AculCalib::Destructor called.\n"); @@ -26,17 +27,20 @@ AculCalib::~AculCalib() { } +//---------------------------------------------------------------------------- void AculCalib::Init() { fPars = 0; } +//---------------------------------------------------------------------------- void AculCalib::SetParFile(const char* parfile) { fParFileName = parfile; return; } +//---------------------------------------------------------------------------- void AculCalib::PrintParameters(const char* option) { if (!fPars) { cerr << "\"AculCalib::PrintParameters\" parameters were not initialized." << endl; @@ -46,6 +50,7 @@ void AculCalib::PrintParameters(const char* option) { fPars->PrintParameters(option); } +//---------------------------------------------------------------------------- void AculCalib::PrintCalibParameters() { cout << "i\ta\t\b" << endl; for (Int_t i = 0; i<=(Int_t)fA.size(); i++) { @@ -53,6 +58,7 @@ void AculCalib::PrintCalibParameters() { } } +//---------------------------------------------------------------------------- Double_t AculCalib::GetA(Int_t i) { if (i >= (Int_t)fA.size()) //if i >= number of array element { @@ -61,6 +67,7 @@ Double_t AculCalib::GetA(Int_t i) { return fA[i]; } +//---------------------------------------------------------------------------- Double_t AculCalib::GetB(Int_t i) { if (i >= (Int_t)fB.size()) //if i >= number of array element { @@ -69,6 +76,7 @@ Double_t AculCalib::GetB(Int_t i) { return fB[i]; } +//---------------------------------------------------------------------------- void AculCalib::CanDivider(TCanvas *c, Int_t noPads, Int_t columns, Int_t rows) { c->Clear(); @@ -83,3 +91,6 @@ void AculCalib::CanDivider(TCanvas *c, Int_t noPads, Int_t columns, Int_t rows) return; } } + +//---------------------------------------------------------------------------- +ClassImp(AculCalib); diff --git a/AculCalib/AculCalib.h b/AculCalib/AculCalib.h index aa093a0..782b510 100644 --- a/AculCalib/AculCalib.h +++ b/AculCalib/AculCalib.h @@ -1,3 +1,11 @@ +//////////////////////////////////////////////////////////////// +// // +// TMyClass // +// // +// This is the description block. // +// // +//////////////////////////////////////////////////////////////// + #ifndef ACULCALIB_ACULCALIB_H_ #define ACULCALIB_ACULCALIB_H_ @@ -19,18 +27,18 @@ using std::cerr; class AculCalib { protected: -//essential - vector fA; - vector fB; + vector fA; //calibration parameter A + vector fB; //calibration parameter A - TString fParFileName; + TString fParFileName; //name of file with parameters - AculCalPars *fPars; + AculCalPars *fPars; //parameters used for calibration public: -//essential + //Default constructor. AculCalib(); - AculCalib(const char* parfile); + + //Destructor. virtual ~AculCalib(); ClassDef(AculCalib,1); @@ -39,16 +47,19 @@ public: void SetParFile(const char* parfile); const char* GetParFileName() {return fParFileName.Data();} + //Print parameters used for calibration. void PrintParameters(const char* option = ""); + //Print calibration parameters. void PrintCalibParameters(); + //Get calibration parameter A. Double_t GetA(Int_t i); + //Get calibration parameter B. Double_t GetB(Int_t i); protected: -//essential void CanDivider(TCanvas *c, Int_t noPads, Int_t columns = 0, Int_t rows = 0); }; -#endif /* ACULCALIB_ACULCALIB_H_ */ +#endif diff --git a/AculCalib/AculCalibScint.h b/AculCalib/AculCalibScint.h index 580e0eb..6e3da7b 100644 --- a/AculCalib/AculCalibScint.h +++ b/AculCalib/AculCalibScint.h @@ -1,3 +1,55 @@ +////////////////////////////////////////////////////////////////////////////// +// // +// This class is intended for ... // +// // +// It work like this... User may use such functions ... in such steps. // +// +// Keywords in parameter file and possible comments +// +// Something about order of keywords +// +// Example of parameter file (with explanations) +// +// 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 +// data/csi_13_Ealpha30.root +// #keyword detector particle +// detector SQ13 Alpha +// #keyword energy [MeV/A] +// energy 66.542 +// #keyword; filename; number of cuts in file +// cutFile cuts/cutsSQ13Alpha.root 2 +// cutsSQ13Alpha16 +// cutSQ13Alpha16Amp +// #channel minimum maximum +// 0 650 830 +// 1 920 1150 +//\ ... +// 15 800 1000 +// #CsI2, energy ~ 21 MeV/A, Alpha +// energy 85.437 +// #keyword; filename; number of cuts in file +// cutFile cuts/cutsSQ13Alpha.root 2 +// cutSQ13Alpha21 +// cutSQ13Alpha21Amp +// #channel minimum maximum +// 0 1050 1200 +//\ \... +// 15 1150 1350 +// #CsI2, energy ~ 26 MeV/A, Alpha +// energy 105.5 +// ... +// +//asdasd +////////////////////////////////////////////////////////////////////////////// + + #pragma once //#include "TObject.h" @@ -25,7 +77,7 @@ class AculCalibScint : public AculCalib { private: // //todo delete this strange double array somewhere - TFile **fInFiles; + TFile **fInFiles; //doc of class member TTree **fTrees; TFile *fCutFile; @@ -33,7 +85,7 @@ private: vector< vector > fHistFull; vector< vector > fHistCut; // - vector< vector > fMeanPeakPos; + vector< vector > fMeanPeakPos; //doc of class member vector< vector > fMeanPeakRMS; // //todo make vector of graphs @@ -41,25 +93,26 @@ private: // TFile *fGraphs; public: -// AculCalibScint() : a(0), b(0), c(0), p(0){}; AculCalibScint(); + //default constructor + AculCalibScint(const char* parfile); virtual ~AculCalibScint(); - // Define the class for the cint dictionary - ClassDef (AculCalibScint,1); + ClassDef (AculCalibScint,1); //decription right after ClassDef virtual void Init(); -// void SetParFile(const char* parfile); - void PrintTrees(); -// void PrintParameters(const char* option = ""); -// void PrintPeakRanges(); + //Description of the function. I think it does not work. void DrawVariable(const char* variable, Int_t treeID, TCanvas *canvas, Int_t lowRange = 0, Int_t upRange = 4096); + + //Description of the function. I think it does not work. void DrawBeam(TCanvas *canvas, Int_t file, const char* variable); - void GetPeakMean(const char* variable, Int_t treeID, /*Int_t energy,*/ TCanvas *canvas, const char* beamcut, const Int_t nbins = 4096, Int_t lowRange = 0); + //One of the crucial function. It founds the mean of the peak related to our particle. + void GetPeakMean(const char* variable, Int_t treeID, TCanvas *canvas, + const char* beamcut, const Int_t nbins = 4096, Int_t lowRange = 0); void Calibrate(TCanvas *canvas, Bool_t savefile = 0, const char* filename = "", const char* option = "READ"); void WriteClbParameters(const char* filename); diff --git a/html.cxx b/html.cxx deleted file mode 100755 index acc65a4..0000000 --- a/html.cxx +++ /dev/null @@ -1,11 +0,0 @@ -{ - gSystem->Load("./libAculData.so"); - gSystem->Load("./libTELoss.so"); - - THtml h; - - h.SetInputDir("."); - - h.MakeAll(); - -} diff --git a/htmldoc.cxx b/htmldoc.cxx new file mode 100755 index 0000000..354a523 --- /dev/null +++ b/htmldoc.cxx @@ -0,0 +1,18 @@ +#include "THtml.h" + +void htmldoc() +{ + gSystem->Load("./libTELoss.so"); + gSystem->Load("./libAculCalib.so"); + gSystem->Load("./libAculData.so"); + + THtml h; + + h.SetInputDir("."); + h.SetOutputDir("htmldoc"); + h.SetProductName("AculUtils"); + + + h.MakeAll(); + +} diff --git a/makefile b/makefile index f42f9b5..aaea1ba 100755 --- a/makefile +++ b/makefile @@ -40,7 +40,11 @@ all: libAculData.so \ #ROOT html documentation, it will be done as a program which will be alsa compiled by this makefile, program will be as a last condition after all of the libraries htmldoc: libAculData.so libAculCalib.so libTELoss.so -$(RM) htmldoc - root -l -q html.cxx + root -l -q htmldoc.cxx + +clean_htmldoc: + -$(RM) htmldoc + -@echo ' ' clean: -$(RM) $(ACULDATAOBJS) $(ACULDATACPP_DEPS) -- 2.18.1