StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StVpdAnalysisMaker.h
1 /*******************************************************************
2  *
3  * $Id: StVpdAnalysisMaker.h,v 1.2 2014/08/06 11:43:48 jeromel Exp $
4  *
5  * Author: Xin Dong
6  *****************************************************************
7  *
8  * Description: Vpd analysis Maker to do the calibration for pVPD
9  * hit pattern, VzVpd, Tdiff, Tstart
10  *
11  *****************************************************************
12  *
13  * $Log: StVpdAnalysisMaker.h,v $
14  * Revision 1.2 2014/08/06 11:43:48 jeromel
15  * Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
16  *
17  * Revision 1.1 2008/09/02 18:27:39 dongx
18  * first release.
19  * - Vpd analysis maker from MuDst to extract vz, Tstart, Tdiff etc.
20  * - TPC primary vertex used for Tstart and Tdiff calculation
21  *
22  *
23  *******************************************************************/
24 #ifndef STVPDANALYSISMAKER_H
25 #define STVPDANALYSISMAKER_H
26 
27 #include "TMath.h"
28 #include "TF1.h"
29 #include "StMaker.h"
30 
31 #define VHRBIN2PS 24.4140625 // Very High resolution mode, pico-second per bin
32  // 1000*25/1024 (ps/chn)
33 #define HRBIN2PS 97.65625 // High resolution mode, pico-second per bin
34  // 97.65625= 1000*100/1024 (ps/chn)
35 #define TMAX 51200. // tdc limit
36 
37 #include <string>
38 #include <vector>
39 #ifndef ST_NO_NAMESPACES
40 using std::string;
41 using std::vector;
42 #endif
43 
44 class StEvent;
45 class StTofCollection;
47 class StMuDst;
48 class StMuDstMaker;
49 class StMuEvent;
50 #include "StTofUtil/StTofrDaqMap.h"
51 #include "StTofUtil/StTofINLCorr.h"
52 #include "StTofUtil/StSortTofRawData.h"
53 
54 #if !defined(ST_NO_TEMPLATE_DEF_ARGS) || defined(__CINT__)
55 typedef vector<Int_t> IntVec;
56 typedef vector<Double_t> DoubleVec;
57 #else
58 typedef vector<Int_t, allocator<Int_t>> IntVec;
59 typedef vector<Double_t, allocator<Double_t>> DoubleVec;
60 #endif
61 
62 class StVpdAnalysisMaker : public StMaker{
63 public:
64 
66  StVpdAnalysisMaker(const char* name="vpdAna");
69 
70  Int_t Init();
71  Int_t InitRun(int);
72  Int_t FinishRun(int);
73  Int_t Make();
74  Int_t Finish();
75 
76  Int_t processEventYear8();
77 
79  void resetCalibPars();
80  void resetVpdPars();
82  Int_t initParameters(int);
83 
84  void setVPDHitsCut(const Int_t, const Int_t);
85 
87  void setSlewingCorr(const bool);
88 
90  void tsum(const Double_t *tot, const Double_t *time);
91 
92  Int_t numberOfVpdEast() const;
93  Int_t numberOfVpdWest() const;
94  Double_t tstart() const;
95  Double_t tdiff() const;
96  Double_t vzVpd() const;
97 
98 private:
100  static const Int_t mNTDIG = 8; // 8 per tray in Run 8++
101  static const Int_t mNTray8 = 5; // 5 trays in Run 8
102  static const Int_t mNVPD = 19; // 19 tubes at each side
103  static const Int_t mWestVpdTrayId = 121;
104  static const Int_t mEastVpdTrayId = 122;
105  static const Int_t mNValidTrays_Run8 = 5;
106  static const Int_t mNBinMax = 60;
107 
108  StTofINLCorr* mTofINLCorr;
109  StTofrDaqMap* mDaqMap;
110 
111  Double_t mVPDTotEdge[2*mNVPD][mNBinMax];
112  Double_t mVPDTotCorr[2*mNVPD][mNBinMax];
113  Double_t mVPDTZero[2*mNVPD];
114 
115  Double_t mPhaseOffset8;
116 
117  Double_t mVPDLeTime[2*mNVPD];
118  Double_t mVPDTot[2*mNVPD];
119 
120  Double_t mTSumEast;
121  Double_t mTSumWest;
122  UInt_t mVPDHitPatternEast;
123  UInt_t mVPDHitPatternWest;
124  Int_t mNEast;
125  Int_t mNWest;
126  Double_t mVPDVtxZ;
127  Double_t mTDiff;
128  Double_t mTStart;
129 
130  StEvent* mEvent;
131  StTofCollection* mTofCollection;
132  StSortTofRawData* mSortTofRawData;
133 
134  StMuDstMaker* mMuDstMaker;
135  StMuDst* mMuDst;
136  StMuEvent* mMuEvent;
137 
138  Double_t mVertexZ;
139  Bool_t mYear8;
140 
141  Bool_t mValidCalibPar;
142  Bool_t mSlewingCorr;
143  Double_t mVPDEastHitsCut;
144  Double_t mVPDWestHitsCut;
145 
146  virtual const char *GetCVS() const
147  {static const char cvs[]="Tag $Name: $ $Id: StVpdAnalysisMaker.h,v 1.2 2014/08/06 11:43:48 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
148 
149  ClassDef(StVpdAnalysisMaker,1)
150 };
151 
152 inline void StVpdAnalysisMaker::setVPDHitsCut(const Int_t ieast, const Int_t iwest) { mVPDEastHitsCut=ieast ; mVPDWestHitsCut=iwest; }
153 
154 inline void StVpdAnalysisMaker::setSlewingCorr(const bool val) { mSlewingCorr=val; }
155 
156 inline Int_t StVpdAnalysisMaker::numberOfVpdEast() const { return mNEast; }
157 
158 inline Int_t StVpdAnalysisMaker::numberOfVpdWest() const { return mNWest; }
159 
160 inline Double_t StVpdAnalysisMaker::tstart() const { return mTStart; }
161 
162 inline Double_t StVpdAnalysisMaker::tdiff() const { return mTDiff; }
163 
164 inline Double_t StVpdAnalysisMaker::vzVpd() const { return mVPDVtxZ; }
165 
166 #endif
void tsum(const Double_t *tot, const Double_t *time)
Run 8++ -&gt;
StVpdAnalysisMaker(const char *name="vpdAna")
Default constructor.
void resetCalibPars()
Reset the calibration parameters.
~StVpdAnalysisMaker()
Destructor.
void setSlewingCorr(const bool)
switch to turn on slewing correction or not - maybe only T0 in the first step.
Int_t initParameters(int)
Initialize the calibration parameters from dbase.