Correcting the event content for ESD files writen before the the cosmic
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Sep 2012 08:44:25 +0000 (08:44 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Sep 2012 08:44:25 +0000 (08:44 +0000)
tracks were added to the std event content.
Constantin Loizides <cloizides@lbl.gov>

STEER/ESD/AliESDEvent.cxx

index 719cfe2..2e73427 100644 (file)
@@ -1488,9 +1488,16 @@ void AliESDEvent::CreateStdContent()
 
 void AliESDEvent::CompleteStdContent() 
 {
-  // create missing standard objects and add them to the TList of objects
-  
-  // add new MUON containers if missing (for backward compatibility)
+  // Create missing standard objects and add them to the TList of objects
+  //
+  // Add cosmic tracks for cases where esd files were created 
+  // before adding them to the std content
+  if (!fESDObjects->FindObject(fgkESDListName[kCosmicTracks])) {
+    TClonesArray* cosmics = new TClonesArray("AliESDCosmicTrack",0);
+    fESDObjects->AddAt(cosmics, kCosmicTracks);
+    fESDObjects->SetOwner(kTRUE);
+  }
+  // Add new MUON containers if missing (for backward compatibility)
   if (!fESDObjects->FindObject(fgkESDListName[kMuonClusters])) {
     TClonesArray* muonClusters = new TClonesArray("AliESDMuonCluster",0);
     muonClusters->SetName(fgkESDListName[kMuonClusters]);