#include "TFile.h" #include "TCanvas.h" #include "TStyle.h" #include "TH1.h" #include "TH2.h" #include "TH3.h" #include "TGaxis.h" #include "TRandom.h" #include "TLegend.h" #include "TPaveStats.h" #include "TGraph.h" #include "TSystem.h" #include "TTree.h" #include "TTreePlayer.h" #include "TF1.h" #include "TCut.h" #include "TPaletteAxis.h" void simlemma() { int n=3; int c_YTitleSize=25; int c_YTitleFont=43; double c_YTitleOffset=1.; int c_YLabelFont=43; int c_YLabelSize=25; int c_XTitleSize=25; int c_XTitleFont=43; double c_XTitleOffset=1.1; int c_XLabelFont=43; int c_XLabelSize=25; double c_XTitleOffsetTH3=2.; double c_YTitleOffsetTH3=2.; double c_ZTitleOffsetTH3=2.; float fillcolor=0.35; char dirin[50];//Directory where there is the input root file char dirout[50];//Main Directory where to save the output files char Volume1[50]; char Volume2[50]; char Event[50]; char Secondary[50]; char dirv1[50]; char dirv2[50]; char direv[50]; char dirsp[50]; char PDGname[50]; char KinEnname[50]; char Momentumname[50]; char Directionname[50]; char RelEnname[50]; char RelEnHitname[50]; char MomHitname[50]; char RelEnmomname[50]; char PDGxname[50]; char kinenxname[50]; char angname[50]; char angxname[50]; char momxname[50]; char totmomXname[50]; char dirxname[50]; char relenxname[50]; char vertxname[50]; char RelEnXHitname[50]; char RelEnXMomname[50]; char countyname[50]; char Hitpoints[50]; char XHitpoints[50]; char YHitpoints[50]; char ZHitpoints[50]; char Vertname[50]; char momvalxname[50]; char Momentumvalname[50]; char totmomname[50]; char Invmassname[50]; char invmassxname[50]; char Posiemitx[50]; char Posiemity[50]; char Angemitx[50]; char Angemity[50]; char htempname[50]; char Emittancename[50]; char outformat[50]; sprintf(dirin, "C:/"); sprintf(dirout, "C:/"); sprintf(dirv1, "Volume1/"); sprintf(dirv2, "Volume2/"); sprintf(direv, "Events/"); sprintf(dirsp, "Secondaries/"); sprintf(Volume1, "B1Volume1"); sprintf(Volume2, "B1Volume2"); sprintf(Event, "B1EventVariables"); sprintf(Secondary, "B1Secondaryparticles"); sprintf(PDGname, "Particle PDG"); sprintf(KinEnname, "Particle Kinetic Energy"); sprintf(Momentumname, "Particle Momentum Direction"); sprintf(Momentumvalname, "Particle Momentum "); sprintf(momvalxname, "Particle Momentum (MeV/c)"); sprintf(Directionname, "Particle Position"); sprintf(RelEnname, "Particle Released Energy"); sprintf(RelEnHitname, "Particle Released Energy- Hit point"); sprintf(MomHitname, "Particle Momentum Direction- Hit point"); sprintf(RelEnmomname, "Particle Released Energy- Momentum Direction"); sprintf(PDGxname, "PDG"); sprintf(kinenxname, "Kinetic Energy (MeV)"); sprintf(momxname, "Momentum Direction (mm)"); sprintf(dirxname, "Position (mm)"); sprintf(relenxname, "Released Energy (MeV)"); sprintf(RelEnXHitname, "Hit point (mm)"); sprintf(RelEnXMomname, "Momentum Direction "); sprintf(Hitpoints, "Space Hit points"); sprintf(XHitpoints, "z Hit points (mm)"); sprintf(YHitpoints, "x Hit points (mm)"); sprintf(ZHitpoints, "y Hit points (mm)"); sprintf(angname, "Angular distribution"); sprintf(angxname, "Angular distribution (rad)"); sprintf(vertxname, "Vertex (mm)"); sprintf(Invmassname, "Invariant Mass"); sprintf(totmomname, "Particle Momentum"); sprintf(totmomXname, "Particle Momentum (MeV/c)"); sprintf(invmassxname, "Invariant Mass (MeV/c^{2})"); sprintf(Posiemitx, "x (mm)"); sprintf(Posiemity, "y (mm)"); sprintf(Angemitx, "x' (rad)"); sprintf(Angemity, "y' (rad)"); sprintf(Emittancename, "Emittance"); sprintf(Vertname, "Vertex"); sprintf(countyname, "#Counts"); sprintf(htempname, "Lemma"); sprintf(outformat, "pdf"); //sprintf(outformat, "png"); TString myfilein = TString::Format("%sB1.root",dirin); gSystem->mkdir(TString::Format("%ssimulazione/", dirout), kTRUE); gSystem->mkdir(TString::Format("%ssimulazione/%s", dirout,dirv1), kTRUE); gSystem->mkdir(TString::Format("%ssimulazione/%s", dirout, dirv2), kTRUE); gSystem->mkdir(TString::Format("%ssimulazione/%s", dirout, direv), kTRUE); gSystem->mkdir(TString::Format("%ssimulazione/%s", dirout, dirsp), kTRUE); TString outfolder=TString::Format("%ssimulazione/",dirout); TString outfolderV1=TString::Format("%ssimulazione/%s",dirout,dirv1); TString outfolderV2=TString::Format("%ssimulazione/%s",dirout, dirv2); TString outfolderev=TString::Format("%ssimulazione/%s",dirout, direv); TString outfoldersp=TString::Format("%ssimulazione/%s",dirout, dirsp); TString cdnamePDGV1 = TString::Format("%s - %s",PDGname, Volume1); TString cdnameKinEnV1 = TString::Format("%s - %s",KinEnname, Volume1); TString cdnamePxV1 = TString::Format("%s x-axis - %s", Momentumname,Volume1); TString cdnamePyV1 = TString::Format("%s y-axis - %s", Momentumname, Volume1); TString cdnamePzV1 = TString::Format("%s z-axis - %s", Momentumname, Volume1); TString cdnameDxV1= TString::Format("%s x-axis - %s", Directionname, Volume1); TString cdnameDyV1= TString::Format("%s y-axis - %s", Directionname, Volume1); TString cdnameDzV1= TString::Format("%s z-axis - %s", Directionname, Volume1); TString cdnameRelEnV1 = TString::Format("%s- %s",RelEnname,Volume1); TString cdnamehenexhitv1 = TString::Format("%s- x axis %s",RelEnHitname,Volume1); TString cdnameheneyhitv1 = TString::Format("%s- y axis %s",RelEnHitname,Volume1); TString cdnamehenezhitv1 = TString::Format("%s- z axis %s",RelEnHitname,Volume1); TString cdnamehenexmomv1 = TString::Format("%s- x axis %s",RelEnmomname,Volume1); TString cdnameheneymomv1 = TString::Format("%s- y axis %s",RelEnmomname,Volume1); TString cdnamehenezmomv1 = TString::Format("%s- z axis %s",RelEnmomname,Volume1); TString cdnamehmomxhitv1 = TString::Format("%s- x axis %s",MomHitname,Volume1); TString cdnamehmomyhitv1 = TString::Format("%s- y axis %s",MomHitname,Volume1); TString cdnamehmomzhitv1 = TString::Format("%s- z axis %s",MomHitname,Volume1); TString cdnamehenexhitv2 = TString::Format("%s- x axis %s",RelEnHitname,Volume2); TString cdnameheneyhitv2 = TString::Format("%s- y axis %s",RelEnHitname,Volume2); TString cdnamehenezhitv2 = TString::Format("%s- z axis %s",RelEnHitname,Volume2); TString cdnamehenexmomv2 = TString::Format("%s- x axis %s",RelEnmomname,Volume2); TString cdnameheneymomv2 = TString::Format("%s- y axis %s",RelEnmomname,Volume2); TString cdnamehenezmomv2 = TString::Format("%s- z axis %s",RelEnmomname,Volume2); TString cdnamehmomxhitv2 = TString::Format("%s- x axis %s",MomHitname,Volume2); TString cdnamehmomyhitv2 = TString::Format("%s- y axis %s",MomHitname,Volume2); TString cdnamehmomzhitv2 = TString::Format("%s- z axis %s",MomHitname,Volume2); TString cdXnamehenehit = TString::Format("%s",RelEnXHitname); TString cdYnamehenehit = TString::Format("%s",relenxname); TString cdXnamehspacehit = TString::Format("%s",XHitpoints); TString cdYnamehspacehit = TString::Format("%s",YHitpoints); TString cdZnamehspacehit = TString::Format("%s",ZHitpoints); TString cdXnamehenemom = TString::Format("%s",RelEnXMomname); TString cdnamePDGV2 = TString::Format("%s - %s",PDGname, Volume2); TString cdnameKinEnv2 = TString::Format("%s - %s",KinEnname, Volume2); TString cdnamePxv2 = TString::Format("%s x-axis - %s", Momentumname,Volume2); TString cdnamePyv2 = TString::Format("%s y-axis - %s", Momentumname, Volume2); TString cdnamePzv2 = TString::Format("%s z-axis - %s", Momentumname, Volume2); TString cdnameDxv2= TString::Format("%s x-axis - %s", Directionname, Volume2); TString cdnameDyv2= TString::Format("%s y-axis - %s", Directionname, Volume2); TString cdnameDzv2= TString::Format("%s z-axis - %s", Directionname, Volume2); TString cdnameRelEnv2 = TString::Format("%s - %s",RelEnname,Volume2); TString cdnameRelEnev = TString::Format("%s Events - %s",RelEnname,Volume1); TString cdnameRelEnev2 = TString::Format("%s Events - %s",RelEnname,Volume2); TString cdnamePDGsp = TString::Format("%s - %s",PDGname, Secondary); TString cdnameKinEnsp = TString::Format("%s - %s",KinEnname, Secondary); TString cdnameinvmasssp = TString::Format("%s - %s",Invmassname, Secondary); TString cdnamePxsp = TString::Format("%s x-axis - %s", Momentumname,Secondary); TString cdnamePysp = TString::Format("%s y-axis - %s", Momentumname, Secondary); TString cdnamePzsp = TString::Format("%s z-axis - %s", Momentumname, Secondary); TString cdnameangxsp = TString::Format("%s x-axis - %s", angname, Secondary); TString cdnameangysp = TString::Format("%s y-axis - %s", angname, Secondary); TString cdnamemomvalxsp = TString::Format("%s x-axis - %s", Momentumvalname, Secondary); TString cdnamemomvalysp = TString::Format("%s y-axis - %s", Momentumvalname, Secondary); TString cdnamemomvalzsp = TString::Format("%s z-axis - %s", Momentumvalname, Secondary); TString cdnameDxsp= TString::Format("%s x-axis - %s", Directionname, Secondary); TString cdnameDysp= TString::Format("%s y-axis - %s", Directionname, Secondary); TString cdnameDzsp= TString::Format("%s z-axis - %s", Directionname, Secondary); TString cdnametotmomsp= TString::Format("%s - %s", totmomname, Secondary); TString cdnamevertxsp= TString::Format("%s x-axis - %s", Vertname, Secondary); TString cdnamevertysp= TString::Format("%s y-axis - %s", Vertname, Secondary); TString cdnamevertzsp= TString::Format("%s z-axis - %s", Vertname, Secondary); TString cdnameRelEnsp = TString::Format("%s - %s",RelEnname,Secondary); TString cdnamehemitxxpsp = TString::Format("%s x-x' - %s", Emittancename, Secondary); TString cdnamehemityypsp = TString::Format("%s y-y' - %s", Emittancename, Secondary); TString cdXnamehemitxxp = TString::Format("%s", Posiemitx); TString cdYnamehemitxxp = TString::Format("%s", Angemitx); TString cdXnamehemityyp = TString::Format("%s", Posiemity); TString cdYnamehemityyp = TString::Format("%s", Angemity); TString cdnamehspacehitv1 = TString::Format("%s-%s",Hitpoints,Volume1); TString cdnamehspacehitv2 = TString::Format("%s-%s",Hitpoints,Volume2); TString myplotpdgv1 = TString::Format("%s%s-%s.%s",outfolderV1.Data(), Volume1, PDGname, outformat); TString myplotkinenv1 = TString::Format("%s%s-%s.%s",outfolderV1.Data(), Volume1, KinEnname, outformat); TString myplotmomxv1 = TString::Format("%s%s-%sx.%s",outfolderV1.Data(), Volume1, Momentumname, outformat); TString myplotmomyv1 = TString::Format("%s%s-%sy.%s",outfolderV1.Data(), Volume1, Momentumname, outformat); TString myplotmomzv1 = TString::Format("%s%s-%sz.%s",outfolderV1.Data(), Volume1, Momentumname, outformat); TString myplotdirxv1 = TString::Format("%s%s-%sx.%s",outfolderV1.Data(), Volume1, Directionname, outformat); TString myplotdiryv1 = TString::Format("%s%s-%sy.%s",outfolderV1.Data(), Volume1, Directionname, outformat); TString myplotdirzv1 = TString::Format("%s%s-%sz.%s",outfolderV1.Data(), Volume1, Directionname, outformat); TString myplotrelenv1 = TString::Format("%s%s-%s.%s",outfolderV1.Data(), Volume1, RelEnname, outformat); TString myplothenexhitv1 = TString::Format("%s%s-%s-x axis.%s",outfolderV1.Data(), Volume1, RelEnHitname, outformat); TString myplotheneyhitv1 = TString::Format("%s%s-%s-y axis.%s",outfolderV1.Data(), Volume1, RelEnHitname, outformat); TString myplothenezhitv1 = TString::Format("%s%s-%s-z axis.%s",outfolderV1.Data(), Volume1, RelEnHitname, outformat); TString myplothenexmomv1 = TString::Format("%s%s-%s-x-axis.%s",outfolderV1.Data(), Volume1, RelEnmomname, outformat); TString myplotheneymomv1 = TString::Format("%s%s-%s-y-axis.%s",outfolderV1.Data(), Volume1, RelEnmomname, outformat); TString myplothenezmomv1 = TString::Format("%s%s-%s-z-axis.%s",outfolderV1.Data(), Volume1, RelEnmomname, outformat); TString myplothenexhitv2 = TString::Format("%s%s-%s-x axis.%s",outfolderV2.Data(), Volume2, RelEnHitname, outformat); TString myplothmomxhitv1 = TString::Format("%s%s-%s-x axis.%s",outfolderV1.Data(), Volume1, MomHitname, outformat); TString myplothmomyhitv1 = TString::Format("%s%s-%s-y axis.%s",outfolderV1.Data(), Volume1, MomHitname, outformat); TString myplothmomzhitv1 = TString::Format("%s%s-%s-z axis.%s",outfolderV1.Data(), Volume1, MomHitname, outformat); TString myplotheneyhitv2 = TString::Format("%s%s-%s-y axis.%s",outfolderV2.Data(), Volume2, RelEnHitname, outformat); TString myplothenezhitv2 = TString::Format("%s%s-%s-z axis.%s",outfolderV2.Data(), Volume2, RelEnHitname, outformat); TString myplothenexmomv2 = TString::Format("%s%s-%s-x-axis.%s",outfolderV2.Data(), Volume2, RelEnmomname, outformat); TString myplotheneymomv2 = TString::Format("%s%s-%s-y-axis.%s",outfolderV2.Data(), Volume2, RelEnmomname, outformat); TString myplothenezmomv2 = TString::Format("%s%s-%s-z-axis.%s",outfolderV2.Data(), Volume2, RelEnmomname, outformat); TString myplothmomxhitv2 = TString::Format("%s%s-%s-x axis.%s",outfolderV1.Data(), Volume2, MomHitname, outformat); TString myplothmomyhitv2 = TString::Format("%s%s-%s-y axis.%s",outfolderV1.Data(), Volume2, MomHitname, outformat); TString myplothmomzhitv2 = TString::Format("%s%s-%s-z axis.%s",outfolderV1.Data(), Volume2, MomHitname, outformat); TString myplotpdgv2 = TString::Format("%s%s-%s.%s",outfolderV2.Data(), Volume2, PDGname, outformat); TString myplotkinenv2 = TString::Format("%s%s-%s.%s",outfolderV2.Data(), Volume2, KinEnname, outformat); TString myplotmomxv2 = TString::Format("%s%s-%sx.%s",outfolderV2.Data(), Volume2, Momentumname, outformat); TString myplotmomyv2 = TString::Format("%s%s-%sy.%s",outfolderV2.Data(), Volume2, Momentumname, outformat); TString myplotmomzv2 = TString::Format("%s%s-%sz.%s",outfolderV2.Data(), Volume2, Momentumname, outformat); TString myplotdirxv2 = TString::Format("%s%s-%sx.%s",outfolderV2.Data(), Volume2, Directionname, outformat); TString myplotdiryv2 = TString::Format("%s%s-%sy.%s",outfolderV2.Data(), Volume2, Directionname, outformat); TString myplotdirzv2 = TString::Format("%s%s-%sz.%s",outfolderV2.Data(), Volume2, Directionname, outformat); TString myplotrelenv2 = TString::Format("%s%s-%s.%s",outfolderV2.Data(), Volume2, RelEnname, outformat); TString myplotrelenev = TString::Format("%s%s-%s vol1.%s",outfolderev.Data(), Event, RelEnname, outformat); TString myplotrelenev2 = TString::Format("%s%s-%s vol2.%s",outfolderev.Data(), Event, RelEnname, outformat); TString myplotpdgsp = TString::Format("%s%s-%s.%s",outfoldersp.Data(), Secondary, PDGname, outformat); TString myplotkinensp = TString::Format("%s%s-%s.%s",outfoldersp.Data(), Secondary, KinEnname, outformat); TString myplotmomxsp = TString::Format("%s%s-%sx.%s",outfoldersp.Data(), Secondary, Momentumname, outformat); TString myplotmomysp = TString::Format("%s%s-%sy.%s",outfoldersp.Data(), Secondary, Momentumname, outformat); TString myplotmomzsp = TString::Format("%s%s-%sz.%s",outfoldersp.Data(), Secondary, Momentumname, outformat); TString myplotvertxsp = TString::Format("%s%s-%sx.%s",outfoldersp.Data(), Secondary, Vertname, outformat); TString myplotvertysp = TString::Format("%s%s-%sy.%s",outfoldersp.Data(), Secondary, Vertname, outformat); TString myplotvertzsp = TString::Format("%s%s-%sz.%s",outfoldersp.Data(), Secondary, Vertname, outformat); TString myplottotmomsp = TString::Format("%s%s-%s.%s",outfoldersp.Data(), Secondary, totmomname, outformat); TString myplotdirxsp = TString::Format("%s%s-%sx.%s",outfoldersp.Data(), Secondary, Directionname, outformat); TString myplotdirysp = TString::Format("%s%s-%sy.%s",outfoldersp.Data(), Secondary, Directionname, outformat); TString myplotdirzsp = TString::Format("%s%s-%sz.%s",outfoldersp.Data(), Secondary, Directionname, outformat); TString myplotinvmasssp = TString::Format("%s%s-%s.%s",outfoldersp.Data(), Secondary, Invmassname, outformat); TString myplotmomvalxsp = TString::Format("%s%s-%sx.%s",outfoldersp.Data(), Secondary, Momentumvalname, outformat); TString myplotmomvalysp = TString::Format("%s%s-%sy.%s",outfoldersp.Data(), Secondary, Momentumvalname, outformat); TString myplotmomvalzsp = TString::Format("%s%s-%sz.%s",outfoldersp.Data(), Secondary, Momentumvalname, outformat); TString myplothemitxxpsp = TString::Format("%s%s-%sxxp.%s",outfoldersp.Data(), Secondary, Emittancename, outformat); TString myplothemityypsp = TString::Format("%s%s-%syyp.%s",outfoldersp.Data(), Secondary, Emittancename, outformat); TString myplotangxsp = TString::Format("%s%s-%sx.%s",outfoldersp.Data(), Secondary, angname, outformat); TString myplotangysp = TString::Format("%s%s-%sy.%s",outfoldersp.Data(), Secondary, angname, outformat); TString myplothspacehitv1 = TString::Format("%s%s-%s.%s",outfolderV1.Data(), Volume1, Hitpoints, outformat); TString myplothspacehitv2 = TString::Format("%s%s-%s.%s",outfolderV2.Data(), Volume2, Hitpoints, outformat); TString canvtitle = TString::Format("Simulation LEMMA"); TFile *fin = TFile::Open(myfilein); fin->ls (); TGaxis::SetMaxDigits(n); if (fin == 0) { printf("Error: cannot open the file!\n"); } else { TTree *t1=0; TTree *t2=0; TTree *te=0; TTree *ts=0; fin->GetObject(Volume1,t1); fin->GetObject(Volume2,t2); fin->GetObject(Event,te); fin->GetObject(Secondary,ts); gStyle->SetOptFit(); gStyle->SetOptStat(111110); t1->SetLineColor(kBlue); t2->SetLineColor(kBlue); te->SetLineColor(kBlue); ts->SetLineColor(kBlue); //---------------------------------------------------------------------TARGET 1 -------------------------------------------------------------// TCanvas *c0 = new TCanvas("c0",canvtitle,1280,1024); t1->Draw(Form("ParticleID >> htemp(100, -25, 25)")); t1->GetHistogram()->SetTitle(cdnamePDGV1); t1->SetScanField(0); TH1F *htemppdgv1= (TH1F*)gPad->GetPrimitive("htemp"); htemppdgv1->GetXaxis()->SetTitle(PDGxname); htemppdgv1->GetYaxis()->SetTitle(countyname); htemppdgv1->GetYaxis()->SetTitleSize(c_YTitleSize); htemppdgv1->GetYaxis()->SetTitleFont(c_YTitleFont); htemppdgv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htemppdgv1->GetYaxis()->SetLabelFont(c_YLabelFont); htemppdgv1->GetYaxis()->SetLabelSize(c_YLabelSize); htemppdgv1->GetXaxis()->SetTitleSize(c_XTitleSize); htemppdgv1->GetXaxis()->SetTitleFont(c_XTitleFont); htemppdgv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htemppdgv1->GetXaxis()->SetLabelFont(c_XLabelFont); htemppdgv1->GetXaxis()->SetLabelSize(c_XLabelSize); htemppdgv1->SetFillStyle(1001); htemppdgv1->SetFillColorAlpha(kBlue, fillcolor); htemppdgv1->Draw(); htemppdgv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c0->Update(); TLegend* legpdgv1 = new TLegend(0.25, 0.7, .35, .75); legpdgv1->SetHeader("Legend"); legpdgv1->SetNColumns(1); legpdgv1->AddEntry(htemppdgv1, "MC", "l"); legpdgv1->Draw(); c0->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statspdgv1 = (TPaveStats*)htemppdgv1->GetListOfFunctions()->FindObject("stats"); statspdgv1->SetTextColor(kBlue); statspdgv1->SetX1NDC(0.80); statspdgv1->SetX2NDC(0.98); statspdgv1->SetY1NDC(0.77); statspdgv1->SetY2NDC(0.92); statspdgv1->DrawClone(); gPad->Update(); // c0->Print(myplotpdgv1); c0->Print("C:/simulazione/c0.pdf"); delete c0; TCanvas *c1 = new TCanvas("c1",canvtitle,1280,1024); t1->Draw(Form("kinEnergy >> htemp(100, 0., 0.)")); t1->GetHistogram()->SetTitle(cdnameKinEnV1); t1->SetScanField(0); TH1F *htempkinenv1= (TH1F*)gPad->GetPrimitive("htemp"); htempkinenv1->GetXaxis()->SetTitle(kinenxname); htempkinenv1->GetYaxis()->SetTitle(countyname); htempkinenv1->GetYaxis()->SetTitleSize(c_YTitleSize); htempkinenv1->GetYaxis()->SetTitleFont(c_YTitleFont); htempkinenv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempkinenv1->GetYaxis()->SetLabelFont(c_YLabelFont); htempkinenv1->GetYaxis()->SetLabelSize(c_YLabelSize); htempkinenv1->GetXaxis()->SetTitleSize(c_XTitleSize); htempkinenv1->GetXaxis()->SetTitleFont(c_XTitleFont); htempkinenv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempkinenv1->GetXaxis()->SetLabelFont(c_XLabelFont); htempkinenv1->GetXaxis()->SetLabelSize(c_XLabelSize); htempkinenv1->SetFillStyle(1001); htempkinenv1->SetFillColorAlpha(kBlue, fillcolor); htempkinenv1->Draw(); htempkinenv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c1->Update(); TLegend* legkinenv1 = new TLegend(0.25, 0.7, .35, .75); legkinenv1->SetHeader("Legend"); legkinenv1->SetNColumns(1); legkinenv1->AddEntry(htempkinenv1, "MC", "l"); legkinenv1->Draw(); c1->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statskinenv1 = (TPaveStats*)htempkinenv1->GetListOfFunctions()->FindObject("stats"); statskinenv1->SetTextColor(kBlue); statskinenv1->SetX1NDC(0.80); statskinenv1->SetX2NDC(0.98); statskinenv1->SetY1NDC(0.77); statskinenv1->SetY2NDC(0.92); statskinenv1->DrawClone(); gPad->Update(); c1->Print(myplotkinenv1); delete c1; TCanvas *c2 = new TCanvas("c2",canvtitle,1280,1024); c2->SetLogy(); t1->Draw(Form("MomentumDirection.x >> htemp(300, -1.5, 1.5)")); t1->GetHistogram()->SetTitle(cdnamePxV1); t1->SetScanField(0); TH1F *htempmomxv1= (TH1F*)gPad->GetPrimitive("htemp"); htempmomxv1->GetXaxis()->SetTitle(momxname); htempmomxv1->GetYaxis()->SetTitle(countyname); htempmomxv1->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomxv1->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomxv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomxv1->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomxv1->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomxv1->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomxv1->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomxv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomxv1->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomxv1->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomxv1->SetFillStyle(1001); htempmomxv1->SetFillColorAlpha(kBlue, fillcolor); htempmomxv1->Draw(); htempmomxv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c2->Update(); TLegend* legmomxv1 = new TLegend(0.25, 0.7, .35, .75); legmomxv1->SetHeader("Legend"); legmomxv1->SetNColumns(1); legmomxv1->AddEntry(htempmomxv1, "MC", "l"); legmomxv1->Draw(); c2->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomxv1 = (TPaveStats*)htempmomxv1->GetListOfFunctions()->FindObject("stats"); statsmomxv1->SetTextColor(kBlue); statsmomxv1->SetX1NDC(0.80); statsmomxv1->SetX2NDC(0.98); statsmomxv1->SetY1NDC(0.77); statsmomxv1->SetY2NDC(0.92); statsmomxv1->DrawClone(); gPad->Update(); c2->Print(myplotmomxv1); delete c2; TCanvas *c3 = new TCanvas("c3",canvtitle,1280,1024); c3->SetLogy(); t1->Draw(Form("MomentumDirection.y >> htemp(300, -1.5, 1.5)")); t1->GetHistogram()->SetTitle(cdnamePyV1); t1->SetScanField(0); TH1F *htempmomyv1= (TH1F*)gPad->GetPrimitive("htemp"); htempmomyv1->GetXaxis()->SetTitle(momxname); htempmomyv1->GetYaxis()->SetTitle(countyname); htempmomyv1->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomyv1->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomyv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomyv1->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomyv1->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomyv1->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomyv1->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomyv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomyv1->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomyv1->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomyv1->SetFillStyle(1001); htempmomyv1->SetFillColorAlpha(kBlue, fillcolor); htempmomyv1->Draw(); htempmomyv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c3->Update(); TLegend* legmomyv1 = new TLegend(0.25, 0.7, .35, .75); legmomyv1->SetHeader("Legend"); legmomyv1->SetNColumns(1); legmomyv1->AddEntry(htempmomyv1, "MC", "l"); legmomyv1->Draw(); c3->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomyv1 = (TPaveStats*)htempmomyv1->GetListOfFunctions()->FindObject("stats"); statsmomyv1->SetTextColor(kBlue); statsmomyv1->SetX1NDC(0.80); statsmomyv1->SetX2NDC(0.98); statsmomyv1->SetY1NDC(0.77); statsmomyv1->SetY2NDC(0.92); statsmomyv1->DrawClone(); gPad->Update(); c3->Print(myplotmomyv1); delete c3; TCanvas *c4 = new TCanvas("c4",canvtitle,1280,1024); c4->SetLogy(); t1->Draw(Form("MomentumDirection.z >> htemp(300, -1.5, 1.5)")); t1->GetHistogram()->SetTitle(cdnamePzV1); t1->SetScanField(0); TH1F *htempmomzv1= (TH1F*)gPad->GetPrimitive("htemp"); htempmomzv1->GetXaxis()->SetTitle(momxname); htempmomzv1->GetYaxis()->SetTitle(countyname); htempmomzv1->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomzv1->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomzv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomzv1->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomzv1->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomzv1->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomzv1->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomzv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomzv1->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomzv1->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomzv1->SetFillStyle(1001); htempmomzv1->SetFillColorAlpha(kBlue, fillcolor); htempmomzv1->Draw(); htempmomzv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c4->Update(); TLegend* legmomzv1 = new TLegend(0.25, 0.7, .35, .75); legmomzv1->SetHeader("Legend"); legmomzv1->SetNColumns(1); legmomzv1->AddEntry(htempmomzv1, "MC", "l"); legmomzv1->Draw(); c4->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomzv1 = (TPaveStats*)htempmomzv1->GetListOfFunctions()->FindObject("stats"); statsmomzv1->SetTextColor(kBlue); statsmomzv1->SetX1NDC(0.80); statsmomzv1->SetX2NDC(0.98); statsmomzv1->SetY1NDC(0.77); statsmomzv1->SetY2NDC(0.92); statsmomzv1->DrawClone(); gPad->Update(); c4->Print(myplotmomzv1); delete c4; TCanvas *c5 = new TCanvas("c5",canvtitle,1280,1024); t1->Draw(Form("PositionDirection.x >> htemp(100, 0., 0.)")); t1->GetHistogram()->SetTitle(cdnameDxV1); t1->SetScanField(0); TH1F *htempdirxv1= (TH1F*)gPad->GetPrimitive("htemp"); htempdirxv1->GetXaxis()->SetTitle(dirxname); htempdirxv1->GetYaxis()->SetTitle(countyname); htempdirxv1->GetYaxis()->SetTitleSize(c_YTitleSize); htempdirxv1->GetYaxis()->SetTitleFont(c_YTitleFont); htempdirxv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdirxv1->GetYaxis()->SetLabelFont(c_YLabelFont); htempdirxv1->GetYaxis()->SetLabelSize(c_YLabelSize); htempdirxv1->GetXaxis()->SetTitleSize(c_XTitleSize); htempdirxv1->GetXaxis()->SetTitleFont(c_XTitleFont); htempdirxv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdirxv1->GetXaxis()->SetLabelFont(c_XLabelFont); htempdirxv1->GetXaxis()->SetLabelSize(c_XLabelSize); htempdirxv1->SetFillStyle(1001); htempdirxv1->SetFillColorAlpha(kBlue, fillcolor); htempdirxv1->Draw(); htempdirxv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c5->Update(); TLegend* legdirxv1 = new TLegend(0.25, 0.7, .35, .75); legdirxv1->SetHeader("Legend"); legdirxv1->SetNColumns(1); legdirxv1->AddEntry(htempdirxv1, "MC", "l"); legdirxv1->Draw(); c5->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdirxv1 = (TPaveStats*)htempdirxv1->GetListOfFunctions()->FindObject("stats"); statsdirxv1->SetTextColor(kBlue); statsdirxv1->SetX1NDC(0.80); statsdirxv1->SetX2NDC(0.98); statsdirxv1->SetY1NDC(0.77); statsdirxv1->SetY2NDC(0.92); statsdirxv1->DrawClone(); gPad->Update(); c5->Print(myplotdirxv1); delete c5; TCanvas *c6 = new TCanvas("c6",canvtitle,1280,1024); t1->Draw(Form("PositionDirection.y >> htemp(100, 0., 0.)")); t1->GetHistogram()->SetTitle(cdnameDyV1); t1->SetScanField(0); TH1F *htempdiryv1= (TH1F*)gPad->GetPrimitive("htemp"); htempdiryv1->GetXaxis()->SetTitle(dirxname); htempdiryv1->GetYaxis()->SetTitle(countyname); htempdiryv1->GetYaxis()->SetTitleSize(c_YTitleSize); htempdiryv1->GetYaxis()->SetTitleFont(c_YTitleFont); htempdiryv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdiryv1->GetYaxis()->SetLabelFont(c_YLabelFont); htempdiryv1->GetYaxis()->SetLabelSize(c_YLabelSize); htempdiryv1->GetXaxis()->SetTitleSize(c_XTitleSize); htempdiryv1->GetXaxis()->SetTitleFont(c_XTitleFont); htempdiryv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdiryv1->GetXaxis()->SetLabelFont(c_XLabelFont); htempdiryv1->GetXaxis()->SetLabelSize(c_XLabelSize); htempdiryv1->SetFillStyle(1001); htempdiryv1->SetFillColorAlpha(kBlue, fillcolor); htempdiryv1->Draw(); htempdiryv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c6->Update(); TLegend* legdiryv1 = new TLegend(0.25, 0.7, .35, .75); legdiryv1->SetHeader("Legend"); legdiryv1->SetNColumns(1); legdiryv1->AddEntry(htempdiryv1, "MC", "l"); legdiryv1->Draw(); c6->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdiryv1 = (TPaveStats*)htempdiryv1->GetListOfFunctions()->FindObject("stats"); statsdiryv1->SetTextColor(kBlue); statsdiryv1->SetX1NDC(0.80); statsdiryv1->SetX2NDC(0.98); statsdiryv1->SetY1NDC(0.77); statsdiryv1->SetY2NDC(0.92); statsdiryv1->DrawClone(); gPad->Update(); c6->Print(myplotdiryv1); delete c6; TCanvas *c7 = new TCanvas("c7",canvtitle,1280,1024); t1->Draw(Form("PositionDirection.z >> htemp(100, 0., 0.)")); t1->GetHistogram()->SetTitle(cdnameDzV1); t1->SetScanField(0); TH1F *htempdirzv1= (TH1F*)gPad->GetPrimitive("htemp"); htempdirzv1->GetXaxis()->SetTitle(dirxname); htempdirzv1->GetYaxis()->SetTitle(countyname); htempdirzv1->GetYaxis()->SetTitleSize(c_YTitleSize); htempdirzv1->GetYaxis()->SetTitleFont(c_YTitleFont); htempdirzv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdirzv1->GetYaxis()->SetLabelFont(c_YLabelFont); htempdirzv1->GetYaxis()->SetLabelSize(c_YLabelSize); htempdirzv1->GetXaxis()->SetTitleSize(c_XTitleSize); htempdirzv1->GetXaxis()->SetTitleFont(c_XTitleFont); htempdirzv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdirzv1->GetXaxis()->SetLabelFont(c_XLabelFont); htempdirzv1->GetXaxis()->SetLabelSize(c_XLabelSize); htempdirzv1->SetFillStyle(1001); htempdirzv1->SetFillColorAlpha(kBlue, fillcolor); htempdirzv1->Draw(); htempdirzv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c7->Update(); TLegend* legdirzv1 = new TLegend(0.25, 0.7, .35, .75); legdirzv1->SetHeader("Legend"); legdirzv1->SetNColumns(1); legdirzv1->AddEntry(htempdirzv1, "MC", "l"); legdirzv1->Draw(); c7->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdirzv1 = (TPaveStats*)htempdirzv1->GetListOfFunctions()->FindObject("stats"); statsdirzv1->SetTextColor(kBlue); statsdirzv1->SetX1NDC(0.80); statsdirzv1->SetX2NDC(0.98); statsdirzv1->SetY1NDC(0.77); statsdirzv1->SetY2NDC(0.92); statsdirzv1->DrawClone(); gPad->Update(); c7->Print(myplotdirzv1); delete c7; TCanvas *c8 = new TCanvas("c8",canvtitle,1280,1024); t1->Draw(Form("ReleasedEnergy >> htemp(100, 0., 1)")); t1->GetHistogram()->SetTitle(cdnameRelEnV1); t1->SetScanField(0); TH1F *htemprelenv1= (TH1F*)gPad->GetPrimitive("htemp"); htemprelenv1->GetXaxis()->SetTitle(relenxname); htemprelenv1->GetYaxis()->SetTitle(countyname); htemprelenv1->GetYaxis()->SetTitleSize(c_YTitleSize); htemprelenv1->GetYaxis()->SetTitleFont(c_YTitleFont); htemprelenv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); htemprelenv1->GetYaxis()->SetLabelFont(c_YLabelFont); htemprelenv1->GetYaxis()->SetLabelSize(c_YLabelSize); htemprelenv1->GetXaxis()->SetTitleSize(c_XTitleSize); htemprelenv1->GetXaxis()->SetTitleFont(c_XTitleFont); htemprelenv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); htemprelenv1->GetXaxis()->SetLabelFont(c_XLabelFont); htemprelenv1->GetXaxis()->SetLabelSize(c_XLabelSize); htemprelenv1->SetFillStyle(1001); htemprelenv1->SetFillColorAlpha(kBlue, fillcolor); htemprelenv1->Draw(); htemprelenv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c8->Update(); TLegend* legrelenv1 = new TLegend(0.25, 0.7, .35, .75); legrelenv1->SetHeader("Legend"); legrelenv1->SetNColumns(1); legrelenv1->AddEntry(htemprelenv1, "MC", "l"); legrelenv1->Draw(); c8->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsrelenv1 = (TPaveStats*)htemprelenv1->GetListOfFunctions()->FindObject("stats"); statsrelenv1->SetTextColor(kBlue); statsrelenv1->SetX1NDC(0.80); statsrelenv1->SetX2NDC(0.98); statsrelenv1->SetY1NDC(0.77); statsrelenv1->SetY2NDC(0.92); statsrelenv1->DrawClone(); gPad->Update(); c8->Print(myplotrelenv1); delete c8; TCanvas *c25 = new TCanvas("c25",canvtitle,1280,1024); TH2F *henexhitv1 = new TH2F("henexhitv1", "", 500, 0., 0.,5000, 0.,0.); TString varhenexhitv1 = TString::Format("ReleasedEnergy : EndStepPos.x >> henexhitv1"); t1->Draw(varhenexhitv1); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn henexhitv1->SetTitle(cdnamehenexhitv1); henexhitv1->GetXaxis()->SetTitle(cdXnamehenehit); henexhitv1->GetYaxis()->SetTitle(cdYnamehenehit); henexhitv1->GetYaxis()->SetTitleSize(c_YTitleSize); henexhitv1->GetYaxis()->SetTitleFont(c_YTitleFont); henexhitv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); henexhitv1->GetYaxis()->SetLabelFont(c_YLabelFont); henexhitv1->GetYaxis()->SetLabelSize(c_YLabelSize); henexhitv1->GetXaxis()->SetTitleSize(c_XTitleSize); henexhitv1->GetXaxis()->SetTitleFont(c_XTitleFont); henexhitv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); henexhitv1->GetXaxis()->SetLabelFont(c_XLabelFont); henexhitv1->GetXaxis()->SetLabelSize(c_XLabelSize); henexhitv1->SetMarkerSize(50); henexhitv1->Draw("COLZ"); henexhitv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *henexhitv1copy = henexhitv1->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteenexhitv1 = (TPaletteAxis *) henexhitv1copy->GetListOfFunctions()->FindObject("palette"); paletteenexhitv1->SetX1NDC(0.86); paletteenexhitv1->SetX2NDC(0.90); paletteenexhitv1->SetY1NDC(0.2); paletteenexhitv1->SetY2NDC(0.8); c25->Modified(); c25->Update(); TLegend* leghenexhitv1 = new TLegend(0.65, 0.7, .75, .75); leghenexhitv1->SetHeader("Legend"); leghenexhitv1->SetNColumns(1); leghenexhitv1->AddEntry(leghenexhitv1, "MC", "l"); leghenexhitv1->Draw(); gPad->Update(); TPaveStats *statshenexhitv1 = (TPaveStats*)henexhitv1->GetListOfFunctions()->FindObject("stats"); statshenexhitv1->SetTextColor(kBlue); statshenexhitv1->SetX1NDC(0.80); statshenexhitv1->SetX2NDC(0.98); statshenexhitv1->SetY1NDC(0.77); statshenexhitv1->SetY2NDC(0.92); gPad->Update(); c25->Print(myplothenexhitv1); delete c25; TCanvas *c26 = new TCanvas("c26",canvtitle,1280,1024); TH2F *heneyhitv1 = new TH2F("heneyhitv1", "", 500, 0., 0.,5000, 0.,0.); TString varheneyhitv1 = TString::Format("ReleasedEnergy : EndStepPos.y >> heneyhitv1"); t1->Draw(varheneyhitv1); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn heneyhitv1->SetTitle(cdnameheneyhitv1); heneyhitv1->GetXaxis()->SetTitle(cdXnamehenehit); heneyhitv1->GetYaxis()->SetTitle(cdYnamehenehit); heneyhitv1->GetYaxis()->SetTitleSize(c_YTitleSize); heneyhitv1->GetYaxis()->SetTitleFont(c_YTitleFont); heneyhitv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); heneyhitv1->GetYaxis()->SetLabelFont(c_YLabelFont); heneyhitv1->GetYaxis()->SetLabelSize(c_YLabelSize); heneyhitv1->GetXaxis()->SetTitleSize(c_XTitleSize); heneyhitv1->GetXaxis()->SetTitleFont(c_XTitleFont); heneyhitv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); heneyhitv1->GetXaxis()->SetLabelFont(c_XLabelFont); heneyhitv1->GetXaxis()->SetLabelSize(c_XLabelSize); heneyhitv1->SetMarkerSize(50); heneyhitv1->Draw("COLZ"); heneyhitv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *heneyhitv1copy = heneyhitv1->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteeneyhitv1 = (TPaletteAxis *) heneyhitv1copy->GetListOfFunctions()->FindObject("palette"); paletteeneyhitv1->SetX1NDC(0.86); paletteeneyhitv1->SetX2NDC(0.90); paletteeneyhitv1->SetY1NDC(0.2); paletteeneyhitv1->SetY2NDC(0.8); c26->Modified(); c26->Update(); TLegend* legheneyhitv1 = new TLegend(0.65, 0.7, .75, .75); legheneyhitv1->SetHeader("Legend"); legheneyhitv1->SetNColumns(1); legheneyhitv1->AddEntry(legheneyhitv1, "MC", "l"); legheneyhitv1->Draw(); gPad->Update(); TPaveStats *statsheneyhitv1 = (TPaveStats*)heneyhitv1->GetListOfFunctions()->FindObject("stats"); statsheneyhitv1->SetTextColor(kBlue); statsheneyhitv1->SetX1NDC(0.80); statsheneyhitv1->SetX2NDC(0.98); statsheneyhitv1->SetY1NDC(0.77); statsheneyhitv1->SetY2NDC(0.92); gPad->Update(); c26->Print(myplotheneyhitv1); delete c26; TCanvas *c27 = new TCanvas("c27",canvtitle,1280,1024); TH2F *henezhitv1 = new TH2F("henezhitv1", "", 500, 0., 0.,5000, 0., 0.); TString varhenezhitv1 = TString::Format("ReleasedEnergy : EndStepPos.z >> henezhitv1"); t1->Draw(varhenezhitv1); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn henezhitv1->SetTitle(cdnamehenezhitv1); henezhitv1->GetXaxis()->SetTitle(cdXnamehenehit); henezhitv1->GetYaxis()->SetTitle(cdYnamehenehit); henezhitv1->GetYaxis()->SetTitleSize(c_YTitleSize); henezhitv1->GetYaxis()->SetTitleFont(c_YTitleFont); henezhitv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); henezhitv1->GetYaxis()->SetLabelFont(c_YLabelFont); henezhitv1->GetYaxis()->SetLabelSize(c_YLabelSize); henezhitv1->GetXaxis()->SetTitleSize(c_XTitleSize); henezhitv1->GetXaxis()->SetTitleFont(c_XTitleFont); henezhitv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); henezhitv1->GetXaxis()->SetLabelFont(c_XLabelFont); henezhitv1->GetXaxis()->SetLabelSize(c_XLabelSize); henezhitv1->SetMarkerSize(50); henezhitv1->Draw("COLZ"); henezhitv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *henezhitv1copy = henezhitv1->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteenezhitv1 = (TPaletteAxis *) henezhitv1copy->GetListOfFunctions()->FindObject("palette"); paletteenezhitv1->SetX1NDC(0.86); paletteenezhitv1->SetX2NDC(0.90); paletteenezhitv1->SetY1NDC(0.2); paletteenezhitv1->SetY2NDC(0.8); c27->Modified(); c27->Update(); TLegend* leghenezhitv1 = new TLegend(0.65, 0.7, .75, .75); leghenezhitv1->SetHeader("Legend"); leghenezhitv1->SetNColumns(1); leghenezhitv1->AddEntry(leghenezhitv1, "MC", "l"); leghenezhitv1->Draw(); gPad->Update(); TPaveStats *statshenezhitv1 = (TPaveStats*)henezhitv1->GetListOfFunctions()->FindObject("stats"); statshenezhitv1->SetTextColor(kBlue); statshenezhitv1->SetX1NDC(0.80); statshenezhitv1->SetX2NDC(0.98); statshenezhitv1->SetY1NDC(0.77); statshenezhitv1->SetY2NDC(0.92); gPad->Update(); c27->Print(myplothenezhitv1); delete c27; TCanvas *c31 = new TCanvas("c31",canvtitle,1280,1024); TH3F *hspacehitv1 = new TH3F("hspacehitv1", "", 40, 0., 0.,40, 0.,0.,40,0.,0.); TString varhspacehitv1 = TString::Format("EndStepPos.y : EndStepPos.x : EndStepPos.z >> hspacehitv1"); t1->Draw(varhspacehitv1); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn hspacehitv1->SetTitle(cdnamehspacehitv1); hspacehitv1->GetXaxis()->SetTitle(cdXnamehspacehit); hspacehitv1->GetYaxis()->SetTitle(cdYnamehspacehit); hspacehitv1->GetZaxis()->SetTitle(cdZnamehspacehit); hspacehitv1->GetYaxis()->SetTitleSize(c_YTitleSize); hspacehitv1->GetYaxis()->SetTitleFont(c_YTitleFont); hspacehitv1->GetYaxis()->SetTitleOffset(c_YTitleOffsetTH3); hspacehitv1->GetYaxis()->SetLabelFont(c_YLabelFont); hspacehitv1->GetYaxis()->SetLabelSize(c_YLabelSize); hspacehitv1->GetXaxis()->SetTitleSize(c_XTitleSize); hspacehitv1->GetXaxis()->SetTitleFont(c_XTitleFont); hspacehitv1->GetXaxis()->SetTitleOffset(c_XTitleOffsetTH3); hspacehitv1->GetXaxis()->SetLabelFont(c_XLabelFont); hspacehitv1->GetXaxis()->SetLabelSize(c_XLabelSize); hspacehitv1->GetZaxis()->SetTitleSize(c_XTitleSize); hspacehitv1->GetZaxis()->SetTitleFont(c_XTitleFont); hspacehitv1->GetZaxis()->SetTitleOffset(c_XTitleOffsetTH3); hspacehitv1->GetZaxis()->SetLabelFont(c_XLabelFont); hspacehitv1->GetZaxis()->SetLabelSize(c_XLabelSize); hspacehitv1->SetMarkerSize(50); // hspacehitv1->Draw("COLZ"); hspacehitv1->Draw(); hspacehitv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn /* TH1 *hspacehitv1copy = hspacehitv1->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * palettespacehitv1 = (TPaletteAxis *) hspacehitv1copy->GetListOfFunctions()->FindObject("palette"); palettespacehitv1->SetX1NDC(0.86); palettespacehitv1->SetX2NDC(0.90); palettespacehitv1->SetY1NDC(0.2); palettespacehitv1->SetY2NDC(0.8);*/ c31->Modified(); c31->Update(); TLegend* leghspacehitv1 = new TLegend(0.65, 0.7, .75, .75); leghspacehitv1->SetHeader("Legend"); leghspacehitv1->SetNColumns(1); leghspacehitv1->AddEntry(leghspacehitv1, "MC", "l"); leghspacehitv1->Draw(); gPad->Update(); TPaveStats *statshspacehitv1 = (TPaveStats*)hspacehitv1->GetListOfFunctions()->FindObject("stats"); statshspacehitv1->SetTextColor(kBlue); statshspacehitv1->SetX1NDC(0.80); statshspacehitv1->SetX2NDC(0.98); statshspacehitv1->SetY1NDC(0.77); statshspacehitv1->SetY2NDC(0.92); gPad->Update(); c31->Print(myplothspacehitv1); delete c31; TCanvas *c47 = new TCanvas("c47",canvtitle,1280,1024); TH2F *henexmomv1 = new TH2F("henexmomv1", "", 500, 0., 0.,5000, 0.,0.); TString varhenexmomv1 = TString::Format("ReleasedEnergy : MomentumDirection.x >> henexmomv1"); t1->Draw(varhenexmomv1); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn henexmomv1->SetTitle(cdnamehenexmomv1); henexmomv1->GetXaxis()->SetTitle(cdXnamehenemom); henexmomv1->GetYaxis()->SetTitle(cdYnamehenehit); henexmomv1->GetYaxis()->SetTitleSize(c_YTitleSize); henexmomv1->GetYaxis()->SetTitleFont(c_YTitleFont); henexmomv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); henexmomv1->GetYaxis()->SetLabelFont(c_YLabelFont); henexmomv1->GetYaxis()->SetLabelSize(c_YLabelSize); henexmomv1->GetXaxis()->SetTitleSize(c_XTitleSize); henexmomv1->GetXaxis()->SetTitleFont(c_XTitleFont); henexmomv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); henexmomv1->GetXaxis()->SetLabelFont(c_XLabelFont); henexmomv1->GetXaxis()->SetLabelSize(c_XLabelSize); henexmomv1->SetMarkerSize(50); henexmomv1->Draw("COLZ"); henexmomv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *henexmomv1copy = henexmomv1->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteenexmomv1 = (TPaletteAxis *) henexmomv1copy->GetListOfFunctions()->FindObject("palette"); paletteenexmomv1->SetX1NDC(0.86); paletteenexmomv1->SetX2NDC(0.90); paletteenexmomv1->SetY1NDC(0.2); paletteenexmomv1->SetY2NDC(0.8); c47->Modified(); c47->Update(); TLegend* leghenexmomv1 = new TLegend(0.65, 0.7, .75, .75); leghenexmomv1->SetHeader("Legend"); leghenexmomv1->SetNColumns(1); leghenexmomv1->AddEntry(leghenexmomv1, "MC", "l"); leghenexmomv1->Draw(); gPad->Update(); TPaveStats *statshenexmomv1 = (TPaveStats*)henexmomv1->GetListOfFunctions()->FindObject("stats"); statshenexmomv1->SetTextColor(kBlue); statshenexmomv1->SetX1NDC(0.80); statshenexmomv1->SetX2NDC(0.98); statshenexmomv1->SetY1NDC(0.77); statshenexmomv1->SetY2NDC(0.92); gPad->Update(); c47->Print(myplothenexmomv1); delete c47; TCanvas *c48 = new TCanvas("c48",canvtitle,1280,1024); TH2F *heneymomv1 = new TH2F("heneymomv1", "", 500, 0., 0.,5000, 0.,0.); TString varheneymomv1 = TString::Format("ReleasedEnergy : MomentumDirection.y >> heneymomv1"); t1->Draw(varheneymomv1); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn heneymomv1->SetTitle(cdnameheneymomv1); heneymomv1->GetXaxis()->SetTitle(cdXnamehenemom); heneymomv1->GetYaxis()->SetTitle(cdYnamehenehit); heneymomv1->GetYaxis()->SetTitleSize(c_YTitleSize); heneymomv1->GetYaxis()->SetTitleFont(c_YTitleFont); heneymomv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); heneymomv1->GetYaxis()->SetLabelFont(c_YLabelFont); heneymomv1->GetYaxis()->SetLabelSize(c_YLabelSize); heneymomv1->GetXaxis()->SetTitleSize(c_XTitleSize); heneymomv1->GetXaxis()->SetTitleFont(c_XTitleFont); heneymomv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); heneymomv1->GetXaxis()->SetLabelFont(c_XLabelFont); heneymomv1->GetXaxis()->SetLabelSize(c_XLabelSize); heneymomv1->SetMarkerSize(50); heneymomv1->Draw("COLZ"); heneymomv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *heneymomv1copy = heneymomv1->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteeneymomv1 = (TPaletteAxis *) heneymomv1copy->GetListOfFunctions()->FindObject("palette"); paletteeneymomv1->SetX1NDC(0.86); paletteeneymomv1->SetX2NDC(0.90); paletteeneymomv1->SetY1NDC(0.2); paletteeneymomv1->SetY2NDC(0.8); c48->Modified(); c48->Update(); TLegend* legheneymomv1 = new TLegend(0.65, 0.7, .75, .75); legheneymomv1->SetHeader("Legend"); legheneymomv1->SetNColumns(1); legheneymomv1->AddEntry(legheneymomv1, "MC", "l"); legheneymomv1->Draw(); gPad->Update(); TPaveStats *statsheneymomv1 = (TPaveStats*)heneymomv1->GetListOfFunctions()->FindObject("stats"); statsheneymomv1->SetTextColor(kBlue); statsheneymomv1->SetX1NDC(0.80); statsheneymomv1->SetX2NDC(0.98); statsheneymomv1->SetY1NDC(0.77); statsheneymomv1->SetY2NDC(0.92); gPad->Update(); c48->Print(myplotheneymomv1); delete c48; TCanvas *c49 = new TCanvas("c49",canvtitle,1280,1024); TH2F *henezmomv1 = new TH2F("henezmomv1", "", 500, 0., 0.,5000, 0.,0.); TString varhenezmomv1 = TString::Format("ReleasedEnergy : MomentumDirection.z >> henezmomv1"); t1->Draw(varhenezmomv1); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn henezmomv1->SetTitle(cdnamehenezmomv1); henezmomv1->GetXaxis()->SetTitle(cdXnamehenemom); henezmomv1->GetYaxis()->SetTitle(cdYnamehenehit); henezmomv1->GetYaxis()->SetTitleSize(c_YTitleSize); henezmomv1->GetYaxis()->SetTitleFont(c_YTitleFont); henezmomv1->GetYaxis()->SetTitleOffset(c_YTitleOffset); henezmomv1->GetYaxis()->SetLabelFont(c_YLabelFont); henezmomv1->GetYaxis()->SetLabelSize(c_YLabelSize); henezmomv1->GetXaxis()->SetTitleSize(c_XTitleSize); henezmomv1->GetXaxis()->SetTitleFont(c_XTitleFont); henezmomv1->GetXaxis()->SetTitleOffset(c_XTitleOffset); henezmomv1->GetXaxis()->SetLabelFont(c_XLabelFont); henezmomv1->GetXaxis()->SetLabelSize(c_XLabelSize); henezmomv1->SetMarkerSize(50); henezmomv1->Draw("COLZ"); henezmomv1->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *henezmomv1copy = henezmomv1->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteenezmomv1 = (TPaletteAxis *) henezmomv1copy->GetListOfFunctions()->FindObject("palette"); paletteenezmomv1->SetX1NDC(0.86); paletteenezmomv1->SetX2NDC(0.90); paletteenezmomv1->SetY1NDC(0.2); paletteenezmomv1->SetY2NDC(0.8); c49->Modified(); c49->Update(); TLegend* leghenezmomv1 = new TLegend(0.65, 0.7, .75, .75); leghenezmomv1->SetHeader("Legend"); leghenezmomv1->SetNColumns(1); leghenezmomv1->AddEntry(leghenezmomv1, "MC", "l"); leghenezmomv1->Draw(); gPad->Update(); TPaveStats *statshenezmomv1 = (TPaveStats*)henezmomv1->GetListOfFunctions()->FindObject("stats"); statshenezmomv1->SetTextColor(kBlue); statshenezmomv1->SetX1NDC(0.80); statshenezmomv1->SetX2NDC(0.98); statshenezmomv1->SetY1NDC(0.77); statshenezmomv1->SetY2NDC(0.92); gPad->Update(); c49->Print(myplothenezmomv1); delete c49; //-----------------------------------------------------------TARGET 2----------------------------// TCanvas *c9 = new TCanvas("c9",canvtitle,1280,1024); t2->Draw(Form("ParticleID >> htemp(100, -25, 25)")); t2->GetHistogram()->SetTitle(cdnamePDGV2); t2->SetScanField(0); TH1F *htemppdgv2= (TH1F*)gPad->GetPrimitive("htemp"); htemppdgv2->GetXaxis()->SetTitle(PDGxname); htemppdgv2->GetYaxis()->SetTitle(countyname); htemppdgv2->GetYaxis()->SetTitleSize(c_YTitleSize); htemppdgv2->GetYaxis()->SetTitleFont(c_YTitleFont); htemppdgv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htemppdgv2->GetYaxis()->SetLabelFont(c_YLabelFont); htemppdgv2->GetYaxis()->SetLabelSize(c_YLabelSize); htemppdgv2->GetXaxis()->SetTitleSize(c_XTitleSize); htemppdgv2->GetXaxis()->SetTitleFont(c_XTitleFont); htemppdgv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htemppdgv2->GetXaxis()->SetLabelFont(c_XLabelFont); htemppdgv2->GetXaxis()->SetLabelSize(c_XLabelSize); htemppdgv2->SetFillStyle(1001); htemppdgv2->SetFillColorAlpha(kBlue, fillcolor); htemppdgv2->Draw(); htemppdgv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c9->Update(); TLegend* legpdgv2 = new TLegend(0.25, 0.7, .35, .75); legpdgv2->SetHeader("Legend"); legpdgv2->SetNColumns(1); legpdgv2->AddEntry(htemppdgv2, "MC", "l"); legpdgv2->Draw(); c9->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statspdgv2 = (TPaveStats*)htemppdgv2->GetListOfFunctions()->FindObject("stats"); statspdgv2->SetTextColor(kBlue); statspdgv2->SetX1NDC(0.80); statspdgv2->SetX2NDC(0.98); statspdgv2->SetY1NDC(0.77); statspdgv2->SetY2NDC(0.92); statspdgv2->DrawClone(); gPad->Update(); c9->Print(myplotpdgv2); delete c9; TCanvas *c10 = new TCanvas("c10",canvtitle,1280,1024); t2->Draw(Form("kinEnergy >> htemp(100, 0., 0.)")); t2->GetHistogram()->SetTitle(cdnameKinEnv2); t2->SetScanField(0); TH1F *htempkinenv2= (TH1F*)gPad->GetPrimitive("htemp"); htempkinenv2->GetXaxis()->SetTitle(kinenxname); htempkinenv2->GetYaxis()->SetTitle(countyname); htempkinenv2->GetYaxis()->SetTitleSize(c_YTitleSize); htempkinenv2->GetYaxis()->SetTitleFont(c_YTitleFont); htempkinenv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempkinenv2->GetYaxis()->SetLabelFont(c_YLabelFont); htempkinenv2->GetYaxis()->SetLabelSize(c_YLabelSize); htempkinenv2->GetXaxis()->SetTitleSize(c_XTitleSize); htempkinenv2->GetXaxis()->SetTitleFont(c_XTitleFont); htempkinenv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempkinenv2->GetXaxis()->SetLabelFont(c_XLabelFont); htempkinenv2->GetXaxis()->SetLabelSize(c_XLabelSize); htempkinenv2->SetFillStyle(1001); htempkinenv2->SetFillColorAlpha(kBlue, fillcolor); htempkinenv2->Draw(); htempkinenv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c10->Update(); TLegend* legkinenv2 = new TLegend(0.25, 0.7, .35, .75); legkinenv2->SetHeader("Legend"); legkinenv2->SetNColumns(1); legkinenv2->AddEntry(htempkinenv2, "MC", "l"); legkinenv2->Draw(); c10->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statskinenv2 = (TPaveStats*)htempkinenv2->GetListOfFunctions()->FindObject("stats"); statskinenv2->SetTextColor(kBlue); statskinenv2->SetX1NDC(0.80); statskinenv2->SetX2NDC(0.98); statskinenv2->SetY1NDC(0.77); statskinenv2->SetY2NDC(0.92); statskinenv2->DrawClone(); gPad->Update(); c10->Print(myplotkinenv2); delete c10; TCanvas *c11 = new TCanvas("c11",canvtitle,1280,1024); c11->SetLogy(); t2->Draw(Form("MomentumDirection.x >> htemp(300, -1.5., 1.5.)")); t2->GetHistogram()->SetTitle(cdnamePxv2); t2->SetScanField(0); TH1F *htempmomxv2= (TH1F*)gPad->GetPrimitive("htemp"); htempmomxv2->GetXaxis()->SetTitle(momxname); htempmomxv2->GetYaxis()->SetTitle(countyname); htempmomxv2->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomxv2->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomxv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomxv2->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomxv2->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomxv2->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomxv2->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomxv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomxv2->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomxv2->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomxv2->SetFillStyle(1001); htempmomxv2->SetFillColorAlpha(kBlue, fillcolor); htempmomxv2->Draw(); htempmomxv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c11->Update(); TLegend* legmomxv2 = new TLegend(0.25, 0.7, .35, .75); legmomxv2->SetHeader("Legend"); legmomxv2->SetNColumns(1); legmomxv2->AddEntry(htempmomxv2, "MC", "l"); legmomxv2->Draw(); c11->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomxv2 = (TPaveStats*)htempmomxv2->GetListOfFunctions()->FindObject("stats"); statsmomxv2->SetTextColor(kBlue); statsmomxv2->SetX1NDC(0.80); statsmomxv2->SetX2NDC(0.98); statsmomxv2->SetY1NDC(0.77); statsmomxv2->SetY2NDC(0.92); statsmomxv2->DrawClone(); gPad->Update(); c11->Print(myplotmomxv2); delete c11; TCanvas *c12 = new TCanvas("c12",canvtitle,1280,1024); c12->SetLogy(); t2->Draw(Form("MomentumDirection.y >> htemp(300, -1.5, 1.5)")); t2->GetHistogram()->SetTitle(cdnamePyv2); t2->SetScanField(0); TH1F *htempmomyv2= (TH1F*)gPad->GetPrimitive("htemp"); htempmomyv2->GetXaxis()->SetTitle(momxname); htempmomyv2->GetYaxis()->SetTitle(countyname); htempmomyv2->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomyv2->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomyv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomyv2->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomyv2->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomyv2->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomyv2->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomyv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomyv2->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomyv2->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomyv2->SetFillStyle(1001); htempmomyv2->SetFillColorAlpha(kBlue, fillcolor); htempmomyv2->Draw(); htempmomyv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c12->Update(); TLegend* legmomyv2 = new TLegend(0.25, 0.7, .35, .75); legmomyv2->SetHeader("Legend"); legmomyv2->SetNColumns(1); legmomyv2->AddEntry(htempmomyv2, "MC", "l"); legmomyv2->Draw(); c12->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomyv2 = (TPaveStats*)htempmomyv2->GetListOfFunctions()->FindObject("stats"); statsmomyv2->SetTextColor(kBlue); statsmomyv2->SetX1NDC(0.80); statsmomyv2->SetX2NDC(0.98); statsmomyv2->SetY1NDC(0.77); statsmomyv2->SetY2NDC(0.92); statsmomyv2->DrawClone(); gPad->Update(); c12->Print(myplotmomyv2); delete c12; TCanvas *c13 = new TCanvas("c13",canvtitle,1280,1024); c13->SetLogy(); t2->Draw(Form("MomentumDirection.z >> htemp(300, -1.5, 1.5)")); t2->GetHistogram()->SetTitle(cdnamePzv2); t2->SetScanField(0); TH1F *htempmomzv2= (TH1F*)gPad->GetPrimitive("htemp"); htempmomzv2->GetXaxis()->SetTitle(momxname); htempmomzv2->GetYaxis()->SetTitle(countyname); htempmomzv2->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomzv2->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomzv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomzv2->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomzv2->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomzv2->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomzv2->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomzv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomzv2->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomzv2->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomzv2->SetFillStyle(1001); htempmomzv2->SetFillColorAlpha(kBlue, fillcolor); htempmomzv2->Draw(); htempmomzv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c13->Update(); TLegend* legmomzv2 = new TLegend(0.25, 0.7, .35, .75); legmomzv2->SetHeader("Legend"); legmomzv2->SetNColumns(1); legmomzv2->AddEntry(htempmomzv2, "MC", "l"); legmomzv2->Draw(); c13->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomzv2 = (TPaveStats*)htempmomzv2->GetListOfFunctions()->FindObject("stats"); statsmomzv2->SetTextColor(kBlue); statsmomzv2->SetX1NDC(0.80); statsmomzv2->SetX2NDC(0.98); statsmomzv2->SetY1NDC(0.77); statsmomzv2->SetY2NDC(0.92); statsmomzv2->DrawClone(); gPad->Update(); c13->Print(myplotmomzv2); delete c13; TCanvas *c14 = new TCanvas("c14",canvtitle,1280,1024); t2->Draw(Form("PositionDirection.x >> htemp(100, 0., 0.)")); t2->GetHistogram()->SetTitle(cdnameDxv2); t2->SetScanField(0); TH1F *htempdirxv2= (TH1F*)gPad->GetPrimitive("htemp"); htempdirxv2->GetXaxis()->SetTitle(dirxname); htempdirxv2->GetYaxis()->SetTitle(countyname); htempdirxv2->GetYaxis()->SetTitleSize(c_YTitleSize); htempdirxv2->GetYaxis()->SetTitleFont(c_YTitleFont); htempdirxv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdirxv2->GetYaxis()->SetLabelFont(c_YLabelFont); htempdirxv2->GetYaxis()->SetLabelSize(c_YLabelSize); htempdirxv2->GetXaxis()->SetTitleSize(c_XTitleSize); htempdirxv2->GetXaxis()->SetTitleFont(c_XTitleFont); htempdirxv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdirxv2->GetXaxis()->SetLabelFont(c_XLabelFont); htempdirxv2->GetXaxis()->SetLabelSize(c_XLabelSize); htempdirxv2->SetFillStyle(1001); htempdirxv2->SetFillColorAlpha(kBlue, fillcolor); htempdirxv2->Draw(); htempdirxv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c14->Update(); TLegend* legdirxv2 = new TLegend(0.25, 0.7, .35, .75); legdirxv2->SetHeader("Legend"); legdirxv2->SetNColumns(1); legdirxv2->AddEntry(htempdirxv2, "MC", "l"); legdirxv2->Draw(); c14->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdirxv2 = (TPaveStats*)htempdirxv2->GetListOfFunctions()->FindObject("stats"); statsdirxv2->SetTextColor(kBlue); statsdirxv2->SetX1NDC(0.80); statsdirxv2->SetX2NDC(0.98); statsdirxv2->SetY1NDC(0.77); statsdirxv2->SetY2NDC(0.92); statsdirxv2->DrawClone(); gPad->Update(); c14->Print(myplotdirxv2); delete c14; TCanvas *c15 = new TCanvas("c15",canvtitle,1280,1024); t2->Draw(Form("PositionDirection.y >> htemp(100, 0., 0.)")); t2->GetHistogram()->SetTitle(cdnameDyv2); t2->SetScanField(0); TH1F *htempdiryv2= (TH1F*)gPad->GetPrimitive("htemp"); htempdiryv2->GetXaxis()->SetTitle(dirxname); htempdiryv2->GetYaxis()->SetTitle(countyname); htempdiryv2->GetYaxis()->SetTitleSize(c_YTitleSize); htempdiryv2->GetYaxis()->SetTitleFont(c_YTitleFont); htempdiryv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdiryv2->GetYaxis()->SetLabelFont(c_YLabelFont); htempdiryv2->GetYaxis()->SetLabelSize(c_YLabelSize); htempdiryv2->GetXaxis()->SetTitleSize(c_XTitleSize); htempdiryv2->GetXaxis()->SetTitleFont(c_XTitleFont); htempdiryv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdiryv2->GetXaxis()->SetLabelFont(c_XLabelFont); htempdiryv2->GetXaxis()->SetLabelSize(c_XLabelSize); htempdiryv2->SetFillStyle(1001); htempdiryv2->SetFillColorAlpha(kBlue, fillcolor); htempdiryv2->Draw(); htempdiryv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c15->Update(); TLegend* legdiryv2 = new TLegend(0.25, 0.7, .35, .75); legdiryv2->SetHeader("Legend"); legdiryv2->SetNColumns(1); legdiryv2->AddEntry(htempdiryv2, "MC", "l"); legdiryv2->Draw(); c15->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdiryv2 = (TPaveStats*)htempdiryv2->GetListOfFunctions()->FindObject("stats"); statsdiryv2->SetTextColor(kBlue); statsdiryv2->SetX1NDC(0.80); statsdiryv2->SetX2NDC(0.98); statsdiryv2->SetY1NDC(0.77); statsdiryv2->SetY2NDC(0.92); statsdiryv2->DrawClone(); gPad->Update(); c15->Print(myplotdiryv2); delete c15; TCanvas *c16 = new TCanvas("c16",canvtitle,1280,1024); t2->Draw(Form("PositionDirection.z >> htemp(100, 0., 0.)")); t2->GetHistogram()->SetTitle(cdnameDzv2); t2->SetScanField(0); TH1F *htempdirzv2= (TH1F*)gPad->GetPrimitive("htemp"); htempdirzv2->GetXaxis()->SetTitle(dirxname); htempdirzv2->GetYaxis()->SetTitle(countyname); htempdirzv2->GetYaxis()->SetTitleSize(c_YTitleSize); htempdirzv2->GetYaxis()->SetTitleFont(c_YTitleFont); htempdirzv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdirzv2->GetYaxis()->SetLabelFont(c_YLabelFont); htempdirzv2->GetYaxis()->SetLabelSize(c_YLabelSize); htempdirzv2->GetXaxis()->SetTitleSize(c_XTitleSize); htempdirzv2->GetXaxis()->SetTitleFont(c_XTitleFont); htempdirzv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdirzv2->GetXaxis()->SetLabelFont(c_XLabelFont); htempdirzv2->GetXaxis()->SetLabelSize(c_XLabelSize); htempdirzv2->SetFillStyle(1001); htempdirzv2->SetFillColorAlpha(kBlue, fillcolor); htempdirzv2->Draw(); htempdirzv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c16->Update(); TLegend* legdirzv2 = new TLegend(0.25, 0.7, .35, .75); legdirzv2->SetHeader("Legend"); legdirzv2->SetNColumns(1); legdirzv2->AddEntry(htempdirzv2, "MC", "l"); legdirzv2->Draw(); c16->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdirzv2 = (TPaveStats*)htempdirzv2->GetListOfFunctions()->FindObject("stats"); statsdirzv2->SetTextColor(kBlue); statsdirzv2->SetX1NDC(0.80); statsdirzv2->SetX2NDC(0.98); statsdirzv2->SetY1NDC(0.77); statsdirzv2->SetY2NDC(0.92); statsdirzv2->DrawClone(); gPad->Update(); c16->Print(myplotdirzv2); delete c16; TCanvas *c17 = new TCanvas("c17",canvtitle,1280,1024); t2->Draw(Form("ReleasedEnergy >> htemp(100, 0., 1)")); t2->GetHistogram()->SetTitle(cdnameRelEnv2); t2->SetScanField(0); TH1F *htemprelenv2= (TH1F*)gPad->GetPrimitive("htemp"); htemprelenv2->GetXaxis()->SetTitle(relenxname); htemprelenv2->GetYaxis()->SetTitle(countyname); htemprelenv2->GetYaxis()->SetTitleSize(c_YTitleSize); htemprelenv2->GetYaxis()->SetTitleFont(c_YTitleFont); htemprelenv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htemprelenv2->GetYaxis()->SetLabelFont(c_YLabelFont); htemprelenv2->GetYaxis()->SetLabelSize(c_YLabelSize); htemprelenv2->GetXaxis()->SetTitleSize(c_XTitleSize); htemprelenv2->GetXaxis()->SetTitleFont(c_XTitleFont); htemprelenv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htemprelenv2->GetXaxis()->SetLabelFont(c_XLabelFont); htemprelenv2->GetXaxis()->SetLabelSize(c_XLabelSize); htemprelenv2->SetFillStyle(1001); htemprelenv2->SetFillColorAlpha(kBlue, fillcolor); htemprelenv2->Draw(); htemprelenv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c17->Update(); TLegend* legrelenv2 = new TLegend(0.25, 0.7, .35, .75); legrelenv2->SetHeader("Legend"); legrelenv2->SetNColumns(1); legrelenv2->AddEntry(htemprelenv2, "MC", "l"); legrelenv2->Draw(); c17->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsrelenv2 = (TPaveStats*)htemprelenv2->GetListOfFunctions()->FindObject("stats"); statsrelenv2->SetTextColor(kBlue); statsrelenv2->SetX1NDC(0.80); statsrelenv2->SetX2NDC(0.98); statsrelenv2->SetY1NDC(0.77); statsrelenv2->SetY2NDC(0.92); statsrelenv2->DrawClone(); gPad->Update(); c17->Print(myplotrelenv2); delete c17; TCanvas *c28 = new TCanvas("c28",canvtitle,1280,1024); TH2F *henexhitv2 = new TH2F("henexhitv2", "", 500, 0., 0.,5000, 0.,0.); TString varhenexhitv2 = TString::Format("ReleasedEnergy : EndStepPos.x >> henexhitv2"); t2->Draw(varhenexhitv2); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn henexhitv2->SetTitle(cdnamehenexhitv2); henexhitv2->GetXaxis()->SetTitle(cdXnamehenehit); henexhitv2->GetYaxis()->SetTitle(cdYnamehenehit); henexhitv2->GetYaxis()->SetTitleSize(c_YTitleSize); henexhitv2->GetYaxis()->SetTitleFont(c_YTitleFont); henexhitv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); henexhitv2->GetYaxis()->SetLabelFont(c_YLabelFont); henexhitv2->GetYaxis()->SetLabelSize(c_YLabelSize); henexhitv2->GetXaxis()->SetTitleSize(c_XTitleSize); henexhitv2->GetXaxis()->SetTitleFont(c_XTitleFont); henexhitv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); henexhitv2->GetXaxis()->SetLabelFont(c_XLabelFont); henexhitv2->GetXaxis()->SetLabelSize(c_XLabelSize); henexhitv2->SetMarkerSize(50); henexhitv2->Draw("COLZ"); henexhitv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *henexhitv2copy = henexhitv2->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteenexhitv2 = (TPaletteAxis *) henexhitv2copy->GetListOfFunctions()->FindObject("palette"); paletteenexhitv2->SetX1NDC(0.86); paletteenexhitv2->SetX2NDC(0.90); paletteenexhitv2->SetY1NDC(0.2); paletteenexhitv2->SetY2NDC(0.8); c28->Modified(); c28->Update(); TLegend* leghenexhitv2 = new TLegend(0.65, 0.7, .75, .75); leghenexhitv2->SetHeader("Legend"); leghenexhitv2->SetNColumns(1); leghenexhitv2->AddEntry(leghenexhitv2, "MC", "l"); leghenexhitv2->Draw(); gPad->Update(); TPaveStats *statshenexhitv2 = (TPaveStats*)henexhitv2->GetListOfFunctions()->FindObject("stats"); statshenexhitv2->SetTextColor(kBlue); statshenexhitv2->SetX1NDC(0.80); statshenexhitv2->SetX2NDC(0.98); statshenexhitv2->SetY1NDC(0.77); statshenexhitv2->SetY2NDC(0.92); gPad->Update(); c28->Print(myplothenexhitv2); delete c28; TCanvas *c29 = new TCanvas("c29",canvtitle,1280,1024); TH2F *heneyhitv2 = new TH2F("heneyhitv2", "", 500, 0., 0.,5000, 0.,0.); TString varheneyhitv2 = TString::Format("ReleasedEnergy : EndStepPos.y >> heneyhitv2"); t2->Draw(varheneyhitv2); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn heneyhitv2->SetTitle(cdnameheneyhitv2); heneyhitv2->GetXaxis()->SetTitle(cdXnamehenehit); heneyhitv2->GetYaxis()->SetTitle(cdYnamehenehit); heneyhitv2->GetYaxis()->SetTitleSize(c_YTitleSize); heneyhitv2->GetYaxis()->SetTitleFont(c_YTitleFont); heneyhitv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); heneyhitv2->GetYaxis()->SetLabelFont(c_YLabelFont); heneyhitv2->GetYaxis()->SetLabelSize(c_YLabelSize); heneyhitv2->GetXaxis()->SetTitleSize(c_XTitleSize); heneyhitv2->GetXaxis()->SetTitleFont(c_XTitleFont); heneyhitv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); heneyhitv2->GetXaxis()->SetLabelFont(c_XLabelFont); heneyhitv2->GetXaxis()->SetLabelSize(c_XLabelSize); heneyhitv2->SetMarkerSize(50); heneyhitv2->Draw("COLZ"); heneyhitv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *heneyhitv2copy = heneyhitv2->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteeneyhitv2 = (TPaletteAxis *) heneyhitv2copy->GetListOfFunctions()->FindObject("palette"); paletteeneyhitv2->SetX1NDC(0.86); paletteeneyhitv2->SetX2NDC(0.90); paletteeneyhitv2->SetY1NDC(0.2); paletteeneyhitv2->SetY2NDC(0.8); c29->Modified(); c29->Update(); TLegend* legheneyhitv2 = new TLegend(0.65, 0.7, .75, .75); legheneyhitv2->SetHeader("Legend"); legheneyhitv2->SetNColumns(1); legheneyhitv2->AddEntry(legheneyhitv2, "MC", "l"); legheneyhitv2->Draw(); gPad->Update(); TPaveStats *statsheneyhitv2 = (TPaveStats*)heneyhitv2->GetListOfFunctions()->FindObject("stats"); statsheneyhitv2->SetTextColor(kBlue); statsheneyhitv2->SetX1NDC(0.80); statsheneyhitv2->SetX2NDC(0.98); statsheneyhitv2->SetY1NDC(0.77); statsheneyhitv2->SetY2NDC(0.92); gPad->Update(); c29->Print(myplotheneyhitv2); delete c29; TCanvas *c30 = new TCanvas("c30",canvtitle,1280,1024); TH2F *henezhitv2 = new TH2F("henezhitv2", "", 500, 0., 0.,5000, 0.,0.); TString varhenezhitv2 = TString::Format("ReleasedEnergy : EndStepPos.z >> henezhitv2"); t2->Draw(varhenezhitv2); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn henezhitv2->SetTitle(cdnamehenezhitv2); henezhitv2->GetXaxis()->SetTitle(cdXnamehenehit); henezhitv2->GetYaxis()->SetTitle(cdYnamehenehit); henezhitv2->GetYaxis()->SetTitleSize(c_YTitleSize); henezhitv2->GetYaxis()->SetTitleFont(c_YTitleFont); henezhitv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); henezhitv2->GetYaxis()->SetLabelFont(c_YLabelFont); henezhitv2->GetYaxis()->SetLabelSize(c_YLabelSize); henezhitv2->GetXaxis()->SetTitleSize(c_XTitleSize); henezhitv2->GetXaxis()->SetTitleFont(c_XTitleFont); henezhitv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); henezhitv2->GetXaxis()->SetLabelFont(c_XLabelFont); henezhitv2->GetXaxis()->SetLabelSize(c_XLabelSize); henezhitv2->SetMarkerSize(50); henezhitv2->Draw("COLZ"); henezhitv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *henezhitv2copy = henezhitv2->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteenezhitv2 = (TPaletteAxis *) henezhitv2copy->GetListOfFunctions()->FindObject("palette"); paletteenezhitv2->SetX1NDC(0.86); paletteenezhitv2->SetX2NDC(0.90); paletteenezhitv2->SetY1NDC(0.2); paletteenezhitv2->SetY2NDC(0.8); c30->Modified(); c30->Update(); TLegend* leghenezhitv2 = new TLegend(0.65, 0.7, .75, .75); leghenezhitv2->SetHeader("Legend"); leghenezhitv2->SetNColumns(1); leghenezhitv2->AddEntry(leghenezhitv2, "MC", "l"); leghenezhitv2->Draw(); gPad->Update(); TPaveStats *statshenezhitv2 = (TPaveStats*)henezhitv2->GetListOfFunctions()->FindObject("stats"); statshenezhitv2->SetTextColor(kBlue); statshenezhitv2->SetX1NDC(0.80); statshenezhitv2->SetX2NDC(0.98); statshenezhitv2->SetY1NDC(0.77); statshenezhitv2->SetY2NDC(0.92); gPad->Update(); c30->Print(myplothenezhitv2); delete c30; TCanvas *c32 = new TCanvas("c32",canvtitle,1280,1024); TH3F *hspacehitv2 = new TH3F("hspacehitv2", "", 40, 0., 0.,40, 0.,0.,40,0.,0.); TString varhspacehitv2 = TString::Format("EndStepPos.x : EndStepPos.y : EndStepPos.z >> hspacehitv2"); t2->Draw(varhspacehitv2); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn hspacehitv2->SetTitle(cdnamehspacehitv2); hspacehitv2->GetXaxis()->SetTitle(cdXnamehspacehit); hspacehitv2->GetYaxis()->SetTitle(cdYnamehspacehit); hspacehitv2->GetZaxis()->SetTitle(cdZnamehspacehit); hspacehitv2->GetYaxis()->SetTitleSize(c_YTitleSize); hspacehitv2->GetYaxis()->SetTitleFont(c_YTitleFont); hspacehitv2->GetYaxis()->SetTitleOffset(c_YTitleOffsetTH3); hspacehitv2->GetYaxis()->SetLabelFont(c_YLabelFont); hspacehitv2->GetYaxis()->SetLabelSize(c_YLabelSize); hspacehitv2->GetXaxis()->SetTitleSize(c_XTitleSize); hspacehitv2->GetXaxis()->SetTitleFont(c_XTitleFont); hspacehitv2->GetXaxis()->SetTitleOffset(c_XTitleOffsetTH3); hspacehitv2->GetXaxis()->SetLabelFont(c_XLabelFont); hspacehitv2->GetXaxis()->SetLabelSize(c_XLabelSize); hspacehitv2->GetZaxis()->SetTitleSize(c_XTitleSize); hspacehitv2->GetZaxis()->SetTitleFont(c_XTitleFont); hspacehitv2->GetZaxis()->SetTitleOffset(c_XTitleOffsetTH3); hspacehitv2->GetZaxis()->SetLabelFont(c_XLabelFont); hspacehitv2->GetZaxis()->SetLabelSize(c_XLabelSize); hspacehitv2->SetMarkerSize(50); // hspacehitv2->Draw("COLZ"); hspacehitv2->Draw(); hspacehitv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn /* TH1 *hspacehitv2copy = hspacehitv2->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * palettespacehitv2 = (TPaletteAxis *) hspacehitv2copy->GetListOfFunctions()->FindObject("palette"); palettespacehitv2->SetX1NDC(0.86); palettespacehitv2->SetX2NDC(0.90); palettespacehitv2->SetY1NDC(0.2); palettespacehitv2->SetY2NDC(0.8);*/ c32->Modified(); c32->Update(); TLegend* leghspacehitv2 = new TLegend(0.65, 0.7, .75, .75); leghspacehitv2->SetHeader("Legend"); leghspacehitv2->SetNColumns(1); leghspacehitv2->AddEntry(leghspacehitv2, "MC", "l"); leghspacehitv2->Draw(); gPad->Update(); TPaveStats *statshspacehitv2 = (TPaveStats*)hspacehitv2->GetListOfFunctions()->FindObject("stats"); statshspacehitv2->SetTextColor(kBlue); statshspacehitv2->SetX1NDC(0.80); statshspacehitv2->SetX2NDC(0.98); statshspacehitv2->SetY1NDC(0.77); statshspacehitv2->SetY2NDC(0.92); gPad->Update(); c32->Print(myplothspacehitv2); delete c32; TCanvas *c50 = new TCanvas("c50",canvtitle,1280,1024); TH2F *henexmomv2 = new TH2F("henexmomv2", "", 500, 0., 0.,5000, 0.,0.); TString varhenexmomv2 = TString::Format("ReleasedEnergy : MomentumDirection.x >> henexmomv2"); t2->Draw(varhenexmomv2); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn henexmomv2->SetTitle(cdnamehenexmomv2); henexmomv2->GetXaxis()->SetTitle(cdXnamehenemom); henexmomv2->GetYaxis()->SetTitle(cdYnamehenehit); henexmomv2->GetYaxis()->SetTitleSize(c_YTitleSize); henexmomv2->GetYaxis()->SetTitleFont(c_YTitleFont); henexmomv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); henexmomv2->GetYaxis()->SetLabelFont(c_YLabelFont); henexmomv2->GetYaxis()->SetLabelSize(c_YLabelSize); henexmomv2->GetXaxis()->SetTitleSize(c_XTitleSize); henexmomv2->GetXaxis()->SetTitleFont(c_XTitleFont); henexmomv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); henexmomv2->GetXaxis()->SetLabelFont(c_XLabelFont); henexmomv2->GetXaxis()->SetLabelSize(c_XLabelSize); henexmomv2->SetMarkerSize(50); henexmomv2->Draw("COLZ"); henexmomv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *henexmomv2copy = henexmomv2->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteenexmomv2 = (TPaletteAxis *) henexmomv2copy->GetListOfFunctions()->FindObject("palette"); paletteenexmomv2->SetX1NDC(0.86); paletteenexmomv2->SetX2NDC(0.90); paletteenexmomv2->SetY1NDC(0.2); paletteenexmomv2->SetY2NDC(0.8); c50->Modified(); c50->Update(); TLegend* leghenexmomv2 = new TLegend(0.65, 0.7, .75, .75); leghenexmomv2->SetHeader("Legend"); leghenexmomv2->SetNColumns(1); leghenexmomv2->AddEntry(leghenexmomv2, "MC", "l"); leghenexmomv2->Draw(); gPad->Update(); TPaveStats *statshenexmomv2 = (TPaveStats*)henexmomv2->GetListOfFunctions()->FindObject("stats"); statshenexmomv2->SetTextColor(kBlue); statshenexmomv2->SetX1NDC(0.80); statshenexmomv2->SetX2NDC(0.98); statshenexmomv2->SetY1NDC(0.77); statshenexmomv2->SetY2NDC(0.92); gPad->Update(); c50->Print(myplothenexmomv2); delete c50; TCanvas *c51 = new TCanvas("c51",canvtitle,1280,1024); TH2F *heneymomv2 = new TH2F("heneymomv2", "", 500, 0., 0.,5000, 0.,0.); TString varheneymomv2 = TString::Format("ReleasedEnergy : MomentumDirection.y >> heneymomv2"); t2->Draw(varheneymomv2); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn heneymomv2->SetTitle(cdnameheneymomv2); heneymomv2->GetXaxis()->SetTitle(cdXnamehenemom); heneymomv2->GetYaxis()->SetTitle(cdYnamehenehit); heneymomv2->GetYaxis()->SetTitleSize(c_YTitleSize); heneymomv2->GetYaxis()->SetTitleFont(c_YTitleFont); heneymomv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); heneymomv2->GetYaxis()->SetLabelFont(c_YLabelFont); heneymomv2->GetYaxis()->SetLabelSize(c_YLabelSize); heneymomv2->GetXaxis()->SetTitleSize(c_XTitleSize); heneymomv2->GetXaxis()->SetTitleFont(c_XTitleFont); heneymomv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); heneymomv2->GetXaxis()->SetLabelFont(c_XLabelFont); heneymomv2->GetXaxis()->SetLabelSize(c_XLabelSize); heneymomv2->SetMarkerSize(50); heneymomv2->Draw("COLZ"); heneymomv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *heneymomv2copy = heneymomv2->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteeneymomv2 = (TPaletteAxis *) heneymomv2copy->GetListOfFunctions()->FindObject("palette"); paletteeneymomv2->SetX1NDC(0.86); paletteeneymomv2->SetX2NDC(0.90); paletteeneymomv2->SetY1NDC(0.2); paletteeneymomv2->SetY2NDC(0.8); c51->Modified(); c51->Update(); TLegend* legheneymomv2 = new TLegend(0.65, 0.7, .75, .75); legheneymomv2->SetHeader("Legend"); legheneymomv2->SetNColumns(1); legheneymomv2->AddEntry(legheneymomv2, "MC", "l"); legheneymomv2->Draw(); gPad->Update(); TPaveStats *statsheneymomv2 = (TPaveStats*)heneymomv2->GetListOfFunctions()->FindObject("stats"); statsheneymomv2->SetTextColor(kBlue); statsheneymomv2->SetX1NDC(0.80); statsheneymomv2->SetX2NDC(0.98); statsheneymomv2->SetY1NDC(0.77); statsheneymomv2->SetY2NDC(0.92); gPad->Update(); c51->Print(myplotheneymomv2); delete c51; TCanvas *c52 = new TCanvas("c52",canvtitle,1280,1024); TH2F *henezmomv2 = new TH2F("henezmomv2", "", 500, 0., 0.,5000, 0.,0.); TString varhenezmomv2 = TString::Format("ReleasedEnergy : MomentumDirection.z >> henezmomv2"); t2->Draw(varhenezmomv2); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn henezmomv2->SetTitle(cdnamehenezmomv2); henezmomv2->GetXaxis()->SetTitle(cdXnamehenemom); henezmomv2->GetYaxis()->SetTitle(cdYnamehenehit); henezmomv2->GetYaxis()->SetTitleSize(c_YTitleSize); henezmomv2->GetYaxis()->SetTitleFont(c_YTitleFont); henezmomv2->GetYaxis()->SetTitleOffset(c_YTitleOffset); henezmomv2->GetYaxis()->SetLabelFont(c_YLabelFont); henezmomv2->GetYaxis()->SetLabelSize(c_YLabelSize); henezmomv2->GetXaxis()->SetTitleSize(c_XTitleSize); henezmomv2->GetXaxis()->SetTitleFont(c_XTitleFont); henezmomv2->GetXaxis()->SetTitleOffset(c_XTitleOffset); henezmomv2->GetXaxis()->SetLabelFont(c_XLabelFont); henezmomv2->GetXaxis()->SetLabelSize(c_XLabelSize); henezmomv2->SetMarkerSize(50); henezmomv2->Draw("COLZ"); henezmomv2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TH1 *henezmomv2copy = henezmomv2->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn TPaletteAxis * paletteenezmomv2 = (TPaletteAxis *) henezmomv2copy->GetListOfFunctions()->FindObject("palette"); paletteenezmomv2->SetX1NDC(0.86); paletteenezmomv2->SetX2NDC(0.90); paletteenezmomv2->SetY1NDC(0.2); paletteenezmomv2->SetY2NDC(0.8); c52->Modified(); c52->Update(); TLegend* leghenezmomv2 = new TLegend(0.65, 0.7, .75, .75); leghenezmomv2->SetHeader("Legend"); leghenezmomv2->SetNColumns(1); leghenezmomv2->AddEntry(leghenezmomv2, "MC", "l"); leghenezmomv2->Draw(); gPad->Update(); TPaveStats *statshenezmomv2 = (TPaveStats*)henezmomv2->GetListOfFunctions()->FindObject("stats"); statshenezmomv2->SetTextColor(kBlue); statshenezmomv2->SetX1NDC(0.80); statshenezmomv2->SetX2NDC(0.98); statshenezmomv2->SetY1NDC(0.77); statshenezmomv2->SetY2NDC(0.92); gPad->Update(); c52->Print(myplothenezmomv2); delete c52; //---------------------------------------------------------------------EVENTS -------------------------------------------------------------// TCanvas *c18 = new TCanvas("c18",canvtitle,1280,1024); te->Draw(Form("ReleasedEnergy >> htemp(1000, 0., 10)")); te->GetHistogram()->SetTitle(cdnameRelEnev); te->SetScanField(0); TH1F *htemprelenev= (TH1F*)gPad->GetPrimitive("htemp"); htemprelenev->GetXaxis()->SetTitle(relenxname); htemprelenev->GetYaxis()->SetTitle(countyname); htemprelenev->GetYaxis()->SetTitleSize(c_YTitleSize); htemprelenev->GetYaxis()->SetTitleFont(c_YTitleFont); htemprelenev->GetYaxis()->SetTitleOffset(c_YTitleOffset); htemprelenev->GetYaxis()->SetLabelFont(c_YLabelFont); htemprelenev->GetYaxis()->SetLabelSize(c_YLabelSize); htemprelenev->GetXaxis()->SetTitleSize(c_XTitleSize); htemprelenev->GetXaxis()->SetTitleFont(c_XTitleFont); htemprelenev->GetXaxis()->SetTitleOffset(c_XTitleOffset); htemprelenev->GetXaxis()->SetLabelFont(c_XLabelFont); htemprelenev->GetXaxis()->SetLabelSize(c_XLabelSize); htemprelenev->SetFillStyle(1001); htemprelenev->SetFillColorAlpha(kBlue, fillcolor); htemprelenev->Draw(); htemprelenev->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c18->Update(); TLegend* legrelenev = new TLegend(0.25, 0.7, .35, .75); legrelenev->SetHeader("Legend"); legrelenev->SetNColumns(1); legrelenev->AddEntry(htemprelenev, "MC", "l"); legrelenev->Draw(); c18->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsrelenev = (TPaveStats*)htemprelenev->GetListOfFunctions()->FindObject("stats"); statsrelenev->SetTextColor(kBlue); statsrelenev->SetX1NDC(0.80); statsrelenev->SetX2NDC(0.98); statsrelenev->SetY1NDC(0.77); statsrelenev->SetY2NDC(0.92); statsrelenev->DrawClone(); gPad->Update(); c18->Print(myplotrelenev); delete c18; TCanvas *c19 = new TCanvas("c19",canvtitle,1280,1024); te->Draw(Form("ReleasedEnergy2 >> htemp(1000, 0., 10)")); te->GetHistogram()->SetTitle(cdnameRelEnev2); te->SetScanField(0); TH1F *htemprelenev2= (TH1F*)gPad->GetPrimitive("htemp"); htemprelenev2->GetXaxis()->SetTitle(relenxname); htemprelenev2->GetYaxis()->SetTitle(countyname); htemprelenev2->GetYaxis()->SetTitleSize(c_YTitleSize); htemprelenev2->GetYaxis()->SetTitleFont(c_YTitleFont); htemprelenev2->GetYaxis()->SetTitleOffset(c_YTitleOffset); htemprelenev2->GetYaxis()->SetLabelFont(c_YLabelFont); htemprelenev2->GetYaxis()->SetLabelSize(c_YLabelSize); htemprelenev2->GetXaxis()->SetTitleSize(c_XTitleSize); htemprelenev2->GetXaxis()->SetTitleFont(c_XTitleFont); htemprelenev2->GetXaxis()->SetTitleOffset(c_XTitleOffset); htemprelenev2->GetXaxis()->SetLabelFont(c_XLabelFont); htemprelenev2->GetXaxis()->SetLabelSize(c_XLabelSize); htemprelenev2->SetFillStyle(1001); htemprelenev2->SetFillColorAlpha(kBlue, fillcolor); htemprelenev2->Draw(); htemprelenev2->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c19->Update(); TLegend* legrelenev2 = new TLegend(0.25, 0.7, .35, .75); legrelenev2->SetHeader("Legend"); legrelenev2->SetNColumns(1); legrelenev2->AddEntry(htemprelenev2, "MC", "l"); legrelenev2->Draw(); c19->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsrelenev2 = (TPaveStats*)htemprelenev2->GetListOfFunctions()->FindObject("stats"); statsrelenev2->SetTextColor(kBlue); statsrelenev2->SetX1NDC(0.80); statsrelenev2->SetX2NDC(0.98); statsrelenev2->SetY1NDC(0.77); statsrelenev2->SetY2NDC(0.92); statsrelenev2->DrawClone(); gPad->Update(); c19->Print(myplotrelenev2); delete c19; //---------------------------------------------------------------------SECONDARY -------------------------------------------------------------// TCanvas *c20 = new TCanvas("c20",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleID >> htemp(100, -25., 25.)")); ts->GetHistogram()->SetTitle(cdnamePDGsp); ts->SetScanField(0); TH1F *htemppdgsp= (TH1F*)gPad->GetPrimitive("htemp"); htemppdgsp->GetXaxis()->SetTitle(PDGxname); htemppdgsp->GetYaxis()->SetTitle(countyname); htemppdgsp->GetYaxis()->SetTitleSize(c_YTitleSize); htemppdgsp->GetYaxis()->SetTitleFont(c_YTitleFont); htemppdgsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htemppdgsp->GetYaxis()->SetLabelFont(c_YLabelFont); htemppdgsp->GetYaxis()->SetLabelSize(c_YLabelSize); htemppdgsp->GetXaxis()->SetTitleSize(c_XTitleSize); htemppdgsp->GetXaxis()->SetTitleFont(c_XTitleFont); htemppdgsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htemppdgsp->GetXaxis()->SetLabelFont(c_XLabelFont); htemppdgsp->GetXaxis()->SetLabelSize(c_XLabelSize); htemppdgsp->SetFillStyle(1001); htemppdgsp->SetFillColorAlpha(kBlue, fillcolor); htemppdgsp->Draw(); htemppdgsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c20->Update(); TLegend* legpdgsp = new TLegend(0.25, 0.7, .35, .75); legpdgsp->SetHeader("Legend"); legpdgsp->SetNColumns(1); legpdgsp->AddEntry(htemppdgsp, "MC", "l"); legpdgsp->Draw(); c20->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statspdgsp = (TPaveStats*)htemppdgsp->GetListOfFunctions()->FindObject("stats"); statspdgsp->SetTextColor(kBlue); statspdgsp->SetX1NDC(0.80); statspdgsp->SetX2NDC(0.98); statspdgsp->SetY1NDC(0.77); statspdgsp->SetY2NDC(0.92); statspdgsp->DrawClone(); gPad->Update(); c20->Print(myplotpdgsp); delete c20; TCanvas *c21 = new TCanvas("c21",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleKinEn >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnameKinEnsp); ts->SetScanField(0); TH1F *htempkinensp= (TH1F*)gPad->GetPrimitive("htemp"); htempkinensp->GetXaxis()->SetTitle(kinenxname); htempkinensp->GetYaxis()->SetTitle(countyname); htempkinensp->GetYaxis()->SetTitleSize(c_YTitleSize); htempkinensp->GetYaxis()->SetTitleFont(c_YTitleFont); htempkinensp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempkinensp->GetYaxis()->SetLabelFont(c_YLabelFont); htempkinensp->GetYaxis()->SetLabelSize(c_YLabelSize); htempkinensp->GetXaxis()->SetTitleSize(c_XTitleSize); htempkinensp->GetXaxis()->SetTitleFont(c_XTitleFont); htempkinensp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempkinensp->GetXaxis()->SetLabelFont(c_XLabelFont); htempkinensp->GetXaxis()->SetLabelSize(c_XLabelSize); htempkinensp->SetFillStyle(1001); htempkinensp->SetFillColorAlpha(kBlue, fillcolor); htempkinensp->Draw(); htempkinensp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c21->Update(); TLegend* legkinensp = new TLegend(0.25, 0.7, .35, .75); legkinensp->SetHeader("Legend"); legkinensp->SetNColumns(1); legkinensp->AddEntry(htempkinensp, "MC", "l"); legkinensp->Draw(); c21->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statskinensp = (TPaveStats*)htempkinensp->GetListOfFunctions()->FindObject("stats"); statskinensp->SetTextColor(kBlue); statskinensp->SetX1NDC(0.80); statskinensp->SetX2NDC(0.98); statskinensp->SetY1NDC(0.83); statskinensp->SetY2NDC(0.98); statskinensp->DrawClone(); gPad->Update(); c21->Print(myplotkinensp); delete c21; TCanvas *c22 = new TCanvas("c22",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleMomDir.x >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnamePxsp); ts->SetScanField(0); TH1F *htempmomxsp= (TH1F*)gPad->GetPrimitive("htemp"); htempmomxsp->GetXaxis()->SetTitle(momxname); htempmomxsp->GetYaxis()->SetTitle(countyname); htempmomxsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomxsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomxsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomxsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomxsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomxsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomxsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomxsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomxsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomxsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomxsp->SetFillStyle(1001); htempmomxsp->SetFillColorAlpha(kBlue, fillcolor); htempmomxsp->Draw(); htempmomxsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c22->Update(); TLegend* legmomxsp = new TLegend(0.25, 0.7, .35, .75); legmomxsp->SetHeader("Legend"); legmomxsp->SetNColumns(1); legmomxsp->AddEntry(htempmomxsp, "MC", "l"); legmomxsp->Draw(); c22->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomxsp = (TPaveStats*)htempmomxsp->GetListOfFunctions()->FindObject("stats"); statsmomxsp->SetTextColor(kBlue); statsmomxsp->SetX1NDC(0.80); statsmomxsp->SetX2NDC(0.98); statsmomxsp->SetY1NDC(0.83); statsmomxsp->SetY2NDC(0.98); statsmomxsp->DrawClone(); gPad->Update(); c22->Print(myplotmomxsp); delete c22; TCanvas *c23 = new TCanvas("c23",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleMomDir.y >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnamePysp); ts->SetScanField(0); TH1F *htempmomysp= (TH1F*)gPad->GetPrimitive("htemp"); htempmomysp->GetXaxis()->SetTitle(momxname); htempmomysp->GetYaxis()->SetTitle(countyname); htempmomysp->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomysp->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomysp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomysp->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomysp->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomysp->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomysp->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomysp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomysp->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomysp->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomysp->SetFillStyle(1001); htempmomysp->SetFillColorAlpha(kBlue, fillcolor); htempmomysp->Draw(); htempmomysp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c23->Update(); TLegend* legmomysp = new TLegend(0.25, 0.7, .35, .75); legmomysp->SetHeader("Legend"); legmomysp->SetNColumns(1); legmomysp->AddEntry(htempmomysp, "MC", "l"); legmomysp->Draw(); c23->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomysp = (TPaveStats*)htempmomysp->GetListOfFunctions()->FindObject("stats"); statsmomysp->SetTextColor(kBlue); statsmomysp->SetX1NDC(0.80); statsmomysp->SetX2NDC(0.98); statsmomysp->SetY1NDC(0.77); statsmomysp->SetY2NDC(0.92); statsmomysp->DrawClone(); gPad->Update(); c23->Print(myplotmomysp); delete c23; TCanvas *c24 = new TCanvas("c24",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleMomDir.z >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnamePzsp); ts->SetScanField(0); TH1F *htempmomzsp= (TH1F*)gPad->GetPrimitive("htemp"); htempmomzsp->GetXaxis()->SetTitle(momxname); htempmomzsp->GetYaxis()->SetTitle(countyname); htempmomzsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomzsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomzsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomzsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomzsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomzsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomzsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomzsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomzsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomzsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomzsp->SetFillStyle(1001); htempmomzsp->SetFillColorAlpha(kBlue, fillcolor); htempmomzsp->Draw(); htempmomzsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c24->Update(); TLegend* legmomzsp = new TLegend(0.25, 0.7, .35, .75); legmomzsp->SetHeader("Legend"); legmomzsp->SetNColumns(1); legmomzsp->AddEntry(htempmomzsp, "MC", "l"); legmomzsp->Draw(); c24->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomzsp = (TPaveStats*)htempmomzsp->GetListOfFunctions()->FindObject("stats"); statsmomzsp->SetTextColor(kBlue); statsmomzsp->SetX1NDC(0.80); statsmomzsp->SetX2NDC(0.98); statsmomzsp->SetY1NDC(0.77); statsmomzsp->SetY2NDC(0.92); statsmomzsp->DrawClone(); gPad->Update(); c24->Print(myplotmomzsp); delete c24; TCanvas *c33 = new TCanvas("c33",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleVert.x >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnamevertxsp); ts->SetScanField(0); TH1F *htempvertxsp= (TH1F*)gPad->GetPrimitive("htemp"); htempvertxsp->GetXaxis()->SetTitle(vertxname); htempvertxsp->GetYaxis()->SetTitle(countyname); htempvertxsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempvertxsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempvertxsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempvertxsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempvertxsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempvertxsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempvertxsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempvertxsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempvertxsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempvertxsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempvertxsp->SetFillStyle(1001); htempvertxsp->SetFillColorAlpha(kBlue, fillcolor); htempvertxsp->Draw(); htempvertxsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c33->Update(); TLegend* legvertxsp = new TLegend(0.25, 0.7, .35, .75); legvertxsp->SetHeader("Legend"); legvertxsp->SetNColumns(1); legvertxsp->AddEntry(htempvertxsp, "MC", "l"); legvertxsp->Draw(); c33->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsvertxsp = (TPaveStats*)htempvertxsp->GetListOfFunctions()->FindObject("stats"); statsvertxsp->SetTextColor(kBlue); statsvertxsp->SetX1NDC(0.80); statsvertxsp->SetX2NDC(0.98); statsvertxsp->SetY1NDC(0.77); statsvertxsp->SetY2NDC(0.92); statsvertxsp->DrawClone(); gPad->Update(); c33->Print(myplotvertxsp); delete c33; TCanvas *c34 = new TCanvas("c34",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleVert.y >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnamevertysp); ts->SetScanField(0); TH1F *htempvertysp= (TH1F*)gPad->GetPrimitive("htemp"); htempvertysp->GetXaxis()->SetTitle(vertxname); htempvertysp->GetYaxis()->SetTitle(countyname); htempvertysp->GetYaxis()->SetTitleSize(c_YTitleSize); htempvertysp->GetYaxis()->SetTitleFont(c_YTitleFont); htempvertysp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempvertysp->GetYaxis()->SetLabelFont(c_YLabelFont); htempvertysp->GetYaxis()->SetLabelSize(c_YLabelSize); htempvertysp->GetXaxis()->SetTitleSize(c_XTitleSize); htempvertysp->GetXaxis()->SetTitleFont(c_XTitleFont); htempvertysp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempvertysp->GetXaxis()->SetLabelFont(c_XLabelFont); htempvertysp->GetXaxis()->SetLabelSize(c_XLabelSize); htempvertysp->SetFillStyle(1001); htempvertysp->SetFillColorAlpha(kBlue, fillcolor); htempvertysp->Draw(); htempvertysp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c34->Update(); TLegend* legvertysp = new TLegend(0.25, 0.7, .35, .75); legvertysp->SetHeader("Legend"); legvertysp->SetNColumns(1); legvertysp->AddEntry(htempvertysp, "MC", "l"); legvertysp->Draw(); c34->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsvertysp = (TPaveStats*)htempvertysp->GetListOfFunctions()->FindObject("stats"); statsvertysp->SetTextColor(kBlue); statsvertysp->SetX1NDC(0.80); statsvertysp->SetX2NDC(0.98); statsvertysp->SetY1NDC(0.77); statsvertysp->SetY2NDC(0.92); statsvertysp->DrawClone(); gPad->Update(); c34->Print(myplotvertysp); delete c34; TCanvas *c35 = new TCanvas("c35",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleVert.z >> htemp(50, -10, 40)")); ts->GetHistogram()->SetTitle(cdnamevertzsp); ts->SetScanField(0); TH1F *htempvertzsp= (TH1F*)gPad->GetPrimitive("htemp"); htempvertzsp->GetXaxis()->SetTitle(vertxname); htempvertzsp->GetYaxis()->SetTitle(countyname); htempvertzsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempvertzsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempvertzsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempvertzsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempvertzsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempvertzsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempvertzsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempvertzsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempvertzsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempvertzsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempvertzsp->SetFillStyle(1001); htempvertzsp->SetFillColorAlpha(kBlue, fillcolor); htempvertzsp->Draw(); htempvertzsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c35->Update(); TLegend* legvertzsp = new TLegend(0.25, 0.7, .35, .75); legvertzsp->SetHeader("Legend"); legvertzsp->SetNColumns(1); legvertzsp->AddEntry(htempvertzsp, "MC", "l"); legvertzsp->Draw(); c35->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsvertzsp = (TPaveStats*)htempvertzsp->GetListOfFunctions()->FindObject("stats"); statsvertzsp->SetTextColor(kBlue); statsvertzsp->SetX1NDC(0.80); statsvertzsp->SetX2NDC(0.98); statsvertzsp->SetY1NDC(0.77); statsvertzsp->SetY2NDC(0.92); statsvertzsp->DrawClone(); gPad->Update(); c35->Print(myplotvertzsp); delete c35; TCanvas *c36 = new TCanvas("c36",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleTotMom >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnametotmomsp); ts->SetScanField(0); TH1F *htemptotmomsp= (TH1F*)gPad->GetPrimitive("htemp"); htemptotmomsp->GetXaxis()->SetTitle(totmomXname); htemptotmomsp->GetYaxis()->SetTitle(countyname); htemptotmomsp->GetYaxis()->SetTitleSize(c_YTitleSize); htemptotmomsp->GetYaxis()->SetTitleFont(c_YTitleFont); htemptotmomsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htemptotmomsp->GetYaxis()->SetLabelFont(c_YLabelFont); htemptotmomsp->GetYaxis()->SetLabelSize(c_YLabelSize); htemptotmomsp->GetXaxis()->SetTitleSize(c_XTitleSize); htemptotmomsp->GetXaxis()->SetTitleFont(c_XTitleFont); htemptotmomsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htemptotmomsp->GetXaxis()->SetLabelFont(c_XLabelFont); htemptotmomsp->GetXaxis()->SetLabelSize(c_XLabelSize); htemptotmomsp->SetFillStyle(1001); htemptotmomsp->SetFillColorAlpha(kBlue, fillcolor); htemptotmomsp->Draw(); htemptotmomsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c36->Update(); TLegend* legtotmomsp = new TLegend(0.25, 0.7, .35, .75); legtotmomsp->SetHeader("Legend"); legtotmomsp->SetNColumns(1); legtotmomsp->AddEntry(htemptotmomsp, "MC", "l"); legtotmomsp->Draw(); c36->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statstotmomsp = (TPaveStats*)htemptotmomsp->GetListOfFunctions()->FindObject("stats"); statstotmomsp->SetTextColor(kBlue); statstotmomsp->SetX1NDC(0.80); statstotmomsp->SetX2NDC(0.98); statstotmomsp->SetY1NDC(0.77); statstotmomsp->SetY2NDC(0.92); statstotmomsp->DrawClone(); gPad->Update(); c36->Print(myplottotmomsp); delete c36; TCanvas *c37 = new TCanvas("c37",canvtitle,1280,1024); ts->Draw(Form("PositionDirection.x >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnameDxsp); ts->SetScanField(0); TH1F *htempdirxsp= (TH1F*)gPad->GetPrimitive("htemp"); htempdirxsp->GetXaxis()->SetTitle(dirxname); htempdirxsp->GetYaxis()->SetTitle(countyname); htempdirxsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempdirxsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempdirxsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdirxsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempdirxsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempdirxsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempdirxsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempdirxsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdirxsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempdirxsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempdirxsp->SetFillStyle(1001); htempdirxsp->SetFillColorAlpha(kBlue, fillcolor); htempdirxsp->Draw(); htempdirxsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c37->Update(); TLegend* legdirxsp = new TLegend(0.25, 0.7, .35, .75); legdirxsp->SetHeader("Legend"); legdirxsp->SetNColumns(1); legdirxsp->AddEntry(htempdirxsp, "MC", "l"); legdirxsp->Draw(); c37->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdirxsp = (TPaveStats*)htempdirxsp->GetListOfFunctions()->FindObject("stats"); statsdirxsp->SetTextColor(kBlue); statsdirxsp->SetX1NDC(0.80); statsdirxsp->SetX2NDC(0.98); statsdirxsp->SetY1NDC(0.77); statsdirxsp->SetY2NDC(0.92); statsdirxsp->DrawClone(); gPad->Update(); c37->Print(myplotdirxsp); delete c37; TCanvas *c38 = new TCanvas("c38",canvtitle,1280,1024); ts->Draw(Form("PositionDirection.y >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnameDysp); ts->SetScanField(0); TH1F *htempdirysp= (TH1F*)gPad->GetPrimitive("htemp"); htempdirysp->GetXaxis()->SetTitle(dirxname); htempdirysp->GetYaxis()->SetTitle(countyname); htempdirysp->GetYaxis()->SetTitleSize(c_YTitleSize); htempdirysp->GetYaxis()->SetTitleFont(c_YTitleFont); htempdirysp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdirysp->GetYaxis()->SetLabelFont(c_YLabelFont); htempdirysp->GetYaxis()->SetLabelSize(c_YLabelSize); htempdirysp->GetXaxis()->SetTitleSize(c_XTitleSize); htempdirysp->GetXaxis()->SetTitleFont(c_XTitleFont); htempdirysp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdirysp->GetXaxis()->SetLabelFont(c_XLabelFont); htempdirysp->GetXaxis()->SetLabelSize(c_XLabelSize); htempdirysp->SetFillStyle(1001); htempdirysp->SetFillColorAlpha(kBlue, fillcolor); htempdirysp->Draw(); htempdirysp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c38->Update(); TLegend* legdirysp = new TLegend(0.25, 0.7, .35, .75); legdirysp->SetHeader("Legend"); legdirysp->SetNColumns(1); legdirysp->AddEntry(htempdirysp, "MC", "l"); legdirysp->Draw(); c38->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdirysp = (TPaveStats*)htempdirysp->GetListOfFunctions()->FindObject("stats"); statsdirysp->SetTextColor(kBlue); statsdirysp->SetX1NDC(0.80); statsdirysp->SetX2NDC(0.98); statsdirysp->SetY1NDC(0.77); statsdirysp->SetY2NDC(0.92); statsdirysp->DrawClone(); gPad->Update(); c38->Print(myplotdirysp); delete c38; TCanvas *c39 = new TCanvas("c39",canvtitle,1280,1024); ts->Draw(Form("PositionDirection.z >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnameDzsp); ts->SetScanField(0); TH1F *htempdirzsp= (TH1F*)gPad->GetPrimitive("htemp"); htempdirzsp->GetXaxis()->SetTitle(dirxname); htempdirzsp->GetYaxis()->SetTitle(countyname); htempdirzsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempdirzsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempdirzsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempdirzsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempdirzsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempdirzsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempdirzsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempdirzsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempdirzsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempdirzsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempdirzsp->SetFillStyle(1001); htempdirzsp->SetFillColorAlpha(kBlue, fillcolor); htempdirzsp->Draw(); htempdirzsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c39->Update(); TLegend* legdirzsp = new TLegend(0.25, 0.7, .35, .75); legdirzsp->SetHeader("Legend"); legdirzsp->SetNColumns(1); legdirzsp->AddEntry(htempdirzsp, "MC", "l"); legdirzsp->Draw(); c39->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsdirzsp = (TPaveStats*)htempdirzsp->GetListOfFunctions()->FindObject("stats"); statsdirzsp->SetTextColor(kBlue); statsdirzsp->SetX1NDC(0.80); statsdirzsp->SetX2NDC(0.98); statsdirzsp->SetY1NDC(0.77); statsdirzsp->SetY2NDC(0.92); statsdirzsp->DrawClone(); gPad->Update(); c39->Print(myplotdirzsp); delete c39; TCanvas *c40 = new TCanvas("c40",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleMom.x >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnamemomvalxsp); ts->SetScanField(0); TH1F *htempmomvalxsp= (TH1F*)gPad->GetPrimitive("htemp"); htempmomvalxsp->GetXaxis()->SetTitle(momvalxname); htempmomvalxsp->GetYaxis()->SetTitle(countyname); htempmomvalxsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomvalxsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomvalxsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomvalxsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomvalxsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomvalxsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomvalxsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomvalxsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomvalxsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomvalxsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomvalxsp->SetFillStyle(1001); htempmomvalxsp->SetFillColorAlpha(kBlue, fillcolor); htempmomvalxsp->Draw(); htempmomvalxsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c40->Update(); TLegend* legmomvalxsp = new TLegend(0.25, 0.7, .35, .75); legmomvalxsp->SetHeader("Legend"); legmomvalxsp->SetNColumns(1); legmomvalxsp->AddEntry(htempmomvalxsp, "MC", "l"); legmomvalxsp->Draw(); c40->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomvalxsp = (TPaveStats*)htempmomvalxsp->GetListOfFunctions()->FindObject("stats"); statsmomvalxsp->SetTextColor(kBlue); statsmomvalxsp->SetX1NDC(0.80); statsmomvalxsp->SetX2NDC(0.98); statsmomvalxsp->SetY1NDC(0.77); statsmomvalxsp->SetY2NDC(0.92); statsmomvalxsp->DrawClone(); gPad->Update(); c40->Print(myplotmomvalxsp); delete c40; TCanvas *c41 = new TCanvas("c41",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleMom.y >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnamemomvalysp); ts->SetScanField(0); TH1F *htempmomvalysp= (TH1F*)gPad->GetPrimitive("htemp"); htempmomvalysp->GetXaxis()->SetTitle(momvalxname); htempmomvalysp->GetYaxis()->SetTitle(countyname); htempmomvalysp->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomvalysp->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomvalysp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomvalysp->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomvalysp->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomvalysp->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomvalysp->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomvalysp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomvalysp->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomvalysp->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomvalysp->SetFillStyle(1001); htempmomvalysp->SetFillColorAlpha(kBlue, fillcolor); htempmomvalysp->Draw(); htempmomvalysp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c41->Update(); TLegend* legmomvalysp = new TLegend(0.25, 0.7, .35, .75); legmomvalysp->SetHeader("Legend"); legmomvalysp->SetNColumns(1); legmomvalysp->AddEntry(htempmomvalysp, "MC", "l"); legmomvalysp->Draw(); c41->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomvalysp = (TPaveStats*)htempmomvalysp->GetListOfFunctions()->FindObject("stats"); statsmomvalysp->SetTextColor(kBlue); statsmomvalysp->SetX1NDC(0.80); statsmomvalysp->SetX2NDC(0.98); statsmomvalysp->SetY1NDC(0.77); statsmomvalysp->SetY2NDC(0.92); statsmomvalysp->DrawClone(); gPad->Update(); c41->Print(myplotmomvalysp); delete c41; TCanvas *c42 = new TCanvas("c42",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleMom.z >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnamemomvalzsp); ts->SetScanField(0); TH1F *htempmomvalzsp= (TH1F*)gPad->GetPrimitive("htemp"); htempmomvalzsp->GetXaxis()->SetTitle(momvalxname); htempmomvalzsp->GetYaxis()->SetTitle(countyname); htempmomvalzsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempmomvalzsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempmomvalzsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempmomvalzsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempmomvalzsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempmomvalzsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempmomvalzsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempmomvalzsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempmomvalzsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempmomvalzsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempmomvalzsp->SetFillStyle(1001); htempmomvalzsp->SetFillColorAlpha(kBlue, fillcolor); htempmomvalzsp->Draw(); htempmomvalzsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c42->Update(); TLegend* legmomvalzsp = new TLegend(0.25, 0.7, .35, .75); legmomvalzsp->SetHeader("Legend"); legmomvalzsp->SetNColumns(1); legmomvalzsp->AddEntry(htempmomvalzsp, "MC", "l"); legmomvalzsp->Draw(); c42->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsmomvalzsp = (TPaveStats*)htempmomvalzsp->GetListOfFunctions()->FindObject("stats"); statsmomvalzsp->SetTextColor(kBlue); statsmomvalzsp->SetX1NDC(0.80); statsmomvalzsp->SetX2NDC(0.98); statsmomvalzsp->SetY1NDC(0.77); statsmomvalzsp->SetY2NDC(0.92); statsmomvalzsp->DrawClone(); gPad->Update(); c42->Print(myplotmomvalzsp); delete c42; TCanvas *c43 = new TCanvas("c43",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleAng.x >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnameangxsp); ts->SetScanField(0); TH1F *htempangxsp= (TH1F*)gPad->GetPrimitive("htemp"); htempangxsp->GetXaxis()->SetTitle(angxname); htempangxsp->GetYaxis()->SetTitle(countyname); htempangxsp->GetYaxis()->SetTitleSize(c_YTitleSize); htempangxsp->GetYaxis()->SetTitleFont(c_YTitleFont); htempangxsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempangxsp->GetYaxis()->SetLabelFont(c_YLabelFont); htempangxsp->GetYaxis()->SetLabelSize(c_YLabelSize); htempangxsp->GetXaxis()->SetTitleSize(c_XTitleSize); htempangxsp->GetXaxis()->SetTitleFont(c_XTitleFont); htempangxsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempangxsp->GetXaxis()->SetLabelFont(c_XLabelFont); htempangxsp->GetXaxis()->SetLabelSize(c_XLabelSize); htempangxsp->SetFillStyle(1001); htempangxsp->SetFillColorAlpha(kBlue, fillcolor); htempangxsp->Draw(); htempangxsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c43->Update(); TLegend* legangxsp = new TLegend(0.25, 0.7, .35, .75); legangxsp->SetHeader("Legend"); legangxsp->SetNColumns(1); legangxsp->AddEntry(htempangxsp, "MC", "l"); legangxsp->Draw(); c43->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsangxsp = (TPaveStats*)htempangxsp->GetListOfFunctions()->FindObject("stats"); statsangxsp->SetTextColor(kBlue); statsangxsp->SetX1NDC(0.80); statsangxsp->SetX2NDC(0.98); statsangxsp->SetY1NDC(0.77); statsangxsp->SetY2NDC(0.92); statsangxsp->DrawClone(); gPad->Update(); c43->Print(myplotangxsp); delete c43; TCanvas *c44 = new TCanvas("c44",canvtitle,1280,1024); ts->Draw(Form("SecondaryParticleAng.y >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnameangysp); ts->SetScanField(0); TH1F *htempangysp= (TH1F*)gPad->GetPrimitive("htemp"); htempangysp->GetXaxis()->SetTitle(angxname); htempangysp->GetYaxis()->SetTitle(countyname); htempangysp->GetYaxis()->SetTitleSize(c_YTitleSize); htempangysp->GetYaxis()->SetTitleFont(c_YTitleFont); htempangysp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempangysp->GetYaxis()->SetLabelFont(c_YLabelFont); htempangysp->GetYaxis()->SetLabelSize(c_YLabelSize); htempangysp->GetXaxis()->SetTitleSize(c_XTitleSize); htempangysp->GetXaxis()->SetTitleFont(c_XTitleFont); htempangysp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempangysp->GetXaxis()->SetLabelFont(c_XLabelFont); htempangysp->GetXaxis()->SetLabelSize(c_XLabelSize); htempangysp->SetFillStyle(1001); htempangysp->SetFillColorAlpha(kBlue, fillcolor); htempangysp->Draw(); htempangysp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c44->Update(); TLegend* legangysp = new TLegend(0.25, 0.7, .35, .75); legangysp->SetHeader("Legend"); legangysp->SetNColumns(1); legangysp->AddEntry(htempangysp, "MC", "l"); legangysp->Draw(); c44->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsangysp = (TPaveStats*)htempangysp->GetListOfFunctions()->FindObject("stats"); statsangysp->SetTextColor(kBlue); statsangysp->SetX1NDC(0.80); statsangysp->SetX2NDC(0.98); statsangysp->SetY1NDC(0.77); statsangysp->SetY2NDC(0.92); statsangysp->DrawClone(); gPad->Update(); c44->Print(myplotangysp); delete c44; TCanvas *c45 = new TCanvas("c45",canvtitle,1280,1024); TH2F *hemitxxpsp = new TH2F("hemitxxpsp", "", 500, 0., 0.,5000, 0.,0.); TString varhemitxxpsp = TString::Format("SecondaryParticleAng.x : PositionDirection.x >> hemitxxpsp"); ts->Draw(varhemitxxpsp); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn hemitxxpsp->SetTitle(cdnamehemitxxpsp); hemitxxpsp->GetXaxis()->SetTitle(cdXnamehemitxxp); hemitxxpsp->GetYaxis()->SetTitle(cdYnamehemitxxp); hemitxxpsp->GetYaxis()->SetTitleSize(c_YTitleSize); hemitxxpsp->GetYaxis()->SetTitleFont(c_YTitleFont); hemitxxpsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); hemitxxpsp->GetYaxis()->SetLabelFont(c_YLabelFont); hemitxxpsp->GetYaxis()->SetLabelSize(c_YLabelSize); hemitxxpsp->GetXaxis()->SetTitleSize(c_XTitleSize); hemitxxpsp->GetXaxis()->SetTitleFont(c_XTitleFont); hemitxxpsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); hemitxxpsp->GetXaxis()->SetLabelFont(c_XLabelFont); hemitxxpsp->GetXaxis()->SetLabelSize(c_XLabelSize); hemitxxpsp->SetMarkerSize(50); // hemitxxpsp->Draw("COLZ"); hemitxxpsp->Draw(); hemitxxpsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn // TH1 *hemitxxpspcopy = hemitxxpsp->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn /* TPaletteAxis * paletteemitxxpsp = (TPaletteAxis *) hemitxxpspcopy->GetListOfFunctions()->FindObject("palette"); paletteemitxxpsp->SetX1NDC(0.86); paletteemitxxpsp->SetX2NDC(0.90); paletteemitxxpsp->SetY1NDC(0.2); paletteemitxxpsp->SetY2NDC(0.8);*/ c45->Modified(); c45->Update(); TLegend* leghemitxxpsp = new TLegend(0.65, 0.7, .75, .75); leghemitxxpsp->SetHeader("Legend"); leghemitxxpsp->SetNColumns(1); leghemitxxpsp->AddEntry(leghemitxxpsp, "MC", "l"); leghemitxxpsp->Draw(); gPad->Update(); TPaveStats *statshemitxxpsp = (TPaveStats*)hemitxxpsp->GetListOfFunctions()->FindObject("stats"); statshemitxxpsp->SetTextColor(kBlue); statshemitxxpsp->SetX1NDC(0.80); statshemitxxpsp->SetX2NDC(0.98); statshemitxxpsp->SetY1NDC(0.77); statshemitxxpsp->SetY2NDC(0.92); gPad->Update(); c45->Print(myplothemitxxpsp); delete c45; TCanvas *c46 = new TCanvas("c46",canvtitle,1280,1024); TH2F *hemityypsp = new TH2F("hemityypsp", "", 500, 0., 0.,5000, 0.,0.); TString varhemityypsp = TString::Format("SecondaryParticleAng.y : PositionDirection.y >> hemityypsp"); ts->Draw(varhemityypsp); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn hemityypsp->SetTitle(cdnamehemityypsp); hemityypsp->GetXaxis()->SetTitle(cdXnamehemityyp); hemityypsp->GetYaxis()->SetTitle(cdYnamehemityyp); hemityypsp->GetYaxis()->SetTitleSize(c_YTitleSize); hemityypsp->GetYaxis()->SetTitleFont(c_YTitleFont); hemityypsp->GetYaxis()->SetTitleOffset(c_YTitleOffset); hemityypsp->GetYaxis()->SetLabelFont(c_YLabelFont); hemityypsp->GetYaxis()->SetLabelSize(c_YLabelSize); hemityypsp->GetXaxis()->SetTitleSize(c_XTitleSize); hemityypsp->GetXaxis()->SetTitleFont(c_XTitleFont); hemityypsp->GetXaxis()->SetTitleOffset(c_XTitleOffset); hemityypsp->GetXaxis()->SetLabelFont(c_XLabelFont); hemityypsp->GetXaxis()->SetLabelSize(c_XLabelSize); hemityypsp->SetMarkerSize(50); //hemityypsp->Draw("COLZ"); hemityypsp->Draw(); hemityypsp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn //TH1 *hemityypspcopy = hemityypsp->DrawCopy("colz"); // creates all axes gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn /* TPaletteAxis * paletteemityypsp = (TPaletteAxis *) hemityypspcopy->GetListOfFunctions()->FindObject("palette"); paletteemityypsp->SetX1NDC(0.86); paletteemityypsp->SetX2NDC(0.90); paletteemityypsp->SetY1NDC(0.2); paletteemityypsp->SetY2NDC(0.8);*/ c46->Modified(); c46->Update(); TLegend* leghemityypsp = new TLegend(0.65, 0.7, .75, .75); leghemityypsp->SetHeader("Legend"); leghemityypsp->SetNColumns(1); leghemityypsp->AddEntry(leghemityypsp, "MC", "l"); leghemityypsp->Draw(); gPad->Update(); TPaveStats *statshemityypsp = (TPaveStats*)hemityypsp->GetListOfFunctions()->FindObject("stats"); statshemityypsp->SetTextColor(kBlue); statshemityypsp->SetX1NDC(0.80); statshemityypsp->SetX2NDC(0.98); statshemityypsp->SetY1NDC(0.77); statshemityypsp->SetY2NDC(0.92); gPad->Update(); c46->Print(myplothemityypsp); delete c46; /* TCanvas *c40 = new TCanvas("c40",canvtitle,1280,1024); ts->Draw(Form("InvariantMass >> htemp(100, 0., 0.)")); ts->GetHistogram()->SetTitle(cdnameinvmasssp); ts->SetScanField(0); TH1F *htempinvmasssp= (TH1F*)gPad->GetPrimitive("htemp"); htempinvmasssp->GetXaxis()->SetTitle(invmassxname); htempinvmasssp->GetYaxis()->SetTitle(countyname); htempinvmasssp->GetYaxis()->SetTitleSize(c_YTitleSize); htempinvmasssp->GetYaxis()->SetTitleFont(c_YTitleFont); htempinvmasssp->GetYaxis()->SetTitleOffset(c_YTitleOffset); htempinvmasssp->GetYaxis()->SetLabelFont(c_YLabelFont); htempinvmasssp->GetYaxis()->SetLabelSize(c_YLabelSize); htempinvmasssp->GetXaxis()->SetTitleSize(c_XTitleSize); htempinvmasssp->GetXaxis()->SetTitleFont(c_XTitleFont); htempinvmasssp->GetXaxis()->SetTitleOffset(c_XTitleOffset); htempinvmasssp->GetXaxis()->SetLabelFont(c_XLabelFont); htempinvmasssp->GetXaxis()->SetLabelSize(c_XLabelSize); htempinvmasssp->SetFillStyle(1001); htempinvmasssp->SetFillColorAlpha(kBlue, fillcolor); htempinvmasssp->Draw(); htempinvmasssp->SetName(htempname); gPad->Modified(); gPad->Update(); // make sure it's really (re)drawn c40->Update(); TLegend* leginvmasssp = new TLegend(0.25, 0.7, .35, .75); leginvmasssp->SetHeader("Legend"); leginvmasssp->SetNColumns(1); leginvmasssp->AddEntry(htempinvmasssp, "MC", "l"); leginvmasssp->Draw(); c40->Update(); gPad->Modified(); gPad->Update(); TPaveStats *statsinvmasssp = (TPaveStats*)htempinvmasssp->GetListOfFunctions()->FindObject("stats"); statsinvmasssp->SetTextColor(kBlue); statsinvmasssp->SetX1NDC(0.80); statsinvmasssp->SetX2NDC(0.98); statsinvmasssp->SetY1NDC(0.77); statsinvmasssp->SetY2NDC(0.92); statsinvmasssp->DrawClone(); gPad->Update(); c40->Print(myplotinvmasssp); delete c40; */ } }