ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
InDetEventAthenaPool
src
SCT_ClusterContainerCnv_p0.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
SCT_ClusterContainerCnv_p0.h
"
6
7
#include "
MsgUtil.h
"
8
9
// Athena
10
#include "
AthenaKernel/errorcheck.h
"
11
#include "
InDetIdentifier/SCT_ID.h
"
12
#include "
StoreGate/ReadCondHandle.h
"
13
#include "
StoreGate/StoreGateSvc.h
"
14
15
// Gaudi
16
#include "GaudiKernel/Bootstrap.h"
17
#include "GaudiKernel/ISvcLocator.h"
18
#include "GaudiKernel/Service.h"
19
20
#include <string>
21
22
//================================================================
23
24
25
SCT_ClusterContainerCnv_p0::SCT_ClusterContainerCnv_p0
():
26
m_sctId
{nullptr},
27
m_SCTDetEleCollKey
{
"SCT_DetectorElementCollection"
}
28
{
29
}
30
31
StatusCode
SCT_ClusterContainerCnv_p0::initialize
(MsgStream& log ) {
32
33
log << MSG::INFO <<
"SCT_ClusterContainerCnv::initialize()"
<<
endmsg
;
34
35
SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore"
)};
36
CHECK
( detStore.isValid() );
37
38
CHECK
( detStore->retrieve(
m_sctId
,
"SCT_ID"
) );
39
CHECK
(
m_SCTDetEleCollKey
.initialize() );
40
MSG_DEBUG
(log,
"Converter initialized."
);
41
42
return
StatusCode::SUCCESS;
43
}
44
45
InDet::SCT_ClusterContainer*
SCT_ClusterContainerCnv_p0::createTransient
(
SCT_ClusterContainer_p0
* persObj, MsgStream& log) {
46
47
auto
trans = std::make_unique<InDet::SCT_ClusterContainer>(
m_sctId
->wafer_hash_max());
48
// MSG_DEBUG(log,"Read PRD vector, size " << persObj->size());
49
50
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection>
sctDetEleHandle(
m_SCTDetEleCollKey
);
51
const
InDetDD::SiDetectorElementCollection
* elements(*sctDetEleHandle);
52
if
(not sctDetEleHandle.
isValid
() or elements==
nullptr
) {
53
log << MSG::FATAL <<
m_SCTDetEleCollKey
.fullKey() <<
" is not available."
<<
endmsg
;
54
return
trans.release();
55
}
56
57
for
(InDet::SCT_ClusterCollection* dcColl : *persObj) {
58
// Add detElem to each drift circle
59
IdentifierHash
collHash = dcColl->identifyHash();
60
const
InDetDD::SiDetectorElement
* de = elements->
getDetectorElement
(collHash);
61
62
InDet::SCT_ClusterCollection::iterator itColl = dcColl->begin();
63
InDet::SCT_ClusterCollection::iterator lastColl = dcColl->end();
64
for
(; itColl != lastColl; ++itColl) {
65
(*itColl)->m_detEl = de;
66
}
67
68
StatusCode
sc
= trans->addCollection(dcColl, collHash);
69
if
(
sc
.isSuccess()){
70
}
else
{
71
log << MSG::ERROR <<
"Failed to add SCT_ClusterContainer to container"
<<
endmsg
;
72
return
nullptr
;
73
}
74
}
75
return
trans.release();
76
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
MsgUtil.h
MSG_DEBUG
#define MSG_DEBUG(log, x)
Definition
MsgUtil.h:16
ReadCondHandle.h
SCT_ClusterContainerCnv_p0.h
SCT_ClusterContainer_p0
DataVector< Trk::PrepRawDataCollection< InDet::SCT_Cluster > > SCT_ClusterContainer_p0
Definition
SCT_ClusterContainerCnv_p0.h:14
SCT_ID.h
This is an Identifier helper class for the SCT subdetector.
StoreGateSvc.h
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
InDetDD::SiDetectorElementCollection
Class to hold the SiDetectorElement objects to be put in the detector store.
Definition
SiDetectorElementCollection.h:27
InDetDD::SiDetectorElementCollection::getDetectorElement
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Definition
SiDetectorElementCollection.cxx:9
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
SCT_ClusterContainerCnv_p0::SCT_ClusterContainerCnv_p0
SCT_ClusterContainerCnv_p0()
Definition
SCT_ClusterContainerCnv_p0.cxx:25
SCT_ClusterContainerCnv_p0::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition
SCT_ClusterContainerCnv_p0.h:42
SCT_ClusterContainerCnv_p0::m_sctId
const SCT_ID * m_sctId
Definition
SCT_ClusterContainerCnv_p0.h:41
SCT_ClusterContainerCnv_p0::createTransient
virtual InDet::SCT_ClusterContainer * createTransient(const SCT_ClusterContainer_p0 *, MsgStream &) override
Definition
SCT_ClusterContainerCnv_p0.h:34
SCT_ClusterContainerCnv_p0::initialize
StatusCode initialize(MsgStream &log)
Definition
SCT_ClusterContainerCnv_p0.cxx:31
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:205
Generated on
for ATLAS Offline Software by
1.17.0