Commit 28706779 authored by Kostyleva D.A's avatar Kostyleva D.A

Got rid of BLOCKSNUMBER

parent 21729c50
This diff is collapsed.
......@@ -76,23 +76,27 @@ public:
Double_t fFitPeakThreshold; //pouziva se, private, prozkoumat, k cemu vlastne slouzi ve fci ShowPeaks, popremyslet o vhodnem prednastaveni v konstruktoru
//these variables are the main for the class
Double_t fAOld[BLOCKSNUMBER][ADDRESSNUMBER]; //calibration parameter, f(x) = fAOld*x + fBOld
Double_t fBOld[BLOCKSNUMBER][ADDRESSNUMBER]; //calibration parameter, f(x) = fAOld*x + fBOld
// Double_t fAOld[BLOCKSNUMBER][ADDRESSNUMBER]; //calibration parameter, f(x) = fAOld*x + fBOld
// Double_t fBOld[BLOCKSNUMBER][ADDRESSNUMBER]; //calibration parameter, f(x) = fAOld*x + fBOld
Double_t fC[BLOCKSNUMBER][ADDRESSNUMBER]; //treti kalibracni parametr, jine zavislosti nez pol1
Double_t fD[BLOCKSNUMBER][ADDRESSNUMBER]; //ctvrty kalibracni parametr
private:
TArrayD fA;
TArrayD fB;
TArrayD fB;
// TArrayD fC;
// TArrayD fD;
public:
//smysl je velmi pochybny
TFile *fCalInformation;
TFile *fCalInformation;
Double_t GetA(Int_t i); //to obtain calib parameter A
Double_t GetB(Int_t i); //to obtain calib parameter B
//private:
Double_t fPeak[DEFAULTNOPEAKS]; //v teto promenne je ulozena momentalni hodnota piku v kanalech, zejmena v jedne fci, mozno udelat ji jako lokalni, bude navratovou hodnotou fce PeaksFitting, predelat delku pole
public:
AculCalibration();
//default constructor
......@@ -142,9 +146,10 @@ public:
// blockmax: maximum block data are displayed for
Bool_t CalculateCalibParameters(const char* inputfile, const char* block,
const Int_t address, const char* treename, Int_t lowerchannel = 0,
/*const Int_t address,*/ 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
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"
......@@ -173,7 +178,7 @@ public:
void CalibrateRawSpectra(const char* inputfile, const char* block, const Int_t address, const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t uppersubaddress = ADDRESSNUMBER-1);
void CalibrateRawSpectra(const char* inputfile, const char* block, /*const Int_t address,*/ const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t uppersubaddress = ADDRESSNUMBER-1);
// Bool_t EnergyPositions(const char* inputfile, const char* block,
// const Int_t address, const Int_t address, const char* treename, Int_t lowerchannel = 0,
......
......@@ -3,7 +3,8 @@
AculCalibration cal;
cal.SetInputParameters(); //from .par
cal.CalculateCalibParameters("clb08_0001.root", "SQ22", 22, "AnalysisxTree", 100, 4095);
cal.CalculateCalibParameters("clb08_0001.root", "SQ22", "AnalysisxTree", 100, 4095);
// CalculateCalibParameters(const char* inputfile, const char* block, const Int_t address, const char* treename, Int_t lowerchannel = 0, Int_t upperchannel = 4095, Int_t nEBins = 1000, Int_t lowersubaddress = 0, Int_t uppersubaddress = ADDRESSNUMBER-1);
TFile fr("SQ22[]E.root");
......
......@@ -4,11 +4,11 @@
AculCalibration cal;
cal->SetInputParameters();
cal->SetCalibrationParameters("./run8/SQ22[].cal"); //takes calibration parameters
cal->SetCalibrationParameters("SQ22[].cal"); //takes calibration parameters
cal->PrintCalibrationParameters(22, 22);
TCanvas *c1 = new TCanvas();
cal->CalibrateRawSpectra("clb09_0001.root", "SQ22", 22, "AnalysisxTree", 100, 800, 500); //takes data from raw file and calibrates it with obtained calibration parameters
cal->CalibrateRawSpectra("clb09_0001.root", "SQ22", "AnalysisxTree", 100, 800, 500); //takes data from raw file and calibrates it with obtained calibration parameters
TFile fr("SQ22[]E.root");
cout << fr.GetListOfKeys()->GetEntries() << " histograms" << endl;
......
{
gSystem->Load("../libTELoss.so");
TELoss mSi;
//set parameters for Si and alpha
mSi.SetEL(1, 2.321); // density in g/cm3
mSi.AddEL(14., 28.086, 1); //Z, mass
// mSi.SetZP(1., 1.); //protons
mSi.SetZP(2., 4.); //alphas, Z, A
mSi.SetEtab(100000, 200.); // ?, MeV calculate ranges
mSi.SetDeltaEtab(300); // calculate delta E
// TCanvas *c1 = new TCanvas("name", "title which can consist more than one word.", 617, 0, 1058, 972);
// cout << mSi.GetE(50, 1000) << endl; //(input energy E0 in MeV, microns)
// cout << mSi.GetE0(9.04, 1000) << endl; //(output energy E in MeV, microns)
//calculated energies for run1 - run3
/*
Double_t deltaL1 = mSi.GetR(4.789, 4.623); //(doule E0, double E in MeV) calculates layer in mcm for averages
Double_t deltaL2 = mSi.GetR(5.5,5.355);
Double_t deltaL3 = mSi.GetR(6.017,5.880);
Double_t deltaL4 = mSi.GetR(7.693, 7.577);
*/
//calculated energies for run4 - run5
/*
Double_t deltaL1 = mSi.GetR(4.782,4.613); //(doule E0, double E in MeV) calculates layer in mcm for averages
Double_t deltaL2 = mSi.GetR(5.503,5.348);
Double_t deltaL3 = mSi.GetR(6.016,5.875);
Double_t deltaL4 = mSi.GetR(7.692,7.571);
*/
//calculated energies for run6 - run7
/*
Double_t deltaL1 = mSi.GetR(4.788,4.675); //(doule E0, double E in MeV) calculates layer in mcm for averages
Double_t deltaL2 = mSi.GetR(5.502,5.340);
Double_t deltaL3 = mSi.GetR(6.017,5.923);
Double_t deltaL4 = mSi.GetR(7.693,7.612);
*/
//calculated energies for run8 - run9
Double_t deltaL1 = mSi.GetR(4.787,4.648); //(doule E0, double E in MeV) calculates layer in mcm for averages
Double_t deltaL2 = mSi.GetR(5.501,5.380);
Double_t deltaL3 = mSi.GetR(6.018,5.903);
Double_t deltaL4 = mSi.GetR(7.692,7.594);
cout << deltaL1 << " mcm" << endl; //MeV, microns - delta layer
cout << deltaL2 << " mcm" << endl;
cout << deltaL3 << " mcm" << endl;
cout << deltaL4 << " mcm" << endl << endl;
cout << "dead layer 1 is: " << deltaL1/(TMath::Sqrt(2) - 1) << " mcm" << endl; //MeV, microns
cout << "dead layer 2 is: " <<deltaL2/(TMath::Sqrt(2) - 1) << " mcm" << endl; //MeV, microns
cout << "dead layer 3 is: " <<deltaL3/(TMath::Sqrt(2) - 1) << " mcm" << endl; //MeV, microns
cout << "dead layer 4 is: " <<deltaL4/(TMath::Sqrt(2) - 1) << " mcm" << endl << endl; //MeV, microns
cout << "Back dead layer for detector 1-11 is : " << ( deltaL1/(TMath::Sqrt(2) - 1) + deltaL2/(TMath::Sqrt(2) - 1)+ deltaL3/(TMath::Sqrt(2) - 1) + deltaL4/(TMath::Sqrt(2) - 1) )/4. << " mcm" << endl; //dead layer width
}
This diff is collapsed.
adadsasdASDADadasd
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