fNPtBins(1),
fTotPosPairs(0),
fTotNegPairs(0),
-fLsNormalization(1.)
+fLsNormalization(1.),
+fFillOnlyD0D0bar(0)
{
fNPtBins(1),
fTotPosPairs(0),
fTotNegPairs(0),
-fLsNormalization(1.)
-
+fLsNormalization(1.),
+fFillOnlyD0D0bar(0)
{
// Default constructor
}
+ namedistr="hpospair";
+ TH1F* hpospair=new TH1F(namedistr.Data(),"Number of positive pairs",fCuts->GetNPtBins(),-0.5,fCuts->GetNPtBins()-0.5);
+ namedistr="hnegpair";
+ TH1F* hnegpair=new TH1F(namedistr.Data(),"Number of negative pairs",fCuts->GetNPtBins(),-0.5,fCuts->GetNPtBins()-0.5);
+ fDistr->Add(hpospair);
+ fDistr->Add(hnegpair);
+
+
//histograms for vertex checking and TOF checking
TString checkname="hptGoodTr";
return;
}
else{
- if(prongg->Charge()==1) {fTotPosPairs[ptbin]++;} else {fTotNegPairs[ptbin]++;}
+ if(prongg->Charge()==1) {
+ fTotPosPairs[ptbin]++;
+ ((TH1F*)fDistr->FindObject("hpospair"))->Fill(ptbin);
+ } else {
+ fTotNegPairs[ptbin]++;
+ ((TH1F*)fDistr->FindObject("hnegpair"))->Fill(ptbin);
+ }
}
//normalise pt distr to half afterwards
if (fReadMC && labD0>=0) fNentries->Fill(2);
//PostData(3,fNentries);
- if (isSelected==1 || isSelected==3) { //D0
+ if ((isSelected==1 || isSelected==3) && fFillOnlyD0D0bar<2) { //D0
fillthis="histMass_";
fillthis+=ptbin;
//cout<<"Filling "<<fillthis<<endl;
}
}
- if (isSelected>1) { //D0bar
+ if (isSelected>1 && (fFillOnlyD0D0bar==0 || fFillOnlyD0D0bar==2)) { //D0bar
fillthis="histMass_";
fillthis+=ptbin;
//printf("Fill mass with D0bar");
void SetReadMC(Bool_t readMC=kFALSE){fReadMC=readMC;}
void SetCutOnDistr(Bool_t cutondistr=kFALSE){fCutOnDistr=cutondistr;}
void SetUsePid4Distr(Bool_t usepid=kTRUE){fUsePid4Distr=usepid;}
+ void SetFillOnlyD0D0bar(Int_t flagfill){fFillOnlyD0D0bar=flagfill;}
Bool_t GetCutOnDistr() const {return fCutOnDistr;}
Bool_t GetUsePid4Distr() const {return fUsePid4Distr;}
+ Int_t GetFillOnlyD0D0bar() const {return fFillOnlyD0D0bar;}
+
private:
AliAnalysisTaskSED0Mass(const AliAnalysisTaskSED0Mass &source);
Int_t* fTotPosPairs; //[fNPtBins]
Int_t* fTotNegPairs; //[fNPtBins]
Double_t fLsNormalization; // normalization
+ Int_t fFillOnlyD0D0bar; // flag to fill mass histogram with D0/D0bar only (0 = fill with both, 1 = fill with D0 only, 2 = fill with D0bar only)
-
- ClassDef(AliAnalysisTaskSED0Mass,8); // AliAnalysisTaskSE for the MC association of heavy-flavour decay candidates
+ ClassDef(AliAnalysisTaskSED0Mass,9); // AliAnalysisTaskSE for the MC association of heavy-flavour decay candidates
};
#endif
-AliAnalysisTaskSED0Mass *AddTaskD0Mass(TString finname="D0toKpiCutsNew.root",Int_t flag=0/*0 = D0,1 = LS*/,Bool_t readMC=kFALSE,Bool_t cutOnDistr=kFALSE)
+AliAnalysisTaskSED0Mass *AddTaskD0Mass(TString finname="D0toKpiCutsNew.root",Int_t flag=0/*0 = D0,1 = LS*/,Bool_t readMC=kFALSE,Bool_t cutOnDistr=kFALSE,Int_t flagD0D0bar=0)
{
//
// AddTask for the AliAnalysisTaskSE for D0 candidates
if(flag==0){
filename+="D0InvMass";
if(cutOnDistr) filename+="C";
+ if(flagD0D0bar==1)filename+="D0";
+ if(flagD0D0bar==2)filename+="D0bar";
//list mass
- out1name="coutputmassD0MassN";
+ out1name="coutputmassD0Mass";
if(cutOnDistr) out1name+="C";
+ if(flagD0D0bar==1)out1name+="D0";
+ if(flagD0D0bar==2)out1name+="D0bar";
//list distr
- out2name="coutputmassD0distrN";
+ out2name="coutputmassD0distr";
if(cutOnDistr) out2name+="C";
- //hist entries
- out3name="nEntriesD0N";
+ if(flagD0D0bar==1)out2name+="D0";
+ if(flagD0D0bar==2)out2name+="D0bar";
+ //hist entries
+ out3name="nEntriesD0";
if(cutOnDistr) out3name+="C";
+ if(flagD0D0bar==1)out3name+="D0";
+ if(flagD0D0bar==2)out3name+="D0bar";
//list checks
- out4name="checksD0N";
+ out4name="checksD0";
if(cutOnDistr) out4name+="C";
- //cuts object
- out5name="cutsD0N";
+ if(flagD0D0bar==1)out4name+="D0";
+ if(flagD0D0bar==2)out4name+="D0bar";
+ //cuts object
+ out5name="cutsD0";
if(cutOnDistr) out5name+="C";
+ if(flagD0D0bar==1)out5name+="D0";
+ if(flagD0D0bar==2)out5name+="D0bar";
- inname="cinputmassD0_0N";
+ inname="cinputmassD0_0";
if(cutOnDistr) inname+="C";
+ if(flagD0D0bar==1)inname+="D0";
+ if(flagD0D0bar==2)inname+="D0bar";
} else {
filename+="D0InvMassLikeSign";
if(cutOnDistr) filename+="C";
+ if(flagD0D0bar==1)filename+="D0";
+ if(flagD0D0bar==2)filename+="D0bar";
//list mass
- out1name="coutputmassLSMassN";
+ out1name="coutputmassLSMass";
if(cutOnDistr) out1name+="C";
+ if(flagD0D0bar==1)out1name+="D0";
+ if(flagD0D0bar==2)out1name+="D0bar";
//list distr
- out2name="coutputmassLSdistrN";
+ out2name="coutputmassLSdistr";
if(cutOnDistr) out2name+="C";
- //hist entries
- out3name="nEntriesLSN";
+ if(flagD0D0bar==1)out2name+="D0";
+ if(flagD0D0bar==2)out2name+="D0bar";
+ //hist entries
+ out3name="nEntriesLS";
if(cutOnDistr) out3name+="C";
+ if(flagD0D0bar==1)out3name+="D0";
+ if(flagD0D0bar==2)out3name+="D0bar";
//list checks
- out4name="checksLSN";
+ out4name="checksLS";
if(cutOnDistr) out4name+="C";
- //cuts object
- out5name="cutsLSN";
+ if(flagD0D0bar==1)out4name+="D0";
+ if(flagD0D0bar==2)out4name+="D0bar";
+ //cuts object
+ out5name="cutsLS";
if(cutOnDistr) out5name+="C";
+ if(flagD0D0bar==1)out5name+="D0";
+ if(flagD0D0bar==2)out5name+="D0bar";
- inname="cinputmassD0_1N";
+ inname="cinputmassD0_1";
if(cutOnDistr) inname+="C";
+ if(flagD0D0bar==1)inname+="D0";
+ if(flagD0D0bar==2)inname+="D0bar";
}
//setting my cut values
massD0Task->SetReadMC(readMC);
massD0Task->SetCutOnDistr(cutOnDistr);
massD0Task->SetUsePid4Distr(kFALSE);
+ massD0Task->SetFillOnlyD0D0bar(flagD0D0bar);
+
mgr->AddTask(massD0Task);
//