Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:10:58

0001 // ----------------------------------------------------------------------------
0002 // 'QuickDeltaPtExtractor.C'
0003 // Derek Anderson
0004 // 04.25.2023
0005 //
0006 // Quickly apply cuts to and extract plots of the track
0007 // DeltaPt/Pt from the track evaluator.
0008 // ----------------------------------------------------------------------------
0009 
0010 // standard c includes
0011 #include <iostream>
0012 // root includes
0013 #include "TH1.h"
0014 #include "TH2.h"
0015 #include "TF1.h"
0016 #include "TPad.h"
0017 #include "TFile.h"
0018 #include "TLine.h"
0019 #include "TGraph.h"
0020 #include "TError.h"
0021 #include "TString.h"
0022 #include "TNtuple.h"
0023 #include "TLegend.h"
0024 #include "TPaveText.h"
0025 #include "TDirectory.h"
0026 
0027 using namespace std;
0028 
0029 // global constants
0030 static const Ssiz_t  NTxt     = 3;
0031 static const Ssiz_t  NPad     = 2;
0032 static const Ssiz_t  NPar     = 3;
0033 static const Ssiz_t  NVtx     = 4;
0034 static const Ssiz_t  NRange   = 2;
0035 static const Ssiz_t  NProj    = 8;
0036 static const Ssiz_t  NTrkCuts = 6;
0037 static const Ssiz_t  NDPtCuts = 7;
0038 static const Ssiz_t  NSigCuts = 5;
0039 static const TString SInTrack = "ntp_track";
0040 static const TString SInTruth = "ntp_gtrack";
0041 
0042 // default parameters
0043 static const TString SInDef  = "input/embed_only/final_merge/sPhenixG4_forPtCheck_embedScanOn_embedOnly.pt2040n100pim.d8m5y2023.root";
0044 static const TString SOutDef = "varyDeltaPtCut.withPtDependentDeltaPtCut.pt2040n100pim.d10m5y2023.root";
0045 
0046 
0047 
0048 void QuickDeltaPtExtractor(const TString sInput = SInDef, const TString sOutput = SOutDef) {
0049 
0050   // lower verbosity
0051   gErrorIgnoreLevel = kError;
0052   cout << "\n  Beginning delta-pt extractor script..." << endl;
0053 
0054   // cut parameters
0055   const UInt_t   nInttTrkMin          = 1;
0056   const UInt_t   nMVtxTrkMin          = 2;
0057   const UInt_t   nTpcTrkMin           = 35;
0058   const Double_t qualTrkMax           = 10.;
0059   const Double_t vzTrkMax             = 10.;
0060   const Double_t ptTrkMin             = 0.1;
0061   const Double_t ptDeltaMax[NDPtCuts] = {0.5, 0.25, 0.1, 0.05, 0.03, 0.02, 0.01};
0062   const Double_t ptDeltaSig[NSigCuts] = {1.,  1.5,  2.,  2.5,  3.};
0063   const Double_t normRange[NRange]    = {0.2, 1.2};
0064 
0065   // histogram parameters
0066   const TString sPtTrueBase          = "PtTrue";
0067   const TString sPtRecoBase          = "PtReco";
0068   const TString sPtFracBase          = "PtFrac";
0069   const TString sPtDeltaBase         = "DeltaPt";
0070   const TString sPtTrkTruBase        = "PtTrkTruth";
0071   const TString sPtProjBase          = "DeltaPtProj";
0072   const TString sRejCutBase          = "Reject_flatDPtCut";
0073   const TString sRejSigBase          = "Reject_sigmaCut";
0074   const TString sMuHiBase            = "MeanPlusSigma";
0075   const TString sMuLoBase            = "MeanMinusSigma";
0076   const TString sSigBase             = "ProjectionSigma";
0077   const TString sMuBase              = "ProjectionMean";
0078   const TString sEffBase             = "Efficiency";
0079   const TString sProjSuffix[NProj]   = {"_pt05",    "_pt1",      "_pt2",     "_pt5",      "_pt10",  "_pt20",  "_pt30", "_pt40"}; 
0080   const TString sDPtSuffix[NDPtCuts] = {"_dPt50",   "_dPt25",    "_dPt10",   "_dPt05",    "_dPt03", "_dPt02", "_dPt01"};
0081   const TString sSigSuffix[NSigCuts] = {"_sigDPt1", "_sidDpt15", "_sigDPt2", "_sigDPt25", "_sigDPt3"};
0082 
0083   // plot parameters
0084   const UInt_t  iCutToDraw     = NDPtCuts - 3;
0085   const UInt_t  iSigToDraw     = NSigCuts - 3;
0086   const UInt_t  nEffRebin      = 5;
0087   const Bool_t  doEffRebin     = true;
0088   const TString sBeforeTitle   = "Before #Deltap_{T}/p_{T} cuts";
0089   const TString sAfterCutTitle = "After #Deltap_{T}/p_{T} < 0.03 cut";
0090   const TString sAfterSigTitle = "After 2 #times #sigma(#Deltap_{T}/p_{T}) cut";
0091 
0092   // histogram text parameters
0093   const TString sTitle        = "";
0094   const TString sCounts       = "counts";
0095   const TString sPtTrueAxis   = "p_{T}^{true} [GeV/c]";
0096   const TString sPtRecoAxis   = "p_{T}^{reco} [GeV/c]";
0097   const TString sPtFracAxis   = "p_{T}^{reco} / p_{T}^{true}";
0098   const TString sPtDeltaAxis  = "#Deltap_{T} / p_{T}^{reco}";
0099   const TString sDeltaCutAxis = "max #Deltap_{T} / p_{T}^{reco}";
0100   const TString sSigmaCutAxis = "n #times #sigma(#Deltap_{T} / p_{T}^{reco})";
0101   const TString sSigProjAxis  = "#sigma(#Deltap_{T} / p_{T}^{reco})";
0102   const TString sMuProjAxis   = "#mu(#Deltap_{T} / p_{T}^{reco}) #pm (n #times #sigma(#Deltap_{T} / p_{T}^{reco}))";
0103   const TString sRejectAxis   = "rejection factor";
0104   const TString sEffAxis      = "#epsilon_{trk}";
0105 
0106   // sigma calculation parameters
0107   const Double_t ptProj[NProj]         = {0.5, 1., 2., 5., 10., 20., 30., 40.};
0108   const Double_t sigHiGuess[NPar]      = {1., -1., 1.};
0109   const Double_t sigLoGuess[NPar]      = {1., -1., 1.};
0110   const Double_t deltaFitRange[NRange] = {0.,  0.1};
0111   const Double_t ptFitRange[NRange]    = {0.5, 40.};
0112 
0113   // histogram style parameters
0114   const UInt_t  fColTrue(923);
0115   const UInt_t  fColPure(923);
0116   const UInt_t  fColTrk(809);
0117   const UInt_t  fMarTrue(20);
0118   const UInt_t  fMarPure(20);
0119   const UInt_t  fMarTrk(46);
0120   const UInt_t  fColProj[NProj]     = {799, 633, 899, 617, 879, 859, 839, 819};
0121   const UInt_t  fMarProj[NProj]     = {20,  22,  23,  21,  33,  34,  47,  20};
0122   const UInt_t  fColCut[NDPtCuts]   = {899, 909, 879, 889, 859, 869, 839};
0123   const UInt_t  fMarCut[NDPtCuts]   = {24,  26,  32,  25,  27,  28,  30};
0124   const Float_t rPtRange[NRange]    = {0., 60.};
0125   const Float_t rFracRange[NRange]  = {0., 4.};
0126   const Float_t rDeltaRange[NRange] = {0., 0.1};
0127 
0128   // graph/fit style parameters
0129   const UInt_t fColFit[NProj]       = {803, 636, 893, 620, 883, 863, 843, 813};
0130   const UInt_t fColSigFit[NSigCuts] = {893, 903, 873, 883, 863};
0131   const UInt_t fColSig[NSigCuts]    = {899, 909, 879, 889, 859};
0132   const UInt_t fMarSig[NSigCuts]    = {24,  26,  32,  25,  27};
0133 
0134   // legend parameters
0135   const TString sLegTrue("truth");
0136   const TString sLegTrack("tracks (w/ cuts)");
0137   const TString sLegMu("Mean #Deltap_{T} / p_{T}^{reco} (n = 0)");
0138   const TString sInfo[NTxt] = {
0139     "#bf{#it{sPHENIX}} Simulation",
0140     "100 #pi^{-}/event, p_{T} #in (20, 40) GeV/c",
0141     "#bf{Only #pi^{-}}"
0142   };
0143   const TString sLegProj[NProj] = {
0144     "p_{T}^{reco} = 0.5 GeV/c",
0145     "p_{T}^{reco} = 1 GeV/c",
0146     "p_{T}^{reco} = 2 GeV/c",
0147     "p_{T}^{reco} = 5 GeV/c",
0148     "p_{T}^{reco} = 10 GeV/c",
0149     "p_{T}^{reco} = 20 GeV/c",
0150     "p_{T}^{reco} = 30 GeV/c",
0151     "p_{T}^{reco} = 40 GeV/c"
0152   };
0153   const TString sLegCut[NDPtCuts] = {
0154     "#Deltap_{T} / p_{T}^{reco} < 0.5",
0155     "#Deltap_{T} / p_{T}^{reco} < 0.25",
0156     "#Deltap_{T} / p_{T}^{reco} < 0.1",
0157     "#Deltap_{T} / p_{T}^{reco} < 0.05",
0158     "#Deltap_{T} / p_{T}^{reco} < 0.03",
0159     "#Deltap_{T} / p_{T}^{reco} < 0.02",
0160     "#Deltap_{T} / p_{T}^{reco} < 0.01"
0161   };
0162   const TString sLegProjSig[NSigCuts] = {
0163     "n = 1",
0164     "n = 1.5",
0165     "n = 2",
0166     "n = 2.5",
0167     "n = 3"
0168   };
0169   const TString sLegDelta[NSigCuts] = {
0170     "1 #times #sigma(#Deltap_{T} / p_{T}^{reco})",
0171     "1.5 #times #sigma(#Deltap_{T} / p_{T}^{reco})",
0172     "2 #times #sigma(#Deltap_{T} / p_{T}^{reco})",
0173     "2.5 #times #sigma(#Deltap_{T} / p_{T}^{reco})",
0174     "3 #times #sigma(#Deltap_{T} / p_{T}^{reco})"
0175   };
0176   const TString sLegSig[NSigCuts] = {
0177     "#Deltap_{T} / p_{T}^{reco} #in 1 #times sigma(#Deltap_{T} / p_{T}^{reco})",
0178     "#Deltap_{T} / p_{T}^{reco} #in 1.5 #times sigma(#Deltap_{T} / p_{T}^{reco})",
0179     "#Deltap_{T} / p_{T}^{reco} #in 2 #times sigma(#Deltap_{T} / p_{T}^{reco})",
0180     "#Deltap_{T} / p_{T}^{reco} #in 2.5 #times sigma(#Deltap_{T} / p_{T}^{reco})",
0181     "#Deltap_{T} / p_{T}^{reco} #in 3 #times sigma(#Deltap_{T} / p_{T}^{reco})"
0182   };
0183   const TString sTrkCuts[NTrkCuts] = {
0184     "|v_{z}| < 10 cm",
0185     "N_{hit}^{intt} #geq 1",
0186     "N_{hit}^{mvtx} > 2",
0187     "N_{hit}^{tpc} > 35",
0188     "p_{T}^{reco} > 0.1 GeV/c",
0189     "quality < 10"
0190   };
0191 
0192   // open files
0193   TFile *fOutput = new TFile(sOutput.Data(), "recreate");
0194   TFile *fInput  = new TFile(sInput.Data(),  "read");
0195   if (!fInput || !fOutput) {
0196     cerr << "PANIC: couldn't open a file!\n"
0197          << "       fInput  = " << fInput  << "\n"
0198          << "       fOutput = " << fOutput << "\n"
0199          << endl;
0200     return;
0201   }
0202   cout << "    Opened files." << endl;
0203 
0204   // grab input tuples
0205   TNtuple *ntTrack = (TNtuple*) fInput -> Get(SInTrack.Data());
0206   TNtuple *ntTruth = (TNtuple*) fInput -> Get(SInTruth.Data());
0207   if (!ntTrack || !ntTruth) {
0208     cerr << "PANIC: couldn't grab aninput tuple!\n"
0209          << "       ntTrack = " << ntTrack << "\n"
0210          << "       ntTruth = " << ntTruth << "\n"
0211          << endl;
0212     return;
0213   }
0214   cout << "    Grabbed input tuples." << endl;
0215 
0216   // declare track tuple addresses
0217   Float_t trk_event;
0218   Float_t trk_seed;
0219   Float_t trk_trackID;
0220   Float_t trk_crossing;
0221   Float_t trk_px;
0222   Float_t trk_py;
0223   Float_t trk_pz;
0224   Float_t trk_pt;
0225   Float_t trk_eta;
0226   Float_t trk_phi;
0227   Float_t trk_deltapt;
0228   Float_t trk_deltaeta;
0229   Float_t trk_deltaphi;
0230   Float_t trk_charge;
0231   Float_t trk_quality;
0232   Float_t trk_chisq;
0233   Float_t trk_ndf;
0234   Float_t trk_nhits;
0235   Float_t trk_nmaps;
0236   Float_t trk_nintt;
0237   Float_t trk_ntpc;
0238   Float_t trk_nmms;
0239   Float_t trk_ntpc1;
0240   Float_t trk_ntpc11;
0241   Float_t trk_ntpc2;
0242   Float_t trk_ntpc3;
0243   Float_t trk_nlmaps;
0244   Float_t trk_nlintt;
0245   Float_t trk_nltpc;
0246   Float_t trk_nlmms;
0247   Float_t trk_layers;
0248   Float_t trk_vertexID;
0249   Float_t trk_vx;
0250   Float_t trk_vy;
0251   Float_t trk_vz;
0252   Float_t trk_dca2d;
0253   Float_t trk_dca2dsigma;
0254   Float_t trk_dca3dxy;
0255   Float_t trk_dca3dxysigma;
0256   Float_t trk_dca3dz;
0257   Float_t trk_dca3dzsigma;
0258   Float_t trk_pcax;
0259   Float_t trk_pcay;
0260   Float_t trk_pcaz;
0261   Float_t trk_gtrackID;
0262   Float_t trk_gflavor;
0263   Float_t trk_gnhits;
0264   Float_t trk_gnmaps;
0265   Float_t trk_gnintt;
0266   Float_t trk_gntpc;
0267   Float_t trk_gnmms;
0268   Float_t trk_gnlmaps;
0269   Float_t trk_gnlintt;
0270   Float_t trk_gnltpc;
0271   Float_t trk_gnlmms;
0272   Float_t trk_gpx;
0273   Float_t trk_gpy;
0274   Float_t trk_gpz;
0275   Float_t trk_gpt;
0276   Float_t trk_geta;
0277   Float_t trk_gphi;
0278   Float_t trk_gvx;
0279   Float_t trk_gvy;
0280   Float_t trk_gvz;
0281   Float_t trk_gvt;
0282   Float_t trk_gfpx;
0283   Float_t trk_gfpy;
0284   Float_t trk_gfpz;
0285   Float_t trk_gfx;
0286   Float_t trk_gfy;
0287   Float_t trk_gfz;
0288   Float_t trk_gembed;
0289   Float_t trk_gprimary;
0290   Float_t trk_nfromtruth;
0291   Float_t trk_nwrong;
0292   Float_t trk_ntrumaps;
0293   Float_t trk_ntruintt;
0294   Float_t trk_ntrutpc;
0295   Float_t trk_ntrumms;
0296   Float_t trk_ntrutpc1;
0297   Float_t trk_ntrutpc11;
0298   Float_t trk_ntrutpc2;
0299   Float_t trk_ntrutpc3;
0300   Float_t trk_layersfromtruth;
0301   Float_t trk_nhittpcall;
0302   Float_t trk_nhittpcin;
0303   Float_t trk_nhittpcmid;
0304   Float_t trk_nhittpcout;
0305   Float_t trk_nclusall;
0306   Float_t trk_nclustpc;
0307   Float_t trk_nclusintt;
0308   Float_t trk_nclusmaps;
0309   Float_t trk_nclusmms;
0310 
0311   // declare truth tuple addresses
0312   Float_t tru_event;
0313   Float_t tru_seed;
0314   Float_t tru_gntracks;
0315   Float_t tru_gtrackID;
0316   Float_t tru_gflavor;
0317   Float_t tru_gnhits;
0318   Float_t tru_gnmaps;
0319   Float_t tru_gnintt;
0320   Float_t tru_gnmms;
0321   Float_t tru_gnintt1;
0322   Float_t tru_gnintt2;
0323   Float_t tru_gnintt3;
0324   Float_t tru_gnintt4;
0325   Float_t tru_gnintt5;
0326   Float_t tru_gnintt6;
0327   Float_t tru_gnintt7;
0328   Float_t tru_gnintt8;
0329   Float_t tru_gntpc;
0330   Float_t tru_gnlmaps;
0331   Float_t tru_gnlintt;
0332   Float_t tru_gnltpc;
0333   Float_t tru_gnlmms;
0334   Float_t tru_gpx;
0335   Float_t tru_gpy;
0336   Float_t tru_gpz;
0337   Float_t tru_gpt;
0338   Float_t tru_geta;
0339   Float_t tru_gphi;
0340   Float_t tru_gvx;
0341   Float_t tru_gvy;
0342   Float_t tru_gvz;
0343   Float_t tru_gvt;
0344   Float_t tru_gfpx;
0345   Float_t tru_gfpy;
0346   Float_t tru_gfpz;
0347   Float_t tru_gfx;
0348   Float_t tru_gfy;
0349   Float_t tru_gfz;
0350   Float_t tru_gembed;
0351   Float_t tru_gprimary;
0352   Float_t tru_trackID;
0353   Float_t tru_px;
0354   Float_t tru_py;
0355   Float_t tru_pz;
0356   Float_t tru_pt;
0357   Float_t tru_eta;
0358   Float_t tru_phi;
0359   Float_t tru_deltapt;
0360   Float_t tru_deltaeta;
0361   Float_t tru_deltaphi;
0362   Float_t tru_charge;
0363   Float_t tru_quality;
0364   Float_t tru_chisq;
0365   Float_t tru_ndf;
0366   Float_t tru_nhits;
0367   Float_t tru_layers;
0368   Float_t tru_nmaps;
0369   Float_t tru_nintt;
0370   Float_t tru_ntpc;
0371   Float_t tru_nmms;
0372   Float_t tru_ntpc1;
0373   Float_t tru_ntpc11;
0374   Float_t tru_ntpc2;
0375   Float_t tru_ntpc3;
0376   Float_t tru_nlmaps;
0377   Float_t tru_nlintt;
0378   Float_t tru_nltpc;
0379   Float_t tru_nlmms;
0380   Float_t tru_vertexID;
0381   Float_t tru_vx;
0382   Float_t tru_vy;
0383   Float_t tru_vz;
0384   Float_t tru_dca2d;
0385   Float_t tru_dca2dsigma;
0386   Float_t tru_dca3dxy;
0387   Float_t tru_dca3dxysigma;
0388   Float_t tru_dca3dz;
0389   Float_t tru_dca3dzsigma;
0390   Float_t tru_pcax;
0391   Float_t tru_pcay;
0392   Float_t tru_pcaz;
0393   Float_t tru_nfromtruth;
0394   Float_t tru_nwrong;
0395   Float_t tru_ntrumaps;
0396   Float_t tru_ntruintt;
0397   Float_t tru_ntrutpc;
0398   Float_t tru_ntrumms;
0399   Float_t tru_ntrutpc1;
0400   Float_t tru_ntrutpc11;
0401   Float_t tru_ntrutpc2;
0402   Float_t tru_ntrutpc3;
0403   Float_t tru_layersfromtruth;
0404   Float_t tru_nhittpcall;
0405   Float_t tru_nhittpcin;
0406   Float_t tru_nhittpcmid;
0407   Float_t tru_nhittpcout;
0408   Float_t tru_nclusall;
0409   Float_t tru_nclustpc;
0410   Float_t tru_nclusintt;
0411   Float_t tru_nclusmaps;
0412   Float_t tru_nclusmms;
0413 
0414   // set track branch addresses
0415   ntTrack -> SetBranchAddress("event",           &trk_event);
0416   ntTrack -> SetBranchAddress("seed",            &trk_seed);
0417   ntTrack -> SetBranchAddress("trackID",         &trk_trackID);
0418   ntTrack -> SetBranchAddress("crossing",        &trk_crossing);
0419   ntTrack -> SetBranchAddress("px",              &trk_px);
0420   ntTrack -> SetBranchAddress("py",              &trk_py);
0421   ntTrack -> SetBranchAddress("pz",              &trk_pz);
0422   ntTrack -> SetBranchAddress("pt",              &trk_pt);
0423   ntTrack -> SetBranchAddress("eta",             &trk_eta);
0424   ntTrack -> SetBranchAddress("phi",             &trk_phi);
0425   ntTrack -> SetBranchAddress("deltapt",         &trk_deltapt);
0426   ntTrack -> SetBranchAddress("deltaeta",        &trk_deltaeta);
0427   ntTrack -> SetBranchAddress("deltaphi",        &trk_deltaphi);
0428   ntTrack -> SetBranchAddress("charge",          &trk_charge);
0429   ntTrack -> SetBranchAddress("quality",         &trk_quality);
0430   ntTrack -> SetBranchAddress("chisq",           &trk_chisq);
0431   ntTrack -> SetBranchAddress("ndf",             &trk_ndf);
0432   ntTrack -> SetBranchAddress("nhits",           &trk_nhits);
0433   ntTrack -> SetBranchAddress("nmaps",           &trk_nmaps);
0434   ntTrack -> SetBranchAddress("nintt",           &trk_nintt);
0435   ntTrack -> SetBranchAddress("ntpc",            &trk_ntpc);
0436   ntTrack -> SetBranchAddress("nmms",            &trk_nmms);
0437   ntTrack -> SetBranchAddress("ntpc1",           &trk_ntpc1);
0438   ntTrack -> SetBranchAddress("ntpc11",          &trk_ntpc11);
0439   ntTrack -> SetBranchAddress("ntpc2",           &trk_ntpc2);
0440   ntTrack -> SetBranchAddress("ntpc3",           &trk_ntpc3);
0441   ntTrack -> SetBranchAddress("nlmaps",          &trk_nlmaps);
0442   ntTrack -> SetBranchAddress("nlintt",          &trk_nlintt);
0443   ntTrack -> SetBranchAddress("nltpc",           &trk_nltpc);
0444   ntTrack -> SetBranchAddress("nlmms",           &trk_nlmms);
0445   ntTrack -> SetBranchAddress("layers",          &trk_layers);
0446   ntTrack -> SetBranchAddress("vertexID",        &trk_vertexID);
0447   ntTrack -> SetBranchAddress("vx",              &trk_vx);
0448   ntTrack -> SetBranchAddress("vy",              &trk_vy);
0449   ntTrack -> SetBranchAddress("vz",              &trk_vz);
0450   ntTrack -> SetBranchAddress("dca2d",           &trk_dca2d);
0451   ntTrack -> SetBranchAddress("dca2dsigma",      &trk_dca2dsigma);
0452   ntTrack -> SetBranchAddress("dca3dxy",         &trk_dca3dxy);
0453   ntTrack -> SetBranchAddress("dca3dxysigma",    &trk_dca3dxysigma);
0454   ntTrack -> SetBranchAddress("dca3dz",          &trk_dca3dz);
0455   ntTrack -> SetBranchAddress("dca3dzsigma",     &trk_dca3dzsigma);
0456   ntTrack -> SetBranchAddress("pcax",            &trk_pcax);
0457   ntTrack -> SetBranchAddress("pcay",            &trk_pcay);
0458   ntTrack -> SetBranchAddress("pcaz",            &trk_pcaz);
0459   ntTrack -> SetBranchAddress("gtrackID",        &trk_gtrackID);
0460   ntTrack -> SetBranchAddress("gflavor",         &trk_gflavor);
0461   ntTrack -> SetBranchAddress("gnhits",          &trk_gnhits);
0462   ntTrack -> SetBranchAddress("gnmaps",          &trk_gnmaps);
0463   ntTrack -> SetBranchAddress("gnintt",          &trk_gnintt);
0464   ntTrack -> SetBranchAddress("gntpc",           &trk_gntpc);
0465   ntTrack -> SetBranchAddress("gnmms",           &trk_gnmms);
0466   ntTrack -> SetBranchAddress("gnlmaps",         &trk_gnlmaps);
0467   ntTrack -> SetBranchAddress("gnlintt",         &trk_gnlintt);
0468   ntTrack -> SetBranchAddress("gnltpc",          &trk_gnltpc);
0469   ntTrack -> SetBranchAddress("gnlmms",          &trk_gnlmms);
0470   ntTrack -> SetBranchAddress("gpx",             &trk_gpx);
0471   ntTrack -> SetBranchAddress("gpy",             &trk_gpy);
0472   ntTrack -> SetBranchAddress("gpz",             &trk_gpz);
0473   ntTrack -> SetBranchAddress("gpt",             &trk_gpt);
0474   ntTrack -> SetBranchAddress("geta",            &trk_geta);
0475   ntTrack -> SetBranchAddress("gphi",            &trk_gphi);
0476   ntTrack -> SetBranchAddress("gvx",             &trk_gvx);
0477   ntTrack -> SetBranchAddress("gvy",             &trk_gvy);
0478   ntTrack -> SetBranchAddress("gvz",             &trk_gvz);
0479   ntTrack -> SetBranchAddress("gvt",             &trk_gvt);
0480   ntTrack -> SetBranchAddress("gfpx",            &trk_gfpx);
0481   ntTrack -> SetBranchAddress("gfpy",            &trk_gfpy);
0482   ntTrack -> SetBranchAddress("gfpz",            &trk_gfpz);
0483   ntTrack -> SetBranchAddress("gfx",             &trk_gfx);
0484   ntTrack -> SetBranchAddress("gfy",             &trk_gfy);
0485   ntTrack -> SetBranchAddress("gfz",             &trk_gfz);
0486   ntTrack -> SetBranchAddress("gembed",          &trk_gembed);
0487   ntTrack -> SetBranchAddress("gprimary",        &trk_gprimary);
0488   ntTrack -> SetBranchAddress("nfromtruth",      &trk_nfromtruth);
0489   ntTrack -> SetBranchAddress("nwrong",          &trk_nwrong);
0490   ntTrack -> SetBranchAddress("ntrumaps",        &trk_ntrumaps);
0491   ntTrack -> SetBranchAddress("ntruintt",        &trk_ntruintt);
0492   ntTrack -> SetBranchAddress("ntrutpc",         &trk_ntrutpc);
0493   ntTrack -> SetBranchAddress("ntrumms",         &trk_ntrumms);
0494   ntTrack -> SetBranchAddress("ntrutpc1",        &trk_ntrutpc1);
0495   ntTrack -> SetBranchAddress("ntrutpc11",       &trk_ntrutpc11);
0496   ntTrack -> SetBranchAddress("ntrutpc2",        &trk_ntrutpc2);
0497   ntTrack -> SetBranchAddress("ntrutpc3",        &trk_ntrutpc3);
0498   ntTrack -> SetBranchAddress("layersfromtruth", &trk_layersfromtruth);
0499   ntTrack -> SetBranchAddress("nhittpcall",      &trk_nhittpcall);
0500   ntTrack -> SetBranchAddress("nhittpcin",       &trk_nhittpcin);
0501   ntTrack -> SetBranchAddress("nhittpcmid",      &trk_nhittpcmid);
0502   ntTrack -> SetBranchAddress("nhittpcout",      &trk_nhittpcout);
0503   ntTrack -> SetBranchAddress("nclusall",        &trk_nclusall);
0504   ntTrack -> SetBranchAddress("nclustpc",        &trk_nclustpc);
0505   ntTrack -> SetBranchAddress("nclusintt",       &trk_nclusintt);
0506   ntTrack -> SetBranchAddress("nclusmaps",       &trk_nclusmaps);
0507   ntTrack -> SetBranchAddress("nclusmms",        &trk_nclusmms);
0508 
0509   // Set branch addresses.
0510   ntTruth -> SetBranchAddress("event",           &tru_event);
0511   ntTruth -> SetBranchAddress("seed",            &tru_seed);
0512   ntTruth -> SetBranchAddress("gntracks",        &tru_gntracks);
0513   ntTruth -> SetBranchAddress("gtrackID",        &tru_gtrackID);
0514   ntTruth -> SetBranchAddress("gflavor",         &tru_gflavor);
0515   ntTruth -> SetBranchAddress("gnhits",          &tru_gnhits);
0516   ntTruth -> SetBranchAddress("gnmaps",          &tru_gnmaps);
0517   ntTruth -> SetBranchAddress("gnintt",          &tru_gnintt);
0518   ntTruth -> SetBranchAddress("gnmms",           &tru_gnmms);
0519   ntTruth -> SetBranchAddress("gnintt1",         &tru_gnintt1);
0520   ntTruth -> SetBranchAddress("gnintt2",         &tru_gnintt2);
0521   ntTruth -> SetBranchAddress("gnintt3",         &tru_gnintt3);
0522   ntTruth -> SetBranchAddress("gnintt4",         &tru_gnintt4);
0523   ntTruth -> SetBranchAddress("gnintt5",         &tru_gnintt5);
0524   ntTruth -> SetBranchAddress("gnintt6",         &tru_gnintt6);
0525   ntTruth -> SetBranchAddress("gnintt7",         &tru_gnintt7);
0526   ntTruth -> SetBranchAddress("gnintt8",         &tru_gnintt8);
0527   ntTruth -> SetBranchAddress("gntpc",           &tru_gntpc);
0528   ntTruth -> SetBranchAddress("gnlmaps",         &tru_gnlmaps);
0529   ntTruth -> SetBranchAddress("gnlintt",         &tru_gnlintt);
0530   ntTruth -> SetBranchAddress("gnltpc",          &tru_gnltpc);
0531   ntTruth -> SetBranchAddress("gnlmms",          &tru_gnlmms);
0532   ntTruth -> SetBranchAddress("gpx",             &tru_gpx);
0533   ntTruth -> SetBranchAddress("gpy",             &tru_gpy);
0534   ntTruth -> SetBranchAddress("gpz",             &tru_gpz);
0535   ntTruth -> SetBranchAddress("gpt",             &tru_gpt);
0536   ntTruth -> SetBranchAddress("geta",            &tru_geta);
0537   ntTruth -> SetBranchAddress("gphi",            &tru_gphi);
0538   ntTruth -> SetBranchAddress("gvx",             &tru_gvx);
0539   ntTruth -> SetBranchAddress("gvy",             &tru_gvy);
0540   ntTruth -> SetBranchAddress("gvz",             &tru_gvz);
0541   ntTruth -> SetBranchAddress("gvt",             &tru_gvt);
0542   ntTruth -> SetBranchAddress("gfpx",            &tru_gfpx);
0543   ntTruth -> SetBranchAddress("gfpy",            &tru_gfpy);
0544   ntTruth -> SetBranchAddress("gfpz",            &tru_gfpz);
0545   ntTruth -> SetBranchAddress("gfx",             &tru_gfx);
0546   ntTruth -> SetBranchAddress("gfy",             &tru_gfy);
0547   ntTruth -> SetBranchAddress("gfz",             &tru_gfz);
0548   ntTruth -> SetBranchAddress("gembed",          &tru_gembed);
0549   ntTruth -> SetBranchAddress("gprimary",        &tru_gprimary);
0550   ntTruth -> SetBranchAddress("trackID",         &tru_trackID);
0551   ntTruth -> SetBranchAddress("px",              &tru_px);
0552   ntTruth -> SetBranchAddress("py",              &tru_py);
0553   ntTruth -> SetBranchAddress("pz",              &tru_pz);
0554   ntTruth -> SetBranchAddress("pt",              &tru_pt);
0555   ntTruth -> SetBranchAddress("eta",             &tru_eta);
0556   ntTruth -> SetBranchAddress("phi",             &tru_phi);
0557   ntTruth -> SetBranchAddress("deltapt",         &tru_deltapt);
0558   ntTruth -> SetBranchAddress("deltaeta",        &tru_deltaeta);
0559   ntTruth -> SetBranchAddress("deltaphi",        &tru_deltaphi);
0560   ntTruth -> SetBranchAddress("charge",          &tru_charge);
0561   ntTruth -> SetBranchAddress("quality",         &tru_quality);
0562   ntTruth -> SetBranchAddress("chisq",           &tru_chisq);
0563   ntTruth -> SetBranchAddress("ndf",             &tru_ndf);
0564   ntTruth -> SetBranchAddress("nhits",           &tru_nhits);
0565   ntTruth -> SetBranchAddress("layers",          &tru_layers);
0566   ntTruth -> SetBranchAddress("nmaps",           &tru_nmaps);
0567   ntTruth -> SetBranchAddress("nintt",           &tru_nintt);
0568   ntTruth -> SetBranchAddress("ntpc",            &tru_ntpc);
0569   ntTruth -> SetBranchAddress("nmms",            &tru_nmms);
0570   ntTruth -> SetBranchAddress("ntpc1",           &tru_ntpc1);
0571   ntTruth -> SetBranchAddress("ntpc11",          &tru_ntpc11);
0572   ntTruth -> SetBranchAddress("ntpc2",           &tru_ntpc2);
0573   ntTruth -> SetBranchAddress("ntpc3",           &tru_ntpc3);
0574   ntTruth -> SetBranchAddress("nlmaps",          &tru_nlmaps);
0575   ntTruth -> SetBranchAddress("nlintt",          &tru_nlintt);
0576   ntTruth -> SetBranchAddress("nltpc",           &tru_nltpc);
0577   ntTruth -> SetBranchAddress("nlmms",           &tru_nlmms);
0578   ntTruth -> SetBranchAddress("vertexID",        &tru_vertexID);
0579   ntTruth -> SetBranchAddress("vx",              &tru_vx);
0580   ntTruth -> SetBranchAddress("vy",              &tru_vy);
0581   ntTruth -> SetBranchAddress("vz",              &tru_vz);
0582   ntTruth -> SetBranchAddress("dca2d",           &tru_dca2d);
0583   ntTruth -> SetBranchAddress("dca2dsigma",      &tru_dca2dsigma);
0584   ntTruth -> SetBranchAddress("dca3dxy",         &tru_dca3dxy);
0585   ntTruth -> SetBranchAddress("dca3dxysigma",    &tru_dca3dxysigma);
0586   ntTruth -> SetBranchAddress("dca3dz",          &tru_dca3dz);
0587   ntTruth -> SetBranchAddress("dca3dzsigma",     &tru_dca3dzsigma);
0588   ntTruth -> SetBranchAddress("pcax",            &tru_pcax);
0589   ntTruth -> SetBranchAddress("pcay",            &tru_pcay);
0590   ntTruth -> SetBranchAddress("pcaz",            &tru_pcaz);
0591   ntTruth -> SetBranchAddress("nfromtruth",      &tru_nfromtruth);
0592   ntTruth -> SetBranchAddress("nwrong",          &tru_nwrong);
0593   ntTruth -> SetBranchAddress("ntrumaps",        &tru_ntrumaps);
0594   ntTruth -> SetBranchAddress("ntruintt",        &tru_ntruintt);
0595   ntTruth -> SetBranchAddress("ntrutpc",         &tru_ntrutpc);
0596   ntTruth -> SetBranchAddress("ntrumms",         &tru_ntrumms);
0597   ntTruth -> SetBranchAddress("ntrutpc1",        &tru_ntrutpc1);
0598   ntTruth -> SetBranchAddress("ntrutpc11",       &tru_ntrutpc11);
0599   ntTruth -> SetBranchAddress("ntrutpc2",        &tru_ntrutpc2);
0600   ntTruth -> SetBranchAddress("ntrutpc3",        &tru_ntrutpc3);
0601   ntTruth -> SetBranchAddress("layersfromtruth", &tru_layersfromtruth);
0602   ntTruth -> SetBranchAddress("nhittpcall",      &tru_nhittpcall);
0603   ntTruth -> SetBranchAddress("nhittpcin",       &tru_nhittpcin);
0604   ntTruth -> SetBranchAddress("nhittpcmid",      &tru_nhittpcmid);
0605   ntTruth -> SetBranchAddress("nhittpcout",      &tru_nhittpcout);
0606   ntTruth -> SetBranchAddress("nclusall",        &tru_nclusall);
0607   ntTruth -> SetBranchAddress("nclustpc",        &tru_nclustpc);
0608   ntTruth -> SetBranchAddress("nclusintt",       &tru_nclusintt);
0609   ntTruth -> SetBranchAddress("nclusmaps",       &tru_nclusmaps);
0610   ntTruth -> SetBranchAddress("nclusmms",        &tru_nclusmms);
0611   cout << "    Set track tuple branches." << endl;
0612 
0613   // declare histograms
0614   TH1D *hEff;
0615   TH1D *hPtTruth;
0616   TH1D *hPtDelta;
0617   TH1D *hPtTrack;
0618   TH1D *hPtFrac;
0619   TH1D *hPtTrkTru;
0620   TH1D *hPtDeltaProj[NProj];
0621   TH1D *hPtDeltaCut[NDPtCuts];
0622   TH1D *hPtDeltaSig[NSigCuts];
0623   TH1D *hPtTrackCut[NDPtCuts];
0624   TH1D *hPtTrackSig[NSigCuts];
0625   TH1D *hPtFracCut[NDPtCuts];
0626   TH1D *hPtFracSig[NSigCuts];
0627   TH1D *hPtTrkTruCut[NDPtCuts];
0628   TH1D *hPtTrkTruSig[NSigCuts];
0629   TH1D *hEffCut[NDPtCuts];
0630   TH1D *hEffSig[NSigCuts];
0631 
0632   TH2D *hPtDeltaVsFrac;
0633   TH2D *hPtDeltaVsTrue;
0634   TH2D *hPtDeltaVsTrack;
0635   TH2D *hPtTrueVsTrack;
0636   TH2D *hPtDeltaVsFracCut[NDPtCuts];
0637   TH2D *hPtDeltaVsFracSig[NSigCuts];
0638   TH2D *hPtDeltaVsTrueCut[NDPtCuts];
0639   TH2D *hPtDeltaVsTrueSig[NSigCuts];
0640   TH2D *hPtDeltaVsTrackCut[NDPtCuts];
0641   TH2D *hPtDeltaVsTrackSig[NSigCuts];
0642   TH2D *hPtTrueVsTrackCut[NDPtCuts];
0643   TH2D *hPtTrueVsTrackSig[NSigCuts];
0644 
0645   // histogram binning
0646   const UInt_t  nPtBins(1000);
0647   const UInt_t  nFracBins(1000);
0648   const UInt_t  nDeltaBins(5000);
0649   const Float_t rPtBins[NRange]    = {0., 100.};
0650   const Float_t rFracBins[NRange]  = {0., 10.};
0651   const Float_t rDeltaBins[NRange] = {0., 5.};
0652 
0653   // create names
0654   TString sPtTruth("h");
0655   TString sPtDelta("h");
0656   TString sPtTrack("h");
0657   TString sPtFrac("h");
0658   TString sPtTrkTru("h");
0659   sPtTruth.Append(sPtTrueBase.Data());
0660   sPtDelta.Append(sPtDeltaBase.Data());
0661   sPtTrack.Append(sPtRecoBase.Data());
0662   sPtFrac.Append(sPtFracBase.Data());
0663   sPtTrkTru.Append(sPtTrkTruBase.Data());
0664 
0665   TString sPtDeltaVsFrac("h");
0666   TString sPtDeltaVsTrue("h");
0667   TString sPtDeltaVsTrack("h");
0668   TString sPtTrueVsTrack("h");
0669   sPtDeltaVsFrac.Append(sPtDeltaBase.Data());
0670   sPtDeltaVsTrue.Append(sPtDeltaBase.Data());
0671   sPtDeltaVsTrack.Append(sPtDeltaBase.Data());
0672   sPtTrueVsTrack.Append(sPtTrueBase.Data());
0673   sPtDeltaVsFrac.Append("Vs");
0674   sPtDeltaVsTrue.Append("Vs");
0675   sPtDeltaVsTrack.Append("Vs");
0676   sPtTrueVsTrack.Append("Vs");
0677   sPtDeltaVsFrac.Append(sPtFracBase.Data());
0678   sPtDeltaVsTrue.Append(sPtTrueBase.Data());
0679   sPtDeltaVsTrack.Append(sPtRecoBase.Data());
0680   sPtTrueVsTrack.Append(sPtRecoBase.Data());
0681 
0682   // delta-pt projection names
0683   TString sPtProj[NProj];
0684   for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
0685     sPtProj[iProj] = "h";
0686     sPtProj[iProj].Append(sPtProjBase.Data());
0687     sPtProj[iProj].Append(sProjSuffix[iProj].Data());
0688   }
0689 
0690   // flat delta-pt cut names
0691   TString sPtDeltaCut[NDPtCuts];
0692   TString sPtTrackCut[NDPtCuts];
0693   TString sPtFracCut[NDPtCuts];
0694   TString sPtTrkTruCut[NDPtCuts];
0695   TString sPtDeltaVsFracCut[NDPtCuts];
0696   TString sPtDeltaVsTrueCut[NDPtCuts];
0697   TString sPtDeltaVsTrackCut[NDPtCuts];
0698   TString sPtTrueVsTrackCut[NDPtCuts];
0699   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
0700     sPtDeltaCut[iCut]  = "h";
0701     sPtTrackCut[iCut]  = "h";
0702     sPtFracCut[iCut]   = "h";
0703     sPtTrkTruCut[iCut] = "h";
0704     sPtDeltaCut[iCut].Append(sPtDeltaBase.Data());
0705     sPtTrackCut[iCut].Append(sPtRecoBase.Data());
0706     sPtFracCut[iCut].Append(sPtFracBase.Data());
0707     sPtTrkTruCut[iCut].Append(sPtTrkTruBase.Data());
0708     sPtDeltaCut[iCut].Append(sDPtSuffix[iCut].Data());
0709     sPtTrackCut[iCut].Append(sDPtSuffix[iCut].Data());
0710     sPtFracCut[iCut].Append(sDPtSuffix[iCut].Data());
0711     sPtTrkTruCut[iCut].Append(sDPtSuffix[iCut].Data());
0712 
0713     sPtDeltaVsFracCut[iCut]  = "h";
0714     sPtDeltaVsTrueCut[iCut]  = "h";
0715     sPtDeltaVsTrackCut[iCut] = "h";
0716     sPtTrueVsTrackCut[iCut]  = "h";
0717     sPtDeltaVsFracCut[iCut].Append(sPtDeltaBase.Data());
0718     sPtDeltaVsFracCut[iCut].Append(sPtDeltaBase.Data());
0719     sPtDeltaVsTrueCut[iCut].Append(sPtDeltaBase.Data());
0720     sPtDeltaVsTrackCut[iCut].Append(sPtDeltaBase.Data());
0721     sPtTrueVsTrackCut[iCut].Append(sPtTrueBase.Data());
0722     sPtDeltaVsFracCut[iCut].Append("Vs");
0723     sPtDeltaVsTrueCut[iCut].Append("Vs");
0724     sPtDeltaVsTrackCut[iCut].Append("Vs");
0725     sPtTrueVsTrackCut[iCut].Append("Vs");
0726     sPtDeltaVsFracCut[iCut].Append(sPtFracBase.Data());
0727     sPtDeltaVsTrueCut[iCut].Append(sPtTrueBase.Data());
0728     sPtDeltaVsTrackCut[iCut].Append(sPtRecoBase.Data());
0729     sPtTrueVsTrackCut[iCut].Append(sPtRecoBase.Data());
0730     sPtDeltaVsFracCut[iCut].Append(sDPtSuffix[iCut].Data());
0731     sPtDeltaVsTrueCut[iCut].Append(sDPtSuffix[iCut].Data());
0732     sPtDeltaVsTrackCut[iCut].Append(sDPtSuffix[iCut].Data());
0733     sPtTrueVsTrackCut[iCut].Append(sDPtSuffix[iCut].Data());
0734   }
0735 
0736   // pt-dependent delta-pt cut names
0737   TString sPtDeltaSig[NSigCuts];
0738   TString sPtTrackSig[NSigCuts];
0739   TString sPtFracSig[NSigCuts];
0740   TString sPtTrkTruSig[NSigCuts];
0741   TString sPtDeltaVsFracSig[NSigCuts];
0742   TString sPtDeltaVsTrueSig[NSigCuts];
0743   TString sPtDeltaVsTrackSig[NSigCuts];
0744   TString sPtTrueVsTrackSig[NSigCuts];
0745   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
0746     sPtDeltaSig[iSig]  = "h";
0747     sPtTrackSig[iSig]  = "h";
0748     sPtFracSig[iSig]   = "h";
0749     sPtTrkTruSig[iSig] = "h";
0750     sPtDeltaSig[iSig].Append(sPtDeltaBase.Data());
0751     sPtTrackSig[iSig].Append(sPtRecoBase.Data());
0752     sPtFracSig[iSig].Append(sPtFracBase.Data());
0753     sPtTrkTruSig[iSig].Append(sPtTrkTruBase.Data());
0754     sPtDeltaSig[iSig].Append(sSigSuffix[iSig].Data());
0755     sPtTrackSig[iSig].Append(sSigSuffix[iSig].Data());
0756     sPtFracSig[iSig].Append(sSigSuffix[iSig].Data());
0757     sPtTrkTruSig[iSig].Append(sSigSuffix[iSig].Data());
0758 
0759     sPtDeltaVsFracSig[iSig]  = "h";
0760     sPtDeltaVsTrueSig[iSig]  = "h";
0761     sPtDeltaVsTrackSig[iSig] = "h";
0762     sPtTrueVsTrackSig[iSig]  = "h";
0763     sPtDeltaVsFracSig[iSig].Append(sPtDeltaBase.Data());
0764     sPtDeltaVsFracSig[iSig].Append(sPtDeltaBase.Data());
0765     sPtDeltaVsTrueSig[iSig].Append(sPtDeltaBase.Data());
0766     sPtDeltaVsTrackSig[iSig].Append(sPtDeltaBase.Data());
0767     sPtTrueVsTrackSig[iSig].Append(sPtTrueBase.Data());
0768     sPtDeltaVsFracSig[iSig].Append("Vs");
0769     sPtDeltaVsTrueSig[iSig].Append("Vs");
0770     sPtDeltaVsTrackSig[iSig].Append("Vs");
0771     sPtTrueVsTrackSig[iSig].Append("Vs");
0772     sPtDeltaVsFracSig[iSig].Append(sPtFracBase.Data());
0773     sPtDeltaVsTrueSig[iSig].Append(sPtTrueBase.Data());
0774     sPtDeltaVsTrackSig[iSig].Append(sPtRecoBase.Data());
0775     sPtTrueVsTrackSig[iSig].Append(sPtRecoBase.Data());
0776     sPtDeltaVsFracSig[iSig].Append(sSigSuffix[iSig].Data());
0777     sPtDeltaVsTrueSig[iSig].Append(sSigSuffix[iSig].Data());
0778     sPtDeltaVsTrackSig[iSig].Append(sSigSuffix[iSig].Data());
0779     sPtTrueVsTrackSig[iSig].Append(sSigSuffix[iSig].Data());
0780   }
0781 
0782   // initialize histograms
0783   hPtTruth  = new TH1D(sPtTruth.Data(),  "", nPtBins,    rPtBins[0],    rPtBins[1]);
0784   hPtDelta  = new TH1D(sPtDelta.Data(),  "", nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0785   hPtTrack  = new TH1D(sPtTrack.Data(),  "", nPtBins,    rPtBins[0],    rPtBins[1]);
0786   hPtFrac   = new TH1D(sPtFrac.Data(),   "", nFracBins,  rFracBins[0],  rFracBins[1]);
0787   hPtTrkTru = new TH1D(sPtTrkTru.Data(), "", nPtBins,    rPtBins[0],    rPtBins[1]);
0788   hPtTruth  -> Sumw2();
0789   hPtDelta  -> Sumw2();
0790   hPtTrack  -> Sumw2();
0791   hPtFrac   -> Sumw2();
0792   hPtTrkTru -> Sumw2();
0793 
0794   hPtDeltaVsFrac  = new TH2D(sPtDeltaVsFrac.Data(),  "", nFracBins, rFracBins[0], rFracBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0795   hPtDeltaVsTrue  = new TH2D(sPtDeltaVsTrue.Data(),  "", nPtBins,   rPtBins[0],   rPtBins[1],   nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0796   hPtDeltaVsTrack = new TH2D(sPtDeltaVsTrack.Data(), "", nPtBins,   rPtBins[0],   rPtBins[1],   nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0797   hPtTrueVsTrack  = new TH2D(sPtTrueVsTrack.Data(),  "", nPtBins,   rPtBins[0],   rPtBins[1],   nPtBins,    rPtBins[0],    rPtBins[1]);
0798   hPtDeltaVsFrac  -> Sumw2();
0799   hPtDeltaVsTrue  -> Sumw2();
0800   hPtDeltaVsTrack -> Sumw2();
0801   hPtTrueVsTrack  -> Sumw2();
0802 
0803   // delta-pt projection histograms
0804   for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
0805     hPtDeltaProj[iProj] = new TH1D(sPtProj[iProj].Data(), "", nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0806     hPtDeltaProj[iProj] -> Sumw2();
0807   }
0808 
0809   // flat delta-pt cut histograms
0810   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
0811     hPtDeltaCut[iCut]  = new TH1D(sPtDeltaCut[iCut].Data(),  "", nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0812     hPtTrackCut[iCut]  = new TH1D(sPtTrackCut[iCut].Data(),  "", nPtBins,    rPtBins[0],    rPtBins[1]);
0813     hPtFracCut[iCut]   = new TH1D(sPtFracCut[iCut].Data(),   "", nFracBins,  rFracBins[0],  rFracBins[1]);
0814     hPtTrkTruCut[iCut] = new TH1D(sPtTrkTruCut[iCut].Data(), "", nPtBins,    rPtBins[0],    rPtBins[1]);
0815     hPtDeltaCut[iCut]  -> Sumw2();
0816     hPtTrackCut[iCut]  -> Sumw2();
0817     hPtFracCut[iCut]   -> Sumw2();
0818     hPtTrkTruCut[iCut] -> Sumw2();
0819 
0820     hPtDeltaVsFracCut[iCut]  = new TH2D(sPtDeltaVsFracCut[iCut].Data(),  "", nFracBins, rFracBins[0], rFracBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0821     hPtDeltaVsTrueCut[iCut]  = new TH2D(sPtDeltaVsTrueCut[iCut].Data(),  "", nPtBins,   rPtBins[0],   rPtBins[1],   nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0822     hPtDeltaVsTrackCut[iCut] = new TH2D(sPtDeltaVsTrackCut[iCut].Data(), "", nPtBins,   rPtBins[0],   rPtBins[1],   nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0823     hPtTrueVsTrackCut[iCut]  = new TH2D(sPtTrueVsTrackCut[iCut].Data(),  "", nPtBins,   rPtBins[0],   rPtBins[1],   nPtBins,    rPtBins[0],    rPtBins[1]);
0824     hPtDeltaVsFracCut[iCut]  -> Sumw2();
0825     hPtDeltaVsTrueCut[iCut]  -> Sumw2();
0826     hPtDeltaVsTrackCut[iCut] -> Sumw2();
0827     hPtTrueVsTrackCut[iCut]  -> Sumw2();
0828   }
0829 
0830   // pt-dependent delta-pt cut histograms
0831   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
0832     hPtDeltaSig[iSig]  = new TH1D(sPtDeltaSig[iSig].Data(),  "", nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0833     hPtTrackSig[iSig]  = new TH1D(sPtTrackSig[iSig].Data(),  "", nPtBins,    rPtBins[0],    rPtBins[1]);
0834     hPtFracSig[iSig]   = new TH1D(sPtFracSig[iSig].Data(),   "", nFracBins,  rFracBins[0],  rFracBins[1]);
0835     hPtTrkTruSig[iSig] = new TH1D(sPtTrkTruSig[iSig].Data(), "", nPtBins,    rPtBins[0],    rPtBins[1]);
0836     hPtDeltaSig[iSig]  -> Sumw2();
0837     hPtTrackSig[iSig]  -> Sumw2();
0838     hPtFracSig[iSig]   -> Sumw2();
0839     hPtTrkTruSig[iSig] -> Sumw2();
0840 
0841     hPtDeltaVsFracSig[iSig]  = new TH2D(sPtDeltaVsFracSig[iSig].Data(),  "", nFracBins, rFracBins[0], rFracBins[1], nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0842     hPtDeltaVsTrueSig[iSig]  = new TH2D(sPtDeltaVsTrueSig[iSig].Data(),  "", nPtBins,   rPtBins[0],   rPtBins[1],   nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0843     hPtDeltaVsTrackSig[iSig] = new TH2D(sPtDeltaVsTrackSig[iSig].Data(), "", nPtBins,   rPtBins[0],   rPtBins[1],   nDeltaBins, rDeltaBins[0], rDeltaBins[1]);
0844     hPtTrueVsTrackSig[iSig]  = new TH2D(sPtTrueVsTrackSig[iSig].Data(),  "", nPtBins,   rPtBins[0],   rPtBins[1],   nPtBins,    rPtBins[0],    rPtBins[1]);
0845     hPtDeltaVsFracSig[iSig]  -> Sumw2();
0846     hPtDeltaVsTrueSig[iSig]  -> Sumw2();
0847     hPtDeltaVsTrackSig[iSig] -> Sumw2();
0848     hPtTrueVsTrackSig[iSig]  -> Sumw2();
0849   }
0850 
0851   // grab no. of entries
0852   const Long64_t nTrks = ntTrack -> GetEntries();
0853   const Long64_t nTrus = ntTruth -> GetEntries();
0854   cout << "    Beginning tuple loops: " << nTrks << " reco. tracks and " << nTrus << " particles to process" << endl;
0855 
0856   // for sigma calculatin
0857   Double_t muProj[NProj];
0858   Double_t sigProj[NProj];
0859   Double_t muHiProj[NSigCuts][NProj];
0860   Double_t muLoProj[NSigCuts][NProj];
0861   for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
0862     muProj[iProj]  = 0.;
0863     sigProj[iProj] = 0.;
0864   }
0865   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
0866     for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
0867       muHiProj[iSig][iProj] = 0.;
0868       muLoProj[iSig][iProj] = 0.;
0869     }
0870   }
0871 
0872   // for reject calculation
0873   UInt_t   nNormCut[NDPtCuts];
0874   UInt_t   nNormSig[NSigCuts];
0875   UInt_t   nWeirdCut[NDPtCuts];
0876   UInt_t   nWeirdSig[NSigCuts];
0877   Double_t rejCut[NDPtCuts];
0878   Double_t rejSig[NSigCuts];
0879   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
0880     nNormCut[iCut]  = 0;
0881     nWeirdCut[iCut] = 0;
0882     rejCut[iCut]    = 0.;
0883   }
0884   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
0885     nNormSig[iSig]  = 0;
0886     nWeirdSig[iSig] = 0;
0887     rejSig[iSig]    = 0.;
0888   }
0889   cout << "      First loop over reco. tracks:" << endl;
0890 
0891   // 1st track loop
0892   Long64_t nBytesTrk = 0;
0893   for (Long64_t iTrk = 0; iTrk < nTrks; iTrk++) {
0894 
0895     // grab entry
0896     const Long64_t bytesTrk = ntTrack -> GetEntry(iTrk);
0897     if (bytesTrk < 0.) {
0898       cerr << "WARNING: something wrong with track #" << iTrk << "! Aborting loop!" << endl;
0899       break;
0900     }
0901     nBytesTrk += bytesTrk;
0902 
0903     // announce progress
0904     const Long64_t iProgTrk = iTrk + 1;
0905     //if (iProgTrk == nTrks) {
0906     //  cout << "        Processing track " << iProgTrk << "/" << nTrks << "..." << endl;
0907     //} else {
0908     //  cout << "        Processing track " << iProgTrk << "/" << nTrks << "...\r" << flush;
0909     //}
0910 
0911     // do calculations
0912     const Double_t ptFrac  = trk_pt / trk_gpt;
0913     const Double_t ptDelta = trk_deltapt / trk_pt;
0914 
0915     // apply trk cuts
0916     const Bool_t isInZVtxCut = (abs(trk_vz) <  vzTrkMax);
0917     const Bool_t isInInttCut = (trk_nintt   >= nInttTrkMin);
0918     const Bool_t isInMVtxCut = (trk_nlmaps  >  nMVtxTrkMin);
0919     const Bool_t isInTpcCut  = (trk_ntpc    >  nTpcTrkMin);
0920     const Bool_t isInPtCut   = (trk_pt      >  ptTrkMin);
0921     const Bool_t isInQualCut = (trk_quality <  qualTrkMax);
0922     const Bool_t isGoodTrk   = (isInZVtxCut && isInInttCut && isInMVtxCut && isInTpcCut && isInPtCut && isInQualCut);
0923     if (!isGoodTrk) continue;
0924 
0925     if (trk_pt < 20) {
0926       cout << "CHECK intt = " << trk_nintt << ", mvtx = " << trk_nlmaps << ", tpc = " << trk_ntpc << ", quality = " << trk_quality << ", ptTrue = " << trk_gpt
0927            << ", dcaXY = " << trk_dca3dxy << ", dcaZ = " << trk_dca3dz << endl;
0928     }
0929 
0930     // fill histograms
0931     hPtDelta        -> Fill(ptDelta);
0932     hPtTrack        -> Fill(trk_pt);
0933     hPtFrac         -> Fill(ptFrac);
0934     hPtTrkTru       -> Fill(trk_gpt);
0935     hPtDeltaVsFrac  -> Fill(ptFrac,  ptDelta);
0936     hPtDeltaVsTrue  -> Fill(trk_gpt, ptDelta);
0937     hPtDeltaVsTrack -> Fill(trk_pt,  ptDelta);
0938     hPtTrueVsTrack  -> Fill(trk_pt,  trk_gpt);
0939 
0940     // apply delta-pt cuts
0941     const Bool_t isNormalTrk = ((ptFrac > normRange[0]) && (ptFrac < normRange[1]));
0942     for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
0943       const Bool_t isInDeltaPtCut = (ptDelta < ptDeltaMax[iCut]);
0944       if (isInDeltaPtCut) {
0945 
0946         // fill histograms
0947         hPtDeltaCut[iCut]        -> Fill(ptDelta);
0948         hPtTrackCut[iCut]        -> Fill(trk_pt);
0949         hPtFracCut[iCut]         -> Fill(ptFrac);
0950         hPtTrkTruCut[iCut]       -> Fill(trk_gpt);
0951         hPtDeltaVsFracCut[iCut]  -> Fill(ptFrac,  ptDelta);
0952         hPtDeltaVsTrueCut[iCut]  -> Fill(trk_gpt, ptDelta);
0953         hPtDeltaVsTrackCut[iCut] -> Fill(trk_pt,  ptDelta);
0954         hPtTrueVsTrackCut[iCut]  -> Fill(trk_pt,  trk_gpt);
0955 
0956         // increment counters
0957         if (isNormalTrk) {
0958           ++nNormCut[iCut];
0959         } else {
0960           ++nWeirdCut[iCut];
0961         }
0962       }
0963     }  // end delta-pt cut
0964   }  // end 1st track loop
0965   cout << "      First loop over reco. tracks finished!" << endl;
0966 
0967   // calculate flat delta-pt rejection factors
0968   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
0969     rejCut[iCut] = (Double_t) nNormCut[iCut] / (Double_t) nWeirdCut[iCut];
0970   }
0971   cout << "      Calculated flat delta-pt rejection factors." << endl;
0972 
0973   // projection fit names
0974   TString sFitProj[NProj];
0975   for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
0976     sFitProj[iProj] = "f";
0977     sFitProj[iProj].Append(sPtProjBase.Data());
0978     sFitProj[iProj].Append(sProjSuffix[iProj].Data());
0979   }
0980 
0981   // project slices of delta-pt and get sigmas
0982   const UInt_t fWidFit = 2;
0983   const UInt_t fLinFit = 1;
0984 
0985   TF1 *fPtDeltaProj[NProj];
0986   for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
0987 
0988     // do projection
0989     const UInt_t iBinProj = hPtDeltaVsTrack -> GetXaxis() -> FindBin(ptProj[iProj]);
0990     hPtDeltaProj[iProj]   = hPtDeltaVsTrack -> ProjectionY(sPtProj[iProj], iBinProj, iBinProj, "");
0991 
0992     // get initial values for fit
0993     const Float_t ampGuess = hPtDeltaProj[iProj] -> GetMaximum();
0994     const Float_t muGuess  = hPtDeltaProj[iProj] -> GetMean();
0995     const Float_t sigGuess = hPtDeltaProj[iProj] -> GetRMS();
0996 
0997     // fit with gaussian
0998     fPtDeltaProj[iProj] = new TF1(sFitProj[iProj].Data(), "gaus", deltaFitRange[0], deltaFitRange[1]);
0999     fPtDeltaProj[iProj] -> SetLineColor(fColFit[iProj]);
1000     fPtDeltaProj[iProj] -> SetLineStyle(fLinFit);
1001     fPtDeltaProj[iProj] -> SetLineWidth(fWidFit);
1002     fPtDeltaProj[iProj] -> SetParameter(0, ampGuess);
1003     fPtDeltaProj[iProj] -> SetParameter(1, muGuess);
1004     fPtDeltaProj[iProj] -> SetParameter(2, sigGuess);
1005     hPtDeltaProj[iProj] -> Fit(sFitProj[iProj].Data(), "R");
1006 
1007     // add values to arrays
1008     muProj[iProj]  = fPtDeltaProj[iProj] -> GetParameter(1);
1009     sigProj[iProj] = fPtDeltaProj[iProj] -> GetParameter(2);
1010     for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1011       muHiProj[iSig][iProj] = muProj[iProj] + (ptDeltaSig[iSig] * sigProj[iProj]);
1012       muLoProj[iSig][iProj] = muProj[iProj] - (ptDeltaSig[iSig] * sigProj[iProj]);
1013     }
1014   }  // end projection loop
1015   cout << "      Obtained delta-pt projections, fits, and sigmas." << endl;
1016 
1017   // sigma graph names
1018   TString sMuProj("gr");
1019   TString sSigProj("gr");
1020   sMuProj.Append(sMuBase.Data());
1021   sSigProj.Append(sSigBase.Data());
1022 
1023   TString sGrMuHiProj[NSigCuts];
1024   TString sGrMuLoProj[NSigCuts];
1025   TString sFnMuHiProj[NSigCuts];
1026   TString sFnMuLoProj[NSigCuts];
1027   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1028     sGrMuHiProj[iSig] = "gr";
1029     sGrMuLoProj[iSig] = "gr";
1030     sFnMuHiProj[iSig] = "f";
1031     sFnMuLoProj[iSig] = "f";
1032     sGrMuHiProj[iSig].Append(sMuHiBase.Data());
1033     sGrMuLoProj[iSig].Append(sMuLoBase.Data());
1034     sFnMuHiProj[iSig].Append(sMuHiBase.Data());
1035     sFnMuLoProj[iSig].Append(sMuLoBase.Data());
1036     sGrMuHiProj[iSig].Append(sSigSuffix[iSig].Data());
1037     sGrMuLoProj[iSig].Append(sSigSuffix[iSig].Data());
1038     sFnMuHiProj[iSig].Append(sSigSuffix[iSig].Data());
1039     sFnMuLoProj[iSig].Append(sSigSuffix[iSig].Data());
1040   }
1041 
1042   // construct sigma graphs
1043   TGraph *grMuProj  = new TGraph(NProj, ptProj, muProj);
1044   TGraph *grSigProj = new TGraph(NProj, ptProj, sigProj);
1045   grMuProj  -> SetName(sMuProj);
1046   grSigProj -> SetName(sSigProj);
1047 
1048   TF1    *fMuHiProj[NSigCuts];
1049   TF1    *fMuLoProj[NSigCuts];
1050   TGraph *grMuHiProj[NSigCuts];
1051   TGraph *grMuLoProj[NSigCuts];
1052   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1053 
1054     // create graphs
1055     grMuHiProj[iSig] = new TGraph(NProj, ptProj, muHiProj[iSig]);
1056     grMuLoProj[iSig] = new TGraph(NProj, ptProj, muLoProj[iSig]);
1057     grMuHiProj[iSig] -> SetName(sGrMuHiProj[iSig].Data());
1058     grMuLoProj[iSig] -> SetName(sGrMuLoProj[iSig].Data());
1059 
1060     // create fit functions
1061     fMuHiProj[iSig] = new TF1(sFnMuHiProj[iSig].Data(), "pol2", rPtRange[0], rPtRange[1]);
1062     fMuLoProj[iSig] = new TF1(sFnMuLoProj[iSig].Data(), "pol2", rPtRange[0], rPtRange[1]);
1063     fMuHiProj[iSig] -> SetLineColor(fColSigFit[iSig]);
1064     fMuLoProj[iSig] -> SetLineColor(fColSigFit[iSig]);
1065     fMuHiProj[iSig] -> SetLineStyle(fLinFit);
1066     fMuLoProj[iSig] -> SetLineStyle(fLinFit);
1067     fMuHiProj[iSig] -> SetLineWidth(fWidFit);
1068     fMuLoProj[iSig] -> SetLineWidth(fWidFit);
1069     fMuHiProj[iSig] -> SetParameter(0, sigHiGuess[0]);
1070     fMuLoProj[iSig] -> SetParameter(0, sigLoGuess[0]);
1071     fMuHiProj[iSig] -> SetParameter(1, sigHiGuess[1]);
1072     fMuLoProj[iSig] -> SetParameter(1, sigLoGuess[1]);
1073     fMuHiProj[iSig] -> SetParameter(2, sigHiGuess[2]);
1074     fMuLoProj[iSig] -> SetParameter(2, sigLoGuess[2]);
1075 
1076     // fit graphs
1077     grMuHiProj[iSig] -> Fit(sFnMuHiProj[iSig].Data(), "", "", ptFitRange[0], ptFitRange[1]);
1078     grMuLoProj[iSig] -> Fit(sFnMuLoProj[iSig].Data(), "", "", ptFitRange[0], ptFitRange[1]);
1079   }
1080   cout << "      Created and fit sigma graphs.\n"
1081        << "      Second loop over reco. tracks:"
1082        << endl;
1083 
1084   // 2nd track loop
1085   nBytesTrk = 0;
1086   for (Long64_t iTrk = 0; iTrk < nTrks; iTrk++) {
1087 
1088     // grab entry
1089     const Long64_t bytesTrk = ntTrack -> GetEntry(iTrk);
1090     if (bytesTrk < 0.) {
1091       cerr << "WARNING: something wrong with track #" << iTrk << "! Aborting loop!" << endl;
1092       break;
1093     }
1094     nBytesTrk += bytesTrk;
1095 
1096     // announce progress
1097     const Long64_t iProgTrk = iTrk + 1;
1098     if (iProgTrk == nTrks) {
1099       cout << "        Processing track " << iProgTrk << "/" << nTrks << "..." << endl;
1100     } else {
1101       cout << "        Processing track " << iProgTrk << "/" << nTrks << "...\r" << flush;
1102     }
1103 
1104     // do calculations
1105     const Double_t ptFrac  = trk_pt / trk_gpt;
1106     const Double_t ptDelta = trk_deltapt / trk_pt;
1107 
1108     // apply trk cuts
1109     const Bool_t isInZVtxCut = (abs(trk_vz) <  vzTrkMax);
1110     const Bool_t isInInttCut = (trk_nintt   >= nInttTrkMin);
1111     const Bool_t isInMVtxCut = (trk_nlmaps  >  nMVtxTrkMin);
1112     const Bool_t isInTpcCut  = (trk_ntpc    >  nTpcTrkMin);
1113     const Bool_t isInPtCut   = (trk_pt      >  ptTrkMin);
1114     const Bool_t isInQualCut = (trk_quality <  qualTrkMax);
1115     const Bool_t isGoodTrk   = (isInZVtxCut && isInInttCut && isInMVtxCut && isInTpcCut && isInPtCut && isInQualCut);
1116     if (!isGoodTrk) continue;
1117 
1118     // apply delta-pt cuts
1119     const Bool_t isNormalTrk = ((ptFrac > normRange[0]) && (ptFrac < normRange[1]));
1120     for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1121 
1122       // get bounds
1123       const Float_t ptDeltaMin = fMuLoProj[iSig] -> Eval(trk_pt);
1124       const Float_t ptDeltaMax = fMuHiProj[iSig] -> Eval(trk_pt);
1125 
1126       const Bool_t isInDeltaPtSigma = ((ptDelta >= ptDeltaMin) && (ptDelta <= ptDeltaMax));
1127       if (isInDeltaPtSigma) {
1128 
1129         // fill histograms
1130         hPtDeltaSig[iSig]        -> Fill(ptDelta);
1131         hPtTrackSig[iSig]        -> Fill(trk_pt);
1132         hPtFracSig[iSig]         -> Fill(ptFrac);
1133         hPtTrkTruSig[iSig]       -> Fill(trk_gpt);
1134         hPtDeltaVsFracSig[iSig]  -> Fill(ptFrac,  ptDelta);
1135         hPtDeltaVsTrueSig[iSig]  -> Fill(trk_gpt, ptDelta);
1136         hPtDeltaVsTrackSig[iSig] -> Fill(trk_pt,  ptDelta);
1137         hPtTrueVsTrackSig[iSig]  -> Fill(trk_pt,  trk_gpt);
1138 
1139         // increment counters
1140         if (isNormalTrk) {
1141           ++nNormSig[iSig];
1142         } else {
1143           ++nWeirdSig[iSig];
1144         }
1145       }
1146     }  // end delta-pt cut
1147   }  // end 1st track loop
1148   cout << "      Second loop over reco. tracks finished!" << endl;
1149 
1150   // calculate pt-dependent delta-pt rejection factors
1151   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1152     rejSig[iSig] = (Double_t) nNormSig[iSig] / (Double_t) nWeirdSig[iSig];
1153   }
1154   cout << "      Calculated pt-depdendent delta-pt rejection factors.\n"
1155        << "      Loop over particles:"
1156        << endl;
1157 
1158   // truth loop
1159   Long64_t nBytesTru = 0;
1160   for (Long64_t iTru = 0; iTru < nTrus; iTru++) {
1161 
1162     // grab entry
1163     const Long64_t bytesTru = ntTruth -> GetEntry(iTru);
1164     if (bytesTru < 0.) {
1165       cerr << "WARNING: something wrong with particle #" << iTru << "! Aborting loop!" << endl;
1166       break;
1167     }
1168     nBytesTru += bytesTru;
1169 
1170     // announce progress
1171     const Long64_t iProgTru = iTru + 1;
1172     if (iProgTru == nTrus) {
1173       cout << "        Processing particle " << iProgTru << "/" << nTrus << "..." << endl;
1174     } else {
1175       cout << "        Processing particle" << iProgTru << "/" << nTrus << "...\r" << flush;
1176     }
1177 
1178     // fill truth histogram
1179     const Bool_t isPrimary = (tru_gprimary == 1);
1180     if (isPrimary) {
1181       hPtTruth -> Fill(tru_gpt);
1182     }
1183   }  // end track loop
1184   cout << "      Loop over particles finished!" << endl;
1185 
1186   // announce rejection factors
1187   cout << "    Finished tuple loops! Rejection factors:" << endl;
1188 
1189   // flat delta-t rejection factors
1190   cout << "      Flat delta-pt cuts" << endl;
1191   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
1192     cout << "        n(Norm, Weird) = (" << nNormCut[iCut] << ", " << nWeirdCut[iCut] << "), rejection = " << rejCut[iCut] << endl;
1193   }
1194 
1195   // flat delta-t rejection factors
1196   cout << "      Pt-dependent delta-pt cuts" << endl;
1197   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1198     cout << "        n(Norm, Weird) = (" << nNormSig[iSig] << ", " << nWeirdSig[iSig] << "), rejection = " << rejSig[iSig] << endl;
1199   }
1200 
1201   // make rejection graphs
1202   TString sRejCut("gr");
1203   TString sRejSig("gr");
1204   sRejCut.Append(sRejCutBase.Data());
1205   sRejSig.Append(sRejSigBase.Data());
1206 
1207   TGraph *grRejCut = new TGraph(NDPtCuts, ptDeltaMax, rejCut);
1208   TGraph *grRejSig = new TGraph(NSigCuts, ptDeltaSig, rejSig);
1209   grRejCut -> SetName(sRejCut.Data());
1210   grRejSig -> SetName(sRejSig.Data());
1211   cout << "    Made rejection factor graph." << endl; 
1212 
1213   // rebin efficiency histograms if needed
1214   if (doEffRebin) {
1215     hPtTruth  -> Rebin(nEffRebin);
1216     hPtTrkTru -> Rebin(nEffRebin);
1217     for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
1218       hPtTrkTruCut[iCut] -> Rebin(nEffRebin);
1219     }
1220     for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1221       hPtTrkTruSig[iSig] -> Rebin(nEffRebin);
1222     }
1223     cout << "    Rebinned efficiency histograms." << endl;
1224   }
1225 
1226   // calculate efficiencies
1227   TString sEff("h");
1228   sEff.Append(sEffBase.Data());
1229 
1230   // flat delta-pt cut efficiency names
1231   TString sEffCut[NDPtCuts];
1232   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
1233     sEffCut[iCut] = "h";
1234     sEffCut[iCut].Append(sEffBase.Data());
1235     sEffCut[iCut].Append(sDPtSuffix[iCut].Data());
1236   }
1237 
1238   // pt-dependent delta-pt cut efficiency names
1239   TString sEffSig[NSigCuts];
1240   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1241     sEffSig[iSig] = "h";
1242     sEffSig[iSig].Append(sEffBase.Data());
1243     sEffSig[iSig].Append(sSigSuffix[iSig].Data());
1244   }
1245 
1246   hEff = (TH1D*) hPtTruth -> Clone();
1247   hEff -> SetName(sEff.Data());
1248   hEff -> Reset("ICES");
1249   hEff -> Divide(hPtTrkTru, hPtTruth, 1., 1.);
1250 
1251   // flat delta-pt cut efficiencies
1252   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
1253     hEffCut[iCut] = (TH1D*) hPtTruth -> Clone();
1254     hEffCut[iCut] -> SetName(sEffCut[iCut].Data());
1255     hEffCut[iCut] -> Reset("ICES");
1256     hEffCut[iCut] -> Divide(hPtTrkTruCut[iCut], hPtTruth, 1., 1.);
1257   }
1258 
1259   // pt-dependent delta-pt cut efficiencies
1260   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1261     hEffSig[iSig] = (TH1D*) hPtTruth -> Clone();
1262     hEffSig[iSig] -> SetName(sEffSig[iSig].Data());
1263     hEffSig[iSig] -> Reset("ICES");
1264     hEffSig[iSig] -> Divide(hPtTrkTruSig[iSig], hPtTruth, 1., 1.);
1265   }
1266   cout << "    Calculated efficiencies." << endl;
1267 
1268   // set styles
1269   const UInt_t  fFil(0);
1270   const UInt_t  fLin(1);
1271   const UInt_t  fWid(1);
1272   const UInt_t  fTxt(42);
1273   const UInt_t  fAln(12);
1274   const UInt_t  fCnt(1);
1275   const Float_t fLab[NPad]  = {0.074, 0.04};
1276   const Float_t fTit[NPad]  = {0.074, 0.04};
1277   const Float_t fOffX[NPad] = {1.1,   1.};
1278   const Float_t fOffY[NPad] = {0.7,   1.3};
1279   const Float_t fOffZ[NPad] = {1.1,   1.1};
1280   grRejCut        -> SetMarkerColor(fColTrue);
1281   grRejCut        -> SetMarkerStyle(fMarTrue);
1282   grRejCut        -> SetFillColor(fColTrue);
1283   grRejCut        -> SetFillStyle(fFil);
1284   grRejCut        -> SetLineColor(fColTrue);
1285   grRejCut        -> SetLineStyle(fLin);
1286   grRejCut        -> SetLineWidth(fWid);
1287   grRejCut        -> SetTitle(sTitle.Data());
1288   grRejCut        -> GetXaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1289   grRejCut        -> GetXaxis() -> SetTitle(sDeltaCutAxis.Data());
1290   grRejCut        -> GetXaxis() -> SetTitleFont(fTxt);
1291   grRejCut        -> GetXaxis() -> SetTitleSize(fTit[1]);
1292   grRejCut        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1293   grRejCut        -> GetXaxis() -> SetLabelFont(fTxt);
1294   grRejCut        -> GetXaxis() -> SetLabelSize(fLab[1]);
1295   grRejCut        -> GetXaxis() -> CenterTitle(fCnt);
1296   grRejCut        -> GetYaxis() -> SetTitle(sRejectAxis.Data());
1297   grRejCut        -> GetYaxis() -> SetTitleFont(fTxt);
1298   grRejCut        -> GetYaxis() -> SetTitleSize(fTit[1]);
1299   grRejCut        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1300   grRejCut        -> GetYaxis() -> SetLabelFont(fTxt);
1301   grRejCut        -> GetYaxis() -> SetLabelSize(fLab[1]);
1302   grRejCut        -> GetYaxis() -> CenterTitle(fCnt);
1303   grRejSig        -> SetMarkerColor(fColTrue);
1304   grRejSig        -> SetMarkerStyle(fMarTrue);
1305   grRejSig        -> SetFillColor(fColTrue);
1306   grRejSig        -> SetFillStyle(fFil);
1307   grRejSig        -> SetLineColor(fColTrue);
1308   grRejSig        -> SetLineStyle(fLin);
1309   grRejSig        -> SetLineWidth(fWid);
1310   grRejSig        -> SetTitle(sTitle.Data());
1311   grRejSig        -> GetXaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1312   grRejSig        -> GetXaxis() -> SetTitle(sSigmaCutAxis.Data());
1313   grRejSig        -> GetXaxis() -> SetTitleFont(fTxt);
1314   grRejSig        -> GetXaxis() -> SetTitleSize(fTit[1]);
1315   grRejSig        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1316   grRejSig        -> GetXaxis() -> SetLabelFont(fTxt);
1317   grRejSig        -> GetXaxis() -> SetLabelSize(fLab[1]);
1318   grRejSig        -> GetXaxis() -> CenterTitle(fCnt);
1319   grRejSig        -> GetYaxis() -> SetTitle(sRejectAxis.Data());
1320   grRejSig        -> GetYaxis() -> SetTitleFont(fTxt);
1321   grRejSig        -> GetYaxis() -> SetTitleSize(fTit[1]);
1322   grRejSig        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1323   grRejSig        -> GetYaxis() -> SetLabelFont(fTxt);
1324   grRejSig        -> GetYaxis() -> SetLabelSize(fLab[1]);
1325   grRejSig        -> GetYaxis() -> CenterTitle(fCnt);
1326   hEff            -> SetMarkerColor(fColTrk);
1327   hEff            -> SetMarkerStyle(fMarTrk);
1328   hEff            -> SetFillColor(fColTrk);
1329   hEff            -> SetFillStyle(fFil);
1330   hEff            -> SetLineColor(fColTrk);
1331   hEff            -> SetLineStyle(fLin);
1332   hEff            -> SetLineWidth(fWid);
1333   hEff            -> SetTitle(sTitle.Data());
1334   hEff            -> SetTitleFont(fTxt);
1335   hEff            -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1336   hEff            -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
1337   hEff            -> GetXaxis() -> SetTitleFont(fTxt);
1338   hEff            -> GetXaxis() -> SetTitleSize(fTit[0]);
1339   hEff            -> GetXaxis() -> SetTitleOffset(fOffX[0]);
1340   hEff            -> GetXaxis() -> SetLabelFont(fTxt);
1341   hEff            -> GetXaxis() -> SetLabelSize(fLab[0]);
1342   hEff            -> GetXaxis() -> CenterTitle(fCnt);
1343   hEff            -> GetYaxis() -> SetTitle(sEffAxis.Data());
1344   hEff            -> GetYaxis() -> SetTitleFont(fTxt);
1345   hEff            -> GetYaxis() -> SetTitleSize(fTit[0]);
1346   hEff            -> GetYaxis() -> SetTitleOffset(fOffY[0]);
1347   hEff            -> GetYaxis() -> SetLabelFont(fTxt);
1348   hEff            -> GetYaxis() -> SetLabelSize(fLab[0]);
1349   hEff            -> GetYaxis() -> CenterTitle(fCnt);
1350   hPtTruth        -> SetMarkerColor(fColTrue);
1351   hPtTruth        -> SetMarkerStyle(fMarTrue);
1352   hPtTruth        -> SetFillColor(fColTrue);
1353   hPtTruth        -> SetFillStyle(fFil);
1354   hPtTruth        -> SetLineColor(fColTrue);
1355   hPtTruth        -> SetLineStyle(fLin);
1356   hPtTruth        -> SetLineWidth(fWid);
1357   hPtTruth        -> SetTitle(sTitle.Data());
1358   hPtTruth        -> SetTitleFont(fTxt);
1359   hPtTruth        -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1360   hPtTruth        -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
1361   hPtTruth        -> GetXaxis() -> SetTitleFont(fTxt);
1362   hPtTruth        -> GetXaxis() -> SetTitleSize(fTit[1]);
1363   hPtTruth        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1364   hPtTruth        -> GetXaxis() -> SetLabelFont(fTxt);
1365   hPtTruth        -> GetXaxis() -> SetLabelSize(fLab[1]);
1366   hPtTruth        -> GetXaxis() -> CenterTitle(fCnt);
1367   hPtTruth        -> GetYaxis() -> SetTitle(sCounts.Data());
1368   hPtTruth        -> GetYaxis() -> SetTitleFont(fTxt);
1369   hPtTruth        -> GetYaxis() -> SetTitleSize(fTit[1]);
1370   hPtTruth        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1371   hPtTruth        -> GetYaxis() -> SetLabelFont(fTxt);
1372   hPtTruth        -> GetYaxis() -> SetLabelSize(fLab[1]);
1373   hPtTruth        -> GetYaxis() -> CenterTitle(fCnt);
1374   hPtDelta        -> SetMarkerColor(fColTrue);
1375   hPtDelta        -> SetMarkerStyle(fMarTrue);
1376   hPtDelta        -> SetFillColor(fColTrue);
1377   hPtDelta        -> SetFillStyle(fFil);
1378   hPtDelta        -> SetLineColor(fColTrue);
1379   hPtDelta        -> SetLineStyle(fLin);
1380   hPtDelta        -> SetLineWidth(fWid);
1381   hPtDelta        -> SetTitle(sTitle.Data());
1382   hPtDelta        -> SetTitleFont(fTxt);
1383   hPtDelta        -> GetXaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1384   hPtDelta        -> GetXaxis() -> SetTitle(sPtDeltaAxis.Data());
1385   hPtDelta        -> GetXaxis() -> SetTitleFont(fTxt);
1386   hPtDelta        -> GetXaxis() -> SetTitleSize(fTit[1]);
1387   hPtDelta        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1388   hPtDelta        -> GetXaxis() -> SetLabelFont(fTxt);
1389   hPtDelta        -> GetXaxis() -> SetLabelSize(fLab[1]);
1390   hPtDelta        -> GetXaxis() -> CenterTitle(fCnt);
1391   hPtDelta        -> GetYaxis() -> SetTitle(sCounts.Data());
1392   hPtDelta        -> GetYaxis() -> SetTitleFont(fTxt);
1393   hPtDelta        -> GetYaxis() -> SetTitleSize(fTit[1]);
1394   hPtDelta        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1395   hPtDelta        -> GetYaxis() -> SetLabelFont(fTxt);
1396   hPtDelta        -> GetYaxis() -> SetLabelSize(fLab[1]);
1397   hPtDelta        -> GetYaxis() -> CenterTitle(fCnt);
1398   hPtTrack        -> SetMarkerColor(fColTrue);
1399   hPtTrack        -> SetMarkerStyle(fMarTrue);
1400   hPtTrack        -> SetFillColor(fColTrue);
1401   hPtTrack        -> SetFillStyle(fFil);
1402   hPtTrack        -> SetLineColor(fColTrue);
1403   hPtTrack        -> SetLineStyle(fLin);
1404   hPtTrack        -> SetLineWidth(fWid);
1405   hPtTrack        -> SetTitle(sTitle.Data());
1406   hPtTrack        -> SetTitleFont(fTxt);
1407   hPtTrack        -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1408   hPtTrack        -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1409   hPtTrack        -> GetXaxis() -> SetTitleFont(fTxt);
1410   hPtTrack        -> GetXaxis() -> SetTitleSize(fTit[1]);
1411   hPtTrack        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1412   hPtTrack        -> GetXaxis() -> SetLabelFont(fTxt);
1413   hPtTrack        -> GetXaxis() -> SetLabelSize(fLab[1]);
1414   hPtTrack        -> GetXaxis() -> CenterTitle(fCnt);
1415   hPtTrack        -> GetYaxis() -> SetTitle(sCounts.Data());
1416   hPtTrack        -> GetYaxis() -> SetTitleFont(fTxt);
1417   hPtTrack        -> GetYaxis() -> SetTitleSize(fTit[1]);
1418   hPtTrack        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1419   hPtTrack        -> GetYaxis() -> SetLabelFont(fTxt);
1420   hPtTrack        -> GetYaxis() -> SetLabelSize(fLab[1]);
1421   hPtTrack        -> GetYaxis() -> CenterTitle(fCnt);
1422   hPtFrac         -> SetMarkerColor(fColTrue);
1423   hPtFrac         -> SetMarkerStyle(fMarTrue);
1424   hPtFrac         -> SetFillColor(fColTrue);
1425   hPtFrac         -> SetFillStyle(fFil);
1426   hPtFrac         -> SetLineColor(fColTrue);
1427   hPtFrac         -> SetLineStyle(fLin);
1428   hPtFrac         -> SetLineWidth(fWid);
1429   hPtFrac         -> SetTitle(sTitle.Data());
1430   hPtFrac         -> SetTitleFont(fTxt);
1431   hPtFrac         -> GetXaxis() -> SetRangeUser(rFracRange[0], rFracRange[1]);
1432   hPtFrac         -> GetXaxis() -> SetTitle(sPtFracAxis.Data());
1433   hPtFrac         -> GetXaxis() -> SetTitleFont(fTxt);
1434   hPtFrac         -> GetXaxis() -> SetTitleSize(fTit[1]);
1435   hPtFrac         -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1436   hPtFrac         -> GetXaxis() -> SetLabelFont(fTxt);
1437   hPtFrac         -> GetXaxis() -> SetLabelSize(fLab[1]);
1438   hPtFrac         -> GetXaxis() -> CenterTitle(fCnt);
1439   hPtFrac         -> GetYaxis() -> SetTitle(sCounts.Data());
1440   hPtFrac         -> GetYaxis() -> SetTitleFont(fTxt);
1441   hPtFrac         -> GetYaxis() -> SetTitleSize(fTit[1]);
1442   hPtFrac         -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1443   hPtFrac         -> GetYaxis() -> SetLabelFont(fTxt);
1444   hPtFrac         -> GetYaxis() -> SetLabelSize(fLab[1]);
1445   hPtFrac         -> GetYaxis() -> CenterTitle(fCnt);
1446   hPtTrkTru       -> SetMarkerColor(fColTrk);
1447   hPtTrkTru       -> SetMarkerStyle(fMarTrk);
1448   hPtTrkTru       -> SetFillColor(fColTrk);
1449   hPtTrkTru       -> SetFillStyle(fFil);
1450   hPtTrkTru       -> SetLineColor(fColTrk);
1451   hPtTrkTru       -> SetLineStyle(fLin);
1452   hPtTrkTru       -> SetLineWidth(fWid);
1453   hPtTrkTru       -> SetTitle(sTitle.Data());
1454   hPtTrkTru       -> SetTitleFont(fTxt);
1455   hPtTrkTru       -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1456   hPtTrkTru       -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
1457   hPtTrkTru       -> GetXaxis() -> SetTitleFont(fTxt);
1458   hPtTrkTru       -> GetXaxis() -> SetTitleSize(fTit[1]);
1459   hPtTrkTru       -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1460   hPtTrkTru       -> GetXaxis() -> SetLabelFont(fTxt);
1461   hPtTrkTru       -> GetXaxis() -> SetLabelSize(fLab[1]);
1462   hPtTrkTru       -> GetXaxis() -> CenterTitle(fCnt);
1463   hPtTrkTru       -> GetYaxis() -> SetTitle(sCounts.Data());
1464   hPtTrkTru       -> GetYaxis() -> SetTitleFont(fTxt);
1465   hPtTrkTru       -> GetYaxis() -> SetTitleSize(fTit[1]);
1466   hPtTrkTru       -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1467   hPtTrkTru       -> GetYaxis() -> SetLabelFont(fTxt);
1468   hPtTrkTru       -> GetYaxis() -> SetLabelSize(fLab[1]);
1469   hPtTrkTru       -> GetYaxis() -> CenterTitle(fCnt);
1470   hPtDeltaVsFrac  -> SetMarkerColor(fColTrk);
1471   hPtDeltaVsFrac  -> SetMarkerStyle(fMarTrk);
1472   hPtDeltaVsFrac  -> SetFillColor(fColTrk);
1473   hPtDeltaVsFrac  -> SetFillStyle(fFil);
1474   hPtDeltaVsFrac  -> SetLineColor(fColTrk);
1475   hPtDeltaVsFrac  -> SetLineStyle(fLin);
1476   hPtDeltaVsFrac  -> SetLineWidth(fWid);
1477   hPtDeltaVsFrac  -> SetTitle(sTitle.Data());
1478   hPtDeltaVsFrac  -> SetTitleFont(fTxt);
1479   hPtDeltaVsFrac  -> GetXaxis() -> SetRangeUser(rFracRange[0], rFracRange[1]);
1480   hPtDeltaVsFrac  -> GetXaxis() -> SetTitle(sPtFracAxis.Data());
1481   hPtDeltaVsFrac  -> GetXaxis() -> SetTitleFont(fTxt);
1482   hPtDeltaVsFrac  -> GetXaxis() -> SetTitleSize(fTit[1]);
1483   hPtDeltaVsFrac  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1484   hPtDeltaVsFrac  -> GetXaxis() -> SetLabelFont(fTxt);
1485   hPtDeltaVsFrac  -> GetXaxis() -> SetLabelSize(fLab[1]);
1486   hPtDeltaVsFrac  -> GetXaxis() -> CenterTitle(fCnt);
1487   hPtDeltaVsFrac  -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1488   hPtDeltaVsFrac  -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
1489   hPtDeltaVsFrac  -> GetYaxis() -> SetTitleFont(fTxt);
1490   hPtDeltaVsFrac  -> GetYaxis() -> SetTitleSize(fTit[1]);
1491   hPtDeltaVsFrac  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1492   hPtDeltaVsFrac  -> GetYaxis() -> SetLabelFont(fTxt);
1493   hPtDeltaVsFrac  -> GetYaxis() -> SetLabelSize(fLab[1]);
1494   hPtDeltaVsFrac  -> GetYaxis() -> CenterTitle(fCnt);
1495   hPtDeltaVsFrac  -> GetZaxis() -> SetTitle(sCounts.Data());
1496   hPtDeltaVsFrac  -> GetZaxis() -> SetTitleFont(fTxt);
1497   hPtDeltaVsFrac  -> GetZaxis() -> SetTitleSize(fTit[1]);
1498   hPtDeltaVsFrac  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
1499   hPtDeltaVsFrac  -> GetZaxis() -> SetLabelFont(fTxt);
1500   hPtDeltaVsFrac  -> GetZaxis() -> SetLabelSize(fLab[1]);
1501   hPtDeltaVsFrac  -> GetZaxis() -> CenterTitle(fCnt);
1502   hPtDeltaVsTrue  -> SetMarkerColor(fColTrk);
1503   hPtDeltaVsTrue  -> SetMarkerStyle(fMarTrk);
1504   hPtDeltaVsTrue  -> SetFillColor(fColTrk);
1505   hPtDeltaVsTrue  -> SetFillStyle(fFil);
1506   hPtDeltaVsTrue  -> SetLineColor(fColTrk);
1507   hPtDeltaVsTrue  -> SetLineStyle(fLin);
1508   hPtDeltaVsTrue  -> SetLineWidth(fWid);
1509   hPtDeltaVsTrue  -> SetTitle(sTitle.Data());
1510   hPtDeltaVsTrue  -> SetTitleFont(fTxt);
1511   hPtDeltaVsTrue  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1512   hPtDeltaVsTrue  -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
1513   hPtDeltaVsTrue  -> GetXaxis() -> SetTitleFont(fTxt);
1514   hPtDeltaVsTrue  -> GetXaxis() -> SetTitleSize(fTit[1]);
1515   hPtDeltaVsTrue  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1516   hPtDeltaVsTrue  -> GetXaxis() -> SetLabelFont(fTxt);
1517   hPtDeltaVsTrue  -> GetXaxis() -> SetLabelSize(fLab[1]);
1518   hPtDeltaVsTrue  -> GetXaxis() -> CenterTitle(fCnt);
1519   hPtDeltaVsTrue  -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1520   hPtDeltaVsTrue  -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
1521   hPtDeltaVsTrue  -> GetYaxis() -> SetTitleFont(fTxt);
1522   hPtDeltaVsTrue  -> GetYaxis() -> SetTitleSize(fTit[1]);
1523   hPtDeltaVsTrue  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1524   hPtDeltaVsTrue  -> GetYaxis() -> SetLabelFont(fTxt);
1525   hPtDeltaVsTrue  -> GetYaxis() -> SetLabelSize(fLab[1]);
1526   hPtDeltaVsTrue  -> GetYaxis() -> CenterTitle(fCnt);
1527   hPtDeltaVsTrue  -> GetZaxis() -> SetTitle(sCounts.Data());
1528   hPtDeltaVsTrue  -> GetZaxis() -> SetTitleFont(fTxt);
1529   hPtDeltaVsTrue  -> GetZaxis() -> SetTitleSize(fTit[1]);
1530   hPtDeltaVsTrue  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
1531   hPtDeltaVsTrue  -> GetZaxis() -> SetLabelFont(fTxt);
1532   hPtDeltaVsTrue  -> GetZaxis() -> SetLabelSize(fLab[1]);
1533   hPtDeltaVsTrue  -> GetZaxis() -> CenterTitle(fCnt);
1534   hPtDeltaVsTrack -> SetMarkerColor(fColTrk);
1535   hPtDeltaVsTrack -> SetMarkerStyle(fMarTrk);
1536   hPtDeltaVsTrack -> SetFillColor(fColTrk);
1537   hPtDeltaVsTrack -> SetFillStyle(fFil);
1538   hPtDeltaVsTrack -> SetLineColor(fColTrk);
1539   hPtDeltaVsTrack -> SetLineStyle(fLin);
1540   hPtDeltaVsTrack -> SetLineWidth(fWid);
1541   hPtDeltaVsTrack -> SetTitle(sTitle.Data());
1542   hPtDeltaVsTrack -> SetTitleFont(fTxt);
1543   hPtDeltaVsTrack -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1544   hPtDeltaVsTrack -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1545   hPtDeltaVsTrack -> GetXaxis() -> SetTitleFont(fTxt);
1546   hPtDeltaVsTrack -> GetXaxis() -> SetTitleSize(fTit[1]);
1547   hPtDeltaVsTrack -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1548   hPtDeltaVsTrack -> GetXaxis() -> SetLabelFont(fTxt);
1549   hPtDeltaVsTrack -> GetXaxis() -> SetLabelSize(fLab[1]);
1550   hPtDeltaVsTrack -> GetXaxis() -> CenterTitle(fCnt);
1551   hPtDeltaVsTrack -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1552   hPtDeltaVsTrack -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
1553   hPtDeltaVsTrack -> GetYaxis() -> SetTitleFont(fTxt);
1554   hPtDeltaVsTrack -> GetYaxis() -> SetTitleSize(fTit[1]);
1555   hPtDeltaVsTrack -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1556   hPtDeltaVsTrack -> GetYaxis() -> SetLabelFont(fTxt);
1557   hPtDeltaVsTrack -> GetYaxis() -> SetLabelSize(fLab[1]);
1558   hPtDeltaVsTrack -> GetYaxis() -> CenterTitle(fCnt);
1559   hPtDeltaVsTrack -> GetZaxis() -> SetTitle(sCounts.Data());
1560   hPtDeltaVsTrack -> GetZaxis() -> SetTitleFont(fTxt);
1561   hPtDeltaVsTrack -> GetZaxis() -> SetTitleSize(fTit[1]);
1562   hPtDeltaVsTrack -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
1563   hPtDeltaVsTrack -> GetZaxis() -> SetLabelFont(fTxt);
1564   hPtDeltaVsTrack -> GetZaxis() -> SetLabelSize(fLab[1]);
1565   hPtDeltaVsTrack -> GetZaxis() -> CenterTitle(fCnt);
1566   hPtTrueVsTrack  -> SetMarkerColor(fColTrk);
1567   hPtTrueVsTrack  -> SetMarkerStyle(fMarTrk);
1568   hPtTrueVsTrack  -> SetFillColor(fColTrk);
1569   hPtTrueVsTrack  -> SetFillStyle(fFil);
1570   hPtTrueVsTrack  -> SetLineColor(fColTrk);
1571   hPtTrueVsTrack  -> SetLineStyle(fLin);
1572   hPtTrueVsTrack  -> SetLineWidth(fWid);
1573   hPtTrueVsTrack  -> SetTitle(sTitle.Data());
1574   hPtTrueVsTrack  -> SetTitleFont(fTxt);
1575   hPtTrueVsTrack  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1576   hPtTrueVsTrack  -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1577   hPtTrueVsTrack  -> GetXaxis() -> SetTitleFont(fTxt);
1578   hPtTrueVsTrack  -> GetXaxis() -> SetTitleSize(fTit[1]);
1579   hPtTrueVsTrack  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1580   hPtTrueVsTrack  -> GetXaxis() -> SetLabelFont(fTxt);
1581   hPtTrueVsTrack  -> GetXaxis() -> SetLabelSize(fLab[1]);
1582   hPtTrueVsTrack  -> GetXaxis() -> CenterTitle(fCnt);
1583   hPtTrueVsTrack  -> GetYaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1584   hPtTrueVsTrack  -> GetYaxis() -> SetTitle(sPtTrueAxis.Data());
1585   hPtTrueVsTrack  -> GetYaxis() -> SetTitleFont(fTxt);
1586   hPtTrueVsTrack  -> GetYaxis() -> SetTitleSize(fTit[1]);
1587   hPtTrueVsTrack  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1588   hPtTrueVsTrack  -> GetYaxis() -> SetLabelFont(fTxt);
1589   hPtTrueVsTrack  -> GetYaxis() -> SetLabelSize(fLab[1]);
1590   hPtTrueVsTrack  -> GetYaxis() -> CenterTitle(fCnt);
1591   hPtTrueVsTrack  -> GetZaxis() -> SetTitle(sCounts.Data());
1592   hPtTrueVsTrack  -> GetZaxis() -> SetTitleFont(fTxt);
1593   hPtTrueVsTrack  -> GetZaxis() -> SetTitleSize(fTit[1]);
1594   hPtTrueVsTrack  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
1595   hPtTrueVsTrack  -> GetZaxis() -> SetLabelFont(fTxt);
1596   hPtTrueVsTrack  -> GetZaxis() -> SetLabelSize(fLab[1]);
1597   hPtTrueVsTrack  -> GetZaxis() -> CenterTitle(fCnt);
1598 
1599   // set styles of delta-pt projection histograms
1600   grMuProj  -> SetMarkerColor(fColTrue);
1601   grMuProj  -> SetMarkerStyle(fMarTrue);
1602   grMuProj  -> SetFillColor(fColTrue);
1603   grMuProj  -> SetFillStyle(fFil);
1604   grMuProj  -> SetLineColor(fColTrue);
1605   grMuProj  -> SetLineStyle(fLin);
1606   grMuProj  -> SetLineWidth(fWid);
1607   grMuProj  -> SetTitle(sTitle.Data());
1608   grMuProj  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1609   grMuProj  -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1610   grMuProj  -> GetXaxis() -> SetTitleFont(fTxt);
1611   grMuProj  -> GetXaxis() -> SetTitleSize(fTit[1]);
1612   grMuProj  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1613   grMuProj  -> GetXaxis() -> SetLabelFont(fTxt);
1614   grMuProj  -> GetXaxis() -> SetLabelSize(fLab[1]);
1615   grMuProj  -> GetXaxis() -> CenterTitle(fCnt);
1616   grMuProj  -> GetYaxis() -> SetTitle(sMuProjAxis.Data());
1617   grMuProj  -> GetYaxis() -> SetTitleFont(fTxt);
1618   grMuProj  -> GetYaxis() -> SetTitleSize(fTit[1]);
1619   grMuProj  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1620   grMuProj  -> GetYaxis() -> SetLabelFont(fTxt);
1621   grMuProj  -> GetYaxis() -> SetLabelSize(fLab[1]);
1622   grMuProj  -> GetYaxis() -> CenterTitle(fCnt);
1623   grSigProj -> SetMarkerColor(fColTrue);
1624   grSigProj -> SetMarkerStyle(fMarTrue);
1625   grSigProj -> SetFillColor(fColTrue);
1626   grSigProj -> SetFillStyle(fFil);
1627   grSigProj -> SetLineColor(fColTrue);
1628   grSigProj -> SetLineStyle(fLin);
1629   grSigProj -> SetLineWidth(fWid);
1630   grSigProj -> SetTitle(sTitle.Data());
1631   grSigProj -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1632   grSigProj -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1633   grSigProj -> GetXaxis() -> SetTitleFont(fTxt);
1634   grSigProj -> GetXaxis() -> SetTitleSize(fTit[1]);
1635   grSigProj -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1636   grSigProj -> GetXaxis() -> SetLabelFont(fTxt);
1637   grSigProj -> GetXaxis() -> SetLabelSize(fLab[1]);
1638   grSigProj -> GetXaxis() -> CenterTitle(fCnt);
1639   grSigProj -> GetYaxis() -> SetTitle(sSigProjAxis.Data());
1640   grSigProj -> GetYaxis() -> SetTitleFont(fTxt);
1641   grSigProj -> GetYaxis() -> SetTitleSize(fTit[1]);
1642   grSigProj -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1643   grSigProj -> GetYaxis() -> SetLabelFont(fTxt);
1644   grSigProj -> GetYaxis() -> SetLabelSize(fLab[1]);
1645   grSigProj -> GetYaxis() -> CenterTitle(fCnt);
1646   for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
1647     hPtDeltaProj[iProj] -> SetMarkerColor(fColProj[iProj]);
1648     hPtDeltaProj[iProj] -> SetMarkerStyle(fMarProj[iProj]);
1649     hPtDeltaProj[iProj] -> SetFillColor(fColProj[iProj]);
1650     hPtDeltaProj[iProj] -> SetFillStyle(fFil);
1651     hPtDeltaProj[iProj] -> SetLineColor(fColProj[iProj]);
1652     hPtDeltaProj[iProj] -> SetLineStyle(fLin);
1653     hPtDeltaProj[iProj] -> SetLineWidth(fWid);
1654     hPtDeltaProj[iProj] -> SetTitle(sTitle.Data());
1655     hPtDeltaProj[iProj] -> SetTitleFont(fTxt);
1656     hPtDeltaProj[iProj] -> GetXaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1657     hPtDeltaProj[iProj] -> GetXaxis() -> SetTitle(sPtDeltaAxis.Data());
1658     hPtDeltaProj[iProj] -> GetXaxis() -> SetTitleFont(fTxt);
1659     hPtDeltaProj[iProj] -> GetXaxis() -> SetTitleSize(fTit[1]);
1660     hPtDeltaProj[iProj] -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1661     hPtDeltaProj[iProj] -> GetXaxis() -> SetLabelFont(fTxt);
1662     hPtDeltaProj[iProj] -> GetXaxis() -> SetLabelSize(fLab[1]);
1663     hPtDeltaProj[iProj] -> GetXaxis() -> CenterTitle(fCnt);
1664     hPtDeltaProj[iProj] -> GetYaxis() -> SetTitle(sCounts.Data());
1665     hPtDeltaProj[iProj] -> GetYaxis() -> SetTitleFont(fTxt);
1666     hPtDeltaProj[iProj] -> GetYaxis() -> SetTitleSize(fTit[1]);
1667     hPtDeltaProj[iProj] -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1668     hPtDeltaProj[iProj] -> GetYaxis() -> SetLabelFont(fTxt);
1669     hPtDeltaProj[iProj] -> GetYaxis() -> SetLabelSize(fLab[1]);
1670     hPtDeltaProj[iProj] -> GetYaxis() -> CenterTitle(fCnt);
1671   }
1672   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1673     grMuHiProj[iSig]  -> SetMarkerColor(fColSig[iSig]);
1674     grMuHiProj[iSig]  -> SetMarkerStyle(fMarSig[iSig]);
1675     grMuHiProj[iSig]  -> SetFillColor(fColSig[iSig]);
1676     grMuHiProj[iSig]  -> SetFillStyle(fFil);
1677     grMuHiProj[iSig]  -> SetLineColor(fColSig[iSig]);
1678     grMuHiProj[iSig]  -> SetLineStyle(fLin);
1679     grMuHiProj[iSig]  -> SetLineWidth(fWid);
1680     grMuHiProj[iSig]  -> SetTitle(sTitle.Data());
1681     grMuHiProj[iSig]  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1682     grMuHiProj[iSig]  -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1683     grMuHiProj[iSig]  -> GetXaxis() -> SetTitleFont(fTxt);
1684     grMuHiProj[iSig]  -> GetXaxis() -> SetTitleSize(fTit[1]);
1685     grMuHiProj[iSig]  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1686     grMuHiProj[iSig]  -> GetXaxis() -> SetLabelFont(fTxt);
1687     grMuHiProj[iSig]  -> GetXaxis() -> SetLabelSize(fLab[1]);
1688     grMuHiProj[iSig]  -> GetXaxis() -> CenterTitle(fCnt);
1689     grMuHiProj[iSig]  -> GetYaxis() -> SetTitle(sMuProjAxis.Data());
1690     grMuHiProj[iSig]  -> GetYaxis() -> SetTitleFont(fTxt);
1691     grMuHiProj[iSig]  -> GetYaxis() -> SetTitleSize(fTit[1]);
1692     grMuHiProj[iSig]  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1693     grMuHiProj[iSig]  -> GetYaxis() -> SetLabelFont(fTxt);
1694     grMuHiProj[iSig]  -> GetYaxis() -> SetLabelSize(fLab[1]);
1695     grMuHiProj[iSig]  -> GetYaxis() -> CenterTitle(fCnt);
1696     grMuLoProj[iSig]  -> SetMarkerColor(fColSig[iSig]);
1697     grMuLoProj[iSig]  -> SetMarkerStyle(fMarSig[iSig]);
1698     grMuLoProj[iSig]  -> SetFillColor(fColSig[iSig]);
1699     grMuLoProj[iSig]  -> SetFillStyle(fFil);
1700     grMuLoProj[iSig]  -> SetLineColor(fColSig[iSig]);
1701     grMuLoProj[iSig]  -> SetLineStyle(fLin);
1702     grMuLoProj[iSig]  -> SetLineWidth(fWid);
1703     grMuLoProj[iSig]  -> SetTitle(sTitle.Data());
1704     grMuLoProj[iSig]  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1705     grMuLoProj[iSig]  -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1706     grMuLoProj[iSig]  -> GetXaxis() -> SetTitleFont(fTxt);
1707     grMuLoProj[iSig]  -> GetXaxis() -> SetTitleSize(fTit[1]);
1708     grMuLoProj[iSig]  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1709     grMuLoProj[iSig]  -> GetXaxis() -> SetLabelFont(fTxt);
1710     grMuLoProj[iSig]  -> GetXaxis() -> SetLabelSize(fLab[1]);
1711     grMuLoProj[iSig]  -> GetXaxis() -> CenterTitle(fCnt);
1712     grMuLoProj[iSig]  -> GetYaxis() -> SetTitle(sMuProjAxis.Data());
1713     grMuLoProj[iSig]  -> GetYaxis() -> SetTitleFont(fTxt);
1714     grMuLoProj[iSig]  -> GetYaxis() -> SetTitleSize(fTit[1]);
1715     grMuLoProj[iSig]  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1716     grMuLoProj[iSig]  -> GetYaxis() -> SetLabelFont(fTxt);
1717     grMuLoProj[iSig]  -> GetYaxis() -> SetLabelSize(fLab[1]);
1718     grMuLoProj[iSig]  -> GetYaxis() -> CenterTitle(fCnt);
1719   }
1720 
1721   // set styles of flat delta-pt cut histograms
1722   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
1723     hEffCut[iCut]            -> SetMarkerColor(fColCut[iCut]);
1724     hEffCut[iCut]            -> SetMarkerStyle(fMarCut[iCut]);
1725     hEffCut[iCut]            -> SetFillColor(fColCut[iCut]);
1726     hEffCut[iCut]            -> SetFillStyle(fFil);
1727     hEffCut[iCut]            -> SetLineColor(fColCut[iCut]);
1728     hEffCut[iCut]            -> SetLineStyle(fLin);
1729     hEffCut[iCut]            -> SetLineWidth(fWid);
1730     hEffCut[iCut]            -> SetTitle(sTitle.Data());
1731     hEffCut[iCut]            -> SetTitleFont(fTxt);
1732     hEffCut[iCut]            -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1733     hEffCut[iCut]            -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
1734     hEffCut[iCut]            -> GetXaxis() -> SetTitleFont(fTxt);
1735     hEffCut[iCut]            -> GetXaxis() -> SetTitleSize(fTit[0]);
1736     hEffCut[iCut]            -> GetXaxis() -> SetTitleOffset(fOffX[0]);
1737     hEffCut[iCut]            -> GetXaxis() -> SetLabelFont(fTxt);
1738     hEffCut[iCut]            -> GetXaxis() -> SetLabelSize(fLab[0]);
1739     hEffCut[iCut]            -> GetXaxis() -> CenterTitle(fCnt);
1740     hEffCut[iCut]            -> GetYaxis() -> SetTitle(sEffAxis.Data());
1741     hEffCut[iCut]            -> GetYaxis() -> SetTitleFont(fTxt);
1742     hEffCut[iCut]            -> GetYaxis() -> SetTitleSize(fTit[0]);
1743     hEffCut[iCut]            -> GetYaxis() -> SetTitleOffset(fOffY[0]);
1744     hEffCut[iCut]            -> GetYaxis() -> SetLabelFont(fTxt);
1745     hEffCut[iCut]            -> GetYaxis() -> SetLabelSize(fLab[0]);
1746     hEffCut[iCut]            -> GetYaxis() -> CenterTitle(fCnt);
1747     hPtDeltaCut[iCut]        -> SetMarkerColor(fColCut[iCut]);
1748     hPtDeltaCut[iCut]        -> SetMarkerStyle(fMarCut[iCut]);
1749     hPtDeltaCut[iCut]        -> SetFillColor(fColCut[iCut]);
1750     hPtDeltaCut[iCut]        -> SetFillStyle(fFil);
1751     hPtDeltaCut[iCut]        -> SetLineColor(fColCut[iCut]);
1752     hPtDeltaCut[iCut]        -> SetLineStyle(fLin);
1753     hPtDeltaCut[iCut]        -> SetLineWidth(fWid);
1754     hPtDeltaCut[iCut]        -> SetTitle(sTitle.Data());
1755     hPtDeltaCut[iCut]        -> SetTitleFont(fTxt);
1756     hPtDeltaCut[iCut]        -> GetXaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1757     hPtDeltaCut[iCut]        -> GetXaxis() -> SetTitle(sPtDeltaAxis.Data());
1758     hPtDeltaCut[iCut]        -> GetXaxis() -> SetTitleFont(fTxt);
1759     hPtDeltaCut[iCut]        -> GetXaxis() -> SetTitleSize(fTit[1]);
1760     hPtDeltaCut[iCut]        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1761     hPtDeltaCut[iCut]        -> GetXaxis() -> SetLabelFont(fTxt);
1762     hPtDeltaCut[iCut]        -> GetXaxis() -> SetLabelSize(fLab[1]);
1763     hPtDeltaCut[iCut]        -> GetXaxis() -> CenterTitle(fCnt);
1764     hPtDeltaCut[iCut]        -> GetYaxis() -> SetTitle(sCounts.Data());
1765     hPtDeltaCut[iCut]        -> GetYaxis() -> SetTitleFont(fTxt);
1766     hPtDeltaCut[iCut]        -> GetYaxis() -> SetTitleSize(fTit[1]);
1767     hPtDeltaCut[iCut]        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1768     hPtDeltaCut[iCut]        -> GetYaxis() -> SetLabelFont(fTxt);
1769     hPtDeltaCut[iCut]        -> GetYaxis() -> SetLabelSize(fLab[1]);
1770     hPtDeltaCut[iCut]        -> GetYaxis() -> CenterTitle(fCnt);
1771     hPtTrackCut[iCut]        -> SetMarkerColor(fColCut[iCut]);
1772     hPtTrackCut[iCut]        -> SetMarkerStyle(fMarCut[iCut]);
1773     hPtTrackCut[iCut]        -> SetFillColor(fColCut[iCut]);
1774     hPtTrackCut[iCut]        -> SetFillStyle(fFil);
1775     hPtTrackCut[iCut]        -> SetLineColor(fColCut[iCut]);
1776     hPtTrackCut[iCut]        -> SetLineStyle(fLin);
1777     hPtTrackCut[iCut]        -> SetLineWidth(fWid);
1778     hPtTrackCut[iCut]        -> SetTitle(sTitle.Data());
1779     hPtTrackCut[iCut]        -> SetTitleFont(fTxt);
1780     hPtTrackCut[iCut]        -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1781     hPtTrackCut[iCut]        -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1782     hPtTrackCut[iCut]        -> GetXaxis() -> SetTitleFont(fTxt);
1783     hPtTrackCut[iCut]        -> GetXaxis() -> SetTitleSize(fTit[1]);
1784     hPtTrackCut[iCut]        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1785     hPtTrackCut[iCut]        -> GetXaxis() -> SetLabelFont(fTxt);
1786     hPtTrackCut[iCut]        -> GetXaxis() -> SetLabelSize(fLab[1]);
1787     hPtTrackCut[iCut]        -> GetXaxis() -> CenterTitle(fCnt);
1788     hPtTrackCut[iCut]        -> GetYaxis() -> SetTitle(sCounts.Data());
1789     hPtTrackCut[iCut]        -> GetYaxis() -> SetTitleFont(fTxt);
1790     hPtTrackCut[iCut]        -> GetYaxis() -> SetTitleSize(fTit[1]);
1791     hPtTrackCut[iCut]        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1792     hPtTrackCut[iCut]        -> GetYaxis() -> SetLabelFont(fTxt);
1793     hPtTrackCut[iCut]        -> GetYaxis() -> SetLabelSize(fLab[1]);
1794     hPtTrackCut[iCut]        -> GetYaxis() -> CenterTitle(fCnt);
1795     hPtFracCut[iCut]         -> SetMarkerColor(fColCut[iCut]);
1796     hPtFracCut[iCut]         -> SetMarkerStyle(fMarCut[iCut]);
1797     hPtFracCut[iCut]         -> SetFillColor(fColCut[iCut]);
1798     hPtFracCut[iCut]         -> SetFillStyle(fFil);
1799     hPtFracCut[iCut]         -> SetLineColor(fColCut[iCut]);
1800     hPtFracCut[iCut]         -> SetLineStyle(fLin);
1801     hPtFracCut[iCut]         -> SetLineWidth(fWid);
1802     hPtFracCut[iCut]         -> SetTitle(sTitle.Data());
1803     hPtFracCut[iCut]         -> SetTitleFont(fTxt);
1804     hPtFracCut[iCut]         -> GetXaxis() -> SetRangeUser(rFracRange[0], rFracRange[1]);
1805     hPtFracCut[iCut]         -> GetXaxis() -> SetTitle(sPtFracAxis.Data());
1806     hPtFracCut[iCut]         -> GetXaxis() -> SetTitleFont(fTxt);
1807     hPtFracCut[iCut]         -> GetXaxis() -> SetTitleSize(fTit[1]);
1808     hPtFracCut[iCut]         -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1809     hPtFracCut[iCut]         -> GetXaxis() -> SetLabelFont(fTxt);
1810     hPtFracCut[iCut]         -> GetXaxis() -> SetLabelSize(fLab[1]);
1811     hPtFracCut[iCut]         -> GetXaxis() -> CenterTitle(fCnt);
1812     hPtFracCut[iCut]         -> GetYaxis() -> SetTitle(sCounts.Data());
1813     hPtFracCut[iCut]         -> GetYaxis() -> SetTitleFont(fTxt);
1814     hPtFracCut[iCut]         -> GetYaxis() -> SetTitleSize(fTit[1]);
1815     hPtFracCut[iCut]         -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1816     hPtFracCut[iCut]         -> GetYaxis() -> SetLabelFont(fTxt);
1817     hPtFracCut[iCut]         -> GetYaxis() -> SetLabelSize(fLab[1]);
1818     hPtFracCut[iCut]         -> GetYaxis() -> CenterTitle(fCnt);
1819     hPtTrkTruCut[iCut]       -> SetMarkerColor(fColCut[iCut]);
1820     hPtTrkTruCut[iCut]       -> SetMarkerStyle(fMarCut[iCut]);
1821     hPtTrkTruCut[iCut]       -> SetFillColor(fColCut[iCut]);
1822     hPtTrkTruCut[iCut]       -> SetFillStyle(fFil);
1823     hPtTrkTruCut[iCut]       -> SetLineColor(fColCut[iCut]);
1824     hPtTrkTruCut[iCut]       -> SetLineStyle(fLin);
1825     hPtTrkTruCut[iCut]       -> SetLineWidth(fWid);
1826     hPtTrkTruCut[iCut]       -> SetTitle(sTitle.Data());
1827     hPtTrkTruCut[iCut]       -> SetTitleFont(fTxt);
1828     hPtTrkTruCut[iCut]       -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1829     hPtTrkTruCut[iCut]       -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
1830     hPtTrkTruCut[iCut]       -> GetXaxis() -> SetTitleFont(fTxt);
1831     hPtTrkTruCut[iCut]       -> GetXaxis() -> SetTitleSize(fTit[1]);
1832     hPtTrkTruCut[iCut]       -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1833     hPtTrkTruCut[iCut]       -> GetXaxis() -> SetLabelFont(fTxt);
1834     hPtTrkTruCut[iCut]       -> GetXaxis() -> SetLabelSize(fLab[1]);
1835     hPtTrkTruCut[iCut]       -> GetXaxis() -> CenterTitle(fCnt);
1836     hPtTrkTruCut[iCut]       -> GetYaxis() -> SetTitle(sCounts.Data());
1837     hPtTrkTruCut[iCut]       -> GetYaxis() -> SetTitleFont(fTxt);
1838     hPtTrkTruCut[iCut]       -> GetYaxis() -> SetTitleSize(fTit[1]);
1839     hPtTrkTruCut[iCut]       -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1840     hPtTrkTruCut[iCut]       -> GetYaxis() -> SetLabelFont(fTxt);
1841     hPtTrkTruCut[iCut]       -> GetYaxis() -> SetLabelSize(fLab[1]);
1842     hPtTrkTruCut[iCut]       -> GetYaxis() -> CenterTitle(fCnt);
1843     hPtDeltaVsFracCut[iCut]  -> SetMarkerColor(fColCut[iCut]);
1844     hPtDeltaVsFracCut[iCut]  -> SetMarkerStyle(fMarCut[iCut]);
1845     hPtDeltaVsFracCut[iCut]  -> SetFillColor(fColCut[iCut]);
1846     hPtDeltaVsFracCut[iCut]  -> SetFillStyle(fFil);
1847     hPtDeltaVsFracCut[iCut]  -> SetLineColor(fColCut[iCut]);
1848     hPtDeltaVsFracCut[iCut]  -> SetLineStyle(fLin);
1849     hPtDeltaVsFracCut[iCut]  -> SetLineWidth(fWid);
1850     hPtDeltaVsFracCut[iCut]  -> SetTitle(sTitle.Data());
1851     hPtDeltaVsFracCut[iCut]  -> SetTitleFont(fTxt);
1852     hPtDeltaVsFracCut[iCut]  -> GetXaxis() -> SetRangeUser(rFracRange[0], rFracRange[1]);
1853     hPtDeltaVsFracCut[iCut]  -> GetXaxis() -> SetTitle(sPtFracAxis.Data());
1854     hPtDeltaVsFracCut[iCut]  -> GetXaxis() -> SetTitleFont(fTxt);
1855     hPtDeltaVsFracCut[iCut]  -> GetXaxis() -> SetTitleSize(fTit[1]);
1856     hPtDeltaVsFracCut[iCut]  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1857     hPtDeltaVsFracCut[iCut]  -> GetXaxis() -> SetLabelFont(fTxt);
1858     hPtDeltaVsFracCut[iCut]  -> GetXaxis() -> SetLabelSize(fLab[1]);
1859     hPtDeltaVsFracCut[iCut]  -> GetXaxis() -> CenterTitle(fCnt);
1860     hPtDeltaVsFracCut[iCut]  -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1861     hPtDeltaVsFracCut[iCut]  -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
1862     hPtDeltaVsFracCut[iCut]  -> GetYaxis() -> SetTitleFont(fTxt);
1863     hPtDeltaVsFracCut[iCut]  -> GetYaxis() -> SetTitleSize(fTit[1]);
1864     hPtDeltaVsFracCut[iCut]  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1865     hPtDeltaVsFracCut[iCut]  -> GetYaxis() -> SetLabelFont(fTxt);
1866     hPtDeltaVsFracCut[iCut]  -> GetYaxis() -> SetLabelSize(fLab[1]);
1867     hPtDeltaVsFracCut[iCut]  -> GetYaxis() -> CenterTitle(fCnt);
1868     hPtDeltaVsFracCut[iCut]  -> GetZaxis() -> SetTitle(sCounts.Data());
1869     hPtDeltaVsFracCut[iCut]  -> GetZaxis() -> SetTitleFont(fTxt);
1870     hPtDeltaVsFracCut[iCut]  -> GetZaxis() -> SetTitleSize(fTit[1]);
1871     hPtDeltaVsFracCut[iCut]  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
1872     hPtDeltaVsFracCut[iCut]  -> GetZaxis() -> SetLabelFont(fTxt);
1873     hPtDeltaVsFracCut[iCut]  -> GetZaxis() -> SetLabelSize(fLab[1]);
1874     hPtDeltaVsFracCut[iCut]  -> GetZaxis() -> CenterTitle(fCnt);
1875     hPtDeltaVsTrueCut[iCut]  -> SetMarkerColor(fColTrk);
1876     hPtDeltaVsTrueCut[iCut]  -> SetMarkerStyle(fMarTrk);
1877     hPtDeltaVsTrueCut[iCut]  -> SetFillColor(fColTrk);
1878     hPtDeltaVsTrueCut[iCut]  -> SetFillStyle(fFil);
1879     hPtDeltaVsTrueCut[iCut]  -> SetLineColor(fColTrk);
1880     hPtDeltaVsTrueCut[iCut]  -> SetLineStyle(fLin);
1881     hPtDeltaVsTrueCut[iCut]  -> SetLineWidth(fWid);
1882     hPtDeltaVsTrueCut[iCut]  -> SetTitle(sTitle.Data());
1883     hPtDeltaVsTrueCut[iCut]  -> SetTitleFont(fTxt);
1884     hPtDeltaVsTrueCut[iCut]  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1885     hPtDeltaVsTrueCut[iCut]  -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
1886     hPtDeltaVsTrueCut[iCut]  -> GetXaxis() -> SetTitleFont(fTxt);
1887     hPtDeltaVsTrueCut[iCut]  -> GetXaxis() -> SetTitleSize(fTit[1]);
1888     hPtDeltaVsTrueCut[iCut]  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1889     hPtDeltaVsTrueCut[iCut]  -> GetXaxis() -> SetLabelFont(fTxt);
1890     hPtDeltaVsTrueCut[iCut]  -> GetXaxis() -> SetLabelSize(fLab[1]);
1891     hPtDeltaVsTrueCut[iCut]  -> GetXaxis() -> CenterTitle(fCnt);
1892     hPtDeltaVsTrueCut[iCut]  -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1893     hPtDeltaVsTrueCut[iCut]  -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
1894     hPtDeltaVsTrueCut[iCut]  -> GetYaxis() -> SetTitleFont(fTxt);
1895     hPtDeltaVsTrueCut[iCut]  -> GetYaxis() -> SetTitleSize(fTit[1]);
1896     hPtDeltaVsTrueCut[iCut]  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1897     hPtDeltaVsTrueCut[iCut]  -> GetYaxis() -> SetLabelFont(fTxt);
1898     hPtDeltaVsTrueCut[iCut]  -> GetYaxis() -> SetLabelSize(fLab[1]);
1899     hPtDeltaVsTrueCut[iCut]  -> GetYaxis() -> CenterTitle(fCnt);
1900     hPtDeltaVsTrueCut[iCut]  -> GetZaxis() -> SetTitle(sCounts.Data());
1901     hPtDeltaVsTrueCut[iCut]  -> GetZaxis() -> SetTitleFont(fTxt);
1902     hPtDeltaVsTrueCut[iCut]  -> GetZaxis() -> SetTitleSize(fTit[1]);
1903     hPtDeltaVsTrueCut[iCut]  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
1904     hPtDeltaVsTrueCut[iCut]  -> GetZaxis() -> SetLabelFont(fTxt);
1905     hPtDeltaVsTrueCut[iCut]  -> GetZaxis() -> SetLabelSize(fLab[1]);
1906     hPtDeltaVsTrueCut[iCut]  -> GetZaxis() -> CenterTitle(fCnt);
1907     hPtDeltaVsTrackCut[iCut] -> SetMarkerColor(fColTrk);
1908     hPtDeltaVsTrackCut[iCut] -> SetMarkerStyle(fMarTrk);
1909     hPtDeltaVsTrackCut[iCut] -> SetFillColor(fColTrk);
1910     hPtDeltaVsTrackCut[iCut] -> SetFillStyle(fFil);
1911     hPtDeltaVsTrackCut[iCut] -> SetLineColor(fColTrk);
1912     hPtDeltaVsTrackCut[iCut] -> SetLineStyle(fLin);
1913     hPtDeltaVsTrackCut[iCut] -> SetLineWidth(fWid);
1914     hPtDeltaVsTrackCut[iCut] -> SetTitle(sTitle.Data());
1915     hPtDeltaVsTrackCut[iCut] -> SetTitleFont(fTxt);
1916     hPtDeltaVsTrackCut[iCut] -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1917     hPtDeltaVsTrackCut[iCut] -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1918     hPtDeltaVsTrackCut[iCut] -> GetXaxis() -> SetTitleFont(fTxt);
1919     hPtDeltaVsTrackCut[iCut] -> GetXaxis() -> SetTitleSize(fTit[1]);
1920     hPtDeltaVsTrackCut[iCut] -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1921     hPtDeltaVsTrackCut[iCut] -> GetXaxis() -> SetLabelFont(fTxt);
1922     hPtDeltaVsTrackCut[iCut] -> GetXaxis() -> SetLabelSize(fLab[1]);
1923     hPtDeltaVsTrackCut[iCut] -> GetXaxis() -> CenterTitle(fCnt);
1924     hPtDeltaVsTrackCut[iCut] -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
1925     hPtDeltaVsTrackCut[iCut] -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
1926     hPtDeltaVsTrackCut[iCut] -> GetYaxis() -> SetTitleFont(fTxt);
1927     hPtDeltaVsTrackCut[iCut] -> GetYaxis() -> SetTitleSize(fTit[1]);
1928     hPtDeltaVsTrackCut[iCut] -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1929     hPtDeltaVsTrackCut[iCut] -> GetYaxis() -> SetLabelFont(fTxt);
1930     hPtDeltaVsTrackCut[iCut] -> GetYaxis() -> SetLabelSize(fLab[1]);
1931     hPtDeltaVsTrackCut[iCut] -> GetYaxis() -> CenterTitle(fCnt);
1932     hPtDeltaVsTrackCut[iCut] -> GetZaxis() -> SetTitle(sCounts.Data());
1933     hPtDeltaVsTrackCut[iCut] -> GetZaxis() -> SetTitleFont(fTxt);
1934     hPtDeltaVsTrackCut[iCut] -> GetZaxis() -> SetTitleSize(fTit[1]);
1935     hPtDeltaVsTrackCut[iCut] -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
1936     hPtDeltaVsTrackCut[iCut] -> GetZaxis() -> SetLabelFont(fTxt);
1937     hPtDeltaVsTrackCut[iCut] -> GetZaxis() -> SetLabelSize(fLab[1]);
1938     hPtDeltaVsTrackCut[iCut] -> GetZaxis() -> CenterTitle(fCnt);
1939     hPtTrueVsTrackCut[iCut]  -> SetMarkerColor(fColCut[iCut]);
1940     hPtTrueVsTrackCut[iCut]  -> SetMarkerStyle(fMarCut[iCut]);
1941     hPtTrueVsTrackCut[iCut]  -> SetFillColor(fColCut[iCut]);
1942     hPtTrueVsTrackCut[iCut]  -> SetFillStyle(fFil);
1943     hPtTrueVsTrackCut[iCut]  -> SetLineColor(fColCut[iCut]);
1944     hPtTrueVsTrackCut[iCut]  -> SetLineStyle(fLin);
1945     hPtTrueVsTrackCut[iCut]  -> SetLineWidth(fWid);
1946     hPtTrueVsTrackCut[iCut]  -> SetTitle(sTitle.Data());
1947     hPtTrueVsTrackCut[iCut]  -> SetTitleFont(fTxt);
1948     hPtTrueVsTrackCut[iCut]  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1949     hPtTrueVsTrackCut[iCut]  -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
1950     hPtTrueVsTrackCut[iCut]  -> GetXaxis() -> SetTitleFont(fTxt);
1951     hPtTrueVsTrackCut[iCut]  -> GetXaxis() -> SetTitleSize(fTit[1]);
1952     hPtTrueVsTrackCut[iCut]  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
1953     hPtTrueVsTrackCut[iCut]  -> GetXaxis() -> SetLabelFont(fTxt);
1954     hPtTrueVsTrackCut[iCut]  -> GetXaxis() -> SetLabelSize(fLab[1]);
1955     hPtTrueVsTrackCut[iCut]  -> GetXaxis() -> CenterTitle(fCnt);
1956     hPtTrueVsTrackCut[iCut]  -> GetYaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1957     hPtTrueVsTrackCut[iCut]  -> GetYaxis() -> SetTitle(sPtTrueAxis.Data());
1958     hPtTrueVsTrackCut[iCut]  -> GetYaxis() -> SetTitleFont(fTxt);
1959     hPtTrueVsTrackCut[iCut]  -> GetYaxis() -> SetTitleSize(fTit[1]);
1960     hPtTrueVsTrackCut[iCut]  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
1961     hPtTrueVsTrackCut[iCut]  -> GetYaxis() -> SetLabelFont(fTxt);
1962     hPtTrueVsTrackCut[iCut]  -> GetYaxis() -> SetLabelSize(fLab[1]);
1963     hPtTrueVsTrackCut[iCut]  -> GetYaxis() -> CenterTitle(fCnt);
1964     hPtTrueVsTrackCut[iCut]  -> GetZaxis() -> SetTitle(sCounts.Data());
1965     hPtTrueVsTrackCut[iCut]  -> GetZaxis() -> SetTitleFont(fTxt);
1966     hPtTrueVsTrackCut[iCut]  -> GetZaxis() -> SetTitleSize(fTit[1]);
1967     hPtTrueVsTrackCut[iCut]  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
1968     hPtTrueVsTrackCut[iCut]  -> GetZaxis() -> SetLabelFont(fTxt);
1969     hPtTrueVsTrackCut[iCut]  -> GetZaxis() -> SetLabelSize(fLab[1]);
1970     hPtTrueVsTrackCut[iCut]  -> GetZaxis() -> CenterTitle(fCnt);
1971   }
1972 
1973   // set styles of flat delta-pt cut histograms
1974   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
1975     hEffSig[iSig]            -> SetMarkerColor(fColSig[iSig]);
1976     hEffSig[iSig]            -> SetMarkerStyle(fMarSig[iSig]);
1977     hEffSig[iSig]            -> SetFillColor(fColSig[iSig]);
1978     hEffSig[iSig]            -> SetFillStyle(fFil);
1979     hEffSig[iSig]            -> SetLineColor(fColSig[iSig]);
1980     hEffSig[iSig]            -> SetLineStyle(fLin);
1981     hEffSig[iSig]            -> SetLineWidth(fWid);
1982     hEffSig[iSig]            -> SetTitle(sTitle.Data());
1983     hEffSig[iSig]            -> SetTitleFont(fTxt);
1984     hEffSig[iSig]            -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
1985     hEffSig[iSig]            -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
1986     hEffSig[iSig]            -> GetXaxis() -> SetTitleFont(fTxt);
1987     hEffSig[iSig]            -> GetXaxis() -> SetTitleSize(fTit[0]);
1988     hEffSig[iSig]            -> GetXaxis() -> SetTitleOffset(fOffX[0]);
1989     hEffSig[iSig]            -> GetXaxis() -> SetLabelFont(fTxt);
1990     hEffSig[iSig]            -> GetXaxis() -> SetLabelSize(fLab[0]);
1991     hEffSig[iSig]            -> GetXaxis() -> CenterTitle(fCnt);
1992     hEffSig[iSig]            -> GetYaxis() -> SetTitle(sEffAxis.Data());
1993     hEffSig[iSig]            -> GetYaxis() -> SetTitleFont(fTxt);
1994     hEffSig[iSig]            -> GetYaxis() -> SetTitleSize(fTit[0]);
1995     hEffSig[iSig]            -> GetYaxis() -> SetTitleOffset(fOffY[0]);
1996     hEffSig[iSig]            -> GetYaxis() -> SetLabelFont(fTxt);
1997     hEffSig[iSig]            -> GetYaxis() -> SetLabelSize(fLab[0]);
1998     hEffSig[iSig]            -> GetYaxis() -> CenterTitle(fCnt);
1999     hPtDeltaSig[iSig]        -> SetMarkerColor(fColSig[iSig]);
2000     hPtDeltaSig[iSig]        -> SetMarkerStyle(fMarSig[iSig]);
2001     hPtDeltaSig[iSig]        -> SetFillColor(fColSig[iSig]);
2002     hPtDeltaSig[iSig]        -> SetFillStyle(fFil);
2003     hPtDeltaSig[iSig]        -> SetLineColor(fColSig[iSig]);
2004     hPtDeltaSig[iSig]        -> SetLineStyle(fLin);
2005     hPtDeltaSig[iSig]        -> SetLineWidth(fWid);
2006     hPtDeltaSig[iSig]        -> SetTitle(sTitle.Data());
2007     hPtDeltaSig[iSig]        -> SetTitleFont(fTxt);
2008     hPtDeltaSig[iSig]        -> GetXaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
2009     hPtDeltaSig[iSig]        -> GetXaxis() -> SetTitle(sPtDeltaAxis.Data());
2010     hPtDeltaSig[iSig]        -> GetXaxis() -> SetTitleFont(fTxt);
2011     hPtDeltaSig[iSig]        -> GetXaxis() -> SetTitleSize(fTit[1]);
2012     hPtDeltaSig[iSig]        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
2013     hPtDeltaSig[iSig]        -> GetXaxis() -> SetLabelFont(fTxt);
2014     hPtDeltaSig[iSig]        -> GetXaxis() -> SetLabelSize(fLab[1]);
2015     hPtDeltaSig[iSig]        -> GetXaxis() -> CenterTitle(fCnt);
2016     hPtDeltaSig[iSig]        -> GetYaxis() -> SetTitle(sCounts.Data());
2017     hPtDeltaSig[iSig]        -> GetYaxis() -> SetTitleFont(fTxt);
2018     hPtDeltaSig[iSig]        -> GetYaxis() -> SetTitleSize(fTit[1]);
2019     hPtDeltaSig[iSig]        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
2020     hPtDeltaSig[iSig]        -> GetYaxis() -> SetLabelFont(fTxt);
2021     hPtDeltaSig[iSig]        -> GetYaxis() -> SetLabelSize(fLab[1]);
2022     hPtDeltaSig[iSig]        -> GetYaxis() -> CenterTitle(fCnt);
2023     hPtTrackSig[iSig]        -> SetMarkerColor(fColSig[iSig]);
2024     hPtTrackSig[iSig]        -> SetMarkerStyle(fMarSig[iSig]);
2025     hPtTrackSig[iSig]        -> SetFillColor(fColSig[iSig]);
2026     hPtTrackSig[iSig]        -> SetFillStyle(fFil);
2027     hPtTrackSig[iSig]        -> SetLineColor(fColSig[iSig]);
2028     hPtTrackSig[iSig]        -> SetLineStyle(fLin);
2029     hPtTrackSig[iSig]        -> SetLineWidth(fWid);
2030     hPtTrackSig[iSig]        -> SetTitle(sTitle.Data());
2031     hPtTrackSig[iSig]        -> SetTitleFont(fTxt);
2032     hPtTrackSig[iSig]        -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
2033     hPtTrackSig[iSig]        -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
2034     hPtTrackSig[iSig]        -> GetXaxis() -> SetTitleFont(fTxt);
2035     hPtTrackSig[iSig]        -> GetXaxis() -> SetTitleSize(fTit[1]);
2036     hPtTrackSig[iSig]        -> GetXaxis() -> SetTitleOffset(fOffX[1]);
2037     hPtTrackSig[iSig]        -> GetXaxis() -> SetLabelFont(fTxt);
2038     hPtTrackSig[iSig]        -> GetXaxis() -> SetLabelSize(fLab[1]);
2039     hPtTrackSig[iSig]        -> GetXaxis() -> CenterTitle(fCnt);
2040     hPtTrackSig[iSig]        -> GetYaxis() -> SetTitle(sCounts.Data());
2041     hPtTrackSig[iSig]        -> GetYaxis() -> SetTitleFont(fTxt);
2042     hPtTrackSig[iSig]        -> GetYaxis() -> SetTitleSize(fTit[1]);
2043     hPtTrackSig[iSig]        -> GetYaxis() -> SetTitleOffset(fOffY[1]);
2044     hPtTrackSig[iSig]        -> GetYaxis() -> SetLabelFont(fTxt);
2045     hPtTrackSig[iSig]        -> GetYaxis() -> SetLabelSize(fLab[1]);
2046     hPtTrackSig[iSig]        -> GetYaxis() -> CenterTitle(fCnt);
2047     hPtFracSig[iSig]         -> SetMarkerColor(fColSig[iSig]);
2048     hPtFracSig[iSig]         -> SetMarkerStyle(fMarSig[iSig]);
2049     hPtFracSig[iSig]         -> SetFillColor(fColSig[iSig]);
2050     hPtFracSig[iSig]         -> SetFillStyle(fFil);
2051     hPtFracSig[iSig]         -> SetLineColor(fColSig[iSig]);
2052     hPtFracSig[iSig]         -> SetLineStyle(fLin);
2053     hPtFracSig[iSig]         -> SetLineWidth(fWid);
2054     hPtFracSig[iSig]         -> SetTitle(sTitle.Data());
2055     hPtFracSig[iSig]         -> SetTitleFont(fTxt);
2056     hPtFracSig[iSig]         -> GetXaxis() -> SetRangeUser(rFracRange[0], rFracRange[1]);
2057     hPtFracSig[iSig]         -> GetXaxis() -> SetTitle(sPtFracAxis.Data());
2058     hPtFracSig[iSig]         -> GetXaxis() -> SetTitleFont(fTxt);
2059     hPtFracSig[iSig]         -> GetXaxis() -> SetTitleSize(fTit[1]);
2060     hPtFracSig[iSig]         -> GetXaxis() -> SetTitleOffset(fOffX[1]);
2061     hPtFracSig[iSig]         -> GetXaxis() -> SetLabelFont(fTxt);
2062     hPtFracSig[iSig]         -> GetXaxis() -> SetLabelSize(fLab[1]);
2063     hPtFracSig[iSig]         -> GetXaxis() -> CenterTitle(fCnt);
2064     hPtFracSig[iSig]         -> GetYaxis() -> SetTitle(sCounts.Data());
2065     hPtFracSig[iSig]         -> GetYaxis() -> SetTitleFont(fTxt);
2066     hPtFracSig[iSig]         -> GetYaxis() -> SetTitleSize(fTit[1]);
2067     hPtFracSig[iSig]         -> GetYaxis() -> SetTitleOffset(fOffY[1]);
2068     hPtFracSig[iSig]         -> GetYaxis() -> SetLabelFont(fTxt);
2069     hPtFracSig[iSig]         -> GetYaxis() -> SetLabelSize(fLab[1]);
2070     hPtFracSig[iSig]         -> GetYaxis() -> CenterTitle(fCnt);
2071     hPtTrkTruSig[iSig]       -> SetMarkerColor(fColSig[iSig]);
2072     hPtTrkTruSig[iSig]       -> SetMarkerStyle(fMarSig[iSig]);
2073     hPtTrkTruSig[iSig]       -> SetFillColor(fColSig[iSig]);
2074     hPtTrkTruSig[iSig]       -> SetFillStyle(fFil);
2075     hPtTrkTruSig[iSig]       -> SetLineColor(fColSig[iSig]);
2076     hPtTrkTruSig[iSig]       -> SetLineStyle(fLin);
2077     hPtTrkTruSig[iSig]       -> SetLineWidth(fWid);
2078     hPtTrkTruSig[iSig]       -> SetTitle(sTitle.Data());
2079     hPtTrkTruSig[iSig]       -> SetTitleFont(fTxt);
2080     hPtTrkTruSig[iSig]       -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
2081     hPtTrkTruSig[iSig]       -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
2082     hPtTrkTruSig[iSig]       -> GetXaxis() -> SetTitleFont(fTxt);
2083     hPtTrkTruSig[iSig]       -> GetXaxis() -> SetTitleSize(fTit[1]);
2084     hPtTrkTruSig[iSig]       -> GetXaxis() -> SetTitleOffset(fOffX[1]);
2085     hPtTrkTruSig[iSig]       -> GetXaxis() -> SetLabelFont(fTxt);
2086     hPtTrkTruSig[iSig]       -> GetXaxis() -> SetLabelSize(fLab[1]);
2087     hPtTrkTruSig[iSig]       -> GetXaxis() -> CenterTitle(fCnt);
2088     hPtTrkTruSig[iSig]       -> GetYaxis() -> SetTitle(sCounts.Data());
2089     hPtTrkTruSig[iSig]       -> GetYaxis() -> SetTitleFont(fTxt);
2090     hPtTrkTruSig[iSig]       -> GetYaxis() -> SetTitleSize(fTit[1]);
2091     hPtTrkTruSig[iSig]       -> GetYaxis() -> SetTitleOffset(fOffY[1]);
2092     hPtTrkTruSig[iSig]       -> GetYaxis() -> SetLabelFont(fTxt);
2093     hPtTrkTruSig[iSig]       -> GetYaxis() -> SetLabelSize(fLab[1]);
2094     hPtTrkTruSig[iSig]       -> GetYaxis() -> CenterTitle(fCnt);
2095     hPtDeltaVsFracSig[iSig]  -> SetMarkerColor(fColSig[iSig]);
2096     hPtDeltaVsFracSig[iSig]  -> SetMarkerStyle(fMarSig[iSig]);
2097     hPtDeltaVsFracSig[iSig]  -> SetFillColor(fColSig[iSig]);
2098     hPtDeltaVsFracSig[iSig]  -> SetFillStyle(fFil);
2099     hPtDeltaVsFracSig[iSig]  -> SetLineColor(fColSig[iSig]);
2100     hPtDeltaVsFracSig[iSig]  -> SetLineStyle(fLin);
2101     hPtDeltaVsFracSig[iSig]  -> SetLineWidth(fWid);
2102     hPtDeltaVsFracSig[iSig]  -> SetTitle(sTitle.Data());
2103     hPtDeltaVsFracSig[iSig]  -> SetTitleFont(fTxt);
2104     hPtDeltaVsFracSig[iSig]  -> GetXaxis() -> SetRangeUser(rFracRange[0], rFracRange[1]);
2105     hPtDeltaVsFracSig[iSig]  -> GetXaxis() -> SetTitle(sPtFracAxis.Data());
2106     hPtDeltaVsFracSig[iSig]  -> GetXaxis() -> SetTitleFont(fTxt);
2107     hPtDeltaVsFracSig[iSig]  -> GetXaxis() -> SetTitleSize(fTit[1]);
2108     hPtDeltaVsFracSig[iSig]  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
2109     hPtDeltaVsFracSig[iSig]  -> GetXaxis() -> SetLabelFont(fTxt);
2110     hPtDeltaVsFracSig[iSig]  -> GetXaxis() -> SetLabelSize(fLab[1]);
2111     hPtDeltaVsFracSig[iSig]  -> GetXaxis() -> CenterTitle(fCnt);
2112     hPtDeltaVsFracSig[iSig]  -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
2113     hPtDeltaVsFracSig[iSig]  -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
2114     hPtDeltaVsFracSig[iSig]  -> GetYaxis() -> SetTitleFont(fTxt);
2115     hPtDeltaVsFracSig[iSig]  -> GetYaxis() -> SetTitleSize(fTit[1]);
2116     hPtDeltaVsFracSig[iSig]  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
2117     hPtDeltaVsFracSig[iSig]  -> GetYaxis() -> SetLabelFont(fTxt);
2118     hPtDeltaVsFracSig[iSig]  -> GetYaxis() -> SetLabelSize(fLab[1]);
2119     hPtDeltaVsFracSig[iSig]  -> GetYaxis() -> CenterTitle(fCnt);
2120     hPtDeltaVsFracSig[iSig]  -> GetZaxis() -> SetTitle(sCounts.Data());
2121     hPtDeltaVsFracSig[iSig]  -> GetZaxis() -> SetTitleFont(fTxt);
2122     hPtDeltaVsFracSig[iSig]  -> GetZaxis() -> SetTitleSize(fTit[1]);
2123     hPtDeltaVsFracSig[iSig]  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
2124     hPtDeltaVsFracSig[iSig]  -> GetZaxis() -> SetLabelFont(fTxt);
2125     hPtDeltaVsFracSig[iSig]  -> GetZaxis() -> SetLabelSize(fLab[1]);
2126     hPtDeltaVsFracSig[iSig]  -> GetZaxis() -> CenterTitle(fCnt);
2127     hPtDeltaVsTrueSig[iSig]  -> SetMarkerColor(fColTrk);
2128     hPtDeltaVsTrueSig[iSig]  -> SetMarkerStyle(fMarTrk);
2129     hPtDeltaVsTrueSig[iSig]  -> SetFillColor(fColTrk);
2130     hPtDeltaVsTrueSig[iSig]  -> SetFillStyle(fFil);
2131     hPtDeltaVsTrueSig[iSig]  -> SetLineColor(fColTrk);
2132     hPtDeltaVsTrueSig[iSig]  -> SetLineStyle(fLin);
2133     hPtDeltaVsTrueSig[iSig]  -> SetLineWidth(fWid);
2134     hPtDeltaVsTrueSig[iSig]  -> SetTitle(sTitle.Data());
2135     hPtDeltaVsTrueSig[iSig]  -> SetTitleFont(fTxt);
2136     hPtDeltaVsTrueSig[iSig]  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
2137     hPtDeltaVsTrueSig[iSig]  -> GetXaxis() -> SetTitle(sPtTrueAxis.Data());
2138     hPtDeltaVsTrueSig[iSig]  -> GetXaxis() -> SetTitleFont(fTxt);
2139     hPtDeltaVsTrueSig[iSig]  -> GetXaxis() -> SetTitleSize(fTit[1]);
2140     hPtDeltaVsTrueSig[iSig]  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
2141     hPtDeltaVsTrueSig[iSig]  -> GetXaxis() -> SetLabelFont(fTxt);
2142     hPtDeltaVsTrueSig[iSig]  -> GetXaxis() -> SetLabelSize(fLab[1]);
2143     hPtDeltaVsTrueSig[iSig]  -> GetXaxis() -> CenterTitle(fCnt);
2144     hPtDeltaVsTrueSig[iSig]  -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
2145     hPtDeltaVsTrueSig[iSig]  -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
2146     hPtDeltaVsTrueSig[iSig]  -> GetYaxis() -> SetTitleFont(fTxt);
2147     hPtDeltaVsTrueSig[iSig]  -> GetYaxis() -> SetTitleSize(fTit[1]);
2148     hPtDeltaVsTrueSig[iSig]  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
2149     hPtDeltaVsTrueSig[iSig]  -> GetYaxis() -> SetLabelFont(fTxt);
2150     hPtDeltaVsTrueSig[iSig]  -> GetYaxis() -> SetLabelSize(fLab[1]);
2151     hPtDeltaVsTrueSig[iSig]  -> GetYaxis() -> CenterTitle(fCnt);
2152     hPtDeltaVsTrueSig[iSig]  -> GetZaxis() -> SetTitle(sCounts.Data());
2153     hPtDeltaVsTrueSig[iSig]  -> GetZaxis() -> SetTitleFont(fTxt);
2154     hPtDeltaVsTrueSig[iSig]  -> GetZaxis() -> SetTitleSize(fTit[1]);
2155     hPtDeltaVsTrueSig[iSig]  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
2156     hPtDeltaVsTrueSig[iSig]  -> GetZaxis() -> SetLabelFont(fTxt);
2157     hPtDeltaVsTrueSig[iSig]  -> GetZaxis() -> SetLabelSize(fLab[1]);
2158     hPtDeltaVsTrueSig[iSig]  -> GetZaxis() -> CenterTitle(fCnt);
2159     hPtDeltaVsTrackSig[iSig] -> SetMarkerColor(fColTrk);
2160     hPtDeltaVsTrackSig[iSig] -> SetMarkerStyle(fMarTrk);
2161     hPtDeltaVsTrackSig[iSig] -> SetFillColor(fColTrk);
2162     hPtDeltaVsTrackSig[iSig] -> SetFillStyle(fFil);
2163     hPtDeltaVsTrackSig[iSig] -> SetLineColor(fColTrk);
2164     hPtDeltaVsTrackSig[iSig] -> SetLineStyle(fLin);
2165     hPtDeltaVsTrackSig[iSig] -> SetLineWidth(fWid);
2166     hPtDeltaVsTrackSig[iSig] -> SetTitle(sTitle.Data());
2167     hPtDeltaVsTrackSig[iSig] -> SetTitleFont(fTxt);
2168     hPtDeltaVsTrackSig[iSig] -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
2169     hPtDeltaVsTrackSig[iSig] -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
2170     hPtDeltaVsTrackSig[iSig] -> GetXaxis() -> SetTitleFont(fTxt);
2171     hPtDeltaVsTrackSig[iSig] -> GetXaxis() -> SetTitleSize(fTit[1]);
2172     hPtDeltaVsTrackSig[iSig] -> GetXaxis() -> SetTitleOffset(fOffX[1]);
2173     hPtDeltaVsTrackSig[iSig] -> GetXaxis() -> SetLabelFont(fTxt);
2174     hPtDeltaVsTrackSig[iSig] -> GetXaxis() -> SetLabelSize(fLab[1]);
2175     hPtDeltaVsTrackSig[iSig] -> GetXaxis() -> CenterTitle(fCnt);
2176     hPtDeltaVsTrackSig[iSig] -> GetYaxis() -> SetRangeUser(rDeltaRange[0], rDeltaRange[1]);
2177     hPtDeltaVsTrackSig[iSig] -> GetYaxis() -> SetTitle(sPtDeltaAxis.Data());
2178     hPtDeltaVsTrackSig[iSig] -> GetYaxis() -> SetTitleFont(fTxt);
2179     hPtDeltaVsTrackSig[iSig] -> GetYaxis() -> SetTitleSize(fTit[1]);
2180     hPtDeltaVsTrackSig[iSig] -> GetYaxis() -> SetTitleOffset(fOffY[1]);
2181     hPtDeltaVsTrackSig[iSig] -> GetYaxis() -> SetLabelFont(fTxt);
2182     hPtDeltaVsTrackSig[iSig] -> GetYaxis() -> SetLabelSize(fLab[1]);
2183     hPtDeltaVsTrackSig[iSig] -> GetYaxis() -> CenterTitle(fCnt);
2184     hPtDeltaVsTrackSig[iSig] -> GetZaxis() -> SetTitle(sCounts.Data());
2185     hPtDeltaVsTrackSig[iSig] -> GetZaxis() -> SetTitleFont(fTxt);
2186     hPtDeltaVsTrackSig[iSig] -> GetZaxis() -> SetTitleSize(fTit[1]);
2187     hPtDeltaVsTrackSig[iSig] -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
2188     hPtDeltaVsTrackSig[iSig] -> GetZaxis() -> SetLabelFont(fTxt);
2189     hPtDeltaVsTrackSig[iSig] -> GetZaxis() -> SetLabelSize(fLab[1]);
2190     hPtDeltaVsTrackSig[iSig] -> GetZaxis() -> CenterTitle(fCnt);
2191     hPtTrueVsTrackSig[iSig]  -> SetMarkerColor(fColSig[iSig]);
2192     hPtTrueVsTrackSig[iSig]  -> SetMarkerStyle(fMarSig[iSig]);
2193     hPtTrueVsTrackSig[iSig]  -> SetFillColor(fColSig[iSig]);
2194     hPtTrueVsTrackSig[iSig]  -> SetFillStyle(fFil);
2195     hPtTrueVsTrackSig[iSig]  -> SetLineColor(fColSig[iSig]);
2196     hPtTrueVsTrackSig[iSig]  -> SetLineStyle(fLin);
2197     hPtTrueVsTrackSig[iSig]  -> SetLineWidth(fWid);
2198     hPtTrueVsTrackSig[iSig]  -> SetTitle(sTitle.Data());
2199     hPtTrueVsTrackSig[iSig]  -> SetTitleFont(fTxt);
2200     hPtTrueVsTrackSig[iSig]  -> GetXaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
2201     hPtTrueVsTrackSig[iSig]  -> GetXaxis() -> SetTitle(sPtRecoAxis.Data());
2202     hPtTrueVsTrackSig[iSig]  -> GetXaxis() -> SetTitleFont(fTxt);
2203     hPtTrueVsTrackSig[iSig]  -> GetXaxis() -> SetTitleSize(fTit[1]);
2204     hPtTrueVsTrackSig[iSig]  -> GetXaxis() -> SetTitleOffset(fOffX[1]);
2205     hPtTrueVsTrackSig[iSig]  -> GetXaxis() -> SetLabelFont(fTxt);
2206     hPtTrueVsTrackSig[iSig]  -> GetXaxis() -> SetLabelSize(fLab[1]);
2207     hPtTrueVsTrackSig[iSig]  -> GetXaxis() -> CenterTitle(fCnt);
2208     hPtTrueVsTrackSig[iSig]  -> GetYaxis() -> SetRangeUser(rPtRange[0], rPtRange[1]);
2209     hPtTrueVsTrackSig[iSig]  -> GetYaxis() -> SetTitle(sPtTrueAxis.Data());
2210     hPtTrueVsTrackSig[iSig]  -> GetYaxis() -> SetTitleFont(fTxt);
2211     hPtTrueVsTrackSig[iSig]  -> GetYaxis() -> SetTitleSize(fTit[1]);
2212     hPtTrueVsTrackSig[iSig]  -> GetYaxis() -> SetTitleOffset(fOffY[1]);
2213     hPtTrueVsTrackSig[iSig]  -> GetYaxis() -> SetLabelFont(fTxt);
2214     hPtTrueVsTrackSig[iSig]  -> GetYaxis() -> SetLabelSize(fLab[1]);
2215     hPtTrueVsTrackSig[iSig]  -> GetYaxis() -> CenterTitle(fCnt);
2216     hPtTrueVsTrackSig[iSig]  -> GetZaxis() -> SetTitle(sCounts.Data());
2217     hPtTrueVsTrackSig[iSig]  -> GetZaxis() -> SetTitleFont(fTxt);
2218     hPtTrueVsTrackSig[iSig]  -> GetZaxis() -> SetTitleSize(fTit[1]);
2219     hPtTrueVsTrackSig[iSig]  -> GetZaxis() -> SetTitleOffset(fOffZ[1]);
2220     hPtTrueVsTrackSig[iSig]  -> GetZaxis() -> SetLabelFont(fTxt);
2221     hPtTrueVsTrackSig[iSig]  -> GetZaxis() -> SetLabelSize(fLab[1]);
2222     hPtTrueVsTrackSig[iSig]  -> GetZaxis() -> CenterTitle(fCnt);
2223   }
2224   cout << "    Set styles." << endl;
2225 
2226   // make legends
2227   const UInt_t  fColLe          = 0;
2228   const UInt_t  fFilLe          = 0;
2229   const UInt_t  fLinLe          = 0;
2230   const Float_t yObjLe          = 0.1 + ((NDPtCuts + 2) * 0.05);
2231   const Float_t yObjMu          = 0.1 + ((NSigCuts + 1) * 0.05);
2232   const Float_t yObjDel         = 0.1 + (NSigCuts * 0.05);
2233   const Float_t yObjPro         = 0.1 + (NProj * 0.05);
2234   const Float_t yObjSig         = 0.1 + ((NSigCuts + 2) * 0.05);
2235   const Float_t fLegXY[NVtx]    = {0.1, 0.1, 0.3, yObjLe};
2236   const Float_t fLegMuXY[NVtx]  = {0.1, 0.1, 0.3, yObjMu};
2237   const Float_t fLegDelXY[NVtx] = {0.1, 0.1, 0.3, yObjDel};
2238   const Float_t fLegProXY[NVtx] = {0.1, 0.1, 0.3, yObjPro};
2239   const Float_t fLegSigXY[NVtx] = {0.1, 0.1, 0.3, yObjSig};
2240 
2241   TLegend *leg = new TLegend(fLegXY[0], fLegXY[1], fLegXY[2], fLegXY[3]);
2242   leg -> SetFillColor(fColLe);
2243   leg -> SetFillStyle(fFilLe);
2244   leg -> SetLineColor(fColLe);
2245   leg -> SetLineStyle(fLinLe);
2246   leg -> SetTextFont(fTxt);
2247   leg -> SetTextAlign(fAln);
2248   leg -> AddEntry(hPtTruth,  sLegTrue.Data(),  "pf");
2249   leg -> AddEntry(hPtTrkTru, sLegTrack.Data(), "pf");
2250   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
2251     leg -> AddEntry(hPtTrkTruCut[iCut], sLegCut[iCut].Data(), "pf");
2252   }
2253 
2254   TLegend *legMu = new TLegend(fLegMuXY[0], fLegMuXY[1], fLegMuXY[2], fLegMuXY[3]);
2255   legMu -> SetFillColor(fColLe);
2256   legMu -> SetFillStyle(fFilLe);
2257   legMu -> SetLineColor(fColLe);
2258   legMu -> SetLineStyle(fLinLe);
2259   legMu -> SetTextFont(fTxt);
2260   legMu -> SetTextAlign(fAln);
2261   legMu -> AddEntry(grMuProj, sLegMu.Data(), "p");
2262   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2263     legMu -> AddEntry(grMuHiProj[iSig], sLegProjSig[iSig].Data(), "p");
2264   }
2265 
2266   TLegend *legDel = new TLegend(fLegDelXY[0], fLegDelXY[1], fLegDelXY[2], fLegDelXY[3]);
2267   legDel -> SetFillColor(fColLe);
2268   legDel -> SetFillStyle(fFilLe);
2269   legDel -> SetLineColor(fColLe);
2270   legDel -> SetLineStyle(fLinLe);
2271   legDel -> SetTextFont(fTxt);
2272   legDel -> SetTextAlign(fAln);
2273   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2274     legDel -> AddEntry(fMuHiProj[iSig], sLegDelta[iSig].Data(), "l");
2275   }
2276 
2277   TLegend *legPro = new TLegend(fLegProXY[0], fLegProXY[1], fLegProXY[2], fLegProXY[3]);
2278   legPro -> SetFillColor(fColLe);
2279   legPro -> SetFillStyle(fFilLe);
2280   legPro -> SetLineColor(fColLe);
2281   legPro -> SetLineStyle(fLinLe);
2282   legPro -> SetTextFont(fTxt);
2283   legPro -> SetTextAlign(fAln);
2284   for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
2285     legPro -> AddEntry(hPtDeltaProj[iProj], sLegProj[iProj].Data(), "pf");
2286   }
2287 
2288   TLegend *legSig = new TLegend(fLegSigXY[0], fLegSigXY[1], fLegSigXY[2], fLegSigXY[3]);
2289   legSig -> SetFillColor(fColLe);
2290   legSig -> SetFillStyle(fFilLe);
2291   legSig -> SetLineColor(fColLe);
2292   legSig -> SetLineStyle(fLinLe);
2293   legSig -> SetTextFont(fTxt);
2294   legSig -> SetTextAlign(fAln);
2295   legSig -> AddEntry(hPtTruth,  sLegTrue.Data(),  "pf");
2296   legSig -> AddEntry(hPtTrkTru, sLegTrack.Data(), "pf");
2297   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2298     legSig -> AddEntry(hPtTrkTruSig[iSig], sLegSig[iSig].Data(), "pf");
2299   }
2300   cout << "    Made legends." << endl;
2301 
2302   // make text boxes
2303   const UInt_t  fColInf       = 0;
2304   const UInt_t  fFilInf       = 0;
2305   const UInt_t  fLinInf       = 0;
2306   const Float_t yObjInf       = 0.1 + (NTxt * 0.05);
2307   const Float_t yObjCut       = 0.1 + (NTrkCuts * 0.05);
2308   const Float_t fInfXY[NVtx] = {0.3, 0.1, 0.5, yObjInf};
2309   const Float_t fCutXY[NVtx] = {0.5, 0.1, 0.7, yObjCut};
2310 
2311   TPaveText *info = new TPaveText(fInfXY[0], fInfXY[1], fInfXY[2], fInfXY[3], "NDC NB");
2312   info -> SetFillColor(fColInf);
2313   info -> SetFillStyle(fFilInf);
2314   info -> SetLineColor(fColInf);
2315   info -> SetLineStyle(fLinInf);
2316   info -> SetTextFont(fTxt);
2317   info -> SetTextAlign(fAln);
2318   for (Ssiz_t iTxt = 0; iTxt < NTxt; iTxt++) {
2319     info -> AddText(sInfo[iTxt].Data());
2320   }
2321 
2322   TPaveText *cuts = new TPaveText(fCutXY[0], fCutXY[1], fCutXY[2], fCutXY[3], "NDC NB");
2323   cuts -> SetFillColor(fColInf);
2324   cuts -> SetFillStyle(fFilInf);
2325   cuts -> SetLineColor(fColInf);
2326   cuts -> SetLineStyle(fLinInf);
2327   cuts -> SetTextFont(fTxt);
2328   cuts -> SetTextAlign(fAln);
2329   for (Ssiz_t iTrkCut = 0; iTrkCut < NTrkCuts; iTrkCut++) {
2330     cuts -> AddText(sTrkCuts[iTrkCut].Data());
2331   }
2332   cout << "    Made text." << endl;
2333 
2334   // make line
2335   const UInt_t  fColLi       = 1;
2336   const UInt_t  fLinLi       = 9;
2337   const UInt_t  fWidLi       = 1;
2338   const Float_t fLinXY[NVtx] = {rPtRange[0], 1., rPtRange[1], 1.};
2339 
2340   TLine *line = new TLine(fLinXY[0], fLinXY[1], fLinXY[2], fLinXY[3]);
2341   line -> SetLineColor(fColLi);
2342   line -> SetLineStyle(fLinLi);
2343   line -> SetLineWidth(fWidLi);
2344   cout << "    Made line." << endl;
2345 
2346   // make plots
2347   const UInt_t  width(750);
2348   const UInt_t  width2D(1500);
2349   const UInt_t  height(950);
2350   const UInt_t  heightNR(750);
2351   const UInt_t  fMode(0);
2352   const UInt_t  fBord(2);
2353   const UInt_t  fGrid(0);
2354   const UInt_t  fTick(1);
2355   const UInt_t  fLogX(0);
2356   const UInt_t  fLogY1(1);
2357   const UInt_t  fLogY2(1);
2358   const UInt_t  fLogYNR(0);
2359   const UInt_t  fFrame(0);
2360   const Float_t fMarginL(0.15);
2361   const Float_t fMarginR(0.02);
2362   const Float_t fMarginR2D(0.15);
2363   const Float_t fMarginT1(0.005);
2364   const Float_t fMarginT2(0.02);
2365   const Float_t fMarginTNR(0.02);
2366   const Float_t fMarginB1(0.25);
2367   const Float_t fMarginB2(0.005);
2368   const Float_t fMarginBNR(0.15);
2369   const Float_t fEffXY[NVtx]       = {0.,  0.,   1.,  0.35};
2370   const Float_t fTrksXY[NVtx]      = {0.,  0.35, 1.,  1.};
2371   const Float_t fTwoDimXY[NVtx]    = {0.,  0.,   0.5, 1.};
2372   const Float_t fProjectXY[NVtx]   = {0.5, 0.,   1.,  1.};
2373   const Float_t fBeforeDPtXY[NVtx] = {0.,  0.,   0.5, 1.};
2374   const Float_t fAfterDPtXY[NVtx]  = {0.5, 0.,   1.,  1.};
2375 
2376   TCanvas *cEffCut = new TCanvas("cEfficiency_FlatCut", "", width, height);
2377   TPad    *pEffCut = new TPad("pEffCut", "", fEffXY[0],  fEffXY[1],  fEffXY[2],  fEffXY[3]);
2378   TPad    *pTrkCut = new TPad("pTrkCut", "", fTrksXY[0], fTrksXY[1], fTrksXY[2], fTrksXY[3]);
2379   cEffCut -> SetGrid(fGrid, fGrid);
2380   cEffCut -> SetTicks(fTick, fTick);
2381   cEffCut -> SetBorderMode(fMode);
2382   cEffCut -> SetBorderSize(fBord);
2383   pEffCut -> SetGrid(fGrid, fGrid);
2384   pEffCut -> SetTicks(fTick, fTick);
2385   pEffCut -> SetLogx(fLogX);
2386   pEffCut -> SetLogy(fLogY1);
2387   pEffCut -> SetBorderMode(fMode);
2388   pEffCut -> SetBorderSize(fBord);
2389   pEffCut -> SetFrameBorderMode(fFrame);
2390   pEffCut -> SetLeftMargin(fMarginL);
2391   pEffCut -> SetRightMargin(fMarginR);
2392   pEffCut -> SetTopMargin(fMarginT1);
2393   pEffCut -> SetBottomMargin(fMarginB1);
2394   pTrkCut -> SetGrid(fGrid, fGrid);
2395   pTrkCut -> SetTicks(fTick, fTick);
2396   pTrkCut -> SetLogx(fLogX);
2397   pTrkCut -> SetLogy(fLogY2);
2398   pTrkCut -> SetBorderMode(fMode);
2399   pTrkCut -> SetBorderSize(fBord);
2400   pTrkCut -> SetFrameBorderMode(fFrame);
2401   pTrkCut -> SetLeftMargin(fMarginL);
2402   pTrkCut -> SetRightMargin(fMarginR);
2403   pTrkCut -> SetTopMargin(fMarginT2);
2404   pTrkCut -> SetBottomMargin(fMarginB2);
2405   cEffCut -> cd();
2406   pEffCut -> Draw();
2407   pTrkCut -> Draw();
2408   pEffCut -> cd();
2409   hEff    -> Draw();
2410   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
2411     hEffCut[iCut] -> Draw("SAME");
2412   }
2413   line      -> Draw();
2414   pTrkCut   -> cd();
2415   hPtTruth  -> Draw();
2416   hPtTrkTru -> Draw("SAME");
2417   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
2418     hPtTrkTruCut[iCut] -> Draw("SAME");
2419   }
2420   leg     -> Draw();
2421   info    -> Draw();
2422   cuts    -> Draw();
2423   fOutput -> cd();
2424   cEffCut -> Write();
2425   cEffCut -> Close();
2426 
2427   TCanvas *cEffSig = new TCanvas("cEfficiency_SigmaCut", "", width, height);
2428   TPad    *pEffSig = new TPad("pEffSig", "", fEffXY[0],  fEffXY[1],  fEffXY[2],  fEffXY[3]);
2429   TPad    *pTrkSig = new TPad("pTrkSig", "", fTrksXY[0], fTrksXY[1], fTrksXY[2], fTrksXY[3]);
2430   cEffSig -> SetGrid(fGrid, fGrid);
2431   cEffSig -> SetTicks(fTick, fTick);
2432   cEffSig -> SetBorderMode(fMode);
2433   cEffSig -> SetBorderSize(fBord);
2434   pEffSig -> SetGrid(fGrid, fGrid);
2435   pEffSig -> SetTicks(fTick, fTick);
2436   pEffSig -> SetLogx(fLogX);
2437   pEffSig -> SetLogy(fLogY1);
2438   pEffSig -> SetBorderMode(fMode);
2439   pEffSig -> SetBorderSize(fBord);
2440   pEffSig -> SetFrameBorderMode(fFrame);
2441   pEffSig -> SetLeftMargin(fMarginL);
2442   pEffSig -> SetRightMargin(fMarginR);
2443   pEffSig -> SetTopMargin(fMarginT1);
2444   pEffSig -> SetBottomMargin(fMarginB1);
2445   pTrkSig -> SetGrid(fGrid, fGrid);
2446   pTrkSig -> SetTicks(fTick, fTick);
2447   pTrkSig -> SetLogx(fLogX);
2448   pTrkSig -> SetLogy(fLogY2);
2449   pTrkSig -> SetBorderMode(fMode);
2450   pTrkSig -> SetBorderSize(fBord);
2451   pTrkSig -> SetFrameBorderMode(fFrame);
2452   pTrkSig -> SetLeftMargin(fMarginL);
2453   pTrkSig -> SetRightMargin(fMarginR);
2454   pTrkSig -> SetTopMargin(fMarginT2);
2455   pTrkSig -> SetBottomMargin(fMarginB2);
2456   cEffSig -> cd();
2457   pEffSig -> Draw();
2458   pTrkSig -> Draw();
2459   pEffSig -> cd();
2460   hEff    -> Draw();
2461   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2462     hEffSig[iSig] -> Draw("SAME");
2463   }
2464   line      -> Draw();
2465   pTrkSig   -> cd();
2466   hPtTruth  -> Draw();
2467   hPtTrkTru -> Draw("SAME");
2468   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2469     hPtTrkTruSig[iSig] -> Draw("SAME");
2470   }
2471   legSig  -> Draw();
2472   info    -> Draw();
2473   cuts    -> Draw();
2474   fOutput -> cd();
2475   cEffSig -> Write();
2476   cEffSig -> Close();
2477 
2478   TCanvas *cRejCut = new TCanvas("cReject_FlatCut", "", width, heightNR);
2479   cRejCut  -> SetGrid(fGrid, fGrid);
2480   cRejCut  -> SetTicks(fTick, fTick);
2481   cRejCut  -> SetBorderMode(fMode);
2482   cRejCut  -> SetBorderSize(fBord);
2483   cRejCut  -> SetFrameBorderMode(fFrame);
2484   cRejCut  -> SetLeftMargin(fMarginL);
2485   cRejCut  -> SetRightMargin(fMarginR);
2486   cRejCut  -> SetTopMargin(fMarginTNR);
2487   cRejCut  -> SetBottomMargin(fMarginBNR);
2488   cRejCut  -> SetLogx(fLogX);
2489   cRejCut  -> SetLogy(fLogYNR);
2490   cRejCut  -> cd();
2491   grRejCut -> Draw("ALP");
2492   info     -> Draw();
2493   cuts     -> Draw();
2494   fOutput  -> cd();
2495   cRejCut  -> Write();
2496   cRejCut  -> Close();
2497 
2498   TCanvas *cRejSig = new TCanvas("cReject_SigmaCut", "", width, heightNR);
2499   cRejSig  -> SetGrid(fGrid, fGrid);
2500   cRejSig  -> SetTicks(fTick, fTick);
2501   cRejSig  -> SetBorderMode(fMode);
2502   cRejSig  -> SetBorderSize(fBord);
2503   cRejSig  -> SetFrameBorderMode(fFrame);
2504   cRejSig  -> SetLeftMargin(fMarginL);
2505   cRejSig  -> SetRightMargin(fMarginR);
2506   cRejSig  -> SetTopMargin(fMarginTNR);
2507   cRejSig  -> SetBottomMargin(fMarginBNR);
2508   cRejSig  -> SetLogx(fLogX);
2509   cRejSig  -> SetLogy(fLogYNR);
2510   cRejSig  -> cd();
2511   grRejSig -> Draw("ALP");
2512   info     -> Draw();
2513   cuts     -> Draw();
2514   fOutput  -> cd();
2515   cRejSig  -> Write();
2516   cRejSig  -> Close();
2517 
2518   TCanvas *cPtTruVsTrkCut = new TCanvas("cPtTruthVsReco_FlatCut", "", width2D, heightNR);
2519   TPad    *pBeforeCut     = new TPad("pBeforeCut", "", fBeforeDPtXY[0], fBeforeDPtXY[1], fBeforeDPtXY[2], fBeforeDPtXY[3]);
2520   TPad    *pAfterCut      = new TPad("pAfterCut",  "", fAfterDPtXY[0],  fAfterDPtXY[1],  fAfterDPtXY[2],  fAfterDPtXY[3]);
2521   cPtTruVsTrkCut                -> SetGrid(fGrid, fGrid);
2522   cPtTruVsTrkCut                -> SetTicks(fTick, fTick);
2523   cPtTruVsTrkCut                -> SetBorderMode(fMode);
2524   cPtTruVsTrkCut                -> SetBorderSize(fBord);
2525   pBeforeCut                    -> SetGrid(fGrid, fGrid);
2526   pBeforeCut                    -> SetTicks(fTick, fTick);
2527   pBeforeCut                    -> SetLogx(fLogX);
2528   pBeforeCut                    -> SetLogy(fLogYNR);
2529   pBeforeCut                    -> SetBorderMode(fMode);
2530   pBeforeCut                    -> SetBorderSize(fBord);
2531   pBeforeCut                    -> SetFrameBorderMode(fFrame);
2532   pBeforeCut                    -> SetLeftMargin(fMarginL);
2533   pBeforeCut                    -> SetRightMargin(fMarginR2D);
2534   pBeforeCut                    -> SetBottomMargin(fMarginBNR);
2535   pAfterCut                     -> SetGrid(fGrid, fGrid);
2536   pAfterCut                     -> SetTicks(fTick, fTick);
2537   pAfterCut                     -> SetLogx(fLogX);
2538   pAfterCut                     -> SetLogy(fLogYNR);
2539   pAfterCut                     -> SetBorderMode(fMode);
2540   pAfterCut                     -> SetBorderSize(fBord);
2541   pAfterCut                     -> SetFrameBorderMode(fFrame);
2542   pAfterCut                     -> SetLeftMargin(fMarginL);
2543   pAfterCut                     -> SetRightMargin(fMarginR2D);
2544   pAfterCut                     -> SetBottomMargin(fMarginBNR);
2545   cPtTruVsTrkCut                -> cd();
2546   pBeforeCut                    -> Draw();
2547   pAfterCut                     -> Draw();
2548   pBeforeCut                    -> cd();
2549   hPtTrueVsTrack                -> SetTitle(sBeforeTitle.Data());
2550   hPtTrueVsTrack                -> Draw("colz");
2551   cuts                          -> Draw();
2552   pAfterCut                     -> cd();
2553   hPtTrueVsTrackCut[iCutToDraw] -> SetTitle(sAfterCutTitle.Data());
2554   hPtTrueVsTrackCut[iCutToDraw] -> Draw("colz");
2555   info                          -> Draw();
2556   fOutput                       -> cd();
2557   cPtTruVsTrkCut                -> Write();
2558   cPtTruVsTrkCut                -> Close();
2559 
2560   TCanvas *cPtTruVsTrkSig = new TCanvas("cPtTruthVsReco_SigmaCut", "", width2D, heightNR);
2561   TPad    *pBeforeSig     = new TPad("pBeforeSig", "", fBeforeDPtXY[0], fBeforeDPtXY[1], fBeforeDPtXY[2], fBeforeDPtXY[3]);
2562   TPad    *pAfterSig      = new TPad("pAfterSig",  "", fAfterDPtXY[0],  fAfterDPtXY[1],  fAfterDPtXY[2],  fAfterDPtXY[3]);
2563   cPtTruVsTrkSig                -> SetGrid(fGrid, fGrid);
2564   cPtTruVsTrkSig                -> SetTicks(fTick, fTick);
2565   cPtTruVsTrkSig                -> SetBorderMode(fMode);
2566   cPtTruVsTrkSig                -> SetBorderSize(fBord);
2567   pBeforeSig                    -> SetGrid(fGrid, fGrid);
2568   pBeforeSig                    -> SetTicks(fTick, fTick);
2569   pBeforeSig                    -> SetLogx(fLogX);
2570   pBeforeSig                    -> SetLogy(fLogYNR);
2571   pBeforeSig                    -> SetBorderMode(fMode);
2572   pBeforeSig                    -> SetBorderSize(fBord);
2573   pBeforeSig                    -> SetFrameBorderMode(fFrame);
2574   pBeforeSig                    -> SetLeftMargin(fMarginL);
2575   pBeforeSig                    -> SetRightMargin(fMarginR2D);
2576   pBeforeSig                    -> SetBottomMargin(fMarginBNR);
2577   pAfterSig                     -> SetGrid(fGrid, fGrid);
2578   pAfterSig                     -> SetTicks(fTick, fTick);
2579   pAfterSig                     -> SetLogx(fLogX);
2580   pAfterSig                     -> SetLogy(fLogYNR);
2581   pAfterSig                     -> SetBorderMode(fMode);
2582   pAfterSig                     -> SetBorderSize(fBord);
2583   pAfterSig                     -> SetFrameBorderMode(fFrame);
2584   pAfterSig                     -> SetLeftMargin(fMarginL);
2585   pAfterSig                     -> SetRightMargin(fMarginR2D);
2586   pAfterSig                     -> SetBottomMargin(fMarginBNR);
2587   cPtTruVsTrkSig                -> cd();
2588   pBeforeSig                    -> Draw();
2589   pAfterSig                     -> Draw();
2590   pBeforeSig                    -> cd();
2591   hPtTrueVsTrack                -> Draw("colz");
2592   cuts                          -> Draw();
2593   pAfterSig                     -> cd();
2594   hPtTrueVsTrackSig[iSigToDraw] -> SetTitle(sAfterSigTitle.Data());
2595   hPtTrueVsTrackSig[iSigToDraw] -> Draw("colz");
2596   info                          -> Draw();
2597   fOutput                       -> cd();
2598   cPtTruVsTrkSig                -> Write();
2599   cPtTruVsTrkSig                -> Close();
2600 
2601   TCanvas *cPtDelVsTrk = new TCanvas("cPtDeltaVsTrack", "", width2D, heightNR);
2602   TPad    *pTwoDim     = new TPad("pTwoDim",      "", fTwoDimXY[0],  fTwoDimXY[1],  fTwoDimXY[2],  fTwoDimXY[3]);
2603   TPad    *pProject    = new TPad("pProjections", "", fProjectXY[0], fProjectXY[1], fProjectXY[2], fProjectXY[3]);
2604   cPtDelVsTrk     -> SetGrid(fGrid, fGrid);
2605   cPtDelVsTrk     -> SetTicks(fTick, fTick);
2606   cPtDelVsTrk     -> SetBorderMode(fMode);
2607   cPtDelVsTrk     -> SetBorderSize(fBord);
2608   pTwoDim         -> SetGrid(fGrid, fGrid);
2609   pTwoDim         -> SetTicks(fTick, fTick);
2610   pTwoDim         -> SetLogx(fLogX);
2611   pTwoDim         -> SetLogy(fLogYNR);
2612   pTwoDim         -> SetBorderMode(fMode);
2613   pTwoDim         -> SetBorderSize(fBord);
2614   pTwoDim         -> SetFrameBorderMode(fFrame);
2615   pTwoDim         -> SetLeftMargin(fMarginL);
2616   pTwoDim         -> SetRightMargin(fMarginR2D);
2617   pTwoDim         -> SetTopMargin(fMarginTNR);
2618   pTwoDim         -> SetBottomMargin(fMarginBNR);
2619   pProject        -> SetGrid(fGrid, fGrid);
2620   pProject        -> SetTicks(fTick, fTick);
2621   pProject        -> SetLogx(fLogX);
2622   pProject        -> SetLogy(fLogYNR);
2623   pProject        -> SetBorderMode(fMode);
2624   pProject        -> SetBorderSize(fBord);
2625   pProject        -> SetFrameBorderMode(fFrame);
2626   pProject        -> SetLeftMargin(fMarginL);
2627   pProject        -> SetRightMargin(fMarginR2D);
2628   pProject        -> SetTopMargin(fMarginTNR);
2629   pProject        -> SetBottomMargin(fMarginBNR);
2630   cPtDelVsTrk     -> cd();
2631   pTwoDim         -> Draw();
2632   pProject        -> Draw();
2633   pTwoDim         -> cd();
2634   hPtDeltaVsTrack -> Draw("colz");
2635   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2636     fMuHiProj[iSig] -> Draw("same");
2637     fMuLoProj[iSig] -> Draw("same");
2638   }
2639   legDel          -> Draw();
2640   cuts            -> Draw();
2641   pProject        -> cd();
2642   hPtDeltaProj[0] -> Draw();
2643   fPtDeltaProj[0] -> Draw("same");
2644   for (Ssiz_t iProj = 1; iProj < NProj; iProj++) {
2645     hPtDeltaProj[iProj] -> Draw("same");
2646     fPtDeltaProj[iProj] -> Draw("same");
2647   }
2648   legPro      -> Draw();
2649   info        -> Draw();
2650   fOutput     -> cd();
2651   cPtDelVsTrk -> Write();
2652   cPtDelVsTrk -> Close();
2653 
2654   TCanvas *cDeltaPt = new TCanvas("cDeltaPt", "", width, heightNR);
2655   cDeltaPt  -> SetGrid(fGrid, fGrid);
2656   cDeltaPt  -> SetTicks(fTick, fTick);
2657   cDeltaPt  -> SetBorderMode(fMode);
2658   cDeltaPt  -> SetBorderSize(fBord);
2659   cDeltaPt  -> SetFrameBorderMode(fFrame);
2660   cDeltaPt  -> SetLeftMargin(fMarginL);
2661   cDeltaPt  -> SetRightMargin(fMarginR);
2662   cDeltaPt  -> SetTopMargin(fMarginTNR);
2663   cDeltaPt  -> SetBottomMargin(fMarginBNR);
2664   cDeltaPt  -> SetLogx(fLogX);
2665   cDeltaPt  -> SetLogy(fLogYNR);
2666   cDeltaPt  -> cd();
2667   hPtDelta  -> Draw();
2668   info      -> Draw();
2669   cuts      -> Draw();
2670   fOutput   -> cd();
2671   cDeltaPt  -> Write();
2672   cDeltaPt  -> Close();
2673 
2674   TCanvas *cMuProj = new TCanvas("cMuDeltaPt", "", width, heightNR);
2675   cMuProj  -> SetGrid(fGrid, fGrid);
2676   cMuProj  -> SetTicks(fTick, fTick);
2677   cMuProj  -> SetBorderMode(fMode);
2678   cMuProj  -> SetBorderSize(fBord);
2679   cMuProj  -> SetFrameBorderMode(fFrame);
2680   cMuProj  -> SetLeftMargin(fMarginL);
2681   cMuProj  -> SetRightMargin(fMarginR);
2682   cMuProj  -> SetTopMargin(fMarginTNR);
2683   cMuProj  -> SetBottomMargin(fMarginBNR);
2684   cMuProj  -> SetLogx(fLogX);
2685   cMuProj  -> SetLogy(fLogYNR);
2686   cMuProj  -> cd();
2687   grMuProj -> Draw("ALP");
2688   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2689     grMuHiProj[iSig] -> Draw("LP");
2690     grMuLoProj[iSig] -> Draw("LP");
2691   }
2692   legMu   -> Draw();
2693   info    -> Draw();
2694   cuts    -> Draw();
2695   fOutput -> cd();
2696   cMuProj -> Write();
2697   cMuProj -> Close();
2698 
2699   TCanvas *cSigProj = new TCanvas("cSigmaDeltaPt", "", width, heightNR);
2700   cSigProj  -> SetGrid(fGrid, fGrid);
2701   cSigProj  -> SetTicks(fTick, fTick);
2702   cSigProj  -> SetBorderMode(fMode);
2703   cSigProj  -> SetBorderSize(fBord);
2704   cSigProj  -> SetFrameBorderMode(fFrame);
2705   cSigProj  -> SetLeftMargin(fMarginL);
2706   cSigProj  -> SetRightMargin(fMarginR);
2707   cSigProj  -> SetTopMargin(fMarginTNR);
2708   cSigProj  -> SetBottomMargin(fMarginBNR);
2709   cSigProj  -> SetLogx(fLogX);
2710   cSigProj  -> SetLogy(fLogYNR);
2711   cSigProj  -> cd();
2712   grSigProj -> Draw("ALP");
2713   info      -> Draw();
2714   cuts      -> Draw();
2715   fOutput   -> cd();
2716   cSigProj  -> Write();
2717   cSigProj  -> Close();
2718   cout << "    Made plots." << endl;
2719 
2720   // make directories
2721   TDirectory *dNoCut    = (TDirectory*) fOutput -> mkdir("NoCuts");
2722   TDirectory *dFlatCut  = (TDirectory*) fOutput -> mkdir("FlatCuts");
2723   TDirectory *dSigmaCut = (TDirectory*) fOutput -> mkdir("SigmaCuts");
2724   TDirectory *dProject  = (TDirectory*) fOutput -> mkdir("Projections");
2725 
2726   // save histograms
2727   fOutput         -> cd();
2728   dNoCut          -> cd();
2729   hEff            -> Write();
2730   hPtTruth        -> Write();
2731   hPtDelta        -> Write();
2732   hPtTrack        -> Write();
2733   hPtFrac         -> Write();
2734   hPtTrkTru       -> Write();
2735   hPtDeltaVsFrac  -> Write();
2736   hPtDeltaVsTrue  -> Write();
2737   hPtDeltaVsTrack -> Write();
2738   hPtTrueVsTrack  -> Write();
2739 
2740   // save flat delta-pt cut histograms
2741   dFlatCut -> cd();
2742   grRejCut -> Write();
2743   for (Ssiz_t iCut = 0; iCut < NDPtCuts; iCut++) {
2744     hEffCut[iCut]            -> Write();
2745     hPtDeltaCut[iCut]        -> Write();
2746     hPtTrackCut[iCut]        -> Write();
2747     hPtFracCut[iCut]         -> Write();
2748     hPtTrkTruCut[iCut]       -> Write();
2749     hPtDeltaVsFracCut[iCut]  -> Write();
2750     hPtDeltaVsTrueCut[iCut]  -> Write();
2751     hPtDeltaVsTrackCut[iCut] -> Write();
2752     hPtTrueVsTrackCut[iCut]  -> Write();
2753   }
2754 
2755   // save pt-dependent delta-pt cut histograms
2756   dSigmaCut -> cd();
2757   grRejSig  -> Write();
2758   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2759     hEffSig[iSig]            -> Write();
2760     hPtDeltaSig[iSig]        -> Write();
2761     hPtTrackSig[iSig]        -> Write();
2762     hPtFracSig[iSig]         -> Write();
2763     hPtTrkTruSig[iSig]       -> Write();
2764     hPtDeltaVsFracSig[iSig]  -> Write();
2765     hPtDeltaVsTrueSig[iSig]  -> Write();
2766     hPtDeltaVsTrackSig[iSig] -> Write();
2767     hPtTrueVsTrackSig[iSig]  -> Write();
2768   }
2769 
2770   // save delta-pt projection histograms
2771   dProject  -> cd();
2772   grMuProj  -> Write();
2773   grSigProj -> Write();
2774   for (Ssiz_t iProj = 0; iProj < NProj; iProj++) {
2775     hPtDeltaProj[iProj] -> Write();
2776     fPtDeltaProj[iProj] -> Write();
2777   }
2778   for (Ssiz_t iSig = 0; iSig < NSigCuts; iSig++) {
2779     fMuHiProj[iSig]  -> Write();
2780     fMuLoProj[iSig]  -> Write();
2781     grMuHiProj[iSig] -> Write();
2782     grMuLoProj[iSig] -> Write();
2783   }
2784   cout << "    Saved histograms." << endl;
2785 
2786   // close files
2787   fOutput -> cd();
2788   fOutput -> Close();
2789   fInput  -> cd();
2790   fInput  -> Close();
2791   cout << "  Finished delta-pt extractor script!\n" << endl;
2792 
2793 }
2794 
2795 // end ------------------------------------------------------------------------