104 {
106 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
107 MsgStream log(
msgSvc,
"XtInteMdcCalib");
108 log << MSG::DEBUG << "XtInteMdcCalib::fillHist()" << endreq;
109
111
112
113 bool esCutFg = event->getEsCutFlag();
114 if( ! esCutFg ) return -1;
115
116 int i;
117 int k;
118 int lay;
119 int iLR;
120 int iEntr;
121
122 double dr;
123 double dz;
124 double doca;
125 double tdr;
126 double resi;
127 double entrance;
128
129 int nhitlay;
131 bool fgTrk;
132
133 if(! m_fgIni){
137 }
138 m_fgIni = true;
139 }
140
143
144 int nhit;
145 int ntrk = event -> getNTrk();
146 for(i=0; i<ntrk; i++){
147 fgTrk = true;
148 rectrk = event->getRecTrk(i);
149 nhit = rectrk -> getNHits();
150
151
152 dr = rectrk->
getDr();
153 if(fabs(dr) > m_param.
drCut)
continue;
154
155
156 dz = rectrk->
getDz();
157 if(fabs(dz) > m_param.
dzCut)
continue;
158
159
160 double p = rectrk -> getP();
161 if((fabs(p) < m_param.
pCut[0]) || (fabs(p) > m_param.
pCut[1]))
continue;
162
163
164 double phi0 = rectrk -> getPhi0();
165 double phiTrk = phi0 + CLHEP::halfpi;
166 if(phiTrk > CLHEP::twopi) phiTrk -= CLHEP::twopi;
167 if(m_param.
cosmicDwTrk && (phiTrk<CLHEP::pi))
continue;
168
169
171 fgHitLay[lay] = false;
172 }
173
174 for(k=0; k<nhit; k++){
175 rechit = rectrk -> getRecHit(k);
176 lay = rechit -> getLayid();
177 doca = rechit -> getDocaInc();
178 resi = rechit -> getResiInc();
179 fgHitLay[lay] = true;
180
181
182
183
184
185 }
186 if(! fgTrk) continue;
187
188 nhitlay = 0;
190 if(fgHitLay[lay]) nhitlay++;
191 }
193
194 for(k=0; k<nhit; k++){
195 rechit = rectrk -> getRecHit(k);
196 lay = rechit -> getLayid();
197 doca = rechit -> getDocaInc();
198 resi = rechit -> getResiInc();
199 iLR = rechit -> getLR();
200 entrance = rechit -> getEntra();
201 tdr = rechit -> getTdrift();
202
203 if( (fabs(doca) > m_docaMax[lay]) ||
204 (fabs(resi) > m_param.
resiCut[lay]) ){
205 continue;
206 }
207
208 if(0 == lay){
209 if( ! fgHitLay[1] ) continue;
210 } else if(42 == lay){
211 if( ! fgHitLay[41] ) continue;
212 } else{
213 if( (!fgHitLay[lay-1]) && (!fgHitLay[lay+1]) ) continue;
214 }
215
216 int nPM = 1;
218 for(int iPM=0; iPM<nPM; iPM++){
219 if(0==iPM) iEntr = m_mdcFunSvc -> getXtEntrIndex(entrance);
220 else iEntr = m_mdcFunSvc -> getXtEntrIndex(-1.0*entrance);
221
222 int npoint = m_grXt[lay][iEntr][iLR]->GetN();
223 if(npoint < m_nMaxGrPoint) m_grXt[lay][iEntr][iLR]->SetPoint(npoint, tdr, fabs(doca));
224
225 if(tdr<m_tbinLim[lay][0]) continue;
226 else if(tdr<m_tbinLim[lay][1]) m_pfNear[lay][iEntr][iLR]->Fill(tdr, fabs(doca));
227 else if(tdr<m_tbinLim[lay][2]) m_pfMid[lay][iEntr][iLR]->Fill(tdr, fabs(doca));
228 else if(tdr<m_tbinLim[lay][3]) m_pfFar[lay][iEntr][iLR]->Fill(tdr, fabs(doca));
229 }
230 }
231 }
232 return 1;
233}
double resiCut[MdcCalNLayer]
virtual int fillHist(MdcCalEvent *event)=0