]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
First implementation of QA checkers (P. Cerello)
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Apr 2008 14:00:05 +0000 (14:00 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Apr 2008 14:00:05 +0000 (14:00 +0000)
ITS/AliITSQAChecker.cxx
ITS/AliITSQAChecker.h
ITS/AliITSQADataMakerSim.cxx
ITS/AliITSQASDDChecker.h [new file with mode: 0644]
ITS/AliITSQASPDChecker.cxx [new file with mode: 0644]
ITS/AliITSQASPDChecker.h [new file with mode: 0644]
ITS/AliITSQASSDChecker.cxx [new file with mode: 0644]
ITS/AliITSQASSDChecker.h [new file with mode: 0644]
ITS/ITSrecLinkDef.h
ITS/libITSrec.pkg

index 05a5ce45f2470543e8a50a7209bd6e18c0e1ab6c..88352523edebee3bab5e308867822d90cdbdab7c 100644 (file)
 //  INFN Torino
 
 // --- ROOT system ---
-
+#include "TH1.h"
 
 // --- AliRoot header files ---
 #include "AliITSQAChecker.h"
+#include "AliITSQASPDChecker.h"
+#include "AliITSQASDDChecker.h"
+#include "AliITSQASSDChecker.h"
 
 ClassImp(AliITSQAChecker)
 
+//____________________________________________________________________________
+AliITSQAChecker::AliITSQAChecker(Bool_t kMode, Short_t subDet, Short_t ldc) :
+AliQACheckerBase("ITS","SDD Quality Assurance Checker")
+{
+  fkOnline = kMode; fDet = subDet; fLDC = ldc;
+  if(fDet == 0 || fDet == 1) {
+    AliDebug(1,"AliITSQAChecker::Create SPD Checker\n");
+  }
+  if(fDet == 0 || fDet == 2) {
+    AliDebug(1,"AliITSQAChecker::Create SDD Checker\n");
+  }
+  if(fDet == 0 || fDet == 3) {
+    AliDebug(1,"AliITSQAChecker::Create SSD Checker\n");
+  }
+
+}
+
 //__________________________________________________________________
 AliITSQAChecker& AliITSQAChecker::operator = (const AliITSQAChecker& qac )
 {
@@ -37,3 +57,30 @@ AliITSQAChecker& AliITSQAChecker::operator = (const AliITSQAChecker& qac )
   new(this) AliITSQAChecker(qac);
   return *this;
 }
+
+//____________________________________________________________________________
+const Double_t AliITSQAChecker::Check(TObjArray * list)
+{
+
+  // Super-basic check on the QA histograms on the input list:
+  // look whether they are empty!
+  if(fDet == 0 || fDet == 1) {
+    AliDebug(1,"AliITSQAChecker::Create SPD Checker\n");
+       if(!fSPDChecker) fSPDChecker = new AliITSQASPDChecker();
+       Double_t SPDcheck = fSPDChecker->Check();
+  }
+  if(fDet == 0 || fDet == 2) {
+    AliDebug(1,"AliITSQAChecker::Create SDD Checker\n");
+       if(!fSDDChecker) fSDDChecker = new AliITSQASDDChecker();
+       Double_t SDDcheck = fSDDChecker->Check();
+  }
+  if(fDet == 0 || fDet == 3) {
+    AliDebug(1,"AliITSQAChecker::Create SSD Checker\n");
+       if(!fSSDChecker) fSSDChecker = new AliITSQASSDChecker();
+       Double_t SSDcheck = fSSDChecker->Check();
+  }
+  // here merging part for common ITS QA result
+  return 0;
+}
+
+
index 3407a60a167dfb69483906f4ca4ce19e70c2ae3f..99b84f537bb595322df08b13fb603e1eb4ab4696 100644 (file)
@@ -20,19 +20,46 @@ class TH2F ;
 
 // --- AliRoot header files ---
 #include "AliQACheckerBase.h"
+
+class AliITSQASPDChecker;
+class AliITSQASDDChecker;
+class AliITSQASSDChecker;
 class AliITSLoader ; 
 
 class AliITSQAChecker: public AliQACheckerBase {
 
+friend class AliITSQASPDChecker;
+friend class AliITSQASDDChecker;
+friend class AliITSQASSDChecker;
+
 public:
-  AliITSQAChecker() : AliQACheckerBase("ITS","SDD Quality Assurance Data Maker") {;}          // ctor
-  AliITSQAChecker(const AliITSQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor   
+  AliITSQAChecker(Bool_t kMode = kFALSE, Short_t subDet = 0, Short_t ldc = 0) ;         // ctor
+  AliITSQAChecker(const AliITSQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()), fkOnline(kFALSE), fDet(0), fLDC(0), fSPDChecker(0), fSDDChecker(0), fSSDChecker(0) {;} // cpy ctor   
   AliITSQAChecker& operator = (const AliITSQAChecker& qac) ; //operator =
   virtual ~AliITSQAChecker() {;} // dtor
+  void SetMode(Bool_t kMode) { fkOnline = kMode; }
+  void SetSubDet(Short_t subdet) { fDet = subdet; }
+  void SetLDC(Short_t ldc) { fLDC = ldc; }
+  Bool_t GetMode() { return fkOnline; }
+  Short_t GetSubDet() { return fDet; }
+  Short_t GetLDC() { return fLDC; }
+
+ protected:
+
+  virtual const Double_t Check(TObjArray * list) ;
+  virtual const Double_t Check() {return 0.;} ;
 
 private:
-  
-  ClassDef(AliITSQAChecker,1)  // description 
+
+  Bool_t  fkOnline;
+  Short_t fDet;  
+  Short_t fLDC;
+
+  AliITSQASPDChecker *fSPDChecker;  // SPD Checker
+  AliITSQASDDChecker *fSDDChecker;  // SDD Checker
+  AliITSQASSDChecker *fSSDChecker;  // SSD Checker
+
+  ClassDef(AliITSQAChecker,3)  // description 
 
 };
 
index 4413f12ca24f53ba908f4bb681ebe148f8fa6d8a..61f03f5eea1141a94a49437f7850c984592cfb20 100644 (file)
@@ -35,6 +35,7 @@
 #include "AliLog.h"
 #include "AliQA.h"
 #include "AliQAChecker.h"
+#include "AliITSQAChecker.h"
 #include "AliRawReader.h"
 
 ClassImp(AliITSQADataMakerSim)
@@ -121,7 +122,9 @@ void AliITSQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray
   if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list);
   if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list);
   
