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++])
}
//----------------------------------------------------------
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;
}
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));
//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)
{
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;