]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFQADataMaker.cxx
New version of MUONTRKda:
[u/mrichter/AliRoot.git] / TOF / AliTOFQADataMaker.cxx
index 71c3f897e35ffbf81eefb19d91fa518b10294c7e..7275d25edfc722d3cc16c66d2fbe044e8e356520 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-/*
-  Produces the data needed to calculate the TOF quality assurance. 
-  QA objects are 1 & 2 Dimensional histograms.
-  author: S.Arcelli
-*/
+
+///////////////////////////////////////////////////////////////////////
+//                                                                   //
+//  Produces the data needed to calculate the TOF quality assurance. //
+//  QA objects are 1 & 2 Dimensional histograms.                     //
+//  author: S.Arcelli                                                //
+//                                                                   //
+///////////////////////////////////////////////////////////////////////
 
 #include <TClonesArray.h>
 #include <TFile.h> 
@@ -30,6 +33,7 @@
 #include "AliTOFSDigit.h"
 #include "AliTOFhitT0.h"
 #include "AliTOFQADataMaker.h"
+#include "AliQAChecker.h"
 #include "AliRawReader.h"
 #include "AliTOFRawStream.h"
 #include "AliTOFrawData.h"
@@ -74,21 +78,24 @@ void AliTOFQADataMaker::InitHits()
   //
   // create Hits histograms in Hits subdir
   //
+
+  Bool_t expert = kFALSE;
+
   TH1F * h0 = new TH1F("hTOFHits",    "Number of TOF Hits ",301, -1.02, 5.) ; 
   h0->Sumw2() ;
