solved problems with the cycles when running QA during reconstruction
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Mar 2008 17:25:35 +0000 (17:25 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Mar 2008 17:25:35 +0000 (17:25 +0000)
STEER/AliQADataMakerSteer.cxx
STEER/AliReconstruction.cxx
STEER/AliReconstruction.h

index 2d7519e14228a039ed809916521cfa6d7e8aecfa..338ddc39210fd9023b9741ab4beac5f7f42b6641 100644 (file)
@@ -450,43 +450,46 @@ Bool_t AliQADataMakerSteer::InitRunLoader()
        // get or create the run loader
        if (fRunLoader) {
                fCycleSame = kTRUE ; 
-               return kTRUE ;
-       } 
-               
-       if (!gSystem->AccessPathName(fGAliceFileName.Data())) { // galice.root exists
-    // load all base libraries to get the loader classes
-               TString libs = gSystem->GetLibraries() ;
-               for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
-                       if (!IsSelected(AliQA::GetDetName(iDet))) 
-                               continue ; 
-                       TString detName = AliQA::GetDetName(iDet) ;
-                       if (detName == "HLT") 
-                               continue;
-                       if (libs.Contains("lib" + detName + "base.so")) 
-                               continue;
-                       gSystem->Load("lib" + detName + "base.so");
-               }
-               fRunLoader = AliRunLoader::Open(fGAliceFileName.Data());
-               if (!fRunLoader) {
-                       AliError(Form("no run loader found in file %s", fGAliceFileName.Data()));
-                       return kFALSE;
-               }
-               fRunLoader->CdGAFile();
-               if (fRunLoader->LoadgAlice() == 0) {
-                       gAlice = fRunLoader->GetAliRun();
-               }
+       } else {
+               if (!gSystem->AccessPathName(fGAliceFileName.Data())) { // galice.root exists
+                       // load all base libraries to get the loader classes
+                       TString libs = gSystem->GetLibraries() ;
+                       for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+                               if (!IsSelected(AliQA::GetDetName(iDet))) 
+                                       continue ; 
+                               TString detName = AliQA::GetDetName(iDet) ;
+                               if (detName == "HLT") 
+                                       continue;
+                               if (libs.Contains("lib" + detName + "base.so")) 
+                                       continue;
+                               gSystem->Load("lib" + detName + "base.so");
+                       }
+                       fRunLoader = AliRunLoader::Open(fGAliceFileName.Data());
+                       if (!fRunLoader) {
+                               AliError(Form("no run loader found in file %s", fGAliceFileName.Data()));
+                               return kFALSE;
+                       }
+                       fRunLoader->CdGAFile();
+                       if (fRunLoader->LoadgAlice() == 0) {
+                               gAlice = fRunLoader->GetAliRun();
+                       }
+
+                       if (!gAlice) {
+                               AliError(Form("no gAlice object found in file %s", fGAliceFileName.Data()));
+                               return kFALSE;
+                       }
 
-               if (!gAlice) {
-                       AliError(Form("no gAlice object found in file %s", fGAliceFileName.Data()));
+               } else {               // galice.root does not exist
+                       AliError(Form("the file %s does not exist", fGAliceFileName.Data()));
                        return kFALSE;
                }
+       }
 
-       } else {               // galice.root does not exist
-               AliError(Form("the file %s does not exist", fGAliceFileName.Data()));
-               return kFALSE;
-    }
-
-  return kTRUE;
+       if (!fRunNumber) { 
+               fRunLoader->LoadHeader();
+               fRunNumber = fRunLoader->GetHeader()->GetRun() ; 
+       }
+       return kTRUE;
 }
 
 //_____________________________________________________________________________
index 466c924bfcbc0d083a5d295ed5e3e9e77f03caf1..a42deaf0d44f27d92b0b2add34c2439dcf480547 100644 (file)
@@ -255,6 +255,7 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename,
   fRunQA(kTRUE),  
   fRunGlobalQA(kTRUE),
   fInLoopQA(kFALSE),
+  fSameQACycle(kFALSE),
 
   fRunPlaneEff(kFALSE),
 
@@ -343,6 +344,7 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) :
   fRunQA(rec.fRunQA),  
   fRunGlobalQA(rec.fRunGlobalQA),
   fInLoopQA(rec.fInLoopQA),
+  fSameQACycle(rec.fSameQACycle),
   fRunPlaneEff(rec.fRunPlaneEff),
 
   fesd(NULL),
@@ -743,6 +745,7 @@ Bool_t AliReconstruction::InitRun(const char* input, void **pEvent)
   AliQADataMakerSteer qas ; 
   if (fRunQA && fRawReader) { 
     qas.Run(fRunLocalReconstruction, fRawReader) ; 
+       fSameQACycle = kTRUE ; 
   }
   // checking the QA of previous steps
   //CheckQA() ; 
@@ -871,23 +874,25 @@ Bool_t AliReconstruction::InitRun(const char* input, void **pEvent)
                fgkDetectorName[iDet]));
         qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun());
         qadm->Init(AliQA::kESDS, AliCDBManager::Instance()->GetRun());
