StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMtdTrigUtil.h
1 #ifndef STMTDTRIGUTIL_HH
2 #define STMTDTRIGUTIL_HH
3 
4 /***************************************************************************
5  *
6  * $Id: StMtdTrigUtil.h,v 1.2 2018/12/03 16:56:09 marr Exp $
7  * StMtdTrigUtil: this class reads in the MTD trigger information and
8  * determines the trigger unit that fire the MTD trigger
9  * Author: Rongrong Ma
10  *--------------------------------------------------------------------------
11  *
12  ***************************************************************************/
13 
14 #include "StMaker.h"
15 #include "StMtdUtil/StMtdConstants.h"
16 class StEvent;
17 class StMuDst;
18 class StPicoDst;
19 class StTriggerData;
20 
21 class StMtdTrigUtil: public StMaker {
22  public:
23  StMtdTrigUtil(const Char_t *name = "MtdTriggerDecision");
24  ~StMtdTrigUtil();
25 
26  Int_t Init();
27  Int_t InitRun(const Int_t runNumber);
28  Int_t Make();
29 
30  void setPosCorrToQTtac(Bool_t corr) { mPosCorrToQTtac = corr; }
31  Int_t getVpdTacSum() { return mVpdTacSum; }
32  Int_t getTHUBtime(const Int_t thub) { return mTHUBtime[thub-1]; }
33  Int_t getQt(const int backleg, const int module) { return mModuleToQT[backleg-1][module-1]; }
34  Int_t getQtPos(const int backleg, const int module) { return mModuleToQTPos[backleg-1][module-1]; }
35  Int_t getQtTacSum(const Int_t qt, const Int_t pos) { return mQtTacSum[qt-1][pos-1]; }
36  Int_t getQtTacSumHighestTwo(const Int_t qt, const Int_t index) { return mQtTacSumHighestTwo[qt-1][index]; }
37  Int_t getQtPosHighestTwo(const Int_t qt, const Int_t index) { return mQtPosHighestTwo[qt-1][index]; }
38  Int_t getQtPosTrig(const Int_t qt, const Int_t index){ return mQtPosTrig[qt-1][index]; }
39  Int_t getMT101Tac(const Int_t qt, const Int_t index) { return mMT101Tac[qt-1][index]; }
40  Int_t getMT101Id(const Int_t qt, const Int_t index) { return mMT101Id[qt-1][index]; }
41  Int_t getTF201TriggerBit() { return mTF201TriggerBit; }
42 
43  Bool_t isQtFireTrigger(const Int_t qt, const Int_t pos);
44  Bool_t isQtHighestTwo(const int qt, const int pos);
45 
46  Int_t getHitTimeInQT(const int backleg, const int module);
47  Int_t getHitTimeDiffToVPDInQT(const int backleg, const int module);
48  Int_t getHitTimeDiffToVPDInMT101(const int backleg, const int module);
49  Bool_t isHitFireTrigger(const Int_t backleg, const Int_t module);
50  Bool_t isHitHighestTwo(const Int_t backleg, const Int_t module);
51 
52  protected:
53  void reset();
54  void extractTrigInfo(StTriggerData *trigData);
55  void extractTrigInfo(StPicoDst *picoDst);
56  void findFireQT();
57 
58  enum {kNQTboard = 8};
59  Int_t mModuleToQT[gMtdNBacklegs][gMtdNModules]; // mapping between hit and QT
60  Int_t mModuleToQTPos[gMtdNBacklegs][gMtdNModules]; // mapping between hit and QT position
61  Int_t mQTtoModule[kNQTboard][8]; // mapping between QT and hit module
62  Int_t mQTSlewBinEdge[kNQTboard][16][8]; // slewing correction bin edge
63  Int_t mQTSlewCorr[kNQTboard][16][8]; // slewing correction parameters
64 
65  private:
66  Int_t mRunYear; // running year
67  StEvent *mStEvent; // Pointer to StEvent
68  StMuDst *mMuDst; // Pointer to MuDst event
69  StPicoDst *mPicoDst; // Pointer to PicoDst event
70  Bool_t mPosCorrToQTtac; // switch to apply position correction
71 
72  Int_t mVpdTacSum; // VPD TacSum
73  Int_t mTHUBtime[2]; // Trigger time from the two THUBs
74  Int_t mQtTacSum[kNQTboard][8]; // MTD: TACsum (j2+j3) of each position in each QT board
75  Int_t mMT101Tac[kNQTboard][2]; // Two largest TACsum's stored in MT101 for each QT board
76  Int_t mMT101Id[kNQTboard][2]; // Id of two largest TACsum's for each QT board
77  Int_t mTF201TriggerBit; // Trigger bit in TCU used for online trigger decision. Modified from the original format in MuDst.
78  Int_t mQtPosTrig[kNQTboard][2]; // QT channel that fire the trigger
79  Int_t mQtTacSumHighestTwo[kNQTboard][2]; // Two largest signals of the board
80  Int_t mQtPosHighestTwo[kNQTboard][2]; // QT channel having two largest signals of the board
81 
82  virtual const char *GetCVS() const {
83  static const char cvs[]="Tag $Name: $Id: built " __DATE__ " " __TIME__ ; return cvs;
84  }
85 
86  ClassDef(StMtdTrigUtil, 1);
87 };
88 
89 #endif
Main class that keeps TClonesArrays with main classes.
Definition: StPicoDst.h:40