void plotEloss(TString file, int nEvents=-1) { gStyle->SetPalette(1); gROOT->SetStyle("Plain"); TFile* inFile = new TFile(file, "read"); TTree* tree = inFile->Get("cbmsim"); if(tree==NULL) { std::cout<<"Could not get tree 'cbmsim' ... aborting!"<GetEntries(); std::cout<<"Tree has "<nEv) nE = nEv; else nE = nEvents; std::cout<<"nE: "<SetBranchAddress("TpcPoint",&arr); TH1D* edepDist = new TH1D("edepDist", "TpcPoint energy loss distribution",1000,0,200*1.E-9); TH1D* stepDist = new TH1D("stepDist", "Step length distribution",1000,0,1); TH1D* dedxDist = new TH1D("dedxDist", "dE/dx distribution",2000,0,10*1.E-6); TH2D* dedxVsStep = new TH2D("dedxVsStep", "dE/dx vs. Setp",1000,0,1,2000,0,10*1.E-6); TH1D* posR = new TH1D("posR","Radial TpcPoint Positions", 1000,14.5,42.); TH1D* posZ = new TH1D("posZ","TpcPoint Z Positions", 1000,-45.,115.); for(unsigned int ie=0; ieGetEntry(ie); unsigned int npoints = arr->GetEntriesFast(); for(unsigned int ip=0; ipPosition(pos); posR->Fill(pos.Perp()); posZ->Fill(pos.Z()); double eloss = p->GetEnergyLoss(); double step = p->GetLength(); edepDist->Fill(eloss); stepDist->Fill(step); dedxDist->Fill(eloss/step); dedxVsStep->Fill(step,eloss); } } TCanvas* c = new TCanvas(); c->Divide(2,1); c->cd(1); edepDist->Draw(); c->cd(2); stepDist->Draw(); TCanvas* c2 = new TCanvas(); dedxDist->Draw(); TCanvas* c3 = new TCanvas(); dedxVsStep->Draw("colz"); TCanvas* c4 = new TCanvas(); c4->Divide(2,1); c4->cd(1); posR->Draw(); c4->cd(2); posZ->Draw(); }