File indexing completed on 2025-12-18 09:16:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <cmath>
0012 #include <TFile.h>
0013 #include <TString.h>
0014 #include <TLine.h>
0015 #include <TTree.h>
0016 #include <TLatex.h>
0017 #include <TGraphErrors.h>
0018 #include <cassert>
0019 using namespace std;
0020
0021 void
0022 ExampleAnalysisModulePlot(
0023
0024 )
0025 {
0026
0027 gSystem->Load("libProto3_ExampleAnalysisModule.so");
0028
0029
0030 TFile * file = TFile::Open("ExampleAnalysis.root");
0031
0032
0033 assert(file);
0034 TTree* T = (TTree *) file->GetObjectChecked("T", "TTree");
0035 assert(T);
0036
0037
0038 TH1F* hNormalization = (TH1F *) file->GetObjectChecked("hNormalization",
0039 "TH1F");
0040 assert(hNormalization);
0041
0042
0043 TH2F* hCheck_Cherenkov = (TH2F *) file->GetObjectChecked("hCheck_Cherenkov",
0044 "TH2F");
0045 assert(hCheck_Cherenkov);
0046
0047
0048 TText * t;
0049 TCanvas *c1 = new TCanvas("ExampleAnalysisModulePlot",
0050 "ExampleAnalysisModulePlot", 1200, 1000);
0051 c1->Divide(2, 2);
0052 int idx = 1;
0053 TPad * p;
0054
0055 c1->Update();
0056 p = (TPad *) c1->cd(idx++);
0057 p->SetLogy();
0058
0059 hNormalization->Draw();
0060
0061 c1->Update();
0062 p = (TPad *) c1->cd(idx++);
0063 p->SetLogz();
0064
0065 hCheck_Cherenkov->Draw("colz");
0066
0067 c1->Update();
0068 p = (TPad *) c1->cd(idx++);
0069 p->SetLogy();
0070
0071 T->Draw("clus_5x5_CEMC.sum_E>>hEnergy_Sum_CEMC(400,0,20)", "info.good_anti_e",
0072 "");
0073 T->Draw("clus_5x5_CEMC.sum_E>>hEnergy_Sum_CEMC_C(400,0,20)", "info.good_e",
0074 "same");
0075 hEnergy_Sum_CEMC->SetTitle(
0076 "EMCal 5x5 cluster, anti-e cut (blue) and electron cut (green);EMCal 5x5 cluster Energy (GeV)");
0077 hEnergy_Sum_CEMC_C->SetLineColor(kGreen + 2);
0078 hEnergy_Sum_CEMC_C->SetFillColor(kGreen);
0079
0080 c1->Update();
0081 p = (TPad *) c1->cd(idx++);
0082 p->SetLogy();
0083
0084 T->Draw(
0085 "info.sum_E_CEMC + info.sum_E_HCAL_IN + info.sum_E_HCAL_OUT>>hEnergy_Sum(400,0,20)",
0086 "info.good_anti_e", "");
0087 hEnergy_Sum->SetTitle(
0088 "All three calorimeter energy with anti-e cut (hadron + muon);Energy Sum (GeV)");
0089
0090 }
0091