StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
readTree.C
1 ReadTree(Int_t runnum=0)
2 {
3  gStyle->SetPalette(1);
4  gStyle->SetOptFit(1111);
5  gStyle->SetCanvasColor(0);
6  gStyle->SetPadColor(0);
7  gStyle->SetFillColor(0);
8  gStyle->SetStatBorderSize(0);
9 
10  Int_t adcth=600;
11  Int_t intth=1000;
12  Float_t t0min=1.5;
13  Float_t t0max=2.5;
14  Float_t ch2th=2.;
15 
16  char tname[100];
17  sprintf(tname,"run%d.*tree.root",runnum);//point to the output tree from StFgtTimeShapeMaker
18 
19  TChain* tFgt=new TChain("tFgt");
20  tFgt->Add(tname);
21 
22  Int_t iEvt;
23  Int_t rdo;
24  Int_t arm;
25  Int_t apv;
26  Int_t chn;
27  Short_t disk;
28  Short_t quad;
29  Short_t strip;
30  Short_t stat;//0:good event, bad if anything else
31  Double_t ordinate;
32  Double_t lowerSpan;
33  Double_t upperSpan;
34  Char_t layer;
35  Double_t ped;//pedestal
36  Double_t pedSig;//pedestal sigma
37  Int_t adc[7];
38  Int_t adcmax;//maximum adc for the event
39  Int_t mmax;//time bin of the maximum adc
40  Int_t mmin;//time bin of the minimum adc
41  Float_t chi2;//chi squared of the fit
42  Float_t fmax;//maximum time of the fit function
43  Float_t norm;//normalization for the fit function
44  Float_t tau;//width of the fit function
45  Float_t t0;//rise time of the fit function
46  Float_t offset;//y-offset
47  Int_t errCode;//0:good event, 1:oscillation, 2:saturation
48 
49  tFgt->SetBranchAddress("iEvt",&iEvt);
50  tFgt->SetBranchAddress("rdo",&rdo);
51  tFgt->SetBranchAddress("arm",&arm);
52  tFgt->SetBranchAddress("apv",&apv);
53  tFgt->SetBranchAddress("chn",&chn);
54  tFgt->SetBranchAddress("disk",&disk);
55  tFgt->SetBranchAddress("quad",&quad);
56  tFgt->SetBranchAddress("strip",&strip);
57  tFgt->SetBranchAddress("stat",&stat);
58  tFgt->SetBranchAddress("ordinate",&ordinate);
59  tFgt->SetBranchAddress("lowerSpan",&lowerSpan);
60  tFgt->SetBranchAddress("upperSpan",&upperSpan);
61  tFgt->SetBranchAddress("layer",&layer);
62  tFgt->SetBranchAddress("adc",adc);
63  tFgt->SetBranchAddress("ped",&ped);
64  tFgt->SetBranchAddress("pedSig",&pedSig);
65  tFgt->SetBranchAddress("adcmax",&adcmax);
66  tFgt->SetBranchAddress("mmin",&mmin);
67  tFgt->SetBranchAddress("mmax",&mmax);
68  tFgt->SetBranchAddress("chi2",&chi2);
69  tFgt->SetBranchAddress("fmax",&fmax);
70  tFgt->SetBranchAddress("norm",&norm);
71  tFgt->SetBranchAddress("tau",&tau);
72  tFgt->SetBranchAddress("t0",&t0);
73  tFgt->SetBranchAddress("offset",&offset);
74  tFgt->SetBranchAddress("errCode",&errCode);
75 
76 
77  Int_t nevents=tFgt->GetEntries();
78  printf("nevents=%d \n",nevents);
79  for(Int_t i=0;i<nevents;i++)
80  {
81  tFgt->GetEntry(i);
82 
83 
84  };
85 };
86