Belle II Software development
L1TriggerMenuv0.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include <TRandom.h>
9//index prescalefactor cut
10//0 1 n_2d_finder>=3
11//1 1 n_2d_finder==2&&BhabhaVeto==0
12//2 1 n_2d_finder>=1&&n_gc>=1&&BhabahVeto==0&&SBhabhaVeto==0
13//3 1 n_c>=3&&n_high_c1>=1&&eclBhabhaVeto==0
14//4 1 n_c>=2&&n_high_c4e==0&&n_bbc>=1&&eclBhabhaVeto==0
15//5 1 n_high_c2>=1&&eclBhabhaVeto==0
16//6 2000 n_c>=2&&n_bbc>=1
17//7 2000 n_2d_finder>=1&&n_gc>=1
18//8 2000 n_high_c2>=1
19//9 1000 eclbhabha
20//10 1000 n_2d_finder>=1&&n_high_c3>=1&&n_bbtc>=1
21//11 1000 n_high_c3>=1&&n_2d_finder==0
22
23//GRL Objects
24//0 n_2d_finder
25//1 n_c
26//2 n_high_c1
27//3 n_high_c2b
28//4 n_high_c3
29//5 n_high_c4e
30//6 n_gc
31//7 n_bbc
32//8 n_bbtc
33//9 BhabhaVeto
34//10 SBhabhaVeto
35//11 eclBhabhaVeto
36
37namespace Belle2 {
44 const int ntrgline = 18;
46 double scalef_phase2[ntrgline] = {1, 1, 20, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 1, 1, 1, 1, 1};
48 double scalef_phase3[ntrgline] = {1, 1, 20, 2, 1, 1, 1, 1, 2, 1, 1, 20, 20, 1, 5, 1, 3, 5};
49
51 int doprescale(int f)
52 {
53
54 int Val = 0;
55 double ran = gRandom->Uniform(f);
56 if (ceil(ran) == f) Val = 1;
57 return Val;
58 }
59
61// void dotrigger(std::vector<int>& trgres, std::vector<int> objects, std::string phase) // the function is commended out entirely to avoid warning
62// {
65 /*
66 //line 0
67 if (objects[0] >= 3) trgres.push_back(doprescale(scalef[0]));
68 else trgres.push_back(0);
69 //line 1
70 if (objects[0] == 2 && objects[9] == 0) trgres.push_back(doprescale(scalef[1]));
71 else trgres.push_back(0);
72 //line 2
73 if (objects[0] >= 1 && objects[6] >= 1 && objects[9] == 0 && objects[10] == 0)trgres.push_back(doprescale(scalef[2]));
74 else trgres.push_back(0);
75 //line 3
76 if (objects[1] >= 3 && objects[2] >= 1 && objects[11] == 0) trgres.push_back(doprescale(scalef[3]));
77 else trgres.push_back(0);
78 //line 4
79 if (objects[1] >= 2 && objects[5] == 0 && objects[7] >= 1 && objects[11] == 0) trgres.push_back(doprescale(scalef[4]));
80 else trgres.push_back(0);
81 //line 5
82 if (objects[3] >= 1 && objects[11] == 0) trgres.push_back(doprescale(scalef[5]));
83 else trgres.push_back(0);
84 //line 6
85 if (objects[1] >= 2 && objects[7] >= 1) trgres.push_back(doprescale(scalef[6]));
86 else trgres.push_back(0);
87 //line 7
88 if (objects[0] >= 1 && objects[6] >= 1) trgres.push_back(doprescale(scalef[7]));
89 else trgres.push_back(0);
90 //line 8
91 if (objects[3] >= 1) trgres.push_back(doprescale(scalef[8]));
92 else trgres.push_back(0);
93 //line 9
94 if (objects[11] == 1) trgres.push_back(doprescale(scalef[9]));
95 else trgres.push_back(0);
96 //line 10
97 if (objects[0] >= 1 && objects[4] >= 1 && objects[8] >= 1) trgres.push_back(doprescale(scalef[11]));
98 else trgres.push_back(0);
99 //line 11
100 if (objects[0] == 0 && objects[4] >= 1) trgres.push_back(doprescale(scalef[11]));
101 else trgres.push_back(0);
102 //add new trigger line by users here, e.g.
103 //if(objects[0]==0)trgres.push_back(doprescale(1));
104 //else trgres.push_back(0);
105 */
106// }
107
109}
110
double scalef_phase3[ntrgline]
prescale factor for phase3
const int ntrgline
set the total number of trigger lines and prescalefactor
double scalef_phase2[ntrgline]
prescale factor for phase2
int doprescale(int f)
select one event in number of prescale factor events
Abstract base class for different kinds of events.