+
+
+ // loop over D* candidates
+ Int_t nDstar = arrayDstar->GetEntriesFast();
+ nTotDstar += nDstar;
+ cout<<"Number of D*->D0pi: "<<nDstar<<endl;
+
+ for (Int_t iDstar = 0; iDstar < nDstar; iDstar++) {
+ AliAODRecoCascadeHF *c = (AliAODRecoCascadeHF*)arrayDstar->UncheckedAt(iDstar);
+ Bool_t unsetvtx=kFALSE;
+ if(!c->GetOwnPrimaryVtx()) {
+ c->SetOwnPrimaryVtx(vtx1); // needed to compute all variables
+ c->Get2Prong()->SetOwnPrimaryVtx(vtx1);
+ unsetvtx=kTRUE;
+ }
+ if(c->SelectDstar(cutsDstar,cutsD0)) {
+ hDeltaMassDstar->Fill(c->DeltaInvMass());
+ // get daughters
+ AliAODTrack *trk = (AliAODTrack*)c->GetBachelor();
+ AliAODRecoDecayHF2Prong *d = (AliAODRecoDecayHF2Prong*)c->Get2Prong();
+ cout<<"pt of soft pi: "<<trk->Pt()<<endl;
+ cout<<"pt of D0: "<<d->Pt()<<endl;
+ }
+
+ if(unsetvtx) {
+ c->UnsetOwnPrimaryVtx();
+ c->Get2Prong()->UnsetOwnPrimaryVtx();
+ }
+ }
+