-  //AliQAChecker::Instance()->Run( AliQA::kITS , task, list);  //temporary skipping the checking
+  AliQAChecker *qac = AliQAChecker::Instance();
+  AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0);
+  qac->Run( AliQA::kITS , task, list);  //temporary skipping the checking
 }
 
 //____________________________________________________________________________ 
diff --git a/ITS/AliITSQASDDChecker.h b/ITS/AliITSQASDDChecker.h
new file mode 100644 (file)
index 0000000..6edf0f8
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef ALIITSQASDDCHECKER_H
+#define ALIITSQASDDCHECKER_H
+/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+/* $Id$ */
+
+//
+//  Checks the quality assurance. 
+//  By comparing with reference data
+//  INFN Torino
+//  P. Cerello - apr 2008
+//
+
+
+// --- ROOT system ---
+class TFile ; 
+class TH2F ;  
+
+// --- AliRoot header files ---
+#include "AliQACheckerBase.h"
+#include "AliITSQAChecker.h"
+class AliITSLoader ; 
+
+class AliITSQASDDChecker: public TObject {
+
+public:
+  AliITSQASDDChecker() {;}          // ctor
+  AliITSQASDDChecker& operator = (const AliITSQASDDChecker& qac) ; //operator =
+  virtual ~AliITSQASDDChecker() {;} // dtor
+  const Double_t Check();
+
+private:
+  AliITSQASDDChecker(const AliITSQASDDChecker& qac) {;} // cpy ctor   
+  
+  ClassDef(AliITSQASDDChecker,1)  // description 
+
+};
+
+#endif // AliITSQASDDChecker_H
diff --git a/ITS/AliITSQASPDChecker.cxx b/ITS/AliITSQASPDChecker.cxx
new file mode 100644 (file)
index 0000000..b186c49
--- /dev/null
@@ -0,0 +1,83 @@
+/**************************************************************************
+ * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+// *****************************************
+//  Checks the quality assurance 
+//  by comparing with reference data
+//  P. Cerello Apr 2008
+//  INFN Torino
+
+// --- ROOT system ---
+
+// --- AliRoot header files ---
+#include "AliITSQASPDChecker.h"
+
+ClassImp(AliITSQASPDChecker)
+
+//__________________________________________________________________
+AliITSQASPDChecker& AliITSQASPDChecker::operator = (const AliITSQASPDChecker& qac ) 
+{
+  // Equal operator.
+  this->~AliITSQASPDChecker();
+  new(this) AliITSQASPDChecker(qac);
+  return *this;
+}
+
+//__________________________________________________________________
+const Double_t AliITSQASPDChecker::Check() 
+{
+/*
+  TObjArray * list
+  Double_t test = 0.0  ;
+  Int_t count = 0 ;
+
+  if (list->GetEntries() == 0){
+    test = 1. ; // nothing to check
+  }
+  else {
+    TIter next(list) ;
+    TH1 * hdata ;
+    count = 0 ;
+    while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
+      if (hdata) {
+        Double_t rv = 0.;
+        if(hdata->GetEntries()>0)rv=1;
+        AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
+        count++ ;
+        test += rv ;
+      }
+      else{
+        AliError("Data type cannot be processed") ;
+      }
+
+    }
+    if (count != 0) {
+      if (test==0) {
+        AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
+        test = 0.5;  //upper limit value to set kWARNING flag for a task
+      }
+      else {
+        test /= count ;
+      }
+    }
+  }
+
+  AliInfo(Form("Test Result = %f", test)) ;
+  return test ;
+*/
+  return 0.;   
+} 
diff --git a/ITS/AliITSQASPDChecker.h b/ITS/AliITSQASPDChecker.h
new file mode 100644 (file)
index 0000000..2607411
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef ALIITSQASPDCHECKER_H
+#define ALIITSQASPDCHECKER_H
+/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+/* $Id$ */
+
+//
+//  Checks the quality assurance. 
+//  By comparing with reference data
+//  INFN Torino
+//  P. Cerello - apr 2008
+//
+
+
+// --- ROOT system ---
+class TFile ; 
+class TH2F ;  
+
+// --- AliRoot header files ---
+#include "AliQACheckerBase.h"
+#include "AliITSQAChecker.h"
+class AliITSLoader ; 
+
+class AliITSQASPDChecker: public TObject {
+
+public:
+  AliITSQASPDChecker() {;}          // ctor
+  AliITSQASPDChecker& operator = (const AliITSQASPDChecker& qac) ; //operator =
+  virtual ~AliITSQASPDChecker() {;} // dtor
+  const Double_t Check();
+private:
+  
+  AliITSQASPDChecker(const AliITSQASPDChecker& qac){;}  // cpy ctor   
+  ClassDef(AliITSQASPDChecker,1)  // description 
+
+};
+
+#endif // AliITSQASPDChecker_H
diff --git a/ITS/AliITSQASSDChecker.cxx b/ITS/AliITSQASSDChecker.cxx
new file mode 100644 (file)
index 0000000..ab68f83
--- /dev/null
@@ -0,0 +1,85 @@
+/**************************************************************************
+ * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+// *****************************************
+//  Checks the quality assurance 
+//  by comparing with reference data
+//  P. Cerello Apr 2008
+//  INFN Torino
+
+// --- ROOT system ---
+
+// --- AliRoot header files ---
+#include "AliITSQASSDChecker.h"
+
+ClassImp(AliITSQASSDChecker)
+
+//__________________________________________________________________
+AliITSQASSDChecker& AliITSQASSDChecker::operator = (const AliITSQASSDChecker& qac ) 
+{
+  // Equal operator.
+  this->~AliITSQASSDChecker();
+  new(this) AliITSQASSDChecker(qac);
+  return *this;
+}
+
+//__________________________________________________________________
+const Double_t AliITSQASSDChecker::Check() 
+{
+/*
+  TObjArray * list
+  Double_t test = 0.0  ;
+  Int_t count = 0 ;
+
+  if (list->GetEntries() == 0){
+    test = 1. ; // nothing to check
+  }
+  else {
+    TIter next(list) ;
+    TH1 * hdata ;
+    count = 0 ;
+    while ( (hdata = dynamic_cast<TH1 *>(next())) ) {
+      if (hdata) {
+        Double_t rv = 0.;
+        if(hdata->GetEntries()>0)rv=1;
+        AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ;
+        count++ ;
+        test += rv ;
+      }
+      else{
+        AliError("Data type cannot be processed") ;
+      }
+
+    }
+    if (count != 0) {
+      if (test==0) {
+        AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING");
+        test = 0.5;  //upper limit value to set kWARNING flag for a task
+      }
+      else {
+        test /= count ;
+      }
+    }
+  }
+
+  AliInfo(Form("Test Result = %f", test)) ;
+  return test ;
+*/
+  return 0.;   
+}
+
diff --git a/ITS/AliITSQASSDChecker.h b/ITS/AliITSQASSDChecker.h
new file mode 100644 (file)
index 0000000..9a26634
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef ALIITSQASSDCHECKER_H
+#define ALIITSQASSDCHECKER_H
+/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+/* $Id$ */
+
+//
+//  Checks the quality assurance. 
+//  By comparing with reference data
+//  INFN Torino
+//  P. Cerello - apr 2008
+//
+
+
+// --- ROOT system ---
+class TFile ; 
+class TH2F ;  
+
+// --- AliRoot header files ---
+#include "AliQACheckerBase.h"
+#include "AliITSQAChecker.h"
+class AliITSLoader ; 
+
+class AliITSQASSDChecker: public TObject {
+
+public:
+  AliITSQASSDChecker() {;}          // ctor
+  AliITSQASSDChecker& operator = (const AliITSQASSDChecker& qac) ; //operator =
+  virtual ~AliITSQASSDChecker() {;} // dtor
+  const Double_t Check();
+
+private:
+  
+  AliITSQASSDChecker(const AliITSQASSDChecker& qac){;} // cpy ctor   
+  ClassDef(AliITSQASSDChecker,1)  // description 
+
+};
+
+#endif // AliITSQASSDChecker_H
index 49db3ab791d7a5182063af775de4a2bf8797d791..2c5348f980ab6738f344c76f639a1b13456b69ea 100644 (file)
 #pragma link C++ class AliITSQASPDDataMakerRec+;
 #pragma link C++ class AliITSQASDDDataMakerRec+;
 #pragma link C++ class AliITSQASSDDataMakerRec+;
+#pragma link C++ class AliITSQASPDChecker+;
+#pragma link C++ class AliITSQASDDChecker+;
+#pragma link C++ class AliITSQASSDChecker+;
 
 #endif
index bd79a962655b737ca512a6f4209a228de9165fea..a028b1a4636214b2df685ca46ee542b3884d654f 100644 (file)
@@ -88,7 +88,11 @@ SRCS =       AliITSDetTypeRec.cxx \
                AliITSQADataMakerRec.cxx \
                AliITSQASPDDataMakerRec.cxx \
                AliITSQASDDDataMakerRec.cxx \
-               AliITSQASSDDataMakerRec.cxx 
+               AliITSQASSDDataMakerRec.cxx \
+               AliITSQASPDChecker.cxx \
+                AliITSQASDDChecker.cxx \
+                AliITSQASSDChecker.cxx 
+
 
 HDRS:=  $(SRCS:.cxx=.h)