StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBTofINLCorr.h
1 /*******************************************************************
2  *
3  * $Id: StBTofINLCorr.h,v 1.8 2017/09/21 22:21:18 geurts Exp $
4  *
5  * Author: Xin Dong
6  *****************************************************************
7  *
8  * Description: INL correction for all TDIG board channels
9  *
10  *****************************************************************
11  *
12  * $Log: StBTofINLCorr.h,v $
13  * Revision 1.8 2017/09/21 22:21:18 geurts
14  * increasee max number of TDIGs that are stored in database from 1203 to 1206, after recent upload of three new boards to INL correction database table.
15  * Relevant to all run-17+ productions.
16  *
17  * Revision 1.7 2016/07/13 19:13:19 jdb
18  * Increasing the max # of TDIG for INL corrections for the recent upload of a new board to the tof INL Corr DB Table
19  *
20  * Revision 1.6 2013/12/06 23:27:04 geurts
21  * increasee max number of TDIGs that are stored in database from 1200 to 1202
22  *
23  * Revision 1.5 2012/02/11 02:13:23 geurts
24  * allow direct access to INL corrections given TDIG-Id
25  *
26  * Revision 1.4 2009/12/14 19:38:30 dongx
27  * - mNValidBoards set by the read-in database entrie instead of a hard-coded number
28  * - clean up mNValidTrays and related functions (not needed since previous versions)
29  *
30  * Revision 1.3 2009/03/04 04:57:36 dongx
31  * INL arrays changed from float to short - memory occupied reduced by a factor of 2
32  *
33  * Revision 1.2 2009/02/13 23:32:52 dongx
34  * fixed the crash when no INL table for some board is available
35  *
36  * Revision 1.1 2009/02/02 21:57:51 dongx
37  * first release - Barrel TOF INL correction functions
38  *
39  *
40  *******************************************************************/
41 #ifndef STBTOFINLCORR_H
42 #define STBTOFINLCORR_H
43 
44 #include "StObject.h"
45 #include "StMaker.h"
46 #include <assert.h>
47 #include "Stypes.h"
48 #include "TDataSet.h"
49 #include "TDataSetIter.h"
50 #include "TObjectSet.h"
51 #include <string>
52 #include "StEnumerations.h"
53 
59  private:
60  static const Int_t mNTray = 120;
61  static const Int_t mNTDIGOnTray = 8;
62  static const Int_t mNGLOBALCHANMAX = 192;
63 
64  // nMTDIGMAX = 1202 Originally
65  // July, 2016 uploaded INL corrs for new board but also keeping all of the old ones
66  // so total is now 1203
67  static const Int_t mNTDIGMAX = 1206;
68  static const Int_t mNChanOnTDIG = 24;
69  static const Int_t mNChanMAX = 1024;
70  static const Int_t mNBoardIdMAX = 4800;
71 
72  static const Int_t mEastVpdTrayId = 122;
73  static const Int_t mWestVpdTrayId = 121;
74 
75  Int_t mTdigOnTray[mNTray][mNTDIGOnTray];
76  Int_t mTdigOnEastVpd[mNTDIGOnTray];
77  Int_t mTdigOnWestVpd[mNTDIGOnTray];
78 
79  Int_t mBoardId[mNTDIGMAX];
80  Int_t mBoardId2Index[mNBoardIdMAX]; // index in mNTDIGMAX for board #Id
81  Short_t mINLCorr[mNTDIGMAX][mNChanOnTDIG][mNChanMAX];
82 
83  Int_t mNValidBoards;
84 
85  public:
86  StBTofINLCorr();
87  ~StBTofINLCorr();
88 
89  void init();
90  void init(StMaker *maker);
92  void initFromDbase(StMaker *maker);
93  void Reset();
94 
96  float getTrayINLCorr(int trayId, int globalTdcChan, int bin);
98  float getVpdINLCorr(StBeamDirection eastwest, int globalTdcChan, int bin);
100  float getTdigINLCorr(int tdigId, int tdcChannel, int bin);
101 
102 
103 };
104 
105 #endif
float getTdigINLCorr(int tdigId, int tdcChannel, int bin)
direct access to INL correction table for any TDIG-Id
float getTrayINLCorr(int trayId, int globalTdcChan, int bin)
To get the INL correction tables for trays.
void initFromDbase(StMaker *maker)
Initial function to access the data base and retrieve INL tables.
float getVpdINLCorr(StBeamDirection eastwest, int globalTdcChan, int bin)
To get the INL correction tables for vpds.