87 {
89 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
90 MsgStream log(
msgSvc,
"GrXtMdcCalib");
91 log << MSG::DEBUG << "GrXtMdcCalib::fillHist()" << endreq;
92
94
95
96 bool esCutFg = event->getEsCutFlag();
97 if( ! esCutFg ) return -1;
98
99 int i;
100 int k;
101 int lay;
102 int iLR;
103 int iEntr;
104
105 double dr;
106 double dz;
107 double doca;
108 double tdr;
109 double resi;
110 double entrance;
111
112 int nhitlay;
114 bool fgTrk;
115
116 if(! m_fgIni){
120 }
121 m_fgIni = true;
122 }
123
126
127 int nhit;
128 int ntrk = event -> getNTrk();
129 for(i=0; i<ntrk; i++){
130 fgTrk = true;
131 rectrk = event->getRecTrk(i);
132 nhit = rectrk -> getNHits();
133
134
135 dr = rectrk->
getDr();
136 if(fabs(dr) > m_param.
drCut)
continue;
137
138
139 dz = rectrk->
getDz();
140 if(fabs(dz) > m_param.
dzCut)
continue;
141
143 fgHitLay[lay] = false;
144 }
145
146 for(k=0; k<nhit; k++){
147 rechit = rectrk -> getRecHit(k);
148 lay = rechit -> getLayid();
149 doca = rechit -> getDocaInc();
150 resi = rechit -> getResiInc();
151 fgHitLay[lay] = true;
152
153
154
155
156
157 }
158 if(! fgTrk) continue;
159
160 nhitlay = 0;
162 if(fgHitLay[lay]) nhitlay++;
163 }
165
166 for(k=0; k<nhit; k++){
167 rechit = rectrk -> getRecHit(k);
168 lay = rechit -> getLayid();
169 doca = rechit -> getDocaInc();
170 resi = rechit -> getResiInc();
171 iLR = rechit -> getLR();
172 entrance = rechit -> getEntra();
173 tdr = rechit -> getTdrift();
174
175 if( (fabs(doca) > m_docaMax[lay]) ||
176 (fabs(resi) > m_param.
resiCut[lay]) ){
177 continue;
178 }
179
180 if(0 == lay){
181 if( ! fgHitLay[1] ) continue;
182 } else if(42 == lay){
183 if( ! fgHitLay[41] ) continue;
184 } else{
185 if( (!fgHitLay[lay-1]) && (!fgHitLay[lay+1]) ) continue;
186 }
187
188 iEntr = m_mdcFunSvc -> getXtEntrIndex(entrance);
189
190 if(iLR < 2){
191 if(m_nhit[lay][iEntr][iLR] < m_maxNhit){
192 m_grxt[lay][iEntr][iLR] -> SetPoint(m_nhit[lay][iEntr][iLR],
193 tdr, fabs(doca));
194 m_nhit[lay][iEntr][iLR]++;
195 }
196 }
197
198 if(m_nhit[lay][iEntr][2] < m_maxNhit){
199 m_grxt[lay][iEntr][2] -> SetPoint(m_nhit[lay][iEntr][2],
200 tdr, fabs(doca));
201 m_nhit[lay][iEntr][2]++;
202 }
203 }
204 }
205 return 1;
206}
double resiCut[MdcCalNLayer]
virtual int fillHist(MdcCalEvent *event)=0