169 {
170
171 MsgStream log(
msgSvc(), name());
172
173
174
175 ISvcLocator* svcLocator = Gaudi::svcLocator();
176 StatusCode sc=svcLocator->service("EventDataSvc", m_evtSvc);
177 if (sc.isFailure())
178 cout<<"Could not accesss EventDataSvc!"<<endl;
179
180
181 SmartDataPtr<RecCgemClusterCol> aClusterCol(m_evtSvc,"/Event/Recon/RecCgemClusterCol");
182 if(!aClusterCol)
183 cout<<"Could not retrieve CGEM cluster collection"<<endl;
184
185 int nclu = aClusterCol->size();
186
188 std::cout << "nclu " << nclu << std::endl;
190 }
191
193
194 int nclusterx = 0;
195 int nclusterv = 0;
196 int nclusterxv = 0;
197
199 anode_radius_L1_x = anode->
getRX();
200 anode_radius_L1_v = anode->
getRV();
203 anode_radius_L2_x = anode->
getRX();
204 anode_radius_L2_v = anode->
getRV();
206
207
208 int tmp_cluster_L1_S1 = -1;
209 int tmp_cluster_L2_S1 = -1;
210 int tmp_cluster_L2_S2 = -1;
211 double tmp_charge_L1_S1 = 0.;
212 double tmp_charge_L2_S1 = 0.;
213 double tmp_charge_L2_S2 = 0.;
214
215 RecCgemClusterCol::iterator iClusterCol;
216 for(iClusterCol=aClusterCol->begin(); iClusterCol!=aClusterCol->end(); iClusterCol++)
217 {
218
220
221 int flag = (*iClusterCol)->getflag();
222
223
224 if(flag==2 || flag==3) nclusterxv++;
225
226 int clusterid = (*iClusterCol)->getclusterid();
227 int trkid = (*iClusterCol)->getTrkId();
228 int layerid = (*iClusterCol)->getlayerid();
229 int sheetid = (*iClusterCol)->getsheetid();
230
231 double edep = (*iClusterCol)->getenergydeposit();
232 double phi = (*iClusterCol)->getrecphi();
233 double v = (*iClusterCol)->getrecv();
234 double z = (*iClusterCol)->getRecZ();
235 double phi_cc = (*iClusterCol)->getrecphi_CC();
236 double v_cc = (*iClusterCol)->getrecv_CC();
237 double z_cc = (*iClusterCol)->getRecZ_CC();
238 double phi_tpc = (*iClusterCol)->getrecphi_mTPC();
239 double v_tpc = (*iClusterCol)->getrecv_mTPC();
240 double z_tpc = (*iClusterCol)->getRecZ_mTPC();
241 double a_tpc = 0;
242 double b_tpc = 0;
243
244
245 if(sheetid==-1) {
246
247 continue;
248 }
249
250
251 cluster_t[ncluster] = 0;
252
253 cluster_q[ncluster] = edep;
254
255
257 double anode_radius_x = anode->
getRX();
258 double anode_radius_v = anode->
getRV();
260
261 if(flag==0) {
262
263
264 cluster_r[ncluster] = anode_mid_gap;
265 cluster_phi[ncluster] = phi;
266 cluster_phi_cc[ncluster] = phi_cc;
267 cluster_phi_tpc[ncluster] = phi_tpc;
268 cluster_ax_tpc[ncluster] = a_tpc;
269 cluster_bx_tpc[ncluster] = b_tpc;
270 }
271 else if(flag==1) {
272 cluster_r[ncluster] = anode_mid_gap;
273 cluster_v[ncluster] =
v;
274 cluster_v_cc[ncluster] = v_cc;
275 cluster_v_tpc[ncluster] = v_tpc;
276 cluster_av_tpc[ncluster] = a_tpc;
277 cluster_bv_tpc[ncluster] = b_tpc;
278 }
279 else if(flag==2 || flag==3) {
280 cluster_r[ncluster] = anode_mid_gap;
281
282
283 cluster_z[ncluster] = z;
284 cluster_z_cc[ncluster] = z_cc;
285 cluster_z_tpc[ncluster] = z_tpc;
286 cluster_phi[ncluster] = phi;
287 cluster_phi_cc[ncluster] = phi_cc;
288 cluster_phi_tpc[ncluster] = phi_tpc;
289
290
291
292 if(layerid==0) {
293 if(edep > tmp_charge_L1_S1) {
294 tmp_charge_L1_S1 = edep; tmp_cluster_L1_S1 = ncluster;
295 }
296 }
297 else if(layerid==1 && sheetid==0) {
298 if(edep > tmp_charge_L2_S1){
299 tmp_charge_L2_S1 = edep; tmp_cluster_L2_S1 = ncluster;
300 }
301 }
302 else if(layerid==1 && sheetid==1) {
303 if(edep > tmp_charge_L2_S2){
304 tmp_charge_L2_S2 = edep; tmp_cluster_L2_S2 = ncluster;
305 }
306 }
307 }
308
309 cluster_layerid[ncluster] = layerid;
310 cluster_sheetid[ncluster] = sheetid;
311
312 cluster_view[ncluster] = flag;
313
314 int flagB = (*iClusterCol)->getclusterflagb();
315 int flagE = (*iClusterCol)->getclusterflage();
316
317 if(flag==2 || flag==3) {
318 int clusterX = (*iClusterCol)->getclusterflagb();
319 RecCgemClusterCol::iterator iClusterCol2 = aClusterCol->begin()+clusterX;
320 int stripx1 = (*iClusterCol2)->getclusterflagb();
321 int stripx2 = (*iClusterCol2)->getclusterflage();
322 int sizex = stripx2 - stripx1 + 1;
323 double chargex = (*iClusterCol2)->getenergydeposit();
324 double ax_tpc = 0;
325 double bx_tpc = 0;
326
327 int clusterV = (*iClusterCol)->getclusterflage();
328 iClusterCol2 = aClusterCol->begin()+clusterV;
329 int stripv1 = (*iClusterCol2)->getclusterflagb();
330 int stripv2 = (*iClusterCol2)->getclusterflage();
331 int sizev = stripv2 - stripv1 + 1;
332 double chargev = (*iClusterCol2)->getenergydeposit();
333 double av_tpc = 0;
334 double bv_tpc = 0;
335
336
337
338
339
340
341 cluster_idx[ncluster] = clusterX;
342 cluster_idv[ncluster] = clusterV;
343 cluster_stripx1[ncluster] = stripx1;
344 cluster_stripx2[ncluster] = stripx2;
345 cluster_stripv1[ncluster] = stripv1;
346 cluster_stripv2[ncluster] = stripv2;
347 cluster_sizex[ncluster] = sizex;
348 cluster_sizev[ncluster] = sizev;
349 cluster_qx[ncluster] = chargex;
350 cluster_qv[ncluster] = chargev;
351 cluster_ax_tpc[ncluster] = ax_tpc;
352 cluster_av_tpc[ncluster] = av_tpc;
353 cluster_bx_tpc[ncluster] = bx_tpc;
354 cluster_bv_tpc[ncluster] = bv_tpc;
355 }
356 else {
357 int strip1 = (*iClusterCol)->getclusterflagb();
358 int strip2 = (*iClusterCol)->getclusterflage();
359 int size = strip2 - strip1 + 1;
360 double charge = (*iClusterCol)->getenergydeposit();
361
362 if(flag==0) {
363 cluster_idx[ncluster] = clusterid;
364 cluster_sizex[ncluster] = size;
365 cluster_qx[ncluster] = charge;
366 cluster_stripx1[ncluster] = strip1;
367 cluster_stripx2[ncluster] = strip2;
368 }
369 else if(flag==1) {
370 cluster_idv[ncluster] = clusterid;
371 cluster_sizev[ncluster] = size;
372 cluster_qv[ncluster] = charge;
373 cluster_stripv1[ncluster] = strip1;
374 cluster_stripv2[ncluster] = strip2;
375 }
376
377
378
379
380
381
382
383 }
384
385
386
387 ncluster++;
388 if(flag == 0) {
389 nclusterx++;
390 if(layerid == 0) ncluster_L1_S1_x++;
391 else if(layerid == 1) {
392 if(sheetid == 0) ncluster_L2_S1_x++;
393 else ncluster_L2_S2_x++;
394 }
395 }
396 else if(flag == 1) {
397 nclusterv++;
398 if(layerid == 0) ncluster_L1_S1_v++;
399 else if(layerid == 1) {
400 if(sheetid == 0) ncluster_L2_S1_v++;
401 else ncluster_L2_S2_v++;
402 }
403 }
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437 }
438
439
440
441
442 if(tmp_cluster_L1_S1!=-1) cluster_highest[tmp_cluster_L1_S1]=1;
443 if(tmp_cluster_L2_S1!=-1) cluster_highest[tmp_cluster_L2_S1]=1;
444 if(tmp_cluster_L2_S2!=-1) cluster_highest[tmp_cluster_L2_S2]=1;
445
446 tree->Fill();
447
448
449
450
451 return StatusCode::SUCCESS;
452}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0