ATLAS Offline Software
Public Member Functions | List of all members
XYMapsEC Class Reference
Inheritance diagram for XYMapsEC:
Collaboration diagram for XYMapsEC:

Public Member Functions

 XYMapsEC (char *, string, bool)
 

Detailed Description

Definition at line 2394 of file TRTCalib_makeplots.cxx.

Constructor & Destructor Documentation

◆ XYMapsEC()

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

Definition at line 2400 of file TRTCalib_makeplots.cxx.

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

The documentation for this class was generated from the following file:
run.infile
string infile
Definition: run.py:13
read_hist_ntuple.h1
h1
Definition: read_hist_ntuple.py:21
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
ResizePalette
void ResizePalette(TH2 *hist)
Definition: TRTCalib_makeplots.cxx:68
file
TFile * file
Definition: tile_monitor.h:29
compute_lumi.leg
leg
Definition: compute_lumi.py:95
python.selection.variable
variable
Definition: selection.py:33
calibdata.cd
cd
Definition: calibdata.py:51
SetZAxis
void SetZAxis(TH2F *reshist0)
Definition: TRTCalib_makeplots.cxx:49