StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBTofDaqMap.h
1 /*******************************************************************
2  *
3  * $Id: StBTofDaqMap.h,v 1.3 2017/10/20 17:50:33 smirnovd Exp $
4  *
5  * Author: Xin Dong
6  *****************************************************************
7  *
8  * Description: (1) Mapping between Daq channel numbers and Cell numbers
9  * (2) Parameters initalize from dbase
10  *
11  *****************************************************************
12  *
13  * $Log: StBTofDaqMap.h,v $
14  * Revision 1.3 2017/10/20 17:50:33 smirnovd
15  * Squashed commit of the following:
16  *
17  * StBTof: Remove outdated ClassImp macro
18  *
19  * Prefer explicit namespace for std:: names in header files
20  *
21  * Removed unnecessary specification of default std::allocator
22  *
23  * Frank signed-off
24  *
25  * Revision 1.2 2009/02/13 19:47:33 dongx
26  * mNValidTrays set by the tofTrayConfig in db now
27  *
28  * Revision 1.1 2009/02/02 21:56:34 dongx
29  * first release - Barrel TOF daq mapping
30  *
31  *
32  *******************************************************************/
33 #ifndef STBTOFDAQMAP_H
34 #define STBTOFDAQMAP_H
35 
36 #include "StObject.h"
37 #include "StMaker.h"
38 #include <assert.h>
39 #include "Stypes.h"
40 #include "TDataSet.h"
41 #include "TDataSetIter.h"
42 #include "TObjectSet.h"
43 #include <string>
44 
45 #include <vector>
46 
47 typedef std::vector<Int_t> IntVec;
48 
54  private:
55  static const Int_t mDAQOVERFLOW = 255; // daq max channel #
56  static const Int_t mNTOF = 192; // 192 for tof in Run 8++
57  static const Int_t mNTray = 120; // # of trays
58  static const Int_t mNModule = 32; // 32 for tofr5++
59  static const Int_t mNCell = 6;
60  static const Int_t mNVPD = 19; // 19 on each side
61 
62  Int_t mNValidTrays;
63 
64  Int_t mMRPC2TDIGChan[mNTOF];
65  Int_t mTDIG2MRPCChan[mNTOF];
66  Int_t mEastPMT2TDIGLeChan[mNVPD], mEastPMT2TDIGTeChan[mNVPD];
67  Int_t mTDIGLe2EastPMTChan[mNTOF], mTDIGTe2EastPMTChan[mNTOF];
68  Int_t mWestPMT2TDIGLeChan[mNVPD], mWestPMT2TDIGTeChan[mNVPD];
69  Int_t mTDIGLe2WestPMTChan[mNTOF], mTDIGTe2WestPMTChan[mNTOF];
70 
72  Int_t mValidTrayId[mNTray];
73 
74  public:
76  StBTofDaqMap();
77  ~StBTofDaqMap();
78 
80  void Init(StMaker *maker);
81  void Reset();
82 
84  void setNValidTrays(int ntrays);
85 
87  IntVec TDIGChan2Cell( const Int_t iTdc );
89  Int_t Cell2TDIGChan( const Int_t iModule, const Int_t iCell );
90 
93  Int_t EastPMT2TDIGLeChan( const Int_t iTube );
95  Int_t TDIGLeChan2EastPMT( const Int_t iTdc );
97  Int_t EastPMT2TDIGTeChan( const Int_t iTube );
99  Int_t TDIGTeChan2EastPMT( const Int_t iTdc );
101  Int_t WestPMT2TDIGLeChan( const Int_t iTube );
103  Int_t TDIGLeChan2WestPMT( const Int_t iTdc );
105  Int_t WestPMT2TDIGTeChan( const Int_t iTube );
107  Int_t TDIGTeChan2WestPMT( const Int_t iTdc );
108 
110  IntVec ValidTrays();
112  Int_t numberOfValidTrays();
113 };
114 
115 inline void StBTofDaqMap::setNValidTrays(int ntrays) { mNValidTrays = ntrays; }
116 inline Int_t StBTofDaqMap::numberOfValidTrays() { return mNValidTrays; }
117 #endif
void Init(StMaker *maker)
Initial function, need a maker to access the data base.
Int_t numberOfValidTrays()
Returns the number of valid trays.
Definition: StBTofDaqMap.h:116
Int_t WestPMT2TDIGTeChan(const Int_t iTube)
To convert west VPD PMT number to TDIG trailing channel number.
Int_t WestPMT2TDIGLeChan(const Int_t iTube)
To convert west VPD PMT number to TDIG leading channel number.
Int_t TDIGLeChan2WestPMT(const Int_t iTdc)
To convert TDIG leading channel number to west VPD PMT number.
IntVec ValidTrays()
Returns the list of valid tray Ids.
Int_t TDIGLeChan2EastPMT(const Int_t iTdc)
To convert TDIG leading channel number to east VPD PMT number.
Int_t Cell2TDIGChan(const Int_t iModule, const Int_t iCell)
To convert module/cell number to TDIG channel number.
Int_t TDIGTeChan2EastPMT(const Int_t iTdc)
To convert TDIG trailing channel number to east VPD PMT number.
Int_t EastPMT2TDIGTeChan(const Int_t iTube)
To convert east VPD PMT number to TDIG trailing channel number.
void setNValidTrays(int ntrays)
Set the number valid trays.
Definition: StBTofDaqMap.h:115
Int_t TDIGTeChan2WestPMT(const Int_t iTdc)
To convert TDIG trailing channel number to west VPD PMT number.
IntVec TDIGChan2Cell(const Int_t iTdc)
To convert TDIG channel number to module/cell number.
StBTofDaqMap()
Default constructor.
Int_t EastPMT2TDIGLeChan(const Int_t iTube)