]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
new method to retrieve the QAbit set. Requested by AMORE.
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 5 Nov 2009 12:21:03 +0000 (12:21 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 5 Nov 2009 12:21:03 +0000 (12:21 +0000)
STEER/AliQAv1.cxx
STEER/AliQAv1.h

index c94b7ea34699762a2a42535d5b81e359a2442971..eaf16798fb0221e759092157d9b35bd49e0669ac 100644 (file)
@@ -321,6 +321,7 @@ const char * AliQAv1::GetBitName(QABIT_t bit) const
        TString bitName ;
        switch (bit) {
                case kNULLBit:
+                       bitName = "NONE" ;
                        break ; 
                case kINFO:
                        bitName = "INFO" ;
@@ -471,11 +472,11 @@ TFile * AliQAv1::GetQADataFile(const char * fileName)
 //_______________________________________________________________
 TFile * AliQAv1::GetQAResultFile() 
 {
-  // opens the file to store the  Quality Assurance Data Checker results
-       if (fgQAResultFile) 
-               fgQAResultFile->Close() ; 
-       fgQAResultFile = 0x0 ; 
-//     if (!fgQAResultFile) { 
+  // opens the file to store the  Quality Assurance Data Checker results       
+  if (fgQAResultFile) 
+    if (fgQAResultFile->IsOpen()) 
+      fgQAResultFile->Close();
+  
                TString dirName(fgQAResultDirName) ; 
                if ( dirName.Contains(fgkLabLocalFile)) 
                        dirName.ReplaceAll(fgkLabLocalFile, "") ;
@@ -489,11 +490,28 @@ TFile * AliQAv1::GetQAResultFile()
                        opt = "NEW" ; 
                }
                fgQAResultFile = TFile::Open(fileName, opt) ;   
-//     }
        
        return fgQAResultFile ;
 }
 
+//_______________________________________________________________
+const AliQAv1::QABIT_t AliQAv1::GetQAStatusBit(AliRecoParam::EventSpecie_t es, DETECTORINDEX_t det, ALITASK_t tsk) const
+{
+    // returns the QA bit set
+  QABIT_t rv = kNULLBit ; 
+  if ( es == AliRecoParam::kDefault) 
+    es = fEventSpecie ; 
+  if ( det == kNULLDET ) 
+    det = fDet ; 
+  if ( tsk == kNULLTASK ) 
+    tsk = fTask ; 
+  for (Int_t bit = kINFO ; bit < kNBIT ; bit++) {
+               if (IsSet(det, tsk, es, QABIT_t(bit))) 
+      rv = QABIT_t(bit) ;
+       }
+  return rv ; 
+}
+
 //_______________________________________________________________
 AliQAv1::TASKINDEX_t AliQAv1::GetTaskIndex(const char * name) 
 {
@@ -588,6 +606,7 @@ AliQAv1 * AliQAv1::Instance()
   if ( ! fgQA) {
     TFile * f = GetQAResultFile() ; 
     fgQA = static_cast<AliQAv1 *>(f->Get("QA")) ; 
+    f->Close() ; 
     if ( ! fgQA ) 
       fgQA = new AliQAv1() ;
   }
@@ -611,7 +630,7 @@ AliQAv1 * AliQAv1::Instance(const DETECTORINDEX_t det)
   
   if ( ! fgQA) {
     TFile * f = GetQAResultFile() ; 
-    fgQA = static_cast<AliQAv1 *>(f->Get("QA")) ; 
+    fgQA = static_cast<AliQAv1 *>(f->Get(GetQAName())) ; 
     if ( ! fgQA ) 
       fgQA = new AliQAv1(det) ;
   }            
@@ -875,14 +894,12 @@ void AliQAv1::ShowASCIIStatus(AliRecoParam::EventSpecie_t es, DETECTORINDEX_t de
 {
        // print the QA status in human readable format
        TString text; 
-       for (Int_t bit = kINFO ; bit < kNBIT ; bit++) {
-               if (IsSet(det, tsk, es, QABIT_t(bit))) {
-                       text = GetBitName(QABIT_t(bit)) ; 
-                       text += " " ; 
-               }
-       }
-       if (! text.IsNull())
-               AliInfoClass(Form("           %8s %8s %4s 0x%4lx, Problem signalled: %8s \n", AliRecoParam::GetEventSpecieName(es), GetDetName(det).Data(), GetAliTaskName(tsk), status, text.Data())) ; 
+  QABIT_t bit = GetQAStatusBit(es, det, tsk) ; 
+  if ( bit != kNULLBit ) {
+    text = GetBitName(bit) ; 
+    text += " " ; 
+    AliInfoClass(Form("           %8s %8s %4s 0x%4lx, Problem signalled: %8s \n", AliRecoParam::GetEventSpecieName(es), GetDetName(det).Data(), GetAliTaskName(tsk), status, text.Data())) ; 
+  }
 }
 
 //_______________________________________________________________
index ea524ba4be8ea1c050860e8e2032d11b46b58814..f5a1b69b4abe53044db5d4aa120b17e6cc0be88e 100644 (file)
@@ -78,8 +78,10 @@ public:
   static const char  *   GetQARefDefaultStorage() { return fgkQARefOCDBDefault.Data() ; }
   static const char  *   GetQARefFileName() { return fgQARefFileName ; }
   static const char  *   GetQARefStorage() { return fgQARefDirName.Data() ; }
+  const QABIT_t          GetQAStatusBit(AliRecoParam::EventSpecie_t es = AliRecoParam::kDefault, DETECTORINDEX_t det=kNULLDET, ALITASK_t tsk=kNULLTASK) const ; 
   static const char  *   GetRefOCDBDirName() { return fgkRefOCDBDirName.Data() ; }
   static const char  *   GetRefDataDirName() { return fgRefDataDirName.Data() ; }
+
   static     TASKINDEX_t GetTaskIndex(const char * name) ; 
   static       TString   GetTaskName(UInt_t tsk) { return fgTaskNames[tsk] ; }
   static const char *    GetModeName(MODE_t mode) { return (mode == kSIMMODE || mode == kRECMODE) ? (fgModeNames[mode]).Data() : "" ; }
@@ -128,45 +130,45 @@ private:
   void                  SetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es, QABIT_t bit) ;
   void                  UnSetStatusBit(DETECTORINDEX_t det, ALITASK_t tsk, AliRecoParam::EventSpecie_t es, QABIT_t bit) ;
   
-  static AliQAv1 *      fgQA                          ; // pointer to the instance of the singleton
-  Int_t                 fNdet                     ; // number of detectors
-  Int_t                 fNEventSpecies         ; // number of Event Species (see AliRecoParam)
-  Int_t                 fLengthQA              ; // Auxiliary length of fQA
-  ULong_t    *          fQA                             ; //[fLengthQA]  the status word 4 bits for SIM, REC, ESD, ANA each
-  DETECTORINDEX_t       fDet                          ; //! the current detector (ITS, TPC, ....)
-  ALITASK_t             fTask                   ; //! the current environment (SIM, REC, ESD, ANA)
-  AliRecoParam::EventSpecie_t fEventSpecie     ; //! the current event specie
-  static TString        fgDetNames[]            ; //! list of detector names   
-  static TString        fgGRPPath              ; //! path of the GRP object in OCDB
-  static TFile *        fgQADataFile            ; //! the output file where the quality assurance maker store their results
-  static TString        fgQADataFileName       ; //! the name of the file where the quality assurance maker store their results
-  static TFile *        fgQARefFile               ; //! the output file where the quality assurance maker store their results
-  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 TFile *        fgQAResultFile         ; //! File where to find the QA result
-  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        fgRTNames[]               ; //! list of Run Type names   
-  static TString        fgTaskNames[]           ; //! list of tasks names   
-  static TString        fgModeNames[]           ; //! list of mode names   
-  static const TString  fgkExpert              ; //! name for the expert directory
-  static const UInt_t   fgkExpertBit           ; //! TObject bit identifing the object as "expert"
-  static const UInt_t   fgkImageBit            ; //! TObject bit identifing the object to be plotted on the QA image
-  static const TString  fgkLabLocalFile        ; //! label to identify a file as local 
-  static const TString  fgkLabLocalOCDB        ; //! label to identify a file as local OCDB 
-  static const TString  fgkLabAliEnOCDB        ; //! label to identify a file as AliEn OCDB 
-  static const TString  fgkRefFileName         ; //! name of Reference File Name 
-  static const UInt_t   fgkQABit               ; //! bit in the QA data object which is set when Checker does not return 0
-  static const Int_t    fgkQADebugLevel        ; //! debug level used for QA verbosity
-  static const TString  fgkQAName              ; //! name of QA object 
-  static const TString  fgkQACorrNtName        ; //! name of QA Correlation Ntuple
-  static const TString  fgkRefOCDBDirName      ; //! name of Reference directory name in OCDB          
-  static       TString  fgRefDataDirName       ; //! name of Reference directory name in OCDB for data         
-  static const TString  fgkQARefOCDBDefault    ; //! default storage for QA in OCDB 
-  Bool_t *              fEventSpecies          ; //[fNEventSpecies] list of event species encountered in a run
-  static const TString  fImageFileName         ; //! name of the file that contains all the QA images
-  static const TString  fImageFileFormat       ; //! format of the file that contains all the QA images
-  static const UShort_t fgkMaxQAObjects        ;//! maximum number of QA objects allowed dor each task (Raws, digits,....) 
+  static AliQAv1 *       fgQA                            ; // pointer to the instance of the singleton
+  Int_t                  fNdet                       ; // number of detectors
+  Int_t                  fNEventSpecies           ; // number of Event Species (see AliRecoParam)
+  Int_t                  fLengthQA                ; // Auxiliary length of fQA
+  ULong_t    *           fQA                             ; //[fLengthQA]  the status word 4 bits for SIM, REC, ESD, ANA each
+  DETECTORINDEX_t fDet                                 ; //! the current detector (ITS, TPC, ....)
+  ALITASK_t       fTask                                  ; //! the current environment (SIM, REC, ESD, ANA)
+  AliRecoParam::EventSpecie_t fEventSpecie        ; //! the current event specie
+  static TString         fgDetNames[]              ; //! list of detector names   
+  static TString         fgGRPPath                ; //! path of the GRP object in OCDB
+  static TFile *         fgQADataFile              ; //! the output file where the quality assurance maker store their results
+  static TString         fgQADataFileName         ; //! the name of the file where the quality assurance maker store their results
+  static TFile *         fgQARefFile               ; //! the output file where the quality assurance maker store their results
+  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 TFile *         fgQAResultFile           ; //! File where to find the QA result
+  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         fgRTNames[]               ; //! list of Run Type names   
+  static TString         fgTaskNames[]            ; //! list of tasks names   
+  static TString         fgModeNames[]           ; //! list of mode names   
+  static const TString   fgkExpert                ; //! name for the expert directory
+  static const UInt_t    fgkExpertBit             ; //! TObject bit identifing the object as "expert"
+  static const UInt_t    fgkImageBit              ; //! TObject bit identifing the object to be plotted on the QA image
+  static const TString   fgkLabLocalFile          ; //! label to identify a file as local 
+  static const TString   fgkLabLocalOCDB          ; //! label to identify a file as local OCDB 
+  static const TString   fgkLabAliEnOCDB          ; //! label to identify a file as AliEn OCDB 
+  static const TString   fgkRefFileName           ; //! name of Reference File Name 
+  static const UInt_t    fgkQABit                 ; //! bit in the QA data object which is set when Checker does not return 0
+  static const Int_t     fgkQADebugLevel          ; //! debug level used for QA verbosity
+  static const TString   fgkQAName                ; //! name of QA object 
+  static const TString   fgkQACorrNtName          ; //! name of QA Correlation Ntuple
+  static const TString   fgkRefOCDBDirName        ; //! name of Reference directory name in OCDB       
+  static       TString   fgRefDataDirName         ; //! name of Reference directory name in OCDB for data      
+  static const TString   fgkQARefOCDBDefault      ; //! default storage for QA in OCDB 
+  Bool_t *               fEventSpecies            ; //[fNEventSpecies] list of event species encountered in a run
+  static const TString   fImageFileName           ; //! name of the file that contains all the QA images
+  static const TString   fImageFileFormat         ; //! format of the file that contains all the QA images
+  static const UShort_t  fgkMaxQAObjects          ;//! maximum number of QA objects allowed dor each task (Raws, digits,....) 
 
  ClassDef(AliQAv1,3)  //ALICE Quality Assurance Object
 };