{ // TH1::AddDirectory(kFALSE); TFile* f1 = TFile::Open("RBBhistogram.root"); // f1->ls(); TH1D* hEdepTheta0RBB; f1->GetObject("EdepTheta0", hEdepTheta0RBB); hEdepTheta0RBB->Scale(0.0005); TH1D* hEdepTheta68RBB; f1->GetObject("EdepTheta68", hEdepTheta68RBB); hEdepTheta68RBB->Scale(0.0005); TH2D* hEdepPos0RBB; f1->GetObject("EdepPosTheta0", hEdepPos0RBB); hEdepPos0RBB->Scale(0.0005); TH2D* hEdepPos68RBB; f1->GetObject("EdepPosTheta68", hEdepPos68RBB); hEdepPos68RBB->Scale(0.0005); TH1D* hEdepCell0RBB; f1->GetObject("EdepPerRelevantCell1", hEdepCell0RBB); hEdepCell0RBB->Scale(0.0005); TH1D* hEdepCell68RBB; f1->GetObject("EdepPerRelevantCell2", hEdepCell68RBB); hEdepCell68RBB->Scale(0.0005); TH1D* hNumHits0RBB; f1->GetObject("NumOfHitsRelevantCell1", hNumHits0RBB); hNumHits0RBB->Scale(0.0005); TH1D* hNumHits68RBB; f1->GetObject("NumOfHitsRelevantCell2", hNumHits68RBB); hNumHits68RBB->Scale(0.0005); TH2D* hEdepPosCell0RBB; f1->GetObject("EdepPostitionRelevantCell1", hEdepPosCell0RBB); hEdepPosCell0RBB->Scale(0.0005); TH2D* hEdepPosCell68RBB; f1->GetObject("EdepPostitionRelevantCell2", hEdepPosCell68RBB); hEdepPosCell68RBB->Scale(0.0005); // delete f1; f1 = 0; TFile* f2 = TFile::Open("AllButRBBhistogram.root"); // f2->ls(); TH1D* hEdepTheta0All; f2->GetObject("EdepTheta0", hEdepTheta0All); hEdepTheta0All->Scale(0.00005); TH1D* hEdepTheta68All; f2->GetObject("EdepTheta68", hEdepTheta68All); hEdepTheta68All->Scale(0.00005); TH2D* hEdepPos0All; f2->GetObject("EdepPosTheta0", hEdepPos0All); hEdepPos0All->Scale(0.00005); TH2D* hEdepPos68All; f2->GetObject("EdepPosTheta68", hEdepPos68All); hEdepPos68All->Scale(0.00005); TH1D* hEdepCell0All; f2->GetObject("EdepPerRelevantCell1", hEdepCell0All); hEdepCell0All->Scale(0.00005); TH1D* hEdepCell68All; f2->GetObject("EdepPerRelevantCell2", hEdepCell68All); hEdepCell68All->Scale(0.00005); TH1D* hNumHits0All; f2->GetObject("NumOfHitsRelevantCell1", hNumHits0All); hNumHits0All->Scale(0.00005); TH1D* hNumHits68All; f2->GetObject("NumOfHitsRelevantCell2", hNumHits68All); hNumHits68All->Scale(0.00005); TH2D* hEdepPosCell0All; f2->GetObject("EdepPostitionRelevantCell1", hEdepPosCell0All); hEdepPosCell0All->Scale(0.00005); TH2D* hEdepPosCell68All; f2->GetObject("EdepPostitionRelevantCell2", hEdepPosCell68All); hEdepPosCell68All->Scale(0.00005); // delete f2; f2 = 0; gROOT->cd(); TH1D* hEdepTheta0 = (TH1D *)hEdepTheta0RBB->Clone("hEdepTheta0"); TH1D* hEdepTheta68 = (TH1D *)hEdepTheta68RBB->Clone("hEdepTheta68"); TH2D* hEdepPos0 = (TH2D *)hEdepPos0RBB->Clone("hEdepPos0"); TH2D* hEdepPos68 = (TH2D *)hEdepPos68RBB->Clone("hEdepPos68"); TH1D* hEdepCell0 = (TH1D *)hEdepCell0RBB->Clone("hEdepCell0"); TH1D* hEdepCell68 = (TH1D *)hEdepCell68RBB->Clone("hEdepCell68"); TH1D* hNumHits0 = (TH1D *)hNumHits0RBB->Clone("hNumHits0"); TH1D* hNumHits68 = (TH1D *)hNumHits68RBB->Clone("hNumHits68"); TH2D* hEdepPosCell0 = (TH2D *)hEdepPosCell0RBB->Clone("hEdepPosCell0"); TH2D* hEdepPosCell68 = (TH2D *)hEdepPosCell68RBB->Clone("hEdepPosCell68"); hEdepTheta0->Add(hEdepTheta0All); hEdepTheta68->Add(hEdepTheta68All); hEdepPos0->Add(hEdepPos0All); hEdepPos68->Add(hEdepPos68All); hEdepCell0->Add(hEdepCell0All); hEdepCell68->Add(hEdepCell68All); hNumHits0->Add(hNumHits0All); hNumHits68->Add(hNumHits68All); hEdepPosCell0->Add(hEdepPosCell0All); hEdepPosCell68->Add(hEdepPosCell68All); delete f2; delete f1; }