- if(TMath::Abs(minvD0-mPDG)<0.03 || TMath::Abs(minvD0bar-mPDG)<0.03){
- //cout<<"inside mass cut"<<endl;
- Int_t pdgDgD0toKpi[2]={321,211};
- Int_t lab=d->MatchToMC(421,mcArray,2,pdgDgD0toKpi); //return MC particle label if the array corresponds to a D0, -1 if not (cf. AliAODRecoDecay.cxx)
-
- if(lab>=0){ //signal
- if(fArray==1) cout<<"LS signal: ERROR"<<endl;
- for (Int_t iprong=0; iprong<2; iprong++){
- AliAODTrack *prong=(AliAODTrack*)d->GetDaughter(iprong);
- Int_t labprong=prong->GetLabel();
-
- //cout<<"prong name = "<<prong->GetName()<<" label = "<<prong->GetLabel()<<endl;
- AliAODMCParticle *mcprong=0;
- if(labprong>=0) mcprong= (AliAODMCParticle*)mcArray->At(labprong);
- Int_t pdgprong=mcprong->GetPdgCode();
- if(TMath::Abs(pdgprong)==211) {
- //cout<<"pi"<<endl;
- ((TH1F*)fDistr->FindObject("hptpiS"))->Fill(d->PtProng(iprong));
- ((TH1F*)fDistr->FindObject("hd0piS"))->Fill(d->Getd0Prong(iprong));
- }
-
- if(TMath::Abs(pdgprong)==321) {
- //cout<<"kappa"<<endl;
- ((TH1F*)fDistr->FindObject("hptKS"))->Fill(d->PtProng(iprong));
- ((TH1F*)fDistr->FindObject("hd0KS"))->Fill(d->Getd0Prong(iprong));
- }
- ((TH1F*)fDistr->FindObject("hdcaS"))->Fill(d->GetDCA());
-
- }
-
- if (((AliAODMCParticle*)mcArray->At(lab))->GetPdgCode() == 421)
- ((TH1F*)fDistr->FindObject("hcosthetastarS"))->Fill(d->CosThetaStarD0());
- else ((TH1F*)fDistr->FindObject("hcosthetastarS"))->Fill(d->CosThetaStarD0bar());
-
- ((TH1F*)fDistr->FindObject("hd0d0S"))->Fill(d->Prodd0d0());
-
- ((TH1F*)fDistr->FindObject("hcosthetapointS"))->Fill(d->CosPointingAngle());
- ((TH1F*)fDistr->FindObject("hcosthpointd0d0S"))->Fill(d->CosPointingAngle(),d->Prodd0d0());
-
- //cout<<"ok point"<<endl;
+ if(fReadMC){
+ if(TMath::Abs(minvD0-mPDG)<0.03 || TMath::Abs(minvD0bar-mPDG)<0.03){
+ //cout<<"inside mass cut"<<endl;
+ Int_t pdgDgD0toKpi[2]={321,211};
+ Int_t lab=d->MatchToMC(421,mcArray,2,pdgDgD0toKpi); //return MC particle label if the array corresponds to a D0, -1 if not (cf. AliAODRecoDecay.cxx)
+
+ if(lab>=0){ //signal
+ if(fArray==1) cout<<"LS signal: ERROR"<<endl;
+ for (Int_t iprong=0; iprong<2; iprong++){
+ AliAODTrack *prong=(AliAODTrack*)d->GetDaughter(iprong);
+ Int_t labprong=prong->GetLabel();
+
+ //cout<<"prong name = "<<prong->GetName()<<" label = "<<prong->GetLabel()<<endl;
+ AliAODMCParticle *mcprong=0;
+ if(labprong>=0) mcprong= (AliAODMCParticle*)mcArray->At(labprong);
+ Int_t pdgprong=mcprong->GetPdgCode();
+ if(TMath::Abs(pdgprong)==211) {
+ //cout<<"pi"<<endl;
+ ((TH1F*)fDistr->FindObject("hptpiS"))->Fill(d->PtProng(iprong));
+ ((TH1F*)fDistr->FindObject("hd0piS"))->Fill(d->Getd0Prong(iprong));
+ }
+
+ if(TMath::Abs(pdgprong)==321) {
+ //cout<<"kappa"<<endl;
+ ((TH1F*)fDistr->FindObject("hptKS"))->Fill(d->PtProng(iprong));
+ ((TH1F*)fDistr->FindObject("hd0KS"))->Fill(d->Getd0Prong(iprong));
+ }
+ ((TH1F*)fDistr->FindObject("hdcaS"))->Fill(d->GetDCA());
+
+ }
+
+ if (((AliAODMCParticle*)mcArray->At(lab))->GetPdgCode() == 421)
+ ((TH1F*)fDistr->FindObject("hcosthetastarS"))->Fill(d->CosThetaStarD0());
+ else ((TH1F*)fDistr->FindObject("hcosthetastarS"))->Fill(d->CosThetaStarD0bar());
+
+ ((TH1F*)fDistr->FindObject("hd0d0S"))->Fill(d->Prodd0d0());
+
+ ((TH1F*)fDistr->FindObject("hcosthetapointS"))->Fill(d->CosPointingAngle());
+ ((TH1F*)fDistr->FindObject("hcosthpointd0d0S"))->Fill(d->CosPointingAngle(),d->Prodd0d0());
+
+ //cout<<"ok point"<<endl;
- } else{ //Background or LS
- //cout<<"is background"<<endl;
- AliAODTrack *prong=(AliAODTrack*)d->GetDaughter(0);
- if(!prong) cout<<"No daughter found";
- else{
- if(prong->Charge()==1) {fTotPosPairs[4]++;} else {fTotNegPairs[4]++;}
- }
- ((TH1F*)fDistr->FindObject("hptB"))->Fill(d->PtProng(0));
- //cout<<"ptok"<<endl;
- ((TH1F*)fDistr->FindObject("hd0B"))->Fill(d->Getd0Prong(0));
- //cout<<"d0ok"<<endl;
- ((TH1F*)fDistr->FindObject("hdcaB"))->Fill(d->GetDCA());
- //cout<<"dcaok"<<endl;
- ((TH1F*)fDistr->FindObject("hcosthetastarB"))->Fill(d->CosThetaStarD0());
- ((TH1F*)fDistr->FindObject("hcosthetastarB"))->Fill(d->CosThetaStarD0bar());
- ((TH1F*)fDistr->FindObject("hd0d0B"))->Fill(d->Prodd0d0());
- //cout<<"d0d0ok"<<endl;
- ((TH1F*)fDistr->FindObject("hcosthetapointB"))->Fill(d->CosPointingAngle());
- ((TH1F*)fDistr->FindObject("hcosthpointd0d0B"))->Fill(d->CosPointingAngle(),d->Prodd0d0());
-
- //cout<<"pointok"<<endl;
+ } else{ //Background or LS
+ //cout<<"is background"<<endl;
+ AliAODTrack *prong=(AliAODTrack*)d->GetDaughter(0);
+ if(!prong) cout<<"No daughter found";
+ else{
+ if(prong->Charge()==1) {fTotPosPairs[4]++;} else {fTotNegPairs[4]++;}
+ }
+ ((TH1F*)fDistr->FindObject("hptB"))->Fill(d->PtProng(0));
+ //cout<<"ptok"<<endl;
+ ((TH1F*)fDistr->FindObject("hd0B"))->Fill(d->Getd0Prong(0));
+ //cout<<"d0ok"<<endl;
+ ((TH1F*)fDistr->FindObject("hdcaB"))->Fill(d->GetDCA());
+ //cout<<"dcaok"<<endl;
+ ((TH1F*)fDistr->FindObject("hcosthetastarB"))->Fill(d->CosThetaStarD0());
+ ((TH1F*)fDistr->FindObject("hcosthetastarB"))->Fill(d->CosThetaStarD0bar());
+ ((TH1F*)fDistr->FindObject("hd0d0B"))->Fill(d->Prodd0d0());
+ //cout<<"d0d0ok"<<endl;
+ ((TH1F*)fDistr->FindObject("hcosthetapointB"))->Fill(d->CosPointingAngle());
+ ((TH1F*)fDistr->FindObject("hcosthpointd0d0B"))->Fill(d->CosPointingAngle(),d->Prodd0d0());
+
+ //cout<<"pointok"<<endl;