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 #ifndef L3_READER_HH
00044 #define L3_READER_HH
00045
00046
00048 #include <string>
00049 #if !defined ST_NO_NAMESPACES
00050 using std::string;
00051 #endif
00052
00053 #include <stdio.h>
00054 #include "StDaqLib/GENERIC/EventReader.hh"
00055 #include "StDaqLib/GENERIC/RecHeaderFormats.hh"
00056 #include "StDaqLib/GENERIC/swaps.hh"
00057 #include "StDaqLib/GENERIC/Error.hh"
00058 #include "L3_Banks.hh"
00059
00061
00062 class Bank_L3_P;
00063 class Bank_L3_SUMD;
00064 class Bank_L3_GTD;
00065 class Bank_L3_SECP;
00066 class Bank_L3_SECTP;
00067 class Bank_L3_SECCD;
00068 class Bank_TPCSECLP;
00069 class Bank_TPCRBCLP;
00070 class Bank_TPCMZCLD;
00071 class Gl3AlgorithmReader;
00072 class GlobalTrackReader;
00073 class Sl3ClusterReader;
00074 class Sl3TrackReader;
00075 class L3_Reader;
00076
00077 #define L3ERROR(x, text) {errnum = x; sprintf(errstr0,"ERROR: "text" %s::%d",__FILE__,__LINE__); }
00078 #define L3secERROR(x, text, s) {errnum = x; sprintf(errstr0,"ERROR: "text" in sector %d, %s::%d",s,__FILE__,__LINE__); }
00079 #define pL3secERROR(x, text, s) {mL3->errnum = x; sprintf(mL3->errstr0,"ERROR: "text" in sector %d, %s::%d",s,__FILE__,__LINE__); }
00080
00081 #define maxClusterPerSector 100000
00082
00083
00084
00085
00086
00087
00088
00089 class Gl3AlgorithmReader {
00090
00091 public:
00092 Gl3AlgorithmReader(L3_Reader *l3);
00093 ~Gl3AlgorithmReader() {};
00094
00095 int getNumberofAlgorithms() { return mNAlg; }
00096 unsigned int getNumberOfProcessedEvents() { return mNProcessed; }
00097 unsigned int getNumberOfReconstructedEvents() { return mNReconstructed; }
00098 Algorithm_Data *getAlgorithmData() { return mAlgData; }
00099 int initialize();
00100
00101 private:
00102 Bank_L3_SUMD *mL3SUMD;
00103 unsigned int mNProcessed;
00104 unsigned int mNReconstructed;
00105 int mNAlg;
00106 Algorithm_Data *mAlgData;
00107
00108 L3_Reader *mL3r;
00109 };
00110
00111
00112
00113
00114
00115
00116
00117 class GlobalTrackReader {
00118
00119 public:
00120 globalTrack *getTrackList() { return mTracks; }
00121 int getNumberOfTracks() { return mNTracks; }
00122 int getNumberOfHits() { return mNHits; }
00123 vertex getVertex() { return mGlobalVertex; }
00124
00125 int initialize();
00126
00127 GlobalTrackReader(L3_Reader *l3r);
00128 ~GlobalTrackReader() {};
00129
00130 private:
00131 Bank_L3_GTD *mL3GTD;
00132 globalTrack *mTracks;
00133 int mNTracks;
00134 int mNHits;
00135 vertex mGlobalVertex;
00136
00137 L3_Reader *mL3;
00138 };
00139
00140
00141
00142
00143
00144
00145
00146 class Sl3ClusterReader {
00147
00148 public:
00149 L3_Cluster *getClusterList() { return mCluster; }
00150 int getNumberOfClusters() { return mNCluster; }
00151
00152 int initialize(int sector);
00153
00154 Sl3ClusterReader(L3_Reader *l3r);
00155 ~Sl3ClusterReader() {};
00156
00157 private:
00158 Bank_L3_SECCD *mL3SECCD;
00159 L3_Cluster *mCluster;
00160 int mNCluster;
00161 int mSector;
00162 L3_Reader *mL3;
00163 };
00164
00165
00166
00167
00168
00169
00170
00171 class Sl3TrackReader {
00172
00173 public:
00174 localTrack *getLocalTrackList() { return mTracks; }
00175 int getNumberOfTracks() { return mNTracks; }
00176 int getNumberOfHits() { return mNHits; }
00177 int getCpuTime() { return mCpuTime; }
00178 int getRealTime() { return mRealTime; }
00179 int getParameterSetId() {return mParaSet; }
00180 vertex getVertex() { return mSectorVertex; }
00181
00182 int initialize(int sector);
00183
00184 Sl3TrackReader(L3_Reader *l3r);
00185 ~Sl3TrackReader() {};
00186
00187 private:
00188 Bank_L3_SECTP *mL3SECTP;
00189 Bank_L3_LTD *mL3LTD;
00190 localTrack *mTracks;
00191 int mNTracks;
00192 int mNHits;
00193 int mCpuTime;
00194 int mRealTime;
00195 int mParaSet;
00196 vertex mSectorVertex;
00197 int mSector;
00198 L3_Reader *mL3;
00199
00200 };
00201
00202
00203
00204
00205
00206
00207
00208 class I960ClusterReader {
00209
00210 public:
00211 L3_Cluster *getClusterList() { return mCluster; }
00212 int getNumberOfClusters() { return mNCluster; }
00213
00214 int initialize(int sector);
00215
00216 I960ClusterReader(L3_Reader *l3r);
00217 ~I960ClusterReader();
00218
00219 private:
00220 Bank_TPCMZCLD *mBankTPCMZCLD[12][3];
00221 L3_Cluster *mCluster;
00222 int mNCluster;
00223 int mSector;
00224 L3_Reader *mL3;
00225
00226 };
00227
00228
00229
00230
00231
00232
00233
00234 class L3_Reader {
00235 friend class EventReader;
00236
00237 public:
00238 L3_Reader(EventReader *er, Bank_L3_P *pL3P);
00239 ~L3_Reader();
00240
00241 Bank_L3_P *getL3_P() { return mBankL3P; }
00242 Bank_L3_SUMD *getL3_SUMD();
00243 Bank_L3_GTD *getL3_GTD();
00244 Bank_L3_SECP *getL3_SECP(int sector);
00245 Bank_L3_SECTP *getL3_SECTP(int sector);
00246 Bank_L3_SECCD *getL3_SECCD(int sector);
00247 Bank_TPCSECLP *getTPCSECLP(int sector);
00248 Bank_TPCRBCLP *getTPCRBCLP(int sector, int rb);
00249 Bank_TPCMZCLD *getTPCMZCLD(int sector, int rb, int mz);
00250 int *getSVT_Bank(int sector);
00251 int *getFTPC_Bank(int sector);
00252 int *getEMC_Bank();
00253
00254 GlobalTrackReader *getGlobalTrackReader();
00255 Gl3AlgorithmReader *getGl3AlgorithmReader();
00256 Sl3ClusterReader *getSl3ClusterReader(int sector);
00257 Sl3TrackReader *getSl3TrackReader(int sector);
00258 I960ClusterReader *getI960ClusterReader(int sector);
00259
00260 unsigned char getL3PFormatNumber() { return mBankL3P->header.FormatNumber; }
00261 unsigned int getTime() { return mTime; }
00262 unsigned int getGl3Id() { return mGl3Id; }
00263 L3_Summary *getL3_Summary() { return mL3sum; }
00264
00265 int errorNo() { return errnum; };
00266 string errstr() { return string(errstr0); };
00267
00268 int errnum;
00269 char errstr0[250];
00270
00271 protected:
00272
00273
00274 Bank_L3_P *mBankL3P;
00275 Bank_L3_SUMD *mBankL3SUMD;
00276 Bank_L3_GTD *mBankL3GTD;
00277 Bank_L3_SECP *mBankL3SECP;
00278 Bank_L3_SECCD *mBankL3SECCD;
00279 Bank_L3_SECTP *mBankL3SECTP;
00280 Bank_TPCSECLP *mBankTPCSECLP;
00281 Bank_TPCRBCLP *mBankTPCRBCLP;
00282 Bank_TPCMZCLD *mBankTPCMZCLD;
00283
00284 int *mSVT;
00285 int *mFTPC;
00286 int *mEMC;
00287
00288 private:
00289 Gl3AlgorithmReader *mAlr;
00290 GlobalTrackReader *mGtr;
00291 Sl3ClusterReader *mScr;
00292 Sl3TrackReader *mStr;
00293 I960ClusterReader *mIcr;
00294
00295 L3_Summary *mL3sum;
00296 unsigned int mGl3Id;
00297 unsigned int mTime;
00298
00299
00300 };
00301
00302
00303 L3_Reader *getL3Reader(EventReader *er);
00304
00305
00306 #endif