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
160 fgHitLay[lay] = false;
161 }
162
163 for(k=0; k<nhit; k++){
164 rechit = rectrk -> getRecHit(k);
165 lay = rechit -> getLayid();
166 doca = rechit -> getDocaInc();
167 resi = rechit -> getResiInc();
168 fgHitLay[lay] = true;
169
170
171
172
173
174 }
175 if(! fgTrk) continue;
176
177 nhitlay = 0;
179 if(fgHitLay[lay]) nhitlay++;
180 }
182
183 for(k=0; k<nhit; k++){
184 rechit = rectrk -> getRecHit(k);
185 lay = rechit -> getLayid();
186 doca = rechit -> getDocaInc();
187 resi = rechit -> getResiInc();
188 iLR = rechit -> getLR();
189 entrance = rechit -> getEntra();
190 tdr = rechit -> getTdrift();
191
192 if( (fabs(doca) > m_docaMax[lay]) ||
193 (fabs(resi) > m_param.
resiCut[lay]) ){
194 continue;
195 }
196
197 if(0 == lay){
198 if( ! fgHitLay[1] ) continue;
199 } else if(42 == lay){
200 if( ! fgHitLay[41] ) continue;
201 } else{
202 if( (!fgHitLay[lay-1]) && (!fgHitLay[lay+1]) ) continue;
203 }
204
205 iEntr = m_mdcFunSvc -> getXtEntrIndex(entrance);
206 int npoint = m_grXt[lay][iEntr][iLR]->GetN();
207 if(npoint < m_nMaxGrPoint) m_grXt[lay][iEntr][iLR]->SetPoint(npoint, tdr, fabs(doca));
208
209 if(tdr<m_tbinLim[lay][0]) continue;
210 else if(tdr<m_tbinLim[lay][1]) m_pfNear[lay][iEntr][iLR]->Fill(tdr, fabs(doca));
211 else if(tdr<m_tbinLim[lay][2]) m_pfMid[lay][iEntr][iLR]->Fill(tdr, fabs(doca));
212 else if(tdr<m_tbinLim[lay][3]) m_pfFar[lay][iEntr][iLR]->Fill(tdr, fabs(doca));
213 }
214 }
215 return 1;
216}
double resiCut[MdcCalNLayer]
virtual int fillHist(MdcCalEvent *event)=0