Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Peter Sherwood
athena
Commits
792cd81b
Commit
792cd81b
authored
6 years ago
by
Jana Schaarschmidt
Browse files
Options
Downloads
Patches
Plain Diff
Option to set PCA bin probabilities in case no pcabinprob object is available
Former-commit-id: b11111e1e2168eacf7c55097c65c1a3252ddf7cb
parent
aadbe96b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyBinParametrization.cxx
+23
-7
23 additions, 7 deletions
...ISF_FastCaloSimEvent/src/TFCSEnergyBinParametrization.cxx
with
23 additions
and
7 deletions
Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimEvent/src/TFCSEnergyBinParametrization.cxx
+
23
−
7
View file @
792cd81b
...
...
@@ -81,31 +81,47 @@ void TFCSEnergyBinParametrization::set_pdgid_Ekin_bin_probability(int id,std::ve
}
void
TFCSEnergyBinParametrization
::
load_pdgid_Ekin_bin_probability_from_file
(
int
id
,
TFile
*
file
,
std
::
string
prob_object_name
)
{
add_pdgid
(
id
);
float
*
prob
;
file
->
cd
();
TVectorF
*
pcabinprobvector
=
(
TVectorF
*
)
gDirectory
->
Get
(
prob_object_name
.
c_str
());
if
(
!
pcabinprobvector
)
{
ATH_MSG_ERROR
(
"TFCSEnergyBinParametrization::"
<<
prob_object_name
<<
" is null"
);
return
;
ATH_MSG_INFO
(
"TFCSEnergyBinParametrization::"
<<
prob_object_name
<<
" is null. Using equal PCA probabilities."
);
prob
=
new
float
[
m_pdgid_Ebin_probability
[
id
].
size
()];
prob
[
0
]
=
0.0
;
for
(
unsigned
int
i
=
1
;
i
<
m_pdgid_Ebin_probability
[
id
].
size
();
i
++
)
{
prob
[
i
]
=
1.0
;
}
}
if
(
(
unsigned
int
)
pcabinprobvector
->
GetNoElements
()
!=
m_pdgid_Ebin_probability
[
id
].
size
()
)
if
(
pcabinprobvector
)
{
if
((
unsigned
int
)
pcabinprobvector
->
GetNoElements
()
!=
m_pdgid_Ebin_probability
[
id
].
size
())
{
ATH_MSG_ERROR
(
"TFCSEnergyBinParametrization::set_pdgid_Ekin_bin_probability(): size of prob array does not match! in.size()="
<<
pcabinprobvector
->
GetNoElements
()
<<
" instance="
<<
m_pdgid_Ebin_probability
[
id
].
size
());
return
;
}
prob
=
pcabinprobvector
->
GetMatrixArray
();
}
float
*
prob
=
pcabinprobvector
->
GetMatrixArray
();
float
ptot
=
0
;
for
(
int
iEbin
=
0
;
iEbin
<=
n_bins
();
++
iEbin
)
ptot
+=
prob
[
iEbin
];
float
p
=
0
;
for
(
int
iEbin
=
0
;
iEbin
<=
n_bins
();
++
iEbin
)
{
for
(
int
iEbin
=
0
;
iEbin
<=
n_bins
();
++
iEbin
)
{
p
+=
prob
[
iEbin
]
/
ptot
;
m_pdgid_Ebin_probability
[
id
][
iEbin
]
=
p
;
}
...
...
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