Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
athena
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Jira
Jira
Labels
Merge Requests
172
Merge Requests
172
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
atlas
athena
Commits
032ed518
Commit
032ed518
authored
Nov 25, 2019
by
jmaurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added EventInfo decoration for testing, enabled systematics variations for LhoodMM_tools
parent
12e4c898
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
11 deletions
+28
-11
PhysicsAnalysis/AnalysisCommon/FakeBkgTools/util/fbtTestBasics.cxx
...alysis/AnalysisCommon/FakeBkgTools/util/fbtTestBasics.cxx
+28
-11
No files found.
PhysicsAnalysis/AnalysisCommon/FakeBkgTools/util/fbtTestBasics.cxx
View file @
032ed518
...
...
@@ -28,6 +28,7 @@
#include <fstream>
#include <map>
#include <memory>
bool
successful
(
bool
arg
)
{
return
arg
;
}
bool
successful
(
int
arg
);
...
...
@@ -61,6 +62,12 @@ bool addEventWeight(asg::AnaToolHandle<CP::ILinearFakeBkgTool>& tool, Result& re
bool
addEventWeight
(
asg
::
AnaToolHandle
<
CP
::
IFakeBkgTool
>&
tool
,
Result
&
result
);
template
<
class
Interface
=
CP
::
IFakeBkgTool
>
bool
fillResult
(
asg
::
AnaToolHandle
<
Interface
>&
tool
,
Result
&
result
);
#ifdef XAOD_STANDALONE
std
::
unique_ptr
<
xAOD
::
TStore
>
store
;
#else
StoreGateSvc
*
store
=
nullptr
;
#endif
std
::
vector
<
std
::
string
>
config
;
std
::
string
selection
=
">=1T"
;
std
::
string
process
=
">=1F[T]"
;
...
...
@@ -82,11 +89,13 @@ int main(int argc, char* argv[])
#ifdef XAOD_STANDALONE
xAOD
::
Init
(
"fbtTestBasics"
).
ignore
();
xAOD
::
TEvent
event
(
xAOD
::
TEvent
::
kClassAccess
);
xAOD
::
TStore
store
;
store
=
std
::
make_unique
<
xAOD
::
TStore
>
()
;
StatusCode
::
enableFailure
();
#else
IAppMgrUI
*
app
=
POOL
::
Init
();
POOL
::
TEvent
event
(
POOL
::
TEvent
::
kClassAccess
);
FBT_CHECK
(
event
.
evtStore
().
retrieve
()
);
store
=
event
.
evtStore
().
get
();
#endif
int
returnCode
=
allTests
()
?
0
:
1
;
...
...
@@ -110,9 +119,7 @@ bool allTests()
FBT_CHECK
(
minimalTest
(
"CP::AsymptMatrixTool"
,
result1
)
);
if
(
verbose
)
std
::
cout
<<
"
\n
Will do minimal test with CP::LhoodMM_tools
\n
"
;
readCPVariations
=
false
;
FBT_CHECK
(
minimalTest
(
"CP::LhoodMM_tools"
,
result0
)
);
readCPVariations
=
true
;
if
(
verbose
)
std
::
cout
<<
"
\n
Will test loading efficiencies from XML
\n
"
;
FBT_CHECK
(
readFromXML
()
);
...
...
@@ -203,12 +210,15 @@ bool setup(asg::AnaToolHandle<Interface>& tool, const std::string& type)
template
<
class
Interface
>
bool
eventLoop
(
asg
::
AnaToolHandle
<
Interface
>&
tool
,
Result
&
result
)
{
std
::
unique_ptr
<
xAOD
::
EventInfo
>
eventInfo
=
std
::
make_unique
<
xAOD
::
EventInfo
>
();
std
::
unique_ptr
<
xAOD
::
EventAuxInfo
>
eventAuxInfo
=
std
::
make_unique
<
xAOD
::
EventAuxInfo
>
();
auto
eventInfo
=
std
::
make_unique
<
xAOD
::
EventInfo
>
();
auto
eventAuxInfo
=
std
::
make_unique
<
xAOD
::
EventAuxInfo
>
();
eventInfo
->
setStore
(
eventAuxInfo
.
get
());
eventInfo
->
auxdata
<
int
>
(
"flag"
)
=
1
;
FBT_CHECK
(
store
->
record
(
std
::
move
(
eventInfo
),
"EventInfo"
)
);
FBT_CHECK
(
store
->
record
(
std
::
move
(
eventAuxInfo
),
"EventAuxInfo"
)
);
xAOD
::
IParticleContainer
particles
(
SG
::
VIEW_ELEMENTS
);
std
::
unique_ptr
<
xAOD
::
Electron
>
e
(
new
xAOD
::
Electron
()
);
auto
e
=
std
::
make_unique
<
xAOD
::
Electron
>
(
);
e
->
makePrivateStore
();
e
->
setCharge
(
1
);
particles
.
push_back
(
static_cast
<
xAOD
::
IParticle
*>
(
&*
e
));
...
...
@@ -219,6 +229,12 @@ bool eventLoop(asg::AnaToolHandle<Interface>& tool, Result& result)
FBT_CHECK
(
tool
->
addEvent
(
particles
)
);
FBT_CHECK
(
addEventWeight
(
tool
,
result
)
);
}
#ifdef XAOD_STANDALONE
store
->
clear
();
#else
store
->
clearStore
(
true
);
#endif
return
true
;
}
...
...
@@ -331,10 +347,11 @@ bool readFromXML()
/// note: the declarations must be placed in the "good" order,
/// otherwise the definitions of the SystematicVariations will be different than those obtained with readFromROOT()
out
<<
"<efficiencies>
\n
"
;
out
<<
"<electron type=
\"
fake-efficiency
\"
input=
\"
central-value
\"
stat=
\"
per-bin
\"
>
\n\t
<bin>
\n
0.05 +- 0.01 (stat) </bin>
\n
</electron>
\n
"
;
out
<<
"<electron type=
\"
real-efficiency
\"
input=
\"
central-value
\"
stat=
\"
global
\"
>
\n\t
<bin>
\n
0.90 +- 0.01 (stat) </bin>
\n
</electron>
\n
"
;
out
<<
"<muon type=
\"
fake-efficiency
\"
input=
\"
central-value
\"
stat=
\"
per-bin
\"
>
\n\t
<bin>
\n
0.15 +- 0.032 (stat) </bin>
\n
</muon>
\n
"
;
out
<<
"<muon type=
\"
real-efficiency
\"
input=
\"
central-value
\"
stat=
\"
global
\"
>
\n\t
<bin>
\n
0.95 +- 0.01 (stat) </bin>
\n
</muon>
\n
"
;
out
<<
"<param type=
\"
int
\"
level=
\"
event
\"
> flag </param>
\n
"
;
out
<<
"<electron type=
\"
fake-efficiency
\"
input=
\"
central-value
\"
stat=
\"
per-bin
\"
>
\n\t
<bin flag=
\"
1
\"
>
\n
0.05 +- 0.01 (stat) </bin>
\n
</electron>
\n
"
;
out
<<
"<electron type=
\"
real-efficiency
\"
input=
\"
central-value
\"
stat=
\"
global
\"
>
\n\t
<bin flag=
\"
1
\"
>
\n
0.90 +- 0.01 (stat) </bin>
\n
</electron>
\n
"
;
out
<<
"<muon type=
\"
fake-efficiency
\"
input=
\"
central-value
\"
stat=
\"
per-bin
\"
>
\n\t
<bin flag=
\"
1
\"
>
\n
0.15 +- 0.032 (stat) </bin>
\n
</muon>
\n
"
;
out
<<
"<muon type=
\"
real-efficiency
\"
input=
\"
central-value
\"
stat=
\"
global
\"
>
\n\t
<bin flag=
\"
1
\"
>
\n
0.95 +- 0.01 (stat) </bin>
\n
</muon>
\n
"
;
out
<<
"</efficiencies>
\n
"
;
out
.
close
();
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment