]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Put all the naming conventions into AlIQA
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Nov 2007 13:48:58 +0000 (13:48 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Nov 2007 13:48:58 +0000 (13:48 +0000)
STEER/AliQA.cxx
STEER/AliQA.h
STEER/AliQAChecker.cxx
STEER/AliQAChecker.h
STEER/AliQADataMaker.cxx
STEER/AliQADataMakerSteer.cxx
STEER/AliQADataMakerSteer.h

index 6ea84d8b68e0b60355eebebfc83fe2f51eafd276..19904bdb186c7745639d40ba0bded259100e0b59 100644 (file)
 // --- Standard library ---
 
 // --- AliRoot header files ---
+#include "AliCDBManager.h"
+#include "AliCDBMetaData.h"
+#include "AliCDBEntry.h"
 #include "AliLog.h"
 #include "AliQA.h"
 #include "AliQAChecker.h"
 
 
 ClassImp(AliQA)
-  AliQA * AliQA::fgQA        = 0x0 ;
-  TFile      * AliQA::fgDataFile  = 0x0 ;   
-  TString      AliQA::fgDataName  = "QA" ;   
-  TString      AliQA::fgDetNames[]  = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD",
+  AliQA    * AliQA::fgQA                = 0x0 ;
+  TFile    * AliQA::fgDataFile          = 0x0 ;   
+  TString    AliQA::fgDataName          = "QA" ;  // will transform into Det.QA.run.cycle.root  
+  TString    AliQA::fgQARefDirName             = "local://Ref/" ; 
+  TString    AliQA::fgQARefFileName     = "QA.root" ;
+  TString    AliQA::fgQAResultDirName   = "local://RUN/" ;  
+  TString    AliQA::fgQAResultFileName  = "QA.root" ; 
+  TString    AliQA::fgDetNames[]  = {"ITS", "TPC", "TRD", "TOF", "PHOS", "HMPID", "EMCAL", "MUON", "FMD",
                                        "ZDC", "PMD", "T0", "VZERO", "ACORDE", "HLT"} ;   
-  TString      AliQA::fgTaskNames[]  = {"Raws", "Hits", "SDigits", "Digits", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ;   
+  TString   AliQA::fgTaskNames[]  = {"Raws", "Hits", "SDigits", "Digits", "RecPoints", "TrackSegments", "RecParticles", "ESDs"} ;   
 
 //____________________________________________________________________________
 AliQA::AliQA() : 
@@ -61,6 +68,7 @@ AliQA::AliQA() :
 {
   // default constructor
   // beware singleton: not to be used
+  
   for (Int_t index = 0 ; index < fNdet ; index++) 
        fQA[index] = 0 ; 
 }
@@ -129,6 +137,32 @@ AliQA::~AliQA()
   delete[] fQA ;
 }
 
+//_______________________________________________________________
+const Bool_t AliQA::AddQAData2CDB(const char * defSto) const 
+{
+       // loads the QA data into the OCDB
+       Bool_t rv = kTRUE ; 
+       AliCDBManager* man = AliCDBManager::Instance() ;
+       man->SetDefaultStorage(defSto) ;
+       AliCDBMetaData md ; 
+       // loop over detectors  
+       AliCDBId id("QA/Ref/PHOS",0,999999999) ;
+
+       
+       return rv ; 
+}  
+
+//_______________________________________________________________
+const Bool_t AliQA::CheckFatal() const
+{
+  // check if any FATAL status is set
+  Bool_t rv = kFALSE ;
+  Int_t index ;
+  for (index = 0; index < kNDET ; index++)
+    rv = rv || IsSet(DETECTORINDEX(index), fTask, kFATAL) ;
+  return rv ;
+}
+
 //_______________________________________________________________
 const Bool_t AliQA::CheckRange(DETECTORINDEX det) const
 { 
@@ -161,7 +195,6 @@ const Bool_t AliQA::CheckRange(QABIT bit) const
   return rv ;
 }
 
-
 //_______________________________________________________________
 TFile * AliQA::GetQADMOutFile(const char * name, const Int_t run, const Int_t cycle) 
 {
@@ -187,6 +220,7 @@ TFile * AliQA::GetQADMOutFile(const char * name, const Int_t run, const Int_t cy
   return fgDataFile ; 
 } 
 
+
 //_______________________________________________________________
 const char * AliQA::GetDetName(Int_t det) 
 {
@@ -229,14 +263,33 @@ const char * AliQA::GetAliTaskName(ALITASK tsk)
 }
 
 //_______________________________________________________________
-const Bool_t AliQA::CheckFatal() const
+TFile * AliQA::GetQARefFile() 
 {
-  // check if any FATAL status is set
-  Bool_t rv = kFALSE ;
-  Int_t index ;
-  for (index = 0; index < kNDET ; index++)
-    rv = rv || IsSet(DETECTORINDEX(index), fTask, kFATAL) ;
-  return rv ;
+  // opens the file whwre Quality Assurance Reference Data are stored
+
+       TString fileName(fgQARefDirName + fgQARefFileName) ; 
+
+       if ( fileName.Contains("local://")) 
+               fileName.ReplaceAll("local://", "") ;
+
+       return TFile::Open(fileName.Data(), "READ") ;
+} 
+
+//_______________________________________________________________
+TFile * AliQA::GetQAResultFile() 
+{
+  // opens the file to store the  Quality Assurance Data Checker results
+   
+       TString fileName(fgQAResultDirName + fgQAResultFileName) ; 
+       if ( fileName.Contains("local://")) 
+               fileName.ReplaceAll("local://", "") ;
+       TString opt("") ; 
+       if ( !gSystem->AccessPathName(fileName) )
+               opt = "UPDATE" ; 
+       else 
+               opt = "NEW" ; 
+      
+       return TFile::Open(fileName, opt) ;   
 }
 
 //_______________________________________________________________
@@ -352,6 +405,30 @@ void AliQA::Set(QABIT bit)
   SetStatusBit(fDet, fTask, bit) ;
 }
 
+//_____________________________________________________________________________
+void AliQA::SetQARefDir(const char * name)
+{
+  // Set the root directory where the QA reference data are stored
+
+  fgQARefDirName.Prepend(name) ; 
+  printf("AliQA::SetQARefDir: QA references are in  %s\n", fgQARefDirName.Data()) ;
+  if ( fgQARefDirName.Contains("local://")) 
+    fgQARefDirName.ReplaceAll("local:/", "") ;
+  fgQARefFileName.Prepend(fgQARefDirName) ;
+}
+
+//_____________________________________________________________________________
+void AliQA::SetQAResultDirName(const char * name)
+{
+  // Set the root directory where to store the QA status object
+
+  fgQAResultDirName.Prepend(name) ; 
+  printf("AliQA::SetQAResultDirName: QA results are in  %s\n", fgQAResultDirName.Data()) ;
+  if ( fgQAResultDirName.Contains("local://")) 
+    fgQAResultDirName.ReplaceAll("local:/", "") ;
+  fgQAResultFileName.Prepend(fgQAResultDirName) ;
+}
+
 //_______________________________________________________________
 void AliQA::SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit)
 {
index aad43646cdf7d8c2d79667f79767413db158da69..9394732ac45b9a621a20cf2b5d69db1fa87be9c7 100644 (file)
@@ -43,6 +43,7 @@ public:
   static  AliQA *   Instance() ;
   static  AliQA *   Instance(const DETECTORINDEX det) ;
   static  AliQA *   Instance(const ALITASK tsk) ;
+  const Bool_t           AddQAData2CDB(const char * defSto) const ;
   const Bool_t           CheckFatal() const ;
   static const char *    GetAliTaskName(ALITASK tsk) ;
   static const char *    GetDataName() { return fgDataName.Data() ; }
@@ -50,8 +51,14 @@ public:
   static const TString   GetTaskName(TASKINDEX tsk) { return fgTaskNames[tsk] ; }
   static const char *    GetDetName(Int_t det) ;
   static TFile *         GetQADMOutFile(const char * name, const Int_t run, const Int_t cycle) ; 
+  static TFile *         GetQAResultFile() ; 
+  static TFile *         GetQARefFile() ; 
+  static const char  *   GetQAResultFileName() { return (fgQAResultDirName + fgQAResultFileName).Data() ; }
+  static const char  *   GetQARefFileName() { return (fgQARefDirName + fgQARefFileName).Data() ; }
   const Bool_t           IsSet(DETECTORINDEX det, ALITASK tsk, QABIT bit) const ;
   void                   Set(QABIT bit) ;
+  static void                   SetQAResultDirName(const char * name) ; 
+  static void            SetQARefDir(const char * name) ; 
   void                   Show() const { ShowStatus(fDet) ; }
   void                   ShowAll() const ;
 
@@ -71,15 +78,19 @@ private:
   void                 SetStatus(DETECTORINDEX det, UShort_t status) { fQA[det] = status ; }
   void                 SetStatusBit(DETECTORINDEX det, ALITASK tsk, QABIT bit) ;
 
-  static AliQA *fgQA              ; // pointer to the instance of the singleton
-  Int_t              fNdet        ; // number of detectors
-  ULong_t    *       fQA          ; //[fNdet] the status word 4 bits for SIM, REC, ESD, ANA each
-  DETECTORINDEX      fDet         ; //!  the current detector (ITS, TPC, ....)
-  ALITASK            fTask        ; //!  the current environment (SIM, REC, ESD, ANA)
-  static TFile *     fgDataFile   ; //! the output file where the quality assurance maker store their results
-  static TString     fgDataName   ; //! the name of the file where the quality assurance maker store their results
-  static TString     fgDetNames[] ; //! list of detector names   
-  static TString     fgTaskNames[]; //! list of tasks names   
+  static AliQA *fgQA                                   ; // pointer to the instance of the singleton
+  Int_t              fNdet                             ; // number of detectors
+  ULong_t    *       fQA                               ; //[fNdet] the status word 4 bits for SIM, REC, ESD, ANA each
+  DETECTORINDEX      fDet                              ; //!  the current detector (ITS, TPC, ....)
+  ALITASK            fTask                             ; //!  the current environment (SIM, REC, ESD, ANA)
+  static TFile *     fgDataFile                        ; //! the output file where the quality assurance maker store their results
+  static TString     fgDataName                        ; //! the name of the file where the quality assurance maker store their results
+  static TString     fgDetNames[]              ; //! list of detector names   
+  static TString     fgQAResultDirName  ; //! the location of the output file where the QA results are stored  
+  static TString     fgQAResultFileName ; //! the output file where the QA results are stored  
+  static TString     fgQARefDirName            ; //! name of directory where to find the reference data file
+  static TString     fgQARefFileName   ; //! file name where to find the reference data
+  static TString     fgTaskNames[]             ; //! list of tasks names   
 
  ClassDef(AliQA,1)  //ALICE Quality Assurance Object
 };
index cf2776e5f688a472ffe8eef2bb871e969aba92d7..22173614a260677a7571065e2b962d790a6c779b 100644 (file)
 ClassImp(AliQAChecker)
   AliQAChecker * AliQAChecker::fgQAChecker = 0x0 ;
   TFile   * AliQAChecker::fgQAResultFile        = 0x0 ;  
-  TString   AliQAChecker::fgQAResultDirName     = "local://RUN/";  
-  TString   AliQAChecker::fgQAResultFileName    = "QA.root" ; 
+//  TString   AliQAChecker::fgQAResultDirName     = "local://RUN/";  
+//  TString   AliQAChecker::fgQAResultFileName    = "QA.root" ; 
 
 //_____________________________________________________________________________
 AliQAChecker::AliQAChecker(const char* name, const char* title) :
   TNamed(name, title),
   fDataFile(0x0), 
-  fRefDirName("./Ref/"), 
-  fRefName("QA.root"), 
+//  fRefDirName("./Ref/"), 
+//  fRefName("QA.root"), 
   fFoundDetectors(".")
 {
   // ctor: initialise checkers and open the data file   
   for (Int_t det = 0 ; det < AliQA::kNDET ; det++) 
     fCheckers[det] = NULL ; 
   
-  //GetDataFile() ; 
-  fRefDirName.Append(fRefName) ; 
+//  fRefDirName.Append(fRefName) ; 
 }
 
 //_____________________________________________________________________________
 AliQAChecker::AliQAChecker(const AliQAChecker& qac) :
   TNamed(qac),
   fDataFile(qac.fDataFile), 
