Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
and
there
.
Show more breadcrumbs
np
nptool
Commits
aa67669a
Commit
aa67669a
authored
3 months ago
by
Theodore Efremov
Browse files
Options
Downloads
Patches
Plain Diff
Advanced in chio analysis
parent
f3e6b0dc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!27
Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Projects/AlPhaPha/2024/macro/chio/YCalibration/DECorr.C
+77
-34
77 additions, 34 deletions
Projects/AlPhaPha/2024/macro/chio/YCalibration/DECorr.C
Projects/AlPhaPha/2024/macro/chio/YCalibration/SplineChioP2P.C
+2
-1
2 additions, 1 deletion
...cts/AlPhaPha/2024/macro/chio/YCalibration/SplineChioP2P.C
with
79 additions
and
35 deletions
Projects/AlPhaPha/2024/macro/chio/YCalibration/DECorr.C
+
77
−
34
View file @
aa67669a
...
@@ -109,16 +109,28 @@ void DECorr(bool cut = false, bool spline = false) {
...
@@ -109,16 +109,28 @@ void DECorr(bool cut = false, bool spline = false) {
//Defining output histo
//Defining output histo
TH2F
*
hDE_E
=
new
TH2F
(
"DE_E"
,
"DE_E"
,
1000
,
0
,
22000
,
1000
,
0
,
28000
);
TH2F
*
hDE_E
=
new
TH2F
(
"DE_E"
,
"DE_E"
,
1000
,
0
,
22000
,
1000
,
0
,
28000
);
TH2F
*
hDE_E_splined
=
new
TH2F
(
"DE_E_splined"
,
"DE_E_splined"
,
1000
,
0
,
22000
,
1000
,
0
,
28000
);
TH2F
*
hDE_Ebis
=
new
TH2F
(
"DE_Ebis"
,
"DE_Ebis"
,
1000
,
0
,
22000
,
1000
,
0
,
24000
);
TH2F
*
hDE_Ebis
=
new
TH2F
(
"DE_Ebis"
,
"DE_Ebis"
,
1000
,
0
,
22000
,
1000
,
0
,
24000
);
TH2F
*
hDE_Y
=
new
TH2F
(
"DE_Y"
,
"DE_Y"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y
=
new
TH2F
(
"DE_Y"
,
"DE_Y"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y_splined
=
new
TH2F
(
"DE_Ysplined"
,
"DE_Ysplined"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y_splined
=
new
TH2F
(
"DE_Ysplined"
,
"DE_Ysplined"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y_splined_nocut
=
new
TH2F
(
"DE_Ysplined_nocut"
,
"DE_Ysplined_nocut"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hIC_Y
=
new
TH2F
(
"IC_Y"
,
"IC_Y"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hIC_Y_splined
=
new
TH2F
(
"IC_Ysplined"
,
"IC_Ysplined"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y_corr
=
new
TH2F
(
"DE_Ycorr"
,
"DE_Ycorr"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y_corr
=
new
TH2F
(
"DE_Ycorr"
,
"DE_Ycorr"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y_corr_nocut
=
new
TH2F
(
"DE_Ycorr_nocut"
,
"DE_Ycorr_nocut"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y_bis
=
new
TH2F
(
"DE_Ybis"
,
"DE_Ybis"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_Y_bis
=
new
TH2F
(
"DE_Ybis"
,
"DE_Ybis"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDEbis_Y_corr
=
new
TH2F
(
"DE_Ybiscorr"
,
"DE_Ybiscorr"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDEbis_Y_corr
=
new
TH2F
(
"DE_Ybiscorr"
,
"DE_Ybiscorr"
,
1000
,
-
100
,
100
,
1000
,
0
,
22000
);
TH2F
*
hDE_E_corr
=
new
TH2F
(
"DE_Ecorr"
,
"DE_Ecorr"
,
1000
,
0
,
22000
,
1000
,
0
,
28000
);
TH2F
*
hDE_E_corr
=
new
TH2F
(
"DE_Ecorr"
,
"DE_Ecorr"
,
1000
,
0
,
22000
,
1000
,
0
,
28000
);
TH2F
*
hDE_Ebis_corr
=
new
TH2F
(
"DE_Ebiscorr"
,
"DE_Ebiscorr"
,
1000
,
0
,
22000
,
1000
,
0
,
24000
);
TH2F
*
hDE_Ebis_corr
=
new
TH2F
(
"DE_Ebiscorr"
,
"DE_Ebiscorr"
,
1000
,
0
,
22000
,
1000
,
0
,
24000
);
TH2F
*
hDE_E_Recur
=
new
TH2F
(
"DE_E_Recur"
,
"DE_E_Recur"
,
1000
,
0
,
22000
,
1000
,
0
,
28000
);
TH2F
*
hDE_E_Recur
=
new
TH2F
(
"DE_E_Recur"
,
"DE_E_Recur"
,
1000
,
0
,
22000
,
1000
,
0
,
28000
);
TH2F
*
hDE_V
=
new
TH2F
(
"DE_V"
,
"DE_V"
,
1000
,
0
,
5
,
1000
,
0
,
28000
);
// Def Lim spline
// Def Lim spline
double
Ymin
=
-
100
,
Ymax
=
100
;
double
Ymin
=
-
100
,
Ymax
=
100
;
...
@@ -174,8 +186,8 @@ void DECorr(bool cut = false, bool spline = false) {
...
@@ -174,8 +186,8 @@ void DECorr(bool cut = false, bool spline = false) {
}
//endloop seg
}
//endloop seg
double
DE
=
0
,
DE_splined
=
0
,
E
=
0
,
Ecorr
,
DE_
Y
corr
=
0
,
DE_Ybis
=
0
,
DE_Y_Recur
=
0
;
double
DE
=
0
,
DE_splined
=
0
,
DE_corr
=
0
,
DE_Ybis
=
0
,
DE_Y_Recur
=
0
;
double
E
=
0
,
Ecorr
=
0
;
for
(
int
seg
=
0
;
seg
<
sizeof
(
IC
->
fIC_raw
)
/
sizeof
(
IC
->
fIC_raw
[
0
])
;
seg
++
){
for
(
int
seg
=
0
;
seg
<
sizeof
(
IC
->
fIC_raw
)
/
sizeof
(
IC
->
fIC_raw
[
0
])
;
seg
++
){
if
(
seg
>
4
){
if
(
seg
>
4
){
E
+=
IC
->
fIC_raw
[
seg
]
;
E
+=
IC
->
fIC_raw
[
seg
]
;
...
@@ -183,24 +195,39 @@ void DECorr(bool cut = false, bool spline = false) {
...
@@ -183,24 +195,39 @@ void DECorr(bool cut = false, bool spline = false) {
}
}
}
}
// ********************* DE setter *********************
double
IC1corr
=
(
IC
->
fIC_raw
[
1
]
*
(
1
-
0
.
0006
86068
*
FF_IC_Y
))
*
(
1
-
4.88238e-05
*
FF_IC_Y
+
7.40395e-06
*
FF_IC_Y
*
FF_IC_Y
);
double
IC1corr
=
(
IC
->
fIC_raw
[
1
]
*
(
1
-
0
.
0006
86068
*
FF_IC_Y
))
*
(
1
-
4.88238e-05
*
FF_IC_Y
+
7.40395e-06
*
FF_IC_Y
*
FF_IC_Y
);
double
DE_Bis
=
0
.
5
*
(
IC1corr
+
IC
->
fIC_raw
[
2
]
+
IC
->
fIC_raw
[
3
])
+
IC
->
fIC_raw
[
4
];
double
DE_Bis
=
0
.
5
*
(
IC1corr
+
IC
->
fIC_raw
[
2
]
+
IC
->
fIC_raw
[
3
])
+
IC
->
fIC_raw
[
4
];
DE
=
0
.
5
*
(
IC
->
fIC_raw
[
0
]
+
IC
->
fIC_raw
[
1
]
+
IC
->
fIC_raw
[
2
]
+
IC
->
fIC_raw
[
3
])
+
IC
->
fIC_raw
[
4
];
DE
=
0
.
5
*
(
ICcorr_Y
.
at
(
0
)
+
IC
->
fIC_raw
[
1
]
+
IC
->
fIC_raw
[
2
]
+
IC
->
fIC_raw
[
3
])
+
IC
->
fIC_raw
[
4
];
//DE_splined = 0.5*(ICcorr_Y[0]+ ICcorr_Y[1] +ICcorr_Y[2]+ICcorr_Y[3])+ICcorr_Y[4];
DE_splined
=
0
.
5
*
(
ICcorr_Y
[
0
]
+
ICcorr_Y
[
1
]
+
ICcorr_Y
[
2
]
+
ICcorr_Y
[
3
])
+
ICcorr_Y
[
4
];
DE_splined
=
0
.
5
*
(
ICcorr_Y
[
1
]
+
IC
->
fIC_raw
[
2
]
+
IC
->
fIC_raw
[
3
])
+
IC
->
fIC_raw
[
4
];
//DE_splined = 0.5*( ICcorr_Y[1] +IC->fIC_raw[2]+IC->fIC_raw[3])+IC->fIC_raw[4];
//************* Cut ******************
bool
CutV
=
abs
(
FF_V13
-
3
.
94
)
<
0
.
01
;
bool
CutVbis
=
abs
(
FF_V13
-
3
.
94
)
<
0
.
01
;
//bool CutV = true;
//bool CutVbis = true;
//***********Fill histo*************
bool
CutV
=
FF_V13
>
4
.
2999
&&
FF_V13
<=
4
.
3
;
bool
CutVbis
=
FF_V13
>
4
.
2999
&&
FF_V13
<=
4
.
3
;
//bool CutV = true; //nocut
if
(
FF_IC_Y
>
Ymin
&&
FF_IC_Y
<
Ymax
){
if
(
FF_IC_Y
>
Ymin
&&
FF_IC_Y
<
Ymax
){
//hDE_E->Fill(E,DE);
hDE_E
->
Fill
(
E
,
DE_splined
);
//*************Init DE_E*****************
hDE_E
->
Fill
(
E
,
DE
);
hDE_E_splined
->
Fill
(
E
,
DE_splined
);
hDE_Ebis
->
Fill
(
E
,
DE_Bis
);
hDE_Ebis
->
Fill
(
E
,
DE_Bis
);
if
(
spline
==
true
&&
FF_IC_Y
>
Ymin
&&
FF_IC_Y
<
Ymax
){
hDE_V
->
Fill
(
FF_V13
,
DE_splined
);
DE_Ycorr
=
DE_splined
*
splineDEcorr
->
Eval
(
0
)
/
splineDEcorr
->
Eval
(
FF_IC_Y
);
hDE_E_corr
->
Fill
(
E
,
DE_Ycorr
);
//******* Coor DE ************
if
(
spline
==
true
){
DE_corr
=
DE_splined
*
splineDEcorr
->
Eval
(
0
)
/
splineDEcorr
->
Eval
(
FF_IC_Y
);
hDE_E_corr
->
Fill
(
E
,
DE_corr
);
DE_Ybis
=
DE_Bis
*
splineDEbis
->
Eval
(
0
)
/
splineDEbis
->
Eval
(
FF_IC_Y
);
DE_Ybis
=
DE_Bis
*
splineDEbis
->
Eval
(
0
)
/
splineDEbis
->
Eval
(
FF_IC_Y
);
hDE_Ebis_corr
->
Fill
(
E
,
DE_Ybis
);
hDE_Ebis_corr
->
Fill
(
E
,
DE_Ybis
);
...
@@ -208,26 +235,34 @@ void DECorr(bool cut = false, bool spline = false) {
...
@@ -208,26 +235,34 @@ void DECorr(bool cut = false, bool spline = false) {
DE_Y_Recur
=
DE_splined
;
DE_Y_Recur
=
DE_splined
;
for
(
int
i
=
0
;
i
<
vsplineDE
.
size
()
;
i
++
){
for
(
int
i
=
0
;
i
<
vsplineDE
.
size
()
;
i
++
){
DE_Y_Recur
=
DE_Y_Recur
*
vsplineDE
.
at
(
i
)
->
Eval
(
0
)
/
vsplineDE
.
at
(
i
)
->
Eval
(
FF_IC_Y
);
DE_Y_Recur
=
DE_Y_Recur
*
vsplineDE
.
at
(
i
)
->
Eval
(
0
)
/
vsplineDE
.
at
(
i
)
->
Eval
(
FF_IC_Y
);
}
}
hDE_E_Recur
->
Fill
(
E
,
DE_Y_Recur
);
hDE_E_Recur
->
Fill
(
E
,
DE_Y_Recur
);
}
}
else
{
else
{
DE_
Y
corr
=
DE_splined
;
DE_corr
=
DE_splined
;
hDE_E_corr
->
Fill
(
E
,
DE_
Y
corr
);
hDE_E_corr
->
Fill
(
E
,
DE_corr
);
DE_Ybis
=
DE_Bis
;
DE_Ybis
=
DE_Bis
;
hDE_Ebis_corr
->
Fill
(
E
,
DE_Ybis
);
hDE_Ebis_corr
->
Fill
(
E
,
DE_Ybis
);
}
}
//
bool Cut
V
= CutZ->IsInside(
E
,DE_splined);
bool
Cut
Charge
=
CutZ
->
IsInside
(
FF_V13
,
DE_splined
);
//bool Cut
V
= CutZ->IsInside(E,DE_Y_Recur);
//bool Cut
ChargeBis
= CutZ->IsInside(E,DE_Y_Recur);
//bool CutVbis = CutZbis->IsInside(E,DE_Bis);
//bool CutVbis = CutZbis->IsInside(E,DE_Bis);
// DE_Y in a cut
if
(
cut
==
true
&&
CutV
)
{
hDE_Y
->
Fill
(
FF_IC_Y
,
DE_splined
);
hDE_Y_corr_nocut
->
Fill
(
FF_IC_Y
,
DE
);
//hDE_Y_corr->Fill(FF_IC_Y,DE_splined);
hDE_Y_splined_nocut
->
Fill
(
FF_IC_Y
,
DE_splined
);
hDE_Y_corr
->
Fill
(
FF_IC_Y
,
DE_Y_Recur
);
if
(
cut
==
true
&&
CutV
&&
CutCharge
)
{
hDE_Y
->
Fill
(
FF_IC_Y
,
DE
);
hDE_Y_splined
->
Fill
(
FF_IC_Y
,
DE_splined
);
hDE_Y_corr
->
Fill
(
FF_IC_Y
,
DE_corr
);
hIC_Y
->
Fill
(
FF_IC_Y
,
IC
->
fIC_raw
[
1
]);
hIC_Y_splined
->
Fill
(
FF_IC_Y
,
ICcorr_Y
.
at
(
1
));
}
//end cut
}
//end cut
else
{;}
else
{;}
...
@@ -244,9 +279,9 @@ void DECorr(bool cut = false, bool spline = false) {
...
@@ -244,9 +279,9 @@ void DECorr(bool cut = false, bool spline = false) {
TSpline3
*
splineDE
,
*
osplineDEbis
;
TSpline3
*
splineDE
,
*
osplineDEbis
;
if
(
spline
==
true
){
if
(
spline
==
true
){
splineDE
=
MakeSpline
(
hDE_Y_
corr
,
0
,
Ymin
,
Ymax
,
0
,
23000
);
splineDE
=
MakeSpline
(
hDE_Y_
splined
,
0
,
Ymin
,
Ymax
,
0
,
23000
);
osplineDEbis
=
MakeSpline
(
hDE_Y_bis
,
1
,
Ymin
,
Ymax
,
0
,
23000
);
osplineDEbis
=
MakeSpline
(
hDE_Y_bis
,
1
,
Ymin
,
Ymax
,
0
,
23000
);
TFile
*
fSpline
=
new
TFile
(
"Output/splineDE.root"
,
"
upd
ate"
);
TFile
*
fSpline
=
new
TFile
(
"Output/splineDE.root"
,
"
recre
ate"
);
splineDE
->
SetName
(
"SplineDe_0"
);
splineDE
->
SetName
(
"SplineDe_0"
);
splineDE
->
Write
();
splineDE
->
Write
();
osplineDEbis
->
SetName
(
"SplineDebis"
);
osplineDEbis
->
SetName
(
"SplineDebis"
);
...
@@ -261,20 +296,28 @@ void DECorr(bool cut = false, bool spline = false) {
...
@@ -261,20 +296,28 @@ void DECorr(bool cut = false, bool spline = false) {
c
->
Divide
(
2
,
2
);
c
->
Divide
(
2
,
2
);
c
->
cd
(
1
);
c
->
cd
(
1
);
gPad
->
SetLogz
();
gPad
->
SetLogz
();
hDE_Y
_corr
->
ProfileX
()
->
Draw
();
hDE_Y
->
ProfileX
()
->
Draw
();
c
->
cd
(
2
);
c
->
cd
(
2
);
gPad
->
SetLogz
();
gPad
->
SetLogz
();
hDE_Y
->
ProfileX
()
->
Draw
();
hDE_Y
_splined
->
ProfileX
()
->
Draw
();
c
->
cd
(
3
);
c
->
cd
(
3
);
gPad
->
SetLogz
();
gPad
->
SetLogz
();
h
DEbis_Y_corr
->
ProfileX
()
->
Draw
();
h
IC_Y
->
ProfileX
()
->
Draw
();
c
->
cd
(
4
);
c
->
cd
(
4
);
gPad
->
SetLogz
();
gPad
->
SetLogz
();
hDE_Y_bis
->
ProfileX
()
->
Draw
();
hIC_Y_splined
->
ProfileX
()
->
Draw
();
TCanvas
*
c4
=
new
TCanvas
(
"c4"
,
"c4"
,
1500
,
1000
);
c4
->
Divide
(
2
);
c4
->
cd
(
1
);
hDE_Y_splined_nocut
->
ProfileX
()
->
Draw
();
c4
->
cd
(
2
);
hDE_Y_corr_nocut
->
ProfileX
()
->
Draw
();
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"c1"
,
1500
,
1000
);
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"c1"
,
1500
,
1000
);
hDE_
E
->
Draw
();
hDE_
V
->
Draw
();
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"c2"
,
1500
,
1000
);
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"c2"
,
1500
,
1000
);
c2
->
Divide
(
2
+
3
*
spline
);
c2
->
Divide
(
2
+
3
*
spline
);
...
@@ -287,10 +330,10 @@ void DECorr(bool cut = false, bool spline = false) {
...
@@ -287,10 +330,10 @@ void DECorr(bool cut = false, bool spline = false) {
if
(
spline
){
if
(
spline
){
c2
->
cd
(
3
);
c2
->
cd
(
3
);
gPad
->
SetLogz
();
gPad
->
SetLogz
();
hDE_E_
corr
->
Draw
();
hDE_E_
splined
->
Draw
();
c2
->
cd
(
4
);
c2
->
cd
(
4
);
gPad
->
SetLogz
();
gPad
->
SetLogz
();
hDE_E_
Recu
r
->
Draw
();
hDE_E_
cor
r
->
Draw
();
c2
->
cd
(
5
);
c2
->
cd
(
5
);
gPad
->
SetLogz
();
gPad
->
SetLogz
();
hDE_Ebis_corr
->
Draw
();
hDE_Ebis_corr
->
Draw
();
...
...
This diff is collapsed.
Click to expand it.
Projects/AlPhaPha/2024/macro/chio/YCalibration/SplineChioP2P.C
+
2
−
1
View file @
aa67669a
...
@@ -53,7 +53,8 @@ void SplineChioP2P() {
...
@@ -53,7 +53,8 @@ void SplineChioP2P() {
NCallSpline
+=
1
;
NCallSpline
+=
1
;
SplineAllIC
.
at
(
1
)
=
(
SplineICurrent
);
//
SplineAllIC
.
at
(
1
)
=
(
SplineICurrent
);
//
//SplineAllIC.erase(SplineAllIC.begin() + 1); //activate this to not make the
SplineAllIC
.
erase
(
SplineAllIC
.
begin
()
+
1
);
///activate this to not make the
//spline of IC1
//spline of IC1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment