#include "Riostream.h" #include #include void shower_evolution() { gStyle->SetOptStat(0); gStyle->SetOptTitle(0); TFile *file1 = TFile::Open("ECALGeometry.root"); TH1F *h2000 = (TH1F*)file1->Get("h2000"); TH1F *h2001 = (TH1F*)file1->Get("h2001"); TH1F *h2002 = (TH1F*)file1->Get("h2002"); TH1F *h2003 = (TH1F*)file1->Get("h2003"); TH1F *h2004 = (TH1F*)file1->Get("h2004"); TH1F *h2005 = (TH1F*)file1->Get("h2005"); TChain chain("G4SIM"); //TFile *_file0 = TFile::Open("g4simhitsEcal_fixedeta_3.root"); chain.Add("g4simhitsEcal_fixedeta_3.root"); //chain.Add("g4simhitsEcal_All_V1_RealVertex.root"); //chain.Add("g4simhitsEcal_All_V2_RealVertex.root"); //chain.Add("g4simhitsEcal_All_V3_RealVertex.root"); //chain.Add("g4simhitsEcal_All_V4_RealVertex.root"); //chain.Add("g4simhitsEcal_All_V5_RealVertex.root"); Int_t nPlots = 50; Float_t t1 = 4.00; Float_t tMax; Float_t tMin; Float_t MaxBinContent; TString cut[nPlots]; TString HistoName; TString PadName[nPlots]; TString DrawVariables; TString PlotName; TH2F *ShowerShape[100]; Double_t W = 0.025; // Pad Width Int_t Nx = nPlots; // Number of pads along X Double_t Xm = (1-(Nx*W))/2; // X Margin //Double_t Xm = 0; // X Margin Double_t dw = (W*0.1)/4; Double_t dw = 0.0; TPad *pad[100]; // //G4SIM->Draw("(prexg4EB**2+preyg4EB**2)**0.5:prezg4EB>>h200(50,120,260,50,1280,1550)","","",5,3); // TCanvas *PhotonShower1 = new TCanvas("PhotonShower1", "PhotonShower1",25,145,1000,1000); for (Int_t i=0; iDraw(DrawVariables,cut[i],"",2,1); chain.Draw(DrawVariables,cut[i],"",3999,1); if (ShowerShape[i]->GetMaximum() > MaxBinContent) MaxBinContent = ShowerShape[i]->GetMaximum(); cout << MaxBinContent; cout << " Histo " << i << " done " << endl; }; // for (Int_t i=0; iSetLogz(); ShowerShape[i] ->SetMaximum(MaxBinContent*1.05); ShowerShape[i] ->Draw("colz"); //_file0 ->cd(); h2000->SetMarkerSize(0.2); h2001->SetMarkerSize(0.2); h2002->SetMarkerSize(0.2); h2003->SetMarkerSize(0.2); h2004->SetMarkerSize(0.2); h2005->SetMarkerSize(0.2); h2000->Draw("same"); h2001->Draw("same"); h2002->Draw("same"); h2003->Draw("same"); h2004->Draw("same"); h2005->Draw("same"); PhotonShower1 ->Print(PlotName); }; // TCanvas *PhotonShower2 = new TCanvas("PhotonShower2", "PhotonShower2",25,145,1500,300); for (Int_t i=0; iSetRightMargin(0); pad[i]->SetLeftMargin(0); pad[i]->Draw(); }; for (Int_t i=0; icd(); pad[i]->SetLogz(); ShowerShape[i] ->SetMaximum(MaxBinContent*1.05); ShowerShape[i] ->Draw("colz"); //_file0 ->cd(); h2000->SetMarkerSize(0.2); h2001->SetMarkerSize(0.2); h2002->SetMarkerSize(0.2); h2003->SetMarkerSize(0.2); h2004->SetMarkerSize(0.2); h2005->SetMarkerSize(0.2); h2000->Draw("same"); h2001->Draw("same"); h2002->Draw("same"); h2003->Draw("same"); h2004->Draw("same"); h2005->Draw("same"); }; TFile* f1 = new TFile("ShowerEvolutionPHO.root","RECREATE"); for (Int_t i=0; iWrite(); }; f1->Close(); }