- //       if (!fInLoopQA) {
-//           qadm->StartOfCycle(AliQA::kRECPOINTS);
-//           qadm->StartOfCycle(AliQA::kESDS,"same");
-//        }
-     }
-  }
-  if (fRunGlobalQA) {
-         AliQADataMakerRec *qadm = GetQADataMaker(AliQA::kGLOBAL);
-     AliInfo(Form("Initializing the global QA data maker"));
-     TObjArray *arr=
-          qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun());
-     AliTracker::SetResidualsArray(arr);
-     qadm->Init(AliQA::kESDS, AliCDBManager::Instance()->GetRun());
-     if (!fInLoopQA) {
-        qadm->StartOfCycle(AliQA::kRECPOINTS, (fRunQA && fRawReader));
-        qadm->StartOfCycle(AliQA::kESDS, "same");
+        if (!fInLoopQA) {
+                       qadm->StartOfCycle(AliQA::kRECPOINTS, fSameQACycle);
+                       qadm->StartOfCycle(AliQA::kESDS,"same");
+        }
      }
+         if (fRunGlobalQA) {
+                 AliQADataMakerRec *qadm = GetQADataMaker(AliQA::kGLOBAL);
+                 AliInfo(Form("Initializing the global QA data maker"));
+                 TObjArray *arr=
+                       qadm->Init(AliQA::kRECPOINTS, AliCDBManager::Instance()->GetRun());
+                 AliTracker::SetResidualsArray(arr);
+                 qadm->Init(AliQA::kESDS, AliCDBManager::Instance()->GetRun());
+                 if (!fInLoopQA) {
+                         qadm->StartOfCycle(AliQA::kRECPOINTS, fSameQACycle);
+                         qadm->StartOfCycle(AliQA::kESDS, "same");
+                 }
+         }
+         if (!fInLoopQA) 
+                 fSameQACycle = kTRUE; 
   }
 
   //Initialize the Plane Efficiency framework
@@ -936,18 +941,20 @@ Bool_t AliReconstruction::RunEvent(Int_t iEvent)
        if (fRunQA) {
           TString detStr(fFillESD); 
           for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
-             if (!IsSelected(fgkDetectorName[iDet], detStr)) continue;
+             if (!IsSelected(fgkDetectorName[iDet], detStr)) 
+                                continue;
              AliQADataMakerRec *qadm = GetQADataMaker(iDet);  
-             if (!qadm) continue;
-             qadm->StartOfCycle(AliQA::kRECPOINTS, (fRunQA && fRawReader));
+             if (!qadm) 
+                                continue;
+             qadm->StartOfCycle(AliQA::kRECPOINTS, fSameQACycle);
              qadm->StartOfCycle(AliQA::kESDS, "same") ;        
           }
-       }
-       if (fRunGlobalQA) {
-          AliQADataMakerRec *qadm = GetQADataMaker(AliQA::kGLOBAL);
-          qadm->StartOfCycle(AliQA::kRECPOINTS, (fRunQA && fRawReader));
-          qadm->StartOfCycle(AliQA::kESDS, "same");
-       }
+                  if (fRunGlobalQA) {
+                          AliQADataMakerRec *qadm = GetQADataMaker(AliQA::kGLOBAL);
+                          qadm->StartOfCycle(AliQA::kRECPOINTS, fSameQACycle);
+                          qadm->StartOfCycle(AliQA::kESDS, "same");
+                  }               
+          }
     }
 
     fRunLoader->GetEvent(iEvent);
@@ -1322,9 +1329,9 @@ Bool_t AliReconstruction::FinishRun()
   if (!fInLoopQA) {
      if (fRunQA) {
        AliQADataMakerSteer qas;
-       qas.Run(fRunLocalReconstruction.Data(), AliQA::kRECPOINTS, (fRunQA && fRawReader));
+       qas.Run(fRunLocalReconstruction.Data(), AliQA::kRECPOINTS, fSameQACycle);
        //qas.Reset() ;
-       qas.Run(fRunTracking.Data(), AliQA::kESDS, (fRunQA && fRawReader));
+       qas.Run(fRunTracking.Data(), AliQA::kESDS, fSameQACycle);
      }
      if (fRunGlobalQA) {
         AliQADataMakerRec *qadm = GetQADataMaker(AliQA::kGLOBAL);
index 4363509353b6d3986ed595c4641ba493d84af1c1..7f6b6d879cc5429264733265bbda0b7f95e6f388 100644 (file)
@@ -237,6 +237,7 @@ private:
   Bool_t             fRunQA ;        // Run QA flag
   Bool_t             fRunGlobalQA;   // Run global QA flag
   Bool_t             fInLoopQA;      // In-loop QA flag
+  Bool_t             fSameQACycle;   //! open a vew QA data file or not
   // Plane Efficiency Evaluation
   Bool_t         fRunPlaneEff ;      // Evaluate Plane Efficiency