Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reconstruction_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
EIC
benchmarks
reconstruction_benchmarks
Commits
14155fff
Commit
14155fff
authored
4 years ago
by
Jihee Kim
Browse files
Options
Downloads
Patches
Plain Diff
Eres fit script into CI pipeline
parent
0b24bac9
Branches
Branches containing commit
No related tags found
1 merge request
!53
Eres fit script into CI pipeline
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ecal/emcal_electrons.sh
+7
-0
7 additions, 0 deletions
ecal/emcal_electrons.sh
ecal/scripts/rec_emcal_resolution_analysis.cxx
+108
-97
108 additions, 97 deletions
ecal/scripts/rec_emcal_resolution_analysis.cxx
with
115 additions
and
97 deletions
ecal/emcal_electrons.sh
+
7
−
0
View file @
14155fff
...
@@ -104,6 +104,13 @@ if [[ "$?" -ne "0" ]] ; then
...
@@ -104,6 +104,13 @@ if [[ "$?" -ne "0" ]] ; then
exit
1
exit
1
fi
fi
# Script to generate energy resolution plots
root
-b
-q
"ecal/scripts/rec_emcal_resolution_analysis.cxx(
\"
${
JUGGLER_DETECTOR
}
/
${
JUGGLER_REC_FILE
}
\"
)"
if
[[
"
$?
"
-ne
"0"
]]
;
then
echo
"ERROR running analysis script"
exit
1
fi
#paste results/sim_${JUGGLER_FILE_NAME_TAG}.txt results/rec_${JUGGLER_FILE_NAME_TAG}.txt > results/eng_${JUGGLER_FILE_NAME_TAG}.txt
#paste results/sim_${JUGGLER_FILE_NAME_TAG}.txt results/rec_${JUGGLER_FILE_NAME_TAG}.txt > results/eng_${JUGGLER_FILE_NAME_TAG}.txt
#root -b -q "ecal/scripts/read_eng.C(\"results/eng_${JUGGLER_FILE_NAME_TAG}.root\", \"results/eng_${JUGGLER_FILE_NAME_TAG}.txt\")"
#root -b -q "ecal/scripts/read_eng.C(\"results/eng_${JUGGLER_FILE_NAME_TAG}.root\", \"results/eng_${JUGGLER_FILE_NAME_TAG}.txt\")"
#root -b -q "ecal/scripts/cal_eng_res.C(\"results/eng_${JUGGLER_FILE_NAME_TAG}.root\")"
#root -b -q "ecal/scripts/cal_eng_res.C(\"results/eng_${JUGGLER_FILE_NAME_TAG}.root\")"
...
...
This diff is collapsed.
Click to expand it.
ecal/scripts/rec_emcal_resolution_analysis.cxx
+
108
−
97
View file @
14155fff
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
#include
"ROOT/RDataFrame.hxx"
#include
"ROOT/RDataFrame.hxx"
#include
<iostream>
#include
<iostream>
#include
"dd4pod/Geant4ParticleCollection.h"
#include
"dd4pod/CalorimeterHitCollection.h"
#include
"dd4pod/CalorimeterHitCollection.h"
#include
"dd4pod/Geant4ParticleCollection.h"
#include
"dd4pod/TrackerHitCollection.h"
#include
"dd4pod/TrackerHitCollection.h"
#include
"eicd/CalorimeterHitCollection.h"
#include
"eicd/CalorimeterHitCollection.h"
#include
"eicd/CalorimeterHitData.h"
#include
"eicd/CalorimeterHitData.h"
...
@@ -16,10 +16,10 @@
...
@@ -16,10 +16,10 @@
#include
"eicd/ClusterData.h"
#include
"eicd/ClusterData.h"
#include
"TCanvas.h"
#include
"TCanvas.h"
#include
"TStyle.h"
#include
"TMath.h"
#include
"TH1.h"
#include
"TH1.h"
#include
"TH1D.h"
#include
"TH1D.h"
#include
"TMath.h"
#include
"TStyle.h"
// If root cannot find a dd4pod header make sure to add the include dir to ROOT_INCLUDE_PATH:
// If root cannot find a dd4pod header make sure to add the include dir to ROOT_INCLUDE_PATH:
// export ROOT_INCLUDE_PATH=$HOME/include:$ROOT_INCLUDE_PATH
// export ROOT_INCLUDE_PATH=$HOME/include:$ROOT_INCLUDE_PATH
...
@@ -45,64 +45,69 @@ void rec_emcal_resolution_analysis(const char* input_fname = "rec_emcal_uniform_
...
@@ -45,64 +45,69 @@ void rec_emcal_resolution_analysis(const char* input_fname = "rec_emcal_uniform_
ROOT
::
RDataFrame
d0
(
"events"
,
input_fname
);
ROOT
::
RDataFrame
d0
(
"events"
,
input_fname
);
// Number of Clusters
// Number of Clusters
auto
ncluster
=
[]
(
const
std
::
vector
<
eic
::
ClusterData
>&
evt
)
{
return
(
int
)
evt
.
size
();
};
auto
ncluster
=
[](
const
std
::
vector
<
eic
::
ClusterData
>&
evt
)
{
return
(
int
)
evt
.
size
();
};
// Cluster Energy [GeV]
// Cluster Energy [GeV]
auto
clusterE
=
[]
(
const
std
::
vector
<
eic
::
ClusterData
>&
evt
)
{
auto
clusterE
=
[](
const
std
::
vector
<
eic
::
ClusterData
>&
evt
)
{
std
::
vector
<
double
>
result
;
std
::
vector
<
double
>
result
;
for
(
const
auto
&
i
:
evt
)
for
(
const
auto
&
i
:
evt
)
result
.
push_back
(
i
.
energy
);
result
.
push_back
(
i
.
energy
);
return
result
;
return
result
;
};
};
// Thrown Energy [GeV]
// Thrown Energy [GeV]
auto
E_thr
=
[](
std
::
vector
<
dd4pod
::
Geant4ParticleData
>
const
&
input
)
{
auto
E_thr
=
[](
std
::
vector
<
dd4pod
::
Geant4ParticleData
>
const
&
input
)
{
std
::
vector
<
double
>
result
;
std
::
vector
<
double
>
result
;
result
.
push_back
(
TMath
::
Sqrt
(
input
[
2
].
psx
*
input
[
2
].
psx
+
input
[
2
].
psy
*
input
[
2
].
psy
+
input
[
2
].
psz
*
input
[
2
].
psz
+
input
[
2
].
mass
*
input
[
2
].
mass
));
result
.
push_back
(
TMath
::
Sqrt
(
input
[
2
].
psx
*
input
[
2
].
psx
+
input
[
2
].
psy
*
input
[
2
].
psy
+
return
result
;
input
[
2
].
psz
*
input
[
2
].
psz
+
input
[
2
].
mass
*
input
[
2
].
mass
));
return
result
;
};
};
// Energy Resolution = delta(E)/E
// Energy Resolution = delta(E)/E
// delta(E) = (Erec - Ethr)
// delta(E) = (Erec - Ethr)
// E = Ethr
// E = Ethr
auto
E_res
=
[]
(
const
std
::
vector
<
double
>&
Erec
,
const
std
::
vector
<
double
>&
Ethr
)
{
auto
E_res
=
[](
const
std
::
vector
<
double
>&
Erec
,
const
std
::
vector
<
double
>&
Ethr
)
{
std
::
vector
<
double
>
result
;
std
::
vector
<
double
>
result
;
for
(
const
auto
&
E1
:
Ethr
)
{
for
(
const
auto
&
E1
:
Ethr
)
{
for
(
const
auto
&
E2
:
Erec
)
{
for
(
const
auto
&
E2
:
Erec
)
{
result
.
push_back
((
E2
-
E1
)
/
E1
);
result
.
push_back
((
E2
-
E1
)
/
E1
);
}
}
}
}
return
result
;
return
result
;
};
};
// Define variables
// Define variables
auto
d1
=
d0
.
Define
(
"ncluster"
,
ncluster
,
{
"EcalClusters"
})
auto
d1
=
d0
.
Define
(
"ncluster"
,
ncluster
,
{
"EcalClusters"
})
.
Define
(
"clusterE"
,
clusterE
,
{
"EcalClusters"
})
.
Define
(
"clusterE"
,
clusterE
,
{
"EcalClusters"
})
.
Define
(
"E_thr"
,
E_thr
,
{
"mcparticles2"
})
.
Define
(
"E_thr"
,
E_thr
,
{
"mcparticles2"
})
.
Define
(
"E_res"
,
E_res
,
{
"clusterE"
,
"E_thr"
})
.
Define
(
"E_res"
,
E_res
,
{
"clusterE"
,
"E_thr"
});
;
// Define Cuts
// Define Cuts
// d2: Select Events with One Cluster
// d2: Select Events with One Cluster
// d3: Select Events which determined their center of cluster not being on the edge of detector in addition to d2 cut
// d3: Select Events which determined their center of cluster not being on the edge of detector in addition to d2 cut
auto
d2
=
d1
.
Filter
(
"ncluster==1"
);
auto
d2
=
d1
.
Filter
(
"ncluster==1"
);
auto
d3
=
d2
.
Filter
([
=
]
(
const
std
::
vector
<
eic
::
ClusterData
>&
evt
)
{
auto
d3
=
d2
.
Filter
(
for
(
const
auto
&
i
:
evt
)
{
[
=
](
const
std
::
vector
<
eic
::
ClusterData
>&
evt
)
{
auto
pos_x
=
i
.
position
.
x
;
for
(
const
auto
&
i
:
evt
)
{
auto
pos_y
=
i
.
position
.
y
;
auto
pos_x
=
i
.
position
.
x
;
auto
radial_dist
=
TMath
::
Sqrt
(
pos_x
*
pos_x
+
pos_y
*
pos_y
);
auto
pos_y
=
i
.
position
.
y
;
if
(
radial_dist
>
8.0
&&
radial_dist
<
30.0
)
auto
radial_dist
=
TMath
::
Sqrt
(
pos_x
*
pos_x
+
pos_y
*
pos_y
);
return
true
;
if
(
radial_dist
>
8.0
&&
radial_dist
<
30.0
)
}
return
true
;
return
false
;},
{
"EcalClusters"
});
}
return
false
;
},
{
"EcalClusters"
});
// Define histograms
// Define histograms
auto
hEresNC1
=
d2
.
Histo1D
({
"hEresNC1"
,
"Energy Resolution CE vs Ethr w/ NC1; #DeltaE/E; Events"
,
100
,
-
0.5
,
0.5
},
"E_res"
);
auto
hEresNC1
=
auto
hEresNC1EGCUT
=
d3
.
Histo1D
({
"hEresNC1EGCUT"
,
"Energy Resolution CE vs Ethr w/ NC1 EGCUT; #DeltaE/E; Events"
,
100
,
-
0.5
,
0.5
},
"E_res"
);
d2
.
Histo1D
({
"hEresNC1"
,
"Energy Resolution CE vs Ethr w/ NC1; #DeltaE/E; Events"
,
100
,
-
0.5
,
0.5
},
"E_res"
);
auto
hEresNC1EGCUT
=
d3
.
Histo1D
(
{
"hEresNC1EGCUT"
,
"Energy Resolution CE vs Ethr w/ NC1 EGCUT; #DeltaE/E; Events"
,
100
,
-
0.5
,
0.5
},
"E_res"
);
// Energy Resolution Graphs
// Energy Resolution Graphs
// Divided into serveral energy bin group
// Divided into serveral energy bin group
// Do gaussian
g
it to extract mean and sigma
// Do gaussian
f
it to extract mean and sigma
int
nbin
=
12
;
// number of energy bin group
int
nbin
=
12
;
// number of energy bin group
double
maxEnergy
=
30.0
;
// maximum of energy in dataset
double
maxEnergy
=
30.0
;
// maximum of energy in dataset
double
multiple
=
maxEnergy
/
(
double
)
nbin
;
// energy interval between energy bin group
double
multiple
=
maxEnergy
/
(
double
)
nbin
;
// energy interval between energy bin group
...
@@ -123,106 +128,110 @@ void rec_emcal_resolution_analysis(const char* input_fname = "rec_emcal_uniform_
...
@@ -123,106 +128,110 @@ void rec_emcal_resolution_analysis(const char* input_fname = "rec_emcal_uniform_
// Define hitogram and do gaussian fit
// Define hitogram and do gaussian fit
// Save fit results; mean, sigma, error on mean & sigam
// Save fit results; mean, sigma, error on mean & sigam
// Calculate resolution and resolution error
// Calculate resolution and resolution error
for
(
int
n
=
1
;
n
<=
nbin
;
n
++
)
{
for
(
int
n
=
1
;
n
<=
nbin
;
n
++
)
{
maximumE
=
n
*
multiple
;
maximumE
=
n
*
multiple
;
minimumE
=
maximumE
-
multiple
;
minimumE
=
maximumE
-
multiple
;
gEbin
[
n
-
1
]
=
(
maximumE
+
minimumE
)
/
2.0
;
gEbin
[
n
-
1
]
=
(
maximumE
+
minimumE
)
/
2.0
;
invSqrtgEbin
[
n
-
1
]
=
1.0
/
TMath
::
Sqrt
(
gEbin
[
n
-
1
]);
invSqrtgEbin
[
n
-
1
]
=
1.0
/
TMath
::
Sqrt
(
gEbin
[
n
-
1
]);
// Define histogram
// Define histogram
auto
h
=
d3
.
Filter
([
=
]
(
const
std
::
vector
<
eic
::
ClusterData
>&
evt
)
{
auto
h
=
d3
.
Filter
(
for
(
const
auto
&
i
:
evt
)
{
[
=
](
const
std
::
vector
<
eic
::
ClusterData
>&
evt
)
{
auto
eng
=
i
.
energy
;
for
(
const
auto
&
i
:
evt
)
{
if
(
eng
>=
minimumE
&&
eng
<
maximumE
)
auto
eng
=
i
.
energy
;
return
true
;
if
(
eng
>=
minimumE
&&
eng
<
maximumE
)
}
return
true
;
return
false
;},
{
"EcalClusters"
})
}
.
Histo1D
({
"h"
,
"Energy Resolution; #DeltaE/E; Events"
,
100
,
-
0.5
,
0.5
},
"E_res"
);
return
false
;
// Gaussian fit
},
h
->
Fit
(
"gaus"
,
"W,E"
);
{
"EcalClusters"
})
// Save fit results
.
Histo1D
({
"h"
,
"Energy Resolution; #DeltaE/E; Events"
,
100
,
-
0.5
,
0.5
},
"E_res"
);
// how to access how many events in histogram: h->GetEntries();
// Gaussian fit
if
(
h
->
GetFunction
(
"gaus"
))
{
h
->
Fit
(
"gaus"
,
"W"
,
""
,
h
->
GetMean
()
-
2.0
*
h
->
GetRMS
(),
h
->
GetMean
()
+
2.0
*
h
->
GetRMS
());
mean
[
n
-
1
]
=
TMath
::
Abs
(
h
->
GetFunction
(
"gaus"
)
->
GetParameter
(
1
));
// Save fit results
dmean
[
n
-
1
]
=
h
->
GetFunction
(
"gaus"
)
->
GetParError
(
1
);
// how to access how many events in histogram: h->GetEntries();
sigma
[
n
-
1
]
=
h
->
GetFunction
(
"gaus"
)
->
GetParameter
(
2
);
if
(
h
->
GetFunction
(
"gaus"
))
{
dsigma
[
n
-
1
]
=
h
->
GetFunction
(
"gaus"
)
->
GetParError
(
2
);
mean
[
n
-
1
]
=
TMath
::
Abs
(
h
->
GetFunction
(
"gaus"
)
->
GetParameter
(
1
));
resolution
[
n
-
1
]
=
sigma
[
n
-
1
]
/
mean
[
n
-
1
];
dmean
[
n
-
1
]
=
h
->
GetFunction
(
"gaus"
)
->
GetParError
(
1
);
resolutionErrorSigma
=
dsigma
[
n
-
1
]
/
mean
[
n
-
1
];
sigma
[
n
-
1
]
=
h
->
GetFunction
(
"gaus"
)
->
GetParameter
(
2
);
resolutionErrorMean
=
dmean
[
n
-
1
]
*
sigma
[
n
-
1
];
dsigma
[
n
-
1
]
=
h
->
GetFunction
(
"gaus"
)
->
GetParError
(
2
);
resolutionError
[
n
-
1
]
=
TMath
::
Sqrt
(
resolutionErrorSigma
*
resolutionErrorSigma
+
resolutionErrorMean
*
resolutionErrorMean
);
resolution
[
n
-
1
]
=
sigma
[
n
-
1
]
/
mean
[
n
-
1
];
xerror
[
n
-
1
]
=
0.0
;
resolutionErrorSigma
=
dsigma
[
n
-
1
]
/
mean
[
n
-
1
];
}
resolutionErrorMean
=
dmean
[
n
-
1
]
*
sigma
[
n
-
1
];
// Draw histogram, but
resolutionError
[
n
-
1
]
=
// Just save fit results
TMath
::
Sqrt
(
resolutionErrorSigma
*
resolutionErrorSigma
+
resolutionErrorMean
*
resolutionErrorMean
);
//TCanvas *c = new TCanvas("c", "c", 500, 500);
xerror
[
n
-
1
]
=
0.0
;
//h->GetYaxis()->SetTitleOffset(1.4);
}
//h->SetLineWidth(2);
// Draw histogram, but
//h->SetLineColor(kBlue);
// Just save fit results
//h->Fit("gaus","W,E");
// TCanvas *c = new TCanvas("c", "c", 500, 500);
//h->DrawClone();
// h->GetYaxis()->SetTitleOffset(1.4);
//c->SaveAs("results/h.png");
// h->SetLineWidth(2);
// h->SetLineColor(kBlue);
// h->Fit("gaus","W,E");
// h->DrawClone();
// c->SaveAs("results/h.png");
}
}
// Generate graphs using gaussian fit results
// Generate graphs using gaussian fit results
// Cluster energy VS Simga
// Cluster energy VS Simga
TGraphErrors
*
gCEVsSigmaNC1EGCUT
=
new
TGraphErrors
(
nbin
,
gEbin
,
sigma
,
xerror
,
dsigma
);
TGraphErrors
*
gCEVsSigmaNC1EGCUT
=
new
TGraphErrors
(
nbin
,
gEbin
,
sigma
,
xerror
,
dsigma
);
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"c1"
,
500
,
500
);
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"c1"
,
500
,
500
);
gCEVsSigmaNC1EGCUT
->
SetTitle
(
"Cluster Energy vs #sigma"
);
gCEVsSigmaNC1EGCUT
->
SetTitle
(
"Cluster Energy vs #sigma"
);
gCEVsSigmaNC1EGCUT
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gCEVsSigmaNC1EGCUT
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gCEVsSigmaNC1EGCUT
->
GetXaxis
()
->
SetTitle
(
"Cluster Energy [GeV]"
);
gCEVsSigmaNC1EGCUT
->
GetXaxis
()
->
SetTitle
(
"Cluster Energy [GeV]"
);
gCEVsSigmaNC1EGCUT
->
GetYaxis
()
->
SetTitle
(
"#sigma"
);
gCEVsSigmaNC1EGCUT
->
GetYaxis
()
->
SetTitle
(
"#sigma"
);
gCEVsSigmaNC1EGCUT
->
GetYaxis
()
->
SetRangeUser
(
0.0
,
0.05
);
gCEVsSigmaNC1EGCUT
->
GetYaxis
()
->
SetRangeUser
(
0.0
,
0.05
);
gCEVsSigmaNC1EGCUT
->
SetMarkerStyle
(
21
);
gCEVsSigmaNC1EGCUT
->
SetMarkerStyle
(
21
);
gCEVsSigmaNC1EGCUT
->
DrawClone
(
"AEP"
);
gCEVsSigmaNC1EGCUT
->
DrawClone
(
"AEP"
);
c1
->
SaveAs
(
"results/emcal_electrons_gCEVsSigmaNC1EGCUT.png"
);
c1
->
SaveAs
(
"results/emcal_electrons_gCEVsSigmaNC1EGCUT.png"
);
c1
->
SaveAs
(
"results/emcal_electrons_gCEVsSigmaNC1EGCUT.pdf"
);
c1
->
SaveAs
(
"results/emcal_electrons_gCEVsSigmaNC1EGCUT.pdf"
);
// Cluster energy VS Mean
// Cluster energy VS Mean
TGraphErrors
*
gCEVsMeanNC1EGCUT
=
new
TGraphErrors
(
nbin
,
gEbin
,
mean
,
xerror
,
dmean
);
TGraphErrors
*
gCEVsMeanNC1EGCUT
=
new
TGraphErrors
(
nbin
,
gEbin
,
mean
,
xerror
,
dmean
);
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"c2"
,
500
,
500
);
TCanvas
*
c2
=
new
TCanvas
(
"c2"
,
"c2"
,
500
,
500
);
gCEVsMeanNC1EGCUT
->
SetTitle
(
"Cluster Energy vs #mu"
);
gCEVsMeanNC1EGCUT
->
SetTitle
(
"Cluster Energy vs #mu"
);
gCEVsMeanNC1EGCUT
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gCEVsMeanNC1EGCUT
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gCEVsMeanNC1EGCUT
->
GetXaxis
()
->
SetTitle
(
"Cluster Energy [GeV]"
);
gCEVsMeanNC1EGCUT
->
GetXaxis
()
->
SetTitle
(
"Cluster Energy [GeV]"
);
gCEVsMeanNC1EGCUT
->
GetYaxis
()
->
SetTitle
(
"#mu"
);
gCEVsMeanNC1EGCUT
->
GetYaxis
()
->
SetTitle
(
"#mu"
);
gCEVsMeanNC1EGCUT
->
GetYaxis
()
->
SetRangeUser
(
0.0
,
0.1
);
gCEVsMeanNC1EGCUT
->
GetYaxis
()
->
SetRangeUser
(
0.0
,
0.1
);
gCEVsMeanNC1EGCUT
->
SetMarkerStyle
(
21
);
gCEVsMeanNC1EGCUT
->
SetMarkerStyle
(
21
);
gCEVsMeanNC1EGCUT
->
DrawClone
(
"AEP"
);
gCEVsMeanNC1EGCUT
->
DrawClone
(
"AEP"
);
c2
->
SaveAs
(
"results/emcal_electrons_gCEVsMeanNC1EGCUT.png"
);
c2
->
SaveAs
(
"results/emcal_electrons_gCEVsMeanNC1EGCUT.png"
);
c2
->
SaveAs
(
"results/emcal_electrons_gCEVsMeanNC1EGCUT.pdf"
);
c2
->
SaveAs
(
"results/emcal_electrons_gCEVsMeanNC1EGCUT.pdf"
);
// Inverse of sqrt(cluster energy) VS resolution
// Inverse of sqrt(cluster energy) VS resolution
TGraphErrors
*
gInvSqCEVsSigmaENC1EGCUT
=
new
TGraphErrors
(
nbin
,
invSqrtgEbin
,
resolution
,
xerror
,
resolutionError
);
TGraphErrors
*
gInvSqCEVsSigmaENC1EGCUT
=
new
TGraphErrors
(
nbin
,
invSqrtgEbin
,
resolution
,
xerror
,
resolutionError
);
TCanvas
*
c3
=
new
TCanvas
(
"c3"
,
"c3"
,
500
,
500
);
TCanvas
*
c3
=
new
TCanvas
(
"c3"
,
"c3"
,
500
,
500
);
gInvSqCEVsSigmaENC1EGCUT
->
SetTitle
(
"#sigma/E [%] vs 1/sqrt(Cluster Energy)"
);
gInvSqCEVsSigmaENC1EGCUT
->
SetTitle
(
"#sigma/E [%] vs 1/sqrt(Cluster Energy)"
);
gInvSqCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gInvSqCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gInvSqCEVsSigmaENC1EGCUT
->
GetXaxis
()
->
SetTitle
(
"1/sqrt(Cluster Energy)"
);
gInvSqCEVsSigmaENC1EGCUT
->
GetXaxis
()
->
SetTitle
(
"1/sqrt(Cluster Energy)"
);
gInvSqCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetTitle
(
"#sigma/E [%]"
);
gInvSqCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetTitle
(
"#sigma/E [%]"
);
gInvSqCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetRangeUser
(
0.0
,
1.5
);
gInvSqCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetRangeUser
(
0.0
,
1.5
);
gInvSqCEVsSigmaENC1EGCUT
->
GetXaxis
()
->
SetRangeUser
(
0.0
,
1.5
);
gInvSqCEVsSigmaENC1EGCUT
->
GetXaxis
()
->
SetRangeUser
(
0.0
,
1.5
);
gInvSqCEVsSigmaENC1EGCUT
->
SetMarkerStyle
(
21
);
gInvSqCEVsSigmaENC1EGCUT
->
SetMarkerStyle
(
21
);
gInvSqCEVsSigmaENC1EGCUT
->
DrawClone
(
"AEP"
);
gInvSqCEVsSigmaENC1EGCUT
->
DrawClone
(
"AEP"
);
c3
->
SaveAs
(
"results/emcal_electrons_gInvSqCEVsSimgaENC1EGCUT.png"
);
c3
->
SaveAs
(
"results/emcal_electrons_gInvSqCEVsSimgaENC1EGCUT.png"
);
c3
->
SaveAs
(
"results/emcal_electrons_gInvSqCEVsSigmaENC1EGCUT.pdf"
);
c3
->
SaveAs
(
"results/emcal_electrons_gInvSqCEVsSigmaENC1EGCUT.pdf"
);
// Fit Function
// Fit Function
// sigma/E = S/sqrt(E) + N/E + C; added in quadrature
// sigma/E = S/sqrt(E) + N/E + C; added in quadrature
// S: Stochastic term
// S: Stochastic term
// N: Niose term
// N: Niose term
// C: Constant term
// C: Constant term
TF1
*
f1
=
new
TF1
(
"f1"
,
"sqrt([0]*[0] + pow([1]/sqrt(x),2) + pow([2]/x,2))"
,
0.5
,
30.0
);
TF1
*
f1
=
new
TF1
(
"f1"
,
"sqrt([0]*[0] + pow([1]/sqrt(x),2) + pow([2]/x,2))"
,
0.5
,
30.0
);
f1
->
SetParNames
(
"C"
,
"S"
,
"N"
);
// param names
f1
->
SetParNames
(
"C"
,
"S"
,
"N"
);
// param names
f1
->
SetParameters
(
0.30
,
2.80
,
0.12
);
// initial param values
f1
->
SetParameters
(
0.30
,
2.80
,
0.12
);
// initial param values
f1
->
SetLineWidth
(
2
);
f1
->
SetLineWidth
(
2
);
f1
->
SetLineColor
(
kRed
);
f1
->
SetLineColor
(
kRed
);
// Cluster energy VS resolution
// Cluster energy VS resolution
TGraphErrors
*
gCEVsSigmaENC1EGCUT
=
new
TGraphErrors
(
nbin
,
gEbin
,
resolution
,
xerror
,
resolutionError
);
TGraphErrors
*
gCEVsSigmaENC1EGCUT
=
new
TGraphErrors
(
nbin
,
gEbin
,
resolution
,
xerror
,
resolutionError
);
TCanvas
*
c4
=
new
TCanvas
(
"c4"
,
"c4"
,
500
,
500
);
TCanvas
*
c4
=
new
TCanvas
(
"c4"
,
"c4"
,
500
,
500
);
gCEVsSigmaENC1EGCUT
->
SetTitle
(
"Cluster Energy vs #sigma/E [%]"
);
gCEVsSigmaENC1EGCUT
->
SetTitle
(
"Cluster Energy vs #sigma/E [%]"
);
gCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetTitleOffset
(
1.4
);
gCEVsSigmaENC1EGCUT
->
GetXaxis
()
->
SetTitle
(
"Cluster Energy [GeV]"
);
gCEVsSigmaENC1EGCUT
->
GetXaxis
()
->
SetTitle
(
"Cluster Energy [GeV]"
);
gCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetTitle
(
"#sigma/E [%]"
);
gCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetTitle
(
"#sigma/E [%]"
);
gCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetRangeUser
(
0.0
,
1.5
);
gCEVsSigmaENC1EGCUT
->
GetYaxis
()
->
SetRangeUser
(
0.0
,
1.5
);
gCEVsSigmaENC1EGCUT
->
SetMarkerStyle
(
21
);
gCEVsSigmaENC1EGCUT
->
SetMarkerStyle
(
21
);
gCEVsSigmaENC1EGCUT
->
Fit
(
"f1"
,
"W
,E
"
);
gCEVsSigmaENC1EGCUT
->
Fit
(
"f1"
,
"W"
);
gCEVsSigmaENC1EGCUT
->
DrawClone
(
"AEP"
);
gCEVsSigmaENC1EGCUT
->
DrawClone
(
"AEP"
);
c4
->
SaveAs
(
"results/emcal_electrons_gCEVsSimgaENC1EGCUT.png"
);
c4
->
SaveAs
(
"results/emcal_electrons_gCEVsSimgaENC1EGCUT.png"
);
c4
->
SaveAs
(
"results/emcal_electrons_gCEVsSigmaENC1EGCUT.pdf"
);
c4
->
SaveAs
(
"results/emcal_electrons_gCEVsSigmaENC1EGCUT.pdf"
);
...
@@ -232,6 +241,8 @@ void rec_emcal_resolution_analysis(const char* input_fname = "rec_emcal_uniform_
...
@@ -232,6 +241,8 @@ void rec_emcal_resolution_analysis(const char* input_fname = "rec_emcal_uniform_
auto
nevents_cluster1
=
d2
.
Count
();
auto
nevents_cluster1
=
d2
.
Count
();
auto
nevents_cluster1cut
=
d3
.
Count
();
auto
nevents_cluster1cut
=
d3
.
Count
();
std
::
cout
<<
"Number of Events: "
<<
(
*
nevents_cluster1
)
<<
" / "
<<
(
*
nevents_thrown
)
<<
" = single cluster events/all
\n
"
;
std
::
cout
<<
"Number of Events: "
<<
(
*
nevents_cluster1
)
<<
" / "
<<
(
*
nevents_thrown
)
std
::
cout
<<
"Number of Events: "
<<
(
*
nevents_cluster1cut
)
<<
" / "
<<
(
*
nevents_thrown
)
<<
" = single cluster events that passed edge cut/all
\n
"
;
<<
" = single cluster events/all
\n
"
;
std
::
cout
<<
"Number of Events: "
<<
(
*
nevents_cluster1cut
)
<<
" / "
<<
(
*
nevents_thrown
)
<<
" = single cluster events that passed edge cut/all
\n
"
;
}
}
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