00001
00002
00003
00004
00005
00007
00008
00009
00011
00012 #ifndef FROOT_TFndProcessRec
00013 #define FROOT_TFndProcessRec
00014
00015 extern "C" {
00016 void gzcali_(int*);
00017 void hlimit_(int*);
00018 void uginit_();
00019 void fin_open_(char *fname, int *iout, int *ierr);
00020 void fin_close_();
00021 int* get_current_raw_event_();
00022 void fin_open03_(char *fname, int *iout, int *ierr);
00023 void fin_close03_();
00024 int* get_current_raw_event03_();
00025 void ginit_();
00026 void ffset_(char*,int*);
00027 void houtpu_(int*);
00028 void uvinit_();
00029 void ugffgo_();
00030 void gffgo_();
00031 void uginou_(int*);
00032 void gzinit_();
00033 void gdinit_();
00034 void reageo_();
00035 void ggclos_();
00036 void gphysi_();
00037 void ugidbg_();
00038 void ugeoin_();
00039 void genini_();
00040 void tofini_();
00041 void simini_();
00042 void vrecin_();
00043 void ustrinit_();
00044 void uhinit_();
00045 void dstini_();
00046 void iofini_();
00047 void jevent_();
00048 void uglast_();
00049 void gtrigi_();
00050 void gtrig_();
00051 void gtrigc_();
00052 void gutrev_();
00053 void guout_();
00054 void rdtupk_(int*);
00055 void checktrig_();
00056 void consinit_();
00057 void provatof_();
00058 void mzwipe_(int*);
00059 void mzdrop_(int* ,int* ,char*);
00060 void vrecon_();
00061 void films_();
00062 void patstrw_();
00063 void genrec_();
00064 void trkfit_();
00065 void ktrkvert_();
00066 void vertfit_();
00067 void kalmanfit_();
00068 void neutfind_();
00069 void bhabharc_();
00070 void bhatrkfit_();
00071 void babarc_();
00072 void babafit_();
00073 }
00074
00075 typedef struct {
00076 int idebug;
00077 int idemin;
00078 int idemax;
00079 int itest;
00080 int idrun;
00081 int idevt;
00082 int ieorun;
00083 int ieotri;
00084 int ievent;
00085 int iswit[10];
00086 int ifinit[20];
00087 int nevent;
00088 int nrndm[2];
00089 } Gcflag_t;
00090
00091 typedef struct {
00092 int ixdst;
00093 int ixdiv1;
00094 int ixdiv2;
00095 int ixdiv3;
00096 float fence[16];
00097 int jinfo;
00098 int jfges;
00099 int jmstr;
00100 int jstrw;
00101 int jfdst;
00102 } Zerbini_t;
00103
00104 typedef struct {
00105 int iout[9];
00106 } Runinf_t;
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 #include "TNamed.h"
00121 #include "TString.h"
00122 #include "TH1F.h"
00123 #include "TH2F.h"
00124
00125
00126 #include "FROOT.h"
00127
00128 class TFndProcessRec : public TNamed {
00129
00130 public:
00131 enum E_prec_Bhabha_Mode { E_SINGLE_HELIX=0, E_DOUBLE_HELIX=1 };
00132
00133 private:
00134
00135 enum { K_NMAX_PROCESSES = 30 };
00136 TString fProcDirBaseName;
00137 Int_t fCurProcNum;
00138
00139 TString *fTyp;
00140 Int_t fNum;
00141 TString *fRawFileName;
00142 TString *fMsqlDbHostStr;
00143
00144 Zerbini_t *fZebini;
00145 Gcflag_t *fGcflag;
00146 Runinf_t *fRuninf;
00147
00148 void *flib_handle;
00149
00150 Int_t fJINFO;
00151 Int_t fJFGES;
00152 Int_t fJFDST;
00153 Int_t *fLQ;
00154 Int_t *fIQ;
00155 Float_t *fQ;
00156
00157 Bool_t fdebug;
00158 Bool_t fRawFileExists;
00159
00160 E_prec_Bhabha_Mode fCurBhabhaRecMode;
00161
00162 public:
00163
00164 TFndProcessRec();
00165 TFndProcessRec(Int_t num, Bool_t debug=kFALSE);
00166 TFndProcessRec(const Char_t *typ, Int_t num, const Char_t *data_path="$RDT", const Char_t *msql_db_host="$MSQL_DB_HOST", Bool_t debug=kFALSE);
00167 ~TFndProcessRec();
00168
00169 Int_t UgEvent();
00170 Int_t FillJFGES();
00171 Int_t Reconstruct();
00172 void CloseRun(Bool_t last=kFALSE);
00173 Int_t CloseInterface();
00174
00175 void InitNewRun(const Char_t *typ, Int_t num, const Char_t *data_path="$RDT", const Char_t *msql_db_host="$MSQL_DB_HOST", Bool_t debug=kFALSE);
00176
00177 Bool_t GetStatusBit(Int_t l, Int_t k);
00178
00179 UInt_t *GetRawEvPointer();
00180 Int_t GetJINFO() {return fJINFO;}
00181 Int_t GetJFGES() {return fJFGES;}
00182 Int_t GetJFDST() {return fJFDST;}
00183 Int_t *GetLQ() {if(fLQ) return fLQ; else return 0;}
00184 Int_t *GetIQ() {if(fIQ) return fIQ; else return 0;}
00185 Float_t *GetQ() {if(fQ) return fQ; else return 0;}
00186
00187 Int_t GetLQ(Int_t address) {if(fLQ) return fLQ[address]; else return 0;}
00188 Int_t GetIQ(Int_t address) {if(fIQ) return fIQ[address]; else return 0;}
00189 Float_t GetQ(Int_t address) {if(fQ) return fQ[address]; else return 0;}
00190
00191 TString *GetRunType() { return fTyp; }
00192 void PrintZebiniContent();
00193 void PrintGcflagContent();
00194 Bool_t GetDebugFlag() { return fdebug; }
00195
00196 void SetRuninf();
00197
00198 void SelectBhabhaInFidaRC(E_prec_Bhabha_Mode mode);
00199 E_prec_Bhabha_Mode GetBhabhaRecMode() { return fCurBhabhaRecMode; }
00200
00201
00202 void CreateProcInpFiles();
00203 void CleanCurrentProcess();
00204
00205 static void CleanRecOutputs(Bool_t out,Bool_t his,Bool_t dst);
00206
00207 private:
00208
00209 void CommInit();
00210 void CheckRawFile();
00211 void InitRun();
00212 void SetZebini();
00213 void SetGcflag();
00214 void SetFidaRC(Char_t *card, Char_t *option);
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 public:
00232 Int_t fMaxEv;
00233
00234 Bool_t fBhaFlag;
00235 Bool_t fHypeFlag;
00236 Bool_t fCosmFlag;
00237
00238
00239 Int_t fcount_k_min;
00240 Int_t fcount_k_min_inside;
00241 TH2F *fHyp_K_min_xy_vert_histo;
00242 TH1F *fHyp_K_min_z_vert_histo;
00243 TH1F *fHyp_K_min_mom_neg_trk;
00244 TH1F *fHyp_K_min_mom_pos_trk;
00245
00246
00247 Int_t fcount_BABA;
00248 Int_t fcount_BABA_OK;
00249 TH1F *fBABA_mom_patt_histo;
00250 TH1F *fBABA_mom_fit_histo;
00251
00252
00253
00254
00255
00256 Int_t fcount_COSM;
00257 Int_t fcount_COSM_OK;
00258 TH1F *fCosm_SignOfCharge_histo;
00259 TH1F * fCOSM_mom_patt_histo;
00260 TH1F * fCOSM_mom_fit_histo;
00261
00262
00263
00264 inline void SetMaxEv(Int_t n) { fMaxEv=n; }
00265 virtual void AutoProcessRun();
00266
00267 private:
00268 Int_t GetHypeDst();
00269 Int_t GetBabaDst();
00270 Int_t GetBhabhaDst();
00271 Int_t GetCosmDst();
00272
00273 ClassDef(TFndProcessRec,0)
00274 };
00275
00276 #endif // FROOT_TFndProcessRec
00277