Coverity 16571
[u/mrichter/AliRoot.git] / STEER / CreateAODfromKineTree.C
index 95e3b31..5271ffb 100644 (file)
@@ -77,7 +77,7 @@ void CreateAODfromKineTree(const char *inFileName,
   TFile *outFile = TFile::Open(outFileName, "RECREATE");
 
   // create the tree
-  TTree *aodTree = new TTree("AOD", "AliAOD tree");
+  TTree *aodTree = new TTree("aodTree", "AliAOD tree");
   aodTree->Branch(aod->GetList());
 
   AliRunLoader *runLoader;
@@ -121,28 +121,32 @@ void CreateAODfromKineTree(const char *inFileName,
     nKPlus = 0;
     nKMinus = 0;
 
-    // create the header
-    aod->AddHeader(new AliAODHeader(aliHeader->GetRun(),
-                                   0, // bunchX number
-                                   0, // orbit number
-                                   nTracks,
-                                   nPos,
-                                   nNeg,
-                                   -999, // mag. field
-                                   -999., // muon mag. field
-                                   -999., // centrality
-                                   -999, // ZDCN1Energy
-                                   -999, // ZDCP1Energy
-                                   -999, // ZDCN2Energy
-                                   -999, // ZDCP2Energy
-                                   -999, // ZDCEMEnergy
-                                   0, // TriggerMask
-                                   0, // TriggerCluster
-                                   0)); // EventType
-    
     // Access to the header
     AliAODHeader *header = aod->GetHeader();
 
+    Double_t emEnergy[2] = {-999., -999.};
+
+    // fill the header
+    *header = AliAODHeader(aliHeader->GetRun(),
+                          0, // bunchX number
+                          0, // orbit number
+                          0, // period number
+                          nTracks,
+                          nPos,
+                          nNeg,
+                          -999, // mag. field
+                          -999., // muon mag. field
+                          -999., // centrality
+                          -999., // ZDCN1Energy
+                          -999., // ZDCP1Energy
+                          -999., // ZDCN2Energy
+                          -999., // ZDCP2Energy
+                          emEnergy, // emEnergy
+                          0, // TriggerMask
+                          0, // TriggerCluster
+                          0, // EventType
+                          ""); // title
+  
     // Access to the AOD container of vertices
     TClonesArray &vertices = *(aod->GetVertices());
     jVertices=0;
@@ -185,6 +189,7 @@ void CreateAODfromKineTree(const char *inFileName,
                                                                0, // no ITSClusterMap
                                                                pid,
                                                                primary,
+                                                               kFALSE,  // no fit performed
                                                                kFALSE, // no fit preformed
                                                                AliAODTrack::kPrimary));
        currTrack = (AliAODTrack*)tracks.Last();
@@ -266,6 +271,7 @@ Int_t LoopOverSecondaries(TParticle *mother) {
                                                                pid,
                                                                secondary,
                                                                kFALSE, // no fit performed
+                                                               kFALSE, // no fit performed
                                                                AliAODTrack::kSecondary));
 
       currTrack = (AliAODTrack*)tracks.Last();