Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AculUtils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pavel Sharov
AculUtils
Commits
8bd7b5f0
Commit
8bd7b5f0
authored
Oct 24, 2016
by
Vratislav Chudoba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Probably all functionality of CsI calibration works in newArch.
parent
33892834
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
390 additions
and
36 deletions
+390
-36
AculCalPars.h
AculCalib/AculCalPars.h
+11
-7
AculCalParsScint.cpp
AculCalib/AculCalParsScint.cpp
+31
-2
AculCalParsScint.h
AculCalib/AculCalParsScint.h
+3
-1
AculCalib.cpp
AculCalib/AculCalib.cpp
+15
-0
AculCalib.h
AculCalib/AculCalib.h
+2
-0
AculCalibScint.cpp
AculCalib/AculCalibScint.cpp
+281
-10
AculCalibScint.h
AculCalib/AculCalibScint.h
+30
-13
calibrationSQ13Alpha.cxx
macros/calibration_CsI/calibrationSQ13Alpha.cxx
+1
-0
parTest.cxx
macros/myMacros/parTest.cxx
+16
-3
No files found.
AculCalib/AculCalPars.h
View file @
8bd7b5f0
...
...
@@ -16,6 +16,7 @@
#include "TString.h"
#include "TArrayD.h"
#include "TArrayI.h"
#include "TCutG.h"
//todo ommit this constant
#define NOCALFILES 5
...
...
@@ -58,17 +59,20 @@ public:
//getters
const
char
*
GetParFileName
()
{
return
fParFileName
.
Data
();}
// Int_t GetNoCrystals() {return fNoCrystals;}
// const char* GetDetName() {return fDetName.Data()
;}
// const char* GetParticleName() {return fPartName.Data()
;}
virtual
const
char
*
GetDetName
()
{
return
0
;}
virtual
const
char
*
GetParticleName
()
{
return
0
;}
virtual
Int_t
GetNoRawFiles
()
{
return
0
;};
virtual
const
char
*
GetFileName
(
Int_t
i
)
{
return
0
;};
// const char* GetCutName(Int_t i);
// Int_t GetNoEPoints() {return fEnergyPoints
;}
// Double_t GetCalEnergy(Int_t i)
;
virtual
Int_t
GetNoEPoints
()
{
return
0
;}
virtual
Double_t
GetCalEnergy
(
Int_t
i
)
{
return
0
.;}
;
virtual
const
char
*
GetCutsFileName
()
{
return
0
;}
Int_t
GetNoCuts
()
{
return
0
;}
// Int_t GetMinChannel(Int_t energy, Int_t crystal);
// Int_t GetMaxChannel(Int_t energy, Int_t crystal);
virtual
Int_t
GetNoCuts
()
{
return
0
;}
virtual
TCutG
*
GetCut
(
Int_t
i
)
{
return
0
;};
virtual
TCutG
*
GetCut
(
const
char
*
cutName
)
{
return
0
;};
// virtual TCutG* GetCutName(Int_t i) {return 0;};
virtual
Int_t
GetMinChannel
(
Int_t
energy
,
Int_t
crystal
)
{
return
0
;};
virtual
Int_t
GetMaxChannel
(
Int_t
energy
,
Int_t
crystal
)
{
return
0
;};
void
SetParFileName
(
const
char
*
parFile
)
{
fParFileName
=
parFile
;}
...
...
AculCalib/AculCalParsScint.cpp
View file @
8bd7b5f0
...
...
@@ -204,6 +204,32 @@ const char* AculCalParsScint::GetCutName(Int_t i) {
return
fCutName
[
i
].
Data
();
}
TCutG
*
AculCalParsScint
::
GetCut
(
Int_t
i
)
{
if
(
i
>=
(
Int_t
)
fCuts
.
size
()
)
{
cerr
<<
"
\"
AculCalParsScint::GetCut
\"
index i cannot be higher than "
<<
fCuts
.
size
()
-
1
<<
endl
;
return
0
;
}
return
&
fCuts
[
i
];
}
TCutG
*
AculCalParsScint
::
GetCut
(
const
char
*
cutName
)
{
// TClonesArray cutsCol;
//
// for (Int_t i = 0; i < nCuts; i++) {
// cutsCol[i] = (TCutG*)fCuts->Get(cutNames[i]);
// }
const
TString
cName
=
cutName
;
for
(
Int_t
i
=
0
;
i
<=
(
Int_t
)
fCuts
.
size
();
i
++
)
{
if
(
cName
.
EqualTo
(
fCutName
[
i
]))
{
return
&
fCuts
[
i
];
}
}
cerr
<<
"
\"
AculCalParsScint::GetCut
\"
cut
\"
"
<<
cutName
<<
"
\"
was not found."
<<
endl
;
return
0
;
}
Double_t
AculCalParsScint
::
GetCalEnergy
(
Int_t
i
)
{
if
(
i
>
(
Int_t
)
fE
.
size
()
-
1
)
{
...
...
@@ -262,9 +288,12 @@ void AculCalParsScint::LoadCuts() {
for
(
Int_t
i
=
0
;
i
<
(
Int_t
)
fCutName
.
size
();
i
++
)
{
TCutG
*
currentCut
=
(
TCutG
*
)
cutFile
.
Get
(
fCutName
[
i
]);
if
(
currentCut
)
{
fCuts
.
push_back
(
*
currentCut
);
if
(
!
currentCut
)
{
cout
<<
"
\"
AculCalParsScint::LoadCuts
\"
Cut
\"
"
<<
fCutName
[
i
]
<<
"
\"
was not found in file "
<<
fCutsFileName
<<
"."
<<
endl
;
continue
;
}
fCuts
.
push_back
(
*
currentCut
);
}
}
AculCalib/AculCalParsScint.h
View file @
8bd7b5f0
...
...
@@ -9,7 +9,7 @@
#define ACULCALIB_ACULCALPARSSCINT_H_
#include "AculCalPars.h"
#include "TCutG.h"
//
#include "TCutG.h"
using
std
::
cerr
;
...
...
@@ -60,6 +60,8 @@ public:
Double_t
GetCalEnergy
(
Int_t
i
);
const
char
*
GetCutsFileName
()
{
return
fCutsFileName
.
Data
();}
Int_t
GetNoCuts
()
{
return
fNoCuts
;}
TCutG
*
GetCut
(
Int_t
i
);
TCutG
*
GetCut
(
const
char
*
cutName
);
Int_t
GetMinChannel
(
Int_t
energy
,
Int_t
crystal
);
Int_t
GetMaxChannel
(
Int_t
energy
,
Int_t
crystal
);
...
...
AculCalib/AculCalib.cpp
View file @
8bd7b5f0
...
...
@@ -68,3 +68,18 @@ 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
();
if
(
noPads
==
16
)
{
c
->
Divide
(
4
,
4
);
return
;
}
if
(
rows
!=
0
&&
columns
!=
0
)
{
c
->
Divide
(
columns
,
rows
);
return
;
}
}
AculCalib/AculCalib.h
View file @
8bd7b5f0
...
...
@@ -8,6 +8,7 @@
#include "TArrayD.h"
#include "TString.h"
#include "TCanvas.h"
#include "./AculCalPars.h"
...
...
@@ -45,6 +46,7 @@ public:
protected
:
//essential
void
CanDivider
(
TCanvas
*
c
,
Int_t
noPads
,
Int_t
columns
=
0
,
Int_t
rows
=
0
);
};
...
...
AculCalib/AculCalibScint.cpp
View file @
8bd7b5f0
This diff is collapsed.
Click to expand it.
AculCalib/AculCalibScint.h
View file @
8bd7b5f0
...
...
@@ -4,19 +4,21 @@
//#include "TROOT.h"
#include <iostream>
#include <fstream>
//#include <vector>
#include "TFile.h"
#include "TTree.h"
#include "TCanvas.h"
//
#include "TH1I.h"
//
#include "TGraphErrors.h"
//
#include "TCanvas.h"
#include "TH1I.h"
#include "TGraphErrors.h"
//#include "TArrayD.h"
//
#include "TF1.h"
#include "TF1.h"
#include "./AculCalib.h"
using
std
::
cout
;
using
std
::
endl
;
//using std::vector;
class
AculCalibScint
:
public
AculCalib
{
...
...
@@ -29,13 +31,18 @@ private:
TFile
*
fCutFile
;
// TClonesArray cutsCol;
//
// TH1I *hfull[NOCALFILES][16];
// TH1I *hcut[NOCALFILES][16];
// TH1I *fHistFull[NOCALFILES][16];
vector
<
vector
<
TH1I
*>
>
fHistFull
;
// TH1I *fHistCut[NOCALFILES][16];
vector
<
vector
<
TH1I
*>
>
fHistCut
;
//
// Double_t mean[NOCALFILES][16];
// Double_t meanRMS[NOCALFILES][16];
// Double_t fMeanPeakPos[NOCALFILES][16];
vector
<
vector
<
Double_t
>
>
fMeanPeakPos
;
// Double_t fMeanPeakRMS[NOCALFILES][16];
vector
<
vector
<
Double_t
>
>
fMeanPeakRMS
;
//
// TGraphErrors *gCal[16];
//todo make vector of graphs
TGraphErrors
*
gCal
[
16
];
// TFile *fGraphs;
public
:
...
...
@@ -54,10 +61,15 @@ public:
// void PrintParameters(const char* option = "");
// void PrintPeakRanges();
void
DrawVariable
(
const
char
*
variable
,
Int_t
tree
,
TCanvas
*
canvas
,
Int_t
lowRange
=
0
,
Int_t
upRange
=
4096
);
// void DrawBeam(TCanvas *canvas, Int_t files, const char* variable);
// void DrawdEE(const char* variable, Int_t tree, TCanvas *canvas);
// void DrawVariableCut(const char* variable, Int_t tree, TCanvas *canvas, const char* cut1, const char* cut2 = "", Int_t lowRange = 0);
void
DrawVariable
(
const
char
*
variable
,
Int_t
treeID
,
TCanvas
*
canvas
,
Int_t
lowRange
=
0
,
Int_t
upRange
=
4096
);
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
);
void
Calibrate
(
TCanvas
*
canvas
,
Bool_t
savefile
=
0
,
const
char
*
filename
=
""
,
const
char
*
option
=
"READ"
);
void
WriteClbParameters
(
const
char
*
filename
);
TTree
*
GetTree
(
Int_t
treeID
);
//private functions:
// void LoadCuts();
...
...
@@ -65,5 +77,10 @@ public:
private
:
void
OpenFiles
();
void
LoadTrees
();
void
SaveClbGraphs
(
const
char
*
filename
,
const
char
*
option
=
"READ"
);
void
FillGraph
(
TGraphErrors
*
g
,
Int_t
npoints
,
/*Double_t *energies,*/
Int_t
graphNumber
,
const
char
*
option
=
""
);
// void SetPars();
};
macros/calibration_CsI/calibrationSQ13Alpha.cxx
View file @
8bd7b5f0
...
...
@@ -31,6 +31,7 @@
// cal.DrawBeam(c4, 4, "SQ13");
//return;
// cal.DrawVariableCut("SQ13", 0, c1, "cutsSQ13Alpha16");
// return;
// cal.DrawVariableCut("SQ13", 0, c1, "cutsSQ13Alpha16", "cutSQ13Alpha16Amp");
//return;
// cal.DrawVariableCut("SQ13", 1, c2, "cutSQ13Alpha21", "cutSQ13Alpha21Amp");
...
...
macros/myMacros/parTest.cxx
View file @
8bd7b5f0
//#include "../../AculCalib/AculCalPars.h"
//#include "../../AculCalib/AculCalibScint.h"
//#include "TSystem.h"
void
parTest
()
{
...
...
@@ -19,16 +21,27 @@ void parTest()
// c.LoadTrees();
c
.
PrintTrees
();
// c.DrawVariable(.........)
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"Plain"
);
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"Plain"
);
TCanvas
*
c3
=
new
TCanvas
(
"c3"
,
"Plain"
);
TCanvas
*
c4
=
new
TCanvas
(
"c4"
,
"Plain"
);
// c.DrawVariable("SQ13", 2, c1);
// c.DrawBeam(c1, 4, "SQ13");
c
.
GetPeakMean
(
"SQ13"
,
0
,
0
,
c1
,
"cutSQ13Alpha16Amp"
,
256
);
c
.
GetPeakMean
(
"SQ13"
,
1
,
1
,
c2
,
"cutSQ13Alpha21Amp"
,
256
);
c
.
GetPeakMean
(
"SQ13"
,
2
,
2
,
c3
,
"cutSQ13Alpha26Amp"
,
256
);
c
.
GetPeakMean
(
"SQ13"
,
3
,
3
,
c4
,
"cutSQ13Alpha30Amp"
,
256
);
//return;
// c.PrintFiles();
// c.PrintCuts();
// TCanvas *c1 = new TCanvas("c1", "Plain");
// c.GetPeakMean("SQ13", 0, 0, c1, "cutSQ13Alpha16Amp", 256);
//
TCanvas *cCal = new TCanvas("cCal", "calibration Alpha");
// cal
.Calibrate(cCal);
TCanvas
*
cCal
=
new
TCanvas
(
"cCal"
,
"calibration Alpha"
);
c
.
Calibrate
(
cCal
);
return
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment