fKeepD0fromBOnly(kFALSE),
fCuts(0),
fUseWeight(kFALSE),
+ fUseFlatPtWeight(kFALSE),
+ fUseZWeight(kFALSE),
fWeight(1.),
fSign(2)
{
fKeepD0fromBOnly(kFALSE),
fCuts(cuts),
fUseWeight(kFALSE),
+ fUseFlatPtWeight(kFALSE),
+ fUseZWeight(kFALSE),
fWeight(1.),
fSign(2)
{
fKeepD0fromBOnly(c.fKeepD0fromBOnly),
fCuts(c.fCuts),
fUseWeight(c.fUseWeight),
+ fUseFlatPtWeight(c.fUseFlatPtWeight),
+ fUseZWeight(c.fUseZWeight),
fWeight(c.fWeight),
fSign(c.fSign)
{
//
if(fDebug > 1) printf("AliCFHeavyFlavourTaskMultiVarMultiStep::Init() \n");
+
+ if(fUseWeight && fUseZWeight) AliFatal("Can not use at the same time pt and z-vtx weights, please choose");
fMinITSClusters = fCuts->GetTrackCuts()->GetMinNClustersITS();
AliRDHFCutsD0toKpi* copyfCuts=new AliRDHFCutsD0toKpi(*fCuts);
}
Double_t zPrimVertex = vtx1->GetZ();
Double_t zMCVertex = mcHeader->GetVtxZ();
+ Int_t runnumber = aodEvent->GetRunNumber();
+ if(fUseZWeight) fWeight = GetZWeight(zMCVertex,runnumber);
Bool_t vtxFlag = kTRUE;
TString title=vtx1->GetTitle();
if(!title.Contains("VertexerTracks")) vtxFlag=kFALSE;
Double_t func2[4] = {0.36609,1.94635,1.40463,2.5};
Double_t dndptFunc1 = DodNdptFit(pt,func1);
+ if(fUseFlatPtWeight) dndptFunc1 = 1./30.;
Double_t dndptFunc2 = DodNdptFit(pt,func2);
AliDebug(2,Form("pt = %f, FONLL = %f, Pythia = %f, ratio = %f",pt,dndptFunc1,dndptFunc2,dndptFunc1/dndptFunc2));
return dndptFunc1/dndptFunc2;
return dNdpt;
}
+
+//__________________________________________________________________________________________________
+Double_t AliCFHeavyFlavourTaskMultiVarMultiStep::GetZWeight(Float_t z, Int_t runnumber){
+
+ if(runnumber>146824 || runnumber<146803) return 1.0;
+
+ Double_t func1[3] = {1.0, 0., 6.5 };
+ Double_t func2[3] = {1.0, 0., 5.5 };
+
+ Double_t dzFunc1 = DodzShape(z,func1);
+ Double_t dzFunc2 = DodzShape(z,func2);
+
+ return dzFunc1/dzFunc2;
+}
+
+//__________________________________________________________________________________________________
+Double_t AliCFHeavyFlavourTaskMultiVarMultiStep::DodzShape(Float_t z, const Double_t* par) const{
+
+ //
+ // Gaussian z-vtx shape
+ //
+ //gaussian = [0]/TMath::Sqrt(2.*TMath::Pi())/[2]*exp[-(x-[1])*(x-[1])/(2*[2]*[2])]
+
+ Double_t value = par[0]/TMath::Sqrt(2.*TMath::Pi())/par[2]*TMath::Exp(-(z-par[1])*(z-par[1])/2./par[2]/par[2]);
+
+ return value;
+}
Bool_t GetKeepD0fromBOnly() const { return fKeepD0fromBOnly;}
void SetUseWeight(Bool_t useWeight){fUseWeight=useWeight;}
Bool_t GetUseWeight() const {return fUseWeight;}
+ void SetUseFlatPtWeight(Bool_t useWeight){fUseFlatPtWeight=useWeight; fUseWeight=useWeight;}
+ Bool_t GetUseFlatPtWeight() const {return fUseFlatPtWeight;}
Double_t GetWeight(Float_t pt);
+ void SetUseZWeight(Bool_t useWeight){fUseZWeight=useWeight;}
+ Bool_t GetUseZWeight() const {return fUseZWeight;}
+ Double_t GetZWeight(Float_t z, Int_t runnumber);
Double_t DodNdptFit(Float_t pt, const Double_t* par) const;
+ Double_t DodzShape(Float_t z, const Double_t* par) const;
void SetSign(Char_t isSign) {fSign = isSign;}
Char_t GetSign() const {return fSign;}
Bool_t fKeepD0fromB; // flag to consider also D0 coming from B
Bool_t fKeepD0fromBOnly; // flag to consider _only_ D0 coming from B
AliRDHFCutsD0toKpi* fCuts; // cuts
- Bool_t fUseWeight; // flag to decide whether to use weights != 1 when filling the container or not
+ Bool_t fUseWeight; // flag to decide whether to use pt weights != 1 when filling the container or not
+ Bool_t fUseFlatPtWeight;
+ Bool_t fUseZWeight; // flag to decide whether to use z-vtx weights != 1 when filling the container or not
Double_t fWeight; // weight used to fill the container
Char_t fSign; // flag to decide wheter to keep D0 only (0), D0bar only (1), or both D0 and D0bar (2)
- ClassDef(AliCFHeavyFlavourTaskMultiVarMultiStep,7); // class for HF corrections as a function of many variables
+ ClassDef(AliCFHeavyFlavourTaskMultiVarMultiStep,8); // class for HF corrections as a function of many variables
};
#endif
//----------------------------------------------------
-AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.root",Int_t configuration = AliCFTaskVertexingHF::kSnail, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 421, Char_t isSign = 2)
-//AliCFContainer *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.root", Int_t configuration = AliCFTaskVertexingHF::kSnail, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 421, Char_t isSign = 2)
+AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.root", TString cutObjectName="D0toKpiCutsStandard", TString suffix="", Int_t configuration = AliCFTaskVertexingHF::kSnail, Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 421, Char_t isSign = 2, Bool_t useWeight=kFALSE, Bool_t useFlatPtWeight=kFALSE, Bool_t useZWeight=kFALSE)
{
printf("Adding CF task using cuts from file %s\n",cutFile);
if (configuration == AliCFTaskVertexingHF::kSnail){
return 0x0;
}
- AliRDHFCutsD0toKpi *cutsD0toKpi = (AliRDHFCutsD0toKpi*)fileCuts->Get("D0toKpiCutsStandard");
+ AliRDHFCutsD0toKpi *cutsD0toKpi = (AliRDHFCutsD0toKpi*)fileCuts->Get(cutObjectName.Data());
// check that the fKeepD0fromB flag is set to true when the fKeepD0fromBOnly flag is true
// for now the binning is the same than for all D's
task->SetFillFromGenerated(kFALSE);
task->SetCFManager(man); //here is set the CF manager
task->SetDecayChannel(2);
- task->SetUseWeight(kFALSE);
+ task->SetUseWeight(useWeight);
+ task->SetUseFlatPtWeight(useFlatPtWeight);
+ task->SetUseZWeight(useZWeight);
task->SetSign(isSign);
task->SetCentralitySelection(kFALSE);
task->SetFakeSelection(0);
}
output4name= "Cuts_CommonFramework";
+ outputfile += suffix;
+ output1name += suffix;
+ output2name += suffix;
+ output3name += suffix;
+ output4name += suffix;
+
//now comes user's output objects :
// output TH1I for event counting
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1name, TH1I::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data());