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

Public Member Functions

 XYMapsEC (char *, string, bool)

Detailed Description

Definition at line 2396 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ XYMapsEC()

XYMapsEC::XYMapsEC ( char * infile,
string variable,
bool isAr = false )

Definition at line 2402 of file TRTCalib_makeplots.cxx.

2403{
2404
2405 char selectionA[500];
2406 sprintf(selectionA, "%s*(det==2)", variable.c_str());
2407 char selectionC[500];
2408 sprintf(selectionC, "%s*(det==-2)", variable.c_str());
2409 if (variable == "nt0")
2410 variable = "n hits";
2411 TFile *file = new TFile(infile);
2412 // cout << infile << endl;
2413 file->cd();
2414 TNtuple *Chiptuple = nullptr;
2415 TNtuple *Moduletuple = nullptr;
2416
2417 if (!isAr)
2418 {
2419 Chiptuple = (TNtuple *)file->Get("Chiptuple");
2420 Moduletuple = (TNtuple *)file->Get("Moduletuple");
2421 }
2422 else
2423 {
2424 Chiptuple = (TNtuple *)file->Get("Chip_Artuple");
2425 Moduletuple = (TNtuple *)file->Get("Module_Artuple");
2426 }
2427
2428 this->SetName("c1");
2429 this->cd();
2430 this->Divide(2, 2, 0.01, 0.01);
2431 ((TPad *)this->GetPrimitive("c1_1"))->SetFrameFillColor(1);
2432 ((TPad *)this->GetPrimitive("c1_2"))->SetFrameFillColor(1);
2433 ((TPad *)this->GetPrimitive("c1_3"))->SetFrameFillColor(1);
2434 ((TPad *)this->GetPrimitive("c1_4"))->SetFrameFillColor(1);
2435
2436 gStyle->SetPalette(1);
2437
2438 this->cd(1);
2439
2440 Moduletuple->Draw("mod:lay>>reshist10(14,0,14,32,0,32)", selectionA, "colz");
2441 TH2F *reshist10 = (TH2F *)gPad->GetPrimitive("reshist10");
2442 this->Update();
2443 if (reshist10->GetEntries() > 1)
2444 ResizePalette(reshist10);
2445 SetZAxis(reshist10);
2446 char title1[500];
2447 sprintf(title1, "Phi Sector VS Wheel %s (EC side A)", variable.c_str());
2448 if (isAr)
2449 sprintf(title1, "Argon Phi Sector VS Wheel %s (EC side A)", variable.c_str());
2450 reshist10->SetTitle(title1);
2451 reshist10->SetStats(0);
2452 reshist10->GetXaxis()->SetLabelOffset(1000);
2453 reshist10->GetYaxis()->SetLabelOffset(1000);
2454 reshist10->GetXaxis()->SetTitle("Wheel (Z)");
2455 reshist10->GetYaxis()->SetTitle("Phi sector");
2456 if (variable == "ftype")
2457 {
2458 reshist10->GetZaxis()->SetRangeUser(1, 6);
2459 reshist10->GetZaxis()->SetNdivisions(6);
2460 }
2461 else if (variable == "res")
2462 {
2463 reshist10->GetZaxis()->SetRangeUser(0.10, 0.20);
2464 }
2465 else if (variable == "abs(resMean)")
2466 {
2467 reshist10->GetZaxis()->SetRangeUser(0.0, 0.05);
2468 }
2469 else if (variable == "t0")
2470 {
2471 reshist10->GetZaxis()->SetRangeUser(2, 14);
2472 }
2473 else if (variable == "abs(t0-oldt0)")
2474 {
2475 reshist10->GetZaxis()->SetRangeUser(0.0, 0.6);
2476 }
2477 else if (variable == "tres")
2478 {
2479 reshist10->GetZaxis()->SetRangeUser(2.0, 4.5);
2480 }
2481
2482 this->cd(2);
2483
2484 Chiptuple->Draw("mod:chp>>histC(248,84,332,32,0,32)", selectionA, "colz");
2485 TH2F *histC = (TH2F *)gPad->GetPrimitive("histC");
2486 char title3[500];
2487 sprintf(title3, "Chip %s (EC side A)", variable.c_str());
2488 if (isAr)
2489 sprintf(title3, "Argon Chip %s (EC side A)", variable.c_str());
2490 histC->SetTitle(title3);
2491 this->Update();
2492 if (histC->GetEntries() > 1)
2493 ResizePalette(histC);
2494 SetZAxis(histC);
2495 histC->SetStats(0);
2496 histC->GetXaxis()->SetLabelOffset(1000);
2497 histC->GetYaxis()->SetLabelOffset(1000);
2498 histC->GetXaxis()->SetTitle("Chip number");
2499 histC->GetYaxis()->SetTitle("Phi sector");
2500 if (variable == "ftype")
2501 {
2502 histC->GetZaxis()->SetRangeUser(1, 6);
2503 histC->GetZaxis()->SetNdivisions(6);
2504 }
2505 else if (variable == "res")
2506 {
2507 histC->GetZaxis()->SetRangeUser(0.10, 0.20);
2508 }
2509 else if (variable == "abs(resMean)")
2510 {
2511 histC->GetZaxis()->SetRangeUser(0.0, 0.05);
2512 }
2513 else if (variable == "t0")
2514 {
2515 histC->GetZaxis()->SetRangeUser(2, 14);
2516 }
2517 else if (variable == "abs(t0-oldt0)")
2518 {
2519 histC->GetZaxis()->SetRangeUser(0.0, 0.6);
2520 }
2521 else if (variable == "tres")
2522 { // took out paranthesis
2523 histC->GetZaxis()->SetRangeUser(2.0, 4.5);
2524 }
2525
2526 float lowe = 0;
2527 float upe = 32;
2528
2529 TLine *lin11 = new TLine(84, lowe, 84, upe);
2530 lin11->SetLineStyle(2);
2531 lin11->Draw();
2532 TLine *lin12 = new TLine(107, lowe, 107, upe);
2533 lin12->SetLineStyle(2);
2534 lin12->Draw();
2535 TLine *lin13 = new TLine(131, lowe, 131, upe);
2536 lin13->SetLineStyle(2);
2537 lin13->Draw();
2538 TLine *lin14 = new TLine(155, lowe, 155, upe);
2539 lin14->SetLineStyle(2);
2540 lin14->Draw();
2541 TLine *lin15 = new TLine(179, lowe, 179, upe);
2542 lin15->SetLineStyle(2);
2543 lin15->Draw();
2544 TLine *lin16 = new TLine(203, lowe, 203, upe);
2545 lin16->SetLineStyle(2);
2546 lin16->Draw();
2547 TLine *lin17 = new TLine(227, lowe, 227, upe);
2548 lin17->SetLineStyle(2);
2549 lin17->Draw();
2550 TLine *lin18 = new TLine(239, lowe, 239, upe);
2551 lin18->SetLineStyle(2);
2552 lin18->Draw();
2553 this->Update();
2554
2555 this->cd(3);
2556 Moduletuple->Draw("mod:lay>>reshist11(14,0,14,32,0,32)", selectionC, "colz");
2557 TH2F *reshist11 = (TH2F *)gPad->GetPrimitive("reshist11");
2558 this->Update();
2559 if (reshist11->GetEntries() > 1)
2560 ResizePalette(reshist11);
2561 SetZAxis(reshist11);
2562 char title4[500];
2563 sprintf(title4, "Phi Sector VS Wheel %s (EC side C)", variable.c_str());
2564 if (isAr)
2565 sprintf(title4, "Argon Phi Sector VS Wheel %s (EC side C)", variable.c_str());
2566 reshist11->SetTitle(title4);
2567 reshist11->SetMarkerStyle(21);
2568 reshist11->SetStats(0);
2569 reshist11->GetXaxis()->SetLabelOffset(1000);
2570 reshist11->GetYaxis()->SetLabelOffset(1000);
2571 reshist11->GetXaxis()->SetTitle("Layer (Z)");
2572 reshist11->GetYaxis()->SetTitle("Phi sector");
2573 if (variable == "ftype")
2574 {
2575 reshist11->GetZaxis()->SetRangeUser(1, 6);
2576 reshist11->GetZaxis()->SetNdivisions(6);
2577
2578 TLegend *leg = new TLegend(0.99, 0.35, 0.55, 0.01, "T0 fit type");
2579
2580 TH2F *h1 = new TH2F("h1", "h1 title", 40, 0, 4, 30, -3, 3);
2581 h1->SetMarkerColor(54);
2582 h1->SetMarkerStyle(21);
2583
2584 TH2F *h2 = new TH2F("h2", "h2 title", 40, 0, 4, 30, -3, 3);
2585 h2->SetMarkerColor(4);
2586 h2->SetMarkerStyle(21);
2587
2588 TH2F *h3 = new TH2F("h3", "h3 title", 40, 0, 4, 30, -3, 3);
2589 h3->SetMarkerColor(7);
2590 h3->SetMarkerStyle(21);
2591
2592 TH2F *h4 = new TH2F("h4", "h4 title", 40, 0, 4, 30, -3, 3);
2593 h4->SetMarkerColor(81);
2594 h4->SetMarkerStyle(21);
2595
2596 TH2F *h5 = new TH2F("h5", "h5 title", 40, 0, 4, 30, -3, 3);
2597 h5->SetMarkerColor(kYellow);
2598 h5->SetMarkerStyle(21);
2599
2600 TH2F *h6 = new TH2F("h6", "h6 title", 40, 0, 4, 30, -3, 3);
2601 h6->SetMarkerColor(kRed);
2602 h6->SetMarkerStyle(21);
2603
2604 leg->AddEntry(h1, "1: |mean|>5", "P");
2605 leg->AddEntry(h2, "2: normal fit", "P");
2606 leg->AddEntry(h3, "3: used chip ref", "P");
2607 leg->AddEntry(h4, "4: Low stat", "P");
2608 leg->AddEntry(h5, "5: No T0 Cal", "P");
2609 leg->AddEntry(h6, "6: Wrong fit. Mean used", "P");
2610 leg->SetTextSize(0.04);
2611 leg->Draw();
2612 }
2613 else if (variable == "res")
2614 {
2615 reshist11->GetZaxis()->SetRangeUser(0.1, 0.20);
2616 }
2617 else if (variable == "abs(resMean)")
2618 {
2619 reshist11->GetZaxis()->SetRangeUser(0.0, 0.05);
2620 }
2621 else if (variable == "t0")
2622 {
2623 reshist11->GetZaxis()->SetRangeUser(2, 14);
2624 }
2625 else if (variable == "abs(t0-oldt0)")
2626 {
2627 reshist11->GetZaxis()->SetRangeUser(0.0, 0.6);
2628 }
2629 else if (variable == "tres")
2630 {
2631 reshist11->GetZaxis()->SetRangeUser(2.0, 4.5);
2632 }
2633
2634 this->cd(4);
2635 Chiptuple->Draw("mod:chp>>histC1(248,84,332,32,0,32)", selectionC, "colz");
2636 TH2F *histC1 = (TH2F *)gPad->GetPrimitive("histC1");
2637 char title5[500];
2638 sprintf(title5, "Chip %s (EC side C)", variable.c_str());
2639 if (isAr)
2640 sprintf(title5, "Argon Chip %s (EC side C)", variable.c_str());
2641 histC1->SetTitle(title5);
2642 this->Update();
2643 if (histC1->GetEntries() > 1)
2644 ResizePalette(histC1);
2645 SetZAxis(histC1);
2646 histC1->SetStats(0);
2647 histC1->GetXaxis()->SetLabelOffset(1000);
2648 histC1->GetYaxis()->SetLabelOffset(1000);
2649 histC1->GetXaxis()->SetTitle("Chip number");
2650 histC1->GetYaxis()->SetTitle("Phi sector");
2651 if (variable == "ftype")
2652 {
2653 histC1->GetZaxis()->SetRangeUser(1, 6);
2654 histC1->GetZaxis()->SetNdivisions(6);
2655 }
2656 else if (variable == "res")
2657 {
2658 histC1->GetZaxis()->SetRangeUser(0.10, 0.20);
2659 }
2660 else if (variable == "abs(resMean)")
2661 {
2662 histC1->GetZaxis()->SetRangeUser(0.0, 0.05);
2663 }
2664 else if (variable == "t0")
2665 {
2666 histC1->GetZaxis()->SetRangeUser(2, 14);
2667 }
2668 else if (variable == "abs(t0-oldt0)")
2669 {
2670 histC1->GetZaxis()->SetRangeUser(0.0, 0.6);
2671 }
2672 else if (variable == "tres")
2673 { // took out parenthesis
2674 histC1->GetZaxis()->SetRangeUser(2.0, 4.5);
2675 }
2676
2677 TLine *lin1 = new TLine(84, lowe, 84, upe);
2678 lin1->SetLineStyle(2);
2679 lin1->Draw();
2680 TLine *lin2 = new TLine(108, lowe, 108, upe);
2681 lin2->SetLineStyle(2);
2682 lin2->Draw();
2683 TLine *lin3 = new TLine(132, lowe, 132, upe);
2684 lin3->SetLineStyle(2);
2685 lin3->Draw();
2686 TLine *lin4 = new TLine(156, lowe, 156, upe);
2687 lin4->SetLineStyle(2);
2688 lin4->Draw();
2689 TLine *lin5 = new TLine(180, lowe, 180, upe);
2690 lin5->SetLineStyle(2);
2691 lin5->Draw();
2692 TLine *lin6 = new TLine(204, lowe, 204, upe);
2693 lin6->SetLineStyle(2);
2694 lin6->Draw();
2695 TLine *lin7 = new TLine(228, lowe, 228, upe);
2696 lin7->SetLineStyle(2);
2697 lin7->Draw();
2698 TLine *lin8 = new TLine(240, lowe, 239, upe);
2699 lin8->SetLineStyle(2);
2700 lin8->Draw();
2701
2702 this->Update();
2703}
void SetZAxis(TH2F *reshist0)
void ResizePalette(TH2 *hist)
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
TFile * file

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