-  fRefDirName(qac.fRefDirName), 
-  fRefName(qac.fRefName), 
+//  fRefDirName(qac.fRefDirName), 
+//  fRefName(qac.fRefName), 
   fFoundDetectors(qac.fFoundDetectors)
 {
   // copy constructor
@@ -117,16 +116,17 @@ TFile * AliQAChecker:: GetQAResultFile()
       fgQAResultFile = 0x0 ; 
     }
   }   
-  if ( fgQAResultFileName.Contains("local://")) 
-    fgQAResultFileName.ReplaceAll("local:/", "") ;
-  
-  TString opt("") ; 
-  if ( !gSystem->AccessPathName(fgQAResultFileName) )
-    opt = "UPDATE" ; 
-  else 
-    opt = "NEW" ; 
-  fgQAResultFile = TFile::Open(fgQAResultFileName, opt) ;   
-      
+//  if ( fgQAResultFileName.Contains("local://")) 
+//    fgQAResultFileName.ReplaceAll("local:/", "") ;
+//  
+//  TString opt("") ; 
+//  if ( !gSystem->AccessPathName(fgQAResultFileName) )
+//    opt = "UPDATE" ; 
+//  else 
+//    opt = "NEW" ; 
+//  fgQAResultFile = TFile::Open(fgQAResultFileName, opt) ;   
+//      
+  fgQAResultFile = AliQA::GetQAResultFile() ; 
   return fgQAResultFile ; 
 }
 
