]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
use AddObjecttoEvent
authorloizides <cloizides@lbl.gov>
Sat, 8 Feb 2014 21:08:48 +0000 (22:08 +0100)
committerloizides <cloizides@lbl.gov>
Sun, 9 Feb 2014 19:07:01 +0000 (20:07 +0100)
PWG/EMCAL/AliEmcalParticleMaker.cxx

index 8b74f903e0f8c79f339b8bf5640128c831e59684..5e05f4a3a679bf479f74b3fb5658311565a9684d 100644 (file)
@@ -57,30 +57,13 @@ void AliEmcalParticleMaker::ExecOnce()
   if (!fTracksOutName.IsNull()) {
     fTracksOut = new TClonesArray("AliEmcalParticle");
     fTracksOut->SetName(fTracksOutName);
-
-    if (!(InputEvent()->FindListObject(fTracksOutName))) {
-      InputEvent()->AddObject(fTracksOut);
-    }
-    else {
-      fInitialized = kFALSE;
-      AliFatal(Form("%s: Container with same name %s already present. Aborting", GetName(), fTracksOutName.Data()));
-      return;
-    }
+    AddObjectToEvent(fTracksOut);
   }
 
   if (!fCaloOutName.IsNull()) {
     fCaloClustersOut = new TClonesArray("AliEmcalParticle");
     fCaloClustersOut->SetName(fCaloOutName);
-    
-    // post output in event if not yet present
-    if (!(InputEvent()->FindListObject(fCaloOutName))) {
-      InputEvent()->AddObject(fCaloClustersOut);
-    }
-    else {
-      fInitialized = kFALSE;
-      AliFatal(Form("%s: Container with same name %s already present. Aborting", GetName(), fCaloOutName.Data()));
-      return;
-    }
+    AddObjectToEvent(fCaloClustersOut);    
   }
 }
 
@@ -105,9 +88,8 @@ Bool_t AliEmcalParticleMaker::Run()
     const Int_t Nclusters = fCaloClusters->GetEntries();
     for (Int_t iClusters = 0, iN=0; iClusters < Nclusters; ++iClusters) {
       AliVCluster *cluster = static_cast<AliVCluster*>(fCaloClusters->At(iClusters));
-      /* commented because for simplicity prefer to keep indices aligned (CL)
-        if (!cluster->IsEMCAL())
-        continue;
+      /* Commented because for simplicity prefer to keep indices aligned with clusters (CL)
+        if (!cluster->IsEMCAL()) continue;
       */
       new ((*fCaloClustersOut)[iN++]) AliEmcalParticle(cluster, iClusters, fVertex[0], fVertex[1], fVertex[2]);
     }