Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hallc_replay
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
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
Show more breadcrumbs
jlab
hallc
exp
polhe3
hallc_replay
Commits
75f5a994
Commit
75f5a994
authored
7 years ago
by
Carlos Yero
Browse files
Options
Downloads
Patches
Plain Diff
Add capability to calibrate SHMS calorimeter with part of a run, by
choosing an event range.
parent
2b38358f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CALIBRATION/shms_cal_calib/THcPShowerCalib.h
+27
-13
27 additions, 13 deletions
CALIBRATION/shms_cal_calib/THcPShowerCalib.h
CALIBRATION/shms_cal_calib/pcal_calib.cpp
+20
-5
20 additions, 5 deletions
CALIBRATION/shms_cal_calib/pcal_calib.cpp
with
47 additions
and
18 deletions
CALIBRATION/shms_cal_calib/THcPShowerCalib.h
+
27
−
13
View file @
75f5a994
...
...
@@ -53,7 +53,7 @@ class THcPShowerCalib {
public:
THcPShowerCalib
(
string
);
THcPShowerCalib
(
string
,
int
,
int
);
THcPShowerCalib
();
~
THcPShowerCalib
();
...
...
@@ -81,6 +81,8 @@ class THcPShowerCalib {
TTree
*
fTree
;
UInt_t
fNentries
;
UInt_t
fNstart
;
UInt_t
fNstop
;
// Declaration of leaves types
...
...
@@ -150,8 +152,10 @@ THcPShowerCalib::THcPShowerCalib() {};
//------------------------------------------------------------------------------
THcPShowerCalib
::
THcPShowerCalib
(
string
RunNumber
)
{
THcPShowerCalib
::
THcPShowerCalib
(
string
RunNumber
,
int
nstart
,
int
nstop
)
{
fRunNumber
=
RunNumber
;
fNstart
=
nstart
;
fNstop
=
nstop
;
};
//------------------------------------------------------------------------------
...
...
@@ -173,7 +177,9 @@ void THcPShowerCalib::SaveRawData() {
THcPShTrack
trk
;
for
(
UInt_t
ientry
=
0
;
ientry
<
fNentries
;
ientry
++
)
{
// for (UInt_t ientry=0; ientry<fNentries; ientry++) {
for
(
UInt_t
ientry
=
TMath
::
Max
(
UInt_t
(
0
),
fNstart
);
ientry
<
TMath
::
Min
(
fNstop
,
fNentries
);
ientry
++
)
{
if
(
ReadShRawTrack
(
trk
,
ientry
))
{
trk
.
SetEs
(
falphaC
);
...
...
@@ -281,12 +287,16 @@ void THcPShowerCalib::CalcThresholds() {
// Histogram uncalibrated energy depositions, get mean and RMS from the
// histogram, establish +/-3 * RMS thresholds.
cout
<<
"THcPShowerCalib::CalcThresholds: FNentries = "
<<
fNentries
<<
endl
;
//cout<< "THcPShowerCalib::CalcThresholds: FNentries = " << fNentries << endl;
cout
<<
"THcPShowerCalib::CalcThresholds: fNstart = "
<<
fNstart
<<
" "
<<
" fNstop = "
<<
fNstop
<<
endl
;
Int_t
nev
=
0
;
THcPShTrack
trk
;
for
(
UInt_t
ientry
=
0
;
ientry
<
fNentries
;
ientry
++
)
{
// for (UInt_t ientry=0; ientry<fNentries; ientry++) {
for
(
UInt_t
ientry
=
TMath
::
Max
(
UInt_t
(
0
),
fNstart
);
ientry
<
TMath
::
Min
(
fNstop
,
fNentries
);
ientry
++
)
{
if
(
ReadShRawTrack
(
trk
,
ientry
))
{
...
...
@@ -425,7 +435,9 @@ void THcPShowerCalib::ComposeVMs() {
// Loop over the shower track events in the ntuples.
for
(
UInt_t
ientry
=
0
;
ientry
<
fNentries
;
ientry
++
)
{
// for (UInt_t ientry=0; ientry<fNentries; ientry++) {
for
(
UInt_t
ientry
=
TMath
::
Max
(
UInt_t
(
0
),
fNstart
);
ientry
<
TMath
::
Min
(
fNstop
,
fNentries
);
ientry
++
)
{
if
(
ReadShRawTrack
(
trk
,
ientry
))
{
...
...
@@ -706,14 +718,16 @@ void THcPShowerCalib::FillHEcal() {
// Output event by event energy depositions and momenta for debug purposes.
//
ofstream
output
;
output
.
open
(
"calibrated.deb"
,
ios
::
out
);
//
ofstream output;
//
output.open("calibrated.deb",ios::out);
Int_t
nev
=
0
;
THcPShTrack
trk
;
for
(
UInt_t
ientry
=
0
;
ientry
<
fNentries
;
ientry
++
)
{
// for (UInt_t ientry=0; ientry<fNentries; ientry++) {
for
(
UInt_t
ientry
=
TMath
::
Max
(
UInt_t
(
0
),
fNstart
);
ientry
<
TMath
::
Min
(
fNstop
,
fNentries
);
ientry
++
)
{
if
(
ReadShRawTrack
(
trk
,
ientry
))
{
// trk.Print(cout);
...
...
@@ -729,15 +743,15 @@ void THcPShowerCalib::FillHEcal() {
hESHvsEPR
->
Fill
(
trk
.
EPRnorm
(),
trk
.
ESHnorm
());
output
<<
Enorm
*
P
/
1000.
<<
" "
<<
P
/
1000.
<<
" "
<<
delta
<<
" "
<<
trk
.
GetX
()
<<
" "
<<
trk
.
GetY
()
<<
endl
;
//
output << Enorm*P/1000. << " " << P/1000. << " " << delta << " "
//
<< trk.GetX() << " " << trk.GetY() << endl;
nev
++
;
}
};
output
.
close
();
//
output.close();
cout
<<
"FillHEcal: "
<<
nev
<<
" events filled"
<<
endl
;
};
...
...
@@ -752,7 +766,7 @@ void THcPShowerCalib::SaveAlphas() {
//
ofstream
output
;
char
*
fname
=
Form
(
"pcal.param.%s"
,
fRunNumber
.
c_str
());
char
*
fname
=
Form
(
"pcal.param.%s
_%d-%d
"
,
fRunNumber
.
c_str
()
,
fNstart
,
fNstop
);
cout
<<
"SaveAlphas: fname="
<<
fname
<<
endl
;
output
.
open
(
fname
,
ios
::
out
);
...
...
This diff is collapsed.
Click to expand it.
CALIBRATION/shms_cal_calib/pcal_calib.cpp
+
20
−
5
View file @
75f5a994
...
...
@@ -8,14 +8,15 @@
// A steering Root script for the SHMS calorimeter calibration.
//
void
pcal_calib
(
string
RunNumber
)
{
void
pcal_calib
(
string
RunNumber
,
int
nstart
=
0
,
int
nstop
=
999999999
)
{
// Initialize the analysis clock
clock_t
t
=
clock
();
cout
<<
"Calibrating run "
<<
RunNumber
<<
endl
;
cout
<<
"Calibrating run "
<<
RunNumber
<<
", events "
<<
nstart
<<
" -- "
<<
nstop
<<
endl
;
THcPShowerCalib
theShowerCalib
(
RunNumber
);
THcPShowerCalib
theShowerCalib
(
RunNumber
,
nstart
,
nstop
);
theShowerCalib
.
Init
();
// Initialize constants and variables
theShowerCalib
.
CalcThresholds
();
// Thresholds on the uncalibrated Edep/P
...
...
@@ -41,7 +42,7 @@ void pcal_calib(string RunNumber) {
theShowerCalib
.
hEuncSel
->
DrawCopy
(
"same"
);
Canvas
->
cd
(
2
);
theShowerCalib
.
hESHvsEPR
->
Draw
(
"colz"
);
theShowerCalib
.
hESHvsEPR
->
Draw
();
// Normalized energy deposition after calibration.
...
...
@@ -56,7 +57,21 @@ void pcal_calib(string RunNumber) {
// SHMS delta(P) versus the calibrated energy deposition.
Canvas
->
cd
(
4
);
theShowerCalib
.
hDPvsEcal
->
Draw
(
"colz"
);
theShowerCalib
.
hDPvsEcal
->
Draw
();
// Save canvas in a pdf format.
Canvas
->
Print
(
Form
(
"%s_%d-%d.pdf"
,
RunNumber
.
c_str
(),
nstart
,
nstop
));
// Save histograms in root file.
//TFile* froot=new TFile(Form("%s_%d-%d.root",RunNumber.c_str(),nstart,nstop),
// "RECREATE");
// theShowerCalib.hEunc->Write();
// theShowerCalib.hEuncSel->Write();
// theShowerCalib.hESHvsEPR->Write();
// theShowerCalib.hEcal->Write();
// theShowerCalib.hDPvsEcal->Write();
// froot->Close();
// Calculate the analysis rate
t
=
clock
()
-
t
;
...
...
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