]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCQAChecker.cxx
Assign track label pi to the raw digits, to be consitent with other detectors.
[u/mrichter/AliRoot.git] / TPC / AliTPCQAChecker.cxx
index ebbdba5de893841c2ff64e178cf11df7a9715cfe..01616f68ca90a111e9cacfc1bd4e850d351918b6 100644 (file)
 
 ClassImp(AliTPCQAChecker)
 
+
+//__________________________________________________________________
+AliTPCQAChecker& AliTPCQAChecker::operator = (const AliTPCQAChecker &checker)
+{
+  // Equal operator.
+  this->~AliTPCQAChecker();
+  new(this) AliTPCQAChecker(checker);
+  return *this;  
+}
+
 //__________________________________________________________________
-Double_t *
-AliTPCQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list, 
-                      AliDetectorRecoParam * /*recoParam*/)
+void
+AliTPCQAChecker::Check(Double_t * rv, AliQAv1::ALITASK_t index, TObjArray ** list, 
+                      const AliDetectorRecoParam * /*recoParam*/)
 {
   /* It is important to understand the destinction between indexed tasks (AliQAv1::TASKINDEX_t) which are used in the DataMaker classes and indexed tasks (AliQAv1::ALITASK_t) whihc are used in the checker class.
 
@@ -69,13 +79,12 @@ AliTPCQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list,
   if(fDebug>0)
     AliInfo("In AliTPCQAChecker::Check");
   
-  if (index!=AliQAv1::kRAW&&index!=AliQAv1::kREC&&index!=AliQAv1::kESD) {
+  if (index!=AliQAv1::kRAW&&index!=AliQAv1::kSIM&&index!=AliQAv1::kREC&&index!=AliQAv1::kESD) {
     
     AliWarning(Form("Checker for task %d not implement for the moment",index));
-    return NULL;
+    return;
   }
   
-  Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; 
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) 
     rv[specie] = 1.0; // All is fine 
   
@@ -86,6 +95,8 @@ AliTPCQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list,
     
     if (index == AliQAv1::kRAW)
       rv[specie] = CheckRAW(specie, list[specie]);
+    if (index == AliQAv1::kSIM)
+      rv[specie] = CheckSIM(specie, list[specie]);
     if (index == AliQAv1::kREC)
       rv[specie] = CheckREC(specie, list[specie]);
     if (index == AliQAv1::kESD)
@@ -97,8 +108,6 @@ AliTPCQAChecker::Check(AliQAv1::ALITASK_t index, TObjArray ** list,
                   AliQAv1::GetAliTaskName(index),
                   rv[specie]));
   }
-  
-  return rv;
 }
 
 //______________________________________________________________________________
@@ -111,20 +120,12 @@ Double_t AliTPCQAChecker::CheckRAW(Int_t specie, TObjArray* list)
   if(fDebug>2)
     list->Print();
 
-  Char_t specieName[256];
-  sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
-
   TH1* hRawsOccupancyVsSector = static_cast<TH1*>
-    (list->FindObject(Form("%s_hRawsOccupancyVsSector",specieName)));
+    (list->FindObject(Form("%s_hRawsOccupancyVsSector",AliRecoParam::GetEventSpecieName(specie))));
   TH1* hRawsQmaxVsSector = static_cast<TH1*>
-    (list->FindObject(Form("%s_hRawsQmaxVsSector",specieName)));
-  TH1* hRawsOccupancyVsEvent = static_cast<TH1*>
-    (list->FindObject(Form("%s_hRawsOccupancyVsEvent",specieName)));
-  TH1* hRawsNclustersVsEvent = static_cast<TH1*>
-    (list->FindObject(Form("%s_hRawsNclustersVsEvent",specieName)));
+    (list->FindObject(Form("%s_hRawsQmaxVsSector",AliRecoParam::GetEventSpecieName(specie))));
   
-  if (!hRawsOccupancyVsSector || !hRawsQmaxVsSector ||
-      !hRawsOccupancyVsEvent  || !hRawsNclustersVsEvent) 
+  if (!hRawsOccupancyVsSector || !hRawsQmaxVsSector)
     return -0.5; // fatal
   
   if(hRawsOccupancyVsSector->GetEntries()==0) {
@@ -141,6 +142,65 @@ Double_t AliTPCQAChecker::CheckRAW(Int_t specie, TObjArray* list)
   return 1.0; // ok
 }
 
+//______________________________________________________________________________
+Double_t AliTPCQAChecker::CheckSIM(Int_t specie, TObjArray* list)
+{
+  // This method checks the QA histograms associated with simulation
+  //
+  // For TPC this is:
+  // Digits : 
+  // The digit histogram gives the ADC distribution for all sigbnals
+  // above threshold. The check is just that there are digits.
+  // Hits : The hit histograms are checked to see that they are not
+  // empty. They contain a lot of detailed information on the
+  // energyloss model (they were used to debug the AliRoot TPC use of
+  // FLUKA).
+  //
+  // The check methods are simple:
+  // We do not know if it is bad that histograms are missing because
+  // this will always be the case for summable digits. So this check
+  // is not possible here.
+  // If digit histogram is empty (set error)
+  // If one of the hit histograms are empty (set error)
+  if(fDebug>0)
+    AliInfo("In AliTPCQAChecker::CheckSIM");
+  
+  if(fDebug>2)
+    list->Print();
+
+  TH1* hDigits = static_cast<TH1*>
+    (list->FindObject(Form("%s_hDigitsADC",AliRecoParam::GetEventSpecieName(specie))));
+  TH1* hHitsNhits = static_cast<TH1*> 
+    (list->FindObject(Form("%s_hHitsNhits",AliRecoParam::GetEventSpecieName(specie))));
+  TH1* hHitsElectrons         = static_cast<TH1*> 
+    (list->FindObject(Form("%s_hHitsElectrons",AliRecoParam::GetEventSpecieName(specie))));
+  TH1* hHitsRadius        = static_cast<TH1*> 
+    (list->FindObject(Form("%s_hHitsRadius",AliRecoParam::GetEventSpecieName(specie))));
+  TH1* histHitsPrimPerCm          = static_cast<TH1*> 
+    (list->FindObject(Form("%s_histHitsPrimPerCm",AliRecoParam::GetEventSpecieName(specie))));
+  TH1* histHitsElectronsPerCm          = static_cast<TH1*> 
+    (list->FindObject(Form("%s_histHitsElectronsPerCm",AliRecoParam::GetEventSpecieName(specie))));
+  
+//   if (!(hDigits) ||                                             // digit hists
+//       !(hHitsNhits && hHitsElectrons && hHitsRadius && histHitsPrimPerCm && histHitsElectronsPerCm)) // hit hists
+//     return -0.5; // fatal
+  
+  if (hDigits) {
+    if(hDigits->GetEntries()==0) 
+      return 0.25; // error
+  }
+
+  if (hHitsNhits && hHitsElectrons && hHitsRadius && 
+      histHitsPrimPerCm && histHitsElectronsPerCm) {
+    if (hHitsNhits->GetEntries()==0 || hHitsElectrons->GetEntries()==0 ||
+       hHitsRadius->GetEntries()==0 || histHitsPrimPerCm->GetEntries()==0 ||
+       histHitsElectronsPerCm->GetEntries()==0) 
+      return 0.25; // error
+  }
+
+  return 1; // ok
+}
+
 //______________________________________________________________________________
 Double_t AliTPCQAChecker::CheckREC(Int_t specie, TObjArray* list)
 {
@@ -168,19 +228,16 @@ Double_t AliTPCQAChecker::CheckREC(Int_t specie, TObjArray* list)
   if(fDebug>2)
     list->Print();
 
-  Char_t specieName[256];
-  sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
-
   TH1* hDigits = static_cast<TH1*>
-    (list->FindObject(Form("%s_hDigitsADC",specieName)));
+    (list->FindObject(Form("%s_hDigitsADC",AliRecoParam::GetEventSpecieName(specie))));
   TH1* hNclustersVsRow = static_cast<TH1*> 
-    (list->FindObject(Form("%s_hRecPointsRow",specieName)));
+    (list->FindObject(Form("%s_hRecPointsRow",AliRecoParam::GetEventSpecieName(specie))));
   TH1* hQshort         = static_cast<TH1*> 
-    (list->FindObject(Form("%s_hRecPointsQShort",specieName)));
+    (list->FindObject(Form("%s_hRecPointsQShort",AliRecoParam::GetEventSpecieName(specie))));
   TH1* hQmedium        = static_cast<TH1*> 
-    (list->FindObject(Form("%s_hRecPointsQMedium",specieName)));
+    (list->FindObject(Form("%s_hRecPointsQMedium",AliRecoParam::GetEventSpecieName(specie))));
   TH1* hQlong          = static_cast<TH1*> 
-    (list->FindObject(Form("%s_hRecPointsQLong",specieName)));
+    (list->FindObject(Form("%s_hRecPointsQLong",AliRecoParam::GetEventSpecieName(specie))));
   // The Qmax histograms are for now ignored
 
   if (!hDigits &&                                             // digits missing
@@ -219,15 +276,12 @@ Double_t AliTPCQAChecker::CheckESD(Int_t specie, TObjArray* list)
   if(fDebug>2)
     list->Print();
 
-  Char_t specieName[256];
-  sprintf(specieName, AliRecoParam::GetEventSpecieName(specie));
-
   TH1* hESDclusters = static_cast<TH1*>
-    (list->FindObject(Form("%s_hESDclusters",specieName)));
+    (list->FindObject(Form("%s_hESDclusters",AliRecoParam::GetEventSpecieName(specie))));
   TH1* hESDratio = static_cast<TH1*>
-    (list->FindObject(Form("%s_hESDratio",specieName)));
+    (list->FindObject(Form("%s_hESDratio",AliRecoParam::GetEventSpecieName(specie))));
   TH1* hESDpt = static_cast<TH1*>
-    (list->FindObject(Form("%s_hESDpt",specieName)));
+    (list->FindObject(Form("%s_hESDpt",AliRecoParam::GetEventSpecieName(specie))));
   
   if (!hESDclusters || !hESDratio || !hESDpt) 
     return -0.5; // fatal