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 << "track id " << track->trackId() << endl; cout << "dr " << track->helix(0) << endl; cout << "phi0 " << track->helix(1) << endl; cout << "dz " << track->helix(3) << endl; cout << "tanL " << track->helix(4) << endl;
440 {
441
442 MsgStream log(
msgSvc(), name());
443
444
446
447
448 ISvcLocator* svcLocator = Gaudi::svcLocator();
449 StatusCode sc=svcLocator->service("EventDataSvc", m_evtSvc);
450 if (sc.isFailure())
451 cout<<"Could not accesss EventDataSvc!"<<endl;
452
453
454 SmartDataPtr<CgemDigiCol> aDigiCol(m_evtSvc,"/Event/Digi/CgemDigiCol");
455 if(!aDigiCol)
456 cout<<"Could not retrieve CGEM digi collection"<<endl;
457 nhit = aDigiCol->size();
458
459
460
461 int ihit=0;
462
463 CgemDigiCol::iterator iDigiCol;
464 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
465 {
466 const Identifier ident = (*iDigiCol)->identify();
470 int view = 1;
472 if(is_xstrip == true) view = 0;
473 double charge = (*iDigiCol)->getCharge_fc();
474 double time = (*iDigiCol)->getTime_ns();
475
476 hit_strip[ihit] = strip;
477 hit_layer[ihit] = layer;
478 hit_sheet[ihit] = sheet;
479 hit_view[ihit] = view;
481 hit_q[ihit] = charge;
482
485 else hit_length[ihit] = anode->
getLength();
486
487 int channel = lutreader->
GetChannel(layer, sheet, view, strip);
488 int roc = lutreader->
GetROC(layer, sheet, view, strip);
489 int feb = lutreader->
GetFEB(layer, sheet, view, strip);
490 int tiger = lutreader->
GetTIGER(layer, sheet, view, strip);
491 int chip = lutreader->
GetChip(layer, sheet, view, strip);
492 int quality = lutreader->
GetQuality(layer, sheet, view, strip);
493
494 hit_channel[ihit] = channel;
495 hit_roc[ihit] = roc;
496 hit_feb[ihit] = feb;
497 hit_tiger[ihit] = tiger;
498 hit_chip[ihit] = chip;
499 hit_quality[ihit] = quality;
500
501 if(selDigi(iDigiCol, m_selGoodDigi)==true) {
502 hit_selgooddigi[ihit] = 1;
503
504
505
506 std::map<int, std::vector < int > > *map_strip_to_hit = GetStripToHitMap(layer, sheet, view);
507 std::map<int, std::vector < int > >::iterator it1 = map_strip_to_hit->find(strip);
508 if (it1 != map_strip_to_hit->end()) {
509 it1->second.push_back(ihit);
510 }
511 else {
512 std::vector< int > hitlist;
513 hitlist.push_back(ihit);
514 std::pair<int, std::vector < int> > pair(strip, hitlist);
515 map_strip_to_hit->insert(pair);
516 }
517 }
518
519 ihit++;
520 }
521
522
523
524
525
526 SmartDataPtr<RecCgemClusterCol> aClusterCol(m_evtSvc,"/Event/Recon/RecCgemClusterCol");
527 if(!aClusterCol)
528 cout<<"Could not retrieve CGEM cluster collection"<<endl;
529 int nclu = aClusterCol->size();
530
532 std::cout << "nclu " << nclu << std::endl;
534 }
535
536 int nclusterx = 0;
537 int nclusterv = 0;
538 int nclusterxv = 0;
539
540 int tmp_cluster_L1_S1 = -1;
541 int tmp_cluster_L2_S1 = -1;
542 int tmp_cluster_L2_S2 = -1;
543 double tmp_charge_L1_S1 = 0.;
544 double tmp_charge_L2_S1 = 0.;
545 double tmp_charge_L2_S2 = 0.;
546
547 ncluster = 0;
548
549 RecCgemClusterCol::iterator iClusterCol;
550 for(iClusterCol=aClusterCol->begin(); iClusterCol!=aClusterCol->end(); iClusterCol++)
551 {
552
554
555 int flag = (*iClusterCol)->getflag();
556 int clusterid = (*iClusterCol)->getclusterid();
557 int trkid = (*iClusterCol)->getTrkId();
558 int layerid = (*iClusterCol)->getlayerid();
559 int sheetid = (*iClusterCol)->getsheetid();
560 double edep = (*iClusterCol)->getenergydeposit();
561 double phi = (*iClusterCol)->getrecphi();
562 double v = (*iClusterCol)->getrecv();
563 double z = (*iClusterCol)->getRecZ();
564 double phi_cc = (*iClusterCol)->getrecphi_CC();
565 double v_cc = (*iClusterCol)->getrecv_CC();
566 double z_cc = (*iClusterCol)->getRecZ_CC();
567 double phi_tpc = (*iClusterCol)->getrecphi_mTPC();
568 double v_tpc = (*iClusterCol)->getrecv_mTPC();
569 double z_tpc = (*iClusterCol)->getRecZ_mTPC();
570 double a_tpc = 0;
571 double b_tpc = 0;
572
573 if(sheetid == -1) {
574 ncluster++;
575 continue;
576 }
577
578
581
582
583
584
585 int flagB = (*iClusterCol)->getclusterflagb();
586 int flagE = (*iClusterCol)->getclusterflage();
587
588
589 if(flag==0 || flag == 1) {
590 cluster_1d_ID[ncluster] = clusterid;
591
592 cluster_1d_t[ncluster] = 0;
593 cluster_1d_q[ncluster] = edep;
594
595 cluster_1d_layerid[ncluster] = layerid;
596 cluster_1d_sheetid[ncluster] = sheetid;
597 cluster_1d_view[ncluster] = flag;
598 cluster_1d_r[ncluster] = anode_mid_gap;
599 cluster_1d_phi[ncluster] = phi;
600 cluster_1d_phi_cc[ncluster] = phi_cc;
601 cluster_1d_phi_tpc[ncluster] = phi_tpc;
602 cluster_1d_v[ncluster] =
v;
603 cluster_1d_v_cc[ncluster] = v_cc;
604 cluster_1d_v_tpc[ncluster] = v_tpc;
605 cluster_1d_a_tpc[ncluster] = a_tpc;
606 cluster_1d_b_tpc[ncluster] = b_tpc;
607
608 cluster_1d_strip1[ncluster] = flagB;
609 cluster_1d_strip2[ncluster] = flagE;
610 int size = flagE - flagB + 1;
611 cluster_1d_size[ncluster] = size;
612
613
614 std::map<int, std::vector < int > > *read_map_strip_to_hit = GetStripToHitMap(layerid, sheetid, flag);
615 std::map<int, std::vector < int > >::iterator it2;
616
617
618
619
620
621
622
623
624 for(int istrip = 0; istrip < size; istrip++) {
625 int stripid = flagB + istrip;
626 it2 = read_map_strip_to_hit->find(stripid);
627 std::vector< int > hitlist = it2->second;
628 int size_hitlist = hitlist.size();
629 cluster_1d_hitindex[ncluster][istrip] = hitlist[size_hitlist-1];
630 }
631
632 ncluster_1d++;
633 }
634
635 else if(flag==2 || flag==3) {
636 cluster_2d_ID[ncluster] = clusterid;
637
638 cluster_2d_t[ncluster] = 0;
639 cluster_2d_q[ncluster] = edep;
640
641 cluster_2d_layerid[ncluster] = layerid;
642 cluster_2d_sheetid[ncluster] = sheetid;
643 if(layerid==0 && phi>0) cluster_2d_sheetid[ncluster] = 1;
644 cluster_2d_view[ncluster] = flag;
645 cluster_2d_r[ncluster] = anode_mid_gap;
646 cluster_2d_z[ncluster] = z;
647 cluster_2d_z_cc[ncluster] = z_cc;
648 cluster_2d_z_tpc[ncluster] = z_tpc;
649 cluster_2d_phi[ncluster] = phi;
650 cluster_2d_phi_cc[ncluster] = phi_cc;
651 cluster_2d_phi_tpc[ncluster] = phi_tpc;
652
653 cluster_2d_idx[ncluster] = flagB;
654 cluster_2d_idv[ncluster] = flagE;
655
656
657
658
659
660
661
662 if(flag==2) {
663
664 if(layerid==0) {
665 if(edep > tmp_charge_L1_S1) {
666 tmp_charge_L1_S1 = edep; tmp_cluster_L1_S1 = ncluster;
667 }
668 }
669 else if(layerid==1 && sheetid==0) {
670 if(edep > tmp_charge_L2_S1){
671 tmp_charge_L2_S1 = edep; tmp_cluster_L2_S1 = ncluster;
672 }
673 }
674 else if(layerid==1 && sheetid==1) {
675 if(edep > tmp_charge_L2_S2){
676 tmp_charge_L2_S2 = edep; tmp_cluster_L2_S2 = ncluster;
677 }
678 }
679 }
680
681 ncluster_2d++;
682 }
683
684 ncluster++;
685 if(flag == 0) {
686 nclusterx++;
687 if(layerid == 0) ncluster_1d_L1_S1_x++;
688 else if(layerid == 1) {
689 if(sheetid == 0) ncluster_1d_L2_S1_x++;
690 else ncluster_1d_L2_S2_x++;
691 }
692 }
693 else if(flag == 1) {
694 nclusterv++;
695 if(layerid == 0) ncluster_1d_L1_S1_v++;
696 else if(layerid == 1) {
697 if(sheetid == 0) ncluster_1d_L2_S1_v++;
698 else ncluster_1d_L2_S2_v++;
699 }
700 }
701 else if(flag == 2) {
702 nclusterxv++;
703 if(layerid == 0) ncluster_2d_L1_S1++;
704 else if(layerid == 1) {
705 if(sheetid == 0) ncluster_2d_L2_S1++;
706 else ncluster_2d_L2_S2++;
707 }
708 }
709
710 }
711
712
713
714
715
716 if(tmp_cluster_L1_S1!=-1) cluster_2d_highest[tmp_cluster_L1_S1]=1;
717 if(tmp_cluster_L2_S1!=-1) cluster_2d_highest[tmp_cluster_L2_S1]=1;
718 if(tmp_cluster_L2_S2!=-1) cluster_2d_highest[tmp_cluster_L2_S2]=1;
719
720
721
722 SmartDataPtr<RecMdcTrackCol> aTrackCol(m_evtSvc,"/Event/Recon/RecMdcTrackCol");
723 if(!aTrackCol) {
724
725 }
726 else {
727
728
729 RecMdcTrackCol::iterator iTrackCol;
730 for(iTrackCol=aTrackCol->begin(); iTrackCol!=aTrackCol->end(); iTrackCol++)
731 {
733
734
735
736
737
738
739
740
741
742 if(track->
trackId() != 0)
continue;
743
744 track_chi2 = track->
chi2();
745
746 track_dr = track->
helix(0);
747 track_phi0 = track->
helix(1);
748 track_dz = track->
helix(3);
749 track_tanL = track->
helix(4);
750
752 track_nfitpoint = vecclusters.size();
753
754
755 bool istestplane[2][2];
756 for(
int ilay=0; ilay<
MAXNOFLAYER; ilay++)
for(
int ishe=0; ishe<
MAXNOFSHEET; ishe++) istestplane[ilay][ishe] =
true;
757
758 for(int iclus=0; iclus < track_nfitpoint; iclus++) {
761 double z = tcluster->
getRecZ();
763
764 track_layerid[iclus] = tcluster->
getlayerid();
765 track_sheetid[iclus] = tcluster->
getsheetid();
766 if(phi > 0) track_sheetid[iclus] = 1;
767
768
769
770
771 istestplane[track_layerid[iclus]][track_sheetid[iclus]] = false;
772 }
773
776
777
778
779 if(istestplane[ilay][ishe] == true) {
780 track_test_layerid = ilay;
781 track_test_sheetid = ishe;
782 }
783 }
784 }
785
786
787
788
789 double xP; double yP; double zP;
790 ComputePOCA(xP, yP, zP);
791
792
793 double xP1; double yP1; double zP1; double phiP1; double vP1;
794 double xP2; double yP2; double zP2; double phiP2; double vP2;
795
796 double angCR_xy_L1, angCR_yz_L1;
797
798 bool gotit1 = ComputeIntersection(0, xP1, yP1, zP1, phiP1, vP1, xP2, yP2, zP2, phiP2, vP2, angCR_xy_L1, angCR_yz_L1);
799
800 ang_xy_L1 = angCR_xy_L1;
801 ang_yz_L1 = angCR_yz_L1;
802
803
804 double xP3; double yP3; double zP3; double phiP3; double vP3;
805 double xP4; double yP4; double zP4; double phiP4; double vP4;
806
807 double angCR_xy_L2, angCR_yz_L2;
808
809 bool gotit2 = ComputeIntersection(1, xP3, yP3, zP3, phiP3, vP3, xP4, yP4, zP4, phiP4, vP4, angCR_xy_L2, angCR_yz_L2);
810
811 ang_xy_L2 = angCR_xy_L2;
812 ang_yz_L2 = angCR_yz_L2;
813
814 if(gotit1==false || gotit2==false) cout << "TestTrack: error in intersection calculation. Intersection on L1 " << gotit1 << ", on L2 " << gotit2 << endl;
815
816
817
818 track_xpoca_glo = xP; track_ypoca_glo = yP; track_zpoca_glo = zP;
819
820
821 track_x1top_glo = xP1; track_y1top_glo = yP1; track_z1top_glo = zP1; track_phi1top_loc = phiP1; track_v1top_loc = vP1;
822 track_x1bot_glo = xP2; track_y1bot_glo = yP2; track_z1bot_glo = zP2; track_phi1bot_loc = phiP2; track_v1bot_loc = vP2;
823
824 track_x2top_glo = xP3; track_y2top_glo = yP3; track_z2top_glo = zP3; track_phi2top_loc = phiP3; track_v2top_loc = vP3;
825 track_x2bot_glo = xP4; track_y2bot_glo = yP4; track_z2bot_glo = zP4; track_phi2bot_loc = phiP4; track_v2bot_loc = vP4;
826 }
827
828
829 }
830 tree->Fill();
831
832 event++;
833
834 return StatusCode::SUCCESS;
835}
**********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
SmartRefVector< RecCgemCluster > ClusterRefVec
double getVStripLength(int V_ID) const
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)
int GetChip(int ilayer, int isheet, int iview, int istrip)
int GetQuality(int ilayer, int isheet, int iview, int istrip)
int GetROC(int ilayer, int isheet, int iview, int istrip)
int GetChannel(int ilayer, int isheet, int iview, int istrip)
int GetTIGER(int ilayer, int isheet, int iview, int istrip)
int GetFEB(int ilayer, int isheet, int iview, int istrip)
const double chi2() const
const int trackId() const
const HepVector helix() const
......
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0
double getRecZ(void) const
int getclusterid(void) const
int getlayerid(void) const
double getrecphi(void) const
int getsheetid(void) const
const ClusterRefVec getVecClusters() const