StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dEdx.C
1 #ifndef __CINT__
2 #include "Riostream.h"
3 #include "Rtypes.h"
4 #include "TROOT.h"
5 #include "TSystem.h"
6 #include "TH2.h"
7 #include "TH3.h"
8 #include "TF1.h"
9 #include "TProfile.h"
10 #include "TTree.h"
11 #include "TChain.h"
12 #include "TCanvas.h"
13 #include "TClassTable.h"
14 #include "TFileSet.h"
15 #include "TDataSetIter.h"
16 #include "StBFChain.h"
17 #include "StIOMaker.h"
18 void bfc (const Int_t Last,
19  const Char_t *Chain,
20  const Char_t *infile,
21  const Char_t *outfile,
22  const Char_t *TreeFile);
23 //R__EXTERN StBFChain *chain;
24 #else
25 #define BIT(n) (1 << (n))
26 #define SETBIT(n,i) ((n) |= (1 << i))
27 #define CLRBIT(n,i) ((n) &= ~(1 << i))
28 #define TESTBIT(n,i) ((Bool_t)(((n) & (1 << i)) != 0))
29 #endif
30 #if 0
31 class StBFChain;
32 StBFChain *chain = 0;
33 class TTree;
34 class StIOMaker;
35 #endif
36 #endif
37 //#define OLDdEdx
38 //________________________________________________________________________________
39 void dEdx(Int_t nevents=1000,
40  const char *MainFile=
41  "/star/data08/reco/dAuMinBias/FullField/P03ih/2003/040/st_physics_4040004_raw_0010010.event.root",
42  // "/star/data05/reco/FPDtbEMCproduction/FullField/P02gc/2002/023/st_physics_3023073_raw_0010.event.root",
43  // const char *MainFile="st_physics_2313002_raw_0010.event.root",
44  // "/star/data08/reco/central/DEV01a/2000/08/st_physics_1243014_raw_0001.dst.root",
45  const char* rootFile="", Int_t mode = 2)
46 {
47  if (gClassTable->GetID("TTable") < 0) {
48  gSystem->Load("libTable");
49 // gSystem->Load("St_base");
50 // gSystem->Load("StChain");
51  }
52  gROOT->LoadMacro("bfc.C");
53  // TString Chain("in dEdxY2 StEvent debug");
54  // TString Chain("in,dEdxY2,StEvent,St_geom,tofrMatch,tofpMatch,tofCalib,AlignSectors");
55  // TString Chain("in,dEdxY2,magF,StEvent,AlignSectors,Corr4,OSpaceZ2");
56  // TString Chain("in,dEdxY2,magF,StEvent,St_geom,tofrMatch,tofpMatch,tofCalib,Corr4,OSpaceZ2");
57  TString Chain("in,TpcHitMover,CorrX,OSpaceZ2,OGridLeak3D,dEdxY2,magF,StEvent,mysql,NoDefault"); // ,analysis
58  TString RootFile(rootFile);
59  if (RootFile == "") {
60  RootFile = gSystem->BaseName(MainFile);
61  RootFile.ReplaceAll(".event","");
62  }
63  chain = bfc(-1,Chain.Data(),MainFile,0,RootFile.Data());
64  StdEdxY2Maker *dEdxY2 = (StdEdxY2Maker *) chain->GetMaker("dEdxY2");
65  StMaker *tofCalib = chain->Maker("tofCalib");
66  if (tofCalib) chain->AddAfter("tofCalib",dEdxY2);
67  Int_t Mode = 0;
68  if (mode%10 == 2)
69  SETBIT(Mode,StdEdxY2Maker::kCalibration);
70  SETBIT(Mode,StdEdxY2Maker::kGASHISTOGRAMS);
71  // SETBIT(Mode,StdEdxY2Maker::kProbabilityPlot);
72  // SETBIT(Mode,StdEdxY2Maker::kZBGX);
73  if ((mode/100)%10)
74  SETBIT(Mode,StdEdxY2Maker::kDoNotCorrectdEdx);
75  if ((mode/1000)%10) SETBIT(Mode,StdEdxY2Maker::kMakeTree);
76  SETBIT(Mode,StdEdxY2Maker::kPadSelection);
77  SETBIT(Mode,StdEdxY2Maker::kPadSelection);
78  SETBIT(Mode,StdEdxY2Maker::kAlignment);
79  // SETBIT(Mode,StdEdxY2Maker::kMip);
80  // SETBIT(Mode,StdEdxY2Maker::kAdcHistos);
81  // SETBIT(Mode,StdEdxY2Maker::kXYZcheck);
82  // SETBIT(Mode,StdEdxY2Maker::kV0CrossCheck);
83  // SETBIT(Mode,StdEdxY2Maker::kSpaceChargeStudy);
84  // SETBIT(Mode,StdEdxY2Maker::kCORRELATION);
85  if (Mode) {
86  cout << " set dEdxY2 Mode " << Mode << " =======================================" << endl;
87  dEdxY2->SetMode(Mode);
88  }
89  if (! gROOT->IsBatch()) dEdxY2->SetDebug(1);
90  StMaker *db = chain->Maker("db");
91  if (db) db->SetDebug(1);
92  if (nevents >= 0) chain->Init();
93  StIOMaker *inMk = (StIOMaker *) chain->GetMaker("inputStream");
94  if (inMk) {
95  inMk->SetIOMode("r");
96  inMk->SetBranch("histBranch",0,"0"); //deactivate all branches
97  inMk->SetBranch("eventBranch",0,"0"); //deactivate all branches
98  inMk->SetBranch("runcoBranch",0,"0"); //deactivate all branches
99  inMk->SetBranch("dstBranch",0,"r");
100  }
101  chain->EventLoop(1,nevents);
102 }
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
Definition: StIOInterFace.h:35
virtual TDataSet * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TDataSet.cxx:437