ROOT logo
/**
 * @file   RunQA.C
 * @author Christian Holm Christensen <cholm@nbi.dk>
 * @date   Thu Nov 17 11:35:08 2011
 * 
 * @brief  Script to run the QATrender over a single run
 * 
 * @ingroup pwglf_forward_qa_scripts
 */
class TTree;
class TCanvas;

/** 
 * Run the QATrender
 * 
 * The QATrender is run over the list of files (runs) to produce the
 * file <tt>trending.root</tt> which contains a TTree of QA
 * information - one entry per run.  
 * 
 * The QATrender will also produce two files per run: 
 * 
 * - <tt>index.root</tt> which contains TCanvas objects of
 *   the finished plots.
 *
 * - <tt>index.pdf</tt> which is a PDF of the TCanvases
 *   mentioned above.
 *
 * @param input  Input file
 * @param type   Data type (data or sim)
 * @param year   Year 
 * @param period Period (e.g., LHC10h)
 * @param pass   Pass (e.g., pass1, cpass1, passMC)
 * @param runNo  Run number 
 * 
 * @ingroup pwglf_forward_qa_scripts
 */
void
RunQA(const char* input, 
      const char* type, 
      Int_t       year, 
      const char* period,
      const char* pass, 
      Long_t      runNo) 
{
  Bool_t keep = true;
  TString fwd(gSystem->Getenv("QA_FWD"));
  TString mac(gROOT->GetMacroPath());
  if (!fwd.IsNull()) {
    mac.Prepend(Form(".:%s:",fwd.Data()));
    gSystem->AddIncludePath(Form("-I%s", fwd.Data()));
  }
  else { 
    fwd = gSystem->Getenv("ANA_SRC");
    if (fwd.IsNull()) 
      fwd = "$(ALICE_ROOT)/PWGLF/FORWARD/analysis2";
    mac.Prepend(Form(".:%s/qa:%s/corrs:",fwd.Data(), fwd.Data()));
    gSystem->AddIncludePath(Form("-I%s/qa", fwd.Data()));
  }
  gROOT->SetMacroPath(mac);
  gSystem->Load("libGpad");
  gSystem->Load("libTree");

  gROOT->LoadMacro("QATrender.C+g");
  QATrender t(keep, type, year, period, pass, runNo);
  t.AddFile(input);
  // t.SetOutputName("trending.root");
  if (!t.Run()) exit(1);
}
//
// EOF
//
 RunQA.C:1
 RunQA.C:2
 RunQA.C:3
 RunQA.C:4
 RunQA.C:5
 RunQA.C:6
 RunQA.C:7
 RunQA.C:8
 RunQA.C:9
 RunQA.C:10
 RunQA.C:11
 RunQA.C:12
 RunQA.C:13
 RunQA.C:14
 RunQA.C:15
 RunQA.C:16
 RunQA.C:17
 RunQA.C:18
 RunQA.C:19
 RunQA.C:20
 RunQA.C:21
 RunQA.C:22
 RunQA.C:23
 RunQA.C:24
 RunQA.C:25
 RunQA.C:26
 RunQA.C:27
 RunQA.C:28
 RunQA.C:29
 RunQA.C:30
 RunQA.C:31
 RunQA.C:32
 RunQA.C:33
 RunQA.C:34
 RunQA.C:35
 RunQA.C:36
 RunQA.C:37
 RunQA.C:38
 RunQA.C:39
 RunQA.C:40
 RunQA.C:41
 RunQA.C:42
 RunQA.C:43
 RunQA.C:44
 RunQA.C:45
 RunQA.C:46
 RunQA.C:47
 RunQA.C:48
 RunQA.C:49
 RunQA.C:50
 RunQA.C:51
 RunQA.C:52
 RunQA.C:53
 RunQA.C:54
 RunQA.C:55
 RunQA.C:56
 RunQA.C:57
 RunQA.C:58
 RunQA.C:59
 RunQA.C:60
 RunQA.C:61
 RunQA.C:62
 RunQA.C:63
 RunQA.C:64
 RunQA.C:65
 RunQA.C:66
 RunQA.C:67
 RunQA.C:68
 RunQA.C:69
 RunQA.C:70
 RunQA.C:71
 RunQA.C:72