Belle II Software  release-05-01-25
TrgEclMaster.cc
1 //---------------------------------------------------------------
2 // $Id$
3 //---------------------------------------------------------------
4 // Filename : TrgEcl.cc
5 // Section : TRG ECL
6 // Owner : InSoo Lee / Yuuji Unno
7 // Email : islee@hep.hanyang.ac.kr / yunno@post.kek.jp
8 //---------------------------------------------------------------
9 // Description : A class to represent TRG ECL
10 //---------------------------------------------------------------------------------
11 //
12 // ECL trigger bit
13 // ---------------------------------------------------------------------------------
14 // Variable(in Tsim) | N(bit) | Address | Parameter
15 // -------------------------------------- ------------------------------------------
16 // | 1 | 0 | TRG(Hit or not)
17 // | 7 | 7 downto 1 | Timing (LSB = 1 ns )
18 // _Triggerbit[0] | 7 | 14 downto 8 | Revoclk from FAM (LSB = 125 ns)
19 // (upto 12th | 3 | 17 downto 15 | ECL-TRG Timing Source
20 // bhabha bit) | 1 | 18 | Physics TRG
21 // (32bit) | 1 | 19 | Belle type Bhabha
22 // ------------------| 14 | 33 downto 20 | Bhabha Type
23 // | 13 | 46 downto 34 | Total Energy
24 // | 1 | 47 | E low (Etot >0.5 GeV)
25 // | 1 | 48 | E High (Etot > 1.0 GeV)
26 // _Triggerbit[1] | 1 | 49 | E lom (Etot > 3.0 GeV)
27 // | 7 | 56 dwonto 50 | ICN
28 // | 3 | 59 downto 57 | BG veto
29 // | 1 | 60 | Cluster Overflow
30 // | 1 | 61 | 3D Bhabha Trigger for Veto
31 // | 1 | 62 | N Cluster >= 3, at least one Cluster >300 MeV (LAB), not 3D ECL Bhabha
32 // _________________ | 1 | 63 | one Cluster >= 2GeV(CM) with Theta Id = 4~14
33 // | 1 | 64 | one Cluster >= 2GeV(CM) with Theta Id = 2,3,15 or 16 and not a 3D ECL Bhabha
34 // | 1 | 65 | one Cluster >= 2GeV(CM) with Theta Id = 2, 3, 15 or 16 and not a 3D ECL Bhabha
35 // | 1 | 66 | one Cluster >= 2GeV(CM) with Theta Id = 1 or 17 and not a 3D ECL Bhabha
36 // | 1 | 67 | one Cluster >= 2GeV(CM) with Theta Id = 1 or 17 and a 3D ECL Bhabha
37 // _Triggerbit[2] | 1 | 68 | exactly one Cluster >= 1GeV(CM) and one Cluster > 300 MeV (LAB ), in Theta Id 4~15(Barrel)
38 // | 1 | 69 | exactly one Cluster >= 1GeV(CM) and one Cluster > 300 MeV (LAB), in Theta Id 2, 3 or 16
39 // | 1 | 70 | 170 < delta phi(CM) < 190 degree, both Clusters > 250 MeV (LAB), and no 2GeV (CM) Cluster
40 // | 1 | 71 | 170 < delta phi(CM) < 190 degree, one Cluster < 250 MeV (LAB), the other Cluster > 250 MeV(LAB), and no 2GeV (CM) Cluster
41 // | 1 | 72 | 160 < delta phi(CM) < 200 degree, 160 < Sum Theta (CM)< 200 degree, no 2 GeV(CM) cluster
42 // | 1 | 74 | 3D Bhabha Trigger for selection
43 // | 1 | 75 | mumu bit
44 // | 1 | 76 | Bhabha prescale bit
45 // | 1 | 77 | E_tot > 20 GeV
46 // | 1 | 78 | N Cluster >= 3, at least one Cluster >500 MeV (LAB) with Theta Id 2~16, not 3D ECL Bhabha
47 // | 1 | 79 | Only one Cluster >500 MeV (CM) with Theta Id 6~11 and no other CL >= 300 MeV(LAB) anywhere
48 // ---------------------------------------------------------------------------------
49 //
50 //---------------------------------------------------------------
51 // $Log$
52 // 2017-02-23 version 1.0
53 // 2019-05-13 version 2.0 for Phase 3
54 // 2020-05-13 version 2.1 for Bug fixing
55 //---------------------------------------------------------------
56 
57 #define TRG_SHORT_NAMES
58 #define TRGECL_SHORT_NAMES
59 
60 #include "framework/datastore/StoreArray.h"
61 #include "trg/ecl/TrgEclMaster.h"
62 #include "trg/ecl/TrgEclCluster.h"
63 
64 #include "trg/ecl/dataobjects/TRGECLTrg.h"
65 #include "trg/ecl/dataobjects/TRGECLHit.h"
66 #include "trg/ecl/dataobjects/TRGECLCluster.h"
67 
68 //
69 #include <math.h>
70 #include <TRandom3.h>
71 //
72 //
73 using namespace std;
74 using namespace Belle2;
75 //
76 //
77 //
78 TrgEclMaster::TrgEclMaster():
79  TimeWindow(250.0), OverlapWindow(0.0), _Clustering(1), _Bhabha(0), _EventTiming(1), _NofTopTC(3), _ClusterLimit(6), _Lowmultibit(0),
80  _PrescaleFactor(0), _PrescaleCounter(0), _mumuThreshold(20), _n300MeVCluster(1), _ECLBurstThreshold(200)
81 {
82 
83  TCEnergy.clear();
84  TCTiming.clear();
85  TCBeamBkgTag.clear();
86  HitTCId.clear();
87  TCHitEnergy.clear();
88  TCHitTiming.clear();
89  TCHitBeamBkgTag.clear();
90 
91 
92  TCEnergy.resize(576);
93  TCTiming.resize(576);
94  TCBeamBkgTag.resize(576);
95 
96  _Triggerbit[0] = 0;
97  _Triggerbit[1] = 0;
98  _Triggerbit[2] = 0;
99  _Triggerbit[3] = 0;
100 
101 
102  _2DBhabhaThresholdFWD.clear();
103  _2DBhabhaThresholdBWD.clear();
105  _3DBhabhaVetoThreshold.clear();
106  _3DBhabhaSelectionAngle.clear();
107  _3DBhabhaVetoAngle.clear();
108  _mumuAngle.clear();
109 
110  _TotalEnergy.clear();
111  _LowMultiThreshold.clear();
112 
113  _TotalEnergy = {5, 10, 30}; // /100 MeV
114  _2DBhabhaThresholdFWD = {40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 30, 35}; // /100 MeV
115  _2DBhabhaThresholdBWD = {25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 30, 30}; // /100 MeV
116  _3DBhabhaVetoThreshold = {30, 45}; // /100 MeV
117  _3DBhabhaSelectionThreshold = {20, 40}; // /100 MeV
118  _3DBhabhaVetoAngle = {160, 200, 165, 190}; // /100 MeV
119  _3DBhabhaSelectionAngle = {140, 220, 160, 200}; // /100 MeV
120  _mumuAngle = {160, 200, 165, 190}; // degree
121  _LowMultiThreshold = {10, 20, 25, 30}; // degree
122 
123  //ThetaRingSum.resize(3,std::vector<double>(36,0));
124  //PhiRingSum.resize(17,0);
125 
126  // obf_timing = new TrgEclTiming();
127  obj_cluster = new TrgEclCluster();
128  obj_beambkg = new TrgEclBeamBKG();
129  obj_bhabha = new TrgEclBhabha();
130  obj_timing = new TrgEclTiming();
131  obj_map = new TrgEclMapping();
133 
134 
135 }
137 {
138  delete obj_cluster;
139  delete obj_beambkg;
140  delete obj_bhabha;
141  delete obj_timing;
142  delete obj_map;
143 }
144 //
145 //
146 //
147 std::string
149 {
150  return "TrgEclMaster";
151 }
152 //
153 //
154 //
155 std::string
157 {
158  return std::string("TrgEclMaster 2.1");
159 }
160 //
161 //
162 //
163 void
164 //iwasaki TrgEclMaster::initialize(int m_nEvent)
166 {
167 }
168 //
169 //
170 //
172 //
173 //
174 //
177 {
178 
179  // if (! _ecl){
180  // std::cout << "TrgEclMaster::getTrgEcl !!! TrgEcl is not created yet" << std::endl;
181  // }
182 
183  if (_ecl) { delete _ecl; }
184  _ecl = new TrgEclMaster();
185 
186  return _ecl;
187 
188 }
189 void
190 TrgEclMaster::simulate01(int m_nEvent) // Firmware simulator(time window 250 ns )
191 {
192  // TrgEclFAM* obj_trgeclfam = new TrgEclFAM();
193  // obj_trgeclfam->setup(m_nEvent, 1);
194  // setPRS(obj_trgeclfam);
195  //
196  //----------
197  // TC Etot
198  //----------
199  //
200  // Energy sum of forward and barrel except for extreme forward
201  // so Etot is sum of "phi ring ID" = 1-14
202  // Etot threshold are
203  // 1.0 GeV for Etot01
204  // 0.5 GeV for Etot02nt
205  // 3.0 GeV for Etot03
206  //
207  // Read FAM Output
208  TCTiming.clear();
209  TCEnergy.clear();
210  TCBeamBkgTag.clear();
211  TCEnergy.resize(576);
212  TCTiming.resize(576);
213  TCBeamBkgTag.resize(576);
214 
215  StoreArray<TRGECLHit> trgeclHitArray;
216  for (int ii = 0; ii < trgeclHitArray.getEntries(); ii++) {
217 
218  TRGECLHit* aTRGECLHit = trgeclHitArray[ii];
219  int iTCID = (aTRGECLHit->getTCId() - 1);
220  double HitTiming = aTRGECLHit ->getTimeAve();
221  double HitEnergy = aTRGECLHit -> getEnergyDep();
222  double HitBeamBkg = aTRGECLHit -> getBeamBkgTag();
223 
224  TCTiming[iTCID].push_back(HitTiming);
225  TCEnergy[iTCID].push_back(HitEnergy);
226  TCBeamBkgTag[iTCID].push_back(HitBeamBkg);
227 
228  }
229  //
230  //
231  int nBin = 8000 / (TimeWindow / 2) ; //8000/125
232  /* cppcheck-suppress variableScope */
233  double WindowStart;
234  /* cppcheck-suppress variableScope */
235  double WindowEnd;
236  double fluctuation = ((gRandom ->Uniform(-1, 0))) * 125;
237  /* cppcheck-suppress variableScope */
238  double check_window_start;
239  /* cppcheck-suppress variableScope */
240  double check_window_end;
241 
242 
243  for (int iBin = 0 ; iBin < nBin; iBin ++) {
244 
245  check_window_start = iBin * (TimeWindow / 3) + fluctuation - 4000;
246  WindowStart = check_window_start;
247  check_window_end = check_window_start + TimeWindow / 3;
248  WindowEnd = WindowStart + TimeWindow;
249  HitTCId.clear();
250  TCHitTiming.clear();
251  TCHitEnergy.clear();
252  TCHitBeamBkgTag.clear();
253 
254 
255  // prepare TC Hit in time window --
256  for (int iTCId = 0; iTCId < 576; iTCId++) {
257  const int hitsize = TCTiming[iTCId].size();
258  for (int ihit = 0; ihit < hitsize; ihit++) {
259  if (TCTiming[iTCId][ihit] > check_window_start && TCTiming[iTCId][ihit] < check_window_end) {
260  HitTCId.push_back(iTCId + 1);
261 
262  }
263  }
264  }
265  if (HitTCId.size() == 0) {continue;}
266  else {
267  HitTCId.clear();
268  for (int iTCId = 0; iTCId < 576; iTCId++) {
269  const int hitsize = TCTiming[iTCId].size();
270  for (int ihit = 0; ihit < hitsize; ihit++) {
271  if (TCTiming[iTCId][ihit] > WindowStart && TCTiming[iTCId][ihit] < WindowEnd) {
272  HitTCId.push_back(iTCId + 1);
273  TCHitTiming.push_back(TCTiming[iTCId][ihit]);
274  TCHitEnergy.push_back(TCEnergy[iTCId][ihit]);
275  }
276  }
277  }
278  iBin = iBin + 2;
279  }
280  int noftchit = HitTCId.size();
281  if (noftchit == 0) {continue;}
282 
283 
284  double eventtiming = 0;
285  // Get EventTiming
287  obj_timing -> SetNofTopTC(_NofTopTC);
288  eventtiming = obj_timing -> GetEventTiming(_EventTiming);
289  int timingsource = obj_timing -> GetTimingSource();
290  //--------------------------------------------------
291  // Ring sum and Total Energy Sum
292  //-------------------------------------------------
293 
294  std::vector<std::vector<double>> thetaringsum;
295  std::vector<double> phiringsum;
296 
297 
298  thetaringsum.clear();
299  phiringsum.clear();
300  thetaringsum.resize(3, std::vector<double>(36, 0));
301  phiringsum.resize(17, 0);
302  setRS(HitTCId, TCHitEnergy, phiringsum, thetaringsum);
303 
304  double E_br = 0;
305  double E_fwd = 0;
306  double E_bwd = 0;
307  double E_phys = 0;
308  double E_total = 0;
309  int E_burst = 0;
310  for (int iii = 0; iii <= 16; iii++) {
311  if (iii > 0 && iii < 15) {E_phys += phiringsum[iii];}
312  if (iii < 3) {E_fwd += phiringsum[iii];}
313  if (iii > 2 && iii < 15) {E_br += phiringsum[iii];}
314  if (iii > 14) {E_bwd += phiringsum[iii];}
315  E_total += phiringsum[iii];
316  }
317  if (E_total == 0) {continue;}
318  int ELow, EHigh, ELum;
319 
320  if (E_total > _ECLBurstThreshold / 10) {
321  E_burst = 0x01;
322  }
323  if (E_phys > _TotalEnergy[0] / 10) { // GeV
324  ELow = 0x01;
325  }
326  if (E_phys > _TotalEnergy[1] / 10) { // GeV
327  EHigh = 0x01;
328  }
329  if (E_phys > _TotalEnergy[2] / 10) { // GeV
330  ELum = 0x01;
331  }
332 
333 
334 
335 
336  //--------------
337  // Clustering
338  //--------------
339  //
340  // TrgEclCluster obj_cluster;
343  obj_cluster->setEventId(m_nEvent);
345  obj_cluster->setICN(HitTCId); // Belle Cluster Counting
346 
347  int icn = obj_cluster->getICNFwBr();
348  int icnfwd = obj_cluster->getICNSub(0);
349  int icnbr = obj_cluster->getICNSub(1);
350  int icnbwd = obj_cluster->getICNSub(2);
351 
352  // int NofCluster = obj_cluster->getNofCluster();
353  //--------------
354  // Low Multiplicity bit
355  //--------------
356  //
357  //
358  std::vector<double> ClusterTiming;
359  std::vector<double> ClusterEnergy;
360  std::vector<int> MaxTCId;
361  ClusterTiming.clear();
362  ClusterEnergy.clear();
363  MaxTCId.clear();
364  StoreArray<TRGECLCluster> trgeclClusterArray;
365  for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
366  TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
367  int maxTCId = aTRGECLCluster ->getMaxTCId();
368  double clusterenergy = aTRGECLCluster ->getEnergyDep();
369  double clustertiming = aTRGECLCluster -> getTimeAve();
370  TVector3 clusterposition(aTRGECLCluster ->getPositionX(), aTRGECLCluster ->getPositionY(), aTRGECLCluster ->getPositionZ());
371  ClusterTiming.push_back(clustertiming);
372  ClusterEnergy.push_back(clusterenergy);
373  MaxTCId.push_back(maxTCId);
374  }
375  // const int ncluster = ClusterEnergy.size();
376 
377  makeLowMultiTriggerBit(MaxTCId, ClusterEnergy);
378 
379  //--------------
380  // Bhabha veto
381  //--------------
382 
390 
391  std::vector<double> vct_bhabha;
392  vct_bhabha.clear();
393  int bhabha2D = 0 ;
394  int bhabha3D_veto = 0 ;
395  int bhabha3D_sel = 0;
396  int mumu = 0;
397 
398  bool b_2Dbhabha = obj_bhabha -> GetBhabha00(phiringsum);
399  vct_bhabha = obj_bhabha -> GetBhabhaComb();
400  if (b_2Dbhabha && (icn < 4)) {bhabha2D = 1;}
401  bool b_3Dbhabha = obj_bhabha -> GetBhabha01();
402  if (b_3Dbhabha) {bhabha3D_veto = 1;}
403  bool b_3Dbhabha_sel = obj_bhabha -> GetBhabha02();
404  if (b_3Dbhabha_sel) {bhabha3D_sel = 1;}
405  bool b_mumu = obj_bhabha -> Getmumu();
406  if (b_mumu) {mumu = 1;}
407  //------------------------
408  // Beam Background veto (Old cosmic veto)
409  //------------------------
410  bool boolBeamBkgTag = false;
411  int beambkgtag = 0;
412  boolBeamBkgTag = obj_beambkg -> GetBeamBkg(thetaringsum);
413  if (boolBeamBkgTag) {beambkgtag = 1;}
414  int bhabhaprescale = 0;
416  bhabhaprescale = 1;
417  _PrescaleCounter = 0;
418  } else if (_PrescaleFactor > _PrescaleCounter) {
419  _PrescaleCounter ++;
420  }
421 
422 
423 
424  //-------------
425  // Make ECL Trigger Bit
426  //-------------
427  int hit = 1; // hit or not
428  int Timing = (int)(eventtiming + 0.5);
429  int RevoFAM = 0;
430  int TimingSource = obj_timing->GetTimingSource(); // FWD(0), Barrel(0), Backward(0);
431  int etot = (int)(E_phys * 1000 + 0.5); // total Energy in theta ID [2~15]
432  int physics = 0;
433  if ((etot > 1000 || icn > 3) && !(bhabha2D == 1)) {physics = 1;}
434  std::vector<int> bhabhabit;
435  bhabhabit.clear();
436  int bhabhabitsize = vct_bhabha.size();
437  for (int ibhabha = 0; ibhabha < bhabhabitsize; ibhabha++) {
438  bhabhabit.push_back((int)vct_bhabha[ibhabha]);
439  }
440  int ClusterOverflow = obj_cluster->getNofExceedCluster();
441  int flagoverflow = 0;
442  if (ClusterOverflow > 0) {
443  flagoverflow = 1;
444  }
445 
446  makeTriggerBit(hit, Timing, 0, timingsource, E_phys, bhabha2D, physics, bhabhabit, icn, beambkgtag, flagoverflow,
447  bhabha3D_veto, _Lowmultibit, bhabha3D_sel, mumu, bhabhaprescale, E_burst);
448 
449 
450  int m_hitEneNum = 0;
451  StoreArray<TRGECLTrg> trgEcltrgArray;
452  trgEcltrgArray.appendNew();
453  m_hitEneNum = trgEcltrgArray.getEntries() - 1;
454 
455  //----------------------
456  //
457  //-------------
458  // Store
459  //-------------
460 
461  trgEcltrgArray[m_hitEneNum]->setEventId(m_nEvent);
462  trgEcltrgArray[m_hitEneNum]->setPRS01(phiringsum[0]);
463  trgEcltrgArray[m_hitEneNum]->setPRS02(phiringsum[1]);
464  trgEcltrgArray[m_hitEneNum]->setPRS03(phiringsum[2]);
465  trgEcltrgArray[m_hitEneNum]->setPRS04(phiringsum[3]);
466  trgEcltrgArray[m_hitEneNum]->setPRS05(phiringsum[4]);
467  trgEcltrgArray[m_hitEneNum]->setPRS06(phiringsum[5]);
468  trgEcltrgArray[m_hitEneNum]->setPRS07(phiringsum[6]);
469  trgEcltrgArray[m_hitEneNum]->setPRS08(phiringsum[7]);
470  trgEcltrgArray[m_hitEneNum]->setPRS09(phiringsum[8]);
471  trgEcltrgArray[m_hitEneNum]->setPRS10(phiringsum[9]);
472  trgEcltrgArray[m_hitEneNum]->setPRS11(phiringsum[10]);
473  trgEcltrgArray[m_hitEneNum]->setPRS12(phiringsum[11]);
474  trgEcltrgArray[m_hitEneNum]->setPRS13(phiringsum[12]);
475  trgEcltrgArray[m_hitEneNum]->setPRS14(phiringsum[13]);
476  trgEcltrgArray[m_hitEneNum]->setPRS15(phiringsum[14]);
477  trgEcltrgArray[m_hitEneNum]->setPRS16(phiringsum[15]);
478  trgEcltrgArray[m_hitEneNum]->setPRS17(phiringsum[16]);
479  //
480  trgEcltrgArray[m_hitEneNum]->setEtot(E_phys);
481  trgEcltrgArray[m_hitEneNum]->setNofTCHit(noftchit);
482  //
483  trgEcltrgArray[m_hitEneNum]->setBhabha01(vct_bhabha[0]);
484  trgEcltrgArray[m_hitEneNum]->setBhabha02(vct_bhabha[1]);
485  trgEcltrgArray[m_hitEneNum]->setBhabha03(vct_bhabha[2]);
486  trgEcltrgArray[m_hitEneNum]->setBhabha04(vct_bhabha[3]);
487  trgEcltrgArray[m_hitEneNum]->setBhabha05(vct_bhabha[4]);
488  trgEcltrgArray[m_hitEneNum]->setBhabha06(vct_bhabha[5]);
489  trgEcltrgArray[m_hitEneNum]->setBhabha07(vct_bhabha[6]);
490  trgEcltrgArray[m_hitEneNum]->setBhabha08(vct_bhabha[7]);
491  trgEcltrgArray[m_hitEneNum]->setBhabha09(vct_bhabha[8]);
492  trgEcltrgArray[m_hitEneNum]->setBhabha10(vct_bhabha[9]);
493  trgEcltrgArray[m_hitEneNum]->setBhabha11(vct_bhabha[10]);
494  trgEcltrgArray[m_hitEneNum]->setBhabha12(vct_bhabha[11]);
495  trgEcltrgArray[m_hitEneNum]->setBhabha13(vct_bhabha[12]);
496  trgEcltrgArray[m_hitEneNum]->setBhabha14(vct_bhabha[13]);
497  trgEcltrgArray[m_hitEneNum]->setBhabha15(vct_bhabha[14]);
498  trgEcltrgArray[m_hitEneNum]->setBhabha16(vct_bhabha[15]);
499  trgEcltrgArray[m_hitEneNum]->setBhabha17(vct_bhabha[16]);
500  trgEcltrgArray[m_hitEneNum]->setBhabha18(vct_bhabha[17]);
501  //
502  trgEcltrgArray[m_hitEneNum]->setICN(icn);
503  trgEcltrgArray[m_hitEneNum]->setICNFw(icnfwd);
504  trgEcltrgArray[m_hitEneNum]->setICNBr(icnbr);
505  trgEcltrgArray[m_hitEneNum]->setICNBw(icnbwd);
506  //
507  trgEcltrgArray[m_hitEneNum]->setECLtoGDL(_Triggerbit[0], 0);
508  trgEcltrgArray[m_hitEneNum]->setECLtoGDL(_Triggerbit[1], 1);
509  trgEcltrgArray[m_hitEneNum]->setECLtoGDL(_Triggerbit[2], 2);
510  trgEcltrgArray[m_hitEneNum]->setECLtoGDL(_Triggerbit[3], 3);
511 
512  trgEcltrgArray[m_hitEneNum]->setBhabhaVeto(bhabha2D);
513  trgEcltrgArray[m_hitEneNum]->setBeamBkgVeto(beambkgtag);
514  trgEcltrgArray[m_hitEneNum]->setEventTiming(eventtiming);
515 
516  trgEcltrgArray[m_hitEneNum]->setHit(hit);
517  trgEcltrgArray[m_hitEneNum]->setRevoclk(RevoFAM);
518  trgEcltrgArray[m_hitEneNum]->setTimingSource(TimingSource);
519  trgEcltrgArray[m_hitEneNum]->setPhysics(physics) ;
520  trgEcltrgArray[m_hitEneNum]->set2DBhabha(bhabha2D);
521  trgEcltrgArray[m_hitEneNum]->set3DBhabha(bhabha3D_veto);
522  trgEcltrgArray[m_hitEneNum]->set3DBhabhaSel(bhabha3D_sel);
523  trgEcltrgArray[m_hitEneNum]->setmumuBit(mumu);
524  trgEcltrgArray[m_hitEneNum]->setBhabhaPrescaleBit(bhabhaprescale);
525 
526 
527  trgEcltrgArray[m_hitEneNum]->setELow(ELow) ;
528  trgEcltrgArray[m_hitEneNum]->setEHihg(EHigh);
529  trgEcltrgArray[m_hitEneNum]->setELum(ELum) ;
530  trgEcltrgArray[m_hitEneNum]->setClusterOverflow(ClusterOverflow) ;
531  trgEcltrgArray[m_hitEneNum]->setLowMultiBit(_Lowmultibit);
532 
533 
534  }
535 
536  return;
537 }
538 
539 void
540 TrgEclMaster::simulate02(int m_nEvent) // select one window for analyze trigger logic
541 {
542  // TrgEclFAM* obj_trgeclfam = new TrgEclFAM();
543  // obj_trgeclfam->setup(m_nEvent, 1);
544  // setPRS(obj_trgeclfam);
545  //
546  //----------
547  // TC Etot
548  //----------
549  //
550  // Energy sum of forward and barrel except for extreme forward
551  // so Etot is sum of "phi ring ID" = 1-14
552  // Etot threshold are
553  // 1.0 GeV for Etot01
554  // 0.5 GeV for Etot02nt
555  // 3.0 GeV for Etot03
556  //
557  // Read FAM Output
558  TCTiming.clear();
559  TCEnergy.clear();
560  TCBeamBkgTag.clear();
561  TCEnergy.resize(576);
562  TCTiming.resize(576);
563  TCBeamBkgTag.resize(576);
564 
565  StoreArray<TRGECLHit> trgeclHitArray;
566  for (int ii = 0; ii < trgeclHitArray.getEntries(); ii++) {
567 
568  TRGECLHit* aTRGECLHit = trgeclHitArray[ii];
569  int iTCID = (aTRGECLHit->getTCId() - 1);
570  double HitTiming = aTRGECLHit ->getTimeAve();
571  double HitEnergy = aTRGECLHit -> getEnergyDep();
572  double HitBeamBkg = aTRGECLHit -> getBeamBkgTag();
573 
574  TCTiming[iTCID].push_back(HitTiming);
575  TCEnergy[iTCID].push_back(HitEnergy);
576  TCBeamBkgTag[iTCID].push_back(HitBeamBkg);
577 
578  }
579  //
580  //
581  int nBin = 2 * 8000 / TimeWindow ;
582  double WindowStart = 0;
583  double WindowEnd = 0;
584  double fluctuation = ((gRandom ->Uniform(-1, 0))) * 125;
585 
586  int startBin = nBin / 2 - 1; //start previous bin near 0s
587 
588  int endBin = nBin / 2 + 1; //start next bin near 0s
589 
590 
591  if (_EventTiming == 0) {
592  TimeWindow = 500;
593  OverlapWindow = 0;
594  }
595 
596  double maxE = 0;
597  int max_bin = 0;
598 
599 
600  for (int iBin = startBin ; iBin <= endBin; iBin ++) {
601  WindowStart = iBin * (TimeWindow - OverlapWindow) + fluctuation - 4000;
602  if (iBin == 0) {WindowStart = - 4000 + fluctuation;}
603  WindowEnd = WindowStart + TimeWindow;
604 
605  double totalE = 0;
606  // prepare TC Hit in time window --
607  for (int iTCId = 0; iTCId < 576; iTCId++) {
608  const int hitsize = TCTiming[iTCId].size();
609  for (int ihit = 0; ihit < hitsize; ihit++) {
610  if (TCTiming[iTCId][ihit] > WindowStart && TCTiming[iTCId][ihit] < WindowEnd) {
611  totalE += TCEnergy[iTCId][ihit] ;
612  }
613  }
614  }
615  if (totalE == 0) {continue;}
616  if (maxE < totalE) { //select the bin having the highest total energy
617  maxE = totalE;
618  max_bin = iBin;
619  }
620  }
621 
622 
623 
624  WindowStart = max_bin * (TimeWindow - OverlapWindow) + fluctuation - 4000;
625  if (max_bin == 0) {WindowStart = - 4000 + fluctuation;}
626  WindowEnd = WindowStart + TimeWindow;
627 
628 
629  HitTCId.clear();
630  TCHitTiming.clear();
631  TCHitEnergy.clear();
632  TCHitBeamBkgTag.clear();
633  // prepare TC Hit in time window --
634  for (int iTCId = 0; iTCId < 576; iTCId++) {
635  const int hitsize = TCTiming[iTCId].size();
636  for (int ihit = 0; ihit < hitsize; ihit++) {
637  if (TCTiming[iTCId][ihit] > WindowStart && TCTiming[iTCId][ihit] < WindowEnd) {
638  HitTCId.push_back(iTCId + 1);
639  TCHitTiming.push_back(TCTiming[iTCId][ihit]);
640  TCHitEnergy.push_back(TCEnergy[iTCId][ihit]);
641  TCHitBeamBkgTag.push_back(TCBeamBkgTag[iTCId][ihit]);
642  }
643  }
644  }
645 
646 
647  int noftchit = HitTCId.size();
648  if (noftchit == 0) { return;}
649 
650 
651 
652  double eventtiming = 0;
653  // Get EventTiming
655  obj_timing -> SetNofTopTC(_NofTopTC);
656  eventtiming = obj_timing -> GetEventTiming(_EventTiming);
657  int timingsource = obj_timing -> GetTimingSource();
658 
659 
660 
661  //--------------------------------------------------
662  // Ring sum and Total Energy Sum
663  //-------------------------------------------------
664 
665  std::vector<std::vector<double>> thetaringsum;
666  std::vector<double> phiringsum;
667 
668 
669  thetaringsum.clear();
670  phiringsum.clear();
671  thetaringsum.resize(3, std::vector<double>(36, 0));
672  phiringsum.resize(17, 0);
673  setRS(HitTCId, TCHitEnergy, phiringsum, thetaringsum);
674 
675  double E_br;
676  double E_fwd;
677  double E_bwd;
678  double E_phys = 0;
679  double E_total = 0;
680  int E_burst = 0;
681 
682  for (int iii = 0; iii <= 16; iii++) {
683  if (iii > 0 && iii < 15) {E_phys += phiringsum[iii];}
684  if (iii < 3) {E_fwd += phiringsum[iii];}
685  if (iii > 2 && iii < 15) {E_br += phiringsum[iii];}
686  if (iii > 14) {E_bwd += phiringsum[iii];}
687  E_total += phiringsum[iii];
688  }
689  if (E_total == 0) {return;}
690  int ELow, EHigh, ELum;
691  if (E_total > _ECLBurstThreshold) {
692  E_burst = 0x01;
693  }
694 
695  if (E_phys > _TotalEnergy[0] / 10) { // GeV
696  ELow = 0x01;
697  }
698  if (E_phys > _TotalEnergy[1] / 10) { // GeV
699  EHigh = 0x01;
700  }
701  if (E_phys > _TotalEnergy[2] / 10) { // GeV
702  ELum = 0x01;
703  }
704 
705 
706 
707  //--------------
708  // Clustering
709  //--------------
710  //
711  // TrgEclCluster obj_cluster;
714  obj_cluster->setEventId(m_nEvent);
716  obj_cluster->setICN(HitTCId); // Belle Cluster Counting
717 
718 
719  int icn = obj_cluster->getICNFwBr();
720  int icnfwd = obj_cluster->getICNSub(0);
721  int icnbr = obj_cluster->getICNSub(1);
722  int icnbwd = obj_cluster->getICNSub(2);
723 
724  // int NofCluster = obj_cluster->getNofCluster();
725  //--------------
726  // Low Multiplicity bit
727  //--------------
728  //
729  //
730  std::vector<double> ClusterTiming;
731  std::vector<double> ClusterEnergy;
732  std::vector<int> MaxTCId;
733  ClusterTiming.clear();
734  ClusterEnergy.clear();
735  MaxTCId.clear();
736  StoreArray<TRGECLCluster> trgeclClusterArray;
737  for (int ii = 0; ii < trgeclClusterArray.getEntries(); ii++) {
738  TRGECLCluster* aTRGECLCluster = trgeclClusterArray[ii];
739  int maxTCId = aTRGECLCluster ->getMaxTCId();
740  double clusterenergy = aTRGECLCluster ->getEnergyDep();
741  double clustertiming = aTRGECLCluster -> getTimeAve();
742  TVector3 clusterposition(aTRGECLCluster ->getPositionX(), aTRGECLCluster ->getPositionY(), aTRGECLCluster ->getPositionZ());
743  ClusterTiming.push_back(clustertiming);
744  ClusterEnergy.push_back(clusterenergy);
745  MaxTCId.push_back(maxTCId);
746  }
747  // int NofCluster = obj_cluster->getNofCluster();
748  makeLowMultiTriggerBit(MaxTCId, ClusterEnergy);
749 
750  //--------------
751  // Bhabha veto
752  //--------------
753  //
761 
762 
763  std::vector<double> vct_bhabha;
764  vct_bhabha.clear();
765  int bhabha2D = 0 ;
766  int bhabha3D_veto = 0 ;
767  int bhabha3D_sel = 0;
768  int mumu = 0;
769 
770  bool b_2Dbhabha = obj_bhabha -> GetBhabha00(phiringsum);
771  vct_bhabha = obj_bhabha -> GetBhabhaComb();
772  if (b_2Dbhabha && (icn < 4)) {bhabha2D = 1;}
773  bool b_3Dbhabha = obj_bhabha -> GetBhabha01();
774  if (b_3Dbhabha) {bhabha3D_veto = 1;}
775  bool b_3Dbhabha_sel = obj_bhabha -> GetBhabha02();
776  if (b_3Dbhabha_sel) {bhabha3D_sel = 1;}
777  bool b_mumu = obj_bhabha -> Getmumu();
778  if (b_mumu) {mumu = 1;}
779  int bhabhaprescale = 0;
781  bhabhaprescale = 1;
782  _PrescaleCounter = 0;
783  } else if (_PrescaleFactor > _PrescaleCounter) {
784  _PrescaleCounter ++;
785  }
786 
787  //------------------------
788  // Beam Background veto (Old cosmic veto)
789  //------------------------
790  bool boolBeamBkgTag = false;
791  int beambkgtag = 0;
792  boolBeamBkgTag = obj_beambkg -> GetBeamBkg(thetaringsum);
793  if (boolBeamBkgTag) {beambkgtag = 1;}
794  //-------------
795  // Make ECL Trigger Bit
796  //-------------
797  int hit = 1; // hit or not
798  int Timing = (int)(eventtiming + 0.5);
799  int RevoFAM = 0;
800  int TimingSource = obj_timing->GetTimingSource(); // FWD(0), Barrel(0), Backward(0);
801  int etot = (int)(E_phys * 1000 + 0.5); // total Energy in theta ID [2~15]
802  //int bhabha2D = BtoBTag ;
803  int physics = 0;
804  if ((etot > 1000 || icn > 3) && !(bhabha2D == 1)) {physics = 1;}
805  std::vector<int> bhabhabit;
806  bhabhabit.clear();
807  int bhabhabitsize = vct_bhabha.size();
808  for (int ibhabha = 0; ibhabha < bhabhabitsize; ibhabha++) {
809  bhabhabit.push_back((int)vct_bhabha[ibhabha]);
810  }
811  int ClusterOverflow = obj_cluster->getNofExceedCluster();
812  int flagoverflow = 0;
813  if (ClusterOverflow > 0) {
814  flagoverflow = 1;
815  }
816 
817  makeTriggerBit(hit, Timing, 0, timingsource, E_phys, bhabha2D, physics, bhabhabit, icn, beambkgtag, flagoverflow,
818  bhabha3D_veto, _Lowmultibit, bhabha3D_sel, mumu, bhabhaprescale, E_burst);
819 
820  //
821  //
822  //--------------
823  // ECL trigger
824  //--------------
825  // Integer GDL "Output word to GDL:"
826  // "bit0-2 = Etot1,2,3"
827  // "bit3 = Bhabha,"
828  // "bit4 = prescaled Bhabha,"
829  // "bit5-8 = ICN(3bits)+FORWARD(1bit) OR ICN(3+1 carry),"
830  // "bit9 = cosmic,"
831  // "bit10 = neutral timing trigger"
832  //
833  //------------------------------
834  // 2 10 16
835  //------------------------------
836  // 1 0000000000001 1 1 Etot1
837  // 2 0000000000010 2 2 Etot2
838  // 3 0000000000100 4 4 Etot3
839  // 4 0000000001000 8 8 Bhabha
840  // 5 0000000010000 16 10 preBhabha
841  // 6 0000000100000 32 20 ICN
842  // 7 0000001000000 64 40 ICN
843  // 8 0000010000000 128 80 ICN
844  // 9 0000100000000 256 100 ForwardICN
845  // 10 0001000000000 512 200 BeamBkgVeto
846  // 11 0010000000000 1024 400 Timing
847  //------------------------------
848  // int bitEtot1 = 0x0001;
849  // int bitEtot2 = 0x0002;
850  // int bitEtot3 = 0x0004;
851  // int bitBhabha = 0x0008;
852  // int bitPreBhabha = 0x0010;
853  // int bitForwardICN = 0x0100;
854  // int bitBeamBkgVeto = 0x0200;
855  // int bitTiming = 0x0400;
856 
857  // bool boolEtot[3] = {false};
858  // if (E_phys > 1.0) boolEtot[1] = true;
859  // bool boolBhabha = (boolBtoBTag && icn > 4);
860  // bool boolPreBhabha = false;
861  // bool boolForwardICN = icnfwd;
862  // bool boolBeamBkgVeto = boolBeamBkgTag;
863  // int bit = 0;
864  // //
865  // // bit 5-7
866  // bit = (icn >= 7) ? 0x0007 : icn;
867  // bit <<= 5;
868  // // bit 0
869  // bit |= boolEtot[0] ? bitEtot1 : 0;
870  // // bit 1
871  // bit |= boolEtot[1] ? bitEtot2 : 0;
872  // // bit 2
873  // bit |= boolEtot[2] ? bitEtot3 : 0;
874  // // bit 3
875  // bit |= boolBhabha ? bitBhabha : 0;
876  // // bit 4
877  // bit |= boolPreBhabha ? bitPreBhabha : 0;
878  // // bit 8
879  // bit |= boolForwardICN ? bitForwardICN : 0;
880  // // bit 9
881  // bit |= boolBeamBkgVeto ? bitBeamBkgVeto : 0;
882  // // bit 10
883  // bit |= bitTiming;
884  //
885  // printf("bit = %i \n", bit);
886  //----------------------
887  // if (0){ // check bit by "binary" output
888  // int xxx = bit;
889  // int yyy = 0;
890  // int iii = 0;
891  // int ans = 0;
892  // while (xxx > 0) {
893  // yyy = xxx % 2;
894  // ans = ans + yyy * pow(10,iii);
895  // xxx = xxx / 2;
896  // iii = iii++;
897  // }
898  // printf("xxx = %i \n", ans);
899  // }
900 
901 
902 
903  int m_hitEneNum = 0;
904  StoreArray<TRGECLTrg> trgEcltrgArray;
905  trgEcltrgArray.appendNew();
906  m_hitEneNum = trgEcltrgArray.getEntries() - 1;
907 
908  //----------------------
909  //
910  //-------------
911  // Store
912  //-------------
913 
914  trgEcltrgArray[m_hitEneNum]->setEventId(m_nEvent);
915  trgEcltrgArray[m_hitEneNum]->setPRS01(phiringsum[0]);
916  trgEcltrgArray[m_hitEneNum]->setPRS02(phiringsum[1]);
917  trgEcltrgArray[m_hitEneNum]->setPRS03(phiringsum[2]);
918  trgEcltrgArray[m_hitEneNum]->setPRS04(phiringsum[3]);
919  trgEcltrgArray[m_hitEneNum]->setPRS05(phiringsum[4]);
920  trgEcltrgArray[m_hitEneNum]->setPRS06(phiringsum[5]);
921  trgEcltrgArray[m_hitEneNum]->setPRS07(phiringsum[6]);
922  trgEcltrgArray[m_hitEneNum]->setPRS08(phiringsum[7]);
923  trgEcltrgArray[m_hitEneNum]->setPRS09(phiringsum[8]);
924  trgEcltrgArray[m_hitEneNum]->setPRS10(phiringsum[9]);
925  trgEcltrgArray[m_hitEneNum]->setPRS11(phiringsum[10]);
926  trgEcltrgArray[m_hitEneNum]->setPRS12(phiringsum[11]);
927  trgEcltrgArray[m_hitEneNum]->setPRS13(phiringsum[12]);
928  trgEcltrgArray[m_hitEneNum]->setPRS14(phiringsum[13]);
929  trgEcltrgArray[m_hitEneNum]->setPRS15(phiringsum[14]);
930  trgEcltrgArray[m_hitEneNum]->setPRS16(phiringsum[15]);
931  trgEcltrgArray[m_hitEneNum]->setPRS17(phiringsum[16]);
932  //
933  trgEcltrgArray[m_hitEneNum]->setEtot(E_phys);
934  trgEcltrgArray[m_hitEneNum]->setNofTCHit(noftchit);
935  //
936  trgEcltrgArray[m_hitEneNum]->setBhabha01(vct_bhabha[0]);
937  trgEcltrgArray[m_hitEneNum]->setBhabha02(vct_bhabha[1]);
938  trgEcltrgArray[m_hitEneNum]->setBhabha03(vct_bhabha[2]);
939  trgEcltrgArray[m_hitEneNum]->setBhabha04(vct_bhabha[3]);
940  trgEcltrgArray[m_hitEneNum]->setBhabha05(vct_bhabha[4]);
941  trgEcltrgArray[m_hitEneNum]->setBhabha06(vct_bhabha[5]);
942  trgEcltrgArray[m_hitEneNum]->setBhabha07(vct_bhabha[6]);
943  trgEcltrgArray[m_hitEneNum]->setBhabha08(vct_bhabha[7]);
944  trgEcltrgArray[m_hitEneNum]->setBhabha09(vct_bhabha[8]);
945  trgEcltrgArray[m_hitEneNum]->setBhabha10(vct_bhabha[9]);
946  trgEcltrgArray[m_hitEneNum]->setBhabha11(vct_bhabha[10]);
947  trgEcltrgArray[m_hitEneNum]->setBhabha12(vct_bhabha[11]);
948  trgEcltrgArray[m_hitEneNum]->setBhabha13(vct_bhabha[12]);
949  trgEcltrgArray[m_hitEneNum]->setBhabha14(vct_bhabha[13]);
950  trgEcltrgArray[m_hitEneNum]->setBhabha15(vct_bhabha[14]);
951  trgEcltrgArray[m_hitEneNum]->setBhabha16(vct_bhabha[15]);
952  trgEcltrgArray[m_hitEneNum]->setBhabha17(vct_bhabha[16]);
953  trgEcltrgArray[m_hitEneNum]->setBhabha18(vct_bhabha[17]);
954  //
955  trgEcltrgArray[m_hitEneNum]->setICN(icn);
956  trgEcltrgArray[m_hitEneNum]->setICNFw(icnfwd);
957  trgEcltrgArray[m_hitEneNum]->setICNBr(icnbr);
958  trgEcltrgArray[m_hitEneNum]->setICNBw(icnbwd);
959  //
960  trgEcltrgArray[m_hitEneNum]->setECLtoGDL(_Triggerbit[0], 0);
961  trgEcltrgArray[m_hitEneNum]->setECLtoGDL(_Triggerbit[1], 1);
962  trgEcltrgArray[m_hitEneNum]->setECLtoGDL(_Triggerbit[2], 2);
963  trgEcltrgArray[m_hitEneNum]->setECLtoGDL(_Triggerbit[3], 3);
964 
965  trgEcltrgArray[m_hitEneNum]->setBhabhaVeto(bhabha2D);
966  trgEcltrgArray[m_hitEneNum]->setBeamBkgVeto(beambkgtag);
967  trgEcltrgArray[m_hitEneNum]->setEventTiming(eventtiming);
968 
969  trgEcltrgArray[m_hitEneNum]->setHit(hit);
970  trgEcltrgArray[m_hitEneNum]->setRevoclk(RevoFAM);
971  trgEcltrgArray[m_hitEneNum]->setTimingSource(TimingSource);
972  trgEcltrgArray[m_hitEneNum]->setPhysics(physics) ;
973  trgEcltrgArray[m_hitEneNum]->set2DBhabha(bhabha2D);
974  trgEcltrgArray[m_hitEneNum]->set3DBhabha(bhabha3D_veto);
975  trgEcltrgArray[m_hitEneNum]->set3DBhabhaSel(bhabha3D_sel);
976  trgEcltrgArray[m_hitEneNum]->setmumuBit(mumu);
977  trgEcltrgArray[m_hitEneNum]->setBhabhaPrescaleBit(bhabhaprescale);
978 
979  trgEcltrgArray[m_hitEneNum]->setELow(ELow) ;
980  trgEcltrgArray[m_hitEneNum]->setEHihg(EHigh);
981  trgEcltrgArray[m_hitEneNum]->setELum(ELum) ;
982  trgEcltrgArray[m_hitEneNum]->setClusterOverflow(ClusterOverflow) ;
983  trgEcltrgArray[m_hitEneNum]->setLowMultiBit(_Lowmultibit);
984 
985 
986 
987 
988  return;
989 }
990 
991 //
992 //
993 //
994 void
995 TrgEclMaster::setRS(std::vector<int> TCId, std::vector<double> TCHit, std::vector<double>& phiringsum,
996  std::vector<std::vector<double>>& thetaringsum)
997 {
998  //
999  //
1000  // TC Phi & Theta ring sum
1001  //
1002  //----------------------------------------
1003  // FW BR BW total
1004  //----------------------------------------
1005  //TC phi ring 3 12 2 17
1006  //ID 1-3 4-15 16-17
1007  //TC Theta ring 32 36 32
1008  //ID 1-32 1-36 1-32
1009 
1010  //----------------------------------------
1011  //
1012  thetaringsum.resize(3, std::vector<double>(36, 0.));
1013  phiringsum.resize(17);
1014  const int size_hit = TCHit.size();
1015  for (int iHit = 0; iHit < size_hit; iHit++) {
1016  int iTCId = TCId[iHit] - 1;
1017  if (TCHit[iHit] > 0) {
1018  int iTCThetaId = obj_map ->getTCThetaIdFromTCId(iTCId + 1) - 1 ;
1019  int iTCPhiId = obj_map ->getTCPhiIdFromTCId(iTCId + 1) - 1 ;
1020  phiringsum[iTCThetaId] += TCHit[iHit];
1021  if (iTCThetaId - 1 < 3) { //fwd
1022  thetaringsum[0][iTCPhiId] += TCHit[iHit];
1023  } else if (iTCThetaId > 14) { //bwd
1024  thetaringsum[2][iTCPhiId] += TCHit[iHit];
1025  } else { //barrel
1026  thetaringsum[1][iTCPhiId] += TCHit[iHit];
1027  }
1028 
1029  }
1030 
1031  }
1032 
1033 }
1034 
1035 
1036 void TrgEclMaster::makeTriggerBit(int hit, int Timing, int RevoFAM, int TimingSource, double etot, int bhabha2D, int physics,
1037  std::vector<int> bhabhatype, int ICN, int BGVeto, int ClusterOverflow, int bhabha3D, int lowmultibit, int bhabha3D_sel, int mumubit,
1038  int prescale, int burst)
1039 {
1040 
1041 
1042  _Triggerbit[0] = 0;
1043  _Triggerbit[1] = 0;
1044  _Triggerbit[2] = 0;
1045  _Triggerbit[3] = 0;
1046 
1047  //---------------------------------------------------------------------------------
1048  // ECL trigger
1049  //---------------------------------------------------------------------------------
1050  //Variable(in Tsim) | N(bit) | Address | Parameter
1051  //-------------------------------------- ------------------------------------------
1052  // | 1 | 0 | TRG(Hit or not)
1053  // | 7 | 7 downto 1 | Timing (LSB = 1 ns )
1054  // _Triggerbit[0] | 7 | 14 downto 8 | Revoclk from FAM (LSB = 125 ns)
1055  // (upto 12th | 3 | 17 downto 15 | ECL-TRG Timing Source
1056  // bhabha bit) | 1 | 18 | Physics TRG
1057  // (32bit) | 1 | 19 | Belle type Bhabha
1058  //------------------| 14 | 33 downto 20 | Bhabha Type
1059  // | 13 | 46 downto 34 | Total Energy
1060  // | 1 | 47 | E low (Etot >0.5 GeV)
1061  // | 1 | 48 | E High (Etot > 1.0 GeV)
1062  // _Triggerbit[1] | 1 | 49 | E lom (Etot > 3.0 GeV)
1063  // | 7 | 56 dwonto 50 | ICN
1064  // | 3 | 59 downto 57 | BG veto
1065  // | 1 | 60 | Cluster Overflow
1066  // | 1 | 61 | 3D Bhabha Trigger
1067  // | 1 | 62 | N Cluster >= 3, at least one Cluster >300 MeV (LAB), not 3D ECL Bhabha
1068  //_________________ | 1 | 63 | one Cluster >= 2GeV(CM) with Theta Id = 4~14
1069  // | 1 | 64 | one Cluster >= 2GeV(CM) with Theta Id = 2,3,15 or 16 and not a 3D ECL Bhabha
1070  // | 1 | 65 | one Cluster >= 2GeV(CM) with Theta Id = 2, 3, 15 or 16 and not a 3D ECL Bhabha
1071  // | 1 | 66 | one Cluster >= 2GeV(CM) with Theta Id = 1 or 17 and not a 3D ECL Bhabha
1072  // | 1 | 67 | one Cluster >= 2GeV(CM) with Theta Id = 1 or 17 and a 3D ECL Bhabha
1073  // _Triggerbit[2] | 1 | 68 | exactly one Cluster >= 1GeV(CM) and one Cluster > 300 MeV (LAB ), in Theta Id 4~15(Barrel)
1074  // | 1 | 69 | exactly one Cluster >= 1GeV(CM) and one Cluster > 300 MeV (LAB), in Theta Id 2, 3 or 16
1075  // | 1 | 70 | 170 < delta phi(CM) < 190 degree, both Clusters > 250 MeV (LAB), and no 2GeV (CM) Cluster
1076  // | 1 | 71 | 170 < delta phi(CM) < 190 degree, one Cluster < 250 MeV (LAB), the other Cluster > 250 MeV(LAB), and no 2GeV (CM) Cluster
1077  // | 1 | 72 | 160 < delta phi(CM) < 200 degree, 160 < Sum Theta (CM)< 200 degree, no 2 GeV(CM) cluster
1078  // | 1 | 73 | No 2GeV (CM) Cluster
1079  // | 1 | 74 | 3D Bhabha Trigger for selection
1080  // | 1 | 75 | mumu bit
1081  // | 1 | 76 | Bhabha prescale bit
1082  // | 1 | 77 | E_tot > 20 GeV
1083  //---------------------------------------------------------------------------------
1084  //
1085  //
1086  //
1087  //
1088  // int physics = 0;
1089  int elow = 0;
1090  int ehigh = 0;
1091  int elum = 0;
1092  int bhabhaveto = 0;
1093  int Bhabhatype = bhabha2D;
1094 
1095  if (etot > 0.5) {
1096  elow = 0x01;
1097  }
1098  if (etot > 1.0) {
1099  ehigh = 0x01;
1100  }
1101  if (etot > 3.0) {
1102  elum = 0x01;
1103  }
1104 
1105  if (bhabhatype.size() > 14) {
1106  for (int ibhabha = 0; ibhabha < 13; ibhabha++) {
1107  int type = 0x00;
1108  if (bhabhatype[ibhabha] == 1) {type = 0x01;}
1109 
1110  Bhabhatype |= type;
1111  Bhabhatype <<= 1;
1112 
1113  }
1114  }
1115 
1116 
1117  int bit_hit = hit & 0x01;
1118  int bit_Timing = (Timing & 0x7F) ;
1119  int bit_RevoFAM = (RevoFAM & 0x7F) ;
1120  int bit_TimingSource = (TimingSource & 0x07) ;
1121  int bit_physics = (physics & 0x01) ;
1122  int bit_2Dbhabha = (bhabhaveto & 0x01) ;
1123  int bit_bhabhatype = (Bhabhatype & 0x3FFF);
1124  int bit_etot = (((int)etot) & 0x1FFF) ;
1125  int bit_elow = (elow & 0x01);
1126  int bit_ehigh = (ehigh & 0x01) ;
1127  int bit_elum = (elum & 0x01) ;
1128  int bit_ICN = (ICN & 0x7F) ;
1129  int bit_BGVeto = (BGVeto & 0x07) ;
1130  int bit_ClusterOverflow = (ClusterOverflow & 0x01);
1131  int bit_3Dbhabha = (bhabha3D & 0x01);
1132 
1133  int bit_lowmulti1 = lowmultibit & 0x0FFF;
1134  int bit_lowmulti2 = (lowmultibit >>= 12) & 0x3;
1135  int bit_3DBhabha_sel = bhabha3D_sel & 0x01;
1136  int bit_mumu = mumubit & 0x01;
1137  int bit_prescale = prescale & 0x01;
1138  int bit_burst = burst & 0x01;
1139  _Triggerbit[2] |= bit_lowmulti2;
1140  _Triggerbit[2] <<= 1;
1141  _Triggerbit[2] |= bit_burst;
1142  _Triggerbit[2] <<= 1;
1143  _Triggerbit[2] |= bit_prescale;
1144  _Triggerbit[2] <<= 1;
1145  _Triggerbit[2] |= bit_mumu;
1146  _Triggerbit[2] <<= 1;
1147  _Triggerbit[2] |= bit_3DBhabha_sel;
1148  _Triggerbit[2] <<= 10;
1149  _Triggerbit[2] |= ((bit_lowmulti1) >> 2) & 0x3FF;
1150 
1151 
1152  _Triggerbit[1] |= (bit_lowmulti1 & 0x03);
1153  _Triggerbit[1] <<= 1;
1154  _Triggerbit[1] |= bit_3Dbhabha;
1155  _Triggerbit[1] <<= 1;
1156  _Triggerbit[1] |= bit_ClusterOverflow;
1157  _Triggerbit[1] <<= 3;
1158  _Triggerbit[1] |= bit_BGVeto;
1159  _Triggerbit[1] <<= 7;
1160  _Triggerbit[1] |= bit_ICN;
1161  _Triggerbit[1] <<= 1;
1162  _Triggerbit[1] |= bit_elum;
1163  _Triggerbit[1] <<= 1;
1164  _Triggerbit[1] |= bit_ehigh;
1165  _Triggerbit[1] <<= 1;
1166  _Triggerbit[1] |= bit_elow;
1167  _Triggerbit[1] <<= 13;
1168  _Triggerbit[1] |= bit_etot;
1169  _Triggerbit[1] <<= 2;
1170  _Triggerbit[1] |= ((bit_bhabhatype >> 12) & 0x03);
1171 
1172 
1173  _Triggerbit[0] |= (bit_bhabhatype & 0x0FFF);
1174  _Triggerbit[0] <<= 1;
1175  _Triggerbit[0] |= bit_2Dbhabha;
1176  _Triggerbit[0] <<= 1;
1177  _Triggerbit[0] |= bit_physics;
1178  _Triggerbit[0] <<= 3;
1179  _Triggerbit[0] |= bit_TimingSource;
1180  _Triggerbit[0] <<= 7;
1181  _Triggerbit[0] |= bit_RevoFAM;
1182  _Triggerbit[0] <<= 7;
1183  _Triggerbit[0] |= bit_Timing;
1184  _Triggerbit[0] <<= 1;
1185  _Triggerbit[0] |= bit_hit;
1186 
1187 
1188 
1189 
1190 
1191 
1192 
1193 }
1194 
1195 
1196 void TrgEclMaster::makeLowMultiTriggerBit(std::vector<int> CenterTCId, std::vector<double> clusterenergy)
1197 {
1198 
1199  //---------------------------------------------------------------------------------
1200  // ECL trigger
1201  //---------------------------------------------------------------------------------
1202  //Variable(in Tsim) | N(bit) | Address | Parameter
1203  //-------------------------------------- ------------------------------------------
1204  // | 1 | 62 | N Cluster >= 3, at least one Cluster >300 MeV (LAB), not 3D ECL Bhabha
1205  // | 1 | 63 | one Cluster >= 2GeV(CM) with Theta Id = 4~14
1206  // _Lowmultibit | 1 | 64 | one Cluster >= 2GeV(CM) with Theta Id = 2,3,15 or 16 and not a 3D ECL Bhabha
1207  // | 1 | 65 | one Cluster >= 2GeV(CM) with Theta Id = 2, 3, 15 or 16 and not a 3D ECL Bhabha
1208  // | 1 | 66 | one Cluster >= 2GeV(CM) with Theta Id = 1 or 17 and not a 3D ECL Bhabha
1209  // | 1 | 67 | one Cluster >= 2GeV(CM) with Theta Id = 1 or 17 and a 3D ECL Bhabha
1210  // | 1 | 68 | exactly one Cluster >= 1GeV(CM) and one Cluster > 300 MeV (LAB ), in Theta Id 4~15(Barrel)
1211  // | 1 | 69 | exactly one Cluster >= 1GeV(CM) and one Cluster > 300 MeV (LAB), in Theta Id 2, 3 or 16
1212  // | 1 | 70 | 170 < delta phi(CM) < 190 degree, both Clusters > 250 MeV (LAB), and no 2GeV (CM) Cluster
1213  // | 1 | 71 | 170 < delta phi(CM) < 190 degree, one Cluster < 250 MeV (LAB), the other Cluster > 250 MeV(LAB), and no 2GeV (CM) Cluster
1214  // | 1 | 72 | 160 < delta phi(CM) < 200 degree, 160 < Sum Theta (CM)< 200 degree, no 2 GeV(CM) cluster
1215  // | 1 | 73 | No 2GeV (CM) Cluster
1216  //---------------------------------------------------------------------------------
1217  _Lowmultibit = 0;
1218  int _nClust = CenterTCId.size();
1219  int _n300MeV = 0;
1220  int _n2GeV = 0;
1221  int _n2GeV414 = 0;
1222  int _n2GeV231516 = 0;
1223  int _n2GeV117 = 0;
1224  int _n1GeV415 = 0;
1225  int _n1GeV2316 = 0;
1226  int _n1GeV117 = 0;
1227  int _nClust216 = 0;
1228  int _n500MeV216 = 0;
1229  int _n500MeV611 = 0;
1230  for (int ic = 0; ic < _nClust; ic++) {
1231  if (clusterenergy[ic] > 0.3) {_n300MeV++;}
1232  int thetaid = obj_map->getTCThetaIdFromTCId(CenterTCId[ic]);
1233  int lut = obj_database->Get3DBhabhaLUT(CenterTCId[ic]);
1234  int thresh = 15 & lut;
1235  if (thetaid >= 2 && thetaid <= 16) {_nClust216++;}
1236  if (thetaid >= 6 && thetaid <= 11) {
1237  if (clusterenergy[ic] * 100 > 5 * thresh) {
1238  _n500MeV611++;
1239  }
1240  }
1241 
1242  if (clusterenergy[ic] > 0.5 && thetaid >= 2 && thetaid <= 16) {_n500MeV216++;}
1243  if (clusterenergy[ic] * 100 > (thresh * _LowMultiThreshold[1])) { //200 <MeV
1244  _n2GeV++;
1245  if (thetaid >= 4 && thetaid <= 14) {_n2GeV414++;}
1246  if (thetaid == 2 || thetaid == 3 || thetaid == 15 || thetaid == 16) {_n2GeV231516++;}
1247  if (thetaid == 1 || thetaid == 17) {_n2GeV117++;}
1248  }
1249  if (clusterenergy[ic] * 100 > thresh * _LowMultiThreshold[0]) { // 100 MeV
1250  if (thetaid >= 4 && thetaid <= 15) {_n1GeV415++;}
1251  if (thetaid == 2 || thetaid == 3 || thetaid == 16) {_n1GeV2316++;}
1252  if (thetaid == 1 || thetaid == 17) {_n1GeV117++;}
1253  }
1254  }
1255  //---------------------------------------------------------------------
1256  //..Trigger objects using back-to-back ECL clusters, plus Bhabha vetoes
1257  // nPhiPairHigh nPhiPairLow n3DPair nECLBhabha nTrkBhabha
1258 
1259  int _nPhiPairHigh = 0;
1260  int _nPhiPairLow = 0;
1261  int _n3DPair = 0;
1262  int _nECLBhabha = 0;
1263  for (int i0 = 0; i0 < _nClust - 1; i0++) {
1264  for (int i1 = i0 + 1; i1 < _nClust; i1++) {
1265  int lut1 = obj_database->Get3DBhabhaLUT(CenterTCId[i0]);
1266  int lut2 = obj_database->Get3DBhabhaLUT(CenterTCId[i1]);
1267 
1268  int energy1 = 15 & lut1;
1269  int energy2 = 15 & lut2;
1270  lut1 >>= 4;
1271  lut2 >>= 4;
1272  int phi1 = 511 & lut1;
1273  int phi2 = 511 & lut2;
1274  lut1 >>= 9;
1275  lut2 >>= 9;
1276  int theta1 = lut1;
1277  int theta2 = lut2;
1278 
1279  //..back to back in phi
1280  int dphi = abs(phi1 - phi2);
1281  if (dphi > 180) {dphi = 360 - dphi;}
1282  int thetaSum = theta1 + theta2;
1283 
1284  // cout << dphi << " " << thetaSum << endl;
1285  // cout << clusterenergy[i0] << " " << clusterenergy[i1] << endl;
1286  // if (dphi > 180.) {dphi = 360 - dphi;}
1287  if (dphi > 170. && clusterenergy[i0] > _LowMultiThreshold[2] / 100
1288  && clusterenergy[i1] > _LowMultiThreshold[2] / 100) {_nPhiPairHigh++;}
1289  if (dphi > 170. &&
1290  ((clusterenergy[i0] < _LowMultiThreshold[2] / 100 && clusterenergy[i1] > _LowMultiThreshold[2] / 100) ||
1291  (clusterenergy[i0] > _LowMultiThreshold[2] / 100 && clusterenergy[i1] < _LowMultiThreshold[2] / 100))) {_nPhiPairLow++;}
1292  //..3D
1293  if (dphi > 160. && thetaSum > 160. && thetaSum < 200) {_n3DPair++;}
1294  //..ecl Bhabha
1295  if (dphi > 160 && thetaSum > 165 && thetaSum < 190 && clusterenergy[i0] * 100 > _3DBhabhaVetoThreshold[0] * energy1
1296  && clusterenergy[i1] * 100 > _3DBhabhaVetoThreshold[0] * energy2
1297  && (clusterenergy[i0] * 100 > _3DBhabhaVetoThreshold[1] * energy1
1298  || clusterenergy[i1] * 100 > _3DBhabhaVetoThreshold[1] * energy2)) {
1299  _nECLBhabha++;
1300 
1301  }
1302  }
1303  }
1304  int bit1 = 0;
1305  int bit2 = 0;
1306  int bit3 = 0;
1307  int bit4 = 0;
1308  int bit5 = 0;
1309  int bit6 = 0;
1310  int bit7 = 0;
1311  int bit8 = 0;
1312  int bit9 = 0;
1313  int bit10 = 0;
1314  int bit11 = 0;
1315  int bit12 = 0;
1316  int bit13 = 0;
1317  int bit14 = 0;
1318 
1319 
1320  if (_nClust >= 3 && _n300MeV >= _n300MeVCluster && _nECLBhabha == 0) {
1321  bit1 = 0x01; //6
1322  }
1323  if (_n2GeV414 > 0) {
1324  bit2 = 0x01; //7
1325  }
1326  if (_n2GeV231516 && _nECLBhabha == 0) {
1327  bit3 = 0x01; //9
1328  }
1329  if (_n2GeV231516 && _nECLBhabha != 0) {
1330  bit4 = 0x01; //10
1331  }
1332  if (_n2GeV117 && _nECLBhabha == 0) {
1333  bit5 = 0x01; //11
1334  }
1335  if (_n2GeV117 && _nECLBhabha != 0) {
1336  bit6 = 0x01; //12
1337  }
1338  if (_n1GeV415 == 1 && _n300MeV == 1) {
1339  bit7 = 0x01; //13
1340  }
1341  if (_n1GeV2316 == 1 && _n300MeV == 1) {
1342  bit8 = 0x01; //14
1343  }
1344  if (_nPhiPairHigh > 0 && _n2GeV == 0) {
1345  bit9 = 0x01; //15
1346  }
1347  if (_nPhiPairLow > 0 && _n2GeV == 0) {
1348  bit10 = 0x01; //16
1349  }
1350  if (_n3DPair > 0 && _n2GeV == 0) {
1351  bit11 = 0x01; //17;
1352  }
1353  if (_n2GeV == 0) {
1354  bit12 = 0x01; //4
1355  }
1356 
1357  if (_nClust216 >= 3 && _n500MeV216 > 0 && _nECLBhabha == 0) {
1358  bit13 = 0x01; //6
1359  }
1360  if (_n500MeV611 == 1 && _n300MeV == 1) {
1361  bit14 = 0x01; //6
1362  }
1363 
1364 
1365  int total_bit = 0;
1366 
1367  total_bit |= bit14;
1368  total_bit <<= 1;
1369  total_bit |= bit13;
1370  total_bit <<= 1;
1371  total_bit |= bit12;
1372  total_bit <<= 1;
1373  total_bit |= bit11;
1374  total_bit <<= 1;
1375  total_bit |= bit10;
1376  total_bit <<= 1;
1377  total_bit |= bit9;
1378  total_bit <<= 1;
1379  total_bit |= bit8;
1380  total_bit <<= 1;
1381  total_bit |= bit7;
1382  total_bit <<= 1;
1383  total_bit |= bit6;
1384  total_bit <<= 1;
1385  total_bit |= bit5;
1386  total_bit <<= 1;
1387  total_bit |= bit4;
1388  total_bit <<= 1;
1389  total_bit |= bit3;
1390  total_bit <<= 1;
1391  total_bit |= bit2;
1392  total_bit <<= 1;
1393  total_bit |= bit1;
1394 
1395  _Lowmultibit = total_bit ;
1396 
1397 }
1398 //
1399 //
1400 //
1401 double TrgEclMaster::setTotalEnergy(std::vector<double> phisum)
1402 {
1403 
1404  double E_phys = 0;
1405  for (int iii = 0; iii <= 16; iii++) {
1406  if (iii > 0 && iii < 15) {E_phys += phisum[iii];}
1407  }
1408  return E_phys;
1409 }
1410 
1411 //
1412 
1413 
1414 
1415 
1416 
1417 
1418 
1419 
1420 
1421 //
1422 //
1423 //
Belle2::StoreArray::appendNew
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:256
Belle2::TrgEclMaster::set3DBhabhaSelectionAngle
void set3DBhabhaSelectionAngle(std::vector< double > i3DBhabhaSelectionAngle)
set 3D selection Bhabha Energy Angle
Definition: TrgEclMaster.h:114
Belle2::TrgEclMaster::_2DBhabhaThresholdBWD
std::vector< double > _2DBhabhaThresholdBWD
2D Bhabha Energy Threshold
Definition: TrgEclMaster.h:194
Belle2::TrgEclMaster::_PrescaleFactor
int _PrescaleFactor
Bhabha Prescale Factor.
Definition: TrgEclMaster.h:187
Belle2::TrgEclMaster::_EventTiming
int _EventTiming
EventTiming option.
Definition: TrgEclMaster.h:177
Belle2::TrgEclMaster::_NofTopTC
int _NofTopTC
Definition: TrgEclMaster.h:179
Belle2::TrgEclMaster::TCHitTiming
std::vector< double > TCHitTiming
Hit TC Timing in time window.
Definition: TrgEclMaster.h:147
Belle2::TRGECLCluster::getMaxTCId
int getMaxTCId() const
The method to get the Maximum(center) TC id.
Definition: TRGECLCluster.h:113
Belle2::TrgEclMaster::TCHitBeamBkgTag
std::vector< int > TCHitBeamBkgTag
Hit TC Beam Background tag in time window.
Definition: TrgEclMaster.h:149
Belle2::TrgEclMaster::_PrescaleCounter
int _PrescaleCounter
Bhabha Prescale Countor.
Definition: TrgEclMaster.h:189
Belle2::TrgEclMaster::simulate02
void simulate02(int)
simulates ECL trigger for Data Analysis
Definition: TrgEclMaster.cc:540
Belle2::TrgEclMaster::obj_timing
TrgEclTiming * obj_timing
EventTiming object.
Definition: TrgEclMaster.h:223
Belle2::TrgEclMaster::makeTriggerBit
void makeTriggerBit(int, int, int, int, double, int, int, std::vector< int >, int, int, int, int, int, int, int, int, int)
make Trigger bit except for Low Multiplicity related bit
Definition: TrgEclMaster.cc:1036
Belle2::TrgEclMaster::setRS
void setRS(std::vector< int >, std::vector< double >, std::vector< double > &, std::vector< std::vector< double >> &)
ECL bit information for GDL.
Definition: TrgEclMaster.cc:995
Belle2::TrgEclMaster::HitTCId
std::vector< int > HitTCId
Hit TC Energy in time window.
Definition: TrgEclMaster.h:143
Belle2::TrgEclMaster::_3DBhabhaVetoThreshold
std::vector< double > _3DBhabhaVetoThreshold
3D Veto Bhabha Energy Threshold
Definition: TrgEclMaster.h:198
Belle2::TrgEclMaster::_ecl
static TrgEclMaster * _ecl
ecl object
Definition: TrgEclMaster.h:217
Belle2::TrgEclMaster::_Lowmultibit
int _Lowmultibit
Low Multiplicity bit.
Definition: TrgEclMaster.h:185
Belle2::TRGECLCluster
Example Detector.
Definition: TRGECLCluster.h:25
Belle2::TrgEclMaster
ETM class.
Definition: TrgEclMaster.h:40
Belle2::TrgEclMaster::name
std::string name(void) const
returns name.
Definition: TrgEclMaster.cc:148
Belle2::TrgEclMaster::initialize
void initialize(int)
initialize
Definition: TrgEclMaster.cc:165
Belle2::TrgEclTiming
A Class of ECL Trigger clustering
Definition: TrgEclTiming.h:34
Belle2::TrgEclMapping::getTCPhiIdFromTCId
int getTCPhiIdFromTCId(int)
get [TC Phi ID] from [TC ID]
Definition: TrgEclMapping.cc:227
Belle2::TrgEclMaster::set3DBhabhaVetoThreshold
void set3DBhabhaVetoThreshold(std::vector< double > i3DBhabhaVetoThreshold)
set 3D veto Bhabha Energy Threshold
Definition: TrgEclMaster.h:111
Belle2::TrgEclMaster::TCTiming
std::vector< std::vector< double > > TCTiming
Hit TC Timing.
Definition: TrgEclMaster.h:138
Belle2::TrgEclCluster::getICNSub
int getICNSub(int)
get ICN in each region(Fw(0), Br(1), Bw(2))
Definition: TrgEclCluster.cc:114
Belle2::TrgEclMaster::setmumuAngle
void setmumuAngle(std::vector< double > imumuAngle)
set mumu bit Angle selection
Definition: TrgEclMaster.h:120
Belle2::TrgEclMaster::TCHitEnergy
std::vector< double > TCHitEnergy
Hit TC Energy in time window.
Definition: TrgEclMaster.h:145
Belle2::TrgEclMaster::_mumuAngle
std::vector< double > _mumuAngle
mumu bit Angle
Definition: TrgEclMaster.h:206
Belle2::TrgEclDataBase
class TrgEclDataBase;
Definition: TrgEclDataBase.h:24
Belle2::TrgEclMaster::obj_beambkg
TrgEclBeamBKG * obj_beambkg
Beam Backgroud veto object.
Definition: TrgEclMaster.h:227
Belle2::TrgEclMaster::_Triggerbit
int _Triggerbit[4]
ECL Trigger bit.
Definition: TrgEclMaster.h:183
Belle2::TRGECLHit
Example Detector.
Definition: TRGECLHit.h:26
Belle2::TrgEclMaster::simulate01
void simulate01(int)
simulates ECL trigger for Global Cosmic data
Definition: TrgEclMaster.cc:190
Belle2::TrgEclMapping
A class of TC Mapping.
Definition: TrgEclMapping.h:31
Belle2::TrgEclMaster::version
std::string version(void) const
returns version.
Definition: TrgEclMaster.cc:156
Belle2::TrgEclMaster::_2DBhabhaThresholdFWD
std::vector< double > _2DBhabhaThresholdFWD
2D Bhabha Energy Threshold
Definition: TrgEclMaster.h:192
Belle2::TrgEclMaster::getTrgEclMaster
static TrgEclMaster * getTrgEclMaster(void)
get pointer of TrgEclMaster object
Definition: TrgEclMaster.cc:176
Belle2::TrgEclMaster::obj_map
TrgEclMapping * obj_map
Mapping object.
Definition: TrgEclMaster.h:219
Belle2::TrgEclTiming::GetTimingSource
int GetTimingSource()
Get Timing Source.
Definition: TrgEclTiming.h:57
Belle2::TrgEclMaster::TCBeamBkgTag
std::vector< std::vector< int > > TCBeamBkgTag
Hit TC Beam Background tag.
Definition: TrgEclMaster.h:140
Belle2::TrgEclMaster::_3DBhabhaVetoAngle
std::vector< double > _3DBhabhaVetoAngle
3D Veto Bhabha Energy Angle
Definition: TrgEclMaster.h:202
Belle2::TrgEclMaster::setTotalEnergy
double setTotalEnergy(std::vector< double >)
Set Total Energy.
Definition: TrgEclMaster.cc:1401
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrgEclCluster::getICNFwBr
int getICNFwBr(void)
get ICN in Barrel and Forward
Definition: TrgEclCluster.cc:104
Belle2::TrgEclCluster::setClusteringMethod
void setClusteringMethod(int method)
Set.
Definition: TrgEclCluster.h:67
Belle2::TrgEclCluster::getNofExceedCluster
int getNofExceedCluster()
get # Cluster in case of exceeding limit
Definition: TrgEclCluster.cc:1867
Belle2::TrgEclMaster::TimeWindow
double TimeWindow
Hit TC Energy in time window.
Definition: TrgEclMaster.h:165
Belle2::TrgEclMaster::~TrgEclMaster
virtual ~TrgEclMaster()
TrgEclMaster Destructor.
Definition: TrgEclMaster.cc:136
Belle2::TrgEclBhabha
A Class of ECL Trigger clustering
Definition: TrgEclBhabha.h:37
Belle2::TrgEclMaster::obj_database
TrgEclDataBase * obj_database
Beam Backgroud veto object.
Definition: TrgEclMaster.h:229
Belle2::TrgEclCluster::setEventId
void setEventId(int eventId)
Set EventId.
Definition: TrgEclCluster.h:65
Belle2::TrgEclMaster::_3DBhabhaSelectionThreshold
std::vector< double > _3DBhabhaSelectionThreshold
3D Selection Bhabha Energy Threshold
Definition: TrgEclMaster.h:196
Belle2::TrgEclMaster::_ClusterLimit
int _ClusterLimit
The limit number of Cluster.
Definition: TrgEclMaster.h:181
Belle2::TrgEclBeamBKG
A Class of ECL Trigger clustering
Definition: TrgEclBeamBKG.h:34
Belle2::TrgEclMaster::makeLowMultiTriggerBit
void makeLowMultiTriggerBit(std::vector< int >, std::vector< double >)
make LowMultiTriggerBit
Definition: TrgEclMaster.cc:1196
Belle2::TrgEclMaster::_ECLBurstThreshold
double _ECLBurstThreshold
ECL Burst Bit Threshold.
Definition: TrgEclMaster.h:210
Belle2::TrgEclMaster::set2DBhabhaThreshold
void set2DBhabhaThreshold(std::vector< double > i2DBhabhaThresholdFWD, std::vector< double > i2DBhabhaThresholdBWD)
set 2D Bhabha Energy Threshold
Definition: TrgEclMaster.h:103
Belle2::TrgEclMaster::TrgEclMaster
TrgEclMaster(void)
TrgEclMaster Constructor.
Definition: TrgEclMaster.cc:78
Belle2::TrgEclMaster::_3DBhabhaSelectionAngle
std::vector< double > _3DBhabhaSelectionAngle
3D Selection Bhabha Energy Angle
Definition: TrgEclMaster.h:200
Belle2::TRGECLHit::getTCId
int getTCId() const
The method to get TC id.
Definition: TRGECLHit.h:62
Belle2::TrgEclMaster::setmumuThreshold
void setmumuThreshold(int mumuThreshold)
set mumu bit Threshold
Definition: TrgEclMaster.h:118
Belle2::TrgEclMaster::_TotalEnergy
std::vector< double > _TotalEnergy
Total Energy Theshold (low, high, lum)
Definition: TrgEclMaster.h:212
Belle2::TrgEclCluster::setICN
void setICN(std::vector< int >)
Destructor.
Definition: TrgEclCluster.cc:156
Belle2::TrgEclMaster::_n300MeVCluster
int _n300MeVCluster
The number of Cluster exceeding 300 MeV.
Definition: TrgEclMaster.h:208
Belle2::TrgEclMapping::getTCThetaIdFromTCId
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
Definition: TrgEclMapping.cc:200
Belle2::TrgEclMaster::_Clustering
int _Clustering
clutering option
Definition: TrgEclMaster.h:171
Belle2::TRGECLHit::getTimeAve
double getTimeAve() const
The method to get hit average time.
Definition: TRGECLHit.h:68
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TrgEclCluster::setClusterLimit
void setClusterLimit(int limit)
Set Limit of Cluster.
Definition: TrgEclCluster.h:69
Belle2::TrgEclMaster::TCEnergy
std::vector< std::vector< double > > TCEnergy
Hit TC Energy.
Definition: TrgEclMaster.h:136
Belle2::TrgEclMaster::_LowMultiThreshold
std::vector< double > _LowMultiThreshold
Low Multiplicity Threshold.
Definition: TrgEclMaster.h:214
Belle2::TrgEclCluster
A Class of ECL Trigger clustering
Definition: TrgEclCluster.h:35
Belle2::TRGECLCluster::getEnergyDep
double getEnergyDep() const
The method to get deposited energy.
Definition: TRGECLCluster.h:120
Belle2::TrgEclDataBase::Get3DBhabhaLUT
int Get3DBhabhaLUT(int)
TC CM Phi
Definition: TrgEclDataBase.cc:580
Belle2::TrgEclMaster::_mumuThreshold
double _mumuThreshold
mumu bit Energy Threshold
Definition: TrgEclMaster.h:204
Belle2::TrgEclMaster::obj_cluster
TrgEclCluster * obj_cluster
Cluster object.
Definition: TrgEclMaster.h:221
Belle2::StoreArray::getEntries
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:226
Belle2::TrgEclMaster::set3DBhabhaSelectionThreshold
void set3DBhabhaSelectionThreshold(std::vector< double > i3DBhabhaSelectionThreshold)
set 3D selection Bhabha Energy Threshold
Definition: TrgEclMaster.h:109
Belle2::TrgEclMaster::obj_bhabha
TrgEclBhabha * obj_bhabha
Bhabha object.
Definition: TrgEclMaster.h:225
Belle2::TrgEclMaster::OverlapWindow
double OverlapWindow
TRG Decision overlap window.
Definition: TrgEclMaster.h:167
Belle2::TrgEclMaster::set3DBhabhaVetoAngle
void set3DBhabhaVetoAngle(std::vector< double > i3DBhabhaVetoAngle)
set 3D veto Bhabha Energy Angle
Definition: TrgEclMaster.h:116