void analysis(const char *energy) { gROOT->Reset(); char name[128]; sprintf(name,"%s GeV pions",energy); c1 = new TCanvas("c1",name,10,10,800,800); const Int_t nColumns = 25; const Int_t nRows = 25; TH2F *h_int = new TH2F("h_int","interaction",nRows,0,nRows,nColumns,0,nColumns); h_int->SetStats(0); h_int->SetBit(TH1::kCanRebin); char *Blacks[25] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"}; char *Whites[25] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24"}; sprintf(name,"largePions_%sGeV.root",energy); cout << name << endl; TFile *f = new TFile(name); TTree *tree = (TTree*)f->Get("tree"); TEventList *elInt_list = (TEventList*)gDirectory->Get("elInt_list"); TEventList *inInt_list = (TEventList*)gDirectory->Get("inInt_list"); TEventList *int_list = new TEventList(*elInt_list); int_list->Add(inInt_list); int_list->Sort(); Event *event = new Event(); TBranch *branch = tree->GetBranch("event"); branch->SetAddress(&event); TClonesArray *tracks = 0; Track *t = 0; Float_t beta; //int tree->SetEventList(int_list); Int_t nevent = (Int_t)int_list->GetN(); cout << nevent << endl; for (Int_t i=0;iGetEntry(i); // pion vertex if(event->GetID() != 14 ) continue; Int_t nBlacks = 0; Int_t nWhites = 0; for(Int_t j = 0; jGetNtrack(); ++j) { tracks = event->GetTracks(); t = (Track*)tracks->At(j); if(is_charged(t->GetID())) { beta = t->GetP()/t->GetEnergy(); if(beta<0.7) ++nBlacks; else ++nWhites; } } h_int->Fill(Blacks[nBlacks], Whites[nWhites],1); event->Clear(); } h_int->LabelsDeflate("X"); h_int->LabelsDeflate("Y"); // h_int->GetXaxis()->LabelsOption(">"); // h_int->GetYaxis()->LabelsOption(">"); h_int->GetXaxis()->SetTitle("Blacks"); h_int->GetYaxis()->SetTitle("Whites"); gPad->SetGrid(); h_int->Draw("TEXT"); sprintf(name,"largePions_%sGeV.ps",energy); c1->Print(name); // close root file f->Close(); }