]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONAlignmentTask.cxx
o updates (Alla, Filip)
[u/mrichter/AliRoot.git] / MUON / AliMUONAlignmentTask.cxx
index b3302540196aed3a9f97445c91f192bdf75e46e3..3fbbd6c64cd6a23ca6574526f6ad942b321d72a3 100644 (file)
@@ -123,7 +123,7 @@ AliMUONAlignmentTask::AliMUONAlignmentTask(const AliMUONAlignmentTask& other):
   fReadRecords( other.fReadRecords ),
   fWriteRecords( other.fWriteRecords ),
   fDoAlignment( other.fDoAlignment ),
-  fAlign( fAlign ),
+  fAlign( other.fAlign ),
   fGeoFilename( other.fGeoFilename ),
   fDefaultStorage( other.fDefaultStorage ),
   fOldAlignStorage( other.fOldAlignStorage ),
@@ -160,6 +160,7 @@ AliMUONAlignmentTask::AliMUONAlignmentTask(const AliMUONAlignmentTask& other):
 AliMUONAlignmentTask& AliMUONAlignmentTask::operator=(const AliMUONAlignmentTask& other)
 {
   /// Assignment
+  if(&other == this) return *this;
   AliAnalysisTaskSE::operator=(other);
 
   fReadRecords = other.fReadRecords;
@@ -469,7 +470,9 @@ void AliMUONAlignmentTask::UserExec(Option_t *)
 
     // save AOD
     if( fWriteRecords && fRecordCount > 0 ) { 
-                       AliAODHandler* handler = dynamic_cast<AliAODHandler*>( AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler() );
+      AliAODHandler* handler = dynamic_cast<AliAODHandler*>( AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler() );
+      if( handler )
+       {
 //                     printf("handler: %p\n",handler);
                        AliAODEvent* aod = handler->GetAOD();
 //                     printf("aod: %p\n",aod);
@@ -477,7 +480,9 @@ void AliMUONAlignmentTask::UserExec(Option_t *)
 //                     printf("header: %p\n",header);
                        header->SetRunNumber(lESD->GetRunNumber());
 //                     printf("RunNumber: %d\n",lESD->GetRunNumber());
-                       AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE); }
+                       AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
+       } else AliInfo( "Error: invalid output event handler" );
+    }
 
   }