void plotHitResSim(){
  setTDRStyle();
  gROOT->SetStyle("tdrStyle");

  // load the code before executing the macro:
  gROOT->LoadMacro("TrackingAnalysis/Cosmics/test/OverlapHistos.C+");
  //make sure OverlapHistos.h is pointing to a root file from MC

  ol = new OverlapHistos();
  ol->Loop(); 

  //summary histos written out to main file, histos/detid pair in root->ROOT Memory
  //new TBrowser()

 width->SetLineColor(2);
 width->SetMarkerStyle(24);  //20
 width->SetMarkerColor(2);
 width->GetYaxis()->SetTitle("Uncertainty [#mum]");
 width->SetMinimum(0);
 width->GetXaxis()->SetTitle("");
 width->GetXaxis()->SetLabelSize(0);
 width->GetXaxis()->SetTickLength(0);
 simRec->SetLineColor(4);
 simRec->SetMarkerStyle(25); //21
 simRec->SetMarkerColor(4);
 simTrk->SetMarkerStyle(26); //22
 width->Draw();
 simTrk->Draw("same");
 simRec->Draw("same");

leg_hist = new TLegend(0.12,0.7,0.39,0.89);
leg_hist->AddEntry(width,"Fitted width #Deltax_{hit}-#Deltax_{pred} [#mum]","p");
leg_hist->AddEntry(simTrk,"Fitted width #Deltax_{pred}-#Deltax_{sim}","p");
leg_hist->AddEntry(simRec,"Fitted width #Deltax_{hit}-#Deltax_{sim}","p");
leg_hist->SetTextSize(0.055);
leg_hist->SetFillColor(0);
leg_hist->Draw("same");

  TArrow ar1(0.0,0.0,5.5,0.0,0.05,"<|>");
  ar1.SetArrowSize(0.02); ar1.SetAngle(40);
  ar1.SetLineWidth(2); ar1.Draw();

  TArrow ar3(6,0.0,15.5,0.0,0.05,"<|>");
  ar3.SetArrowSize(0.02); ar3.SetAngle(40);
  ar3.SetLineWidth(2); ar3.Draw();

  TArrow ar4(16,0.0,33.5,0.0,0.05,"<|>");
  ar4.SetArrowSize(0.02); ar4.SetAngle(40);
  ar4.SetLineWidth(2); ar4.Draw();

  TArrow ar5(34,0.0,60.5,0.0,0.05,"<|>");
  ar5.SetArrowSize(0.02); ar5.SetAngle(40);
  ar5.SetLineWidth(2); ar5.Draw();

  TArrow ar2(61,0.0,86,0.0,0.05,"<|>");
  ar2.SetArrowSize(0.02); ar2.SetAngle(40);
  ar2.SetLineWidth(2); ar2.Draw();

  TLatex* taga = new TLatex(.115, .085, "TIB1");
  taga->SetNDC(kTRUE);  taga->SetTextSize(0.04);  taga->Draw();
  TLatex* taga = new TLatex(.19, .085, "TIB2");
  taga->SetNDC(kTRUE);  taga->SetTextSize(0.04);  taga->Draw();
  TLatex* taga = new TLatex(.33, .085, "TIB3");
  taga->SetNDC(kTRUE);  taga->SetTextSize(0.04);  taga->Draw();
  TLatex* taga = new TLatex(.55, .085, "TIB4");
  taga->SetNDC(kTRUE);  taga->SetTextSize(0.04);  taga->Draw();
  TLatex* tagg = new TLatex(.83, .085, "TOB");
  tagg->SetNDC(kTRUE);  tagg->SetTextSize(0.04);  tagg->Draw();

 c1->SaveAs("ResolutionSim.eps");
 // c1->Print("ResolutionSim.pdf","pdf");
 // do epstopdf instead
}
int main(int argc, char *argv[])
{
    // Initialize POOMA and output stream, using Tester class
    Pooma::initialize(argc, argv);
    Pooma::Tester tester(argc, argv);

    tester.out() << argv[0]
                 << ": Tests of expressions with multipatch."
                 << std::endl;
    tester.out() << "------------------------------------------------"
                 << std::endl;

    int size = 30;

    int from = 0;
    int to = size-1;
    int fromInterior = 0;
    int toInterior = size-1;

    int loc1 = 4;
    int loc2 = 14;
    int loc3 = 22;

    Interval<1> dom(from,to);
    Interval<1> I(fromInterior,toInterior);

    Interval<1> domain(size);

    UniformGridPartition<1> partition(Loc<1>(10),GuardLayers<1>(1));
    UniformGridLayout<1> layout(domain,partition,ReplicatedTag());

    Array<1,double,MultiPatch<UniformTag,Brick> >
    a1(layout), a2(layout), a3(layout), a4(layout), initial(layout);

    initial = 0.0;

    Pooma::blockAndEvaluate();

    initial(loc1) = 2.0;
    initial(loc2) = 3.0;
    initial(loc3) = 4.0;

    test1(tester, 1, a1, a2, a3, a4, initial, I);
    test2(tester, 2, a1, a2, a3, a4, initial, I);
    test3(tester, 3, a1, a2, a3, a4, initial, I);
    test4(tester, 4, a1, a2, a3, a4, initial, I);

    Array<1,Vector<2,double>,MultiPatch<UniformTag,Brick> >
    av1(layout),av2(layout),av3(layout),av4(layout),
        initialv(layout);

    initialv = Vector<2,double>(0.0,0.0);

    Pooma::blockAndEvaluate();

    initialv(loc1) = Vector<2,double>(2.0,3.0);
    initialv(loc2) = Vector<2,double>(3.0,-1.0);
    initialv(loc3) = Vector<2,double>(4.0,-5.0);

    test5(tester, 5, av1, av2, av3, av4, initialv, I);
    test1(tester, 6, av1, av2, av3, av4, initialv, I);
    test4(tester, 7, av1, av2, av3, av4, initialv, I);

    UniformGridLayout<1> layoutr(domain, partition, DistributedTag());

    Array<1, double, MultiPatch<UniformTag, Remote<Brick> > >
    ar1(layoutr), ar2(layoutr), ar3(layoutr), ar4(layoutr);

    test1(tester, 8,  ar1, ar2, ar3, ar4, initial, I);
    test2(tester, 9,  ar1, ar2, ar3, ar4, initial, I);
    test3(tester, 10, ar1, ar2, ar3, ar4, initial, I);
    test4(tester, 11, ar1, ar2, ar3, ar4, initial, I);

    tester.out() << "------------------------------------------------"
                 << std::endl;

    int retval = tester.results("array_test18");
    Pooma::finalize();
    return retval;
}