Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas
athena
Commits
0e9ececc
Commit
0e9ececc
authored
Sep 04, 2019
by
Elemer Nagy
Browse files
This is the same modification as introduced on Run3TrigFeatureAccessTest1 but including the
conflicts solved for the TrigEGammaMonitoring package
parent
f1e7173f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Trigger/TrigMonitoring/TrigBjetMonitoring/python/TrigBjetMonitorAlgorithm.py
View file @
0e9ececc
...
...
@@ -16,7 +16,7 @@ def TrigBjetMonConfig(inputFlags):
# Define one top-level monitoring algorithm. The new configuration
# framework uses a component accumulator.
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
result
=
ComponentAccumulator
()
#
result = ComponentAccumulator()
# The following class will make a sequence, configure algorithms, and link
# them to GenericMonitoringTools
...
...
@@ -65,7 +65,7 @@ def TrigBjetMonConfig(inputFlags):
from
TrigHLTMonitoring.HLTMonTriggerList
import
hltmonList
bjet_triglist
=
hltmonList
.
monitoring_bjet
bjet_triglist
+=
hltmonList
.
monitoring_mujet
print
" ==> bjet_triglist: "
,
bjet_triglist
#
print " ==> bjet_triglist: ", bjet_triglist
# Add some tools. N.B. Do not use your own trigger decion tool. Use the
# standard one that is included with AthMonitorAlgorithm.
...
...
@@ -111,67 +111,67 @@ def TrigBjetMonConfig(inputFlags):
AllChains
=
[]
for
chain
in
bjet_triglist
:
AllChains
.
append
(
chain
[
2
:])
print
" inside bjet_triglist chain[2:8] : "
,
chain
[
2
:
8
]
#
print " inside bjet_triglist chain[2:8] : " , chain[2:8]
if
chain
[
2
:
8
]
==
'HLT_mu'
:
# mu-jets
print
" mu-jet histogram is defined for "
,
chain
[
2
:]
#
print " mu-jet histogram is defined for ", chain[2:]
HistName
=
'jetPt_'
+
chain
[
2
:]
if
chain
[
0
:
1
]
==
"E"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of Pt_jet;Pt_jet;Events'
,
path
=
'Expert/'
+
chain
[
2
:],
xbins
=
100
,
xmin
=-
0.0
,
xmax
=
750.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Expert folder"
#
print " ==> histogram ",HistName," is defined for Expert folder"
if
chain
[
0
:
1
]
==
"S"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of Pt_jet;Pt_jet;Events'
,
path
=
'Shifter/'
+
chain
[
2
:],
xbins
=
100
,
xmin
=-
0.0
,
xmax
=
750.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Shifter folder"
#
print " ==> histogram ",HistName," is defined for Shifter folder"
continue
else
:
# b-jets
print
" b-jet histogram is defined for "
,
chain
[
2
:]
#
print " b-jet histogram is defined for ", chain[2:]
HistName
=
'PVz_tr_'
+
chain
[
2
:]
if
chain
[
0
:
1
]
==
"E"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of online zPV;zPV;Events'
,
path
=
'Expert/'
+
chain
[
2
:],
xbins
=
200
,
xmin
=-
200.0
,
xmax
=
200.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Expert folder"
#
print " ==> histogram ",HistName," is defined for Expert folder"
if
chain
[
0
:
1
]
==
"S"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of online zPV;zPV;Events'
,
path
=
'Shifter/'
+
chain
[
2
:],
xbins
=
200
,
xmin
=-
200.0
,
xmax
=
200.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Shifter folder"
#
print " ==> histogram ",HistName," is defined for Shifter folder"
HistName
=
'd0_'
+
chain
[
2
:]
if
chain
[
0
:
1
]
==
"E"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of d0;d0;Events'
,
path
=
'Expert/'
+
chain
[
2
:],
xbins
=
200
,
xmin
=-
2.0
,
xmax
=
2.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Expert folder"
#
print " ==> histogram ",HistName," is defined for Expert folder"
if
chain
[
0
:
1
]
==
"S"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of d0;d0;Events'
,
path
=
'Shifter/'
+
chain
[
2
:],
xbins
=
200
,
xmin
=-
2.0
,
xmax
=
2.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Shifter folder"
#
print " ==> histogram ",HistName," is defined for Shifter folder"
HistName
=
'jetPt_'
+
chain
[
2
:]
if
chain
[
0
:
1
]
==
"E"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of Pt_jet;Pt_jet;Events'
,
path
=
'Expert/'
+
chain
[
2
:],
xbins
=
100
,
xmin
=-
0.0
,
xmax
=
750.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Expert folder"
#
print " ==> histogram ",HistName," is defined for Expert folder"
if
chain
[
0
:
1
]
==
"S"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of Pt_jet;Pt_jet;Events'
,
path
=
'Shifter/'
+
chain
[
2
:],
xbins
=
100
,
xmin
=-
0.0
,
xmax
=
750.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Shifter folder"
#
print " ==> histogram ",HistName," is defined for Shifter folder"
HistName
=
'wMV2c20_'
+
chain
[
2
:]
if
chain
[
0
:
1
]
==
"E"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of MV2c20 discriminant;MV2c20;Events'
,
path
=
'Expert/'
+
chain
[
2
:],
xbins
=
200
,
xmin
=-
1.0
,
xmax
=
1.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Expert folder"
#
print " ==> histogram ",HistName," is defined for Expert folder"
if
chain
[
0
:
1
]
==
"S"
:
BjetMonGroup
.
defineHistogram
(
HistName
,
title
=
'Distribution of MV2c20 discriminant;MV2c20;Events'
,
path
=
'Shifter/'
+
chain
[
2
:],
xbins
=
200
,
xmin
=-
1.0
,
xmax
=
1.0
)
print
" ==> histogram "
,
HistName
,
" is defined for Shifter folder"
#
print " ==> histogram ",HistName," is defined for Shifter folder"
continue
print
" ==> In TrigBjetMonitorAlgorithm.py: AllChains list: "
,
AllChains
#
print " ==> In TrigBjetMonitorAlgorithm.py: AllChains list: ", AllChains
trigBjetMonAlg
.
AllChains
=
AllChains
#shifterTrigBjetMonAlg.AllChains = AllChains
...
...
@@ -220,7 +220,8 @@ if __name__=='__main__':
# MC input files proposed by Tim Martin in https://its.cern.ch/jira/browse/ATR-19881 for Run-3
# file = '/afs/cern/ch/user/t/tamartin/public/ESD.pool.root'
# file = '/afs/cern/ch/user/t/tamartin/public/AOD.pool.root'
file
=
'/afs/cern.ch/work/e/enagy/public/Run3TrigFeatureAccessTest_1/run/legacy.AOD.pool.root'
# file = '/afs/cern.ch/work/e/enagy/public/Run3TrigFeatureAccessTest_1/run/legacy.AOD.pool.root'
file
=
'/afs/cern.ch/work/e/enagy/public/GenerateAOD/AOD.pool.root'
# file = '/afs/cern.ch/work/e/enagy/public/Run3TrigFeatureAccessTest_1/run/mt.AOD.pool.root'
ConfigFlags
.
Input
.
Files
=
[
file
]
ConfigFlags
.
Input
.
isMC
=
True
...
...
Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.cxx
View file @
0e9ececc
...
...
@@ -17,14 +17,14 @@
TrigBjetMonitorAlgorithm
::
TrigBjetMonitorAlgorithm
(
const
std
::
string
&
name
,
ISvcLocator
*
pSvcLocator
)
:
AthMonitorAlgorithm
(
name
,
pSvcLocator
)
,
m_doRandom
(
true
)
,
m_
A
llChains
{}
,
m_
M
uonContainerKey
(
"Muons"
)
,
m_
V
ertexContainerKey
(
"PrimaryVertices"
)
,
m_
a
llChains
{}
,
m_
m
uonContainerKey
(
"Muons"
)
,
m_
v
ertexContainerKey
(
"PrimaryVertices"
)
,
m_trigDec
(
"Trig::TrigDecisionTool/TrigDecisionTool"
)
{
declareProperty
(
"AllChains"
,
m_
A
llChains
);
declareProperty
(
"MuonContainerName"
,
m_
M
uonContainerKey
);
declareProperty
(
"VertexContainerName"
,
m_
V
ertexContainerKey
);
declareProperty
(
"AllChains"
,
m_
a
llChains
);
declareProperty
(
"MuonContainerName"
,
m_
m
uonContainerKey
);
declareProperty
(
"VertexContainerName"
,
m_
v
ertexContainerKey
);
}
...
...
@@ -32,8 +32,8 @@ TrigBjetMonitorAlgorithm::~TrigBjetMonitorAlgorithm() {}
StatusCode
TrigBjetMonitorAlgorithm
::
initialize
()
{
ATH_CHECK
(
m_
M
uonContainerKey
.
initialize
()
);
ATH_CHECK
(
m_
V
ertexContainerKey
.
initialize
()
);
ATH_CHECK
(
m_
m
uonContainerKey
.
initialize
()
);
ATH_CHECK
(
m_
v
ertexContainerKey
.
initialize
()
);
return
AthMonitorAlgorithm
::
initialize
();
}
...
...
@@ -49,12 +49,12 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
auto
OffyVtx
=
Monitored
::
Scalar
<
float
>
(
"Off_yVtx"
,
0.0
);
auto
OffzVtx
=
Monitored
::
Scalar
<
float
>
(
"Off_zVtx"
,
0.0
);
SG
::
ReadHandle
<
xAOD
::
VertexContainer
>
offlinepv
(
m_
V
ertexContainerKey
,
ctx
);
SG
::
ReadHandle
<
xAOD
::
VertexContainer
>
offlinepv
(
m_
v
ertexContainerKey
,
ctx
);
if
(
!
offlinepv
.
isValid
()
)
{
ATH_MSG_ERROR
(
"evtStore() does not contain VertexContainer Collection with name "
<<
m_
V
ertexContainerKey
);
ATH_MSG_ERROR
(
"evtStore() does not contain VertexContainer Collection with name "
<<
m_
v
ertexContainerKey
);
return
StatusCode
::
FAILURE
;
}
std
::
cout
<<
" Size of the Off-line PV container: "
<<
offlinepv
->
size
()
<<
std
::
endl
;
ATH_MSG_INFO
(
" Size of the Off-line PV container: "
<<
offlinepv
->
size
()
)
;
OffNVtx
=
offlinepv
->
size
()
;
for
(
unsigned
int
j
=
0
;
j
<
offlinepv
->
size
();
j
++
){
OffxVtx
=
(
*
(
offlinepv
))[
j
]
->
x
();
...
...
@@ -68,10 +68,10 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
std
::
string
chainName
;
int
size_AllChains
=
m_
A
llChains
.
size
();
int
size_AllChains
=
m_
a
llChains
.
size
();
ATH_MSG_INFO
(
" Size of the AllChains trigger container: "
<<
size_AllChains
);
for
(
int
i
=
0
;
i
<
size_AllChains
;
i
++
){
chainName
=
m_
A
llChains
.
at
(
i
);
chainName
=
m_
a
llChains
.
at
(
i
);
ATH_MSG_INFO
(
" Chain number: "
<<
i
<<
" AllChains Chain Name: "
<<
chainName
);
}
...
...
@@ -90,7 +90,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for
(
auto
&
trigName
:
m_
A
llChains
)
{
for
(
auto
&
trigName
:
m_
a
llChains
)
{
// Access to TrigFeature
...
...
@@ -99,7 +99,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
if
(
m_trigDecTool
->
isPassed
(
trigName
)
)
{
std
::
cout
<<
" Trigger chain from AllChains list: "
<<
trigName
<<
" has fired !!! "
<<
std
::
endl
;
ATH_MSG_INFO
(
" Trigger chain from AllChains list: "
<<
trigName
<<
" has fired !!! "
)
;
// Trigger type
...
...
@@ -141,8 +141,8 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
bjetChain
=
false
;
}
// found
std
::
cout
<<
" Trigger type: bjetChain "
<<
bjetChain
<<
" mujetChain "
<<
mujetChain
<<
" FTKChain "
<<
FTKChain
<<
" splitChain "
<<
splitChain
<<
std
::
endl
;
std
::
cout
<<
" Keys -- priVtxKey: "
<<
priVtxKey
<<
" jetKey: "
<<
jetKey
<<
" trackKey: "
<<
trackKey
<<
std
::
endl
;
ATH_MSG_INFO
(
" Trigger type: bjetChain "
<<
bjetChain
<<
" mujetChain "
<<
mujetChain
<<
" FTKChain "
<<
FTKChain
<<
" splitChain "
<<
splitChain
)
;
ATH_MSG_INFO
(
" Keys -- priVtxKey: "
<<
priVtxKey
<<
" jetKey: "
<<
jetKey
<<
" trackKey: "
<<
trackKey
)
;
// Read the TrigFeature contener
...
...
@@ -153,7 +153,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
Trig
::
FeatureContainer
fc
=
m_trigDec
->
features
(
trigName
);
const
std
::
vector
<
Trig
::
Combination
>&
triggerCombs
=
fc
.
getCombinations
();
ATH_MSG_INFO
(
"RETRIEVED "
<<
triggerCombs
.
size
()
<<
" COMBINATIONS FOR "
<<
trigName
);
std
::
cout
<<
" Size of triggerCombs : "
<<
triggerCombs
.
size
()
<<
std
::
endl
;
ATH_MSG_INFO
(
" Size of triggerCombs : "
<<
triggerCombs
.
size
()
)
;
// Take all combinations for this b-jet trigger
std
::
vector
<
Trig
::
Combination
>::
const_iterator
triggerComb
;
for
(
triggerComb
=
triggerCombs
.
begin
();
triggerComb
!=
triggerCombs
.
end
();
++
triggerComb
)
{
...
...
@@ -171,7 +171,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
if
(
not
onlinepv
->
empty
())
{
// PVz_tr
std
::
string
NameH
=
"PVz_tr_"
+
trigName
;
std
::
cout
<<
" NameH: "
<<
NameH
<<
std
::
endl
;
ATH_MSG_INFO
(
" NameH: "
<<
NameH
)
;
auto
PVz_tr
=
Monitored
::
Scalar
<
float
>
(
NameH
,
0.0
);
PVz_tr
=
(
*
(
onlinepv
))[
0
]
->
z
();
ATH_MSG_INFO
(
" PVz_tr: "
<<
PVz_tr
);
...
...
@@ -188,7 +188,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for
(
const
auto
*
trk
:
*
onlinetrack
)
{
// d0
std
::
string
NameH
=
"d0_"
+
trigName
;
std
::
cout
<<
" NameH: "
<<
NameH
<<
std
::
endl
;
ATH_MSG_INFO
(
" NameH: "
<<
NameH
)
;
auto
d0
=
Monitored
::
Scalar
<
float
>
(
NameH
,
0.0
);
d0
=
trk
->
d0
();
ATH_MSG_INFO
(
" d0: "
<<
d0
);
...
...
@@ -205,7 +205,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for
(
const
auto
*
bjet
:
*
onlinebjet
)
{
// wMV2c20
std
::
string
NameH
=
"wMV2c20_"
+
trigName
;
std
::
cout
<<
" NameH: "
<<
NameH
<<
std
::
endl
;
ATH_MSG_INFO
(
" NameH: "
<<
NameH
)
;
auto
wMV2c20
=
Monitored
::
Scalar
<
double
>
(
NameH
,
0.0
);
wMV2c20
=
bjet
->
auxdata
<
double
>
(
"MV2c20_discriminant"
);
ATH_MSG_INFO
(
" wMV2c20: "
<<
wMV2c20
);
...
...
@@ -227,7 +227,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for
(
const
auto
*
jet
:
*
onlinejet
)
{
// jetPt
std
::
string
NameH
=
"jetPt_"
+
trigName
;
std
::
cout
<<
" NameH: "
<<
NameH
<<
std
::
endl
;
ATH_MSG_INFO
(
" NameH: "
<<
NameH
)
;
auto
jetPt
=
Monitored
::
Scalar
<
float
>
(
NameH
,
0.0
);
jetPt
=
(
jet
->
pt
())
*
1.e-3
;
ATH_MSG_INFO
(
" jetPt: "
<<
jetPt
);
...
...
@@ -260,7 +260,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for
(
const
auto
*
jet
:
*
onlinejet
)
{
// jetPt
std
::
string
NameH
=
"jetPt_"
+
trigName
;
std
::
cout
<<
" NameH: "
<<
NameH
<<
std
::
endl
;
ATH_MSG_INFO
(
" NameH: "
<<
NameH
)
;
auto
jetPt
=
Monitored
::
Scalar
<
float
>
(
NameH
,
0.0
);
jetPt
=
(
jet
->
pt
())
*
1.e-3
;
ATH_MSG_INFO
(
" jetPt: "
<<
jetPt
);
...
...
@@ -293,7 +293,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
// jetPt
const
xAOD
::
Jet
*
jet
=
*
(
jetLinkInfo
.
link
);
std
::
string
NameH
=
"jetPt_"
+
trigName
;
std
::
cout
<<
" NameH: "
<<
NameH
<<
std
::
endl
;
ATH_MSG_INFO
(
" NameH: "
<<
NameH
)
;
auto
jetPt
=
Monitored
::
Scalar
<
float
>
(
NameH
,
0.0
);
jetPt
=
(
jet
->
pt
())
*
1.e-3
;
ATH_MSG_INFO
(
" jetPt: "
<<
jetPt
);
...
...
@@ -304,7 +304,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
}
// else Run3
}
else
{
std
::
cout
<<
" Trigger chain from AllChains list: "
<<
trigName
<<
" has not fired "
<<
std
::
endl
;
ATH_MSG_INFO
(
" Trigger chain from AllChains list: "
<<
trigName
<<
" has not fired "
)
;
}
// trigger not fired
...
...
Trigger/TrigMonitoring/TrigBjetMonitoring/src/TrigBjetMonitorAlgorithm.h
View file @
0e9ececc
...
...
@@ -25,10 +25,10 @@ class TrigBjetMonitorAlgorithm : public AthMonitorAlgorithm {
private:
// Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
Gaudi
::
Property
<
bool
>
m_doRandom
{
this
,
"RandomHist"
,
true
};
// const std::vector<std::string> m_
A
llChains;
std
::
vector
<
std
::
string
>
m_
A
llChains
;
SG
::
ReadHandleKey
<
xAOD
::
MuonContainer
>
m_
M
uonContainerKey
;
SG
::
ReadHandleKey
<
xAOD
::
VertexContainer
>
m_
V
ertexContainerKey
;
// const std::vector<std::string> m_
a
llChains;
std
::
vector
<
std
::
string
>
m_
a
llChains
;
SG
::
ReadHandleKey
<
xAOD
::
MuonContainer
>
m_
m
uonContainerKey
;
SG
::
ReadHandleKey
<
xAOD
::
VertexContainer
>
m_
v
ertexContainerKey
;
ToolHandle
<
Trig
::
TrigDecisionTool
>
m_trigDec
;
//!
};
#endif
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