54 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc );
55 MsgStream log(
msgSvc,
"EmcRecTDS" );
56 log << MSG::INFO <<
"EmcRecTDS::RegisterHit()" << endmsg;
58 IDataProviderSvc* eventSvc;
59 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc );
62 RecEmcHitMap::iterator iHitMap;
63 for ( iHitMap = aHitMap.begin(); iHitMap != aHitMap.end(); iHitMap++ )
64 { aRecEmcHitCol->add(
new RecEmcHit( iHitMap->second ) ); }
68 DataObject* aRecEmcHitEvent;
69 eventSvc->findObject(
"/Event/Recon/RecEmcHitCol", aRecEmcHitEvent );
70 if ( aRecEmcHitEvent != NULL )
73 sc = eventSvc->unregisterObject(
"/Event/Recon/RecEmcHitCol" );
74 delete aRecEmcHitEvent;
75 if ( sc != StatusCode::SUCCESS )
77 log << MSG::FATAL <<
"Could not unregister EMC shower collection" << endmsg;
78 return ( StatusCode::FAILURE );
82 sc = eventSvc->registerObject(
"/Event/Recon/RecEmcHitCol", aRecEmcHitCol );
83 if ( sc != StatusCode::SUCCESS )
85 log << MSG::FATAL <<
"Could not register EMC hit collection" << endmsg;
86 return ( StatusCode::FAILURE );
89 return StatusCode::SUCCESS;
96 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc );
97 MsgStream log(
msgSvc,
"EmcRecTDS" );
98 log << MSG::INFO <<
"EmcRecTDS::RegisterCluster()" << endmsg;
100 IDataProviderSvc* eventSvc;
101 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc );
104 RecEmcClusterMap::iterator iClusterMap;
105 for ( iClusterMap = aClusterMap.begin(); iClusterMap != aClusterMap.end(); iClusterMap++ )
106 { aRecEmcClusterCol->add(
new RecEmcCluster( iClusterMap->second ) ); }
110 DataObject* aRecEmcClusterEvent;
111 eventSvc->findObject(
"/Event/Recon/RecEmcClusterCol", aRecEmcClusterEvent );
112 if ( aRecEmcClusterEvent != NULL )
115 sc = eventSvc->unregisterObject(
"/Event/Recon/RecEmcClusterCol" );
116 delete aRecEmcClusterEvent;
117 if ( sc != StatusCode::SUCCESS )
119 log << MSG::FATAL <<
"Could not unregister EMC cluster collection" << endmsg;
120 return ( StatusCode::FAILURE );
124 sc = eventSvc->registerObject(
"/Event/Recon/RecEmcClusterCol", aRecEmcClusterCol );
125 if ( sc != StatusCode::SUCCESS )
127 log << MSG::FATAL <<
"Could not register EMC cluster collection" << endmsg;
128 return ( StatusCode::FAILURE );
131 return StatusCode::SUCCESS;
138 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc );
139 MsgStream log(
msgSvc,
"EmcRecTDS" );
140 log << MSG::INFO <<
"EmcRecTDS::RegisterShower()" << endmsg;
142 IDataProviderSvc* eventSvc;
143 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc );
145 SmartDataPtr<RecEmcClusterCol> aClusterCol( eventSvc,
"/Event/Recon/RecEmcClusterCol" );
146 if ( !aClusterCol ) { log << MSG::INFO <<
"Could not find emcRecClusterCol" << endmsg; }
152 RecEmcShowerMap::iterator iShowerMap;
153 for ( iShowerMap = aShowerMap.begin(); iShowerMap != aShowerMap.end(); iShowerMap++ )
158 RecEmcID clusterId( iShowerMap->second.getClusterId() );
159 RecEmcClusterCol::iterator iClusterCol;
160 for ( iClusterCol = aClusterCol->begin(); iClusterCol != aClusterCol->end();
163 if ( clusterId == ( *iClusterCol )->getClusterId() )
165 iShowerMap->second.Cluster( *iClusterCol );
171 aShowerVec.push_back( iShowerMap->second );
173 sort( aShowerVec.begin(), aShowerVec.end(), greater<RecEmcShower>() );
174 RecEmcShowerVec::iterator iShowerVec;
175 for ( iShowerVec = aShowerVec.begin(); iShowerVec != aShowerVec.end(); iShowerVec++ )
176 { aRecEmcShowerCol->add(
new RecEmcShower( *iShowerVec ) ); }
180 DataObject* aRecEmcShowerEvent;
181 eventSvc->findObject(
"/Event/Recon/RecEmcShowerCol", aRecEmcShowerEvent );
182 if ( aRecEmcShowerEvent != NULL )
185 StatusCode sc = eventSvc->unregisterObject(
"/Event/Recon/RecEmcShowerCol" );
186 delete aRecEmcShowerEvent;
187 if ( sc != StatusCode::SUCCESS )
189 log << MSG::FATAL <<
"Could not unregister EMC shower collection" << endmsg;
190 return ( StatusCode::FAILURE );
194 sc = eventSvc->registerObject(
"/Event/Recon/RecEmcShowerCol", aRecEmcShowerCol );
195 if ( sc != StatusCode::SUCCESS )
197 log << MSG::FATAL <<
"Could not register EMC shower collection" << endmsg;
198 return ( StatusCode::FAILURE );
201 return StatusCode::SUCCESS;
206 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc );
207 MsgStream log(
msgSvc,
"EmcRecTDS" );
208 log << MSG::INFO <<
"EmcRecTDS::CheckRegister()" << endmsg;
210 IDataProviderSvc* eventSvc;
211 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc );
214 SmartDataPtr<RecEmcHitCol> aHitCol( eventSvc,
"/Event/Recon/RecEmcHitCol" );
217 log << MSG::FATAL <<
"Could not find emcRecHitCol" << endmsg;
218 return ( StatusCode::FAILURE );
221 RecEmcHitCol::iterator iHitCol;
222 for ( iHitCol = aHitCol->begin(); iHitCol != aHitCol->end(); iHitCol++ )
228 SmartDataPtr<RecEmcClusterCol> aClusterCol( eventSvc,
"/Event/Recon/RecEmcClusterCol" );
231 log << MSG::FATAL <<
"Could not find emcRecClusterCol" << endmsg;
232 return ( StatusCode::FAILURE );
235 RecEmcClusterCol::iterator iClusterCol;
236 for ( iClusterCol = aClusterCol->begin(); iClusterCol != aClusterCol->end(); iClusterCol++ )
242 SmartDataPtr<RecEmcShowerCol> aShowerCol( eventSvc,
"/Event/Recon/RecEmcShowerCol" );
245 log << MSG::FATAL <<
"Could not find emcRecShowerCol" << endmsg;
246 return ( StatusCode::FAILURE );
249 RecEmcShowerCol::iterator iShowerCol;
250 for ( iShowerCol = aShowerCol->begin(); iShowerCol != aShowerCol->end(); iShowerCol++ )
255 return StatusCode::SUCCESS;