BOSS 8.0.0
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
17#include "GaudiKernel/Bootstrap.h"
18#include "GaudiKernel/IDataProviderSvc.h"
19#include "GaudiKernel/ISvcLocator.h"
22
23MdcTCount::MdcTCount() { m_MdcTF = new MdcTF(); }
25 if ( m_MdcTF ) delete m_MdcTF;
26}
28 if ( m_MdcTF ) m_MdcTF->GetTrack();
29 // reset values
30 strackNo = 0;
31 ltrackNo = 0;
32 nItrkSL1 = 0;
33 nItrkSL2 = 0;
34 strackId.clear();
35 ltrackId.clear();
36 intrkId1.clear();
37 intrkId2.clear();
38
39 intrkId1 = m_MdcTF->GetintrkSL1();
40 intrkId2 = m_MdcTF->GetintrkSL2();
41 nItrkSL1 = intrkId1.size();
42 nItrkSL2 = intrkId2.size();
43
44 // Get short and long track information
45 for ( int i = 0; i < 128; i++ )
46 {
47 int stId = 0, ltId = 0;
48 // find short track
49 if ( m_MdcTF->GetstrackId( i ) != 0 )
50 {
51 // cout<<"TCount Cell ID "<<i<<endl;
52 // for(int j = 1; j < 128; j++) {
53 for ( int j = 1; j < 17; j++ )
54 {
55 if ( ( i - j ) < 0 ) stId = m_MdcTF->GetstrackId( 128 - j + i );
56 else stId = m_MdcTF->GetstrackId( i - j );
57 // cout<<"stId is "<<stId<<" j is "<<j<<" j%2 is "<<j%2<<endl;
58 if ( stId == 0 )
59 {
60 if ( j % 2 != 0 )
61 {
62 strackId.push_back( i );
63 strackNo += 1;
64 } // cout<<"short track count id : "<<i<<endl; }
65 break;
66 }
67 }
68 }
69 // find long track
70 if ( m_MdcTF->GetltrackId( i ) != 0 )
71 {
72 // for(int j = 1; j < 128; j++) {
73 for ( int j = 1; j < 17; j++ )
74 {
75 if ( ( i - j ) < 0 ) ltId = m_MdcTF->GetltrackId( 128 - j + i );
76 else ltId = m_MdcTF->GetltrackId( i - j );
77 if ( ltId == 0 )
78 {
79 if ( j % 2 != 0 )
80 {
81 ltrackId.push_back( i );
82 ltrackNo += 1;
83 } // cout<<"long track count id : "<<i<<endl; }
84 break;
85 }
86 }
87 }
88 }
89 /*
90 //No track combination
91 for(int i = 0;i<128;i++)
92 {
93 //find short track
94 if(m_MdcTF->GetstrackId(i) != 0) {
95 strackId.push_back(i);
96 }
97 //find long track
98 if(m_MdcTF->GetltrackId(i) != 0) {
99 ltrackId.push_back(i);
100 }
101 }
102 */
103 ISvcLocator* svcLocator = Gaudi::svcLocator();
104 StatusCode sc = svcLocator->service( "BesGlobalTrigSvc", m_tmpSvc );
105 m_pIBGT = dynamic_cast<BesGlobalTrigSvc*>( m_tmpSvc );
106
107 // set short and long track Id in service
108 m_pIBGT->setMdcStrkId( strackId );
109 m_pIBGT->setMdcLtrkId( ltrackId );
110}
void setMdcStrkId(std::vector< int > i)
void GetTCount()
Definition MdcTCount.cxx:27
Definition MdcTF.h:6