add directory for QA macros
authorjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Jul 2008 09:05:16 +0000 (09:05 +0000)
committerjklay <jklay@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Jul 2008 09:05:16 +0000 (09:05 +0000)
EMCAL/macros/QaDB/makeEMCALQARef.C [new file with mode: 0644]

diff --git a/EMCAL/macros/QaDB/makeEMCALQARef.C b/EMCAL/macros/QaDB/makeEMCALQARef.C
new file mode 100644 (file)
index 0000000..84745ed
--- /dev/null
@@ -0,0 +1,114 @@
+/* 
+
+  JLKlay 04-July-2008
+
+  Example macro to store QA reference data from simulations into OCDB
+
+  All EMCAL.QA.<runnumber>.*.root files are merged by the qas.Merge(runNumber)
+  method, then stored into the local directory
+  $ALICE_ROOT/EMCAL/Ref/Sim/Run0_999999999_v0_s0.root
+
+*/
+
+
+void makeEMCALQARef(Int_t runNumber = 0, Int_t viewHistos = 0) {
+
+  // Save QA data generated by DataMaker into OCDB
+  AliCDBManager * man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://$ALICE_ROOT");
+  // where ?
+  AliQA::SetQARefStorage("local://$ALICE_ROOT");
+  // what ?
+  AliQA::SetQARefDataDirName("Sim") ; //Data, Pedestals, BlackEvent,.....
+
+  AliQADataMakerSteer qas ;
+  //Find all files of the type EMCAL.QA.<runNumber>.*.root and add
+  //them together
+  qas.Merge(runNumber);
+  //Save to OCDB
+  qas.Save2OCDB(runNumber) ;
+
+  if(viewHistos) {
+    TFile *f = new TFile("Merged.QA.0.root");
+  
+    if(f) {
+      //Simulation hits
+      TH1F* hHitE = (TH1F*)f->Get("EMCAL/Hits/hEmcalHits");
+      hHitE->SetDirectory(0);
+      TH1I* hHitM = (TH1I*)f->Get("EMCAL/Hits/hEmcalHitsMul");
+      hHitM->SetDirectory(0);
+      
+      TCanvas *c1 = new TCanvas("c1_hits","Hits",20,20,800,400);
+      c1->Divide(2,1);
+      c1->cd(1);
+      hHitE->Draw();
+      c1->cd(2);
+      hHitM->Draw();
+      
+      //Simulation SDigits
+      TH1F* hSDigE = (TH1F*)f->Get("EMCAL/SDigits/hEmcalSDigits");
+      hSDigE->SetDirectory(0);
+      TH1I* hSDigM = (TH1I*)f->Get("EMCAL/SDigits/hEmcalSDigitsMul");
+      hSDigM->SetDirectory(0);
+      
+      TCanvas *c2 = new TCanvas("c2_sdigits","SDigits",40,40,800,400);
+      c2->Divide(2,1);
+      c2->cd(1);
+      hSDigE->Draw();
+      c2->cd(2);
+      hSDigM->Draw();
+      
+      //Simulation Digits
+      TH1I* hDigA = (TH1I*)f->Get("EMCAL/Digits/hEmcalDigits");
+      hDigA->SetDirectory(0);
+      TH1I* hDigM = (TH1I*)f->Get("EMCAL/Digits/hEmcalDigitsMul");
+      hDigM->SetDirectory(0);
+      
+      TCanvas *c3 = new TCanvas("c3_digits","Digits",60,60,800,400);
+      c3->Divide(2,1);
+      c3->cd(1);
+      hDigA->Draw();
+      c3->cd(2);
+      hDigM->Draw();
+      
+      //RecPoints
+      TH1F* hRpE = (TH1F*)f->Get("EMCAL/RecPoints/hEMCALRpE");
+      hRpE->SetDirectory(0);
+      TH1I* hRpM = (TH1I*)f->Get("EMCAL/RecPoints/hEMCALRpM");
+      hRpM->SetDirectory(0);
+      TH1I* hRpDigM = (TH1I*)f->Get("EMCAL/RecPoints/hEMCALRpDigM");
+      hRpDigM->SetDirectory(0);
+      
+      TCanvas* c4 = new TCanvas("c4_recpoints","RecPoints",80,80,800,800);
+      c4->Divide(2,2);
+      c4->cd(1);
+      hRpE->Draw();
+      c4->cd(2);
+      hRpM->Draw();
+      c4->cd(3);
+      hRpDigM->Draw();
+      
+      //ESDs
+      TH1F* hCClusE = (TH1F*)f->Get("EMCAL/ESDs/hESDCaloClusterE");
+      hCClusE->SetDirectory(0);
+      TH1I* hCClusM = (TH1I*)f->Get("EMCAL/ESDs/hESDCaloClusterM");
+      hCClusM->SetDirectory(0);
+      TH1F* hCCellE = (TH1F*)f->Get("EMCAL/ESDs/hESDCaloCellE");
+      hCCellE->SetDirectory(0);
+      TH1I* hCCellM = (TH1I*)f->Get("EMCAL/ESDs/hESDCaloCellM");
+      hCCellM->SetDirectory(0);
+      
+      TCanvas* c5 = new TCanvas("c5_esds","ESDs",100,100,800,800);
+      c5->Divide(2,2);
+      c5->cd(1);
+      hCClusE->Draw();
+      c5->cd(2);
+      hCClusM->Draw();
+      c5->cd(3);
+      hCCellE->Draw();
+      c5->cd(4);
+      hCCellM->Draw();
+    }
+  }
+
+}