StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPmdMapUtil.h
1 
5 /*********************************************************
6  *
7  * $Id: StPmdMapUtil.h,v 1.6 2018/06/08 03:33:09 smirnovd Exp $
8  *
9  * Author: Dipak Mishra
10  *
11  ************************************************************
12  *
13  * Description: This is the class of PMD geometry for offline
14  *
15  *************************************************************
16  *
17  * $Log: StPmdMapUtil.h,v $
18  * Revision 1.6 2018/06/08 03:33:09 smirnovd
19  * Fix typo in header include guards
20  *
21  * Revision 1.5 2010/05/02 13:14:00 rashmi
22  * removed some couts
23  *
24  * Revision 1.4 2007/05/26 00:40:07 perev
25  * Initialization added
26  *
27  * Revision 1.3 2007/05/21 04:38:05 rashmi
28  * functions for SMChain Combination information 21/05/07
29  *
30  * Revision 1.2 2005/01/27 13:10:13 subhasis
31  * New map for 2005 data
32  *
33  * Revision 1.1 2004/06/24 13:54:35 subhasis
34  * Maputils added
35  *
36  *************************************************************/
37 #ifndef STAR_StPmdMapUtil
38 #define STAR_StPmdMapUtil
39 #include <stdlib.h>
40 #include <TMatrix.h>
41 #include <sstream>
42 #include <Stiostream.h>
43 #include <math.h>
44 #include "StPmdGeom.h"
45 #include "StPmdDBUtil.h"
46 
47 class StPmdGeom;
48 
49 class StPmdMapUtil {
50  private:
51  char beg[1];
52  StPmdGeom * mPmdGeom;
53  protected:
54  Int_t m_TempChannelInBoard[PMD_CRAMS_MAX*2][PMD_ROW_MAX][PMD_COL_MAX];
55  Int_t m_ChannelInBoard [PMD_CRAMS_MAX*2][PMD_ROW_MAX][PMD_COL_MAX];
56  Int_t m_Chain [PMD_CRAMS_MAX*2][PMD_ROW_MAX][PMD_COL_MAX];
57  Int_t SMChainExists[24][48];
58  Int_t nBoardSMChain[24][48];
59  Int_t FirstBoard[60];
60  Int_t Chain_Combo[60];
61  Int_t SM_Combo[60];
62 
63  Int_t nSMChain;
64  char end[1];
65  public:
66  StPmdMapUtil();
67  virtual ~StPmdMapUtil();
68 
69  void StoreMapInfo();
70  void StoreMapInfo(Int_t );
71  void ReverseChannelOriginal( Int_t, Int_t, Int_t, Int_t& );
72  void ReverseChannelConverted( Int_t, Int_t, Int_t, Int_t& );
73  void ChainNumber( Int_t, Int_t, Int_t, Int_t& );
74 
75  void SetSMChainCombos(Int_t);
76  void ComboSMChain(Int_t,Int_t&,Int_t&);
77  Int_t GetComboFirstBoard(Int_t);
78  Int_t GetSMChainCombo(Int_t,Int_t);
79  Int_t GetnSMChain();
80  Int_t GetnBoardSMChain(Int_t);
81  Int_t GetnBoardSMChain(Int_t,Int_t);
82 
83  ClassDef(StPmdMapUtil, 1)
84  };
85 
86  inline void StPmdMapUtil::ReverseChannelConverted(Int_t sm, Int_t row, Int_t col, Int_t& channel)
87 {
88  channel=m_TempChannelInBoard[sm-1][row-1][col-1];
89  //cout<<"channelC, sm,row,col "<<channel<<" "<<sm<<" "<<row<<" "<<col<<endl;
90 }
91 
92 inline void StPmdMapUtil::ReverseChannelOriginal(Int_t sm, Int_t row, Int_t col, Int_t& channel)
93 {
94  channel=m_ChannelInBoard[sm-1][row-1][col-1];
95 //cout<<"channelR, sm,row,col "<<channel<<" "<<sm<<" "<<row<<" "<<col<<endl;
96 }
97 
98 inline void StPmdMapUtil::ChainNumber(Int_t sm, Int_t row, Int_t col, Int_t& chain)
99 {
100 chain=m_Chain[sm-1][row-1][col-1];
101 //cout<<"chain, sm,row,col "<<chain<<" "<<sm<<" "<<row<<" "<<col<<endl;
102 }
103 
104 inline void StPmdMapUtil::ComboSMChain(Int_t icombo,Int_t& ism, Int_t& ichain){
105  ism = SM_Combo[icombo];
106  ichain = Chain_Combo[icombo];
107 }
108 inline Int_t StPmdMapUtil::GetnBoardSMChain(Int_t ism,Int_t ichain){
109  return nBoardSMChain[ism-1][ichain-1];
110 }
111 inline Int_t StPmdMapUtil::GetnBoardSMChain(Int_t icombo){
112  Int_t ism=0,ichain=0;
113  ComboSMChain(icombo,ism,ichain);
114  // cout<<"ism,ichain="<<ism<<","<<ichain<<endl;
115  return nBoardSMChain[ism-1][ichain-1];
116 }
117 
118 inline Int_t StPmdMapUtil::GetnSMChain(){
119  return nSMChain;
120 }
121 
122 inline Int_t StPmdMapUtil::GetComboFirstBoard(Int_t icombo){
123  return FirstBoard[icombo];
124 }
125 
126 #endif
127 
virtual ~StPmdMapUtil()
A constructor.
void StoreMapInfo()
A destructor.
StPmdMapUtil()
A constructor.