00001 #ifndef StTpcHitMaker_H
00002 #define StTpcHitMaker_H
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 #include "StRTSBaseMaker.h"
00065 #include "TString.h"
00066 #include "StThreeVectorF.hh"
00067 #include "THnSparse.h"
00068 class StTpcDigitalSector;
00069 class StTpcHit;
00070 class tpc_cl;
00071 class daq_cld;
00072 class tpc_t;
00073 class StTpcHitCollection;
00074
00075 class StTpcHitMaker : public StRTSBaseMaker {
00076 public:
00077 enum EReaderType {kUnknown, kLegacyTpc, kLegacyTpx, kStandardTpx};
00078 enum EMode {kUndefined,
00079 kTpc, kTpx,
00080 kTpcPulser, kTpxPulser,
00081 #if 0
00082 kTpcPadMonitor, kTpxPadMonitor,
00083 #endif
00084 kTpcDumpPxls2Nt, kTpxDumpPxls2Nt,
00085 kTpcRaw, kTpxRaw, kTpcAvLaser, kTpxAvLaser,
00086 kAll};
00087 StTpcHitMaker(const char *name="tpc_hits") : StRTSBaseMaker("tpc",name), kMode(kUndefined),
00088 kReaderType(kUnknown), mQuery(""), fTpc(0), fAvLaser(0) {}
00089 virtual ~StTpcHitMaker() {}
00090
00091 Int_t Init();
00092 Int_t InitRun(Int_t runnumber);
00093 Int_t Make();
00094 void DoPulser(Int_t sector);
00095 void TpxAvLaser(Int_t sector);
00096 void TpcAvLaser(Int_t sector);
00097 void PadMonitor(Int_t sector);
00098 Int_t UpdateHitCollection(Int_t sector);
00099 void DumpPixels2Ntuple(Int_t sector);
00100 void PrintSpecial(Int_t sector);
00101 Int_t RawTpcData(Int_t sector);
00102 Int_t RawTpxData(Int_t sector);
00103 THnSparseF *CompressTHn(THnSparseF *hist, Double_t compress = 1e3);
00104 StTpcDigitalSector *GetDigitalSector(Int_t sector);
00105 private:
00106
00107 EMode kMode;
00108 EReaderType kReaderType;
00109 TString mQuery;
00110 tpc_t *fTpc;
00111 Short_t ADCs[512];
00112 UShort_t IDTs[512];
00113 UShort_t fId;
00114 Int_t maxHits[24];
00115 Int_t maxBin0Hits;
00116 Int_t bin0Hits;
00117 THnSparseF **fAvLaser;
00118 Int_t NoRows;
00119 protected:
00120 StTpcHit *CreateTpcHit(const tpc_cl &cluster, Int_t sector, Int_t row);
00121 StTpcHit *CreateTpcHit(const daq_cld &cluster, Int_t sector, Int_t row);
00122
00123 public:
00124 static void AfterBurner(StTpcHitCollection *hitCollection);
00125 static StTpcHit* StTpcHitFlag(const StThreeVectorF& p,
00126 const StThreeVectorF& e,
00127 UInt_t hw, float q, UChar_t c,
00128 UShort_t idTruth, UShort_t quality,
00129 UShort_t id,
00130 Short_t mnpad, Short_t mxpad, Short_t mntmbk,
00131 Short_t mxtmbk, Float_t cl_x, Float_t cl_t, UShort_t adc,
00132 UShort_t flag);
00133 static Float_t fgDp;
00134 static Float_t fgDt;
00135 static Float_t fgDperp;
00136
00137
00138 virtual const char *GetCVS() const {
00139 static const char cvs[]="Tag $Name: $Id: built "__DATE__" "__TIME__ ; return cvs;
00140 }
00141 ClassDef(StTpcHitMaker, 1)
00142 };
00143
00144 #endif