Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:02:22

0001 // Hits distribution of detectors
0002 // Shyam Kumar:INFN Bari, shyam.kumar@ba.infn.it; shyam055119@gmail.com
0003 
0004 #include <TGraphErrors.h>
0005 #include <TF1.h>
0006 #include <TRandom.h>
0007 #include <TCanvas.h>
0008 #include <TLegend.h>
0009 #include <TMath.h>
0010 
0011 void draw_hits()
0012 {
0013 
0014 //==========Style of the plot============
0015    gStyle->SetPalette(1);
0016    gStyle->SetOptTitle(1);
0017    gStyle->SetTitleOffset(.85,"X");gStyle->SetTitleOffset(.85,"Y");
0018    gStyle->SetTitleSize(.04,"X");gStyle->SetTitleSize(.04,"Y");
0019    gStyle->SetLabelSize(.04,"X");gStyle->SetLabelSize(.04,"Y");
0020    gStyle->SetHistLineWidth(2);
0021    gStyle->SetOptFit(1);
0022    gStyle->SetOptStat(0);
0023 
0024 //=======Reading the root file DD4HEP===========
0025  TFile *f = TFile::Open("sim.edm4hep.root");
0026  TTree *sim = (TTree*)f->Get("events");
0027 
0028  // Timer Start
0029   TStopwatch timer;
0030   timer.Start();
0031 
0032   TCanvas *c1 = new TCanvas("c1","c1",1200,1000);
0033   c1->SetMargin(0.09, 0.03 ,0.1,0.06);
0034 
0035  // X-Y Hits
0036   Int_t nbins = 320;
0037   Double_t x= 100., y = 100.;
0038   TH2D *hitsxy_vtx_si = new TH2D("hitsxy_vtx_si","hitsxy_vtx_si",nbins,-x,x,nbins,-y,y);
0039   TH2D *hitsxy_barrel_si = new TH2D("hitsxy_barrel_si","hitsxy_barrel_si",nbins,-x,x,nbins,-y,y);
0040   TH2D *hitsxy_barrel_mm_in = new TH2D("hitsxy_barrel_mm_in","hitsxy_barrel_mm_in",nbins,-x,x,nbins,-y,y);
0041   TH2D *hitsxy_barrel_tof = new TH2D("hitsxy_barrel_tof","hitsxy_barrel_tof",nbins,-x,x,nbins,-y,y);
0042   TH2D *hitsxy_barrel_mm_out = new TH2D("hitsxy_barrel_mm_out","hitsxy_barrel_mm_out",nbins,-x,x,nbins,-y,y);
0043 
0044   TString si_vtx_hitsXY ="VertexBarrelHits.position.y*0.1:VertexBarrelHits.position.x*0.1>>hitsxy_vtx_si";
0045   TString si_barrel_hitsXY ="SiBarrelHits.position.y*0.1:SiBarrelHits.position.x*0.1>>hitsxy_barrel_si";
0046   TString barrel_mpgd_in_hitsXY ="MPGDBarrelHits.position.y*0.1:MPGDBarrelHits.position.x*0.1>>hitsxy_barrel_mm_in";
0047   TString tof_barrel_hitsXY ="TOFBarrelHits.position.y*0.1:TOFBarrelHits.position.x*0.1>>hitsxy_barrel_tof";
0048   TString barrel_mpgd_out_hitsXY ="OuterMPGDBarrelHits.position.y*0.1:OuterMPGDBarrelHits.position.x*0.1>>hitsxy_barrel_mm_out";
0049 
0050         sim->Draw(si_vtx_hitsXY.Data(),"",""); // Multiply by 0.1 for cm
0051         sim->Draw(si_barrel_hitsXY.Data(),"","");
0052         sim->Draw(barrel_mpgd_in_hitsXY.Data(),"","");
0053         sim->Draw(tof_barrel_hitsXY.Data(),"","");
0054         sim->Draw(barrel_mpgd_out_hitsXY.Data(),"","");
0055 
0056         hitsxy_vtx_si->SetMarkerStyle(31);
0057         hitsxy_vtx_si->SetTitle("Hit Points (XY)");
0058         hitsxy_vtx_si->SetMarkerColor(kBlack);
0059         hitsxy_vtx_si->SetMarkerSize(0.1);
0060         hitsxy_vtx_si->SetLineColor(kBlack);
0061         hitsxy_vtx_si->GetXaxis()->SetTitle("X [cm]");
0062         hitsxy_vtx_si->GetYaxis()->SetTitle("Y [cm]");
0063         hitsxy_vtx_si->GetXaxis()->CenterTitle();
0064         hitsxy_vtx_si->GetYaxis()->CenterTitle();
0065 
0066   hitsxy_barrel_si->SetMarkerStyle(20);
0067         hitsxy_barrel_si->SetMarkerSize(0.1);
0068         hitsxy_barrel_si->SetMarkerColor(kMagenta);
0069         hitsxy_barrel_si->SetLineColor(kMagenta);
0070 
0071   hitsxy_barrel_mm_in->SetMarkerStyle(20);
0072         hitsxy_barrel_mm_in->SetMarkerSize(0.1);
0073         hitsxy_barrel_mm_in->SetMarkerColor(kBlue);
0074         hitsxy_barrel_mm_in->SetLineColor(kBlue);
0075 
0076   hitsxy_barrel_tof->SetMarkerStyle(20);
0077         hitsxy_barrel_tof->SetMarkerSize(0.1);
0078         hitsxy_barrel_tof->SetMarkerColor(kGreen);
0079         hitsxy_barrel_tof->SetLineColor(kGreen);hitsxy_barrel_mm_out->SetMarkerStyle(20);
0080         hitsxy_barrel_mm_out->SetMarkerSize(0.1);
0081         hitsxy_barrel_mm_out->SetMarkerColor(kBlue-7);
0082         hitsxy_barrel_mm_out->SetLineColor(kBlue-7);
0083         c1->cd();
0084   hitsxy_vtx_si->Draw();
0085   hitsxy_barrel_si->Draw("same");
0086   hitsxy_barrel_mm_in->Draw("same");
0087   hitsxy_barrel_tof->Draw("same");
0088         hitsxy_barrel_mm_out->Draw("same");
0089 
0090  TLegend *l= new TLegend(0.65,0.85,0.90,1.0);
0091  l->SetTextSize(0.025);
0092  l->SetBorderSize(0);
0093  l->AddEntry(hitsxy_vtx_si,"VertexBarrelHits");
0094  l->AddEntry(hitsxy_barrel_si,"SiBarrelHits");
0095  l->AddEntry(hitsxy_barrel_mm_in,"MPGDBarrelHits");
0096  l->AddEntry(hitsxy_barrel_tof,"TOFBarrelHits");
0097  l->AddEntry(hitsxy_barrel_mm_out,"OuterMPGDBarrelHits");
0098  l->Draw();
0099  c1->SaveAs("hitsxy_dd4hep.png");
0100 
0101   TCanvas *c2 = new TCanvas("c2","c2",1200,1000);
0102   c2->SetMargin(0.09, 0.03 ,0.1,0.06);
0103  // Y-Z Hits
0104  Int_t nbinsx = 400, nbinsy=1800.;
0105  x= 200.; y = 90.;
0106  double xmin = -200.;
0107 
0108    TH2D *hitsrz_vtx_si = new TH2D("hitsrz_vtx_si","hitsrz_vtx_si",nbinsx,xmin,x,nbinsy,-y,y);
0109    TH2D *hitsrz_barrel_si = new TH2D("hitsrz_barrel_si","hitsrz_barrel_si",nbinsx,-x,x,nbinsy,-y,y);
0110    TH2D *hitsrz_barrel_mm_in = new TH2D("hitsrz_barrel_mm_in","hitsrz_barrel_mm_in",nbinsx,-x,x,nbinsy,-y,y);
0111    TH2D *hitsrz_barrel_mm_out = new TH2D("hitsrz_barrel_mm_out","hitsrz_barrel_mm_out",nbinsx,-x,x,nbinsy,-y,y);
0112    TH2D *hitsrz_barrel_tof = new TH2D("hitsrz_barrel_tof","hitsrz_barrel_tof",nbinsx,-x,x,nbinsy,-y,y);
0113    TH2D *hitsrz_disks_si = new TH2D("hitsrz_disks_si","hitsrz_disks_si",nbinsx,-x,x,nbinsy,-y,y);
0114    TH2D *hitsrz_endcap_tof = new TH2D("hitsrz_endcap_tof","hitsrz_endcap_tof",nbinsx,-x,x,nbinsy,-y,y);
0115    TH2D *hitsrz_fwd_mpgd = new TH2D("hitsrz_fwd_mpgd","hitsrz_fwd_mpgd",nbinsx,-x,x,nbinsy,-y,y);
0116    TH2D *hitsrz_bwd_mpgd = new TH2D("hitsrz_bwd_mpgd","hitsrz_bwd_mpgd",nbinsx,-x,x,nbinsy,-y,y);
0117 
0118    TH2D *hitsrz_vtx_si_1 = new TH2D("hitsrz_vtx_si_1","hitsrz_vtx_si_1",nbinsx,xmin,x,nbinsy,-y,y);
0119    TH2D *hitsrz_barrel_si_1 = new TH2D("hitsrz_barrel_si_1","hitsrz_barrel_si_1",nbinsx,-x,x,nbinsy,-y,y);
0120    TH2D *hitsrz_barrel_mm_in_1 = new TH2D("hitsrz_barrel_mm_in_1","hitsrz_barrel_mm_in_1",nbinsx,-x,x,nbinsy,-y,y);
0121    TH2D *hitsrz_barrel_mm_out_1 = new TH2D("hitsrz_barrel_mm_out_1","hitsrz_barrel_mm_out_1",nbinsx,-x,x,nbinsy,-y,y);
0122    TH2D *hitsrz_barrel_tof_1 = new TH2D("hitsrz_barrel_tof_1","hitsrz_barrel_tof_1",nbinsx,-x,x,nbinsy,-y,y);
0123    TH2D *hitsrz_disks_si_1 = new TH2D("hitsrz_disks_si_1","hitsrz_disks_si_1",nbinsx,-x,x,nbinsy,-y,y);
0124    TH2D *hitsrz_endcap_tof_1 = new TH2D("hitsrz_endcap_tof_1","hitsrz_endcap_tof_1",nbinsx,-x,x,nbinsy,-y,y);
0125    TH2D *hitsrz_fwd_mpgd_1 = new TH2D("hitsrz_fwd_mpgd_1","hitsrz_fwd_mpgd_1",nbinsx,-x,x,nbinsy,-y,y);
0126    TH2D *hitsrz_bwd_mpgd_1 = new TH2D("hitsrz_bwd_mpgd_1","hitsrz_bwd_mpgd_1",nbinsx,-x,x,nbinsy,-y,y);
0127 
0128     TString si_vtx_hitsrz_posR  ="sqrt(VertexBarrelHits.position.x*VertexBarrelHits.position.x+VertexBarrelHits.position.y*VertexBarrelHits.position.y)*0.1:VertexBarrelHits.position.z*0.1>>hitsrz_vtx_si";
0129 
0130     TString si_barrel_hitsrz_posR ="sqrt(SiBarrelHits.position.x*SiBarrelHits.position.x+SiBarrelHits.position.y*SiBarrelHits.position.y)*0.1:SiBarrelHits.position.z*0.1>>hitsrz_barrel_si";
0131 
0132     TString barrel_mpgd_in_hitsrz_posR= "sqrt(MPGDBarrelHits.position.x*MPGDBarrelHits.position.x+MPGDBarrelHits.position.y*MPGDBarrelHits.position.y)*0.1:MPGDBarrelHits.position.z*0.1>>hitsrz_barrel_mm_in";
0133 
0134     TString tof_barrel_hitsrz_posR ="sqrt(TOFBarrelHits.position.x*TOFBarrelHits.position.x+TOFBarrelHits.position.y*TOFBarrelHits.position.y)*0.1:TOFBarrelHits.position.z*0.1>>hitsrz_barrel_tof";
0135 
0136     TString barrel_mpgd_out_hitsrz_posR ="sqrt(OuterMPGDBarrelHits.position.x*OuterMPGDBarrelHits.position.x+OuterMPGDBarrelHits.position.y*OuterMPGDBarrelHits.position.y)*0.1:OuterMPGDBarrelHits.position.z*0.1>>hitsrz_barrel_mm_out";
0137 
0138     TString disks_si_hitsrz_posR ="sqrt(TrackerEndcapHits.position.x*TrackerEndcapHits.position.x+TrackerEndcapHits.position.y*TrackerEndcapHits.position.y)*0.1:TrackerEndcapHits.position.z*0.1>>hitsrz_disks_si";
0139 
0140     TString endcap_tof_hitsrz_posR ="sqrt(TOFEndcapHits.position.x*TOFEndcapHits.position.x+TOFEndcapHits.position.y*TOFEndcapHits.position.y)*0.1:TOFEndcapHits.position.z*0.1>>hitsrz_endcap_tof";
0141 
0142     TString fwd_mpgd_hitsrz_posR ="sqrt(ForwardMPGDEndcapHits.position.x*ForwardMPGDEndcapHits.position.x+ForwardMPGDEndcapHits.position.y*ForwardMPGDEndcapHits.position.y)*0.1:ForwardMPGDEndcapHits.position.z*0.1>>hitsrz_fwd_mpgd";
0143 
0144     TString bwd_mpgd_hitsrz_posR ="sqrt(BackwardMPGDEndcapHits.position.x*BackwardMPGDEndcapHits.position.x+BackwardMPGDEndcapHits.position.y*BackwardMPGDEndcapHits.position.y)*0.1:BackwardMPGDEndcapHits.position.z*0.1>>hitsrz_bwd_mpgd";
0145 
0146 
0147         sim->Draw(si_vtx_hitsrz_posR.Data(),"VertexBarrelHits.position.y>0",""); // Multiply by 0.1 for cm
0148         sim->Draw(si_barrel_hitsrz_posR.Data(),"SiBarrelHits.position.y>0","");
0149         sim->Draw(barrel_mpgd_in_hitsrz_posR.Data(),"MPGDBarrelHits.position.y>0","");
0150         sim->Draw(tof_barrel_hitsrz_posR.Data(),"TOFBarrelHits.position.y>0","");
0151         sim->Draw(disks_si_hitsrz_posR.Data(),"TrackerEndcapHits.position.y>0","");
0152         sim->Draw(endcap_tof_hitsrz_posR.Data(),"TOFEndcapHits.position.y>0","");
0153   sim->Draw(barrel_mpgd_out_hitsrz_posR.Data(),"OuterMPGDBarrelHits.position.y>0","");
0154   sim->Draw(fwd_mpgd_hitsrz_posR.Data(),"ForwardMPGDEndcapHits.position.y>0","");
0155         sim->Draw(bwd_mpgd_hitsrz_posR.Data(),"BackwardMPGDEndcapHits.position.y>0","");
0156 
0157     TString si_vtx_hitsrz_negR  ="-1.0*sqrt(VertexBarrelHits.position.x*VertexBarrelHits.position.x+VertexBarrelHits.position.y*VertexBarrelHits.position.y)*0.1:VertexBarrelHits.position.z*0.1>>hitsrz_vtx_si_1";
0158 
0159     TString si_barrel_hitsrz_negR ="-1.0*sqrt(SiBarrelHits.position.x*SiBarrelHits.position.x+SiBarrelHits.position.y*SiBarrelHits.position.y)*0.1:SiBarrelHits.position.z*0.1>>hitsrz_barrel_si_1";
0160 
0161     TString barrel_mpgd_in_hitsrz_negR= "-1.0*sqrt(MPGDBarrelHits.position.x*MPGDBarrelHits.position.x+MPGDBarrelHits.position.y*MPGDBarrelHits.position.y)*0.1:MPGDBarrelHits.position.z*0.1>>hitsrz_barrel_mm_in_1";
0162 
0163     TString tof_barrel_hitsrz_negR ="-1.0*sqrt(TOFBarrelHits.position.x*TOFBarrelHits.position.x+TOFBarrelHits.position.y*TOFBarrelHits.position.y)*0.1:TOFBarrelHits.position.z*0.1>>hitsrz_barrel_tof_1";
0164 
0165     TString barrel_mpgd_out_hitsrz_negR ="-1.0*sqrt(OuterMPGDBarrelHits.position.x*OuterMPGDBarrelHits.position.x+OuterMPGDBarrelHits.position.y*OuterMPGDBarrelHits.position.y)*0.1:OuterMPGDBarrelHits.position.z*0.1>>hitsrz_barrel_mm_out_1";
0166 
0167     TString disks_si_hitsrz_negR ="-1.0*sqrt(TrackerEndcapHits.position.x*TrackerEndcapHits.position.x+TrackerEndcapHits.position.y*TrackerEndcapHits.position.y)*0.1:TrackerEndcapHits.position.z*0.1>>hitsrz_disks_si_1";
0168 
0169     TString endcap_tof_hitsrz_negR ="-1.0*sqrt(TOFEndcapHits.position.x*TOFEndcapHits.position.x+TOFEndcapHits.position.y*TOFEndcapHits.position.y)*0.1:TOFEndcapHits.position.z*0.1>>hitsrz_endcap_tof_1";
0170 
0171     TString fwd_mpgd_hitsrz_negR ="-1.0*sqrt(ForwardMPGDEndcapHits.position.x*ForwardMPGDEndcapHits.position.x+ForwardMPGDEndcapHits.position.y*ForwardMPGDEndcapHits.position.y)*0.1:ForwardMPGDEndcapHits.position.z*0.1>>hitsrz_fwd_mpgd_1";
0172 
0173     TString bwd_mpgd_hitsrz_negR ="-1.0*sqrt(BackwardMPGDEndcapHits.position.x*BackwardMPGDEndcapHits.position.x+BackwardMPGDEndcapHits.position.y*BackwardMPGDEndcapHits.position.y)*0.1:BackwardMPGDEndcapHits.position.z*0.1>>hitsrz_bwd_mpgd_1";
0174 
0175     sim->Draw(si_vtx_hitsrz_negR.Data(),"VertexBarrelHits.position.y<0",""); // Multiply by 0.1 for cm
0176           sim->Draw(si_barrel_hitsrz_negR.Data(),"SiBarrelHits.position.y<0","");
0177           sim->Draw(barrel_mpgd_in_hitsrz_negR.Data(),"MPGDBarrelHits.position.y<0","");
0178           sim->Draw(tof_barrel_hitsrz_negR.Data(),"TOFBarrelHits.position.y<0","");
0179           sim->Draw(disks_si_hitsrz_negR.Data(),"TrackerEndcapHits.position.y<0","");
0180           sim->Draw(endcap_tof_hitsrz_negR.Data(),"TOFEndcapHits.position.y<0","");
0181     sim->Draw(barrel_mpgd_out_hitsrz_negR.Data(),"OuterMPGDBarrelHits.position.y<0","");
0182     sim->Draw(fwd_mpgd_hitsrz_negR.Data(),"ForwardMPGDEndcapHits.position.y<0","");
0183           sim->Draw(bwd_mpgd_hitsrz_negR.Data(),"BackwardMPGDEndcapHits.position.y<0","");
0184 
0185 
0186     hitsrz_vtx_si->SetMarkerStyle(31);
0187           hitsrz_vtx_si->SetTitle("");
0188         hitsrz_vtx_si->SetMarkerSize(0.1);
0189           hitsrz_vtx_si->SetLineColor(kBlack);
0190           hitsrz_vtx_si->SetMarkerColor(kBlack);
0191           hitsrz_vtx_si->GetXaxis()->SetTitle("Z [cm]");
0192           hitsrz_vtx_si->GetYaxis()->SetTitle("R [cm]");
0193           hitsrz_vtx_si->GetXaxis()->CenterTitle();
0194           hitsrz_vtx_si->GetYaxis()->CenterTitle();
0195 
0196     hitsrz_vtx_si_1->SetMarkerSize(0.1);
0197           hitsrz_vtx_si_1->SetLineColor(kBlack);
0198           hitsrz_vtx_si_1->SetMarkerColor(kBlack);
0199 
0200           hitsrz_barrel_si->SetMarkerStyle(20);
0201           hitsrz_barrel_si->SetMarkerSize(0.1);
0202           hitsrz_barrel_si->SetMarkerColor(kMagenta);
0203           hitsrz_barrel_si->SetLineColor(kMagenta);
0204 
0205     hitsrz_barrel_si_1->SetMarkerSize(0.1);
0206           hitsrz_barrel_si_1->SetLineColor(kMagenta);
0207           hitsrz_barrel_si_1->SetMarkerColor(kMagenta);
0208 
0209           hitsrz_barrel_mm_in->SetMarkerStyle(20);
0210           hitsrz_barrel_mm_in->SetMarkerSize(0.1);
0211           hitsrz_barrel_mm_in->SetLineColor(kBlue);
0212           hitsrz_barrel_mm_in->SetMarkerColor(kBlue);
0213     hitsrz_barrel_mm_in_1->SetMarkerSize(0.1);
0214           hitsrz_barrel_mm_in_1->SetLineColor(kBlue);
0215           hitsrz_barrel_mm_in_1->SetMarkerColor(kBlue);
0216 
0217           hitsrz_barrel_tof->SetMarkerStyle(20);
0218           hitsrz_barrel_tof->SetMarkerSize(0.1);
0219           hitsrz_barrel_tof->SetLineColor(kGreen);
0220         hitsrz_barrel_tof->SetMarkerColor(kGreen);
0221     hitsrz_barrel_tof_1->SetMarkerSize(0.1);
0222           hitsrz_barrel_tof_1->SetLineColor(kGreen);
0223           hitsrz_barrel_tof_1->SetMarkerColor(kGreen);
0224 
0225 
0226     hitsrz_barrel_mm_out->SetMarkerStyle(20);
0227           hitsrz_barrel_mm_out->SetMarkerSize(0.1);
0228           hitsrz_barrel_mm_out->SetMarkerColor(kBlue-7);
0229           hitsrz_barrel_mm_out->SetLineColor(kBlue-7);
0230 
0231     hitsrz_barrel_mm_out_1->SetMarkerSize(0.1);
0232           hitsrz_barrel_mm_out_1->SetLineColor(kBlue-7);
0233           hitsrz_barrel_mm_out_1->SetMarkerColor(kBlue-7);
0234     hitsrz_endcap_tof->SetMarkerStyle(20);
0235           hitsrz_endcap_tof->SetMarkerSize(0.1);
0236           hitsrz_endcap_tof->SetMarkerColor(kCyan);
0237           hitsrz_endcap_tof->SetLineColor(kCyan);
0238 
0239     hitsrz_endcap_tof_1->SetMarkerSize(0.1);
0240           hitsrz_endcap_tof_1->SetLineColor(kCyan);
0241           hitsrz_endcap_tof_1->SetMarkerColor(kCyan);
0242 
0243           hitsrz_disks_si->SetMarkerStyle(20);
0244           hitsrz_disks_si->SetMarkerSize(0.1);
0245           hitsrz_disks_si->SetMarkerColor(kRed);
0246           hitsrz_disks_si->SetLineColor(kRed);
0247 
0248     hitsrz_disks_si_1->SetMarkerSize(0.1);
0249           hitsrz_disks_si_1->SetLineColor(kRed);
0250           hitsrz_disks_si_1->SetMarkerColor(kRed);
0251 
0252     hitsrz_fwd_mpgd->SetMarkerSize(0.1);
0253           hitsrz_fwd_mpgd->SetLineColor(kRed-7);
0254           hitsrz_fwd_mpgd->SetMarkerColor(kRed-7);
0255           hitsrz_fwd_mpgd_1->SetMarkerSize(0.1);
0256           hitsrz_fwd_mpgd_1->SetLineColor(kRed-7);
0257           hitsrz_fwd_mpgd_1->SetMarkerColor(kRed-7);
0258           hitsrz_bwd_mpgd->SetMarkerSize(0.1);
0259           hitsrz_bwd_mpgd->SetLineColor(kOrange);
0260           hitsrz_bwd_mpgd->SetMarkerColor(kOrange);
0261 
0262     hitsrz_bwd_mpgd_1->SetMarkerSize(0.1);
0263           hitsrz_bwd_mpgd_1->SetLineColor(kOrange);
0264           hitsrz_bwd_mpgd_1->SetMarkerColor(kOrange);
0265 
0266    c2->cd();
0267         hitsrz_vtx_si->Draw();
0268         hitsrz_vtx_si_1->Draw("same");
0269         hitsrz_barrel_si->Draw("same");
0270         hitsrz_barrel_si_1->Draw("same");
0271         hitsrz_barrel_mm_in->Draw("same");
0272         hitsrz_barrel_mm_in_1->Draw("same");
0273         hitsrz_barrel_tof->Draw("same");
0274         hitsrz_barrel_tof_1->Draw("same");
0275         hitsrz_barrel_mm_out->Draw("same");
0276         hitsrz_barrel_mm_out_1->Draw("same");
0277         hitsrz_endcap_tof->Draw("same");
0278         hitsrz_endcap_tof_1->Draw("same");
0279         hitsrz_disks_si->Draw("same");
0280         hitsrz_disks_si_1->Draw("same");
0281         hitsrz_fwd_mpgd->Draw("same");
0282         hitsrz_fwd_mpgd_1->Draw("same");
0283         hitsrz_bwd_mpgd->Draw("same");
0284         hitsrz_bwd_mpgd_1->Draw("same");
0285 
0286   TLegend *l1= new TLegend(0.11,0.88,0.95,0.99);
0287   l1->SetNColumns(3);
0288   l1->SetTextSize(0.025);
0289   l1->SetBorderSize(0);
0290   l1->AddEntry(hitsrz_vtx_si,"VertexBarrelHits");
0291   l1->AddEntry(hitsrz_barrel_si,"SiBarrelHits");
0292   l1->AddEntry(hitsrz_barrel_mm_in,"MPGDBarrelHits");
0293   l1->AddEntry(hitsrz_barrel_tof,"TOFBarrelHits");
0294   l1->AddEntry(hitsrz_barrel_mm_out,"OuterMPGDBarrelHits");
0295   l1->AddEntry(hitsrz_disks_si,"TrackerEndcapHits");
0296   l1->AddEntry(hitsrz_endcap_tof,"TOFEndcapHits");
0297   l1->AddEntry(hitsrz_fwd_mpgd,"ForwardMPGDEndcapHits");
0298   l1->AddEntry(hitsrz_bwd_mpgd,"BackwardMPGDEndcapHits");
0299   l1->Draw();
0300 
0301   c2->SaveAs("hitsrz_dd4hep.png");
0302  // Timer Stop
0303   timer.Stop();
0304   Double_t realtime = timer.RealTime();
0305   Double_t cputime = timer.CpuTime();
0306   printf("RealTime=%f seconds, CpuTime=%f seconds\n",realtime,cputime);
0307 
0308 }