StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBTofSortRawHit.h
1 /*******************************************************************
2  *
3  * $Id: StBTofSortRawHit.h,v 1.7 2017/10/20 17:50:33 smirnovd Exp $
4  *
5  * Author: Xin Dong
6  *****************************************************************
7  *
8  * Description: Utilities to group the raw Tof hits for convenient use
9  *
10  *****************************************************************
11  *
12  *******************************************************************/
13 
14 #ifndef StBTOFSORTRAWHIT_H
15 #define StBTOFSORTRAWHIT_H
16 
17 class StMaker;
18 class StEvent;
19 class StBTofRawHit;
20 class StBTofCollection;
21 class StBTofHeader;
23 class StBTofDaqMap;
24 
25 #include "StObject.h"
26 #include "TDataSet.h"
27 #include "TDataSetIter.h"
28 #include "TObjectSet.h"
29 
30 #include <vector>
31 
32 typedef std::vector<Int_t> IntVec;
33 typedef std::vector<UInt_t> UIntVec;
34 
35 struct TOFRawHit {
36  int fiberId;
37  int tray;
38  int channel;
39  UIntVec leadingTdc;
40  UIntVec trailingTdc;
41 };
42 
43  typedef std::vector<TOFRawHit> tofRawHitVector;
44  typedef std::vector<TOFRawHit>::iterator tofRawHitVectorIter;
45 
51 class StBTofSortRawHit : public StObject {
52  private:
53  // increase #trays to 124 (120 TOF + 2 VPD + 1 MTD)
54  static const Int_t mNTRAY = 124;
55  static const Int_t mNCHAN = 192;
56  static const Int_t mNFIBER = 4;
57  static const Int_t mNVPD = 19;
58  tofRawHitVector mRawHitVec[mNTRAY];
59 
60  Float_t mTriggerTimeWindow[mNTRAY][2]; //
61  Float_t mTriggerOffset; //
62  UInt_t mTriggerTime[mNFIBER]; //
63 
64  Float_t mVpdDelay[2*mNVPD];
65 
66  Bool_t mDebug;
67  StBTofDaqMap *mDaqMap;
68 
69  public:
72 
73  void Init();
76  void Init(StMaker *maker, StBTofDaqMap *daqMap);
77  void Reset();
79  //void setVpdDelay(Int_t runnumber);
80 
81  void setBTofCollection(StBTofCollection* tofColl);
82 
84  IntVec GetValidChannel(int tray);
86  UIntVec GetLeadingTdc(int tray, int channel, bool triggerevent=true);
88  UIntVec GetTrailingTdc(int tray, int channel, bool triggerevent=true);
89 
90 };
91 #endif
void setBTofCollection(StBTofCollection *tofColl)
set to use the VPD delays
IntVec GetValidChannel(int tray)
Returns the valid channel Ids for a tray.
UIntVec GetLeadingTdc(int tray, int channel, bool triggerevent=true)
Returns the leading Tdcs for one channel. triggerevent used as a switch for physical hits selection...
UIntVec GetTrailingTdc(int tray, int channel, bool triggerevent=true)
Returns the trailing Tdcs for one channel. triggerevent used as a switch for physical hits selection...