63 #define TRG_SHORT_NAMES
64 #define TRGECL_SHORT_NAMES
66 #include "framework/datastore/StoreArray.h"
67 #include "trg/ecl/TrgEclMaster.h"
68 #include "trg/ecl/TrgEclCluster.h"
70 #include "trg/ecl/dataobjects/TRGECLTrg.h"
71 #include "trg/ecl/dataobjects/TRGECLHit.h"
72 #include "trg/ecl/dataobjects/TRGECLCluster.h"
83 TrgEclMaster::TrgEclMaster():
84 m_TimeWindow(250.0), m_OverlapWindow(0.0), m_Clustering(1), m_Bhabha(0),
85 m_EventTiming(1), m_NofTopTC(3), m_ClusterLimit(6), m_Triggerbit{0, 0, 0, 0},
86 m_Lowmultibit(0), m_PrescaleFactor(0), m_PrescaleCounter(0), m_mumuThreshold(20),
88 m_taub2bClusterECut1(1.9),
89 m_taub2bClusterECut2(999),
90 m_taub2b2EtotCut(7.0),
91 m_taub2b2CLEEndcapCut(3.0),
92 m_taub2b2CLECut(0.162),
93 m_taub2b3EtotCut(7.0),
94 m_taub2b3CLEb2bCut(0.14),
95 m_taub2b3CLELowCut(0.12),
96 m_taub2b3CLEHighCut(4.5),
98 m_ECLBurstThreshold(200)
126 return "TrgEclMaster";
134 return std::string(
"TrgEclMaster 2.1");
156 {40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 30, 35};
158 {25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 30, 30};
221 for (
int ii = 0; ii < trgeclHitArray.
getEntries(); ii++) {
223 TRGECLHit* aTRGECLHit = trgeclHitArray[ii];
224 int iTCID = (aTRGECLHit->
getTCId() - 1);
240 double fluctuation = ((gRandom->Uniform(-1, 0))) * 125;
242 double check_window_start;
244 double check_window_end;
246 for (
int iBin = 0 ; iBin < nBin; iBin ++) {
248 check_window_start = iBin * (
m_TimeWindow / 3) + fluctuation - 4000;
249 WindowStart = check_window_start;
250 check_window_end = check_window_start +
m_TimeWindow / 3;
258 for (
int iTCId = 0; iTCId < 576; iTCId++) {
260 for (
int ihit = 0; ihit < hitsize; ihit++) {
261 if (
m_TCTiming[iTCId][ihit] > check_window_start &&
271 for (
int iTCId = 0; iTCId < 576; iTCId++) {
273 for (
int ihit = 0; ihit < hitsize; ihit++) {
285 if (noftchit == 0) {
continue;}
287 double eventtiming = 0;
295 int EventTimingQualityFlag =
m_obj_timing->getEventTimingQualityFlag();
299 std::vector<std::vector<double>> thetaringsum;
300 std::vector<double> phiringsum;
302 thetaringsum.clear();
304 thetaringsum.resize(3, std::vector<double>(36, 0));
305 phiringsum.resize(17, 0);
311 for (
int iii = 0; iii <= 16; iii++) {
312 if (iii > 0 && iii < 15) {E_phys += phiringsum[iii];}
313 E_total += phiringsum[iii];
315 if (E_total == 0) {
continue;}
316 int ELow = 0, EHigh = 0, ELum = 0;
348 std::vector<double> ClusterTiming;
349 std::vector<double> ClusterEnergy;
350 std::vector<int> MaxTCId;
351 ClusterTiming.clear();
352 ClusterEnergy.clear();
355 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
359 double clustertiming = aTRGECLCluster->
getTimeAve();
360 TVector3 clusterposition(aTRGECLCluster->
getPositionX(),
363 ClusterTiming.push_back(clustertiming);
364 ClusterEnergy.push_back(clusterenergy);
365 MaxTCId.push_back(maxTCId);
396 std::vector<double> vct_bhabha;
399 int bhabha3D_veto = 0 ;
400 int bhabha3D_sel = 0;
402 int bhabha3DVetoInTrackFlag = 0;
403 int bhabha3DSelectionThetaFlag = 0;
410 if (b_2Dbhabha && (icn < 4)) {bhabha2D = 1;}
412 if (b_3Dbhabha) {bhabha3D_veto = 1;}
414 if (b_3Dbhabha_sel) {bhabha3D_sel = 1;}
416 if (b_mumu) {mumu = 1;}
429 int bhabhaprescale = 0;
440 int Timing = (int)(eventtiming + 0.5);
443 int etot = (int)(E_phys * 1000 + 0.5);
445 if ((etot > 1000 || icn > 3) && !(bhabha2D == 1)) {physics = 1;}
446 std::vector<int> bhabhabit;
448 int bhabhabitsize = vct_bhabha.size();
449 for (
int ibhabha = 0; ibhabha < bhabhabitsize; ibhabha++) {
450 bhabhabit.push_back((
int)vct_bhabha[ibhabha]);
453 int flagoverflow = 0;
454 if (ClusterOverflow > 0) {
459 bhabha2D, physics, bhabhabit, icn, beambkgtag,
461 bhabha3D_sel, mumu, bhabhaprescale, E_burst,
462 EventTimingQualityFlag,
463 bhabha3DVetoInTrackFlag,
464 bhabha3DSelectionThetaFlag,
465 taub2bFlag, 0, taub2b2Flag, taub2b3Flag);
470 m_hitEneNum = trgEcltrgArray.
getEntries() - 1;
474 trgEcltrgArray[m_hitEneNum]->setEventId(m_nEvent);
475 trgEcltrgArray[m_hitEneNum]->setPRS01(phiringsum[0]);
476 trgEcltrgArray[m_hitEneNum]->setPRS02(phiringsum[1]);
477 trgEcltrgArray[m_hitEneNum]->setPRS03(phiringsum[2]);
478 trgEcltrgArray[m_hitEneNum]->setPRS04(phiringsum[3]);
479 trgEcltrgArray[m_hitEneNum]->setPRS05(phiringsum[4]);
480 trgEcltrgArray[m_hitEneNum]->setPRS06(phiringsum[5]);
481 trgEcltrgArray[m_hitEneNum]->setPRS07(phiringsum[6]);
482 trgEcltrgArray[m_hitEneNum]->setPRS08(phiringsum[7]);
483 trgEcltrgArray[m_hitEneNum]->setPRS09(phiringsum[8]);
484 trgEcltrgArray[m_hitEneNum]->setPRS10(phiringsum[9]);
485 trgEcltrgArray[m_hitEneNum]->setPRS11(phiringsum[10]);
486 trgEcltrgArray[m_hitEneNum]->setPRS12(phiringsum[11]);
487 trgEcltrgArray[m_hitEneNum]->setPRS13(phiringsum[12]);
488 trgEcltrgArray[m_hitEneNum]->setPRS14(phiringsum[13]);
489 trgEcltrgArray[m_hitEneNum]->setPRS15(phiringsum[14]);
490 trgEcltrgArray[m_hitEneNum]->setPRS16(phiringsum[15]);
491 trgEcltrgArray[m_hitEneNum]->setPRS17(phiringsum[16]);
493 trgEcltrgArray[m_hitEneNum]->setEtot(E_phys);
494 trgEcltrgArray[m_hitEneNum]->setNofTCHit(noftchit);
496 trgEcltrgArray[m_hitEneNum]->setBhabha01(vct_bhabha[0]);
497 trgEcltrgArray[m_hitEneNum]->setBhabha02(vct_bhabha[1]);
498 trgEcltrgArray[m_hitEneNum]->setBhabha03(vct_bhabha[2]);
499 trgEcltrgArray[m_hitEneNum]->setBhabha04(vct_bhabha[3]);
500 trgEcltrgArray[m_hitEneNum]->setBhabha05(vct_bhabha[4]);
501 trgEcltrgArray[m_hitEneNum]->setBhabha06(vct_bhabha[5]);
502 trgEcltrgArray[m_hitEneNum]->setBhabha07(vct_bhabha[6]);
503 trgEcltrgArray[m_hitEneNum]->setBhabha08(vct_bhabha[7]);
504 trgEcltrgArray[m_hitEneNum]->setBhabha09(vct_bhabha[8]);
505 trgEcltrgArray[m_hitEneNum]->setBhabha10(vct_bhabha[9]);
506 trgEcltrgArray[m_hitEneNum]->setBhabha11(vct_bhabha[10]);
507 trgEcltrgArray[m_hitEneNum]->setBhabha12(vct_bhabha[11]);
508 trgEcltrgArray[m_hitEneNum]->setBhabha13(vct_bhabha[12]);
509 trgEcltrgArray[m_hitEneNum]->setBhabha14(vct_bhabha[13]);
510 trgEcltrgArray[m_hitEneNum]->setBhabha15(vct_bhabha[14]);
511 trgEcltrgArray[m_hitEneNum]->setBhabha16(vct_bhabha[15]);
512 trgEcltrgArray[m_hitEneNum]->setBhabha17(vct_bhabha[16]);
513 trgEcltrgArray[m_hitEneNum]->setBhabha18(vct_bhabha[17]);
515 trgEcltrgArray[m_hitEneNum]->setICN(icn);
516 trgEcltrgArray[m_hitEneNum]->setICNFw(icnfwd);
517 trgEcltrgArray[m_hitEneNum]->setICNBr(icnbr);
518 trgEcltrgArray[m_hitEneNum]->setICNBw(icnbwd);
520 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[0], 0);
521 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[1], 1);
522 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[2], 2);
523 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[3], 3);
525 trgEcltrgArray[m_hitEneNum]->setBhabhaVeto(bhabha2D);
526 trgEcltrgArray[m_hitEneNum]->setBeamBkgVeto(beambkgtag);
527 trgEcltrgArray[m_hitEneNum]->setEventTiming(eventtiming);
529 trgEcltrgArray[m_hitEneNum]->setHit(hit);
530 trgEcltrgArray[m_hitEneNum]->setRevoclk(RevoFAM);
531 trgEcltrgArray[m_hitEneNum]->setTimingSource(TimingSource);
532 trgEcltrgArray[m_hitEneNum]->setPhysics(physics) ;
533 trgEcltrgArray[m_hitEneNum]->set2DBhabha(bhabha2D);
534 trgEcltrgArray[m_hitEneNum]->set3DBhabha(bhabha3D_veto);
535 trgEcltrgArray[m_hitEneNum]->set3DBhabhaSel(bhabha3D_sel);
536 trgEcltrgArray[m_hitEneNum]->setmumuBit(mumu);
537 trgEcltrgArray[m_hitEneNum]->setBhabhaPrescaleBit(bhabhaprescale);
539 trgEcltrgArray[m_hitEneNum]->setELow(ELow) ;
540 trgEcltrgArray[m_hitEneNum]->setEHihg(EHigh);
541 trgEcltrgArray[m_hitEneNum]->setELum(ELum) ;
542 trgEcltrgArray[m_hitEneNum]->setClusterOverflow(ClusterOverflow) ;
579 for (
int ii = 0; ii < trgeclHitArray.
getEntries(); ii++) {
581 TRGECLHit* aTRGECLHit = trgeclHitArray[ii];
582 int iTCID = (aTRGECLHit->
getTCId() - 1);
594 double WindowStart = 0;
595 double WindowEnd = 0;
596 double fluctuation = ((gRandom->Uniform(-1, 0))) * 125;
598 int startBin = nBin / 2 - 1;
600 int endBin = nBin / 2 + 1;
610 for (
int iBin = startBin ; iBin <= endBin; iBin ++) {
613 if (iBin == 0) {WindowStart = - 4000 + fluctuation;}
618 for (
int iTCId = 0; iTCId < 576; iTCId++) {
620 for (
int ihit = 0; ihit < hitsize; ihit++) {
627 if (totalE == 0) {
continue;}
635 if (max_bin == 0) {WindowStart = - 4000 + fluctuation;}
644 for (
int iTCId = 0; iTCId < 576; iTCId++) {
646 for (
int ihit = 0; ihit < hitsize; ihit++) {
658 if (noftchit == 0) {
return;}
660 double eventtiming = 0;
669 int EventTimingQualityFlag =
m_obj_timing->getEventTimingQualityFlag();
673 std::vector<std::vector<double>> thetaringsum;
674 std::vector<double> phiringsum;
676 thetaringsum.clear();
678 thetaringsum.resize(3, std::vector<double>(36, 0));
679 phiringsum.resize(17, 0);
689 for (
int iii = 0; iii <= 16; iii++) {
690 if (iii > 0 && iii < 15) {E_phys += phiringsum[iii];}
694 E_total += phiringsum[iii];
697 if (E_total == 0) {
return;}
698 int ELow = 0, EHigh = 0, ELum = 0;
732 std::vector<double> ClusterTiming;
733 std::vector<double> ClusterEnergy;
734 std::vector<int> MaxTCId;
735 std::vector<int> MaxThetaId;
736 ClusterTiming.clear();
737 ClusterEnergy.clear();
741 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
746 double clustertiming = aTRGECLCluster->
getTimeAve();
747 TVector3 clusterposition(aTRGECLCluster->
getPositionX(),
750 ClusterTiming.push_back(clustertiming);
751 ClusterEnergy.push_back(clusterenergy);
752 MaxTCId.push_back(maxTCId);
753 MaxThetaId.push_back(maxThetaId);
786 std::vector<double> vct_bhabha;
789 int bhabha3D_veto = 0 ;
790 int bhabha3D_sel = 0;
792 int bhabha3DVetoInTrackFlag = -1;
793 int bhabha3DSelectionThetaFlag = -1;
800 if (b_2Dbhabha && (icn < 4)) {bhabha2D = 1;}
802 if (b_3Dbhabha) {bhabha3D_veto = 1;}
804 if (b_3Dbhabha_sel) {bhabha3D_sel = 1;}
806 if (b_mumu) {mumu = 1;}
807 int bhabhaprescale = 0;
830 int bit_hie_bhav = 0;
832 bit_hie_bhav |= (~bhabha_addition & 0x01) & (~bhabha_addition >> 4 & 0x01);
834 bit_hie_bhav |= (~bhabha_addition & 0x01) & (~bhabha_addition >> 3 & 0x01);
836 bit_hie_bhav |= (~bhabha_addition & 0x01) & (~bhabha_addition >> 2 & 0x01);
838 bit_hie_bhav |= (~bhabha_addition & 0x01) & (~bhabha_addition >> 1 & 0x01);
844 int Timing = (int)(eventtiming + 0.5);
847 int etot = (int)(E_phys * 1000 + 0.5);
851 if ((etot > 1000 || icn > 3) && !(bhabha2D == 1)) {physics = 1;}
852 std::vector<int> bhabhabit;
854 int bhabhabitsize = vct_bhabha.size();
855 for (
int ibhabha = 0; ibhabha < bhabhabitsize; ibhabha++) {
856 bhabhabit.push_back((
int)vct_bhabha[ibhabha]);
859 int flagoverflow = 0;
860 if (ClusterOverflow > 0) {
865 physics, bhabhabit, icn, beambkgtag, flagoverflow,
867 bhabhaprescale, E_burst,
868 EventTimingQualityFlag,
869 bhabha3DVetoInTrackFlag,
870 bhabha3DSelectionThetaFlag,
959 m_hitEneNum = trgEcltrgArray.
getEntries() - 1;
963 trgEcltrgArray[m_hitEneNum]->setEventId(m_nEvent);
964 trgEcltrgArray[m_hitEneNum]->setPRS01(phiringsum[0]);
965 trgEcltrgArray[m_hitEneNum]->setPRS02(phiringsum[1]);
966 trgEcltrgArray[m_hitEneNum]->setPRS03(phiringsum[2]);
967 trgEcltrgArray[m_hitEneNum]->setPRS04(phiringsum[3]);
968 trgEcltrgArray[m_hitEneNum]->setPRS05(phiringsum[4]);
969 trgEcltrgArray[m_hitEneNum]->setPRS06(phiringsum[5]);
970 trgEcltrgArray[m_hitEneNum]->setPRS07(phiringsum[6]);
971 trgEcltrgArray[m_hitEneNum]->setPRS08(phiringsum[7]);
972 trgEcltrgArray[m_hitEneNum]->setPRS09(phiringsum[8]);
973 trgEcltrgArray[m_hitEneNum]->setPRS10(phiringsum[9]);
974 trgEcltrgArray[m_hitEneNum]->setPRS11(phiringsum[10]);
975 trgEcltrgArray[m_hitEneNum]->setPRS12(phiringsum[11]);
976 trgEcltrgArray[m_hitEneNum]->setPRS13(phiringsum[12]);
977 trgEcltrgArray[m_hitEneNum]->setPRS14(phiringsum[13]);
978 trgEcltrgArray[m_hitEneNum]->setPRS15(phiringsum[14]);
979 trgEcltrgArray[m_hitEneNum]->setPRS16(phiringsum[15]);
980 trgEcltrgArray[m_hitEneNum]->setPRS17(phiringsum[16]);
982 trgEcltrgArray[m_hitEneNum]->setEtot(E_phys);
983 trgEcltrgArray[m_hitEneNum]->setNofTCHit(noftchit);
985 trgEcltrgArray[m_hitEneNum]->setBhabha01(vct_bhabha[0]);
986 trgEcltrgArray[m_hitEneNum]->setBhabha02(vct_bhabha[1]);
987 trgEcltrgArray[m_hitEneNum]->setBhabha03(vct_bhabha[2]);
988 trgEcltrgArray[m_hitEneNum]->setBhabha04(vct_bhabha[3]);
989 trgEcltrgArray[m_hitEneNum]->setBhabha05(vct_bhabha[4]);
990 trgEcltrgArray[m_hitEneNum]->setBhabha06(vct_bhabha[5]);
991 trgEcltrgArray[m_hitEneNum]->setBhabha07(vct_bhabha[6]);
992 trgEcltrgArray[m_hitEneNum]->setBhabha08(vct_bhabha[7]);
993 trgEcltrgArray[m_hitEneNum]->setBhabha09(vct_bhabha[8]);
994 trgEcltrgArray[m_hitEneNum]->setBhabha10(vct_bhabha[9]);
995 trgEcltrgArray[m_hitEneNum]->setBhabha11(vct_bhabha[10]);
996 trgEcltrgArray[m_hitEneNum]->setBhabha12(vct_bhabha[11]);
997 trgEcltrgArray[m_hitEneNum]->setBhabha13(vct_bhabha[12]);
998 trgEcltrgArray[m_hitEneNum]->setBhabha14(vct_bhabha[13]);
999 trgEcltrgArray[m_hitEneNum]->setBhabha15(vct_bhabha[14]);
1000 trgEcltrgArray[m_hitEneNum]->setBhabha16(vct_bhabha[15]);
1001 trgEcltrgArray[m_hitEneNum]->setBhabha17(vct_bhabha[16]);
1002 trgEcltrgArray[m_hitEneNum]->setBhabha18(vct_bhabha[17]);
1004 trgEcltrgArray[m_hitEneNum]->setICN(icn);
1005 trgEcltrgArray[m_hitEneNum]->setICNFw(icnfwd);
1006 trgEcltrgArray[m_hitEneNum]->setICNBr(icnbr);
1007 trgEcltrgArray[m_hitEneNum]->setICNBw(icnbwd);
1009 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[0], 0);
1010 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[1], 1);
1011 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[2], 2);
1012 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[3], 3);
1014 trgEcltrgArray[m_hitEneNum]->setBhabhaVeto(bhabha2D);
1015 trgEcltrgArray[m_hitEneNum]->setBeamBkgVeto(beambkgtag);
1016 trgEcltrgArray[m_hitEneNum]->setEventTiming(eventtiming);
1018 trgEcltrgArray[m_hitEneNum]->setHit(hit);
1019 trgEcltrgArray[m_hitEneNum]->setRevoclk(RevoFAM);
1020 trgEcltrgArray[m_hitEneNum]->setTimingSource(TimingSource);
1021 trgEcltrgArray[m_hitEneNum]->setPhysics(physics) ;
1022 trgEcltrgArray[m_hitEneNum]->set2DBhabha(bhabha2D);
1023 trgEcltrgArray[m_hitEneNum]->set3DBhabha(bhabha3D_veto);
1024 trgEcltrgArray[m_hitEneNum]->set3DBhabhaSel(bhabha3D_sel);
1025 trgEcltrgArray[m_hitEneNum]->setmumuBit(mumu);
1026 trgEcltrgArray[m_hitEneNum]->setBhabhaPrescaleBit(bhabhaprescale);
1028 trgEcltrgArray[m_hitEneNum]->setELow(ELow) ;
1029 trgEcltrgArray[m_hitEneNum]->setEHihg(EHigh);
1030 trgEcltrgArray[m_hitEneNum]->setELum(ELum) ;
1031 trgEcltrgArray[m_hitEneNum]->setClusterOverflow(ClusterOverflow) ;
1054 trgEcltrgArray[m_hitEneNum]->setEventTimingQualityFlag(
m_obj_timing->getEventTimingQualityFlag());
1055 trgEcltrgArray[m_hitEneNum]->setEventTimingTCId(
m_obj_timing->getEventTimingTCId());
1056 trgEcltrgArray[m_hitEneNum]->setEventTimingTCThetaId(
m_obj_timing->getEventTimingTCThetaId());
1057 trgEcltrgArray[m_hitEneNum]->setEventTimingTCEnergy(
m_obj_timing->getEventTimingTCEnergy());
1059 trgEcltrgArray[m_hitEneNum]->setEtot1to17(E_total);
1060 trgEcltrgArray[m_hitEneNum]->setTaub2bFlag(taub2bFlag);
1065 trgEcltrgArray[m_hitEneNum]->setNofCluster1to17(NofCluster1to17);
1067 trgEcltrgArray[m_hitEneNum]->setDataClockWindowStartTime(WindowStart);
1076 std::vector<double> TCHit,
1077 std::vector<double>& phiringsum,
1078 std::vector<std::vector<double>>& thetaringsum)
1094 thetaringsum.resize(3, std::vector<double>(36, 0.));
1095 phiringsum.resize(17);
1096 const int size_hit = TCHit.size();
1097 for (
int iHit = 0; iHit < size_hit; iHit++) {
1098 int iTCId = TCId[iHit] - 1;
1099 if (TCHit[iHit] > 0) {
1102 phiringsum[iTCThetaId] += TCHit[iHit];
1103 if (iTCThetaId < 3) {
1105 if (iTCThetaId != 0) {
1106 thetaringsum[0][iTCPhiId] += TCHit[iHit];
1108 }
else if (iTCThetaId < 15) {
1110 thetaringsum[1][iTCPhiId] += TCHit[iHit];
1113 thetaringsum[2][iTCPhiId] += TCHit[iHit];
1126 double etot,
int bhabha2D,
int physics,
1127 std::vector<int> bhabhatype,
int ICN,
int BGVeto,
1128 int ClusterOverflow,
int bhabha3D,
int lowmultibit,
1129 int bhabha3D_sel,
int mumubit,
int prescale,
int burst,
1130 int EventTimingQualityFlag,
int bhabha3DVetoInTrackFlag,
1131 int bhabha3DSelectionThetaFlag,
1148 int Bhabhatype = bhabha2D;
1160 if (bhabhatype.size() > 14) {
1161 for (
int ibhabha = 0; ibhabha < 13; ibhabha++) {
1163 if (bhabhatype[ibhabha] == 1) {type = 0x01;}
1171 int bit_hit = hit & 0x01;
1172 int bit_Timing = (Timing & 0x7F) ;
1173 int bit_RevoFAM = (RevoFAM & 0x7F) ;
1174 int bit_TimingSource = (TimingSource & 0x07) ;
1175 int bit_physics = (physics & 0x01) ;
1176 int bit_2Dbhabha = (bhabhaveto & 0x01) ;
1177 int bit_bhabhatype = (Bhabhatype & 0x3FFF);
1178 int bit_etot = (((int)etot) & 0x1FFF) ;
1179 int bit_elow = (elow & 0x01);
1180 int bit_ehigh = (ehigh & 0x01) ;
1181 int bit_elum = (elum & 0x01) ;
1182 int bit_ICN = (ICN & 0x7F) ;
1183 int bit_BGVeto = (BGVeto & 0x07) ;
1184 int bit_ClusterOverflow = (ClusterOverflow & 0x01);
1185 int bit_3Dbhabha = (bhabha3D & 0x01);
1187 int bit_lowmulti1 = lowmultibit & 0x0FFF;
1188 int bit_lowmulti2 = (lowmultibit >>= 12) & 0x3;
1189 int bit_3DBhabha_sel = bhabha3D_sel & 0x01;
1190 int bit_mumu = mumubit & 0x01;
1191 int bit_prescale = prescale & 0x01;
1192 int bit_burst = burst & 0x01;
1194 int bit_eventtimingqualityflag = EventTimingQualityFlag & 0x03;
1195 int bit_bhabha3dvetointrackflag = 0;
1196 if (bhabha3D == 1) {
1197 bit_bhabha3dvetointrackflag = bhabha3DVetoInTrackFlag & 0x01;
1199 int bit_bhabha3dselectionthetaflag = 0;
1200 if (bhabha3D_sel == 1) {
1201 bit_bhabha3dselectionthetaflag = bhabha3DSelectionThetaFlag & 0x03;
1203 int bit_taub2bflag = taub2bFlag & 0x01;
1204 int bit_taub2b2flag = taub2b2Flag & 0x01;
1205 int bit_taub2b3flag = taub2b3Flag & 0x01;
1207 int bit_hie_bhav_hie123 = bit_hie_bhav & 0x7;
1208 int bit_hie_bhav_hie4 = (bit_hie_bhav >> 3) & 0x1;
1282 std::vector<double> clusterenergy)
1304 int _nClust = CenterTCId.size();
1308 int _n2GeV231516 = 0;
1313 int _n500MeV216 = 0;
1314 int _n500MeV611 = 0;
1315 for (
int ic = 0; ic < _nClust; ic++) {
1316 if (clusterenergy[ic] > 0.3) {_n300MeV++;}
1319 int thresh = 15 & lut;
1320 if (thetaid >= 2 && thetaid <= 16) {_nClust216++;}
1321 if (thetaid >= 6 && thetaid <= 11) {
1322 if (clusterenergy[ic] * 100 > 5 * thresh) {
1327 if (clusterenergy[ic] > 0.5 && thetaid >= 2 && thetaid <= 16) {_n500MeV216++;}
1330 if (thetaid >= 4 && thetaid <= 14) {_n2GeV414++;}
1331 if (thetaid == 2 || thetaid == 3 || thetaid == 15 || thetaid == 16) {_n2GeV231516++;}
1332 if (thetaid == 1 || thetaid == 17) {_n2GeV117++;}
1335 if (thetaid >= 4 && thetaid <= 15) {_n1GeV415++;}
1336 if (thetaid == 2 || thetaid == 3 || thetaid == 16) {_n1GeV2316++;}
1343 int _nPhiPairHigh = 0;
1344 int _nPhiPairLow = 0;
1346 int _nECLBhabha = 0;
1347 for (
int i0 = 0; i0 < _nClust - 1; i0++) {
1348 for (
int i1 = i0 + 1; i1 < _nClust; i1++) {
1352 int energy1 = 15 & lut1;
1353 int energy2 = 15 & lut2;
1356 int phi1 = 511 & lut1;
1357 int phi2 = 511 & lut2;
1364 int dphi = abs(phi1 - phi2);
1365 if (dphi > 180) {dphi = 360 - dphi;}
1366 int thetaSum = theta1 + theta2;
1379 if (dphi > 160. && thetaSum > 160. && thetaSum < 200) {_n3DPair++;}
1412 if (_n2GeV414 > 0) {
1415 if (_n2GeV231516 && _nECLBhabha == 0) {
1418 if (_n2GeV231516 && _nECLBhabha != 0) {
1421 if (_n2GeV117 && _nECLBhabha == 0) {
1424 if (_n2GeV117 && _nECLBhabha != 0) {
1427 if (_n1GeV415 == 1 && _n300MeV == 1) {
1430 if (_n1GeV2316 == 1 && _n300MeV == 1) {
1433 if (_nPhiPairHigh > 0 && _n2GeV == 0) {
1436 if (_nPhiPairLow > 0 && _n2GeV == 0) {
1439 if (_n3DPair > 0 && _n2GeV == 0) {
1445 if (_nClust216 >= 3 && _n500MeV216 > 0 && _nECLBhabha == 0) {
1448 if (_n500MeV611 == 1 && _n300MeV == 1) {
1490 for (
int iii = 0; iii <= 16; iii++) {
1491 if (iii > 0 && iii < 15) {E_phys += phisum[iii];}
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
double getTimeAve() const
The method to get hit average time.
double getPositionZ() const
Get Energy weighted position Z.
int getMaxThetaId()
The method to set Theta Id of maximum TC in Cluster.
double getEnergyDep() const
The method to get deposited energy.
double getPositionX() const
The method to get hit average time Get Energy weighted position X.
double getPositionY() const
Get Energy weighted position Y.
int getMaxTCId() const
The method to get the Maximum(center) TC id.
double getTimeAve() const
The method to get hit average time.
double getEnergyDep() const
The method to get deposited energy.
int getBeamBkgTag() const
The method to get Beam Background tag.
int getTCId() const
The method to get TC id.
A Class of ECL Trigger clustering
A Class of ECL Trigger clustering
int getTaub2bAngleFlag(void)
get taub2b 2 cluster angle cut flag
bool GetBhabha00(std::vector< double >)
Belle 2D Bhabha veto method.
bool Getmumu()
MuMu selection for calibration.
int getTaub2bEtotFlag(void)
get total energy(TC theta id=1-17) flag for taub2b
std::vector< double > GetBhabhaComb()
Output 2D Bhabha combination.
double get3DBhabhaVetoClusterTiming(int cl_idx)
get each cluster timing of two clusters of 3D Bhabha veto (ns)
int GetBhabhaAddition(void)
Additional Bhabha veto.
void set3DBhabhaAddAngleCut(const std::vector< double > &i3DBhabhaAddAngleCut)
set 3D Bhabha addtion Angle selection
double get3DBhabhaSelectionClusterEnergy(int cl_idx)
get each cluster energy of two clusters of 3D Bhabha selection (GeV)
int get3DBhabhaSelectionThetaFlag(void)
get trigger bit(2bits) of flag which shows theta position of clusters of 3DBhabha Selection.
void setTaub2bAngleCut(const std::vector< int > &iTaub2bAngleCut)
set 2 Cluster angle selection for tau 1x1 decay [0], [1] for low and high of dphi,...
double get3DBhabhaSelectionClusterTiming(int cl_idx)
get each cluster timing of two clusters of 3D Bhabha selection (ns)
void setTaub2bClusterECut(const double iTaub2bClusterECut1, const double iTaub2bClusterECut2)
set cluster energy cut for taub2b
int get3DBhabhaSelectionClusterThetaId(int cl_idx)
get each TC theta ID(most energetic TC in a cluster) of two clusters of 3D Bhabha selection
void setmumuThreshold(int mumuThreshold)
set mumu bit Threshold
void set2DBhabhaThreshold(const std::vector< double > &i2DBhabhaThresholdFWD, const std::vector< double > &i2DBhabhaThresholdBWD)
set 2D Bhabha Energy Threshold
int get3DBhabhaVetoClusterThetaId(int cl_idx)
get each TC theta ID(most energetic TC in a cluster) of two clusters of 3D Bhabha veto
int getTaub2bClusterEFlag(void)
taub2b Cluster energy flag
void set3DBhabhaVetoAngle(const std::vector< double > &i3DBhabhaVetoAngle)
set 3D veto Bhabha Energy Angle
void setTaub2b2Cut(const std::vector< int > &iTaub2b2AngleCut, const double iTaub2b2EtotCut, const double iTaub2b2CLEEndcapCut, const double iTaub2b2CLECut)
set taub2b2 cut
bool GetBhabha02()
Belle II 3D Bhabha method for selection.
void set3DBhabhaSelectionAngle(const std::vector< double > &i3DBhabhaSelectionAngle)
set 3D selection Bhabha Energy Angle
void set3DBhabhaSelectionThreshold(const std::vector< double > &i3DBhabhaSelectionThreshold)
set 3D selection Bhabha Energy Threshold
double get3DBhabhaVetoClusterEnergy(int cl_idx)
get each cluster energy of two clusters of 3D Bhabha veto (GeV)
void setTaub2bEtotCut(const double iTaub2bEtotCut)
set total energy cut for taub2b
int get3DBhabhaVetoInTrackFlag(void)
get trigger bit of flag(1bit) whether two clusters statisfy 3D Bhabha veto are in CDCTRG region in th...
bool GetTaub2b3(double)
Taub2b3.
bool GetTaub2b(double)
Taub2b selection.
bool GetBhabha01()
Belle II 3D Bhabha method for veto.
int get3DBhabhaVetoClusterTCId(int cl_idx)
get each TCID(most energetic TC in a cluster) of two clusters of 3D Bhabha veto
void set3DBhabhaVetoInTrackThetaRegion(const std::vector< int > &i3DBhabhaVetoInTrackThetaRegion)
set ThetaID (low and high) for 3DBhabhaVetoInTrack
void set3DBhabhaVetoThreshold(const std::vector< double > &i3DBhabhaVetoThreshold)
set 3D veto Bhabha Energy Threshold
void setmumuAngle(const std::vector< double > &imumuAngle)
set mumu bit Angle selection
void setTaub2b3Cut(const std::vector< int > &iTaub2b3AngleCut, const double iTaub2b3EtotCut, const double iTaub2b3CLEb2bCut, const double iTaub2b3CLELowCut, const double iTaub2b3CLEHighCut)
set taub2b3 cut
int get3DBhabhaSelectionClusterTCId(int cl_idx)
get each TCID(most energetic TC in a cluster) of two clusters of 3D Bhabha selection
bool GetTaub2b2(double)
Taub2b selection (tighter selection than Taub2b)
A Class of ECL Trigger clustering
void setICN(const std::vector< int > &)
set ICN for each part(Fw,Br,Bw)
int getICNSub(int)
get ICN in each region(Fw(0), Br(1), Bw(2))
int getICNFwBr(void)
get ICN in Barrel and Forward
int getNofExceedCluster()
get # Cluster in case of exceeding limit
void setClusterLimit(int limit)
Set Limit of Cluster.
int getNofCluster()
0 : center , 1; upper , 2: right , 3: lower , 4: lower right
void setClusteringMethod(int method)
Set.
void setEventId(int eventId)
Set EventId.
int Get3DBhabhaLUT(int)
TC CM Phi
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
int getTCPhiIdFromTCId(int)
get [TC Phi ID] from [TC ID]
double m_taub2b3CLELowCut
taub2b3 cluster energy low cut in lab for all clusters (GeV)
double m_taub2bEtotCut
tau b2b total energy (TC theta ID =1-17) (GeV)
double m_taub2b3CLEHighCut
taub2b3 cluster energy high cut in lab for all clusters (GeV)
TrgEclDataBase * m_obj_database
Beam Backgroud veto object.
std::vector< double > m_LowMultiThreshold
Low Multiplicity Threshold.
std::vector< double > m_2DBhabhaThresholdBWD
2D Bhabha Energy Threshold
double m_ECLBurstThreshold
ECL Burst Bit Threshold.
std::vector< double > m_mumuAngle
mumu bit Angle
int m_Clustering
clutering option
std::vector< int > m_HitTCId
Hit TC Energy in time window.
std::vector< double > m_EventTimingQualityThresholds
energy threshold(low, high) for quality flag (GeV)
std::vector< double > m_TotalEnergy
Total Energy Theshold (low, high, lum)
std::vector< int > m_taub2bAngleCut
tau b2b 2 cluster angle cut (degree) (dphi low, dphi high, theta_sum low, theta_sum high)
int m_ClusterLimit
The limit number of Cluster.
std::vector< double > m_TCHitTiming
Hit TC Timing in time window.
void simulate02(int)
simulates ECL trigger for Data Analysis
std::vector< std::vector< double > > m_TCTiming
Hit TC Timing.
std::vector< int > m_3DBhabhaVetoInTrackThetaRegion
Theta region (low, high) of 3D Bhabha Veto InTrack.
int m_PrescaleCounter
Bhabha Prescale Countor.
std::string version(void) const
returns version.
int m_EventTiming
EventTiming option.
void initialize(int)
initialize
double setTotalEnergy(std::vector< double >)
Set Total Energy.
void setRS(std::vector< int >, std::vector< double >, std::vector< double > &, std::vector< std::vector< double >> &)
ECL bit information for GDL.
void makeLowMultiTriggerBit(std::vector< int >, std::vector< double >)
make LowMultiTriggerBit
double m_OverlapWindow
TRG Decision overlap window.
std::vector< std::vector< int > > m_TCBeamBkgTag
Hit TC Beam Background tag.
int m_n300MeVCluster
The number of Cluster exceeding 300 MeV.
int m_Triggerbit[4]
ECL Trigger bit.
std::vector< double > m_3DBhabhaSelectionAngle
3D Selection Bhabha Energy Angle
std::vector< double > m_3DBhabhaVetoThreshold
3D Veto Bhabha Energy Threshold
std::vector< double > m_3DBhabhaAddAngleCut
Angle selection of additional Bhabha addition in CM frame.
double m_taub2b2EtotCut
taub2b2 total energy (TC theta ID =1-17) (GeV)
TrgEclMapping * m_obj_map
Mapping object.
std::vector< double > m_TCHitEnergy
Hit TC Energy in time window.
int m_Lowmultibit
Low Multiplicity bit.
std::vector< double > m_3DBhabhaVetoAngle
3D Veto Bhabha Energy Angle
std::vector< double > m_3DBhabhaSelectionThreshold
3D Selection Bhabha Energy Threshold
TrgEclBhabha * m_obj_bhabha
Bhabha object.
double m_mumuThreshold
mumu bit Energy Threshold
int m_PrescaleFactor
Bhabha Prescale Factor.
double m_taub2bClusterECut2
taub2b one Cluster energy selection (GeV)
std::string name(void) const
returns name.
std::vector< int > m_taub2b2AngleCut
taub2b2 angle selection(degree) (3,2,1,0) = (dphi low, dphi high, theta_sum low, theta_sum high)
double m_taub2b3EtotCut
taub2b3 total energy (TC theta ID =1-17) (GeV)
std::vector< int > m_TCHitBeamBkgTag
Hit TC Beam Background tag in time window.
double m_taub2b3CLEb2bCut
taub2b3 cluster energy cut in lab for one of b2b clusters (GeV)
void simulate01(int)
simulates ECL trigger for Global Cosmic data
TrgEclBeamBKG * m_obj_beambkg
Beam Backgroud veto object.
double m_taub2bClusterECut1
taub2b one Cluster energy selection (GeV)
void makeTriggerBit(int, int, int, int, double, int, int, std::vector< int >, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)
make Trigger bit except for Low Multiplicity related bit
TrgEclCluster * m_obj_cluster
Cluster object.
virtual ~TrgEclMaster()
TrgEclMaster Destructor.
std::vector< double > m_2DBhabhaThresholdFWD
2D Bhabha Energy Threshold
std::vector< std::vector< double > > m_TCEnergy
Hit TC Energy.
TrgEclTiming * m_obj_timing
EventTiming object.
double m_taub2b2CLECut
taub2b2 cluseter energy cut (GeV)
double m_taub2b2CLEEndcapCut
taub2b2 cluster energy cut for endcap cluster (GeV)
std::vector< int > m_taub2b3AngleCut
taub2b3 selection cuts (3,2,1,0) = (dphi low, dphi high, theta_sum low, theta_sum high)
double m_TimeWindow
Hit TC Energy in time window.
A Class of ECL Trigger clustering
void Setup(const std::vector< int > &, const std::vector< double > &, const std::vector< double > &)
SetUp.
void SetNofTopTC(int NtopTC)
Set # of considered TC in Energy weighted timing method.
double GetEventTiming(int)
Get Evnet-timing.
int GetTimingSource()
Get Timing Source.
Abstract base class for different kinds of events.