Do not copy, but create the generated event header
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Aug 2006 15:54:30 +0000 (15:54 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 1 Aug 2006 15:54:30 +0000 (15:54 +0000)
EVGEN/AliGenExtFile.cxx

index 43c5ea8..9d9f73e 100644 (file)
@@ -105,16 +105,6 @@ void AliGenExtFile::Generate()
       return;
     }
 
-    // Generated event header
-
-    AliRunLoader * inRunLoader = fReader->GetRunLoader();
-    if(inRunLoader) {
-      AliGenEventHeader * inHeader = inRunLoader->GetHeader()->GenEventHeader();
-      if (inHeader) {
-       AliGenEventHeader * header = new AliGenEventHeader(*inHeader);
-       AliRunLoader::GetRunLoader()->GetHeader()->SetGenEventHeader(header);
-      }
-    }
     //
     // Particle selection loop
     //
@@ -176,7 +166,14 @@ void AliGenExtFile::Generate()
        PushTrack(doTracking,parent,idpart,p,origin,polar,0,kPPrimary,nt);
        KeepTrack(nt);
     } // track loop
+
+    // Generated event header
     
+    AliGenEventHeader * header = new AliGenEventHeader();
+    header->SetNProduced(nt+1);
+    header->SetPrimaryVertex(fVertex);
+    AliRunLoader::GetRunLoader()->GetHeader()->SetGenEventHeader(header);
+
     break;
     
   } // event loop