Commit 3f011dec authored by Vratislav Chudoba's avatar Vratislav Chudoba

Comments to some classes added.

parent b2df0db4
#include "AculCalib.h" #include "AculCalib.h"
ClassImp(AculCalib); //----------------------------------------------------------------------------
AculCalib::AculCalib() { AculCalib::AculCalib() {
//documentation example
printf("AculCalib::Default constructor called.\n"); printf("AculCalib::Default constructor called.\n");
Init(); Init();
} }
AculCalib::AculCalib(const char* parfile) { //----------------------------------------------------------------------------
/*AculCalib::AculCalib(const char* parfile) {
printf("AculCalib::Constructor called.\n"); printf("AculCalib::Constructor called.\n");
SetParFile(parfile); SetParFile(parfile);
Init(); Init();
} }*/
//----------------------------------------------------------------------------
AculCalib::~AculCalib() { AculCalib::~AculCalib() {
printf("AculCalib::Destructor called.\n"); printf("AculCalib::Destructor called.\n");
...@@ -26,17 +27,20 @@ AculCalib::~AculCalib() { ...@@ -26,17 +27,20 @@ AculCalib::~AculCalib() {
} }
//----------------------------------------------------------------------------
void AculCalib::Init() { void AculCalib::Init() {
fPars = 0; fPars = 0;
} }
//----------------------------------------------------------------------------
void AculCalib::SetParFile(const char* parfile) { void AculCalib::SetParFile(const char* parfile) {
fParFileName = parfile; fParFileName = parfile;
return; return;
} }
//----------------------------------------------------------------------------
void AculCalib::PrintParameters(const char* option) { void AculCalib::PrintParameters(const char* option) {
if (!fPars) { if (!fPars) {
cerr << "\"AculCalib::PrintParameters\" parameters were not initialized." << endl; cerr << "\"AculCalib::PrintParameters\" parameters were not initialized." << endl;
...@@ -46,6 +50,7 @@ void AculCalib::PrintParameters(const char* option) { ...@@ -46,6 +50,7 @@ void AculCalib::PrintParameters(const char* option) {
fPars->PrintParameters(option); fPars->PrintParameters(option);
} }
//----------------------------------------------------------------------------
void AculCalib::PrintCalibParameters() { void AculCalib::PrintCalibParameters() {
cout << "i\ta\t\b" << endl; cout << "i\ta\t\b" << endl;
for (Int_t i = 0; i<=(Int_t)fA.size(); i++) { for (Int_t i = 0; i<=(Int_t)fA.size(); i++) {
...@@ -53,6 +58,7 @@ void AculCalib::PrintCalibParameters() { ...@@ -53,6 +58,7 @@ void AculCalib::PrintCalibParameters() {
} }
} }
//----------------------------------------------------------------------------
Double_t AculCalib::GetA(Int_t i) { Double_t AculCalib::GetA(Int_t i) {
if (i >= (Int_t)fA.size()) //if i >= number of array element if (i >= (Int_t)fA.size()) //if i >= number of array element
{ {
...@@ -61,6 +67,7 @@ Double_t AculCalib::GetA(Int_t i) { ...@@ -61,6 +67,7 @@ Double_t AculCalib::GetA(Int_t i) {
return fA[i]; return fA[i];
} }
//----------------------------------------------------------------------------
Double_t AculCalib::GetB(Int_t i) { Double_t AculCalib::GetB(Int_t i) {
if (i >= (Int_t)fB.size()) //if i >= number of array element if (i >= (Int_t)fB.size()) //if i >= number of array element
{ {
...@@ -69,6 +76,7 @@ Double_t AculCalib::GetB(Int_t i) { ...@@ -69,6 +76,7 @@ Double_t AculCalib::GetB(Int_t i) {
return fB[i]; return fB[i];
} }
//----------------------------------------------------------------------------
void AculCalib::CanDivider(TCanvas *c, Int_t noPads, Int_t columns, Int_t rows) { void AculCalib::CanDivider(TCanvas *c, Int_t noPads, Int_t columns, Int_t rows) {
c->Clear(); c->Clear();
...@@ -83,3 +91,6 @@ void AculCalib::CanDivider(TCanvas *c, Int_t noPads, Int_t columns, Int_t rows) ...@@ -83,3 +91,6 @@ void AculCalib::CanDivider(TCanvas *c, Int_t noPads, Int_t columns, Int_t rows)
return; return;
} }
} }
//----------------------------------------------------------------------------
ClassImp(AculCalib);
////////////////////////////////////////////////////////////////
// //
// TMyClass //
// //
// This is the description block. //
// //
////////////////////////////////////////////////////////////////
#ifndef ACULCALIB_ACULCALIB_H_ #ifndef ACULCALIB_ACULCALIB_H_
#define ACULCALIB_ACULCALIB_H_ #define ACULCALIB_ACULCALIB_H_
...@@ -19,18 +27,18 @@ using std::cerr; ...@@ -19,18 +27,18 @@ using std::cerr;
class AculCalib { class AculCalib {
protected: protected:
//essential vector<Double_t> fA; //calibration parameter A
vector<Double_t> fA; vector<Double_t> fB; //calibration parameter A
vector<Double_t> fB;
TString fParFileName; TString fParFileName; //name of file with parameters
AculCalPars *fPars; AculCalPars *fPars; //parameters used for calibration
public: public:
//essential //Default constructor.
AculCalib(); AculCalib();
AculCalib(const char* parfile);
//Destructor.
virtual ~AculCalib(); virtual ~AculCalib();
ClassDef(AculCalib,1); ClassDef(AculCalib,1);
...@@ -39,16 +47,19 @@ public: ...@@ -39,16 +47,19 @@ public:
void SetParFile(const char* parfile); void SetParFile(const char* parfile);
const char* GetParFileName() {return fParFileName.Data();} const char* GetParFileName() {return fParFileName.Data();}
//Print parameters used for calibration.
void PrintParameters(const char* option = ""); void PrintParameters(const char* option = "");
//Print calibration parameters.
void PrintCalibParameters(); void PrintCalibParameters();
//Get calibration parameter A.
Double_t GetA(Int_t i); Double_t GetA(Int_t i);
//Get calibration parameter B.
Double_t GetB(Int_t i); Double_t GetB(Int_t i);
protected: protected:
//essential
void CanDivider(TCanvas *c, Int_t noPads, Int_t columns = 0, Int_t rows = 0); void CanDivider(TCanvas *c, Int_t noPads, Int_t columns = 0, Int_t rows = 0);
}; };
#endif /* ACULCALIB_ACULCALIB_H_ */ #endif
//////////////////////////////////////////////////////////////////////////////
// //
// 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 #pragma once
//#include "TObject.h" //#include "TObject.h"
...@@ -25,7 +77,7 @@ class AculCalibScint : public AculCalib { ...@@ -25,7 +77,7 @@ class AculCalibScint : public AculCalib {
private: private:
// //
//todo delete this strange double array somewhere //todo delete this strange double array somewhere
TFile **fInFiles; TFile **fInFiles; //doc of class member
TTree **fTrees; TTree **fTrees;
TFile *fCutFile; TFile *fCutFile;
...@@ -33,7 +85,7 @@ private: ...@@ -33,7 +85,7 @@ private:
vector< vector<TH1I*> > fHistFull; vector< vector<TH1I*> > fHistFull;
vector< vector<TH1I*> > fHistCut; vector< vector<TH1I*> > fHistCut;
// //
vector< vector<Double_t> > fMeanPeakPos; vector< vector<Double_t> > fMeanPeakPos; //doc of class member
vector< vector<Double_t> > fMeanPeakRMS; vector< vector<Double_t> > fMeanPeakRMS;
// //
//todo make vector of graphs //todo make vector of graphs
...@@ -41,25 +93,26 @@ private: ...@@ -41,25 +93,26 @@ private:
// TFile *fGraphs; // TFile *fGraphs;
public: public:
// AculCalibScint() : a(0), b(0), c(0), p(0){};
AculCalibScint(); AculCalibScint();
//default constructor
AculCalibScint(const char* parfile); AculCalibScint(const char* parfile);
virtual ~AculCalibScint(); virtual ~AculCalibScint();
// Define the class for the cint dictionary ClassDef (AculCalibScint,1); //decription right after ClassDef
ClassDef (AculCalibScint,1);
virtual void Init(); virtual void Init();
// void SetParFile(const char* parfile);
void PrintTrees(); 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); 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 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 Calibrate(TCanvas *canvas, Bool_t savefile = 0, const char* filename = "", const char* option = "READ");
void WriteClbParameters(const char* filename); void WriteClbParameters(const char* filename);
......
#include "THtml.h"
void htmldoc()
{ {
gSystem->Load("./libAculData.so");
gSystem->Load("./libTELoss.so"); gSystem->Load("./libTELoss.so");
gSystem->Load("./libAculCalib.so");
gSystem->Load("./libAculData.so");
THtml h; THtml h;
h.SetInputDir("."); h.SetInputDir(".");
h.SetOutputDir("htmldoc");
h.SetProductName("AculUtils");
h.MakeAll(); h.MakeAll();
......
...@@ -40,7 +40,11 @@ all: libAculData.so \ ...@@ -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 #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 htmldoc: libAculData.so libAculCalib.so libTELoss.so
-$(RM) htmldoc -$(RM) htmldoc
root -l -q html.cxx root -l -q htmldoc.cxx
clean_htmldoc:
-$(RM) htmldoc
-@echo ' '
clean: clean:
-$(RM) $(ACULDATAOBJS) $(ACULDATACPP_DEPS) -$(RM) $(ACULDATAOBJS) $(ACULDATACPP_DEPS)
......
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