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
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 #ifndef STAR_StSvtSeqAdj
00085 #define STAR_StSvtSeqAdj
00087 // //
00088
00089
00091 #ifndef StMaker_H
00092 #include "StMaker.h"
00093 #endif
00094
00095 #include <Stiostream.h>
00096 #include "Stiostream.h"
00097 #include <string>
00098
00099 class TH1D;
00100 class TH2F;
00101 class TFile;
00102 class StSequence;
00103 class StSvtData;
00104 class StSvtHybridData;
00105 class StSvtInverseProducts;
00106 class StSvtPedSub;
00107 class TObjectSet;
00108 class StSvtHybridCollection;
00109 class StSvtBadAnode;
00110 class StSvtProbValues;
00111 class StMCTruth;
00112
00113 class StSvtSeqAdjMaker : public StMaker
00114 {
00115 public:
00116 StSvtSeqAdjMaker(const char *name = "SvtSeqAdj");
00117 StSvtSeqAdjMaker(StSvtSeqAdjMaker& analmaker);
00118 ~StSvtSeqAdjMaker();
00119
00120 virtual Int_t Init();
00121 virtual Int_t InitRun( int runnumber);
00122 virtual Int_t Make();
00123 virtual Int_t Finish();
00124
00125 Int_t SetSvtData();
00126 Int_t GetSvtRawData();
00127 Int_t GetSvtPedestals();
00128 Int_t GetBadAnodes();
00129 Int_t GetPedOffset(){return mPedOffSet;};
00130 void CommonModeNoiseCalc(int iAnode);
00131 void CommonModeNoiseSub(int iAnode);
00132 void SubtractFirstAnode(int iAnode);
00133 Int_t FindBlackAnodes();
00134 Int_t AdjustSequences1( int iAnode, int Anode);
00135 Int_t AdjustSequences2(int iAnode, int Anode);
00136 Int_t MergeSequences(StSequence* Seq, int nSeq,StMCTruth *Tru=0);
00137 Int_t CreateHist(Int_t tNuOfHyb);
00138 void MakeHistogramsProb(int index,int Anode);
00139 void MakeHistogramsAdc(StSvtHybridData* hybridData, int index,int Anode, int Count);
00140 Int_t Reset();
00141
00142 Int_t SetMinAdcLevels( int MinAdc1, int MinAbove1, int MinAdc2, int MinAbove2, int PedOffset);
00143 Int_t SetPedestalFile(const char* PedFile);
00144 Int_t SetLowInvProd(int LowInvProd);
00145
00146 virtual const char *GetCVS() const {
00147 static const char cvs[]="Tag $Name: $ $Id: StSvtSeqAdjMaker.h,v 1.26 2007/07/12 20:10:35 fisyak Exp $ built "__DATE__" "__TIME__ ;
00148 return cvs;
00149 }
00150
00151 protected:
00152 St_ObjectSet* mSvtDataSet;
00153 StSvtData* mSvtRawData;
00154 StSvtData* mSvtAdjData;
00155 StSvtHybridData* mHybridRawData ;
00156 StSvtHybridData* mHybridAdjData ;
00157
00158 StSvtHybridCollection* mSvtBadAnodes;
00159 StSvtHybridCollection* mSvtPedColl;
00160
00161 StSvtInverseProducts* mInvProd;
00162 StSvtPedSub* mSvtPedSub;
00163 StSvtProbValues* mProbValue;
00164
00165 const char* mPedFile;
00166
00167 int* anolist;
00168 TFile *hfile;
00169 unsigned long Evt_counts;
00170
00171 TH1F* mOcupancyHisto;
00172 TH1F* EventOccupancy;
00173 TH1D** mInvProdSeqAdj;
00174 TH1F** mRawAdc;
00175 TH1F** mAdcAfter;
00176 TH1F* mCommonModePitch;
00177 TH1F* mCommonModeCount;
00178 TH2F** mTimeAn;
00179 TH1F** mRawPixel;
00180 int mNumOfSeq;
00181 int m_n_seq_lo;
00182 int m_n_seq_hi;
00183 int m_thresh_lo;
00184 int m_inv_prod_lo;
00185 int m_thresh_hi;
00186
00187 int mTotalNumberOfHybrids;
00188 int mPedOffSet;
00189 int mCommonModeNoise[128];
00190 int mCommonModeNoiseAn[128];
00191 int mNAnodes;
00192 int doCommon;
00193 int adcCommon[128];
00194
00195 private:
00196 string buildFileName(string dir, string fileName, string extention);
00197 string baseName(string s);
00198 ClassDef(StSvtSeqAdjMaker,0)
00199
00200 };
00201
00202
00203 #endif