MdcTF Class Reference

#include <MdcTF.h>

List of all members.

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 ()

Private Attributes

MdcTSFm_MdcTSF
int strack [128]
int ltrack [128]
std::vector< int > intrkSL1
std::vector< int > intrkSL2
std::vector< std::vector<
int > > 
TF


Detailed Description

Definition at line 6 of file MdcTF.h.


Constructor & Destructor Documentation

MdcTF::MdcTF (  ) 

Definition at line 20 of file MdcTF.cxx.

References MdcTSF::get_Mdc(), m_MdcTSF, and ReadTFLut().

00021 {
00022   m_MdcTSF = MdcTSF::get_Mdc();
00023   ReadTFLut();
00024   //Dump();
00025 }

MdcTF::~MdcTF (  ) 

Definition at line 26 of file MdcTF.cxx.

00027 {
00028 }


Member Function Documentation

void MdcTF::Dump (  ) 

Definition at line 114 of file MdcTF.cxx.

References genRecEmupikp::i, ganga-rec::j, delete_small_size::size, and TF.

00115 {
00116   std::vector<int> combine_size;
00117   cout<<endl;
00118   cout<<"     ***************check data file tf: *****************      "<<endl;
00119   cout<<"*--------------------------BEGIN-------------------------------*"<<endl;
00120   cout<<endl;
00121   combine_size.clear();
00122   for(unsigned int i=0; i<TF.size(); i++) {
00123     cout<<"Cell ID --> "<<i<<endl;
00124     combine_size.push_back(TF[i].size());
00125     for(unsigned int j=0; j<TF[i].size(); j++) {
00126       cout<<TF[i][j]<<" ";
00127       if((j+1)%4==0) cout<<endl;
00128     }  
00129     cout<<endl;
00130   } 
00131   sort(combine_size.begin(),combine_size.end());
00132   cout<<"The Max Number of Combination is "<<combine_size[combine_size.size()-1]/4<<endl;
00133   cout<<endl;
00134   cout<<"*----------------------------END-------------------------------*"<<endl;
00135 }

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

Definition at line 16 of file MdcTF.h.

References intrkSL1.

Referenced by MdcTCount::GetTCount().

00016 { return intrkSL1; }

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

Definition at line 17 of file MdcTF.h.

References intrkSL2.

Referenced by MdcTCount::GetTCount().

00017 { return intrkSL2; }

int MdcTF::GetltrackId ( int  i  )  [inline]

Definition at line 15 of file MdcTF.h.

References ltrack.

Referenced by MdcTCount::GetTCount().

00015 { return ltrack[i]; }

int MdcTF::GetstrackId ( int  i  )  [inline]

Definition at line 14 of file MdcTF.h.

References strack.

Referenced by MdcTCount::GetTCount().

00014 { return strack[i]; }

void MdcTF::GetTrack (  ) 

Definition at line 29 of file MdcTF.cxx.

References MdcTSF::GetSL10TSF(), MdcTSF::GetSL1TSF(), MdcTSF::GetSL2TSF(), MdcTSF::GetSL3TSF(), MdcTSF::GetSL4TSF(), MdcTSF::GetSL5TSF(), MdcTSF::GetTS(), genRecEmupikp::i, intrkSL1, intrkSL2, iter(), ltrack, m_MdcTSF, strack, and TF.

Referenced by MdcTCount::GetTCount().

