ROOT logo
/**
 * @file   DrawCuts.C
 * @author Christian Holm Christensen <cholm@nbi.dk>
 * @date   Thu Nov 17 11:20:22 2011
 * 
 * @brief  Draw the cuts used in the analysis
 * 
 * @ingroup pwglf_forward_scripts_qa
 * 
 */
/** 
 * Draw cuts used in analysis
 * 
 * @param filename Input file name 
 *
 * @ingroup pwglf_forward_scripts_qa
 */
void
DrawCuts(const char* filename="forward.root")
{
  gStyle->SetPalette(1);
  gStyle->SetOptFit(0);
  gStyle->SetOptStat(0);
  gStyle->SetTitleW(.4);
  gStyle->SetTitleH(.1);
  gStyle->SetTitleColor(0);
  gStyle->SetTitleStyle(0);
  gStyle->SetTitleBorderSize(0);
  gStyle->SetTitleX(.6);

  TFile* file = TFile::Open(filename, "READ");
  if (!file) { 
    Error("DrawCuts", "failed to open %s", filename);
    return;
  }

  TList* forward = static_cast<TList*>(file->Get("Forward"));
  if (!forward) { 
    Error("DrawCuts", "List Forward not found in %s", filename);
    return;
  }

  TList* dc = static_cast<TList*>(forward->FindObject("fmdDensityCalculator"));
  if (!dc) { 
    Error("DrawCuts", "List fmdDensityCalculator not found in Forward");
    return;
  }
  TList* sf = static_cast<TList*>(forward->FindObject("fmdSharingFilter"));
  if (!dc) { 
    Error("DrawCuts", "List fmdSharingFilter not found in Forward");
    return;
  }
  TList* hc = static_cast<TList*>(forward->FindObject("fmdHistCollector"));
  if (!hc) { 
    Error("DrawCuts", "List fmdHistCollector not found in Forward");
    return;
  }
  TH2* hC = static_cast<TH2*>(sf->FindObject("highCuts"));
  if (!hC) { 
    Error("DrawCuts", "Histogram highCuts found in %s", sf->GetName());
    return;
  }
  TH2* lC = static_cast<TH2*>(dc->FindObject("lowCuts"));
  if (!lC) { 
    Error("DrawCuts", "Histogram lowCuts found in %s", dc->GetName());
    return;
  }
  TH2* co = static_cast<TH2*>(hc->FindObject("coverage"));
  if (!co) { 
    Error("DrawCuts", "Histogram coverage found in %s", hc->GetName());
    return;
  }
  TCanvas* c = new TCanvas("cuts", "Cuts used in the analysis", 900, 700);
  c->SetFillColor(0);
  c->SetBorderSize(0);
  c->Divide(3,1);
  
  c->cd(1); hC->Draw("colz");
  c->cd(2); lC->Draw("colz");
  c->cd(3); co->Draw("colz");
  c->cd();

}

  
  
 
 DrawCuts.C:1
 DrawCuts.C:2
 DrawCuts.C:3
 DrawCuts.C:4
 DrawCuts.C:5
 DrawCuts.C:6
 DrawCuts.C:7
 DrawCuts.C:8
 DrawCuts.C:9
 DrawCuts.C:10
 DrawCuts.C:11
 DrawCuts.C:12
 DrawCuts.C:13
 DrawCuts.C:14
 DrawCuts.C:15
 DrawCuts.C:16
 DrawCuts.C:17
 DrawCuts.C:18
 DrawCuts.C:19
 DrawCuts.C:20
 DrawCuts.C:21
 DrawCuts.C:22
 DrawCuts.C:23
 DrawCuts.C:24
 DrawCuts.C:25
 DrawCuts.C:26
 DrawCuts.C:27
 DrawCuts.C:28
 DrawCuts.C:29
 DrawCuts.C:30
 DrawCuts.C:31
 DrawCuts.C:32
 DrawCuts.C:33
 DrawCuts.C:34
 DrawCuts.C:35
 DrawCuts.C:36
 DrawCuts.C:37
 DrawCuts.C:38
 DrawCuts.C:39
 DrawCuts.C:40
 DrawCuts.C:41
 DrawCuts.C:42
 DrawCuts.C:43
 DrawCuts.C:44
 DrawCuts.C:45
 DrawCuts.C:46
 DrawCuts.C:47
 DrawCuts.C:48
 DrawCuts.C:49
 DrawCuts.C:50
 DrawCuts.C:51
 DrawCuts.C:52
 DrawCuts.C:53
 DrawCuts.C:54
 DrawCuts.C:55
 DrawCuts.C:56
 DrawCuts.C:57
 DrawCuts.C:58
 DrawCuts.C:59
 DrawCuts.C:60
 DrawCuts.C:61
 DrawCuts.C:62
 DrawCuts.C:63
 DrawCuts.C:64
 DrawCuts.C:65
 DrawCuts.C:66
 DrawCuts.C:67
 DrawCuts.C:68
 DrawCuts.C:69
 DrawCuts.C:70
 DrawCuts.C:71
 DrawCuts.C:72
 DrawCuts.C:73
 DrawCuts.C:74
 DrawCuts.C:75
 DrawCuts.C:76
 DrawCuts.C:77
 DrawCuts.C:78
 DrawCuts.C:79
 DrawCuts.C:80
 DrawCuts.C:81
 DrawCuts.C:82
 DrawCuts.C:83
 DrawCuts.C:84
 DrawCuts.C:85
 DrawCuts.C:86
 DrawCuts.C:87
 DrawCuts.C:88