draw.C

Vitaliy Schetinin, 04/12/2018 08:50 PM

Download (1.76 KB)

 
1
{
2
        TFile* f = new TFile("sim_digi.root");
3
           TTree* t = (TTree*)f->Get("er");
4
           //t->AddFriend("er","reco.root");
5

    
6
           TCanvas *c1 = new TCanvas("c1", "Telescope simulation", 1400, 1000);
7
           c1->Divide(2,2);
8
           c1->cd(1);
9
           t->Draw("ERQTelescopeSiPoint_T1_DoubleSi_SD2_XY_0_X.fPDG","ERQTelescopeSiPoint_T1_DoubleSi_SD2_XY_0_X.fPDG == 1000020030");
10
           c1->cd(2);
11
           t->Draw("ERQTelescopeSiPoint_T1_DoubleSi_SD2_XY_0_X.fPDG","ERQTelescopeSiPoint_T1_DoubleSi_SD2_XY_0_X.fPDG == 1000010030");
12
           c1->cd(3);
13
           t->Draw("ERQTelescopeSiPoint_T2_DoubleSi_SD2_XY_1_X.fPDG","ERQTelescopeSiPoint_T2_DoubleSi_SD2_XY_1_X.fPDG == 1000020030");
14
           c1->cd(4);
15
           t->Draw("ERQTelescopeSiPoint_T2_DoubleSi_SD2_XY_1_X.fPDG","ERQTelescopeSiPoint_T2_DoubleSi_SD2_XY_1_X.fPDG == 1000010030");
16

    
17
        TCanvas *c2 = new TCanvas("c2", "Telescope de/E on digi info", 1400, 1000);
18
        c2->Divide(2,1);
19
        
20
        c2->cd(1);
21
        TH2F *T1deE = new TH2F("T1deE","T1 de(SingleSi) vs E(SingleSi+DoubleSi+CsI)",1000,0,0.25,1000,0,0.0015);
22
        T1deE->GetXaxis()->SetTitle("E");
23
        T1deE->GetYaxis()->SetTitle("de");
24
        t->Draw("ERQTelescopeSiDigi_T1_SingleSi_1_X_0.fEdep:ERQTelescopeSiDigi_T1_SingleSi_1_X_0.fEdep+(ERQTelescopeSiDigi_T1_DoubleSi_SD2_XY_0_X.fEdep+ERQTelescopeSiDigi_T1_DoubleSi_SD2_XY_0_Y.fEdep)/2.+ERQTelescopeCsIDigi_T1_CsI_1_0.fEdep>>T1deE","","gof");
25
        T1deE->Draw();
26

    
27
        c2->cd(2);
28
        TH2F *T2deE = new TH2F("T2deE","T1 de(DoubleSi) vs E(DoubleSi+CsI)",1000,0,0.25,1000,0,0.04);
29
        t->Draw("(ERQTelescopeSiDigi_T2_DoubleSi_SD2_XY_1_X.fEdep+ERQTelescopeSiDigi_T2_DoubleSi_SD2_XY_1_Y.fEdep)/2.:(ERQTelescopeSiDigi_T2_DoubleSi_SD2_XY_1_X.fEdep+ERQTelescopeSiDigi_T2_DoubleSi_SD2_XY_1_Y.fEdep)/2.+ERQTelescopeCsIDigi_T2_CsI_1_1.fEdep>>T2deE","","gof");
30
        T2deE->GetXaxis()->SetTitle("E");
31
        T2deE->GetYaxis()->SetTitle("de");
32
        T2deE->Draw();
33
}