Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
atlas
athena
Merge requests
!58946
CavernBkgGenerator: static fixes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
CavernBkgGenerator: static fixes
fwinkl/athena:cavern
into
master
Overview
9
Commits
1
Pipelines
1
Changes
1
Merged
Frank Winklmeier
requested to merge
fwinkl/athena:cavern
into
master
2 years ago
Overview
9
Commits
1
Pipelines
1
Changes
1
Expand
Do static initialization on first use.
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
ef5ebce5
1 commit,
2 years ago
1 file
+
19
−
30
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Generators/CavernBkgGenerator/CavernBkgGenerator/BkgOut.h
+
19
−
30
Options
/*
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
22
CERN for the benefit of the ATLAS collaboration
*/
#ifndef BkgOut_h
@@ -54,15 +54,15 @@ private:
int
m_dummy
;
float
m_realdummy
;
static
BKGOUT
*
s_
bkgout
;
static
BKGOUT
*
bkgout
()
;
};
// set pointer to zero at start
BkgOut
::
BKGOUT
*
BkgOut
::
s_
bkgout
=
0
;
inline
void
BkgOut
::
init
(
void
)
{
if
(
!
s_bkgout
)
s_bkgout
=
static_cast
<
BKGOUT
*>
(
bkgout_address_
());
}
inline
BkgOut
::
BKGOUT
*
BkgOut
::
bkgout
()
{
static
BKGOUT
*
ptr
=
static_cast
<
BKGOUT
*>
(
bkgout_address_
());
return
ptr
;
}
// Constructor
inline
@@ -78,77 +78,66 @@ BkgOut::~BkgOut()
inline
int
&
BkgOut
::
ievent
(
void
)
{
init
();
return
s_bkgout
->
ievent
;
return
bkgout
()
->
ievent
;
}
inline
int
&
BkgOut
::
npv
(
void
)
{
init
();
return
s_bkgout
->
npv
;
return
bkgout
()
->
npv
;
}
inline
float
&
BkgOut
::
vx
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_realdummy
;
return
s_
bkgout
->
vx
[
i
-
1
];
return
bkgout
()
->
vx
[
i
-
1
];
}
inline
float
&
BkgOut
::
vy
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_realdummy
;
return
s_
bkgout
->
vy
[
i
-
1
];
return
bkgout
()
->
vy
[
i
-
1
];
}
inline
float
&
BkgOut
::
vz
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_realdummy
;
return
s_
bkgout
->
vz
[
i
-
1
];
return
bkgout
()
->
vz
[
i
-
1
];
}
inline
float
&
BkgOut
::
px
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_realdummy
;
return
s_
bkgout
->
px
[
i
-
1
];
return
bkgout
()
->
px
[
i
-
1
];
}
inline
float
&
BkgOut
::
py
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_realdummy
;
return
s_
bkgout
->
py
[
i
-
1
];
return
bkgout
()
->
py
[
i
-
1
];
}
inline
float
&
BkgOut
::
pz
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_realdummy
;
return
s_
bkgout
->
pz
[
i
-
1
];
return
bkgout
()
->
pz
[
i
-
1
];
}
inline
float
&
BkgOut
::
ptof
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_realdummy
;
return
s_
bkgout
->
ptof
[
i
-
1
];
return
bkgout
()
->
ptof
[
i
-
1
];
}
inline
int
&
BkgOut
::
irp
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_dummy
;
return
s_
bkgout
->
irp
[
i
-
1
];
return
bkgout
()
->
irp
[
i
-
1
];
}
inline
int
&
BkgOut
::
ityp
(
int
i
)
{
init
();
// check COMMON is initialized
if
(
i
<
1
||
i
>
lenI
()
)
return
m_dummy
;
return
s_
bkgout
->
ityp
[
i
-
1
];
return
bkgout
()
->
ityp
[
i
-
1
];
}
#endif
Loading