-  Add2HitsList(h0, 0) ;
+  Add2HitsList(h0, 0, expert) ;
 
   TH1F * h1  = new TH1F("hTOFHitsTime", "Hits Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  Add2HitsList(h1, 1) ;
+  Add2HitsList(h1, 1, expert) ;
 
   TH1F * h2  = new TH1F("hTOFHitsLength", "Length Spectrum in TOF (cm)", 500, 0., 500) ; 
   h2->Sumw2() ;
-  Add2HitsList(h2, 2) ;
+  Add2HitsList(h2, 2, expert) ;
 
   TH2F * h3  = new TH2F("hTOFHitsClusMap","Hits vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ; 
   h3->Sumw2() ;
-  Add2HitsList(h3, 3) ;
+  Add2HitsList(h3, 3, expert) ;
 }
 
 //____________________________________________________________________________ 
@@ -97,20 +104,23 @@ void AliTOFQADataMaker::InitDigits()
   //
   // create Digits histograms in Digits subdir
   //
+
+  Bool_t expert = kFALSE;
+
   TH1F * h0 = new TH1F("hTOFDigits",    "Number of TOF Digits ",301, -1.02, 5.) ;   h0->Sumw2() ;
-  Add2DigitsList(h0, 0) ;
+  Add2DigitsList(h0, 0, expert) ;
 
   TH1F * h1  = new TH1F("hTOFDigitsTime", "Digits Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  Add2DigitsList(h1, 1) ;
+  Add2DigitsList(h1, 1, expert) ;
 
   TH1F * h2  = new TH1F("hTOFDigitsToT", "Digits ToT Spectrum in TOF (ns)", 500, 0., 50) ; 
   h2->Sumw2() ;
-  Add2DigitsList(h2, 2) ;
+  Add2DigitsList(h2, 2, expert) ;
 
   TH2F * h3  = new TH2F("hTOFDigitsClusMap","Digits vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ; 
   h3->Sumw2() ;
-  Add2DigitsList(h3, 3) ;
+  Add2DigitsList(h3, 3, expert) ;
 
 }
 
@@ -120,16 +130,19 @@ void AliTOFQADataMaker::InitSDigits()
   //
   // create SDigits histograms in SDigits subdir
   //
+
+  Bool_t expert = kFALSE;
+
   TH1F * h0 = new TH1F("hTOFSDigits",    "Number of TOF SDigits ",301, -1.02, 5.) ;   h0->Sumw2() ;
-  Add2SDigitsList(h0, 0) ;
+  Add2SDigitsList(h0, 0, expert) ;
 
   TH1F * h1  = new TH1F("hTOFSDigitsTime", "SDigits Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  Add2SDigitsList(h1, 1) ;
+  Add2SDigitsList(h1, 1, expert) ;
 
   TH2F * h2  = new TH2F("hTOFSDigitsClusMap","SDigits vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ; 
   h2->Sumw2() ;
-  Add2SDigitsList(h2, 2) ;
+  Add2SDigitsList(h2, 2, expert) ;
 
 }
 
@@ -139,20 +152,23 @@ void AliTOFQADataMaker::InitRaws()
   //
   // create Raws histograms in Raws subdir
   //
+
+  Bool_t expert = kFALSE;
+
   TH1F * h0 = new TH1F("hTOFRaws",    "Number of TOF Raws ",301, -1.02, 5.) ;   h0->Sumw2() ;
-  Add2RawsList(h0, 0) ;
+  Add2RawsList(h0, 0, expert) ;
 
   TH1F * h1  = new TH1F("hTOFRawsTime", "Raws Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  Add2RawsList(h1, 1) ;
+  Add2RawsList(h1, 1, expert) ;
 
   TH1F * h2  = new TH1F("hTOFRawsToT", "Raws ToT Spectrum in TOF (ns)", 500, 0., 50) ; 
   h2->Sumw2() ;
-  Add2RawsList(h2, 2) ;
+  Add2RawsList(h2, 2, expert) ;
 
   TH2F * h3  = new TH2F("hTOFRawsClusMap","Raws vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ; 
   h3->Sumw2() ;
-  Add2RawsList(h3, 3) ;
+  Add2RawsList(h3, 3, expert) ;
 
 }
 
@@ -162,24 +178,27 @@ void AliTOFQADataMaker::InitRecPoints()
   //
   // create RecPoints histograms in RecPoints subdir
   //
+
+  Bool_t expert = kFALSE;
+
   TH1F * h0 = new TH1F("hTOFRecPoints",    "Number of TOF RecPoints ",301, -1.02, 5.) ;   h0->Sumw2() ;
-  Add2RecPointsList(h0, 0) ;
+  Add2RecPointsList(h0, 0, expert) ;
 
   TH1F * h1  = new TH1F("hTOFRecPointsTime", "RecPoints Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  Add2RecPointsList(h1, 1) ;
+  Add2RecPointsList(h1, 1, expert) ;
 
   TH1F * h2  = new TH1F("hTOFRecPointsRawTime", "RecPoints raw Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
   h2->Sumw2() ;
-  Add2RecPointsList(h2, 2) ;
+  Add2RecPointsList(h2, 2, expert) ;
 
   TH1F * h3  = new TH1F("hTOFRecPointsToT", "RecPoints ToT Spectrum in TOF (ns)", 500, 0., 50) ; 
   h3->Sumw2() ;
-  Add2RecPointsList(h3, 3) ;
+  Add2RecPointsList(h3, 3, expert) ;
 
   TH2F * h4  = new TH2F("hTOFRecPointsClusMap","RecPoints vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ; 
   h4->Sumw2() ;
-  Add2RecPointsList(h4, 4) ;
+  Add2RecPointsList(h4, 4, expert) ;
 
 }
 
@@ -189,25 +208,28 @@ void AliTOFQADataMaker::InitESDs()
   //
   //create ESDs histograms in ESDs subdir
   //
+
+  Bool_t expert = kFALSE;
+
   TH1F * h0 = new TH1F("hTOFESDs",    "Number of matched TOF tracks over ESDs",       250, -1., 4.) ;  
   h0->Sumw2() ; 
-  Add2ESDsList(h0, 0) ;
+  Add2ESDsList(h0, 0, expert) ;
 
   TH1F * h1  = new TH1F("hTOFESDsTime", "Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  Add2ESDsList(h1, 1) ;
+  Add2ESDsList(h1, 1, expert) ;
 
   TH1F * h2  = new TH1F("hTOFESDsRawTime", "raw Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
   h2->Sumw2() ;
-  Add2ESDsList(h2, 2) ;
+  Add2ESDsList(h2, 2, expert) ;
 
   TH1F * h3  = new TH1F("hTOFESDsToT", "ToT Spectrum in TOF (ns)", 500, 0., 50) ; 
   h3->Sumw2() ;
-  Add2ESDsList(h3, 3) ;
+  Add2ESDsList(h3, 3, expert) ;
 
   TH1F * h4 = new TH1F("hTOFESDsPID",    "Fraction of matched TOF tracks with good PID glag", 100, 0., 1.) ;  
   h4->Sumw2() ; 
-  Add2ESDsList(h4, 4) ;
+  Add2ESDsList(h4, 4, expert) ;
 }
 
 
@@ -222,7 +244,7 @@ void AliTOFQADataMaker::MakeHits(TClonesArray * hits)
   Int_t out[5];
 
   Int_t nentries=hits->GetEntriesFast();
-  if(nentries==0) {
+  if(nentries<=0) {
     GetHitsData(0)->Fill(-1.) ; 
   } else{
     GetHitsData(0)->Fill(TMath::Log10(nentries)) ; 
@@ -295,7 +317,7 @@ void AliTOFQADataMaker::MakeDigits(TClonesArray * digits)
   Int_t out[5];
 
   Int_t nentries=digits->GetEntriesFast();
-  if(nentries==0){
+  if(nentries<=0){
     GetDigitsData(0)->Fill(-1.) ; 
   }else{
     GetDigitsData(0)->Fill(TMath::Log10(nentries)) ; 
@@ -350,7 +372,7 @@ void AliTOFQADataMaker::MakeSDigits(TClonesArray * sdigits)
   Int_t out[5];
 
   Int_t nentries=sdigits->GetEntriesFast();
-  if(nentries==0){
+  if(nentries<=0){
     GetSDigitsData(0)->Fill(-1.) ; 
   }else{
     GetSDigitsData(0)->Fill(TMath::Log10(nentries)) ; 
@@ -437,7 +459,7 @@ void AliTOFQADataMaker::MakeRaws(AliRawReader* rawReader)
   } // DDL Loop
   
   Int_t nentries=ntof;
-  if(nentries==0){
+  if(nentries<=0){
     GetRawsData(0)->Fill(-1.) ; 
   }else{
     GetRawsData(0)->Fill(TMath::Log10(nentries)) ; 
@@ -470,7 +492,7 @@ void AliTOFQADataMaker::MakeRecPoints(TTree * clustersTree)
   clustersTree->GetEvent(0);  
   
   Int_t nentries=clusters->GetEntriesFast();
-  if(nentries==0){
+  if(nentries<=0){
     GetRecPointsData(0)->Fill(-1.) ; 
   }else{
     GetRecPointsData(0)->Fill(TMath::Log10(nentries)) ; 
@@ -522,7 +544,7 @@ void AliTOFQADataMaker::MakeESDs(AliESDEvent * esd)
   }
   
   Int_t nentries=ntof;
-  if(nentries==0){
+  if(nentries<=0){
     GetESDsData(0)->Fill(-1.) ;
   }else{
     GetESDsData(0)->Fill(TMath::Log10(nentries)) ;
@@ -540,6 +562,14 @@ void AliTOFQADataMaker::StartOfDetectorCycle()
   //to be implemented  
 }
 
+//____________________________________________________________________________ 
+void AliTOFQADataMaker::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+{
+  //Detector specific actions at end of cycle
+  // do the QA checking
+
+  AliQAChecker::Instance()->Run(AliQA::kTOF, task, list) ;  
+}
 //____________________________________________________________________________
 void AliTOFQADataMaker::GetMapIndeces(Int_t* in , Int_t* out)
 {