00001 chainTRACKING(char *gmadFile, char *rootFile)
00002 {
00003 gStyle->SetOptTitle(0);
00004 BDSCanvas *b = new BDSCanvas(gmadFile);
00005 TChain *PChain;
00006 Char_t ChainName[256];
00007 Int_t jstar=1;
00008 Int_t jend=254;
00009 Float_t xmin=1000.,xmax=-1000.;
00010 Float_t ymin=1000.,ymax=-1000.;
00011 Float_t x,xp,y,yp,z,e;
00012 Char_t temp[256];
00013 TNtuple *ntuple = new TNtuple("ntuple","nutple","e:xp:yp:z:x:y");
00014 for (Int_t j=jstar; j <= jend ; j++)
00015 {
00016 sprintf(ChainName,"samp%d",j);
00017 PChain=new TChain(ChainName,"chain");
00018 PChain->Add(rootFile);
00019 PChain->SetBranchAddress("x", &x);
00020 PChain->SetBranchAddress("xp", &xp);
00021 PChain->SetBranchAddress("y", &y);
00022 PChain->SetBranchAddress("yp", &yp);
00023 PChain->SetBranchAddress("z", &z);
00024 PChain->SetBranchAddress("E", &e);
00025 for (Int_t i=0; i<PChain->GetEntries(); i++)
00026 {
00027 PChain->GetEntry(i);
00028 ntuple->Fill(e,xp,yp,z,x,y);
00029 ymin=TMath::Min(y,ymin);
00030 ymax=TMath::Max(y,ymax);
00031
00032 }
00033 }
00034 sprintf(temp,"x:z>>+temp(100,0,%f,50,%f,%f)",line->xmax_axis,1.5*ymin,1.5*ymax);
00035 ntuple->Draw(temp,"e==500","L");
00036
00037
00038
00039 b->SetHisto(0);
00040
00041
00042
00043
00044
00045
00046 return(0);
00047 }