115 {
117 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc);
118 MsgStream log(
msgSvc,
"MdcCalEvent");
119 log << MSG::INFO << "MdcCalEvent::setKalEvent" << endreq;
120
121 IDataProviderSvc* eventSvc = NULL;
122 Gaudi::svcLocator()->service("EventDataSvc", eventSvc);
123
124
125 SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc,"/Event/Digi/MdcDigiCol");
126 if (!mdcDigiCol) {
127 log << MSG::FATAL << "Could not find event" << endreq;
128 }
129
130 MdcDigiCol::iterator
iter = mdcDigiCol->begin();
131 m_nhitTQ = 0;
132 for(;
iter != mdcDigiCol->end();
iter++) {
134 unsigned fgOverFlow = (aDigi) -> getOverflow();
135 if ( ((fgOverFlow & 3) !=0 ) || ((fgOverFlow & 12) != 0) ||
138 m_nhitTQ++;
139 }
140
141
142 SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc,"/Event/Recon/RecEsTimeCol");
143 if( (!aevtimeCol) || (aevtimeCol->size()==0) ){
144 m_tes = -9999.0;
145 m_esFlag = -1;
146 }else{
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();
151 }
152 }
153 m_esCutFg = false;
154 m_nEsCutFg = -1;
155 bool flagTes = false;
156 for(
int iEs=0; iEs<m_param.
nEsFlag; iEs++){
157 if(m_esFlag == m_param.
esFlag[iEs]){
158 flagTes = true;
159 m_nEsCutFg = iEs;
160 break;
161 }
162 }
163 if( flagTes && (m_tes > m_param.
tesMin) && (m_tes < m_param.
tesMax) ) m_esCutFg =
true;
164
165 SmartDataPtr<RecMdcKalTrackCol> kaltrkCol(eventSvc,"/Event/Recon/RecMdcKalTrackCol");
166 if (!kaltrkCol) {
167 log << MSG::FATAL << "Could not find RecMdcKalTrackCol" << endreq;
168 return StatusCode::FAILURE;
169 }
170
171 int i = 0;
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);
180
181 i++;
182 }
183 log << MSG::INFO << "KalTrack ntrk = " << i << endreq;
184
185 return StatusCode::SUCCESS;
186}
void setGeomSvc(IMdcGeomSvc *mdcGeomSvc)
void setUtilSvc(IMdcUtilitySvc *mdcUtilitySvc)
unsigned int getChargeChannel() const
unsigned int getTimeChannel() const