Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hcana
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
analyzer_software
hcana
Commits
a18bed34
Commit
a18bed34
authored
9 years ago
by
Vardan Tadevosyan
Committed by
Stephen A. Wood
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add pedestal calculations for the ShowerArray class.
parent
c93b3896
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/THcShower.cxx
+29
-29
29 additions, 29 deletions
src/THcShower.cxx
src/THcShower.h
+3
-3
3 additions, 3 deletions
src/THcShower.h
src/THcShowerArray.cxx
+20
-15
20 additions, 15 deletions
src/THcShowerArray.cxx
src/THcShowerPlane.cxx
+1
-1
1 addition, 1 deletion
src/THcShowerPlane.cxx
with
53 additions
and
48 deletions
src/THcShower.cxx
+
29
−
29
View file @
a18bed34
...
@@ -324,46 +324,46 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
...
@@ -324,46 +324,46 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
//Calibration related parameters (from hcal.param).
//Calibration related parameters (from hcal.param).
fN
t
otBlocks
=
0
;
//total number of blocks
fN
T
otBlocks
=
0
;
//total number of blocks
in the layers
for
(
UInt_t
i
=
0
;
i
<
fNLayers
;
i
++
)
fN
t
otBlocks
+=
fNBlocks
[
i
];
for
(
UInt_t
i
=
0
;
i
<
fNLayers
;
i
++
)
fN
T
otBlocks
+=
fNBlocks
[
i
];
// Debug output.
// Debug output.
if
(
fdbg_init_cal
)
if
(
fdbg_init_cal
)
cout
<<
" Total number of blocks in the calorimeter: "
<<
fN
t
otBlocks
cout
<<
" Total number of blocks in the
layers of
calorimeter: "
<<
dec
<<
fN
T
otBlocks
<<
endl
;
<<
endl
;
//Pedestal limits from hcal.param.
//Pedestal limits from hcal.param.
fShPosPedLimit
=
new
Int_t
[
fN
t
otBlocks
];
fShPosPedLimit
=
new
Int_t
[
fN
T
otBlocks
];
fShNegPedLimit
=
new
Int_t
[
fN
t
otBlocks
];
fShNegPedLimit
=
new
Int_t
[
fN
T
otBlocks
];
//Calibration constants
//Calibration constants
fPosGain
=
new
Double_t
[
fN
t
otBlocks
];
fPosGain
=
new
Double_t
[
fN
T
otBlocks
];
fNegGain
=
new
Double_t
[
fN
t
otBlocks
];
fNegGain
=
new
Double_t
[
fN
T
otBlocks
];
//Read in parameters from hcal.param
//Read in parameters from hcal.param
Double_t
hcal_pos_cal_const
[
fN
t
otBlocks
];
Double_t
hcal_pos_cal_const
[
fN
T
otBlocks
];
// Double_t hcal_pos_gain_ini[fN
t
otBlocks]; not used
// Double_t hcal_pos_gain_ini[fN
T
otBlocks]; not used
// Double_t hcal_pos_gain_cur[fN
t
otBlocks]; not used
// Double_t hcal_pos_gain_cur[fN
T
otBlocks]; not used
// Int_t hcal_pos_ped_limit[fN
t
otBlocks]; not used
// Int_t hcal_pos_ped_limit[fN
T
otBlocks]; not used
Double_t
hcal_pos_gain_cor
[
fN
t
otBlocks
];
Double_t
hcal_pos_gain_cor
[
fN
T
otBlocks
];
Double_t
hcal_neg_cal_const
[
fN
t
otBlocks
];
Double_t
hcal_neg_cal_const
[
fN
T
otBlocks
];
// Double_t hcal_neg_gain_ini[fN
t
otBlocks]; not used
// Double_t hcal_neg_gain_ini[fN
T
otBlocks]; not used
// Double_t hcal_neg_gain_cur[fN
t
otBlocks]; not used
// Double_t hcal_neg_gain_cur[fN
T
otBlocks]; not used
// Int_t hcal_neg_ped_limit[fN
t
otBlocks]; not used
// Int_t hcal_neg_ped_limit[fN
T
otBlocks]; not used
Double_t
hcal_neg_gain_cor
[
fN
t
otBlocks
];
Double_t
hcal_neg_gain_cor
[
fN
T
otBlocks
];
DBRequest
list
[]
=
{
DBRequest
list
[]
=
{
{
"cal_pos_cal_const"
,
hcal_pos_cal_const
,
kDouble
,
fN
t
otBlocks
},
{
"cal_pos_cal_const"
,
hcal_pos_cal_const
,
kDouble
,
fN
T
otBlocks
},
// {"cal_pos_gain_ini", hcal_pos_gain_ini, kDouble, fN
t
otBlocks},
// {"cal_pos_gain_ini", hcal_pos_gain_ini, kDouble, fN
T
otBlocks},
// {"cal_pos_gain_cur", hcal_pos_gain_cur, kDouble, fN
t
otBlocks},
// {"cal_pos_gain_cur", hcal_pos_gain_cur, kDouble, fN
T
otBlocks},
{
"cal_pos_ped_limit"
,
fShPosPedLimit
,
kInt
,
fN
t
otBlocks
},
{
"cal_pos_ped_limit"
,
fShPosPedLimit
,
kInt
,
fN
T
otBlocks
},
{
"cal_pos_gain_cor"
,
hcal_pos_gain_cor
,
kDouble
,
fN
t
otBlocks
},
{
"cal_pos_gain_cor"
,
hcal_pos_gain_cor
,
kDouble
,
fN
T
otBlocks
},
{
"cal_neg_cal_const"
,
hcal_neg_cal_const
,
kDouble
,
fN
t
otBlocks
},
{
"cal_neg_cal_const"
,
hcal_neg_cal_const
,
kDouble
,
fN
T
otBlocks
},
// {"cal_neg_gain_ini", hcal_neg_gain_ini, kDouble, fN
t
otBlocks},
// {"cal_neg_gain_ini", hcal_neg_gain_ini, kDouble, fN
T
otBlocks},
// {"cal_neg_gain_cur", hcal_neg_gain_cur, kDouble, fN
t
otBlocks},
// {"cal_neg_gain_cur", hcal_neg_gain_cur, kDouble, fN
T
otBlocks},
{
"cal_neg_ped_limit"
,
fShNegPedLimit
,
kInt
,
fN
t
otBlocks
},
{
"cal_neg_ped_limit"
,
fShNegPedLimit
,
kInt
,
fN
T
otBlocks
},
{
"cal_neg_gain_cor"
,
hcal_neg_gain_cor
,
kDouble
,
fN
t
otBlocks
},
{
"cal_neg_gain_cor"
,
hcal_neg_gain_cor
,
kDouble
,
fN
T
otBlocks
},
{
"cal_min_peds"
,
&
fShMinPeds
,
kInt
},
{
"cal_min_peds"
,
&
fShMinPeds
,
kInt
},
{
0
}
{
0
}
};
};
...
@@ -430,7 +430,7 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
...
@@ -430,7 +430,7 @@ Int_t THcShower::ReadDatabase( const TDatime& date )
// Calibration constants (GeV / ADC channel).
// Calibration constants (GeV / ADC channel).
for
(
UInt_t
i
=
0
;
i
<
fN
t
otBlocks
;
i
++
)
{
for
(
UInt_t
i
=
0
;
i
<
fN
T
otBlocks
;
i
++
)
{
fPosGain
[
i
]
=
hcal_pos_cal_const
[
i
]
*
hcal_pos_gain_cor
[
i
];
fPosGain
[
i
]
=
hcal_pos_cal_const
[
i
]
*
hcal_pos_gain_cor
[
i
];
fNegGain
[
i
]
=
hcal_neg_cal_const
[
i
]
*
hcal_neg_gain_cor
[
i
];
fNegGain
[
i
]
=
hcal_neg_cal_const
[
i
]
*
hcal_neg_gain_cor
[
i
];
}
}
...
...
This diff is collapsed.
Click to expand it.
src/THcShower.h
+
3
−
3
View file @
a18bed34
...
@@ -233,12 +233,12 @@ protected:
...
@@ -233,12 +233,12 @@ protected:
Int_t
fAnalyzePedestals
;
// Flag for pedestal analysis.
Int_t
fAnalyzePedestals
;
// Flag for pedestal analysis.
Int_t
*
fShPosPedLimit
;
// [fN
t
otBlocks] ADC limits for pedestal calc.-s.
Int_t
*
fShPosPedLimit
;
// [fN
T
otBlocks] ADC limits for pedestal calc.-s.
Int_t
*
fShNegPedLimit
;
Int_t
*
fShNegPedLimit
;
Int_t
fShMinPeds
;
// Min.number of events to analyze pedestals.
Int_t
fShMinPeds
;
// Min.number of events to analyze pedestals.
Double_t
*
fPosGain
;
// [fN
t
otBlocks] Gain constants from calibration
Double_t
*
fPosGain
;
// [fN
T
otBlocks] Gain constants from calibration
Double_t
*
fNegGain
;
Double_t
*
fNegGain
;
// Per-event data
// Per-event data
...
@@ -263,7 +263,7 @@ protected:
...
@@ -263,7 +263,7 @@ protected:
// Following apply to just sideways readout layers
// Following apply to just sideways readout layers
Double_t
*
BlockThick
;
// Thickness of blocks
Double_t
*
BlockThick
;
// Thickness of blocks
UInt_t
*
fNBlocks
;
// [fNLayers] number of blocks per layer
UInt_t
*
fNBlocks
;
// [fNLayers] number of blocks per layer
UInt_t
fN
t
otBlocks
;
// Total number of shower counter blocks
UInt_t
fN
T
otBlocks
;
// Total number of shower counter blocks
Double_t
**
XPos
;
// [fNLayers] X,Y,Z positions of blocks
Double_t
**
XPos
;
// [fNLayers] X,Y,Z positions of blocks
Double_t
*
YPos
;
Double_t
*
YPos
;
Double_t
*
ZPos
;
Double_t
*
ZPos
;
...
...
This diff is collapsed.
Click to expand it.
src/THcShowerArray.cxx
+
20
−
15
View file @
a18bed34
...
@@ -103,13 +103,17 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date )
...
@@ -103,13 +103,17 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date )
// Pedestal limits per channel.
// Pedestal limits per channel.
fPedLimit
=
new
Int_t
[
fNelem
];
fPedLimit
=
new
Int_t
[
fNelem
];
DBRequest
list1
[]
=
{
// {"cal_arr_cal_const", hcal_pos_cal_const, kDouble, fNelem},
{
"cal_arr_ped_limit"
,
fPedLimit
,
kInt
,
fNelem
},
// {"cal_arr_gain_cor", hcal_pos_gain_cor, kDouble, fNelem},
// {"cal_min_peds", &fShMinPeds, kInt},
{
0
}
};
gHcParms
->
LoadParmValues
((
DBRequest
*
)
&
list1
,
prefix
);
THcShower
*
fParent
;
THcShower
*
fParent
;
fParent
=
(
THcShower
*
)
GetParent
();
fParent
=
(
THcShower
*
)
GetParent
();
for
(
Int_t
i
=
0
;
i
<
fNelem
;
i
++
)
{
fPedLimit
[
i
]
=
fParent
->
GetPedLimit
(
i
,
fLayerNum
,
0
);
//layer 2, neg. side
}
fMinPeds
=
fParent
->
GetMinPeds
();
fMinPeds
=
fParent
->
GetMinPeds
();
InitializePedestals
();
InitializePedestals
();
...
@@ -133,7 +137,7 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date )
...
@@ -133,7 +137,7 @@ Int_t THcShowerArray::ReadDatabase( const TDatime& date )
cout
<<
"Debug output from THcShowerArray::ReadDatabase for "
cout
<<
"Debug output from THcShowerArray::ReadDatabase for "
<<
GetParent
()
->
GetPrefix
()
<<
":"
<<
endl
;
<<
GetParent
()
->
GetPrefix
()
<<
":"
<<
endl
;
cout
<<
" Layer #"
<<
fLayerNum
<<
", number of elements "
<<
fNelem
cout
<<
" Layer #"
<<
fLayerNum
<<
", number of elements "
<<
dec
<<
fNelem
<<
endl
;
<<
endl
;
cout
<<
" Columns "
<<
fNColumns
<<
", Rows "
<<
fNRows
<<
endl
;
cout
<<
" Columns "
<<
fNColumns
<<
", Rows "
<<
fNRows
<<
endl
;
...
@@ -213,9 +217,7 @@ Int_t THcShowerArray::FineProcess( TClonesArray& tracks )
...
@@ -213,9 +217,7 @@ Int_t THcShowerArray::FineProcess( TClonesArray& tracks )
//_____________________________________________________________________________
//_____________________________________________________________________________
Int_t
THcShowerArray
::
ProcessHits
(
TClonesArray
*
rawhits
,
Int_t
nexthit
)
Int_t
THcShowerArray
::
ProcessHits
(
TClonesArray
*
rawhits
,
Int_t
nexthit
)
{
{
// Extract the data for this layer from hit list
// Extract the data for this layer from hit list.
// Assumes that the hit list is sorted by layer, so we stop when the
// plane doesn't agree and return the index for the next hit.
THcShower
*
fParent
;
THcShower
*
fParent
;
fParent
=
(
THcShower
*
)
GetParent
();
fParent
=
(
THcShower
*
)
GetParent
();
...
@@ -329,10 +331,9 @@ Int_t THcShowerArray::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
...
@@ -329,10 +331,9 @@ Int_t THcShowerArray::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
THcRawShowerHit
*
hit
=
(
THcRawShowerHit
*
)
rawhits
->
At
(
ihit
);
THcRawShowerHit
*
hit
=
(
THcRawShowerHit
*
)
rawhits
->
At
(
ihit
);
// OK for hit list sorted by layer.
if
(
hit
->
fPlane
!=
fLayerNum
)
{
// if(hit->fPlane > fLayerNum) {
break
;
// break;
}
// }
Int_t
element
=
hit
->
fCounter
-
1
;
// Should check if in range
Int_t
element
=
hit
->
fCounter
-
1
;
// Should check if in range
...
@@ -368,6 +369,10 @@ Int_t THcShowerArray::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
...
@@ -368,6 +369,10 @@ Int_t THcShowerArray::AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit)
THcRawShowerHit
*
hit
=
(
THcRawShowerHit
*
)
rawhits
->
At
(
ih
);
THcRawShowerHit
*
hit
=
(
THcRawShowerHit
*
)
rawhits
->
At
(
ih
);
if
(
hit
->
fPlane
!=
fLayerNum
)
{
break
;
}
Int_t
adc
=
fUsingFADC
?
Int_t
adc
=
fUsingFADC
?
hit
->
GetData
(
0
,
fPedSampLow
,
fPedSampHigh
,
fDataSampLow
,
fDataSampHigh
)
hit
->
GetData
(
0
,
fPedSampLow
,
fPedSampHigh
,
fDataSampLow
,
fDataSampHigh
)
:
:
...
@@ -406,7 +411,7 @@ void THcShowerArray::CalculatePedestals( )
...
@@ -406,7 +411,7 @@ void THcShowerArray::CalculatePedestals( )
if
(
((
THcShower
*
)
GetParent
())
->
fdbg_raw_cal
)
{
if
(
((
THcShower
*
)
GetParent
())
->
fdbg_raw_cal
)
{
cout
<<
"---------------------------------------------------------------
\n
"
;
cout
<<
"---------------------------------------------------------------
\n
"
;
cout
<<
"Debug output from THcShowerArray::CalculatePedestals for"
cout
<<
"Debug output from THcShowerArray::CalculatePedestals for
"
<<
GetParent
()
->
GetPrefix
()
<<
":"
<<
endl
;
<<
GetParent
()
->
GetPrefix
()
<<
":"
<<
endl
;
cout
<<
" ADC pedestals and thresholds for calorimeter plane "
cout
<<
" ADC pedestals and thresholds for calorimeter plane "
...
@@ -414,7 +419,7 @@ void THcShowerArray::CalculatePedestals( )
...
@@ -414,7 +419,7 @@ void THcShowerArray::CalculatePedestals( )
for
(
Int_t
i
=
0
;
i
<
fNelem
;
i
++
)
{
for
(
Int_t
i
=
0
;
i
<
fNelem
;
i
++
)
{
cout
<<
" element "
<<
i
<<
": "
cout
<<
" element "
<<
i
<<
": "
<<
" Pedestal = "
<<
fPed
[
i
]
<<
" Pedestal = "
<<
fPed
[
i
]
<<
"
/
threshold = "
<<
fThresh
[
i
]
<<
" threshold = "
<<
fThresh
[
i
]
<<
endl
;
<<
endl
;
}
}
cout
<<
"---------------------------------------------------------------
\n
"
;
cout
<<
"---------------------------------------------------------------
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
src/THcShowerPlane.cxx
+
1
−
1
View file @
a18bed34
...
@@ -175,7 +175,7 @@ Int_t THcShowerPlane::ReadDatabase( const TDatime& date )
...
@@ -175,7 +175,7 @@ Int_t THcShowerPlane::ReadDatabase( const TDatime& date )
cout
<<
"Debug output from THcShowerPlane::ReadDatabase for "
cout
<<
"Debug output from THcShowerPlane::ReadDatabase for "
<<
GetParent
()
->
GetPrefix
()
<<
":"
<<
endl
;
<<
GetParent
()
->
GetPrefix
()
<<
":"
<<
endl
;
cout
<<
" Layer #"
<<
fLayerNum
<<
", number of elements "
<<
fNelem
cout
<<
" Layer #"
<<
fLayerNum
<<
", number of elements "
<<
dec
<<
fNelem
<<
endl
;
<<
endl
;
cout
<<
" Origin of Layer at X = "
<<
fOrigin
.
X
()
cout
<<
" Origin of Layer at X = "
<<
fOrigin
.
X
()
...
...
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