//
// Class for AOD reconstructed heavy-flavour cascades
//
-// Author: X-M. Zhang, zhangxm@iop.ccnu.edu.cn
+// Author: X-M. Zhang, zhangxm@iopp.ccnu.edu.cn
/////////////////////////////////////////////////////////////
#include <TVector3.h>
#include <TDatabasePDG.h>
+#include <TClonesArray.h>
+#include "AliAODMCParticle.h"
#include "AliAODRecoDecay.h"
#include "AliAODVertex.h"
#include "AliAODRecoDecayHF2Prong.h"
//-----------------------------------------------------------------------------
AliAODRecoCascadeHF::AliAODRecoCascadeHF() :
- AliAODRecoDecayHF2Prong(),
- f2Prong()
+ AliAODRecoDecayHF2Prong()
{
//
// Default Constructor
AliAODRecoCascadeHF::AliAODRecoCascadeHF(AliAODVertex *vtx2, Short_t charge,
Double_t *px, Double_t *py, Double_t *pz,
Double_t *d0, Double_t *d0err, Double_t dca) :
- AliAODRecoDecayHF2Prong(vtx2, px, py, pz, d0, d0err, dca),
- f2Prong()
+ AliAODRecoDecayHF2Prong(vtx2, px, py, pz, d0, d0err, dca)
{
//
// Constructor with AliAODVertex for decay vertex
//-----------------------------------------------------------------------------
AliAODRecoCascadeHF::AliAODRecoCascadeHF(AliAODVertex *vtx2, Short_t charge,
Double_t *d0, Double_t *d0err, Double_t dca) :
- AliAODRecoDecayHF2Prong(vtx2, d0, d0err, dca),
- f2Prong()
+ AliAODRecoDecayHF2Prong(vtx2, d0, d0err, dca)
{
//
// Constructor with decay vertex and without prongs momenta
}
//-----------------------------------------------------------------------------
AliAODRecoCascadeHF::AliAODRecoCascadeHF(const AliAODRecoCascadeHF &source) :
- AliAODRecoDecayHF2Prong(source),
- f2Prong()
+ AliAODRecoDecayHF2Prong(source)
{
//
// Copy constructor
AliAODRecoDecayHF2Prong::operator=(source);
- f2Prong = source.f2Prong;
-
return *this;
}
//-----------------------------------------------------------------------------
return minv;
}
+//----------------------------------------------------------------------------
+Int_t AliAODRecoCascadeHF::MatchToMC(Int_t pdgabs,Int_t pdgabs2prong,
+ TClonesArray *mcArray) const
+{
+ //
+ // Check if this candidate is matched to a MC signal
+ // If no, return -1
+ // If yes, return label (>=0) of the AliAODMCParticle
+ //
+
+ if(pdgabs!=413) {
+ printf("Only D*+ implemented\n");
+ return -1;
+ }
+
+ Int_t ndg=GetNDaughters();
+ if(!ndg) {
+ AliError("No daughters available");
+ return -1;
+ }
+
+ AliAODRecoDecayHF2Prong *the2Prong = Get2Prong();
+ Int_t lab2Prong = the2Prong->MatchToMC(pdgabs2prong,mcArray);
+
+ if(lab2Prong<0) return -1;
+
+ Int_t dgLabels[10];
+
+ // loop on daughters and write labels
+ for(Int_t i=0; i<ndg; i++) {
+ AliVTrack *trk = (AliVTrack*)GetDaughter(i);
+ Int_t lab = trk->GetLabel();
+ if(lab==-1) { // this daughter is the 2prong
+ lab=lab2Prong;
+ } else if(lab<-1) {
+ printf("daughter with negative label\n");
+ continue;
+ }
+ dgLabels[i] = lab;
+ }
+
+ return AliAODRecoDecay::MatchToMC(pdgabs,mcArray,dgLabels,ndg);
+}
//-----------------------------------------------------------------------------
Bool_t AliAODRecoCascadeHF::SelectDstar(const Double_t *cutsDstar,
const Double_t *cutsD0,