BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcTF Class Reference

#include <MdcTF.h>

Public Member Functions

 MdcTF ()
 ~MdcTF ()
void GetTrack ()
void ReadTFLut ()
void Dump ()
int GetstrackId (int i)
int GetltrackId (int i)
std::vector< int > & GetintrkSL1 ()
std::vector< int > & GetintrkSL2 ()

Detailed Description

Definition at line 6 of file MdcTF.h.

Constructor & Destructor Documentation

◆ MdcTF()

MdcTF::MdcTF ( )

Definition at line 20 of file MdcTF.cxx.

20 {
21 m_MdcTSF = MdcTSF::get_Mdc();
22 ReadTFLut();
23 // Dump();
24}
void ReadTFLut()
Definition MdcTF.cxx:78
static MdcTSF * get_Mdc(void)
Definition MdcTSF.cxx:28

◆ ~MdcTF()

MdcTF::~MdcTF ( )

Definition at line 25 of file MdcTF.cxx.

25{}

Member Function Documentation

◆ Dump()

void MdcTF::Dump ( )

Definition at line 115 of file MdcTF.cxx.

115 {
116 std::vector<int> combine_size;
117 cout << endl;
118 cout << " ***************check data file tf: ***************** " << endl;
119 cout << "*--------------------------BEGIN-------------------------------*" << endl;
120 cout << endl;
121 combine_size.clear();
122 for ( unsigned int i = 0; i < TF.size(); i++ )
123 {
124 cout << "Cell ID --> " << i << endl;
125 combine_size.push_back( TF[i].size() );
126 for ( unsigned int j = 0; j < TF[i].size(); j++ )
127 {
128 cout << TF[i][j] << " ";
129 if ( ( j + 1 ) % 4 == 0 ) cout << endl;
130 }
131 cout << endl;
132 }
133 sort( combine_size.begin(), combine_size.end() );
134 cout << "The Max Number of Combination is " << combine_size[combine_size.size() - 1] / 4
135 << endl;
136 cout << endl;
137 cout << "*----------------------------END-------------------------------*" << endl;
138}

◆ GetintrkSL1()

std::vector< int > & MdcTF::GetintrkSL1 ( )
inline

Definition at line 16 of file MdcTF.h.

16{ return intrkSL1; }

◆ GetintrkSL2()

std::vector< int > & MdcTF::GetintrkSL2 ( )
inline

Definition at line 17 of file MdcTF.h.

17{ return intrkSL2; }

◆ GetltrackId()

int MdcTF::GetltrackId ( int i)
inline

Definition at line 15 of file MdcTF.h.

15{ return ltrack[i]; }

◆ GetstrackId()

int MdcTF::GetstrackId ( int i)
inline

Definition at line 14 of file MdcTF.h.

14{ return strack[i]; }

◆ GetTrack()

void MdcTF::GetTrack ( )

Definition at line 26 of file MdcTF.cxx.

26 {
27 intrkSL1.clear();
28 intrkSL2.clear();
29
30 m_MdcTSF->GetTS();
31 for ( int i = 0; i < 128; i++ )
32 {
33 strack[i] = 0;
34 ltrack[i] = 0;
35 }
36
37 for ( int i = 0; i < 48; i++ )
38 {
39 if ( m_MdcTSF->GetSL1TSF( i ) == 1 ) intrkSL1.push_back( i );
40 }
41 for ( int i = 0; i < 80; i++ )
42 {
43 if ( m_MdcTSF->GetSL2TSF( i ) == 1 ) intrkSL2.push_back( i );
44 }
45
46 std::vector<std::vector<int>>::iterator viter = TF.begin();
47 std::vector<int>::iterator iter;
48 for ( int i = 0; i < 128; i++ )
49 {
50 int tracId5 = m_MdcTSF->GetSL5TSF( i );
51 if ( tracId5 != 0 )
52 {
53 iter = ( *( viter + i ) ).begin();
54 for ( ; iter != ( *( viter + i ) ).end(); iter += 4 )
55 {
56 int cellId3 = *( iter + 3 ) - 1;
57 int cellId4 = *( iter + 2 ) - 1;
58 int cellId10 = *(iter)-1;
59 int trackId3 = m_MdcTSF->GetSL3TSF( cellId3 );
60 int trackId4 = m_MdcTSF->GetSL4TSF( cellId4 );
61 int trackId10 = m_MdcTSF->GetSL10TSF( cellId10 );
62 if ( trackId3 > 0 && trackId4 > 0 ) { strack[i] = 1; }
63 if ( trackId3 > 0 && trackId4 > 0 && trackId10 > 0 ) ltrack[i] = 1;
64 }
65 }
66 }
67 // debug
68 /*
69 std::cout<<"*************IN TF.cxx ************"<<std::endl;
70 for(int j = 0; j < 128; j++) {
71 if(strack[j] == 1) std::cout<<"short track : "<<j<<std::endl;
72 }
73 for(int j = 0; j < 128; j++) {
74 if(ltrack[j] == 1) std::cout<<"long track : "<<j<<std::endl;
75 }
76 */
77}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)

◆ ReadTFLut()

void MdcTF::ReadTFLut ( )

Definition at line 78 of file MdcTF.cxx.

78 {
79 fstream readin;
80 TF.clear();
81 int a, b, l1, l2, l3, l4;
82 for ( int i = 1; i < 129; i++ )
83 {
84 int num = 0;
85 std::vector<int> tmp;
86 tmp.clear();
87 TString filename = TString( getenv( "TRIGGERROOT" ) );
88 filename += "/data/tf/ptd5-2/PTD-SL5C-L19-C";
89 filename += i;
90 filename += ".pat";
91 readin.open( filename, ios_base::in );
92 if ( !readin ) cerr << "can not open the file " << filename << endl;
93 while ( readin.good() )
94 {
95 readin >> a >> b >> l4 >> l3 >> l2 >> l1;
96 num++;
97 }
98 if ( i == 1 ) std::cout << "number of line is " << num - 1 << std::endl;
99 readin.close();
100 readin.clear();
101 readin.open( filename, ios_base::in );
102 if ( !readin ) std::cerr << "can not open the file again " << filename << std::endl;
103 for ( int j = 0; j < ( num - 1 ); j++ )
104 {
105 readin >> a >> b >> l4 >> l3 >> l2 >> l1;
106 tmp.push_back( l4 );
107 tmp.push_back( l3 );
108 tmp.push_back( l2 );
109 tmp.push_back( l1 );
110 }
111 readin.close();
112 TF.push_back( tmp );
113 }
114}

Referenced by MdcTF().


The documentation for this class was generated from the following files: