AliRoot Core  3dc7879 (3dc7879)
AliExternalInfoTest.C
Go to the documentation of this file.
1 //
2 // Unit test for the AliExternalInfo
3 //
4 
5 
6 /*
7  gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/ -I$ALICE_ROOT/include -I$ALICE_ROOT/install/include -I$ALICE_ROOT/STEER\
8  -I$ALICE_ROOT/TPC -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD -I$ALICE_ROOT/TOF -I$ALICE_ROOT/RAW -I$ALICE_ROOT/STAT -I$ALICE_ROOT/TPC/TPCBase -I$ALICE_ROOT/TPC/TPCRec -I$ALICE_ROOT/TPC/TPCCalib -I$ALICE_PHYSICS/../src/PWGPP/TPC/ -I$ALICE_ROOT/../src/STAT/");
9 
10 
11  .L $AliRoot_SRC//STAT/test/AliExternalInfoTest.C+
12 
13 
14  TestMCProduction();
15  TestProductionAccess();
16 */
17 
18 
19 #include "AliExternalInfo.h"
20 #include "TTree.h"
21 #include "TMath.h"
22 
23 void TestMCProduction();
25 
27  //
28  //
29  //
32 }
33 
35  //
36  // Check availaibility fo the MC production infomation
37  // - MC production tree
38  // - MC tree
39  // Compatibility of the trees
40  //
41  ::Info("AliExternalInfo.TestMCProduction","Begin");
42  // 1.) Load MC production information
44  TTree * treeMCProd= info.GetTree("MonALISA.ProductionMC","","","MonALISA.MC");
45  TTree * treeMC= info.GetTree("MonALISA.MC","","","MonALISA.ProductionMC");
46  //
47  // 2.) Check availaibility
48  //
49  Int_t nentries=treeMC->Draw("prodName!=MonALISA.ProductionMC.prodName","1");
50  Double_t mean=(nentries>0) ? TMath::Mean(nentries, treeMC->GetV1()):1;
51  if (nentries>0) {
52  ::Info("AliExternalInfo.TestMCProduction.","TestStat(prodName==MonALISA.ProductionMC.prodName)%d-OK",nentries);
53  }else{
54  ::Error("AliExternalInfo.TestMCProduction.","TestStat(prodName==MonALISA.ProductionMC.prodName)%d-FAILED",nentries);
55  }
56  if (TMath::Abs(mean)<0.5/(1+nentries)) {
57  ::Info("AliExternalInfo.TestMCProduction","TestEqual(prodName==MonALISA.ProductionMC.prodName)%6.6f-OK",mean);
58  }else{
59  ::Error("AliExternalInfo.TestMCProduction","TestEqual(prodName==MonALISA.ProductionMC.prodName)%6.6f-FAILED",mean);
60  }
61  ::Info("AliExternalInfo.TestMCProduction","End");
62 
63 }
64 
65 
67  //
68  // Check availability of the AliExternalInfo
69  //
71  TTree * tree = info.GetTree("MonALISA.ProductionCycle", "", "");
72  //
73  if (tree->GetEntries()>0){
74  ::Info("AliExternalInfo.TestProductionAccess","Nproductions=%d >0 - OK", tree->GetEntries());
75  }else{
76  ::Error("AliExternalInfo.TestProductionAccess","Nproductions=%d - FAILED", tree->GetEntries());
77  return;
78  };
79  // check and dump some counters
80  tree->Draw("strstr(Description,\"for\")");
81 }
void TestMCProduction()
void TestProductionAccess()
AliExternalInfo info
void AliExternalInfoTest()
TTree * tree
TTree * GetTree(TString type, TString period, TString pass, Int_t buildIndex=1)
This class gives you an interface to different trees of information spread throughout ALICE...