00001 #ifndef __CINT__
00002 #include "Riostream.h"
00003 #include "Rtypes.h"
00004 #include "TROOT.h"
00005 #include "TSystem.h"
00006 #include "TH2.h"
00007 #include "TH3.h"
00008 #include "TF1.h"
00009 #include "TProfile.h"
00010 #include "TTree.h"
00011 #include "TChain.h"
00012 #include "TCanvas.h"
00013 #include "TClassTable.h"
00014 #include "TFileSet.h"
00015 #include "TDataSetIter.h"
00016 #include "StBFChain.h"
00017 #include "StIOMaker.h"
00018 StBFChain *bfc (const Int_t Last,
00019 const Char_t *Chain,
00020 const Char_t *infile,
00021 const Char_t *outfile,
00022 const Char_t *TreeFile);
00023
00024 #else
00025 #define BIT(n) (1 << (n))
00026 #define SETBIT(n,i) ((n) |= (1 << i))
00027 #define CLRBIT(n,i) ((n) &= ~(1 << i))
00028 #define TESTBIT(n,i) ((Bool_t)(((n) & (1 << i)) != 0))
00029 #endif
00030 #if 0
00031 class StBFChain;
00032 StBFChain *chain = 0;
00033 class TTree;
00034 class StIOMaker;
00035 #endif
00036 #endif
00037
00038
00039 void dEdx(Int_t nevents=1000,
00040 const char *MainFile=
00041 "/star/data08/reco/dAuMinBias/FullField/P03ih/2003/040/st_physics_4040004_raw_0010010.event.root",
00042
00043
00044
00045 const char* rootFile="", Int_t mode = 2)
00046 {
00047 if (gClassTable->GetID("TTable") < 0) {
00048 gSystem->Load("libTable");
00049
00050
00051 }
00052 gROOT->LoadMacro("bfc.C");
00053
00054
00055
00056
00057 TString Chain("in,dEdxY2,magF,StEvent,mysql,NoDefault");
00058 TString RootFile(rootFile);
00059 if (RootFile == "") {
00060 RootFile = gSystem->BaseName(MainFile);
00061 RootFile.ReplaceAll(".event","");
00062 }
00063 chain = bfc(-1,Chain.Data(),MainFile,0,RootFile.Data());
00064 StdEdxY2Maker *dEdxY2 = (StdEdxY2Maker *) chain->GetMaker("dEdxY2");
00065 dEdxY2->SetDebug(1);
00066 StMaker *tofCalib = chain->Maker("tofCalib");
00067 if (tofCalib) chain->AddAfter("tofCalib",dEdxY2);
00068 Int_t Mode = 0;
00069 if (mode%10 == 2)
00070 SETBIT(Mode,StdEdxY2Maker::kCalibration);
00071 if ((mode/10)%10)
00072 SETBIT(Mode,StdEdxY2Maker::kOldClusterFinder);
00073 else {
00074 SETBIT(Mode,StdEdxY2Maker::kGASHISTOGRAMS);
00075
00076
00077 }
00078 if ((mode/100)%10)
00079 SETBIT(Mode,StdEdxY2Maker::kDoNotCorrectdEdx);
00080 if ((mode/1000)%10) SETBIT(Mode,StdEdxY2Maker::kMakeTree);
00081 SETBIT(Mode,StdEdxY2Maker::kPadSelection);
00082 SETBIT(Mode,StdEdxY2Maker::kPadSelection);
00083 SETBIT(Mode,StdEdxY2Maker::kAlignment);
00084
00085
00086
00087
00088
00089 if (Mode) {
00090 cout << " set dEdxY2 Mode " << Mode << " =======================================" << endl;
00091 dEdxY2->SetMode(Mode);
00092 }
00093 if (! gROOT->IsBatch()) dEdxY2->SetDebug(1);
00094 StMaker *db = chain->Maker("db");
00095 if (db) db->SetDebug(1);
00096 if (nevents >= 0) chain->Init();
00097 StIOMaker *inMk = (StIOMaker *) chain->GetMaker("inputStream");
00098 if (inMk) {
00099 inMk->SetIOMode("r");
00100 inMk->SetBranch("histBranch",0,"0");
00101 inMk->SetBranch("eventBranch",0,"0");
00102 inMk->SetBranch("runcoBranch",0,"0");
00103 inMk->SetBranch("dstBranch",0,"r");
00104 }
00105 chain->EventLoop(1,nevents);
00106 }