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
cacd0bac
Commit
cacd0bac
authored
Feb 20, 2020
by
Walter Lampl
Browse files
Merge branch 'revert-
0ba0d394
' into 'master'
Revert "Merge branch 'JetDecorators_190729' into 'master'" See merge request
atlas/athena!30491
parents
48d0c293
0d5fb67e
Changes
13
Hide whitespace changes
Inline
Side-by-side
Reconstruction/Jet/JetMomentTools/JetMomentTools/JetCaloQualityTool.h
View file @
cacd0bac
// this file is -*- C++ -*-
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
*/
/**
...
...
@@ -25,37 +25,30 @@
#ifndef JETREC_JETCALOQUALITYTOOL_H
#define JETREC_JETCALOQUALITYTOOL_H
#include "
AsgTools/AsgTool
.h"
#include "JetInterface/IJetDecorator.h"
#include "
JetRec/JetModifierBase
.h"
#include "JetUtils/JetCaloCalculations.h"
#include "StoreGate/WriteDecorHandleKeyArray.h"
#include <vector>
#include <string>
class
JetCaloQualityTool
:
public
asg
::
AsgTool
,
virtual
public
IJetDecorator
{
class
JetCaloQualityTool
:
public
JetModifierBase
{
ASG_TOOL_CLASS0
(
JetCaloQualityTool
)
public:
JetCaloQualityTool
(
const
std
::
string
&
name
);
virtual
StatusCode
decorate
(
const
xAOD
::
JetContainer
&
jets
)
const
override
;
virtual
int
modifyJet
(
xAOD
::
Jet
&
)
const
;
virtual
StatusCode
initialize
()
override
;
virtual
StatusCode
initialize
();
protected:
/// Names of calo quantities to compute and to add as attributes
std
::
vector
<
std
::
string
>
m_calculationNames
;
Gaudi
::
Property
<
std
::
vector
<
std
::
string
>
>
m_calculationNames
{
this
,
"Calculations"
,
{},
"Name of calo quantities to compute and add as decorations"
};
Gaudi
::
Property
<
std
::
vector
<
double
>
>
m_timingTimeCuts
{
this
,
"TimingCuts"
,
{},
"Time cuts for out-of-time calo quantities"
};
Gaudi
::
Property
<
std
::
string
>
m_jetContainerName
{
this
,
"JetContainer"
,
""
,
"SG key of input jet container"
};
SG
::
WriteDecorHandleKeyArray
<
xAOD
::
JetContainer
>
m_writeDecorKeys
{
this
,
"OutputDecorKeys"
,
{},
"SG keys for output decorations (not to be configured manually!)"
};
/// Time cuts for Out-of-time calo quantities.
std
::
vector
<
double
>
m_timingTimeCuts
;
/// This objects holds a list of cluster-based calculators
jet
::
JetCaloCalculations
m_jetCalculations
;
...
...
@@ -63,6 +56,7 @@ public:
// internal pointer to m_jetCalculations (this pointer is also used in the cell-based derived tool)
jet
::
JetCaloCalculations
*
m_calcProcessor
;
bool
m_doFracSamplingMax
;
// internal
};
#endif
...
...
Reconstruction/Jet/JetMomentTools/JetMomentTools/JetECPSFractionTool.h
View file @
cacd0bac
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
*/
// JetECPSFractionTool.h
...
...
@@ -21,37 +21,27 @@
/// ECPSFraction: Fraction of jet energy in the ECPS
///
#include "AsgTools/AsgTool.h"
#include "StoreGate/WriteDecorHandleKey.h"
#include "JetInterface/IJetDecorator.h"
class
JetECPSFractionTool
:
public
asg
::
AsgTool
,
virtual
public
IJetDecorator
{
ASG_TOOL_CLASS
(
JetECPSFractionTool
,
IJetDecorator
)
#include "JetRec/JetModifierBase.h"
class
JetECPSFractionTool
:
public
JetModifierBase
{
ASG_TOOL_CLASS
(
JetECPSFractionTool
,
IJetModifier
)
public:
// Constructor from tool name.
JetECPSFractionTool
(
std
::
string
myname
);
// Inherited method to decorate a jet.
virtual
StatusCode
decorate
(
const
xAOD
::
JetContainer
&
jets
)
const
override
;
// Inherited from AsgTool
virtual
StatusCode
initialize
()
override
;
// Inherited method to modify a jet.
// Calls width and puts the result on the jet.
int
modifyJet
(
xAOD
::
Jet
&
jet
)
const
;
// Local method to calculate and return the energy fraction.
double
energyFraction
(
const
xAOD
::
Jet
&
jet
)
const
;
private:
Gaudi
::
Property
<
double
>
m_fraclimit
{
this
,
"ECPSFractionThreshold"
,
0.8
,
"Threshold for identifying a cluser as ECPS"
};
Gaudi
::
Property
<
std
::
string
>
m_jetContainerName
{
this
,
"JetContainer"
,
""
,
"SG key for input jet container"
};
SG
::
WriteDecorHandleKey
<
xAOD
::
JetContainer
>
m_fracKey
{
this
,
"ECPSFractionDecorKey"
,
"ECPSFraction"
,
"Name for output ECPS fraction decoration"
};
// Properties.
double
m_fraclimit
;
};
...
...
Reconstruction/Jet/JetMomentTools/JetMomentTools/JetLArHVTool.h
View file @
cacd0bac
// this file is -*- C++ -*-
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
*/
...
...
@@ -17,32 +17,23 @@
#ifndef JETMOMENTTOOLS_JETLARHVTOOL_H
#define JETMOMENTTOOLS_JETLARHVTOOL_H
#include "JetRec/JetModifierBase.h"
#include "AsgTools/ToolHandle.h"
#include "AsgTools/AsgTool.h"
#include "StoreGate/WriteDecorHandleKey.h"
#include "JetInterface/IJetDecorator.h"
class
JetLArHVTool
:
public
asg
::
AsgTool
,
virtual
public
IJetDecorator
{
class
JetLArHVTool
:
public
JetModifierBase
{
ASG_TOOL_CLASS0
(
JetLArHVTool
)
public:
JetLArHVTool
(
const
std
::
string
&
name
);
virtual
StatusCode
decorate
(
const
xAOD
::
JetContainer
&
jets
)
const
override
;
virtual
StatusCode
initialize
()
override
;
virtual
int
modifyJet
(
xAOD
::
Jet
&
)
const
;
virtual
StatusCode
initialize
();
private:
Gaudi
::
Property
<
std
::
string
>
m_jetContainerName
{
this
,
"JetContainer"
,
""
,
"SG key for the input jet container"
};
SG
::
WriteDecorHandleKey
<
xAOD
::
JetContainer
>
m_fracKey
{
this
,
"EnergyFracDecorKey"
,
"LArBadHVEnergyFrac"
,
"SG key for energy fraction decoration (not including jet container name)"
};
SG
::
WriteDecorHandleKey
<
xAOD
::
JetContainer
>
m_nCellKey
{
this
,
"NCellDecorKey"
,
"LArBadHVNCell"
,
"SG key for nCell decoration (not including jet container name)"
};
};
#endif
...
...
Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVoronoiMomentsTool.h
View file @
cacd0bac
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
*/
// JetVoronoiMomentsTool.h
...
...
@@ -17,45 +17,35 @@
///
#include <string>
#include "AsgTools/AsgTool.h"
#include "StoreGate/WriteDecorHandleKey.h"
#include "JetInterface/IJetDecorator.h"
#include "JetRec/JetModifierBase.h"
#include "xAODJet/Jet.h"
namespace
JetVoronoiDiagramHelpers
{
struct
Diagram
;
}
class
JetVoronoiMomentsTool
:
public
asg
::
AsgTool
,
virtual
public
IJetDecorator
{
ASG_TOOL_CLASS
(
JetVoronoiMomentsTool
,
IJetDecorator
)
class
JetVoronoiMomentsTool
:
public
JetModifierBase
{
ASG_TOOL_CLASS
(
JetVoronoiMomentsTool
,
IJetModifier
)
public:
// Constructor from tool name
JetVoronoiMomentsTool
(
const
std
::
string
&
name
);
// Inherited from AsgTool via IJetDecorator
virtual
StatusCode
initialize
()
override
;
// Inherited method to decorate a jet container
virtual
StatusCode
decorate
(
const
xAOD
::
JetContainer
&
jets
)
const
override
;
// Inherited methods to modify a jet container
virtual
StatusCode
modify
(
xAOD
::
JetContainer
&
jets
)
const
;
virtual
int
modifyJet
(
xAOD
::
Jet
&
jet
)
const
;
private:
// parameters
Gaudi
::
Property
<
float
>
m_x_min
{
this
,
"AreaXmin"
,
-
10
,
"Minimum x-value for Voronoi diagram"
};
Gaudi
::
Property
<
float
>
m_x_max
{
this
,
"AreaXmax"
,
10
,
"Maximum x-value for Voronoi diagram"
};
Gaudi
::
Property
<
float
>
m_y_min
{
this
,
"AreaYmin"
,
-
4
,
"Minimum y-value for Voronoi diagram"
};
Gaudi
::
Property
<
float
>
m_y_max
{
this
,
"AreaYmax"
,
4
,
"Maximum y-value for Voronoi diagram"
};
Gaudi
::
Property
<
std
::
string
>
m_jetContainerName
{
this
,
"JetContainer"
,
""
,
"SG key for the input jet container"
};
SG
::
WriteDecorHandleKey
<
xAOD
::
JetContainer
>
m_voronoiAreaKey
{
this
,
"VoronoiAreaKey"
,
"VoronoiArea"
,
"SG key for Voronoi area decoration (not including jet container name)"
};
float
m_x_min
;
float
m_x_max
;
float
m_y_min
;
float
m_y_max
;
int
modifyJet
(
xAOD
::
Jet
&
jet
,
const
JetVoronoiDiagramHelpers
::
Diagram
&
voro
)
const
;
};
#endif
...
...
Reconstruction/Jet/JetMomentTools/JetMomentTools/JetWidthTool.h
View file @
cacd0bac
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
*/
// JetWidthTool.h
...
...
@@ -12,40 +12,28 @@
///
/// Tool to calculate the jet width.
#include "JetInterface/IJetDecorator.h"
#include "AsgTools/AsgTool.h"
#include "JetRec/JetModifierBase.h"
#include "AsgTools/ToolHandle.h"
#include "StoreGate/WriteDecorHandleKey.h"
#include "PFlowUtils/IWeightPFOTool.h"
class
JetWidthTool
:
public
asg
::
AsgTool
,
virtual
public
IJetDecorator
{
ASG_TOOL_CLASS
(
JetWidthTool
,
IJetDecorator
)
class
JetWidthTool
:
public
JetModifierBase
{
ASG_TOOL_CLASS
(
JetWidthTool
,
IJetModifier
)
public:
// Constructor from tool name.
JetWidthTool
(
std
::
string
myname
);
virtual
StatusCode
initialize
()
override
;
// Inherited method to decorate a jet container.
// Calls width and puts the result on the jets.
virtual
StatusCode
decorate
(
const
xAOD
::
JetContainer
&
jets
)
const
override
;
// Inherited method to modify a jet.
// Calls width and puts the result on the jet.
virtual
int
modifyJet
(
xAOD
::
Jet
&
jet
)
const
;
// Local method to calculate and return the width.
float
width
(
const
xAOD
::
Jet
&
jet
,
float
&
widthEta
,
float
&
widthPhi
)
const
;
//double width(const xAOD::Jet& jet) const;
double
width
(
const
xAOD
::
Jet
&
jet
,
double
&
widthEta
,
double
&
widthPhi
)
const
;
private:
Gaudi
::
Property
<
std
::
string
>
m_jetContainerName
{
this
,
"JetContainer"
,
""
,
"SG key for the input jet container"
};
SG
::
WriteDecorHandleKey
<
xAOD
::
JetContainer
>
m_widthKey
{
this
,
"WidthKey"
,
"Width"
,
"SG key for width decoration (not including jet container name)"
};
SG
::
WriteDecorHandleKey
<
xAOD
::
JetContainer
>
m_widthPhiKey
{
this
,
"WidthPhiKey"
,
"WidthPhi"
,
"SG key for width phi decoration (not including jet container name)"
};
};
#endif
Reconstruction/Jet/JetMomentTools/Root/JetCaloQualityTool.cxx
View file @
cacd0bac
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
*/
...
...
@@ -7,7 +7,6 @@
#include "JetMomentTools/JetCaloQualityTool.h"
#include "xAODJet/JetAccessorMap.h"
#include "StoreGate/WriteDecorHandle.h"
#include <iostream>
...
...
@@ -17,69 +16,50 @@ using namespace jet;
JetCaloQualityTool
::
JetCaloQualityTool
(
const
std
::
string
&
name
)
:
asg
::
AsgTool
(
name
)
:
JetModifierBase
(
name
)
{
declareInterface
<
IJetDecorator
>
(
this
);
}
StatusCode
JetCaloQualityTool
::
decorate
(
const
xAOD
::
JetContainer
&
jets
)
const
{
if
(
msgLvl
(
MSG
::
DEBUG
))
msg
(
MSG
::
DEBUG
)
<<
"Inside decorate() method"
<<
endmsg
;
declareProperty
(
"TimingCuts"
,
m_timingTimeCuts
);
declareProperty
(
"Calculations"
,
m_calculationNames
);
}
//bool checkedContainer = false;
const
size_t
nDecorations
=
m_writeDecorKeys
.
size
();
if
(
m_doFracSamplingMax
==
true
){
// Special case : we want to store more than 1 value (max sampling AND its index).
// AND there's no code available for direct cell access.
// So we just use a direct function instead of a calculator for now.
int
JetCaloQualityTool
::
modifyJet
(
xAOD
::
Jet
&
jet
)
const
{
// We specifically put these in last earlier
SG
::
WriteDecorHandle
<
xAOD
::
JetContainer
,
float
>
maxHandle
(
m_writeDecorKeys
.
at
(
nDecorations
-
2
));
SG
::
WriteDecorHandle
<
xAOD
::
JetContainer
,
int
>
samplingHandle
(
m_writeDecorKeys
.
at
(
nDecorations
-
1
));
if
(
msgLvl
(
MSG
::
DEBUG
))
msg
(
MSG
::
DEBUG
)
<<
"Inside process() method"
<<
endmsg
;
if
(
m_doFracSamplingMax
==
true
)
{
// Special case : we want to store more than 1 value (max sampling AND its index).
// AND there's no code available for direct cell access.
// So we just use a direct function instead of a calculator for now.
for
(
const
xAOD
::
Jet
*
jet
:
jets
){
int
sampling
=-
1
;
double
fracSamplingMax
=
JetCaloQualityUtils
::
fracSamplingMax
(
jet
,
sampling
);
double
fracSamplingMax
=
JetCaloQualityUtils
::
fracSamplingMax
(
&
jet
,
sampling
);
ATH_MSG_VERBOSE
(
"Setting "
<<
xAOD
::
JetAttribute
::
FracSamplingMax
<<
" to "
<<
fracSamplingMax
);
maxHandle
(
*
jet
)
=
fracSamplingMax
;
samplingHandle
(
*
jet
)
=
sampling
;
jet
.
setAttribute
<
float
>
(
xAOD
::
JetAttribute
::
FracSamplingMax
,
fracSamplingMax
);
jet
.
setAttribute
<
int
>
(
xAOD
::
JetAttribute
::
FracSamplingMaxIndex
,
sampling
)
;
}
}
// Do all other calculations
for
(
const
xAOD
::
Jet
*
jet
:
jets
){
std
::
vector
<
double
>
results
=
m_calcProcessor
->
process
(
jet
);
// store them in the jet
for
(
size_t
i
=
0
;
i
<
m_calcProcessor
->
numCalculators
();
i
++
)
{
// We inserted WriteDecorKeys in the same order as calculators
SG
::
WriteDecorHandle
<
xAOD
::
JetContainer
,
float
>
decHandle
(
m_writeDecorKeys
.
at
(
i
));
const
JetCaloCalculator
*
calc
=
m_calcProcessor
->
at
(
i
);
ATH_MSG_DEBUG
(
calc
->
name
()
<<
" -> "
<<
results
[
i
]
);
decHandle
(
*
jet
)
=
results
[
i
];
}
std
::
vector
<
double
>
results
=
m_calcProcessor
->
process
(
&
jet
);
// store them in the jet
for
(
size_t
i
=
0
;
i
<
m_calcProcessor
->
numCalculators
();
i
++
)
{
const
JetCaloCalculator
*
calc
=
m_calcProcessor
->
at
(
i
);
ATH_MSG_DEBUG
(
calc
->
name
()
<<
" -> "
<<
results
[
i
]
);
jet
.
setAttribute
<
float
>
(
calc
->
name
(),
results
[
i
]
);
}
return
StatusCode
::
SUCCESS
;
return
1
;
}
StatusCode
JetCaloQualityTool
::
initialize
()
{
ATH_MSG_DEBUG
(
"Inside initialize() method"
);
if
(
!
m_writeDecorKeys
.
empty
()){
ATH_MSG_ERROR
(
"OutputDecorKeys should not be configured manually!"
);
return
StatusCode
::
FAILURE
;
}
if
(
m_jetContainerName
.
empty
()){
ATH_MSG_ERROR
(
"JetCaloQualityTool needs to have its input jet container name configured!"
);
return
StatusCode
::
FAILURE
;
}
// In this tool we're using the cluster-based calculators
// (this is different in the cell-based calculation tool).
m_calcProcessor
=
&
m_jetCalculations
;
...
...
@@ -120,13 +100,10 @@ StatusCode JetCaloQualityTool::initialize() {
}
else
if
(
calcN
==
"FracSamplingMax"
)
{
m_doFracSamplingMax
=
true
;
// no calculator, as this is a special case.
}
}
// end loop over m_calculationNames
// Set the DecorHandleKeys with the correct strings
for
(
size_t
i
=
0
;
i
<
m_jetCalculations
.
numCalculators
();
i
++
){
m_writeDecorKeys
.
emplace_back
(
m_jetContainerName
+
"."
+
m_jetCalculations
.
at
(
i
)
->
name
());
}
}
// end loop over m_calculationNames
// Define OOT calculators.
for
(
double
&
timeCut
:
m_timingTimeCuts
){
...
...
@@ -138,17 +115,8 @@ StatusCode JetCaloQualityTool::initialize() {
c
->
setName
(
s
.
str
());
c
->
timecut
=
timeCut
;
m_jetCalculations
.
addCalculator
(
c
);
m_writeDecorKeys
.
emplace_back
(
m_jetContainerName
+
"."
+
s
.
str
());
}
// Add these last so m_jetCalculations and m_writeDecorKeys have corresponding indices
if
(
m_doFracSamplingMax
){
m_writeDecorKeys
.
emplace_back
(
m_jetContainerName
+
".FracSamplingMax"
);
m_writeDecorKeys
.
emplace_back
(
m_jetContainerName
+
".FracSamplingMaxIndex"
);
}
ATH_CHECK
(
m_writeDecorKeys
.
initialize
());
return
StatusCode
::
SUCCESS
;
}
...
...
Reconstruction/Jet/JetMomentTools/Root/JetECPSFractionTool.cxx
View file @
cacd0bac
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
19
CERN for the benefit of the ATLAS collaboration
*/
// JetECPSFractionTool.cxx
#include "StoreGate/WriteDecorHandle.h"
#include "JetMomentTools/JetECPSFractionTool.h"
#include "xAODCaloEvent/CaloCluster.h"
#include "xAODPFlow/PFO.h"
...
...
@@ -21,35 +20,16 @@ using xAOD::JetFourMom_t;
//**********************************************************************
JetECPSFractionTool
::
JetECPSFractionTool
(
std
::
string
myname
)
:
asg
::
AsgTool
(
myname
)
{
declareInterface
<
IJetDecorator
>
(
this
);
:
JetModifierBase
(
myname
)
{
declareProperty
(
"ECPSFractionThreshold"
,
m_fraclimit
=
0.8
);
}
//**********************************************************************
StatusCode
JetECPSFractionTool
::
initialize
(){
if
(
m_jetContainerName
.
empty
()){
ATH_MSG_ERROR
(
"JetECPSFractionTool needs to have its input jet container name configured!"
);
return
StatusCode
::
FAILURE
;
}
// Prepend jet collection name
m_fracKey
=
m_jetContainerName
+
"."
+
m_fracKey
.
key
();
ATH_CHECK
(
m_fracKey
.
initialize
());
return
StatusCode
::
SUCCESS
;
}
//**********************************************************************
StatusCode
JetECPSFractionTool
::
decorate
(
const
xAOD
::
JetContainer
&
jets
)
const
{
SG
::
WriteDecorHandle
<
xAOD
::
JetContainer
,
float
>
fracHandle
(
m_fracKey
);
for
(
const
xAOD
::
Jet
*
jet
:
jets
)
fracHandle
(
*
jet
)
=
energyFraction
(
*
jet
);
return
StatusCode
::
SUCCESS
;
int
JetECPSFractionTool
::
modifyJet
(
xAOD
::
Jet
&
jet
)
const
{
jet
.
setAttribute
(
"ECPSFraction"
,
energyFraction
(
jet
));
return
0
;
}
//**********************************************************************
...
...
Reconstruction/Jet/JetMomentTools/Root/JetLArHVTool.cxx
View file @
cacd0bac
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
*/
#include "StoreGate/WriteDecorHandle.h"
#include "JetUtils/JetDistances.h"
#include "JetMomentTools/JetLArHVTool.h"
#include "xAODCaloEvent/CaloCluster.h"
JetLArHVTool
::
JetLArHVTool
(
const
std
::
string
&
name
)
:
asg
::
AsgTool
(
name
)
:
JetModifierBase
(
name
)
{
declareInterface
<
IJetDecorator
>
(
this
);
}
StatusCode
JetLArHVTool
::
initialize
()
{
if
(
m_fracKey
.
key
().
at
(
0
)
==
'.'
||
m_nCellKey
.
key
().
at
(
0
)
==
'.'
){
ATH_MSG_ERROR
(
"JetLArHVTool needs to have its input jet container name configured!"
);
return
StatusCode
::
FAILURE
;
}
// Prepend jet container name
m_fracKey
=
m_jetContainerName
+
"."
+
m_fracKey
.
key
();
m_nCellKey
=
m_jetContainerName
+
"."
+
m_nCellKey
.
key
();
ATH_CHECK
(
m_fracKey
.
initialize
());
ATH_CHECK
(
m_nCellKey
.
initialize
());
return
StatusCode
::
SUCCESS
;
}
StatusCode
JetLArHVTool
::
decorate
(
const
xAOD
::
Jet
Container
&
jet
s
)
const
int
JetLArHVTool
::
modifyJet
(
xAOD
::
Jet
&
jet
)
const
{
SG
::
WriteDecorHandle
<
xAOD
::
JetContainer
,
float
>
fracHandle
(
m_fracKey
);
SG
::
WriteDecorHandle
<
xAOD
::
JetContainer
,
int
>
nCellHandle
(
m_nCellKey
);
for
(
const
xAOD
::
Jet
*
jet
:
jets
){
double
energyHVaff
=
0
;
int
numCellsHVaff
=
0
;
// loop over raw constituents. Look for clusters
size_t
num
=
jet
->
numConstituents
();
for
(
size_t
i
=
0
;
i
<
num
;
i
++
)
{
const
xAOD
::
CaloCluster
*
cl
=
dynamic_cast
<
const
xAOD
::
CaloCluster
*>
(
jet
->
rawConstituent
(
i
));
if
(
!
cl
)
continue
;
double
m
;
if
(
cl
->
retrieveMoment
(
xAOD
::
CaloCluster
::
ENG_BAD_HV_CELLS
,
m
)
)
energyHVaff
+=
m
;
if
(
cl
->
retrieveMoment
(
xAOD
::
CaloCluster
::
N_BAD_HV_CELLS
,
m
)
)
numCellsHVaff
+=
m
;
}
double
emE
=
jet
->
jetP4
(
xAOD
::
JetEMScaleMomentum
).
E
();
// set the attributes
fracHandle
(
*
jet
)
=
energyHVaff
/
emE
;
nCellHandle
(
*
jet
)
=
numCellsHVaff
;
double
energyHVaff
=
0
;
int
numCellsHVaff
=
0
;
// loop over raw constituents. Look for clusters
size_t
num
=
jet
.
numConstituents
();
for
(
size_t
i
=
0
;
i
<
num
;
i
++
)
{
const
xAOD
::
CaloCluster
*
cl
=
dynamic_cast
<
const
xAOD
::
CaloCluster
*>
(
jet
.
rawConstituent
(
i
));
if
(
!
cl
)
continue
;
double
m
;
if
(
cl
->
retrieveMoment
(
xAOD
::
CaloCluster
::
ENG_BAD_HV_CELLS
,
m
)
)
energyHVaff
+=
m
;
if
(
cl
->
retrieveMoment
(
xAOD
::
CaloCluster
::
N_BAD_HV_CELLS
,
m
)
)
numCellsHVaff
+=
m
;
}
return
StatusCode
::
SUCCESS
;
double
emE
=
jet
.
jetP4
(
xAOD
::
JetEMScaleMomentum
).
E
();
// set the attributes
jet
.
setAttribute
<
float
>
(
"LArBadHVEnergyFrac"
,
energyHVaff
/
emE
);
jet
.
setAttribute
<
int
>
(
"LArBadHVNCell"
,
numCellsHVaff
);
return
0
;
}
Reconstruction/Jet/JetMomentTools/Root/JetWidthTool.cxx
View file @
cacd0bac
/*
Copyright (C) 2002-20
20
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-20
17
CERN for the benefit of the ATLAS collaboration
*/
// JetWidthTool.cxx
#include "JetMomentTools/JetWidthTool.h"
#include "StoreGate/WriteDecorHandle.h"
#include "xAODJet/JetConstituentVector.h"
#include "JetUtils/JetDistances.h"
#include "PFlowUtils/IWeightPFOTool.h"
...
...
@@ -13,47 +13,52 @@
//**********************************************************************
JetWidthTool
::
JetWidthTool
(
std
::
string
myname
)
:
asg
::
AsgTool
(
myname
)
:
JetModifierBase
(
myname
)