#include #include #include #include #include using namespace std; void ecLDirCPr(){ TString infile = "/net/user/eleser/L5_6062_Erzgebirge_Ext_Cut.root"; TString Treename = "aTree"; TString PEnergy = "MCPrimary_Energy"; TString NEnergy = "MPEFit_LDirC"; double pen, nen, pMinen, pMaxen, nMinen, nMaxen; TChain* inChain = new TChain(Treename); inChain->Add(infile); inChain->SetBranchStatus("*",1); inChain->SetBranchAddress(PEnergy,&pen); inChain->SetBranchAddress(NEnergy,&nen); for(int i = 0 ; i< inChain->GetEntries(); ++i){ inChain->GetEntry(i); pMinen=TMath::Min(pen, pMinen); pMaxen=TMath::Max(pen, pMaxen); } cout<GetEntries(); ++j){ inChain->GetEntry(j); nMinen=TMath::Min(nen, nMinen); nMaxen=TMath::Max(nen, nMaxen); } cout<SetLogy(); //can->SetLogx(); TH2D *histoenergyn = new TH2D("histoenergyn","2D", 50, TMath::Log10(pMinen), TMath::Log10(pMaxen) ,50 , TMath::Log10(nMinen), TMath::Log10(nMaxen)); //"h2p","2D", n, Mintime, Maxtime, m, zenmin, zenmax /*histo2->SetName("Box"); //Name der Fehlerbox im Fenster histo2->SetTitle("2D-Histo"); */ //Name des Titels gStyle->SetPalette(1); //Setzt die Farbpalette fest, 2 ist grau for(int i = 0 ; i< inChain->GetEntries(); ++i){ inChain->GetEntry(i); histoenergyn->Fill(TMath::Log10(pen), TMath::Log10(nen)); } histoenergyn->GetXaxis()->SetTitle("Log10(MCPrimary_Energy)"); histoenergyn->GetYaxis()->SetTitle("Log10(MPEFit_LDirC)"); //histoenergy->GetXaxis()->SetLimits(100, 100000); //histoenergy->GetYaxis()->SetLimits(100, 100000); //histo2D->GetZaxis()->SetTitle("Counts"); histoenergyn->Draw("COLZ"); //COLZ ist die Grafik wie das Histogramm spŠter aussehen soll }