Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kazuya Mochizuki
athena
Commits
237de832
Commit
237de832
authored
Dec 12, 2018
by
Pavol Strizenec
Committed by
Vakhtang Tsulaia
Dec 12, 2018
Browse files
Change LArAffectedRegion info
Former-commit-id:
4e02af32
parent
f16706e6
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_back.py
View file @
237de832
...
...
@@ -55,10 +55,8 @@ def make_CaloSwDeadOTX_back(name = None,
confclass
=
None
,
**
kw
):
from
CaloTools.CaloAffectedToolDefault
import
CaloAffectedToolDefault
theAffectedTool
=
CaloAffectedToolDefault
()
from
AthenaCommon.AppMgr
import
ToolSvc
ToolSvc
+=
theAffectedTool
from
CaloTools.CaloToolsConf
import
CaloAffectedTool
theAffectedTool
=
CaloAffectedTool
(
"CaloAffectedForDeadOTX_back"
)
# Make the tool.
return
makecorr
(
versions
=
CaloSwDeadOTX_back_versions
,
...
...
Calorimeter/CaloClusterCorrection/python/CaloSwDeadOTX_ps.py
View file @
237de832
...
...
@@ -55,10 +55,8 @@ def make_CaloSwDeadOTX_ps(name = None,
confclass
=
None
,
**
kw
):
from
CaloTools.CaloAffectedToolDefault
import
CaloAffectedToolDefault
theAffectedTool
=
CaloAffectedToolDefault
()
from
AthenaCommon.AppMgr
import
ToolSvc
ToolSvc
+=
theAffectedTool
from
CaloTools.CaloToolsConf
import
CaloAffectedTool
theAffectedTool
=
CaloAffectedTool
(
"CaloAffectedToolForDeadOTX_ps"
)
# Make the tool.
return
makecorr
(
versions
=
CaloSwDeadOTX_ps_versions
,
...
...
Calorimeter/CaloClusterCorrection/src/CaloSwDeadOTX_back.cxx
View file @
237de832
...
...
@@ -33,8 +33,7 @@ CaloSwDeadOTX_back::CaloSwDeadOTX_back
(
const
std
::
string
&
type
,
const
std
::
string
&
name
,
const
IInterface
*
parent
)
:
CaloClusterCorrectionCommon
(
type
,
name
,
parent
)
,
m_affectedTool
(
"CaloAffectedTool"
)
:
CaloClusterCorrectionCommon
(
type
,
name
,
parent
)
{
declareConstant
(
"correction"
,
m_correction
);
declareConstant
(
"sampling_depth"
,
m_sampling_depth
);
...
...
@@ -42,7 +41,6 @@ CaloSwDeadOTX_back::CaloSwDeadOTX_back
declareConstant
(
"eta_end_crack"
,
m_eta_end_crack
);
declareConstant
(
"etamax"
,
m_etamax
);
declareConstant
(
"use_raw_eta"
,
m_use_raw_eta
);
declareProperty
(
"affectedTool"
,
m_affectedTool
);
}
StatusCode
CaloSwDeadOTX_back
::
initialize
()
...
...
@@ -53,7 +51,8 @@ StatusCode CaloSwDeadOTX_back::initialize()
// the template in AlgTool.
// CHECK( setProperty ("isDummy", std::string("1")) );
ATH_CHECK
(
m_affKey
.
initialize
());
ATH_MSG_DEBUG
(
" --------------->>>>> CaloSwDeadOTX_back :: retrieving affectedTool"
<<
endmsg
);
if
(
m_affectedTool
.
retrieve
().
isFailure
()){
...
...
@@ -67,7 +66,7 @@ StatusCode CaloSwDeadOTX_back::initialize()
}
void
CaloSwDeadOTX_back
::
makeTheCorrection
(
const
EventContext
&
/*
ctx
*/
,
(
const
EventContext
&
ctx
,
CaloCluster
*
cluster
,
const
CaloDetDescrElement
*
/*elt*/
,
float
eta
,
...
...
@@ -80,6 +79,13 @@ void CaloSwDeadOTX_back::makeTheCorrection
// ??? In principle, we should use adj_eta for the interpolation
// and range checks. However, the v2 corrections were derived
// using regular eta instead.
//
//Get affected info for this event
SG
::
ReadCondHandle
<
CaloAffectedRegionInfoVec
>
affHdl
{
m_affKey
,
ctx
};
const
CaloAffectedRegionInfoVec
*
affCont
=*
affHdl
;
if
(
!
affCont
)
{
ATH_MSG_WARNING
(
"Do not have affected regions info, is this expected ?"
);
}
float
the_aeta
;
if
(
m_use_raw_eta
)
...
...
@@ -129,10 +135,8 @@ void CaloSwDeadOTX_back::makeTheCorrection
float
dphi
=
0.025
;
int
layer
=
si
*
4
+
3
;
bool
check
=
m_affectedTool
->
isAffected
(
cluster
,
deta
,
dphi
,
layer
,
layer
,
0
)
;
// check dead OTX in barrel PS
bool
check
=
m_affectedTool
->
isAffected
(
cluster
,
affCont
,
deta
,
dphi
,
layer
,
layer
,
0
)
;
// check dead OTX in barrel PS
// bool checke = m_affectedTool->isAffected(cluster ,deta , dphi ,4,4,0) ; // check dead OTX in endcap PS
// bool checkb = m_affectedTool->isAffected(cluster ,deta , dphi ,0,0,0) ; // check dead OTX in barrel PS
// if a cluster is in an affected region set the back energy to zero else return
...
...
Calorimeter/CaloClusterCorrection/src/CaloSwDeadOTX_back.h
View file @
237de832
...
...
@@ -15,6 +15,7 @@ PACKAGE: offline/Calorimeter/CaloClusterCorrection
#include "CaloInterface/ICaloAffectedTool.h"
#include "CaloClusterCorrection/CaloClusterCorrectionCommon.h"
#include "CaloConditions/Array.h"
#include "CaloConditions/CaloAffectedRegionInfoVec.h"
class
CaloSwDeadOTX_back
:
public
CaloClusterCorrectionCommon
{
...
...
@@ -57,8 +58,10 @@ public:
private:
// std::string m_affectedTool;
ToolHandle
<
ICaloAffectedTool
>
m_affectedTool
;
SG
::
ReadCondHandleKey
<
CaloAffectedRegionInfoVec
>
m_affKey
{
this
,
"LArAffectedRegionKey"
,
"LArAffectedRegionInfo"
,
"SG key for affected regions cond object"
};
ToolHandle
<
ICaloAffectedTool
>
m_affectedTool
{
this
,
"AffectedTool"
,
"CaloAffectedTool"
,
"affected tool instance"
};
CaloRec
::
Array
<
3
>
m_correction
;
CaloRec
::
Array
<
2
>
m_sampling_depth
;
...
...
Calorimeter/CaloClusterCorrection/src/CaloSwDeadOTX_ps.cxx
View file @
237de832
...
...
@@ -32,8 +32,7 @@ CaloSwDeadOTX_ps::CaloSwDeadOTX_ps
(
const
std
::
string
&
type
,
const
std
::
string
&
name
,
const
IInterface
*
parent
)
:
CaloClusterCorrectionCommon
(
type
,
name
,
parent
)
,
m_affectedTool
(
"CaloAffectedTool"
)
:
CaloClusterCorrectionCommon
(
type
,
name
,
parent
)
{
declareConstant
(
"correction"
,
m_correction
);
declareConstant
(
"sampling_depth"
,
m_sampling_depth
);
...
...
@@ -41,7 +40,6 @@ CaloSwDeadOTX_ps::CaloSwDeadOTX_ps
declareConstant
(
"eta_end_crack"
,
m_eta_end_crack
);
declareConstant
(
"etamax"
,
m_etamax
);
declareConstant
(
"use_raw_eta"
,
m_use_raw_eta
);
declareProperty
(
"affectedTool"
,
m_affectedTool
);
}
StatusCode
CaloSwDeadOTX_ps
::
initialize
()
...
...
@@ -52,6 +50,7 @@ StatusCode CaloSwDeadOTX_ps::initialize()
// the template in AlgTool.
// CHECK( setProperty ("isDummy", std::string("1")) );
ATH_CHECK
(
m_affKey
.
initialize
());
ATH_MSG_DEBUG
(
" --------------->>>>> CaloSwDeadOTX_ps :: retrieving affectedTool"
<<
endmsg
);
...
...
@@ -66,7 +65,7 @@ StatusCode CaloSwDeadOTX_ps::initialize()
}
void
CaloSwDeadOTX_ps
::
makeTheCorrection
(
const
EventContext
&
/*
ctx
*/
,
(
const
EventContext
&
ctx
,
CaloCluster
*
cluster
,
const
CaloDetDescrElement
*
/*elt*/
,
float
eta
,
...
...
@@ -80,6 +79,13 @@ void CaloSwDeadOTX_ps::makeTheCorrection
// and range checks. However, the v2 corrections were derived
// using regular eta instead.
//Get affected info for this event
SG
::
ReadCondHandle
<
CaloAffectedRegionInfoVec
>
affHdl
{
m_affKey
,
ctx
};
const
CaloAffectedRegionInfoVec
*
affCont
=*
affHdl
;
if
(
!
affCont
)
{
ATH_MSG_WARNING
(
"Do not have affected regions info, is this expected ?"
);
}
float
the_aeta
;
if
(
m_use_raw_eta
)
the_aeta
=
std
::
abs
(
adj_eta
);
...
...
@@ -129,10 +135,8 @@ void CaloSwDeadOTX_ps::makeTheCorrection
float
dphi
=
0.025
;
int
layer
=
si
*
4
;
bool
check
=
m_affectedTool
->
isAffected
(
cluster
,
deta
,
dphi
,
layer
,
layer
,
0
)
;
// check dead OTX in barrel PS
bool
check
=
m_affectedTool
->
isAffected
(
cluster
,
affCont
,
deta
,
dphi
,
layer
,
layer
,
0
)
;
// check dead OTX in barrel PS
// bool checke = m_affectedTool->isAffected(cluster ,deta , dphi ,4,4,0) ; // check dead OTX in endcap PS
// bool checkb = m_affectedTool->isAffected(cluster ,deta , dphi ,0,0,0) ; // check dead OTX in barrel PS
// if a cluster is in an affected region set the PS energy to zero else return
...
...
Calorimeter/CaloClusterCorrection/src/CaloSwDeadOTX_ps.h
View file @
237de832
...
...
@@ -15,6 +15,7 @@ PACKAGE: offline/Calorimeter/CaloClusterCorrection
#include "CaloInterface/ICaloAffectedTool.h"
#include "CaloClusterCorrection/CaloClusterCorrectionCommon.h"
#include "CaloConditions/Array.h"
#include "CaloConditions/CaloAffectedRegionInfoVec.h"
class
CaloSwDeadOTX_ps
:
public
CaloClusterCorrectionCommon
{
...
...
@@ -57,8 +58,9 @@ public:
private:
// std::string m_affectedTool;
ToolHandle
<
ICaloAffectedTool
>
m_affectedTool
;
SG
::
ReadCondHandleKey
<
CaloAffectedRegionInfoVec
>
m_affKey
{
this
,
"LArAffectedRegionKey"
,
"LArAffectedRegionInfo"
,
"SG key for affected regions cond object"
};
ToolHandle
<
ICaloAffectedTool
>
m_affectedTool
{
this
,
"AffectedTool"
,
"CaloAffectedTool"
,
"affected tool instance"
};
CaloRec
::
Array
<
3
>
m_correction
;
CaloRec
::
Array
<
2
>
m_sampling_depth
;
...
...
Calorimeter/CaloConditions/CaloConditions/CaloAffectedRegionInfoVec.h
View file @
237de832
...
...
@@ -12,5 +12,5 @@ typedef std::vector<CaloAffectedRegionInfo> CaloAffectedRegionInfoVec;
#include "AthenaKernel/CLASS_DEF.h"
CLASS_DEF
(
CaloAffectedRegionInfoVec
,
36372397
,
1
)
CLASS_DEF
(
CondCont
<
CaloAffectedRegionInfoVec
>
,
162668004
,
1
)
#endif
Calorimeter/CaloInterface/CMakeLists.txt
View file @
237de832
...
...
@@ -9,6 +9,7 @@ atlas_subdir( CaloInterface )
atlas_depends_on_subdirs
(
PUBLIC
Calorimeter/CaloEvent
Calorimeter/CaloIdentifier
Calorimeter/CaloConditions
Control/AthenaKernel
DetectorDescription/Identifier
Event/xAOD/xAODCaloEvent
...
...
@@ -22,7 +23,7 @@ atlas_add_dictionary( CaloInterfaceDict
CaloInterface/CaloInterfaceDict.h
CaloInterface/selection.xml
INCLUDE_DIRS
${
ROOT_INCLUDE_DIRS
}
LINK_LIBRARIES
${
ROOT_LIBRARIES
}
CaloEvent CaloIdentifier AthenaKernel Identifier xAODCaloEvent GaudiKernel
)
LINK_LIBRARIES
${
ROOT_LIBRARIES
}
CaloEvent CaloIdentifier
CaloConditions
AthenaKernel Identifier xAODCaloEvent GaudiKernel
)
# Install files from the package:
atlas_install_headers
(
CaloInterface
)
...
...
Calorimeter/CaloInterface/CaloInterface/ICaloAffectedTool.h
View file @
237de832
/*
Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-201
8
CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -7,6 +7,7 @@
///
/// \author G.Unal
/// \date March 2010
/// \updated Dec 2018 by P. Strizenec
///
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -15,6 +16,9 @@
// Includes for Gaudi
#include "GaudiKernel/IAlgTool.h"
#include "AthenaKernel/CondCont.h"
#include "CaloConditions/CaloAffectedRegionInfoVec.h"
#include <vector>
namespace
xAOD
{
...
...
@@ -26,7 +30,7 @@ class ICaloAffectedTool: virtual public IAlgTool {
public:
static
const
InterfaceID
&
interfaceID
()
{
static
const
InterfaceID
IID_ICaloAffectedTool
(
"ICaloAffectedTool"
,
1
,
0
);
static
const
InterfaceID
IID_ICaloAffectedTool
(
"ICaloAffectedTool"
,
2
,
0
);
return
IID_ICaloAffectedTool
;
}
...
...
@@ -35,6 +39,7 @@ public:
and with a problemType (0= deadReadout, 1 = deadHV, 2 = affectedHV, -1= all problems)
@param p 4 momentum pointer to check
@param vAff pointer to conditions object with affected regions
@param deta = eta tolerance
@param dphi = phi tolerance
@param layer_min = min calo layer to check
...
...
@@ -42,13 +47,14 @@ public:
@param problemType = type of problem in affacted region
*/
virtual
bool
isAffected
(
const
xAOD
::
IParticle
*
p
,
float
deta
=
0
,
float
dphi
=
0
,
int
layer_min
=
0
,
int
layer_max
=-
1
,
int
problemType
=-
1
)
const
=
0
;
virtual
bool
isAffected
(
const
xAOD
::
IParticle
*
p
,
const
CaloAffectedRegionInfoVec
*
vAff
,
float
deta
=
0
,
float
dphi
=
0
,
int
layer_min
=
0
,
int
layer_max
=-
1
,
int
problemType
=-
1
)
const
=
0
;
/*
Return list of layers affected with their problem for a given 4 momentum
Return true is any problem is fonund
@param p 4 momentum pointer to check
@param vAff pointer to conditions object with affected regions
@param deta = eta tolerance
@param dphi = phi tolerance
@param problemType = filters only a given type of problem (-1 : all problems)
...
...
@@ -56,7 +62,7 @@ public:
@param problem_list = reference of vector to store list of problems
*/
virtual
bool
listAffected
(
const
xAOD
::
IParticle
*
p
,
std
::
vector
<
int
>&
layer_list
,
std
::
vector
<
int
>&
problem_list
,
float
deta
=
0
,
float
dphi
=
0
,
int
problemType
=-
1
)
const
=
0
;
virtual
bool
listAffected
(
const
xAOD
::
IParticle
*
p
,
const
CaloAffectedRegionInfoVec
*
vAff
,
std
::
vector
<
int
>&
layer_list
,
std
::
vector
<
int
>&
problem_list
,
float
deta
=
0
,
float
dphi
=
0
,
int
problemType
=-
1
)
const
=
0
;
};
...
...
Calorimeter/CaloRec/share/CaloRec_jobOptions.py
View file @
237de832
...
...
@@ -291,12 +291,12 @@ if jobproperties.CaloRecFlags.doTileMuId() :
#
# information on Calo AffectedRegion, write
metadata
# information on Calo AffectedRegion, write
conditions object
#
if
DetFlags
.
dcs
.
LAr_on
():
if
jobproperties
.
CaloRecFlags
.
doLArAffectedRegion
()
and
rec
.
doESD
and
(
not
rec
.
readESD
)
:
if
jobproperties
.
CaloRecFlags
.
doLArAffectedRegion
():
try
:
include
(
"LAr
AffectedRegion
/LArAffectedRegion
_write
.py"
)
include
(
"LAr
RecUtils
/LArAffectedRegion.py"
)
except
Exception
:
treatException
(
"Could not setup LArAffectedRegion"
)
...
...
Calorimeter/CaloTools/CaloTools/CaloAffectedTool.h
View file @
237de832
/*
Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-201
8
CERN for the benefit of the ATLAS collaboration
*/
/**
@class CaloAffectedTool
@brief Tool to check if object is in an affected region
@author G.Unal
@ changed to use conditions object by P. Strizenec
*/
#ifndef CALOTOOLS_CaloAffectedTool_H
...
...
@@ -13,8 +14,6 @@
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/IIncidentListener.h"
#include "GaudiKernel/IIncidentSvc.h"
#include "CaloInterface/ICaloAffectedTool.h"
#include "CaloConditions/CaloAffectedRegionInfoVec.h"
#include "AthenaKernel/IOVSvcDefs.h"
...
...
@@ -26,21 +25,8 @@ namespace xAOD {
class
StoreGateSvc
;
class
CaloAffectedTool
:
public
AthAlgTool
,
virtual
public
ICaloAffectedTool
,
virtual
public
IIncidentListener
virtual
public
ICaloAffectedTool
{
private:
CaloAffectedRegionInfoVec
*
m_affectedRegions
;
StatusCode
updateAffectedRegionsFromDB
(
IOVSVC_CALLBACK_ARGS
);
StatusCode
readDB
();
virtual
void
handle
(
const
Incident
&
inc
)
override
;
bool
m_read
;
bool
m_readRaw
;
public:
...
...
@@ -49,9 +35,9 @@ public:
const
IInterface
*
parent
);
virtual
~
CaloAffectedTool
();
virtual
bool
isAffected
(
const
xAOD
::
IParticle
*
p
,
float
deta
=
0.
,
float
dphi
=
0.
,
int
layer_min
=
0
,
int
layer_max
=-
1
,
int
problemType
=-
1
)
const
override
;
virtual
bool
isAffected
(
const
xAOD
::
IParticle
*
p
,
const
CaloAffectedRegionInfoVec
*
vAff
,
float
deta
=
0.
,
float
dphi
=
0.
,
int
layer_min
=
0
,
int
layer_max
=-
1
,
int
problemType
=-
1
)
const
override
;
virtual
bool
listAffected
(
const
xAOD
::
IParticle
*
p
,
std
::
vector
<
int
>&
layer_list
,
std
::
vector
<
int
>&
problem_list
,
float
deta
=
0
,
float
dphi
=
0
,
int
problemType
=-
1
)
const
override
;
virtual
bool
listAffected
(
const
xAOD
::
IParticle
*
p
,
const
CaloAffectedRegionInfoVec
*
vAff
,
std
::
vector
<
int
>&
layer_list
,
std
::
vector
<
int
>&
problem_list
,
float
deta
=
0
,
float
dphi
=
0
,
int
problemType
=-
1
)
const
override
;
virtual
StatusCode
initialize
()
override
;
...
...
Calorimeter/CaloTools/python/CaloAffectedToolDefault.py
deleted
100644 → 0
View file @
f16706e6
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from
AthenaCommon.Logging
import
logging
def
CaloAffectedToolDefault
(
name
=
'CaloAffectedToolDefault'
):
# check if tool already exists
from
AthenaCommon.AppMgr
import
ServiceMgr
as
svcMgr
if
hasattr
(
svcMgr
.
ToolSvc
,
name
):
# re-use previously configured (public) tool
return
getattr
(
svcMgr
.
ToolSvc
,
name
)
mlog
=
logging
.
getLogger
(
'CaloAffectedToolDefault'
)
from
CaloTools.CaloToolsConf
import
CaloAffectedTool
theTool
=
CaloAffectedTool
(
name
)
from
RecExConfig.RecFlags
import
rec
if
rec
.
readRDO
():
theTool
.
readRaw
=
True
else
:
theTool
.
readRaw
=
False
from
IOVDbSvc.CondDB
import
conddb
conddb
.
addFolder
(
''
,
'/LAR/LArAffectedRegionInfo<metaOnly/>'
)
return
theTool
Calorimeter/CaloTools/src/CaloAffectedTool.cxx
View file @
237de832
/*
Copyright (C) 2002-201
7
CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-201
8
CERN for the benefit of the ATLAS collaboration
*/
#include "CaloTools/CaloAffectedTool.h"
//#include "EventKernel/I4Momentum.h"
#include "xAODBase/IParticle.h"
#include "StoreGate/StoreGateSvc.h"
#include "CaloConditions/CaloAffectedRegionInfoVec.h"
...
...
@@ -14,145 +13,37 @@
CaloAffectedTool
::
CaloAffectedTool
(
const
std
::
string
&
type
,
const
std
::
string
&
name
,
const
IInterface
*
parent
)
:
AthAlgTool
(
type
,
name
,
parent
),
m_read
(
false
),
m_readRaw
(
true
)
AthAlgTool
(
type
,
name
,
parent
)
{
m_affectedRegions
=
nullptr
;
declareInterface
<
ICaloAffectedTool
>
(
this
);
declareProperty
(
"readRaw"
,
m_readRaw
);
}
//-----------------------------------------------------------------
CaloAffectedTool
::~
CaloAffectedTool
()
{
if
(
m_affectedRegions
&&
!
m_readRaw
)
delete
m_affectedRegions
;
}
//-------------------------------------------------------------------
StatusCode
CaloAffectedTool
::
initialize
()
{
if
(
!
m_readRaw
)
{
if
(
detStore
()
->
contains
<
CondAttrListCollection
>
(
"/LAR/LArAffectedRegionInfo"
))
{
const
DataHandle
<
CondAttrListCollection
>
affectedRegionH
;
if
(
detStore
()
->
regFcn
(
&
CaloAffectedTool
::
updateAffectedRegionsFromDB
,
this
,
affectedRegionH
,
"/LAR/LArAffectedRegionInfo"
).
isSuccess
())
{
ATH_MSG_DEBUG
(
"Registered callback for LArAffectedRegion "
);
}
else
{
ATH_MSG_WARNING
(
"Cannot register callback for LArAffectedRegion "
);
}
}
else
{
ATH_MSG_WARNING
(
" no LArAffectedRegion information available from metadata "
);
}
}
else
{
// register incident handler for begin event
IIncidentSvc
*
incSvc
=
nullptr
;
ATH_CHECK
(
service
(
"IncidentSvc"
,
incSvc
)
);
long
int
priority
=
100
;
incSvc
->
addListener
(
this
,
"BeginEvent"
,
priority
);
}
m_read
=
false
;
return
StatusCode
::
SUCCESS
;
}
//---------------------------------------------------------
void
CaloAffectedTool
::
handle
(
const
Incident
&
inc
)
{
if
(
inc
.
type
()
!=
"BeginEvent"
)
return
;
if
(
detStore
()
->
contains
<
CaloAffectedRegionInfoVec
>
(
"LArAffectedRegion"
))
{
if
(
detStore
()
->
retrieve
(
m_affectedRegions
,
"LArAffectedRegion"
).
isFailure
())
{
ATH_MSG_WARNING
(
" cannot read LArAffectedRegion at begin of event "
);
return
;
}
m_read
=
true
;
//std::cout << " got affected regions at beginning of event " << std::endl;
return
;
}
return
;
}
//--------------------------------------------------
StatusCode
CaloAffectedTool
::
updateAffectedRegionsFromDB
(
IOVSVC_CALLBACK_ARGS
)
{
return
this
->
readDB
();
}
StatusCode
CaloAffectedTool
::
readDB
()
{
ATH_MSG_INFO
(
"updateAffectedRegionsFromDB()"
);
// retrieve from detStore
const
CondAttrListCollection
*
attrListColl
=
nullptr
;
StatusCode
sc
=
detStore
()
->
retrieve
(
attrListColl
,
"/LAR/LArAffectedRegionInfo"
);
if
(
sc
.
isFailure
())
{
ATH_MSG_WARNING
(
"attrrListColl not found for /LAR/CaloAffectedRegionInfo "
);
return
StatusCode
::
SUCCESS
;
}
if
(
m_affectedRegions
)
{
m_affectedRegions
->
clear
();
}
else
{
m_affectedRegions
=
new
CaloAffectedRegionInfoVec
();
}
// Loop over collection
CondAttrListCollection
::
const_iterator
first
=
attrListColl
->
begin
();
CondAttrListCollection
::
const_iterator
last
=
attrListColl
->
end
();
for
(;
first
!=
last
;
++
first
)
{
std
::
ostringstream
attrStr1
;
(
*
first
).
second
.
toOutputStream
(
attrStr1
);
ATH_MSG_DEBUG
(
"ChanNum "
<<
(
*
first
).
first
<<
" Attribute list "
<<
attrStr1
.
str
()
);
// const AttributeList& attrList = (*first).second;
const
coral
::
AttributeList
&
attrList
=
(
*
first
).
second
;
CaloAffectedRegionInfo
info
;
float
eta_min
=
attrList
[
"eta_min"
].
data
<
float
>
();
float
eta_max
=
attrList
[
"eta_max"
].
data
<
float
>
();
float
phi_min
=
attrList
[
"phi_min"
].
data
<
float
>
();
float
phi_max
=
attrList
[
"phi_max"
].
data
<
float
>
();
int
layer_min
=
attrList
[
"layer_min"
].
data
<
int
>
();
int
layer_max
=
attrList
[
"layer_max"
].
data
<
int
>
();
//std::cout << " affected region found " << eta_min << " " << eta_max << " " << phi_min << " " << phi_max << " " << layer_min << " " << layer_max << " " << attrList["problem"].data<int>() << std::endl;
CaloAffectedRegionInfo
::
type_problem
problem
=
(
CaloAffectedRegionInfo
::
type_problem
)(
attrList
[
"problem"
].
data
<
int
>
());
info
.
FillCaloAffectedRegionInfo
(
eta_min
,
eta_max
,
phi_min
,
phi_max
,
layer_min
,
layer_max
,
problem
);
m_affectedRegions
->
push_back
(
info
);
}
m_read
=
true
;
return
StatusCode
::
SUCCESS
;
}
//-------------------------------------------------
bool
CaloAffectedTool
::
isAffected
(
const
xAOD
::
IParticle
*
p
,
float
deta
,
float
dphi
,
int
layer_min
,
int
layer_max
,
int
problemType
)
const
bool
CaloAffectedTool
::
isAffected
(
const
xAOD
::
IParticle
*
p
,
const
CaloAffectedRegionInfoVec
*
vAff
,
float
deta
,
float
dphi
,
int
layer_min
,
int
layer_max
,
int
problemType
)
const
{
if
(
!
vAff
)
return
false
;
static
float
epsilon
=
1e-6
;
//std::cout << " in isAffected " << p->eta() << " " << p->phi() << std::endl;
if
(
!
m_read
)
return
false
;
if
(
!
m_affectedRegions
)
return
false
;
std
::
vector
<
CaloAffectedRegionInfo
>::
const_iterator
reg1
=
m_affectedRegions
->
begin
();
std
::
vector
<
CaloAffectedRegionInfo
>::
const_iterator
reg2
=
m_affectedRegions
->
end
();
std
::
vector
<
CaloAffectedRegionInfo
>::
const_iterator
reg1
=
vAff
->
begin
();
std
::
vector
<
CaloAffectedRegionInfo
>::
const_iterator
reg2
=
vAff
->
end
();
for
(;
reg1
!=
reg2
;
++
reg1
)
{
const
CaloAffectedRegionInfo
*
region
=
&
(
*
reg1
);
...
...
@@ -194,9 +85,11 @@ bool CaloAffectedTool::isAffected(const xAOD::IParticle *p, float deta, float dp
}
//-------------------------------------------------
bool
CaloAffectedTool
::
listAffected
(
const
xAOD
::
IParticle
*
p
,
std
::
vector
<
int
>&
layer_list
,
std
::
vector
<
int
>&
problem_list
,
float
deta
,
float
dphi
,
int
problemType
)
const
bool
CaloAffectedTool
::
listAffected
(
const
xAOD
::
IParticle
*
p
,
const
CaloAffectedRegionInfoVec
*
vAff
,
std
::
vector
<
int
>&
layer_list
,
std
::
vector
<
int
>&
problem_list
,
float
deta
,
float
dphi
,
int
problemType
)
const
{
if
(
!
vAff
)
return
false
;
bool
found
=
false
;
static
float
epsilon
=
1e-6
;
...
...
@@ -204,11 +97,9 @@ bool CaloAffectedTool::listAffected(const xAOD::IParticle*p, std::vector<int>& l
layer_list
.
clear
();
problem_list
.
clear
();
if
(
!
m_read
)
return
false
;
if
(
!
m_affectedRegions
)
return
false
;
std
::
vector
<
CaloAffectedRegionInfo
>::
const_iterator
reg1
=
m_affectedRegions
->
begin
();
std
::
vector
<
CaloAffectedRegionInfo
>::
const_iterator
reg2
=
m_affectedRegions
->
end
();
std
::
vector
<
CaloAffectedRegionInfo
>::
const_iterator
reg1
=
vAff
->
begin
();
std
::
vector
<
CaloAffectedRegionInfo
>::
const_iterator
reg2
=
vAff
->
end
();
for
(;
reg1
!=
reg2
;
++
reg1
)
{
const
CaloAffectedRegionInfo
*
region
=
&
(
*
reg1
);
...
...
LArCalorimeter/LArAffectedRegion/CMakeLists.txt
deleted
100644 → 0
View file @
f16706e6
################################################################################
# Package: LArAffectedRegion
################################################################################
# Declare the package name:
atlas_subdir
(
LArAffectedRegion
)
# Declare the package's dependencies:
atlas_depends_on_subdirs
(
PUBLIC
Calorimeter/CaloConditions
Calorimeter/CaloIdentifier
Control/AthenaBaseComps
Control/AthenaKernel
Control/StoreGate
Database/AthenaPOOL/AthenaPoolUtilities
GaudiKernel
LArCalorimeter/LArIdentifier
PRIVATE
Calorimeter/CaloDetDescr
Calorimeter/CaloGeoHelpers
Database/IOVDbMetaDataTools
Event/EventInfo
LArCalorimeter/LArElecCalib