/home/cern/BDSIM_new/utils/display/chainTRACKING.C

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         //ntuple->Draw(temp,"e==150","Lsame");
00037         //ntuple->Draw(temp,"e==200","Lsame");
00038         //ntuple->Draw(temp,"e==250","Lsame");
00039         b->SetHisto(0);
00040 //      TH2F *histo = new TH2F("histo","using histo",jend,line->xmin_axis,line->xmax_axis,jstar,1.5*xmin,1.5*xmax);
00041 //      ntuple->Project("histo","x:z","e==200");
00042 //      histo->Draw("e");
00043 //
00044 //      TH2F   *ax = b->GetPlot();
00045 //b->SetHisto2(ax);
00046         return(0);
00047 }

Generated on Wed Mar 5 17:25:25 2008 for BDSIM by  doxygen 1.5.3