read map std::map<int, std::vector < int > >::iterator it2; for(it2 = map_L1_S1_stripx_to_hit.begin(); it2 != map_L1_S1_stripx_to_hit.end(); it2++) { int istrip = it2->first; std::vector< int > hitlist = it2->second; cout << "L1/S1/x....reading strip " << istrip << " hit " << hitlist[0] << endl;
}
cout << "1D_CLUSTER index " << clusterid << " or " << ncluster << " layer " << layerid << " sheet " << sheetid << " view " << cluster_1d_view[ncluster] << endl; cout << " from " << flagB << " to " << flagE << endl; cout << "hits: ";
cout << "2D_CLUSTER index " << clusterid << " or " << ncluster << " layer " << layerid << " sheet " << sheetid << " view " << cluster_2d_view[ncluster] << endl; cout << " idx " << flagB << " idv " << flagE << endl;
cout << "************************" << endl; for(int iclu=0; iclu<ncluster; iclu++) { cout << "cluster 1d view " << cluster_1d_view[iclu] << " size " << cluster_1d_size[iclu] << " from " << cluster_1d_strip1[iclu] << " to " << cluster_1d_strip2[iclu] << endl;
for(int ihit = 0; ihit < cluster_1d_size[iclu] ; ihit++) { cout << "hit " << cluster_1d_hitindex[iclu][ihit] << endl; } }
303 {
304
305 MsgStream log(
msgSvc(), name());
306 if(event%1000==0) cout << "->TestClusterWithHit::execute " << event << endl;
307
308
309 ISvcLocator* svcLocator = Gaudi::svcLocator();
310 StatusCode sc=svcLocator->service("EventDataSvc", m_evtSvc);
311 if (sc.isFailure())
312 cout<<"Could not accesss EventDataSvc!"<<endl;
313
314
316
317
318
319 SmartDataPtr<CgemDigiCol> aDigiCol(m_evtSvc,"/Event/Digi/CgemDigiCol");
320 if(!aDigiCol)
321 cout<<"Could not retrieve CGEM digi collection"<<endl;
322 nhit = aDigiCol->size();
323
324
325 int ihit=0;
326
327 CgemDigiCol::iterator iDigiCol;
328 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
329 {
330 const Identifier ident = (*iDigiCol)->identify();
334 int view = 1;
336 if(is_xstrip == true) view = 0;
337 double charge = (*iDigiCol)->getCharge_fc();
338 double time = (*iDigiCol)->getTime_ns();
339
340 hit_strip[ihit] = strip;
341 hit_layer[ihit] = layer;
342 hit_sheet[ihit] = sheet;
343 hit_view[ihit] = view;
344
345 if(selDigi(iDigiCol, m_selGoodDigi)==true) {
346
347
348
349 std::map<int, std::vector < int > > *map_strip_to_hit = GetStripToHitMap(layer, sheet, view);
350 std::map<int, std::vector < int > >::iterator it1 = map_strip_to_hit->find(strip);
351 if (it1 != map_strip_to_hit->end()) {
352 it1->second.push_back(ihit);
353 }
354 else {
355 std::vector< int > hitlist;
356 hitlist.push_back(ihit);
357 std::pair<int, std::vector < int> > pair(strip, hitlist);
358 map_strip_to_hit->insert(pair);
359 }
360 }
361
362
363 ihit++;
364 }
365
366
367
368
369
370
371
372
373
374
375
376
377
378 SmartDataPtr<RecCgemClusterCol> aClusterCol(m_evtSvc,"/Event/Recon/RecCgemClusterCol");
379 if(!aClusterCol)
380 cout<<"Could not retrieve CGEM cluster collection"<<endl;
381
382 int nclu = aClusterCol->size();
384 std::cout << "nclu " << nclu << std::endl;
386 }
387
388 int nclusterx = 0;
389 int nclusterv = 0;
390 int nclusterxv = 0;
391
393 anode_radius_L1_x = anode->
getRX();
394 anode_radius_L1_v = anode->
getRV();
397 anode_radius_L2_x = anode->
getRX();
398 anode_radius_L2_v = anode->
getRV();
400
401 int tmp_cluster_L1_S1 = -1;
402 int tmp_cluster_L2_S1 = -1;
403 int tmp_cluster_L2_S2 = -1;
404 double tmp_charge_L1_S1 = 0.;
405 double tmp_charge_L2_S1 = 0.;
406 double tmp_charge_L2_S2 = 0.;
407
408 ncluster = 0;
409 RecCgemClusterCol::iterator iClusterCol;
410 for(iClusterCol=aClusterCol->begin(); iClusterCol!=aClusterCol->end(); iClusterCol++)
411 {
412
414
415 int flag = (*iClusterCol)->getflag();
416 int clusterid = (*iClusterCol)->getclusterid();
417 int trkid = (*iClusterCol)->getTrkId();
418 int layerid = (*iClusterCol)->getlayerid();
419 int sheetid = (*iClusterCol)->getsheetid();
420 double edep = (*iClusterCol)->getenergydeposit();
421 double phi = (*iClusterCol)->getrecphi();
422 double v = (*iClusterCol)->getrecv();
423 double z = (*iClusterCol)->getRecZ();
424 double phi_cc = (*iClusterCol)->getrecphi_CC();
425 double v_cc = (*iClusterCol)->getrecv_CC();
426 double z_cc = (*iClusterCol)->getRecZ_CC();
427 double phi_tpc = (*iClusterCol)->getrecphi_mTPC();
428 double v_tpc = (*iClusterCol)->getrecv_mTPC();
429 double z_tpc = (*iClusterCol)->getRecZ_mTPC();
430 double a_tpc = 0;
431 double b_tpc = 0;
432
433 if(sheetid == -1) {
434 ncluster++;
435 continue;
436 }
437
438
441
442
443
444
445 int flagB = (*iClusterCol)->getclusterflagb();
446 int flagE = (*iClusterCol)->getclusterflage();
447
448
449
450 if(flag==0 || flag == 1) {
451 cluster_1d_ID[ncluster] = clusterid;
452
453 cluster_1d_t[ncluster] = 0;
454 cluster_1d_q[ncluster] = edep;
455
456 cluster_1d_layerid[ncluster] = layerid;
457 cluster_1d_sheetid[ncluster] = sheetid;
458 cluster_1d_view[ncluster] = flag;
459 cluster_1d_r[ncluster] = anode_mid_gap;
460 cluster_1d_phi[ncluster] = phi;
461 cluster_1d_phi_cc[ncluster] = phi_cc;
462 cluster_1d_phi_tpc[ncluster] = phi_tpc;
463 cluster_1d_v[ncluster] =
v;
464 cluster_1d_v_cc[ncluster] = v_cc;
465 cluster_1d_v_tpc[ncluster] = v_tpc;
466 cluster_1d_a_tpc[ncluster] = a_tpc;
467 cluster_1d_b_tpc[ncluster] = b_tpc;
468
469 cluster_1d_strip1[ncluster] = flagB;
470 cluster_1d_strip2[ncluster] = flagE;
471 int size = flagE - flagB + 1;
472 cluster_1d_size[ncluster] = size;
473
474
475
476 std::map<int, std::vector < int > > *read_map_strip_to_hit = GetStripToHitMap(layerid, sheetid, flag);
477 std::map<int, std::vector < int > >::iterator it2;
478
479
480
481
482
483
484
485
486
487 for(int istrip = 0; istrip < size; istrip++) {
488 int stripid = flagB + istrip;
489 it2 = read_map_strip_to_hit->find(stripid);
490 std::vector< int > hitlist = it2->second;
491 int size_hitlist = hitlist.size();
492
493 cluster_1d_hitindex[ncluster][istrip] = hitlist[size_hitlist-1];
494
495 }
496
497
498 ncluster_1d++;
499 }
500 else if(flag==2 || flag==3) {
501 cluster_2d_ID[ncluster] = clusterid;
502
503 cluster_2d_t[ncluster] = 0;
504 cluster_2d_q[ncluster] = edep;
505
506 cluster_2d_layerid[ncluster] = layerid;
507 cluster_2d_sheetid[ncluster] = sheetid;
508 cluster_2d_view[ncluster] = flag;
509 cluster_2d_r[ncluster] = anode_mid_gap;
510 cluster_2d_z[ncluster] = z;
511 cluster_2d_z_cc[ncluster] = z_cc;
512 cluster_2d_z_tpc[ncluster] = z_tpc;
513 cluster_2d_phi[ncluster] = phi;
514 cluster_2d_phi_cc[ncluster] = phi_cc;
515 cluster_2d_phi_tpc[ncluster] = phi_tpc;
516
517 cluster_2d_idx[ncluster] = flagB;
518 cluster_2d_idv[ncluster] = flagE;
519
520
521
522
523
524
525
526
527 if(flag==2) {
528 if(layerid==0) {
529 if(edep > tmp_charge_L1_S1) {
530 tmp_charge_L1_S1 = edep; tmp_cluster_L1_S1 = ncluster;
531 }
532 }
533 else if(layerid==1 && sheetid==0) {
534 if(edep > tmp_charge_L2_S1){
535 tmp_charge_L2_S1 = edep; tmp_cluster_L2_S1 = ncluster;
536 }
537 }
538 else if(layerid==1 && sheetid==1) {
539 if(edep > tmp_charge_L2_S2){
540 tmp_charge_L2_S2 = edep; tmp_cluster_L2_S2 = ncluster;
541 }
542 }
543 }
544
545 ncluster_2d++;
546 }
547
548
549 ncluster++;
550 if(flag == 0) {
551 nclusterx++;
552 if(layerid == 0) ncluster_1d_L1_S1_x++;
553 else if(layerid == 1) {
554 if(sheetid == 0) ncluster_1d_L2_S1_x++;
555 else ncluster_1d_L2_S2_x++;
556 }
557 }
558 else if(flag == 1) {
559 nclusterv++;
560 if(layerid == 0) ncluster_1d_L1_S1_v++;
561 else if(layerid == 1) {
562 if(sheetid == 0) ncluster_1d_L2_S1_v++;
563 else ncluster_1d_L2_S2_v++;
564 }
565 }
566 else if(flag == 2) {
567 nclusterxv++;
568 if(layerid == 0) ncluster_2d_L1_S1++;
569 else if(layerid == 1) {
570 if(sheetid == 0) ncluster_2d_L2_S1++;
571 else ncluster_2d_L2_S2++;
572 }
573 }
574
575 }
576
577
578
579
580
581 if(tmp_cluster_L1_S1!=-1) cluster_2d_highest[tmp_cluster_L1_S1]=1;
582 if(tmp_cluster_L2_S1!=-1) cluster_2d_highest[tmp_cluster_L2_S1]=1;
583 if(tmp_cluster_L2_S2!=-1) cluster_2d_highest[tmp_cluster_L2_S2]=1;
584
585
586
587
588
589
590
591
592
593
594
595
596 tree->Fill();
597 event++;
598
599 return StatusCode::SUCCESS;
600}
**********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
static int strip(const Identifier &id)
static int sheet(const Identifier &id)
static int layer(const Identifier &id)
static bool is_xstrip(const Identifier &id)
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0