ATLAS Offline Software
Loading...
Searching...
No Matches
T0CalTypeXY Class Reference
Collaboration diagram for T0CalTypeXY:

Public Member Functions

 T0CalTypeXY (TNtuple *, int, float)
void Draw (const string &, bool)

Public Attributes

TGraph * graph [7] {}
TEventList * elist [7] {}

Detailed Description

Definition at line 559 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ T0CalTypeXY()

T0CalTypeXY::T0CalTypeXY ( TNtuple * Levtuple,
int detector,
float markersize )

Definition at line 568 of file TRTCalib_makeplots.cxx.

569{
570
571 float x{}, y{}, nt0{}, chp{}, brd{}, lay{}, mod{}, det{};
572 int color[7] = {0, 46, 38, 8, 16, 1, 2};
573
574 Levtuple->SetBranchAddress("x", &x);
575 Levtuple->SetBranchAddress("y", &y);
576 Levtuple->SetBranchAddress("nt0", &nt0);
577 Levtuple->SetBranchAddress("chp", &chp);
578 Levtuple->SetBranchAddress("brd", &brd);
579 Levtuple->SetBranchAddress("lay", &lay);
580 Levtuple->SetBranchAddress("mod", &mod);
581 Levtuple->SetBranchAddress("det", &det);
582
583 Levtuple->Draw(">>tmplist0", Form("nt0*(det==%i)", detector));
584 Levtuple->Draw(">>tmplist1", Form("nt0*(ftype==1 && det==%i)", detector));
585 Levtuple->Draw(">>tmplist2", Form("nt0*(ftype==2 && det==%i)", detector));
586 Levtuple->Draw(">>tmplist3", Form("nt0*(ftype==3 && det==%i)", detector));
587 Levtuple->Draw(">>tmplist4", Form("nt0*(ftype==4 && det==%i)", detector));
588 Levtuple->Draw(">>tmplist5", Form("nt0*(ftype==5 && det==%i)", detector));
589 Levtuple->Draw(">>tmplist6", Form("nt0*(ftype==6 && det==%i)", detector));
590 elist[0] = (TEventList *)gDirectory->Get("tmplist0");
591 elist[1] = (TEventList *)gDirectory->Get("tmplist1");
592 elist[2] = (TEventList *)gDirectory->Get("tmplist2");
593 elist[3] = (TEventList *)gDirectory->Get("tmplist3");
594 elist[4] = (TEventList *)gDirectory->Get("tmplist4");
595 elist[5] = (TEventList *)gDirectory->Get("tmplist5");
596 elist[6] = (TEventList *)gDirectory->Get("tmplist6");
597
598 for (int igr = 0; igr <= 6; igr++)
599 {
600 graph[igr] = new TGraph();
601 graph[igr]->SetMarkerStyle(20);
602 graph[igr]->SetMarkerSize(markersize);
603 graph[igr]->SetMarkerColor(color[igr]);
604 int ipnt = 0;
605 for (int ib = 0; ib < elist[igr]->GetN(); ib++)
606 {
607 ipnt++;
608 Levtuple->GetEntry(elist[igr]->GetEntry(ib));
609
610 graph[igr]->SetPoint(ipnt, x, y);
611 }
612 graph[igr]->RemovePoint(0);
613 }
614 graph[0]->SetMarkerSize(0.1);
615}
#define y
#define x
TEventList * elist[7]

Member Function Documentation

◆ Draw()

void T0CalTypeXY::Draw ( const string & title,
bool plotleg )

Definition at line 617 of file TRTCalib_makeplots.cxx.

618{
619 graph[0]->GetHistogram()->GetXaxis()->SetLabelOffset(1000);
620 graph[0]->GetHistogram()->GetYaxis()->SetLabelOffset(1000);
621 if (graph[0]->GetN() > 0)
622 graph[0]->Draw("ap");
623 if (graph[1]->GetN() > 0)
624 graph[1]->Draw("p");
625 if (graph[2]->GetN() > 0)
626 graph[2]->Draw("p");
627 if (graph[3]->GetN() > 0)
628 graph[3]->Draw("p");
629 if (graph[4]->GetN() > 0)
630 graph[4]->Draw("p");
631 if (graph[5]->GetN() > 0)
632 graph[5]->Draw("p");
633 if (graph[6]->GetN() > 0)
634 graph[6]->Draw("p");
635 cout << "In Draw title: " << title << endl;
636 cout << " Events in graph[0]: " << graph[0]->GetN() << endl;
637 cout << " Events in graph[1]: " << graph[1]->GetN() << endl;
638 cout << " Events in graph[2]: " << graph[2]->GetN() << endl;
639 cout << " Events in graph[3]: " << graph[3]->GetN() << endl;
640 cout << " Events in graph[4]: " << graph[4]->GetN() << endl;
641 graph[0]->Clear();
642 graph[0]->SetTitle(title.c_str());
643
644 if (plotleg)
645 {
646 TLegend *leg = new TLegend(0.99, 0.35, 0.55, 0.01);
647 leg->AddEntry(graph[2], "normal fit");
648 leg->AddEntry(graph[3], "used chip ref");
649 leg->AddEntry(graph[4], "Low stat,T0");
650 leg->AddEntry(graph[1], "|mean|>5");
651 leg->AddEntry(graph[5], "No T0 Cal");
652 leg->AddEntry(graph[6], "Wrong fit, RMS and Mean used");
653 leg->SetTextSize(0.04);
654
655 leg->Draw();
656 }
657}

Member Data Documentation

◆ elist

TEventList* T0CalTypeXY::elist[7] {}

Definition at line 565 of file TRTCalib_makeplots.cxx.

565{};

◆ graph

TGraph* T0CalTypeXY::graph[7] {}

Definition at line 564 of file TRTCalib_makeplots.cxx.

564{};

The documentation for this class was generated from the following file: