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
f3b16f4b
Commit
f3b16f4b
authored
8 years ago
by
hallc-online
Browse files
Options
Downloads
Patches
Plain Diff
Expedite SHMS calorimeter calibration code.
parent
9fb9122e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CALIBRATION/shms_cal_calib/THcPShowerCalib.h
+72
-2
72 additions, 2 deletions
CALIBRATION/shms_cal_calib/THcPShowerCalib.h
CALIBRATION/shms_cal_calib/pcal_calib.cpp
+6
-0
6 additions, 0 deletions
CALIBRATION/shms_cal_calib/pcal_calib.cpp
with
78 additions
and
2 deletions
CALIBRATION/shms_cal_calib/THcPShowerCalib.h
+
72
−
2
View file @
f3b16f4b
...
...
@@ -16,6 +16,8 @@
#include
"TFile.h"
#include
"TTree.h"
#include
<time.h>
#define D_CALO_FP 275. //distance from FP to the Preshower
//Whole calorimeter
...
...
@@ -75,6 +77,41 @@ class THcPShowerCalib {
TTree
*
fTree
;
UInt_t
fNentries
;
// Declaration of leaves types
// Preshower and Shower ADC signals.
////Double_t P_pr_a_p[THcPShTrack::fNrows_pr][THcPShTrack::fNcols_pr];
////Double_t P_sh_a_p[THcPShTrack::fNrows_sh][THcPShTrack::fNcols_sh];
Double_t
P_pr_apos_p
[
THcPShTrack
::
fNrows_pr
];
Double_t
P_pr_aneg_p
[
THcPShTrack
::
fNrows_pr
];
Double_t
P_sh_a_p
[
THcPShTrack
::
fNcols_sh
][
THcPShTrack
::
fNrows_sh
];
// Track parameters.
double
P_tr_n
;
Double_t
P_tr_p
;
Double_t
P_tr_x
;
//X FP
Double_t
P_tr_xp
;
Double_t
P_tr_y
;
//Y FP
Double_t
P_tr_yp
;
Double_t
P_tr_tg_dp
;
Double_t
P_hgcer_npe
[
4
];
TBranch
*
b_P_tr_p
;
TBranch
*
b_P_pr_apos_p
;
TBranch
*
b_P_pr_aneg_p
;
TBranch
*
b_P_sh_a_p
;
TBranch
*
b_P_tr_n
;
TBranch
*
b_P_tr_x
;
TBranch
*
b_P_tr_y
;
TBranch
*
b_P_tr_xp
;
TBranch
*
b_P_tr_yp
;
TBranch
*
b_P_tr_tg_dp
;
TBranch
*
b_P_hgcer_npe
;
// Quantities for calculations of the calibration constants.
Double_t
fe0
;
...
...
@@ -150,6 +187,37 @@ void THcPShowerCalib::Init() {
fNentries
=
fTree
->
GetEntries
();
cout
<<
"THcPShowerCalib::Init: fNentries= "
<<
fNentries
<<
endl
;
/*
fTree->SetBranchAddress("P.cal.pr.apos_p",P_pr_apos_p);
fTree->SetBranchAddress("P.cal.pr.aneg_p",P_pr_aneg_p);
fTree->SetBranchAddress("P.cal.fly.a_p",P_sh_a_p);
fTree->SetBranchAddress("P.tr.n", &P_tr_n);
fTree->SetBranchAddress("P.tr.x", &P_tr_x);
fTree->SetBranchAddress("P.tr.y", &P_tr_y);
fTree->SetBranchAddress("P.tr.th",&P_tr_xp);
fTree->SetBranchAddress("P.tr.ph",&P_tr_yp);
fTree->SetBranchAddress("P.tr.p", &P_tr_p);
fTree->SetBranchAddress("P.tr.tg_dp", &P_tr_tg_dp);
fTree->SetBranchAddress("P.hgcer.npe", P_hgcer_npe);
*/
fTree
->
SetBranchAddress
(
"P.cal.pr.apos_p"
,
P_pr_apos_p
,
&
b_P_pr_apos_p
);
fTree
->
SetBranchAddress
(
"P.cal.pr.aneg_p"
,
P_pr_aneg_p
,
&
b_P_pr_aneg_p
);
fTree
->
SetBranchAddress
(
"P.cal.fly.a_p"
,
P_sh_a_p
,
&
b_P_sh_a_p
);
fTree
->
SetBranchAddress
(
"P.tr.n"
,
&
P_tr_n
,
&
b_P_tr_n
);
fTree
->
SetBranchAddress
(
"P.tr.x"
,
&
P_tr_x
,
&
b_P_tr_x
);
fTree
->
SetBranchAddress
(
"P.tr.y"
,
&
P_tr_y
,
&
b_P_tr_y
);
fTree
->
SetBranchAddress
(
"P.tr.th"
,
&
P_tr_xp
,
&
b_P_tr_xp
);
fTree
->
SetBranchAddress
(
"P.tr.ph"
,
&
P_tr_yp
,
&
b_P_tr_yp
);
fTree
->
SetBranchAddress
(
"P.tr.p"
,
&
P_tr_p
,
&
b_P_tr_p
);
fTree
->
SetBranchAddress
(
"P.tr.tg_dp"
,
&
P_tr_tg_dp
,
&
b_P_tr_tg_dp
);
fTree
->
SetBranchAddress
(
"P.hgcer.npe"
,
P_hgcer_npe
,
&
b_P_hgcer_npe
);
// Histogram declarations.
...
...
@@ -272,6 +340,7 @@ bool THcPShowerCalib::ReadShRawTrack(THcPShTrack &trk, UInt_t ientry) {
////Double_t P_pr_a_p[THcPShTrack::fNrows_pr][THcPShTrack::fNcols_pr];
////Double_t P_sh_a_p[THcPShTrack::fNrows_sh][THcPShTrack::fNcols_sh];
/*
Double_t P_pr_apos_p[THcPShTrack::fNrows_pr];
Double_t P_pr_aneg_p[THcPShTrack::fNrows_pr];
Double_t P_sh_a_p[THcPShTrack::fNcols_sh][THcPShTrack::fNrows_sh];
...
...
@@ -290,9 +359,9 @@ bool THcPShowerCalib::ReadShRawTrack(THcPShTrack &trk, UInt_t ientry) {
Double_t P_hgcer_npe[4];
//// const Double_t adc_thr = 15.; //Low threshold on the ADC signals.
*/
// Set branch addresses.
/*
fTree->SetBranchAddress("P.cal.pr.apos_p",P_pr_apos_p);
fTree->SetBranchAddress("P.cal.pr.aneg_p",P_pr_aneg_p);
fTree->SetBranchAddress("P.cal.fly.a_p",P_sh_a_p);
...
...
@@ -307,6 +376,7 @@ bool THcPShowerCalib::ReadShRawTrack(THcPShTrack &trk, UInt_t ientry) {
fTree->SetBranchAddress("P.tr.tg_dp", &P_tr_tg_dp);
fTree->SetBranchAddress("P.hgcer.npe", P_hgcer_npe);
*/
fTree
->
GetEntry
(
ientry
);
...
...
This diff is collapsed.
Click to expand it.
CALIBRATION/shms_cal_calib/pcal_calib.cpp
+
6
−
0
View file @
f3b16f4b
...
...
@@ -10,6 +10,9 @@
////void pcal_calib(Int_t RunNumber) {
void
pcal_calib
(
string
RunNumber
)
{
// Initialize the analysis clock
clock_t
t
=
clock
();
cout
<<
"Calibrating run "
<<
RunNumber
<<
endl
;
...
...
@@ -56,4 +59,7 @@ void pcal_calib(string RunNumber) {
Canvas
->
cd
(
4
);
theShowerCalib
.
hDPvsEcal
->
Draw
();
// Calculate the analysis rate
t
=
clock
()
-
t
;
printf
(
"The analysis took %.1f seconds
\n
"
,
((
float
)
t
)
/
CLOCKS_PER_SEC
);
}
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