]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDQAChecker.cxx
Merge remote-tracking branch 'remotes/origin/master' into TPCdev
[u/mrichter/AliRoot.git] / TRD / AliTRDQAChecker.cxx
index 418aca0138a72ea549b66d8f7b554fead82b78a8..57845f6d8787729757ec142af034bb7e9c61426f 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-  Checks the quality assurance. 
-  By comparing with reference data
-  S.Radomski Uni-Heidelberg October 2007
-*/
+/* $Id$ */
+
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  Checks the quality assurance.                                         //
+//  By comparing with reference data                                      //
+//  S.Radomski Uni-Heidelberg October 2007                                //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 // --- ROOT system ---
 #include <TClass.h>
 
 // --- AliRoot header files ---
 #include "AliLog.h"
-#include "AliQA.h"
+#include "AliQAv1.h"
 #include "AliQAChecker.h"
 #include "AliTRDQAChecker.h"
 
 ClassImp(AliTRDQAChecker)
 
 //__________________________________________________________________
-AliTRDQAChecker& AliTRDQAChecker::operator = (const AliTRDQAChecker& qac )
+
+void AliTRDQAChecker::Check(Double_t * test, AliQAv1::ALITASK_t index, TObjArray ** list, const AliDetectorRecoParam* /*param*/) 
 {
-  // Equal operator.
-  this->~AliTRDQAChecker();
-  new(this) AliTRDQAChecker(qac);
-  return *this;
-}
 
+  // Super-basic check on the QA histograms on the input list: 
+
+  if (!list) return;
+  for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) test[i] = 0.5; 
+
+  //Int_t count[AliRecoParam::kNSpecies] = { 0 }; 
+
+  if (index != AliQAv1::kREC) return;
+
+  const Double_t lowAmp = 30;
+  const Double_t highAmp = 50;
+
+  for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+
+    TObjArray * arr = list[specie];
+    if (!arr) continue;
+    TH1D *hist = (TH1D*) arr->At(12);
+    if (!hist) continue;
+    
+    Double_t value = hist->Integral(hist->FindBin(lowAmp), hist->FindBin(highAmp));
+    if (hist->GetSum())
+      test[specie] = value / hist->GetSum();
+
+  }
+}  
+
+//____________________________________________________________________________