Fixed list of extra AOD files that created problems in Terminate when adding content...
authoragheata <Andrei.Gheata@cern.ch>
Mon, 7 Apr 2014 15:05:25 +0000 (17:05 +0200)
committeragheata <Andrei.Gheata@cern.ch>
Mon, 7 Apr 2014 15:06:36 +0000 (17:06 +0200)
ANALYSIS/AliAnalysisAlien.cxx
ANALYSIS/AliAnalysisTaskSE.cxx
STEER/AOD/AliAODHandler.cxx
STEER/AOD/AliAODHandler.h
STEER/STEERBase/AliVEventHandler.cxx
STEER/STEERBase/AliVEventHandler.h

index 9416a66..120cd61 100644 (file)
@@ -3703,7 +3703,7 @@ const char *AliAnalysisAlien::GetListOfFiles(const char *type)
       aodfiles = "";
       if (mgr->GetOutputEventHandler()->GetFillAOD())
          aodfiles = mgr->GetOutputEventHandler()->GetOutputFileName();
-      TString extraaod = mgr->GetOutputEventHandler()->GetExtraOutputs();
+      TString extraaod = mgr->GetOutputEventHandler()->GetExtraOutputs(kTRUE);
       if (!extraaod.IsNull() && mgr->GetOutputEventHandler()->GetFillExtension()) {
          if (!aodfiles.IsNull()) aodfiles += ",";
          aodfiles += extraaod;
index 58c62d6..cdc7c3d 100644 (file)
@@ -341,16 +341,19 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
 {
 //
 // Exec analysis of one event
-
+    
     ConnectMultiHandler();
-
+    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+    if (mgr->GetDebugLevel() > 1) {
+       if (!mgr->GetTopTasks()->FindObject(this))
+          printf("    -> Executing sub-task %s\n", GetName());
+    }   
     if ( fDebug >= 10)
       printf("Task is active %5d\n", IsActive());
     
     if (fDebug > 1) AliInfo("AliAnalysisTaskSE::Exec() \n");
 //
-    AliAODHandler* handler = dynamic_cast<AliAODHandler*> 
-      ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
+    AliAODHandler* handler = dynamic_cast<AliAODHandler*>(mgr->GetOutputEventHandler());
 
     AliAODInputHandler* aodH = dynamic_cast<AliAODInputHandler*>(fInputHandler);
 //
@@ -578,25 +581,25 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
                                Double_t amp = cellsA->GetAmplitude(i) + fgAODEmcalCells->GetAmplitude(pos);
                                
                                //Check if it is MC, depending on that assing the mc lable, time and e fraction
-                               Double_t time    = 0;
+//                             Double_t time    = 0;
                                Int_t    mclabel =-1;
                                Double_t efrac   = 0;
                                if(cellsA->GetMCLabel(i) >= 0 && fgAODEmcalCells->GetMCLabel(pos) < 0)
                                  {
                                    mclabel = cellsA->GetMCLabel(i) ;
-                                   time    = fgAODEmcalCells->GetTime(pos) ; // Time from data
+//                                 time    = fgAODEmcalCells->GetTime(pos) ; // Time from data
                                    if(amp > 0) efrac = cellsA->GetAmplitude(i) / amp;
                                  }
                                else if(fgAODEmcalCells->GetMCLabel(pos) >= 0 &&  cellsA->GetMCLabel(i) < 0)
                                  {
                                    mclabel = fgAODEmcalCells->GetMCLabel(pos) ;
-                                   time    = cellsA->GetTime(i) ; // Time from data
+//                                 time    = cellsA->GetTime(i) ; // Time from data
                                    if(amp > 0) efrac = fgAODEmcalCells->GetAmplitude(pos) / amp;
                                  }
                                else 
                                  { // take all from input
                                    mclabel = cellsA->GetMCLabel(i) ;
-                                   time    = cellsA->GetTime(i) ; 
+//                                 time    = cellsA->GetTime(i) ; 
                                    if(amp > 0) efrac = cellsA->GetAmplitude(i) / amp;  
                                  }
                                
@@ -648,25 +651,25 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
                                Double_t amp = cellsP->GetAmplitude(i) + fgAODPhosCells->GetAmplitude(pos);
                                
                                //Check if it is MC, depending on that assing the mc lable, time and e fraction
-                               Double_t time    = 0;
+//                             Double_t time    = 0;
                                Int_t    mclabel =-1;
                                Double_t    efrac   = 0;
                                if(cellsP->GetMCLabel(i) >= 0 && fgAODPhosCells->GetMCLabel(pos) < 0)
                                  {
                                    mclabel = cellsP->GetMCLabel(i) ;
-                                   time    = fgAODPhosCells->GetTime(pos) ; // Time from data
+//                                 time    = fgAODPhosCells->GetTime(pos) ; // Time from data
                                    if(amp > 0) efrac = cellsP->GetAmplitude(i) / amp;
                                  }
                                else if(fgAODPhosCells->GetMCLabel(pos) >= 0 &&  cellsP->GetMCLabel(i) < 0)
                                  {
                                    mclabel = fgAODPhosCells->GetMCLabel(pos) ;
-                                   time    = cellsP->GetTime(i) ; // Time from data
+//                                 time    = cellsP->GetTime(i) ; // Time from data
                                    if(amp > 0) efrac = fgAODPhosCells->GetAmplitude(pos) / amp;
                                  }
                                else 
                                  { // take all from input
                                    mclabel = cellsP->GetMCLabel(i) ;
-                                   time    = cellsP->GetTime(i) ; 
+//                                 time    = cellsP->GetTime(i) ; 
                                    if(amp > 0) efrac = cellsP->GetAmplitude(i) / amp;  
                                  }
                                
index cddc561..36a4638 100644 (file)
@@ -748,7 +748,7 @@ const char *AliAODHandler::GetOutputFileName() const
 }
 
 //______________________________________________________________________________
-const char *AliAODHandler::GetExtraOutputs() const
+const char *AliAODHandler::GetExtraOutputs(Bool_t merge) const
 {
   // Get extra outputs as a string separated by commas.
   static TString eoutputs;
@@ -757,7 +757,7 @@ const char *AliAODHandler::GetExtraOutputs() const
   if (fExtensions) {
     TIter next1(fExtensions);
     while ((obj=(AliAODExtension*)next1())) {
-      if (!obj->IsToMerge()) continue;
+      if (merge && !obj->IsToMerge()) continue;
       if (!eoutputs.IsNull()) eoutputs += ",";
       eoutputs += obj->GetName();
     }
@@ -765,7 +765,7 @@ const char *AliAODHandler::GetExtraOutputs() const
   if (fFilters) {
     TIter next2(fFilters);
     while ((obj=(AliAODExtension*)next2())) {
-      if (!obj->IsToMerge()) continue;
+      if (merge && !obj->IsToMerge()) continue;
       if (!eoutputs.IsNull()) eoutputs += ",";
       eoutputs += obj->GetName();
     }
index 7b8bd66..2bd4c5e 100644 (file)
@@ -32,7 +32,7 @@ class AliAODHandler : public AliVEventHandler {
     virtual void         SetOutputFileName(const char* fname);
     virtual const char*  GetOutputFileName() const;
     // Extra outputs as a string separated by commas
-    virtual const char*  GetExtraOutputs() const;
+    virtual const char*  GetExtraOutputs(Bool_t merge=kTRUE) const;
     virtual Bool_t       Init(Option_t* option);
     virtual Bool_t       Init(TTree* /*tree*/, Option_t* /*option*/)  {return kTRUE;}
     virtual Bool_t       GetEntry() {return kTRUE;}
index d98fce6..40d635e 100644 (file)
@@ -66,3 +66,11 @@ void AliVEventHandler::Changed()
 // in case the lock was set.
    if (IsLocked()) Fatal("Changed","Critical setter of a handler called in locked mode");
 }
+
+//______________________________________________________________________________
+const char *AliVEventHandler::GetExtraOutputs(Bool_t) const
+{
+// Returns extra outputs. If merge is requested, returns only files to be
+// merged. Implementation in derived classes.
+   return 0;
+}
index 4743c83..bcd121d 100644 (file)
@@ -37,7 +37,7 @@ enum EEventHandlerFlags {
     virtual void         SetOutputFileName(const char* fname)   = 0;
     virtual const char*  GetOutputFileName() const        = 0;
     // Extra outputs as a string separated by commas
-    virtual const char*  GetExtraOutputs() const {return NULL;}
+    virtual const char*  GetExtraOutputs(Bool_t merge=kFALSE) const;
     // Input
     virtual void         SetInputTree(TTree* tree)        = 0;
     // Steering