@@ -174,19 +174,19 @@ TFile * AliQAChecker:: GetQAResultFile()
 TDirectory * AliQAChecker::GetRefSubDir(const char * det, const char * task)     
 { 
   // Opens and returns the file with the reference data 
-  TFile * f = TFile::Open(fRefDirName, "READ") ;
+  TFile * f = AliQA::GetQARefFile() ; //TFile::Open(fRefDirName, "READ") ;
   TDirectory * rv = NULL ; 
   if (!f) { 
-    AliError(Form("Cannot find reference file %s", fRefDirName.Data())) ; 
+    AliError(Form("Cannot find reference file %s", (AliQA::GetQARefFileName()))) ; 
     return rv ; 
   }
   rv = f->GetDirectory(det) ; 
   if (!rv) {
-    AliWarning(Form("Directory %s not found in %d", det, fRefDirName.Data())) ; 
+    AliWarning(Form("Directory %s not found in %d", det, (AliQA::GetQARefFileName()))) ; 
   } else {
     rv = rv->GetDirectory(task) ; 
     if (!rv) 
-      AliWarning(Form("Directory %s/%s not found in %s", det, task, fRefDirName.Data())) ; 
+      AliWarning(Form("Directory %s/%s not found in %s", det, task, (AliQA::GetQARefFileName()))) ; 
   }  
   return rv ; 
 }
@@ -322,29 +322,29 @@ Bool_t AliQAChecker::Run(AliQA::DETECTORINDEX det, AliQA::TASKINDEX task, TList
 }
 
 //_____________________________________________________________________________
-void AliQAChecker::SetQAResultDirName(const char * name)
-{
-  // Set the root directory where to store the QA status object
-
-  fgQAResultDirName.Prepend(name) ; 
-  AliInfo(Form("QA results are in  %s", fgQAResultDirName.Data())) ;
-  if ( fgQAResultDirName.Contains("local://")) 
-    fgQAResultDirName.ReplaceAll("local:/", "") ;
-  fgQAResultFileName.Prepend(fgQAResultDirName) ;
-}
+//void AliQAChecker::SetQAResultDirName(const char * name)
+//{
+//  // Set the root directory where to store the QA status object
+//
+//  fgQAResultDirName.Prepend(name) ; 
+//  AliInfo(Form("QA results are in  %s", fgQAResultDirName.Data())) ;
+//  if ( fgQAResultDirName.Contains("local://")) 
+//    fgQAResultDirName.ReplaceAll("local:/", "") ;
+//  fgQAResultFileName.Prepend(fgQAResultDirName) ;
+//}
 
 //_____________________________________________________________________________
-void AliQAChecker::SetRefDirName(const char * name)
-{
-  // Set the root directory of reference data
-
-  fRefDirName.Prepend(name) ; 
-  fRefDirName.Append(fRefName) ; 
-  AliInfo(Form("Reference data are taken from %s", fRefDirName.Data())) ;
-  if ( fRefDirName.Contains("local://")) 
-    fRefDirName.ReplaceAll("local:/", "") ; 
-}
-
+//void AliQAChecker::SetRefDirName(const char * name)
+//{
+//  // Set the root directory of reference data
+//
+//  fRefDirName.Prepend(name) ; 
+//  fRefDirName.Append(fRefName) ; 
+//  AliInfo(Form("Reference data are taken from %s", fRefDirName.Data())) ;
+//  if ( fRefDirName.Contains("local://")) 
+//    fRefDirName.ReplaceAll("local:/", "") ; 
+//}
+//
 
 
 
index 6a9697e909f78aa08ea1cae6a833bb47455cd67e..9ed3e545d75c4c3c648a33643d452d71f7580476 100644 (file)
@@ -32,8 +32,8 @@ public:
   AliQACheckerBase *     GetDetQAChecker(Int_t det) ; 
   TDirectory *           GetRefSubDir(const char * det, const char * task) ;
   static TFile *         GetQAResultFile() ;
-  static const char *    GetQAResultFileName() { return fgQAResultFileName.Data() ; }
-  void                   SetQAResultDirName(const char * name) ; 
+//  static const char *    GetQAResultFileName() { return fgQAResultFileName.Data() ; }
+//  void                   SetQAResultDirName(const char * name) ; 
   void                   SetRefDirName(const char * name) ; 
 
   virtual Bool_t Run(const char * fileName = NULL) ;
