#include "TFile.h" #include "TTree.h" #include "TString.h" #include #include #include #include "TCanvas.h" #include "TStyle.h" #include "TH1D.h" void clustering(){ gStyle->SetOptFit(); TString files[7]={"data/pion.15deg.reco.root", "data/pion.20deg.reco.root", "data/pion.30deg.reco.root", "data/pion.40deg.reco.root", "data/pion.50deg.reco.root", "data/pion.60deg.reco.root", "data/pion.70deg.reco.root"}; TCanvas* c=new TCanvas("Clusters","Clusters",10,10,500,900); c->Divide(3,7); int count=0; for(int i=0; i<7; ++i){ TFile* file=new TFile(files[i],"READ"); TTree* tr=(TTree*)file->Get("cbmsim"); assert(tr!=0); c->cd(++count); std::ostringstream histo; histo <<"hRX"<>"<Draw(select.str().c_str(),"abs(TrackFitStat._TpcResX)<1"); TH1F* hX = (TH1F*)gDirectory->Get(histo.str().c_str()); hX->Fit("gaus"); c->cd(++count); std::ostringstream histo2; std::ostringstream select2; histo2 <<"hRY"<>"<Draw(select2.str().c_str(),"abs(TrackFitStat._TpcResY)<1"); TH1F* hY = (TH1F*)gDirectory->Get(histo2.str().c_str()); hY->Fit("gaus"); c->cd(++count); tr->Draw("TpcCluster._size",""); }// end loop over files }