3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/AlgFactory.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "GaudiKernel/SmartDataPtr.h"
7#include "GaudiKernel/IDataProviderSvc.h"
8#include "GaudiKernel/PropertyMgr.h"
37 Algorithm(name, pSvcLocator)
44 MsgStream log(
msgSvc(), name());
45 log << MSG::INFO <<
"in initialize()" << endreq;
47 return StatusCode::SUCCESS;
53 MsgStream log(
msgSvc(), name());
54 log << MSG::INFO <<
"in execute()" << endreq;
58 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
60 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
61 return( StatusCode::FAILURE);
64 int eventId = eventHeader->eventNumber() ;
65 int runId = eventHeader->runNumber();
66 log << MSG::INFO <<
"event: " << eventId
67 <<
" run: " <<runId << endreq;
69 StatusCode sc = StatusCode::SUCCESS ;
73 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(),
"/Event/Recon/RecMdcTrackCol");
76 log << MSG::INFO <<
"Could not find RecMdcTrackCol" << endreq;
77 SmartDataPtr<DstMdcTrackCol> dstMdcTrackCol(eventSvc(),
"/Event/Dst/DstMdcTrackCol");
78 if (!dstMdcTrackCol) {
79 log << MSG::INFO <<
"Could not find DstMdcTrackCol" << endreq;
83 DstMdcTrackCol::iterator iter_mdc = dstMdcTrackCol->begin();
85 for (;iter_mdc != dstMdcTrackCol->end(); iter_mdc++, trackID++) {
87 *recMdcTrack = **iter_mdc;
88 (*recMdcTrackCol).push_back(recMdcTrack);
90 <<
" Mdc Track ID = " << trackID
91 <<
" Mdc Track Nster = " << (*iter_mdc)->
nster()
99 SmartDataPtr<RecMdcKalTrackCol> recMdcKalTrackCol(eventSvc(),
"/Event/Recon/RecMdcKalTrackCol");
100 if (!recMdcKalTrackCol) {
101 log << MSG::INFO <<
"Could not find RecMdcKalTrackCol" << endreq;
102 SmartDataPtr<DstMdcKalTrackCol> dstMdcKalTrackCol(eventSvc(),
"/Event/Dst/DstMdcKalTrackCol");
103 if(!dstMdcKalTrackCol) {
104 log << MSG::INFO <<
"Could not find DstMdcKalTrackCol" << endreq;
108 DstMdcKalTrackCol::iterator iter_mdc = dstMdcKalTrackCol->begin();
110 for (;iter_mdc != dstMdcKalTrackCol->end(); iter_mdc++, trackID++) {
112 *recMdcKalTrack = **iter_mdc;
113 (*recMdcKalTrackCol).push_back(recMdcKalTrack);
115 <<
" MdcKalTrack ID = " << trackID
116 <<
" MdcKalTrack Nster = " << (*iter_mdc)->
nster()
117 <<
" MdcKalTrack poca = " << (*iter_mdc)->poca()
125 SmartDataPtr<RecMdcDedxCol> recMdcDedxCol(eventSvc(),
"/Event/Recon/RecMdcDedxCol");
126 if (!recMdcDedxCol) {
127 log <<MSG::INFO <<
"Could not find RecMdcDedxCol" << endreq;
128 SmartDataPtr<DstMdcDedxCol> dstMdcDedxCol(eventSvc(),
"/Event/Dst/DstMdcDedxCol");
130 log <<MSG::INFO <<
"Could not find DstMdcDedxCol" << endreq;
134 DstMdcDedxCol::iterator iter_mdc = dstMdcDedxCol->begin();
136 for (;iter_mdc != dstMdcDedxCol->end(); iter_mdc++, trackID++) {
138 *recMdcDedx= **iter_mdc;
139 (*recMdcDedxCol).push_back(recMdcDedx);
141 <<
" MdcDedx ID = " << trackID
150 SmartDataPtr<RecExtTrackCol> recExtTrackCol(eventSvc(),
"/Event/Recon/RecExtTrackCol");
151 if (!recExtTrackCol) {
152 log <<MSG::INFO <<
"Could not find RecExtTrackCol" << endreq;
153 SmartDataPtr<DstExtTrackCol> dstExtTrackCol(eventSvc(),
"/Event/Dst/DstExtTrackCol");
154 if(!dstExtTrackCol) {
155 log <<MSG::INFO <<
"Could not find DstExtTrackCol" << endreq;
159 DstExtTrackCol::iterator iter_ext = dstExtTrackCol->begin();
161 for (;iter_ext != dstExtTrackCol->end(); iter_ext++, trackID++) {
163 *recExtTrack = **iter_ext;
164 (*recExtTrackCol).push_back(recExtTrack);
166 <<
" ExtTrack ID = " << trackID
174 SmartDataPtr<RecTofTrackCol> tofTrackCol(eventSvc(),
"/Event/Recon/RecTofTrackCol");
175 if ( !tofTrackCol ) {
176 log << MSG::INFO <<
"Could not find TofTrackCol" << endreq;
177 SmartDataPtr<DstTofTrackCol> dstTofTrackCol(eventSvc(),
"/Event/Dst/DstTofTrackCol");
178 if(!dstTofTrackCol) {
179 log << MSG::INFO <<
"Could not find DstTofTrackCol" << endreq;
183 DstTofTrackCol::iterator iter_tof = dstTofTrackCol->begin();
184 for (;iter_tof != dstTofTrackCol->end(); iter_tof++) {
186 *recTofTrack = **iter_tof;
187 (*recTofTrackCol).push_back(recTofTrack);
189 <<
"Tof Track ID = " << (*iter_tof)->
tofTrackID()
190 <<
" Track ID = " << (*iter_tof)->trackID()
191 <<
" Tof Counter ID = "<<(*iter_tof)->tofID()
192 <<
" Quality = "<< (*iter_tof)->quality()
201 SmartDataPtr<RecEmcShowerCol> recEmcShowerCol(eventSvc(),
"/Event/Recon/RecEmcShowerCol");
202 if (!recEmcShowerCol) {
203 log << MSG::INFO <<
"Could not find RecEmcShowerCol" << endreq;
204 SmartDataPtr<DstEmcShowerCol> dstEmcShowerCol(eventSvc(),
"/Event/Dst/DstEmcShowerCol");
205 if(!dstEmcShowerCol) {
206 log << MSG::INFO <<
"Could not find DstEmcShowerCol" << endreq;
210 DstEmcShowerCol::iterator iter_emc = dstEmcShowerCol->begin();
212 for (;iter_emc != dstEmcShowerCol->end(); iter_emc++, trackID++) {
214 *recEmcShower = **iter_emc;
215 (*recEmcShowerCol).push_back(recEmcShower);
217 <<
" EmcShower ID = " << trackID
218 <<
" EmcShower energy = " << (*iter_emc)->
energy()
226 SmartDataPtr<RecMucTrackCol> recMucTrackCol(eventSvc(),
"/Event/Recon/RecMucTrackCol");
227 if (!recMucTrackCol) {
228 log <<MSG::INFO <<
"Could not find RecMucTrackCol" << endreq;
229 SmartDataPtr<DstMucTrackCol> dstMucTrackCol(eventSvc(),
"/Event/Dst/DstMucTrackCol");
230 if(!dstMucTrackCol) {
231 log <<MSG::INFO <<
"Could not find DstMucTrackCol" << endreq;
235 DstMucTrackCol::iterator iter_muc = dstMucTrackCol->begin();
237 for (;iter_muc != dstMucTrackCol->end(); iter_muc++, trackID++) {
239 *recMucTrack = **iter_muc;
240 (*recMucTrackCol).push_back(recMucTrack);
242 <<
" MucTrack ID = "<< trackID
254 MsgStream log(
msgSvc(), name());
255 log << MSG::INFO <<
"in finalize()" << endreq;
257 return StatusCode::SUCCESS;
ObjectVector< RecEmcShower > RecEmcShowerCol
ObjectVector< RecExtTrack > RecExtTrackCol
ObjectVector< RecMdcDedx > RecMdcDedxCol
ObjectVector< RecMdcKalTrack > RecMdcKalTrackCol
ObjectVector< RecMdcTrack > RecMdcTrackCol
ObjectVector< RecMucTrack > RecMucTrackCol
ObjectVector< RecTofTrack > RecTofTrackCol
RecMakerAlg(const std::string &name, ISvcLocator *pSvcLocator)
_EXTERN_ std::string RecExtTrackCol
_EXTERN_ std::string RecMdcDedxCol
_EXTERN_ std::string RecTofTrackCol
_EXTERN_ std::string RecMdcTrackCol
_EXTERN_ std::string RecMdcKalTrackCol
_EXTERN_ std::string RecMucTrackCol
_EXTERN_ std::string RecEmcShowerCol