14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/Bootstrap.h"
16 #include "GaudiKernel/StatusCode.h"
17 #include "GaudiKernel/Service.h"
18 #include "GaudiKernel/MsgStream.h"
25 m_storeGate(
"StoreGateSvc",
"PixelGangedClusterAmbiguitiesCnv_p1"),
36 if (this->
initialize(log) != StatusCode::SUCCESS) {
41 if (transObj->empty()) {
42 if (
log.level() <=
MSG::DEBUG)
log <<
MSG::DEBUG <<
"No ganged pixels in this event. PixelAmbiMap has size 0. This happens often on single particle files." <<
endmsg;
45 InDet::PixelGangedClusterAmbiguities::const_iterator itr = transObj->begin();
46 InDet::PixelGangedClusterAmbiguities::const_iterator itrE = transObj->end();
47 InDet::PixelGangedClusterAmbiguities::const_iterator previous_itr = transObj->begin();
52 log << MSG::WARNING <<
"No containers found!"<<
endmsg;
66 for ( ;
dh!=dhEnd; ++
dh ) {
67 const auto *coll =
dh->indexFindPtr(idHash);
80 log << MSG::ERROR<<
"Could not find matching PRD container for this PixelCluster! Dumping PRD: "<<*
pixelCluster<<
endmsg;
83 std::vector<unsigned int> uintvector;
86 for( ; itr != itrE ; ++itr ) {
89 keyPixelCluster = itr->first;
91 gangedPixelCluster = itr->second;
94 else if (keyPixelCluster != keyPreviousPixelCluster)
112 if (this->
initialize(log) != StatusCode::SUCCESS) {
113 log <<
MSG::FATAL <<
"Could not initialize PixelGangedClusterAmbiguitiesCnv_p1 " <<
endmsg;
119 if (
log.level() <=
MSG::DEBUG)
log <<
MSG::DEBUG <<
"Name of the pixel cluster container is empty. Most likely cause: input is a single particle file and there were no pixel ambiguities." <<
endmsg;
124 log <<
MSG::FATAL <<
"PixelGangedClusterAmbiguitiesCnv_p1: Cannot retrieve "
133 for (
uint32_t elt : mapElement.second)
137 for (InDet::PixelClusterContainer::const_iterator contItr = pCC->begin();
138 contItr != pCC->end(); ++contItr)
141 if (coll->identifyHash() == keyIdentContIndex.
collHash())
143 keyPixelCluster = coll->at(keyIdentContIndex.
objIndex());
144 gangedPixelCluster = coll->at(gangedIdentContIndex.
objIndex());
145 transObj->insert(std::pair<const InDet::PixelCluster*, const InDet::PixelCluster*>(keyPixelCluster,gangedPixelCluster));
164 return StatusCode::SUCCESS;