deltainvMDStar = -998;\r
AliAODRecoCascadeHF* dstarD0pi;\r
AliAODRecoDecayHF2Prong* theD0particle;\r
- AliAODMCParticle* DStarMC;\r
+ AliAODMCParticle* DStarMC=0x0;\r
Short_t daughtercharge = -2;\r
Int_t trackiddaugh0 = -1; // track id if it is reconstruction - label if it is montecarlo info\r
Int_t trackiddaugh1 = -1;\r
// ================ FILL CORRELATION HISTOGRAMS ===============================\r
\r
// monte carlo case (mc tagged D*)\r
- if((fmontecarlo && isDStarMCtag) || (fmontecarlo && !fReco)){ // check correlations of MC tagged DStars in MonteCarlo\r
- \r
- Bool_t* PartSource = fCuts2->IsMCpartFromHF(label,fmcArray); // check source of associated particle (hadron/kaon/K0)\r
- \r
- MCarraytofill[5] = 0;\r
- if(PartSource[0]) MCarraytofill[5] = 1;\r
- if(PartSource[1]) MCarraytofill[5] = 2;\r
- if(PartSource[2]&&PartSource[0]) MCarraytofill[5] = 3;\r
+ if((fmontecarlo && isDStarMCtag) || (fmontecarlo && !fReco)){ // check correlations of MC tagged DStars in MonteCarlo\r
+ \r
+ Bool_t* PartSource = fCuts2->IsMCpartFromHF(label,fmcArray); // check source of associated particle (hadron/kaon/K0)\r
+ \r
+ MCarraytofill[5] = 0;\r
+ if(PartSource[0]) MCarraytofill[5] = 1;\r
+ if(PartSource[1]) MCarraytofill[5] = 2;\r
+ if(PartSource[2]&&PartSource[0]) MCarraytofill[5] = 3;\r
if(PartSource[2]&&PartSource[1]) MCarraytofill[5] = 4;\r
if(PartSource[3]) MCarraytofill[5] = 5;\r
if(!isDfromB) MCarraytofill[6] = 0;\r
if(isDfromB) MCarraytofill[6] = 1;\r
- if(!fReco && TMath::Abs(etaHad)>0.8) continue; // makes sure you study the correlation on MC truth only if particles are in acceptance\r
+ if(!fReco && TMath::Abs(etaHad)>0.8) {\r
+ delete [] PartSource;\r
+ continue; // makes sure you study the correlation on MC truth only if particles are in acceptance\r
+ }\r
((THnSparseF*)fOutputMC->FindObject("MCDStarCorrelationsDStarHadron"))->Fill(MCarraytofill);\r
\r
delete[] PartSource;\r
\r
AliInfo("Enlarging the D0 mass windows from cut object\n"); \r
Int_t nvars = fCuts->GetNVars();\r
- \r
+\r
+ if(nvars<1){\r
+ AliWarning("EnlargeDZeroMassWindow: 0 variables in cut object... check!");\r
+ return;\r
+ }\r
Float_t** rdcutsvalmine=new Float_t*[nvars];\r
for(Int_t iv=0;iv<nvars;iv++){\r
rdcutsvalmine[iv]=new Float_t[fNofPtBins];\r
Int_t labelD0 = d->GetLabel();
Int_t mother = track->GetMother();
- if(!mother) return isSoftPi; //safety check
+ if(mother<0) return isSoftPi; //safety check
AliAODMCParticle* mcMoth = dynamic_cast<AliAODMCParticle*>(arrayMC->At(mother)); //it's the mother of the track!
+ if(!mcMoth){
+ return isSoftPi;
+ }
if(TMath::Abs(mcMoth->GetPdgCode())==413 && mcMoth->GetNDaughters()==2) { //mother is D* with 2 daughs
Int_t labdau1 = mcMoth->GetDaughter(0);
Int_t labdau2 = mcMoth->GetDaughter(1);