]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/qa/RunQA.C
flat friends update
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / qa / RunQA.C
1 /**
2  * @file   RunQA.C
3  * @author Christian Holm Christensen <cholm@nbi.dk>
4  * @date   Thu Nov 17 11:35:08 2011
5  * 
6  * @brief  Script to run the QATrender over a single run
7  * 
8  * @ingroup pwglf_forward_qa_scripts
9  */
10 class TTree;
11 class TCanvas;
12
13 /** 
14  * Run the QATrender
15  * 
16  * The QATrender is run over the list of files (runs) to produce the
17  * file <tt>trending.root</tt> which contains a TTree of QA
18  * information - one entry per run.  
19  * 
20  * The QATrender will also produce two files per run: 
21  * 
22  * - <tt>index.root</tt> which contains TCanvas objects of
23  *   the finished plots.
24  *
25  * - <tt>index.pdf</tt> which is a PDF of the TCanvases
26  *   mentioned above.
27  *
28  * @param input  Input file
29  * @param type   Data type (data or sim)
30  * @param year   Year 
31  * @param period Period (e.g., LHC10h)
32  * @param pass   Pass (e.g., pass1, cpass1, passMC)
33  * @param runNo  Run number 
34  * 
35  * @ingroup pwglf_forward_qa_scripts
36  */
37 void
38 RunQA(const char* input, 
39       const char* type, 
40       Int_t       year, 
41       const char* period,
42       const char* pass, 
43       Long_t      runNo) 
44 {
45   Bool_t keep = true;
46   TString fwd(gSystem->Getenv("QA_FWD"));
47   TString mac(gROOT->GetMacroPath());
48   if (!fwd.IsNull()) {
49     mac.Prepend(Form(".:%s:",fwd.Data()));
50     gSystem->AddIncludePath(Form("-I%s", fwd.Data()));
51   }
52   else { 
53     fwd = gSystem->Getenv("ANA_SRC");
54     if (fwd.IsNull()) 
55       fwd = "$(ALICE_ROOT)/PWGLF/FORWARD/analysis2";
56     mac.Prepend(Form(".:%s/qa:%s/corrs:",fwd.Data(), fwd.Data()));
57     gSystem->AddIncludePath(Form("-I%s/qa", fwd.Data()));
58   }
59   gROOT->SetMacroPath(mac);
60   gSystem->Load("libGpad");
61   gSystem->Load("libTree");
62
63   gROOT->LoadMacro("QATrender.C+g");
64   QATrender t(keep, type, year, period, pass, runNo);
65   t.AddFile(input);
66   // t.SetOutputName("trending.root");
67   if (!t.Run()) exit(1);
68 }
69 //
70 // EOF
71 //