36 ISvcLocator* svcLocator = Gaudi::svcLocator();
37 StatusCode sc = svcLocator->service(
"BesGlobalTrigSvc", m_tmpSvc);
57 if(!m_TofHitCount) std::cerr<<
"can not get TofHitCount pointer"<<std::endl;
59 std::vector<int> barHitmap;
60 std::vector<int> endHitmap;
61 std::vector<int> barHitId1;
62 std::vector<int> barHitId2;
63 std::vector<int> ecapHitId;
64 std::vector<int> wcapHitId;
65 std::vector<int>::iterator
iter;
79 for(
unsigned int btofId = 0; btofId < barHitId1.size(); btofId++) barHitmap.push_back(barHitId1[btofId]);
80 for(
unsigned int btofId = 0; btofId < barHitId2.size(); btofId++) barHitmap.push_back(88+barHitId2[btofId]);
81 for(
unsigned int etofId = 0; etofId < ecapHitId.size(); etofId++) endHitmap.push_back(ecapHitId[etofId]);
82 for(
unsigned int etofId = 0; etofId < wcapHitId.size(); etofId++) endHitmap.push_back(48+wcapHitId[etofId]);
92 for(
int btofId = 0; btofId < 88; btofId++) {
94 if((find(barHitId1.begin(),barHitId1.end(),btofId)!=barHitId1.end()) ) {
95 bHitpos.push_back(btofId);
100 if((find(barHitId1.begin(),barHitId1.end(),btofId)!=barHitId1.end()) ||
101 (find(barHitId2.begin(),barHitId2.end(),btofId)!=barHitId2.end()) ||
102 (find(barHitId2.begin(),barHitId2.end(),btofId+1)!=barHitId2.end()) ) {
103 bHitpos.push_back(btofId);
107 if((find(barHitId1.begin(),barHitId1.end(),btofId)!=barHitId1.end()) ||
108 (find(barHitId2.begin(),barHitId2.end(),btofId)!=barHitId2.end()) ||
109 (find(barHitId2.begin(),barHitId2.end(),0)!=barHitId2.end()) ) {
110 bHitpos.push_back(btofId);
116 for(
iter=ecapHitId.begin();
iter!=ecapHitId.end();
iter++)
118 scinNo = (int) (*
iter)/2;
119 if(find(ecapHitpos.begin(),ecapHitpos.end(),scinNo)==ecapHitpos.end())
121 ecapHitpos.push_back(scinNo);
125 for(
iter=wcapHitId.begin();
iter!=wcapHitId.end();
iter++)
127 scinNo = (int)*
iter/2;
128 if(find(wcapHitpos.begin(),wcapHitpos.end(),scinNo)==wcapHitpos.end())
130 wcapHitpos.push_back(scinNo);
136 for(
int btofId = 0; btofId < 88; btofId++) {
138 if((find(bHitpos.begin(),bHitpos.end(),btofId) != bHitpos.end()) &&
139 (find(bHitpos.begin(),bHitpos.end(),87) == bHitpos.end())) {
144 if((find(bHitpos.begin(),bHitpos.end(),btofId) != bHitpos.end()) &&
145 (find(bHitpos.begin(),bHitpos.end(),btofId-1) == bHitpos.end())) {
151 for(
int etofId = 0; etofId < 48; etofId++) {
153 if((find(wcapHitId.begin(),wcapHitId.end(),etofId) != wcapHitId.end()) &&
154 (find(wcapHitId.begin(),wcapHitId.end(),47) == wcapHitId.end())) {
157 if((find(ecapHitId.begin(),ecapHitId.end(),etofId) != ecapHitId.end()) &&
158 (find(ecapHitId.begin(),ecapHitId.end(),47) == ecapHitId.end())) {
163 if((find(wcapHitId.begin(),wcapHitId.end(),etofId) != wcapHitId.end()) &&
164 (find(wcapHitId.begin(),wcapHitId.end(),etofId-1) == wcapHitId.end())) {
167 if((find(ecapHitId.begin(),ecapHitId.end(),etofId) != ecapHitId.end()) &&
168 (find(ecapHitId.begin(),ecapHitId.end(),etofId-1) == ecapHitId.end())) {
174 if(barHitCount>=1) NBTOF1 =
true;
175 if(barHitCount>=2) NBTOF2 =
true;
176 if(endHitCount>=1) NETOF1 =
true;
177 if(endHitCount>=2) NETOF2 =
true;
178 if((NBTOF1 ==
true) || (NETOF1 ==
true)) NTOF1 =
true;
183 for(
int i=0;i<13;i++)
187 if(find(bHitpos.begin(),bHitpos.end(),scinNo+38+i)!=bHitpos.end()) TBB =
true;
191 if(find(bHitpos.begin(),bHitpos.end(),scinNo+38+i-88)!=bHitpos.end()) TBB =
true;
195 for(
iter=wcapHitId.begin();
iter!=wcapHitId.end();
iter++)
202 if(find(ecapHitId.begin(),ecapHitId.end(),scinNo+20+i)!=ecapHitId.end()) ETBB =
true;
206 if(find(ecapHitId.begin(),ecapHitId.end(),scinNo+20+i-48)!=ecapHitId.end()) ETBB =
true;
210 map<int,vector<int>,greater<int> > mHitId;
212 typedef pair<int, vector<int> > vpair;
223 mHitId.insert(vpair(0,ecapHitpos));
224 mHitId.insert(vpair(1,bHitpos));
225 mHitId.insert(vpair(2,wcapHitpos));