]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQAManager.cxx
added a protection before writing out the corr NTuple
[u/mrichter/AliRoot.git] / STEER / AliQAManager.cxx
index 0bf8d0a466c06b773aa3ba8b83c3bff36c1a6588..e1d7a6b67741892a02575e7fa773467e347fcc0b 100644 (file)
@@ -583,12 +583,33 @@ void  AliQAManager::EndOfCycle(TString detectors)
     fakeCanvas.Print(Form("%s%s%d.%s]", AliQAv1::GetImageFileName(), GetMode(), fRunNumber, AliQAv1::GetImageFileFormat()), "ps"); 
 }
 
+//_____________________________________________________________________________
+AliRecoParam::EventSpecie_t AliQAManager::GetEventSpecieFromESD() 
+{
+  AliRecoParam::EventSpecie_t runtype = AliRecoParam::kDefault ; 
+  if (!gSystem->AccessPathName("AliESDs.root")) { // AliESDs.root exists
+    TFile * esdFile = TFile::Open("AliESDs.root") ;
+    TTree * esdTree = static_cast<TTree *> (esdFile->Get("esdTree")) ; 
+    if ( !esdTree ) {
+      AliError("esdTree not found") ; 
+    } else {
+      AliESDEvent * esd    = new AliESDEvent() ;
+      esd->ReadFromTree(esdTree) ;
+      esdTree->GetEntry(0) ; 
+      runtype = AliRecoParam::Convert(esd->GetEventType()) ; 
+    }
+  } else {
+    AliError("AliESDs.root not found") ; 
+  }
+  return runtype ;
+}
+
 //_____________________________________________________________________________
 void AliQAManager::Increment(const AliQAv1::TASKINDEX_t taskIndex)
 {
   // Increments the cycle counter for all QA Data Makers
   static AliQAv1::TASKINDEX_t currentTask = AliQAv1::kNTASKINDEX ; 
-  if (currentTask == taskIndex) 
+  if ( (currentTask == taskIndex) && taskIndex != AliQAv1::kNULLTASKINDEX )
     return ; 
   else 
     currentTask = taskIndex ; 
@@ -969,7 +990,7 @@ void AliQAManager::MergeCustom() const
                     if (  className.Contains("TH") || className.Contains("TProfile") ) {
                       TH1 * histIn = static_cast<TH1*> (key->ReadObj()) ; 
                       TH1 * histOu = static_cast<TH1*> (mergedDirectory->FindObjectAny(histIn->GetName())) ; 
-                      AliDebug(AliQAv1::GetQADebugLevel(), Form("%s %x %x\n", key->GetName(), histIn, histOu)) ; 
+                      AliDebug(AliQAv1::GetQADebugLevel(), Form("%s %p %p\n", key->GetName(), histIn, histOu)) ; 
                       mergedDirectory->cd() ; 
                       if ( ! histOu ) {
                         histIn->Write() ;