Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue 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
Peter Sherwood
athena
Commits
c4a78847
Commit
c4a78847
authored
4 years ago
by
scott snyder
Committed by
scott snyder
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
CaloTriggerTool: Use AthMessaging in LArTTCellMap.
Use AthMessaging in LArTTCellMap. In passing, fix cppcheck warnings.
parent
e122725b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Calorimeter/CaloTriggerTool/CaloTriggerTool/LArTTCellMap.h
+3
-4
3 additions, 4 deletions
Calorimeter/CaloTriggerTool/CaloTriggerTool/LArTTCellMap.h
Calorimeter/CaloTriggerTool/src/LArTTCellMap.cxx
+34
-57
34 additions, 57 deletions
Calorimeter/CaloTriggerTool/src/LArTTCellMap.cxx
with
37 additions
and
61 deletions
Calorimeter/CaloTriggerTool/CaloTriggerTool/LArTTCellMap.h
+
3
−
4
View file @
c4a78847
...
@@ -8,12 +8,12 @@
...
@@ -8,12 +8,12 @@
#include
"Identifier/Identifier.h"
#include
"Identifier/Identifier.h"
#include
"CaloTriggerTool/LArTTCell.h"
#include
"CaloTriggerTool/LArTTCell.h"
#include
"CaloTriggerTool/LArTTCell_P.h"
#include
"CaloTriggerTool/LArTTCell_P.h"
#include
"CaloIdentifier/LArID_Exception.h"
#include
"CaloIdentifier/LArID_Exception.h"
#include
"AthenaBaseComps/AthMessaging.h"
#include
<vector>
#include
<vector>
#include
<map>
#include
<map>
class
MsgStream
;
/**
/**
@brief This is a StoreGate object holding the offline TT-cell map
@brief This is a StoreGate object holding the offline TT-cell map
...
@@ -25,6 +25,7 @@ class MsgStream ;
...
@@ -25,6 +25,7 @@ class MsgStream ;
*/
*/
class
LArTTCellMap
class
LArTTCellMap
:
public
AthMessaging
{
{
public:
public:
...
@@ -70,8 +71,6 @@ private:
...
@@ -70,8 +71,6 @@ private:
// std::map<HWIdentifier,Identifier> m_on2offIdMap;
// std::map<HWIdentifier,Identifier> m_on2offIdMap;
LArTTCell_P
m_persData
;
LArTTCell_P
m_persData
;
MsgStream
*
m_msg
;
};
};
#include
"AthenaKernel/CLASS_DEF.h"
#include
"AthenaKernel/CLASS_DEF.h"
...
...
This diff is collapsed.
Click to expand it.
Calorimeter/CaloTriggerTool/src/LArTTCellMap.cxx
+
34
−
57
View file @
c4a78847
...
@@ -7,25 +7,17 @@
...
@@ -7,25 +7,17 @@
#include
"CaloIdentifier/LArEM_ID.h"
#include
"CaloIdentifier/LArEM_ID.h"
#include
"CaloIdentifier/LArHEC_ID.h"
#include
"CaloIdentifier/LArHEC_ID.h"
#include
"CaloIdentifier/LArFCAL_ID.h"
#include
"CaloIdentifier/LArFCAL_ID.h"
#include
"GaudiKernel/ISvcLocator.h"
#include
"AthenaKernel/getMessageSvc.h"
#include
"GaudiKernel/Bootstrap.h"
#include
"GaudiKernel/MsgStream.h"
#include
"GaudiKernel/MsgStream.h"
#include
"GaudiKernel/
IMessageSvc
.h"
#include
"GaudiKernel/
ServiceHandle
.h"
#include
"StoreGate/StoreGateSvc.h"
#include
"StoreGate/StoreGateSvc.h"
#include
<iostream>
#include
<iostream>
LArTTCellMap
::
LArTTCellMap
(
)
:
m_msg
(
nullptr
)
LArTTCellMap
::
LArTTCellMap
(
)
:
AthMessaging
(
Athena
::
getMessageSvc
(),
"LArTTCellMap"
)
{
{
IMessageSvc
*
msgSvc
;
StatusCode
status
=
Gaudi
::
svcLocator
()
->
service
(
"MessageSvc"
,
msgSvc
);
if
(
status
.
isFailure
()){
std
::
cout
<<
"Cannot locate MessageSvc"
<<
std
::
endl
;
}
m_msg
=
new
MsgStream
(
msgSvc
,
"LArTTCellMap"
);
msgSvc
->
release
()
;
}
}
...
@@ -40,35 +32,30 @@ void LArTTCellMap::set( const LArTTCell& m )
...
@@ -40,35 +32,30 @@ void LArTTCellMap::set( const LArTTCell& m )
convert_to_P
(
m
);
convert_to_P
(
m
);
if
(
m_msg
->
level
()
<=
MSG
::
DEBUG
)
{
ATH_MSG_DEBUG
(
" LArTTCell size = "
<<
m
.
size
()
);
(
*
m_msg
)
<<
MSG
::
DEBUG
<<
" LArTTCell size = "
<<
m
.
size
()
<<
endmsg
;
}
ServiceHandle
<
StoreGateSvc
>
detStore
(
"DetectorStore"
,
"LArTTCellMap"
);
StoreGateSvc
*
detStore
;
StatusCode
status
=
Gaudi
::
svcLocator
()
->
service
(
"DetectorStore"
,
detStore
);
if
(
status
.
isFailure
()){
(
*
m_msg
)
<<
MSG
::
ERROR
<<
"Cannot locate DetectorStore"
<<
endmsg
;
}
const
LArEM_ID
*
em_id
;
const
LArEM_ID
*
em_id
;
const
LArHEC_ID
*
hec_id
;
const
LArHEC_ID
*
hec_id
;
const
LArFCAL_ID
*
fcal_id
;
const
LArFCAL_ID
*
fcal_id
;
const
CaloLVL1_ID
*
lvl1_id
;
const
CaloLVL1_ID
*
lvl1_id
;
status
=
detStore
->
retrieve
(
em_id
);
StatusCode
status
=
detStore
->
retrieve
(
em_id
);
if
(
status
.
isFailure
()){
if
(
status
.
isFailure
()){
(
*
m_msg
)
<<
MSG
::
ERROR
<<
"Cannot retrieve em_id"
<<
endmsg
;
ATH_
MSG
_
ERROR
(
"Cannot retrieve em_id"
)
;
}
}
status
=
detStore
->
retrieve
(
hec_id
);
status
=
detStore
->
retrieve
(
hec_id
);
if
(
status
.
isFailure
()){
if
(
status
.
isFailure
()){
(
*
m_msg
)
<<
MSG
::
ERROR
<<
"Cannot retrieve hec_id"
<<
endmsg
;
ATH_
MSG
_
ERROR
(
"Cannot retrieve hec_id"
)
;
}
}
status
=
detStore
->
retrieve
(
fcal_id
);
status
=
detStore
->
retrieve
(
fcal_id
);
if
(
status
.
isFailure
()){
if
(
status
.
isFailure
()){
(
*
m_msg
)
<<
MSG
::
ERROR
<<
"Cannot retrieve fcal_id"
<<
endmsg
;
ATH_
MSG
_
ERROR
(
"Cannot retrieve fcal_id"
)
;
}
}
status
=
detStore
->
retrieve
(
lvl1_id
);
status
=
detStore
->
retrieve
(
lvl1_id
);
if
(
status
.
isFailure
()){
if
(
status
.
isFailure
()){
(
*
m_msg
)
<<
MSG
::
ERROR
<<
"Cannot retrieve lvl1_id"
<<
endmsg
;
ATH_
MSG
_
ERROR
(
"Cannot retrieve lvl1_id"
)
;
}
}
LArTTCell
::
const_iterator
it
=
m
.
begin
();
LArTTCell
::
const_iterator
it
=
m
.
begin
();
LArTTCell
::
const_iterator
it_e
=
m
.
end
();
LArTTCell
::
const_iterator
it_e
=
m
.
end
();
...
@@ -93,35 +80,29 @@ void LArTTCellMap::set( const LArTTCell& m )
...
@@ -93,35 +80,29 @@ void LArTTCellMap::set( const LArTTCell& m )
id
=
fcal_id
->
channel_id
(
t
.
pn
,
t
.
region
,
t
.
eta
,
t
.
phi
);
id
=
fcal_id
->
channel_id
(
t
.
pn
,
t
.
region
,
t
.
eta
,
t
.
phi
);
}
else
{
}
else
{
(
*
m_msg
)
<<
MSG
::
ERROR
<<
" Wrong input Detector Number "
<<
t
.
det
<<
endmsg
;
ATH_
MSG
_
ERROR
(
" Wrong input Detector Number "
<<
t
.
det
)
;
}
}
Identifier
sid
=
lvl1_id
->
layer_id
(
t
.
tpn
,
t
.
tsample
,
t
.
tregion
,
t
.
teta
,
t
.
tphi
,
t
.
layer
);
Identifier
sid
=
lvl1_id
->
layer_id
(
t
.
tpn
,
t
.
tsample
,
t
.
tregion
,
t
.
teta
,
t
.
tphi
,
t
.
layer
);
if
(
m_msg
->
level
()
<=
MSG
::
VERBOSE
)
{
ATH_MSG_VERBOSE
(
" db struct= "
(
*
m_msg
)
<<
MSG
::
VERBOSE
<<
" det="
<<
t
.
det
<<
" db struct= "
<<
" pn="
<<
t
.
pn
<<
" det="
<<
t
.
det
<<
" region="
<<
t
.
region
<<
" pn="
<<
t
.
pn
<<
" sample="
<<
t
.
sample
<<
" region="
<<
t
.
region
<<
" eta="
<<
t
.
eta
<<
" phi="
<<
t
.
phi
<<
" sample="
<<
t
.
sample
<<
" trig pn="
<<
t
.
tpn
<<
" eta="
<<
t
.
eta
<<
" phi="
<<
t
.
phi
<<
" trig region="
<<
t
.
tregion
<<
" trig pn="
<<
t
.
tpn
<<
" trig sample="
<<
t
.
tsample
<<
" trig region="
<<
t
.
tregion
<<
" trig eta="
<<
t
.
teta
<<
" trig phi="
<<
t
.
tphi
<<
" trig sample="
<<
t
.
tsample
<<
" layer="
<<
t
.
layer
);
<<
" trig eta="
<<
t
.
teta
<<
" trig phi="
<<
t
.
tphi
ATH_MSG_VERBOSE
(
" lvl1 id = "
<<
sid
<<
" offline id ="
<<
id
);
<<
" layer="
<<
t
.
layer
<<
endmsg
;
(
*
m_msg
)
<<
MSG
::
VERBOSE
<<
" lvl1 id = "
<<
sid
<<
" offline id ="
<<
id
<<
endmsg
;
}
if
(
!
(
cellIdSet
.
insert
(
id
)).
second
)
{
if
(
!
(
cellIdSet
.
insert
(
id
)).
second
)
{
(
*
m_msg
)
<<
MSG
::
ERROR
<<
" Duplicate cell id "
ATH_MSG_ERROR
(
" Duplicate cell id "
<<
lvl1_id
->
show_to_string
(
id
)
<<
lvl1_id
->
show_to_string
(
id
)
<<
" in TT= "
<<
" in TT= "
<<
lvl1_id
->
show_to_string
(
sid
)
<<
lvl1_id
->
show_to_string
(
sid
)
);
<<
endmsg
;
}
}
m_cell2ttIdMap
[
id
]
=
sid
;
m_cell2ttIdMap
[
id
]
=
sid
;
...
@@ -167,13 +148,11 @@ void LArTTCellMap::set( const LArTTCell& m )
...
@@ -167,13 +148,11 @@ void LArTTCellMap::set( const LArTTCell& m )
catch
(
LArID_Exception
&
except
)
{
catch
(
LArID_Exception
&
except
)
{
(
*
m_msg
)
<<
MSG
::
ERROR
<<
" Failed in LArTTCellMap::set "
<<
endmsg
;
ATH_
MSG
_
ERROR
(
" Failed in LArTTCellMap::set "
)
;
(
*
m_msg
)
<<
MSG
::
ERROR
<<
(
std
::
string
)
except
<<
endmsg
;
ATH_
MSG
_
ERROR
(
(
std
::
string
)
except
)
;
}
}
if
(
m_msg
->
level
()
<=
MSG
::
DEBUG
)
{
ATH_MSG_DEBUG
(
" LArTTCellMap::set : number of cell Ids="
<<
m_cell2ttIdMap
.
size
()
);
(
*
m_msg
)
<<
MSG
::
DEBUG
<<
" LArTTCellMap::set : number of cell Ids="
<<
m_cell2ttIdMap
.
size
()
<<
std
::
endl
;
}
detStore
->
release
()
;
detStore
->
release
()
;
...
@@ -190,7 +169,7 @@ Identifier LArTTCellMap::whichTTID(const Identifier& id) const
...
@@ -190,7 +169,7 @@ Identifier LArTTCellMap::whichTTID(const Identifier& id) const
return
(
*
it
).
second
;
return
(
*
it
).
second
;
}
}
(
*
m_msg
)
<<
MSG
::
ERROR
<<
" Offline TT ID not found for cell "
<<
id
<<
endmsg
;
ATH_
MSG
_
ERROR
(
" Offline TT ID not found for cell "
<<
id
)
;
return
Identifier
();
return
Identifier
();
...
@@ -211,9 +190,7 @@ LArTTCellMap::createCellIDvec(const Identifier & sid) const
...
@@ -211,9 +190,7 @@ LArTTCellMap::createCellIDvec(const Identifier & sid) const
return
(
*
it
).
second
;
return
(
*
it
).
second
;
}
}
if
(
m_msg
->
level
()
<=
MSG
::
VERBOSE
)
{
ATH_MSG_VERBOSE
(
" vector of offline cell ID not found, TT id = "
<<
sid
.
get_compact
()
);
(
*
m_msg
)
<<
MSG
::
VERBOSE
<<
" vector of offline cell ID not found, TT id = "
<<
sid
.
get_compact
()
<<
endmsg
;
}
static
const
std
::
vector
<
Identifier
>
v
;
static
const
std
::
vector
<
Identifier
>
v
;
return
v
;
return
v
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment