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

Comments to some classes added.

parent b2df0db4
#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);
////////////////////////////////////////////////////////////////
// //
// 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<Double_t> fA;
vector<Double_t> fB;
vector<Double_t> fA; //calibration parameter A
vector<Double_t> 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
//////////////////////////////////////////////////////////////////////////////
// //
// 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<TH1I*> > fHistFull;
vector< vector<TH1I*> > fHistCut;
//
vector< vector<Double_t> > fMeanPeakPos;
vector< vector<Double_t> > fMeanPeakPos; //doc of class member
vector< vector<Double_t> > 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);
......
#include "THtml.h"
void htmldoc()
{
gSystem->Load("./libAculData.so");
gSystem->Load("./libTELoss.so");
gSystem->Load("./libAculCalib.so");
gSystem->Load("./libAculData.so");
THtml h;
h.SetInputDir(".");
h.SetOutputDir("htmldoc");
h.SetProductName("AculUtils");
h.MakeAll();
......
......@@ -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)
......
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