00030 {
00031   intrkSL1.clear();
00032   intrkSL2.clear();
00033 
00034   m_MdcTSF->GetTS();
00035   for(int i=0;i<128;i++) { strack[i] = 0; ltrack[i] = 0; }
00036   
00037   for(int i=0; i<48; i++) {
00038     if(m_MdcTSF->GetSL1TSF(i)==1)  intrkSL1.push_back(i);
00039   }
00040   for(int i=0; i<80; i++) {
00041     if(m_MdcTSF->GetSL2TSF(i)==1)  intrkSL2.push_back(i); 
00042   }
00043 
00044   std::vector<std::vector<int> >::iterator viter=TF.begin();
00045   std::vector<int>::iterator iter;
00046   for(int i=0;i<128;i++)
00047   {
00048     int tracId5 = m_MdcTSF->GetSL5TSF(i);
00049     if(tracId5!=0)
00050     {
00051       iter = (*(viter + i)).begin();
00052       for(;iter!=(*(viter + i)).end();iter+=4)
00053       {
00054         int cellId3 = *(iter+3)-1;
00055         int cellId4 = *(iter+2)-1;
00056         int cellId10 =*(iter)-1;
00057         int trackId3 = m_MdcTSF->GetSL3TSF(cellId3);
00058         int trackId4 = m_MdcTSF->GetSL4TSF(cellId4);
00059         int trackId10 = m_MdcTSF->GetSL10TSF(cellId10); 
00060         if(trackId3 > 0 && trackId4 > 0) { strack[i] = 1;  }
00061         if(trackId3 > 0 && trackId4 > 0 && trackId10 > 0) ltrack[i] = 1; 
00062       }
00063     }
00064   }
00065   //debug
00066 /*
00067   std::cout<<"*************IN TF.cxx ************"<<std::endl;
00068   for(int j = 0; j < 128; j++) {
00069     if(strack[j] == 1) std::cout<<"short track : "<<j<<std::endl;
00070   }
00071   for(int j = 0; j < 128; j++) {
00072     if(ltrack[j] == 1) std::cout<<"long track : "<<j<<std::endl;
00073   }
00074 */
00075 }

void MdcTF::ReadTFLut (  ) 

Definition at line 76 of file MdcTF.cxx.

References check_raw_filter::filename, genRecEmupikp::i, ganga-rec::j, num, and TF.

Referenced by MdcTF().

00077 {
00078   fstream readin;
00079   TF.clear();
00080   int a,b,l1,l2,l3,l4;
00081   for(int i=1;i<129;i++)
00082   {
00083     int num=0;
00084     std::vector<int> tmp;
00085     tmp.clear();
00086     TString filename = TString(getenv( "TRIGGERROOT" ));
00087     filename+="/data/tf/ptd5-2/PTD-SL5C-L19-C";
00088     filename+=i;
00089     filename+=".pat";
00090     readin.open(filename,ios_base::in);
00091     if(!readin) cerr<<"can not open the file "<<filename<<endl;
00092     while(readin.good())
00093     {
00094       readin>>a>>b>>l4>>l3>>l2>>l1;
00095       num++;
00096     }
00097     if(i==1) std::cout<<"number of line is "<<num-1<<std::endl;
00098     readin.close();
00099     readin.clear();
00100     readin.open(filename,ios_base::in);
00101     if(!readin) std::cerr<<"can not open the file again "<<filename<<std::endl;
00102     for(int j=0;j<(num-1);j++)
00103     {
00104       readin>>a>>b>>l4>>l3>>l2>>l1;
00105       tmp.push_back(l4);
00106       tmp.push_back(l3);
00107       tmp.push_back(l2);
00108       tmp.push_back(l1);
00109     }
00110     readin.close();
00111     TF.push_back(tmp);
00112   }
00113 }


Member Data Documentation

std::vector<int> MdcTF::intrkSL1 [private]

Definition at line 22 of file MdcTF.h.

Referenced by GetintrkSL1(), and GetTrack().

std::vector<int> MdcTF::intrkSL2 [private]

Definition at line 23 of file MdcTF.h.

Referenced by GetintrkSL2(), and GetTrack().

int MdcTF::ltrack[128] [private]

Definition at line 21 of file MdcTF.h.

Referenced by GetltrackId(), and GetTrack().

MdcTSF* MdcTF::m_MdcTSF [private]

Definition at line 19 of file MdcTF.h.

Referenced by GetTrack(), and MdcTF().

int MdcTF::strack[128] [private]

Definition at line 20 of file MdcTF.h.

Referenced by GetstrackId(), and GetTrack().

std::vector<std::vector<int> > MdcTF::TF [private]

Definition at line 24 of file MdcTF.h.

Referenced by Dump(), GetTrack(), and ReadTFLut().


Generated on Tue Nov 29 23:20:17 2016 for BOSS_7.0.2 by  doxygen 1.4.7