]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
changed to nanoAOD production; fix in AliAODVertex::CloneWithoutRefts
authorjgrosseo <jgrosseo@cern.ch>
Tue, 11 Mar 2014 16:24:32 +0000 (17:24 +0100)
committerjgrosseo <jgrosseo@cern.ch>
Tue, 11 Mar 2014 16:24:32 +0000 (17:24 +0100)
PWG/DevNanoAOD/AliNanoAODReplicator.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.cxx
STEER/AOD/AliAODVertex.cxx

index 4952fffd59d3c2bdb713d9515e20af4569c05678..15838fbefed960bab7ceef10a6b36cd8b631bf6e 100644 (file)
@@ -497,11 +497,9 @@ void AliNanoAODReplicator::ReplicateAndFilter(const AliAODEvent& source)
     AliAODTrack *aodtrack =(AliAODTrack*)track;// FIXME DYNAMIC CAST?
     if(!fTrackCut->IsSelected(aodtrack)) continue;
 
-    AliNanoAODTrack * special = new  AliNanoAODTrack (aodtrack, fVarList);
+    AliNanoAODTrack * special = new((*fTracks)[ntracks++]) AliNanoAODTrack (aodtrack, fVarList);
     
     if(fCustomSetter) fCustomSetter->SetNanoAODTrack(aodtrack, special);
-    (*fTracks)[ntracks++] = special;
-    //new((*fTracks)[ntrac\ks++])
   }  
   //----------------------------------------------------------
   
@@ -514,15 +512,8 @@ void AliNanoAODReplicator::ReplicateAndFilter(const AliAODEvent& source)
       AliAODVertex* tmp = v->CloneWithoutRefs();
       AliAODVertex* copiedVertex = new((*fVertices)[nvertices++]) AliAODVertex(*tmp);
       
-      // to insure the main vertex retains the ncontributors information
-      // (which is otherwise computed dynamically from
-      // references to tracks, which we do not keep in muon aods...)
-      // we set it here
-      
       copiedVertex->SetNContributors(v->GetNContributors()); 
       
-      //  fVertices->Delete();
-      //         delete copiedVertex;
       delete tmp;
     }
   
index 21fc5157acf93cda085af0b0090318fca41af6e5..6fa91f048d5809578f897f55e6a2d3190ccedf2a 100644 (file)
@@ -510,6 +510,9 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
        Printf("WARNING: Centrality object is 0");
        centrality = -1;
       }
+      
+      if (centrality == -1 && fAOD && fAOD->GetHeader()->InheritsFrom("AliNanoAODHeader"))
+       centrality = (Float_t) gROOT->ProcessLine(Form("100.0 + 100.0 * ((AliNanoAODHeader*) %p)->GetCentrality(\"%s\")", fAOD->GetHeader(), fCentralityMethod.Data())) / 100 - 1.0;
     }
 
     AliInfo(Form("Centrality is %f", centrality));
@@ -1065,6 +1068,12 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseDataMode()
        //centrality = centralityObj->GetCentralityPercentileUnchecked(fCentralityMethod);
       else
        centrality = -1;
+      
+//       fAOD->GetHeader()->Dump();
+//       Printf("%p %d", dynamic_cast<AliNanoAODHeader*> (fAOD->GetHeader()), fAOD->GetHeader()->InheritsFrom("AliNanoAODHeader"));
+
+      if (centrality == -1 && fAOD && fAOD->GetHeader()->InheritsFrom("AliNanoAODHeader"))
+       centrality = (Float_t) gROOT->ProcessLine(Form("100.0 + 100.0 * ((AliNanoAODHeader*) %p)->GetCentrality(\"%s\")", fAOD->GetHeader(), fCentralityMethod.Data())) / 100 - 1.0;
 
       if (fAOD)
       {
index 761ba7c33f29a4209c25e5d54869e12aeb5e60c8..50d011ae62899d5e4910ebde5e653ad9a8aad032 100644 (file)
@@ -205,6 +205,14 @@ AliAODVertex* AliAODVertex::CloneWithoutRefs() const
                                      fType,
                                      0);
   
+  v->SetName(GetName());
+  // NOTE title is not allowed to be set, as GetNContributors 
+  // relies on the title to use the references which are not copied here
+  
+  // to insure the main vertex retains the ncontributors information
+  // (which is otherwise computed dynamically from
+  // references to tracks, which is not kept in the returned object)
+  // we set it here
   v->SetNContributors(fNContributors);  
   
   return v;