3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/IMessageSvc.h"
5#include "GaudiKernel/StatusCode.h"
6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/Bootstrap.h"
8#include "GaudiKernel/SmartDataPtr.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/PropertyMgr.h"
44 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc);
45 MsgStream log(
msgSvc,
"MdcCalEvent");
46 log << MSG::INFO <<
"MdcCalEvent::setRecEvent" << endreq;
48 IDataProviderSvc* eventSvc =
NULL;
49 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
52 SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc,
"/Event/Digi/MdcDigiCol");
54 log << MSG::FATAL <<
"Could not find event" << endreq;
57 MdcDigiCol::iterator
iter = mdcDigiCol->begin();
59 for(;
iter != mdcDigiCol->end();
iter++) {
61 unsigned fgOverFlow = (aDigi) -> getOverflow();
62 if ( ((fgOverFlow & 3) !=0 ) || ((fgOverFlow & 12) != 0) ||
69 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc,
"/Event/Recon/RecEsTimeCol");
70 if( (!aevtimeCol) || (aevtimeCol->size()==0) ){
74 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
75 for(; iter_evt!=aevtimeCol->end(); iter_evt++){
76 m_tes = (*iter_evt)->getTest();
77 m_esFlag = (*iter_evt)->getStat();
83 for(
int iEs=0; iEs<m_param.
nEsFlag; iEs++){
84 if(m_esFlag == m_param.
esFlag[iEs]){
90 if( flagTes && (m_tes > m_param.
tesMin) && (m_tes < m_param.
tesMax) ) m_esCutFg =
true;
92 SmartDataPtr<RecMdcTrackCol> newtrkCol(eventSvc,
"/Event/Recon/RecMdcTrackCol");
94 log << MSG::ERROR <<
"Could not find RecMdcTrackCol" << endreq;
95 return ( StatusCode::FAILURE );
100 RecMdcTrackCol::iterator it_trk = newtrkCol->begin();
101 for(; it_trk != newtrkCol->end(); it_trk++){
105 rectrk -> setRecTrk(it_trk);
106 m_rectrk.push_back(rectrk);
112 return StatusCode::SUCCESS;
117 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc);
118 MsgStream log(
msgSvc,
"MdcCalEvent");
119 log << MSG::INFO <<
"MdcCalEvent::setKalEvent" << endreq;
121 IDataProviderSvc* eventSvc =
NULL;
122 Gaudi::svcLocator()->service(
"EventDataSvc", eventSvc);
125 SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc,
"/Event/Digi/MdcDigiCol");
127 log << MSG::FATAL <<
"Could not find event" << endreq;
130 MdcDigiCol::iterator
iter = mdcDigiCol->begin();
132 for(;
iter != mdcDigiCol->end();
iter++) {
134 unsigned fgOverFlow = (aDigi) -> getOverflow();
135 if ( ((fgOverFlow & 3) !=0 ) || ((fgOverFlow & 12) != 0) ||
142 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc,
"/Event/Recon/RecEsTimeCol");
143 if( (!aevtimeCol) || (aevtimeCol->size()==0) ){
147 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
148 for(; iter_evt!=aevtimeCol->end(); iter_evt++){
149 m_tes = (*iter_evt)->getTest();
150 m_esFlag = (*iter_evt)->getStat();
155 bool flagTes =
false;
156 for(
int iEs=0; iEs<m_param.
nEsFlag; iEs++){
157 if(m_esFlag == m_param.
esFlag[iEs]){
163 if( flagTes && (m_tes > m_param.
tesMin) && (m_tes < m_param.
tesMax) ) m_esCutFg =
true;
165 SmartDataPtr<RecMdcKalTrackCol> kaltrkCol(eventSvc,
"/Event/Recon/RecMdcKalTrackCol");
167 log << MSG::FATAL <<
"Could not find RecMdcKalTrackCol" << endreq;
168 return StatusCode::FAILURE;
173 RecMdcKalTrackCol::iterator iter_trk = kaltrkCol->begin();
174 for(; iter_trk != kaltrkCol->end(); iter_trk++) {
178 rectrk -> setKalTrk(iter_trk);
179 m_rectrk.push_back(rectrk);
183 log << MSG::INFO <<
"KalTrack ntrk = " << i << endreq;
185 return StatusCode::SUCCESS;
190 for(i=0; i<m_rectrk.size(); i++){
void setGeomSvc(IMdcGeomSvc *mdcGeomSvc)
void setUtilSvc(IMdcUtilitySvc *mdcUtilitySvc)
unsigned int getChargeChannel() const
unsigned int getTimeChannel() const