BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcTCount.cxx
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2// BOOST --- BESIII Object_Oriented Simulation Tool /
3//
4//---------------------------------------------------------------------------/
5//
6//Description:
7//Author: Caogf
8//Created: Mar, 2006
9//Modified:
10//Comment:
11//
12
13#include "Trigger/MdcTCount.h"
14#include "Trigger/MdcTF.h"
15#include <iostream>
16
19#include "GaudiKernel/ISvcLocator.h"
20#include "GaudiKernel/Bootstrap.h"
21#include "GaudiKernel/IDataProviderSvc.h"
22
24{
25 m_MdcTF = new MdcTF();
26}
28{
29 if(m_MdcTF) delete m_MdcTF;
30}
32{
33 if(m_MdcTF) m_MdcTF->GetTrack();
34 //reset values
35 strackNo = 0;
36 ltrackNo = 0;
37 nItrkSL1 = 0;
38 nItrkSL2 = 0;
39 strackId.clear();
40 ltrackId.clear();
41 intrkId1.clear();
42 intrkId2.clear();
43
44 intrkId1 = m_MdcTF->GetintrkSL1();
45 intrkId2 = m_MdcTF->GetintrkSL2();
46 nItrkSL1 = intrkId1.size();
47 nItrkSL2 = intrkId2.size();
48
49 //Get short and long track information
50 for(int i = 0;i<128;i++)
51 {
52 int stId = 0, ltId = 0;
53 //find short track
54 if(m_MdcTF->GetstrackId(i) != 0) {
55 //cout<<"TCount Cell ID "<<i<<endl;
56 //for(int j = 1; j < 128; j++) {
57 for(int j = 1; j < 17; j++) {
58 if((i-j) < 0) stId = m_MdcTF->GetstrackId(128-j+i);
59 else stId = m_MdcTF->GetstrackId(i-j);
60 //cout<<"stId is "<<stId<<" j is "<<j<<" j%2 is "<<j%2<<endl;
61 if(stId == 0) {
62 if(j%2 != 0) { strackId.push_back(i); strackNo+=1; }//cout<<"short track count id : "<<i<<endl; }
63 break;
64 }
65 }
66 }
67 //find long track
68 if(m_MdcTF->GetltrackId(i) != 0) {
69 //for(int j = 1; j < 128; j++) {
70 for(int j = 1; j < 17; j++) {
71 if((i-j) < 0) ltId = m_MdcTF->GetltrackId(128-j+i);
72 else ltId = m_MdcTF->GetltrackId(i-j);
73 if(ltId == 0) {
74 if(j%2 != 0) { ltrackId.push_back(i); ltrackNo+=1; }// cout<<"long track count id : "<<i<<endl; }
75 break;
76 }
77 }
78 }
79 }
80/*
81 //No track combination
82 for(int i = 0;i<128;i++)
83 {
84 //find short track
85 if(m_MdcTF->GetstrackId(i) != 0) {
86 strackId.push_back(i);
87 }
88 //find long track
89 if(m_MdcTF->GetltrackId(i) != 0) {
90 ltrackId.push_back(i);
91 }
92 }
93*/
94 ISvcLocator* svcLocator = Gaudi::svcLocator();
95 StatusCode sc = svcLocator->service("BesGlobalTrigSvc", m_tmpSvc);
96 m_pIBGT = dynamic_cast<BesGlobalTrigSvc* >(m_tmpSvc);
97
98 //set short and long track Id in service
99 m_pIBGT->setMdcStrkId(strackId);
100 m_pIBGT->setMdcLtrkId(ltrackId);
101}
void setMdcStrkId(std::vector< int > i)
void setMdcLtrkId(std::vector< int > i)
void GetTCount()
Definition: MdcTCount.cxx:31
Definition: MdcTF.h:6
std::vector< int > & GetintrkSL1()
Definition: MdcTF.h:16
std::vector< int > & GetintrkSL2()
Definition: MdcTF.h:17
void GetTrack()
Definition: MdcTF.cxx:29
int GetstrackId(int i)
Definition: MdcTF.h:14
int GetltrackId(int i)
Definition: MdcTF.h:15