00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef STSVTDRIFTVELOCITYMAKER_H
00035 #define STSVTDRIFTVELOCITYMAKER_H
00036
00037 #ifndef StMaker_H
00038 #include "StMaker.h"
00039 #endif
00040 #include <string>
00041
00042 #include "TH1.h"
00043 #include "TH2.h"
00044
00045 class StEvent;
00046 class StTrack;
00047 class StSvtHit;
00048 class StChain;
00049 class StSvtData;
00050 class StSvtHybridDriftVelocity;
00051 class StSvtHybridCollection;
00052 class StSvtHitCollection;
00053
00054 class StSvtDriftVelocityMaker : public StMaker {
00055 private:
00056 StSvtHybridCollection* mSvtData;
00057 StSvtData* mSvtRawData;
00058 StSvtHybridCollection* mSvtDriftVeloc;
00059 int mNHybridDriftVelocityHisto;
00060 TH1D** mHybridDriftVelocityHisto;
00061 TH2D** mHybridDriftVelocity2DHisto;
00062 TH1D* mGlobalDriftVelocityHisto;
00063 TH2D* mGlobalDriftVelocity2DHisto;
00064 TH1D* mCalculatedDriftVelocity;
00065 TH1D* mLaserSpotDistL07B3_1;
00066 TH1D* mLaserSpotDistL15B3_1;
00067 TH1D* mLaserSpotDistL15B3_2;
00068 Int_t mEventCounter;
00069 Int_t mHitCounter;
00070 Int_t mNumTimeBins;
00071 Int_t mMaximumTB;
00072 Int_t mMinimumTB;
00073 bool mRaw;
00074 bool mDebug;
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 double mFraction;
00091 double mT0Guess;
00092 bool mMoveForward;
00093
00094 protected:
00095
00096 public:
00097 StSvtDriftVelocityMaker(const char *name="SvtDriftVelocity");
00098 virtual ~StSvtDriftVelocityMaker();
00099 virtual Int_t Init();
00100 virtual Int_t Make();
00101 virtual Int_t Finish();
00102
00103
00104 bool accept(StEvent* event);
00105 bool accept(StSvtHit* hit);
00106
00107 virtual Int_t SetSvtData();
00108 virtual Int_t SetSvtRawData();
00109 virtual Int_t SetSvtDriftVelocity();
00110 virtual Int_t FillHistogramsRaw();
00111 virtual Int_t FillHistogramsStEvent();
00112 virtual Int_t CalcDriftVelocity();
00113 virtual Int_t GetInjectorLine(float peak);
00114 virtual Int_t GetInjectorLine(float* peak);
00115 virtual Float_t GetClosestToLine(float peak1, float peak2);
00116 virtual Float_t GetTimeZero(int anode);
00117 virtual Float_t GetDistanceInjectorLine(int line);
00118 virtual Float_t FitVelocity(int nInjectorsFired, float* peak, float t0);
00119 virtual Float_t CalcV1(int anode, float velocity);
00120 virtual Float_t CalcV2(int anode, float velocity);
00121 virtual Float_t CalcV3(int anode, float velocity);
00122 virtual Int_t FillAllAnodes();
00123 virtual Int_t WriteToDb(Text_t *timestamp);
00124 TH1D* GetHybridHisto(int i) {return mHybridDriftVelocityHisto[i];};
00125 TH2D* GetHybrid2DHisto(int i) {return mHybridDriftVelocity2DHisto[i];};
00126 TH1D* GetGlobalHisto() {return mGlobalDriftVelocityHisto;};
00127 TH2D* GetGlobal2DHisto() {return mGlobalDriftVelocity2DHisto;};
00128 TH1D* GetFinalHisto() {return mCalculatedDriftVelocity;};
00129 TH1D* GetLaserSpotDistL07B3_1() {return mLaserSpotDistL07B3_1;};
00130 TH1D* GetLaserSpotDistL15B3_1() {return mLaserSpotDistL15B3_1;};
00131 TH1D* GetLaserSpotDistL15B3_2() {return mLaserSpotDistL15B3_2;};
00132 Int_t GetNumEvents() {return mEventCounter;};
00133 Int_t GetNumHits() {return mHitCounter;};
00134 Int_t GetNumTimeBins() {return mNumTimeBins;};
00135 Int_t GetMaximumTB() {return mMaximumTB;};
00136 Int_t GetMinimumTB() {return mMinimumTB;};
00137 bool DebugIsOn() {return mDebug;};
00138 bool DVCalcDoesMoveForward() {return mMoveForward;};
00139 double GetDVFraction() {return mFraction;};
00140 double GetDVT0Guess() {return mT0Guess;};
00141 void SetNumTimeBins(const Int_t x) {mNumTimeBins = x;};
00142 void SetMaximumTB(const Int_t x) {mMaximumTB = x;};
00143 void SetMinimumTB(const Int_t x) {mMinimumTB = x;};
00144 void SetDebug(int x) {mDebug = (x!=0);};
00145 void SetMoveForward(const bool x) {mMoveForward = x;};
00146 void SetFraction(const double x) {mFraction = x;};
00147 void SetT0Guess(const double x) {mT0Guess = x;};
00148
00149 ClassDef(StSvtDriftVelocityMaker,0)
00150 };
00151
00152 #endif
00153
00154