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"
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 ClusterTiming.push_back(clustertiming);
361 ClusterEnergy.push_back(clusterenergy);
362 MaxTCId.push_back(maxTCId);
393 std::vector<double> vct_bhabha;
396 int bhabha3D_veto = 0 ;
397 int bhabha3D_sel = 0;
399 int bhabha3DVetoInTrackFlag = 0;
400 int bhabha3DSelectionThetaFlag = 0;
407 if (b_2Dbhabha && (icn < 4)) {bhabha2D = 1;}
409 if (b_3Dbhabha) {bhabha3D_veto = 1;}
411 if (b_3Dbhabha_sel) {bhabha3D_sel = 1;}
413 if (b_mumu) {mumu = 1;}
426 int bhabhaprescale = 0;
437 int Timing = (int)(eventtiming + 0.5);
440 int etot = (int)(E_phys * 1000 + 0.5);
442 if ((etot > 1000 || icn > 3) && !(bhabha2D == 1)) {physics = 1;}
443 std::vector<int> bhabhabit;
445 int bhabhabitsize = vct_bhabha.size();
446 for (
int ibhabha = 0; ibhabha < bhabhabitsize; ibhabha++) {
447 bhabhabit.push_back((
int)vct_bhabha[ibhabha]);
450 int flagoverflow = 0;
451 if (ClusterOverflow > 0) {
456 bhabha2D, physics, bhabhabit, icn, beambkgtag,
458 bhabha3D_sel, mumu, bhabhaprescale, E_burst,
459 EventTimingQualityFlag,
460 bhabha3DVetoInTrackFlag,
461 bhabha3DSelectionThetaFlag,
462 taub2bFlag, 0, taub2b2Flag, taub2b3Flag);
467 m_hitEneNum = trgEcltrgArray.
getEntries() - 1;
471 trgEcltrgArray[m_hitEneNum]->setEventId(m_nEvent);
472 trgEcltrgArray[m_hitEneNum]->setPRS01(phiringsum[0]);
473 trgEcltrgArray[m_hitEneNum]->setPRS02(phiringsum[1]);
474 trgEcltrgArray[m_hitEneNum]->setPRS03(phiringsum[2]);
475 trgEcltrgArray[m_hitEneNum]->setPRS04(phiringsum[3]);
476 trgEcltrgArray[m_hitEneNum]->setPRS05(phiringsum[4]);
477 trgEcltrgArray[m_hitEneNum]->setPRS06(phiringsum[5]);
478 trgEcltrgArray[m_hitEneNum]->setPRS07(phiringsum[6]);
479 trgEcltrgArray[m_hitEneNum]->setPRS08(phiringsum[7]);
480 trgEcltrgArray[m_hitEneNum]->setPRS09(phiringsum[8]);
481 trgEcltrgArray[m_hitEneNum]->setPRS10(phiringsum[9]);
482 trgEcltrgArray[m_hitEneNum]->setPRS11(phiringsum[10]);
483 trgEcltrgArray[m_hitEneNum]->setPRS12(phiringsum[11]);
484 trgEcltrgArray[m_hitEneNum]->setPRS13(phiringsum[12]);
485 trgEcltrgArray[m_hitEneNum]->setPRS14(phiringsum[13]);
486 trgEcltrgArray[m_hitEneNum]->setPRS15(phiringsum[14]);
487 trgEcltrgArray[m_hitEneNum]->setPRS16(phiringsum[15]);
488 trgEcltrgArray[m_hitEneNum]->setPRS17(phiringsum[16]);
490 trgEcltrgArray[m_hitEneNum]->setEtot(E_phys);
491 trgEcltrgArray[m_hitEneNum]->setNofTCHit(noftchit);
493 trgEcltrgArray[m_hitEneNum]->setBhabha01(vct_bhabha[0]);
494 trgEcltrgArray[m_hitEneNum]->setBhabha02(vct_bhabha[1]);
495 trgEcltrgArray[m_hitEneNum]->setBhabha03(vct_bhabha[2]);
496 trgEcltrgArray[m_hitEneNum]->setBhabha04(vct_bhabha[3]);
497 trgEcltrgArray[m_hitEneNum]->setBhabha05(vct_bhabha[4]);
498 trgEcltrgArray[m_hitEneNum]->setBhabha06(vct_bhabha[5]);
499 trgEcltrgArray[m_hitEneNum]->setBhabha07(vct_bhabha[6]);
500 trgEcltrgArray[m_hitEneNum]->setBhabha08(vct_bhabha[7]);
501 trgEcltrgArray[m_hitEneNum]->setBhabha09(vct_bhabha[8]);
502 trgEcltrgArray[m_hitEneNum]->setBhabha10(vct_bhabha[9]);
503 trgEcltrgArray[m_hitEneNum]->setBhabha11(vct_bhabha[10]);
504 trgEcltrgArray[m_hitEneNum]->setBhabha12(vct_bhabha[11]);
505 trgEcltrgArray[m_hitEneNum]->setBhabha13(vct_bhabha[12]);
506 trgEcltrgArray[m_hitEneNum]->setBhabha14(vct_bhabha[13]);
507 trgEcltrgArray[m_hitEneNum]->setBhabha15(vct_bhabha[14]);
508 trgEcltrgArray[m_hitEneNum]->setBhabha16(vct_bhabha[15]);
509 trgEcltrgArray[m_hitEneNum]->setBhabha17(vct_bhabha[16]);
510 trgEcltrgArray[m_hitEneNum]->setBhabha18(vct_bhabha[17]);
512 trgEcltrgArray[m_hitEneNum]->setICN(icn);
513 trgEcltrgArray[m_hitEneNum]->setICNFw(icnfwd);
514 trgEcltrgArray[m_hitEneNum]->setICNBr(icnbr);
515 trgEcltrgArray[m_hitEneNum]->setICNBw(icnbwd);
517 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[0], 0);
518 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[1], 1);
519 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[2], 2);
520 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[3], 3);
522 trgEcltrgArray[m_hitEneNum]->setBhabhaVeto(bhabha2D);
523 trgEcltrgArray[m_hitEneNum]->setBeamBkgVeto(beambkgtag);
524 trgEcltrgArray[m_hitEneNum]->setEventTiming(eventtiming);
526 trgEcltrgArray[m_hitEneNum]->setHit(hit);
527 trgEcltrgArray[m_hitEneNum]->setRevoclk(RevoFAM);
528 trgEcltrgArray[m_hitEneNum]->setTimingSource(TimingSource);
529 trgEcltrgArray[m_hitEneNum]->setPhysics(physics) ;
530 trgEcltrgArray[m_hitEneNum]->set2DBhabha(bhabha2D);
531 trgEcltrgArray[m_hitEneNum]->set3DBhabha(bhabha3D_veto);
532 trgEcltrgArray[m_hitEneNum]->set3DBhabhaSel(bhabha3D_sel);
533 trgEcltrgArray[m_hitEneNum]->setmumuBit(mumu);
534 trgEcltrgArray[m_hitEneNum]->setBhabhaPrescaleBit(bhabhaprescale);
536 trgEcltrgArray[m_hitEneNum]->setELow(ELow) ;
537 trgEcltrgArray[m_hitEneNum]->setEHihg(EHigh);
538 trgEcltrgArray[m_hitEneNum]->setELum(ELum) ;
539 trgEcltrgArray[m_hitEneNum]->setClusterOverflow(ClusterOverflow) ;
576 for (
int ii = 0; ii < trgeclHitArray.
getEntries(); ii++) {
578 TRGECLHit* aTRGECLHit = trgeclHitArray[ii];
579 int iTCID = (aTRGECLHit->
getTCId() - 1);
591 double WindowStart = 0;
592 double WindowEnd = 0;
593 double fluctuation = ((gRandom->Uniform(-1, 0))) * 125;
595 int startBin = nBin / 2 - 1;
597 int endBin = nBin / 2 + 1;
607 for (
int iBin = startBin ; iBin <= endBin; iBin ++) {
610 if (iBin == 0) {WindowStart = - 4000 + fluctuation;}
615 for (
int iTCId = 0; iTCId < 576; iTCId++) {
617 for (
int ihit = 0; ihit < hitsize; ihit++) {
624 if (totalE == 0) {
continue;}
632 if (max_bin == 0) {WindowStart = - 4000 + fluctuation;}
641 for (
int iTCId = 0; iTCId < 576; iTCId++) {
643 for (
int ihit = 0; ihit < hitsize; ihit++) {
655 if (noftchit == 0) {
return;}
657 double eventtiming = 0;
666 int EventTimingQualityFlag =
m_obj_timing->getEventTimingQualityFlag();
670 std::vector<std::vector<double>> thetaringsum;
671 std::vector<double> phiringsum;
673 thetaringsum.clear();
675 thetaringsum.resize(3, std::vector<double>(36, 0));
676 phiringsum.resize(17, 0);
686 for (
int iii = 0; iii <= 16; iii++) {
687 if (iii > 0 && iii < 15) {E_phys += phiringsum[iii];}
691 E_total += phiringsum[iii];
694 if (E_total == 0) {
return;}
695 int ELow = 0, EHigh = 0, ELum = 0;
729 std::vector<double> ClusterTiming;
730 std::vector<double> ClusterEnergy;
731 std::vector<int> MaxTCId;
732 std::vector<int> MaxThetaId;
733 ClusterTiming.clear();
734 ClusterEnergy.clear();
738 for (
int ii = 0; ii < trgeclClusterArray.
getEntries(); ii++) {
743 double clustertiming = aTRGECLCluster->
getTimeAve();
744 ClusterTiming.push_back(clustertiming);
745 ClusterEnergy.push_back(clusterenergy);
746 MaxTCId.push_back(maxTCId);
747 MaxThetaId.push_back(maxThetaId);
780 std::vector<double> vct_bhabha;
783 int bhabha3D_veto = 0 ;
784 int bhabha3D_sel = 0;
786 int bhabha3DVetoInTrackFlag = -1;
787 int bhabha3DSelectionThetaFlag = -1;
794 if (b_2Dbhabha && (icn < 4)) {bhabha2D = 1;}
796 if (b_3Dbhabha) {bhabha3D_veto = 1;}
798 if (b_3Dbhabha_sel) {bhabha3D_sel = 1;}
800 if (b_mumu) {mumu = 1;}
801 int bhabhaprescale = 0;
824 int bit_hie_bhav = 0;
826 bit_hie_bhav |= (~bhabha_addition & 0x01) & (~bhabha_addition >> 4 & 0x01);
828 bit_hie_bhav |= (~bhabha_addition & 0x01) & (~bhabha_addition >> 3 & 0x01);
830 bit_hie_bhav |= (~bhabha_addition & 0x01) & (~bhabha_addition >> 2 & 0x01);
832 bit_hie_bhav |= (~bhabha_addition & 0x01) & (~bhabha_addition >> 1 & 0x01);
838 int Timing = (int)(eventtiming + 0.5);
841 int etot = (int)(E_phys * 1000 + 0.5);
845 if ((etot > 1000 || icn > 3) && !(bhabha2D == 1)) {physics = 1;}
846 std::vector<int> bhabhabit;
848 int bhabhabitsize = vct_bhabha.size();
849 for (
int ibhabha = 0; ibhabha < bhabhabitsize; ibhabha++) {
850 bhabhabit.push_back((
int)vct_bhabha[ibhabha]);
853 int flagoverflow = 0;
854 if (ClusterOverflow > 0) {
859 physics, bhabhabit, icn, beambkgtag, flagoverflow,
861 bhabhaprescale, E_burst,
862 EventTimingQualityFlag,
863 bhabha3DVetoInTrackFlag,
864 bhabha3DSelectionThetaFlag,
953 m_hitEneNum = trgEcltrgArray.
getEntries() - 1;
957 trgEcltrgArray[m_hitEneNum]->setEventId(m_nEvent);
958 trgEcltrgArray[m_hitEneNum]->setPRS01(phiringsum[0]);
959 trgEcltrgArray[m_hitEneNum]->setPRS02(phiringsum[1]);
960 trgEcltrgArray[m_hitEneNum]->setPRS03(phiringsum[2]);
961 trgEcltrgArray[m_hitEneNum]->setPRS04(phiringsum[3]);
962 trgEcltrgArray[m_hitEneNum]->setPRS05(phiringsum[4]);
963 trgEcltrgArray[m_hitEneNum]->setPRS06(phiringsum[5]);
964 trgEcltrgArray[m_hitEneNum]->setPRS07(phiringsum[6]);
965 trgEcltrgArray[m_hitEneNum]->setPRS08(phiringsum[7]);
966 trgEcltrgArray[m_hitEneNum]->setPRS09(phiringsum[8]);
967 trgEcltrgArray[m_hitEneNum]->setPRS10(phiringsum[9]);
968 trgEcltrgArray[m_hitEneNum]->setPRS11(phiringsum[10]);
969 trgEcltrgArray[m_hitEneNum]->setPRS12(phiringsum[11]);
970 trgEcltrgArray[m_hitEneNum]->setPRS13(phiringsum[12]);
971 trgEcltrgArray[m_hitEneNum]->setPRS14(phiringsum[13]);
972 trgEcltrgArray[m_hitEneNum]->setPRS15(phiringsum[14]);
973 trgEcltrgArray[m_hitEneNum]->setPRS16(phiringsum[15]);
974 trgEcltrgArray[m_hitEneNum]->setPRS17(phiringsum[16]);
976 trgEcltrgArray[m_hitEneNum]->setEtot(E_phys);
977 trgEcltrgArray[m_hitEneNum]->setNofTCHit(noftchit);
979 trgEcltrgArray[m_hitEneNum]->setBhabha01(vct_bhabha[0]);
980 trgEcltrgArray[m_hitEneNum]->setBhabha02(vct_bhabha[1]);
981 trgEcltrgArray[m_hitEneNum]->setBhabha03(vct_bhabha[2]);
982 trgEcltrgArray[m_hitEneNum]->setBhabha04(vct_bhabha[3]);
983 trgEcltrgArray[m_hitEneNum]->setBhabha05(vct_bhabha[4]);
984 trgEcltrgArray[m_hitEneNum]->setBhabha06(vct_bhabha[5]);
985 trgEcltrgArray[m_hitEneNum]->setBhabha07(vct_bhabha[6]);
986 trgEcltrgArray[m_hitEneNum]->setBhabha08(vct_bhabha[7]);
987 trgEcltrgArray[m_hitEneNum]->setBhabha09(vct_bhabha[8]);
988 trgEcltrgArray[m_hitEneNum]->setBhabha10(vct_bhabha[9]);
989 trgEcltrgArray[m_hitEneNum]->setBhabha11(vct_bhabha[10]);
990 trgEcltrgArray[m_hitEneNum]->setBhabha12(vct_bhabha[11]);
991 trgEcltrgArray[m_hitEneNum]->setBhabha13(vct_bhabha[12]);
992 trgEcltrgArray[m_hitEneNum]->setBhabha14(vct_bhabha[13]);
993 trgEcltrgArray[m_hitEneNum]->setBhabha15(vct_bhabha[14]);
994 trgEcltrgArray[m_hitEneNum]->setBhabha16(vct_bhabha[15]);
995 trgEcltrgArray[m_hitEneNum]->setBhabha17(vct_bhabha[16]);
996 trgEcltrgArray[m_hitEneNum]->setBhabha18(vct_bhabha[17]);
998 trgEcltrgArray[m_hitEneNum]->setICN(icn);
999 trgEcltrgArray[m_hitEneNum]->setICNFw(icnfwd);
1000 trgEcltrgArray[m_hitEneNum]->setICNBr(icnbr);
1001 trgEcltrgArray[m_hitEneNum]->setICNBw(icnbwd);
1003 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[0], 0);
1004 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[1], 1);
1005 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[2], 2);
1006 trgEcltrgArray[m_hitEneNum]->setECLtoGDL(
m_Triggerbit[3], 3);
1008 trgEcltrgArray[m_hitEneNum]->setBhabhaVeto(bhabha2D);
1009 trgEcltrgArray[m_hitEneNum]->setBeamBkgVeto(beambkgtag);
1010 trgEcltrgArray[m_hitEneNum]->setEventTiming(eventtiming);
1012 trgEcltrgArray[m_hitEneNum]->setHit(hit);
1013 trgEcltrgArray[m_hitEneNum]->setRevoclk(RevoFAM);
1014 trgEcltrgArray[m_hitEneNum]->setTimingSource(TimingSource);
1015 trgEcltrgArray[m_hitEneNum]->setPhysics(physics) ;
1016 trgEcltrgArray[m_hitEneNum]->set2DBhabha(bhabha2D);
1017 trgEcltrgArray[m_hitEneNum]->set3DBhabha(bhabha3D_veto);
1018 trgEcltrgArray[m_hitEneNum]->set3DBhabhaSel(bhabha3D_sel);
1019 trgEcltrgArray[m_hitEneNum]->setmumuBit(mumu);
1020 trgEcltrgArray[m_hitEneNum]->setBhabhaPrescaleBit(bhabhaprescale);
1022 trgEcltrgArray[m_hitEneNum]->setELow(ELow) ;
1023 trgEcltrgArray[m_hitEneNum]->setEHihg(EHigh);
1024 trgEcltrgArray[m_hitEneNum]->setELum(ELum) ;
1025 trgEcltrgArray[m_hitEneNum]->setClusterOverflow(ClusterOverflow) ;
1048 trgEcltrgArray[m_hitEneNum]->setEventTimingQualityFlag(
m_obj_timing->getEventTimingQualityFlag());
1049 trgEcltrgArray[m_hitEneNum]->setEventTimingTCId(
m_obj_timing->getEventTimingTCId());
1050 trgEcltrgArray[m_hitEneNum]->setEventTimingTCThetaId(
m_obj_timing->getEventTimingTCThetaId());
1051 trgEcltrgArray[m_hitEneNum]->setEventTimingTCEnergy(
m_obj_timing->getEventTimingTCEnergy());
1053 trgEcltrgArray[m_hitEneNum]->setEtot1to17(E_total);
1054 trgEcltrgArray[m_hitEneNum]->setTaub2bFlag(taub2bFlag);
1059 trgEcltrgArray[m_hitEneNum]->setNofCluster1to17(NofCluster1to17);
1061 trgEcltrgArray[m_hitEneNum]->setDataClockWindowStartTime(WindowStart);
1070 std::vector<double> TCHit,
1071 std::vector<double>& phiringsum,
1072 std::vector<std::vector<double>>& thetaringsum)
1088 thetaringsum.resize(3, std::vector<double>(36, 0.));
1089 phiringsum.resize(17);
1090 const int size_hit = TCHit.size();
1091 for (
int iHit = 0; iHit < size_hit; iHit++) {
1092 int iTCId = TCId[iHit] - 1;
1093 if (TCHit[iHit] > 0) {
1096 phiringsum[iTCThetaId] += TCHit[iHit];
1097 if (iTCThetaId < 3) {
1099 if (iTCThetaId != 0) {
1100 thetaringsum[0][iTCPhiId] += TCHit[iHit];
1102 }
else if (iTCThetaId < 15) {
1104 thetaringsum[1][iTCPhiId] += TCHit[iHit];
1107 thetaringsum[2][iTCPhiId] += TCHit[iHit];
1120 double etot,
int bhabha2D,
int physics,
1121 std::vector<int> bhabhatype,
int ICN,
int BGVeto,
1122 int ClusterOverflow,
int bhabha3D,
int lowmultibit,
1123 int bhabha3D_sel,
int mumubit,
int prescale,
int burst,
1124 int EventTimingQualityFlag,
int bhabha3DVetoInTrackFlag,
1125 int bhabha3DSelectionThetaFlag,
1142 int Bhabhatype = bhabha2D;
1154 if (bhabhatype.size() > 14) {
1155 for (
int ibhabha = 0; ibhabha < 13; ibhabha++) {
1157 if (bhabhatype[ibhabha] == 1) {type = 0x01;}
1165 int bit_hit = hit & 0x01;
1166 int bit_Timing = (Timing & 0x7F) ;
1167 int bit_RevoFAM = (RevoFAM & 0x7F) ;
1168 int bit_TimingSource = (TimingSource & 0x07) ;
1169 int bit_physics = (physics & 0x01) ;
1170 int bit_2Dbhabha = (bhabhaveto & 0x01) ;
1171 int bit_bhabhatype = (Bhabhatype & 0x3FFF);
1172 int bit_etot = (((int)etot) & 0x1FFF) ;
1173 int bit_elow = (elow & 0x01);
1174 int bit_ehigh = (ehigh & 0x01) ;
1175 int bit_elum = (elum & 0x01) ;
1176 int bit_ICN = (ICN & 0x7F) ;
1177 int bit_BGVeto = (BGVeto & 0x07) ;
1178 int bit_ClusterOverflow = (ClusterOverflow & 0x01);
1179 int bit_3Dbhabha = (bhabha3D & 0x01);
1181 int bit_lowmulti1 = lowmultibit & 0x0FFF;
1182 int bit_lowmulti2 = (lowmultibit >>= 12) & 0x3;
1183 int bit_3DBhabha_sel = bhabha3D_sel & 0x01;
1184 int bit_mumu = mumubit & 0x01;
1185 int bit_prescale = prescale & 0x01;
1186 int bit_burst = burst & 0x01;
1188 int bit_eventtimingqualityflag = EventTimingQualityFlag & 0x03;
1189 int bit_bhabha3dvetointrackflag = 0;
1190 if (bhabha3D == 1) {
1191 bit_bhabha3dvetointrackflag = bhabha3DVetoInTrackFlag & 0x01;
1193 int bit_bhabha3dselectionthetaflag = 0;
1194 if (bhabha3D_sel == 1) {
1195 bit_bhabha3dselectionthetaflag = bhabha3DSelectionThetaFlag & 0x03;
1197 int bit_taub2bflag = taub2bFlag & 0x01;
1198 int bit_taub2b2flag = taub2b2Flag & 0x01;
1199 int bit_taub2b3flag = taub2b3Flag & 0x01;
1201 int bit_hie_bhav_hie123 = bit_hie_bhav & 0x7;
1202 int bit_hie_bhav_hie4 = (bit_hie_bhav >> 3) & 0x1;
1276 std::vector<double> clusterenergy)
1298 int _nClust = CenterTCId.size();
1302 int _n2GeV231516 = 0;
1307 int _n500MeV216 = 0;
1308 int _n500MeV611 = 0;
1309 for (
int ic = 0; ic < _nClust; ic++) {
1310 if (clusterenergy[ic] > 0.3) {_n300MeV++;}
1313 int thresh = 15 & lut;
1314 if (thetaid >= 2 && thetaid <= 16) {_nClust216++;}
1315 if (thetaid >= 6 && thetaid <= 11) {
1316 if (clusterenergy[ic] * 100 > 5 * thresh) {
1321 if (clusterenergy[ic] > 0.5 && thetaid >= 2 && thetaid <= 16) {_n500MeV216++;}
1324 if (thetaid >= 4 && thetaid <= 14) {_n2GeV414++;}
1325 if (thetaid == 2 || thetaid == 3 || thetaid == 15 || thetaid == 16) {_n2GeV231516++;}
1326 if (thetaid == 1 || thetaid == 17) {_n2GeV117++;}
1329 if (thetaid >= 4 && thetaid <= 15) {_n1GeV415++;}
1330 if (thetaid == 2 || thetaid == 3 || thetaid == 16) {_n1GeV2316++;}
1337 int _nPhiPairHigh = 0;
1338 int _nPhiPairLow = 0;
1340 int _nECLBhabha = 0;
1341 for (
int i0 = 0; i0 < _nClust - 1; i0++) {
1342 for (
int i1 = i0 + 1; i1 < _nClust; i1++) {
1346 int energy1 = 15 & lut1;
1347 int energy2 = 15 & lut2;
1350 int phi1 = 511 & lut1;
1351 int phi2 = 511 & lut2;
1358 int dphi = abs(phi1 - phi2);
1359 if (dphi > 180) {dphi = 360 - dphi;}
1360 int thetaSum = theta1 + theta2;
1373 if (dphi > 160. && thetaSum > 160. && thetaSum < 200) {_n3DPair++;}
1406 if (_n2GeV414 > 0) {
1409 if (_n2GeV231516 && _nECLBhabha == 0) {
1412 if (_n2GeV231516 && _nECLBhabha != 0) {
1415 if (_n2GeV117 && _nECLBhabha == 0) {
1418 if (_n2GeV117 && _nECLBhabha != 0) {
1421 if (_n1GeV415 == 1 && _n300MeV == 1) {
1424 if (_n1GeV2316 == 1 && _n300MeV == 1) {
1427 if (_nPhiPairHigh > 0 && _n2GeV == 0) {
1430 if (_nPhiPairLow > 0 && _n2GeV == 0) {
1433 if (_n3DPair > 0 && _n2GeV == 0) {
1439 if (_nClust216 >= 3 && _n500MeV216 > 0 && _nECLBhabha == 0) {
1442 if (_n500MeV611 == 1 && _n300MeV == 1) {
1484 for (
int iii = 0; iii <= 16; iii++) {
1485 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.
int getMaxThetaId()
The method to set Theta Id of maximum TC in Cluster.
double getEnergyDep() const
The method to get deposited energy.
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
double get3DBhabhaVetoClusterTiming(int cl_idx)
get each cluster timing of two clusters of 3D Bhabha veto (ns)
int GetBhabhaAddition(void)
Additional Bhabha veto.
std::vector< double > GetBhabhaComb()
Output 2D Bhabha combination.
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.
TrgEclMaster(void)
TrgEclMaster Constructor.
int m_EventTiming
EventTiming option.
void initialize(int)
initialize
double setTotalEnergy(std::vector< double >)
Set Total Energy.
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)
void setRS(std::vector< int >, std::vector< double >, std::vector< double > &, std::vector< std::vector< double > > &)
ECL bit information for GDL.
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.