@@ -45,10 +45,10 @@ private:
   static AliQAChecker *fgQAChecker ; // pointer to the instance of the singleton
   TFile * fDataFile ;                     //! Data file to check
   static TFile * fgQAResultFile ;         //! File where to find the QA result
-  static TString fgQAResultDirName ;      //! directory where to find the QA result
-  static TString fgQAResultFileName ;     //! file name where to find the QA result
-  TString fRefDirName ;                   //! name of directory where to find the reference data file
-  TString fRefName ;                      //! file name where to find the reference data
+//  static TString fgQAResultDirName ;      //! directory where to find the QA result
+//  static TString fgQAResultFileName ;     //! file name where to find the QA result
+//  TString fRefDirName ;                   //! name of directory where to find the reference data file
+//  TString fRefName ;                      //! file name where to find the reference data
   TString fFoundDetectors ;               //! detectors for which the Quality assurance could be done
   AliQACheckerBase * fCheckers[AliQA::kNDET] ; //! list of detectors checkers
   ClassDef(AliQAChecker, 1)  // class for running generation, simulation and digitization
index c240b33b603190c48e37f778bc3f20328ec25c9b..c23f8ec958b576b4343dc79442df7e1e18ce1e61 100644 (file)
@@ -71,7 +71,7 @@ AliQADataMaker::AliQADataMaker(const AliQADataMaker& qadm) :
   fDigitsQAList(qadm.fDigitsQAList),
   fESDsQAList(qadm.fESDsQAList),
   fHitsQAList(qadm.fHitsQAList),
-  fRawsQAList(qadm.fRecPointsQAList),
+  fRawsQAList(qadm.fRawsQAList),
   fRecPointsQAList(qadm.fRecPointsQAList),
   fSDigitsQAList(qadm.fSDigitsQAList), 
   fCurrentCycle(qadm.fCurrentCycle), 
index e3d2c4fa509142e414e9621ede23e917111e7789..5384c37c8a67f9c55f2ead007e9d6361868938a0 100644 (file)
@@ -28,6 +28,8 @@
 #include "AliQA.h"
 #include "AliQADataMaker.h"
 #include "AliQADataMakerSteer.h" 
+#include "AliRawReaderDate.h"
+#include "AliRawReaderFile.h"
 #include "AliRawReaderRoot.h"
 #include "AliRun.h"
 #include "AliRunLoader.h"
@@ -178,12 +180,20 @@ AliQADataMaker * AliQADataMakerSteer::GetQADataMaker(Int_t iDet)
 }
 
 //_____________________________________________________________________________
-Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX taskIndex, const  char * fileName )
+Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX taskIndex, const  char * input )
 {
        // Initialize the event source and QA data makers
        
        if (taskIndex == AliQA::kRAWS) {
-               fRawReader = new AliRawReaderRoot(fileName) ; 
+               TString fileName(input);
+               if (fileName.EndsWith("/")) {
+                       fRawReader = new AliRawReaderFile(fileName);
+               } else if (fileName.EndsWith(".root")) {
+                       fRawReader = new AliRawReaderRoot(fileName);
+               } else if (!fileName.IsNull()) {
+                       fRawReader = new AliRawReaderDate(fileName);
+                       fRawReader->SelectEvents(7);
+               }
            if ( ! fRawReader ) 
                        return kFALSE ; 
                fRawReader->NextEvent() ; 
index 7436f6679fb84dc4d793500e56ece647524ca378..a8bfec24c95f05b609b609cb375fcc843c0e5c86 100644 (file)
@@ -24,7 +24,7 @@
 #include "AliLoader.h" 
  
 class AliQADataMaker ;
-class AliRawReaderRoot ;  
+class AliRawReader ;  
 class AliRunLoader ; 
 class AliESDEvent ; 
 
@@ -57,7 +57,7 @@ private:
        TString            fGAliceFileName ;               //! name of the galice file
        UInt_t             fRunNumber ;                    //! current run number
        Long64_t           fNumberOfEvents ;               //! number of events in the run 
-       AliRawReaderRoot * fRawReader ;                    //! current raw reader object 
+       AliRawReader     * fRawReader ;                    //! current raw reader object 
        AliRunLoader *     fRunLoader ;                    //! current run loader object
        static const UInt_t fgkNDetectors = AliQA::kNDET ; //! number of detectors    
        AliLoader      *   fLoader[fgkNDetectors];         //! array of detectors loader