From 1c44b663dd193723d83e79bb1198aeca993fbf7c Mon Sep 17 00:00:00 2001 From: dainese Date: Wed, 1 Jun 2011 12:31:11 +0000 Subject: [PATCH] Added Lc (Davide) --- PWG3/vertexingHF/AliCFTaskVertexingHF.cxx | 2 +- PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx | 49 +- .../macros/AddTaskCFVertexingHF3ProngLc.C | 634 ++++++++++++++++++ 3 files changed, 674 insertions(+), 11 deletions(-) create mode 100644 PWG3/vertexingHF/macros/AddTaskCFVertexingHF3ProngLc.C diff --git a/PWG3/vertexingHF/AliCFTaskVertexingHF.cxx b/PWG3/vertexingHF/AliCFTaskVertexingHF.cxx index 4a45c6f9806..df93fc4c66f 100644 --- a/PWG3/vertexingHF/AliCFTaskVertexingHF.cxx +++ b/PWG3/vertexingHF/AliCFTaskVertexingHF.cxx @@ -260,7 +260,7 @@ void AliCFTaskVertexingHF::Init() } case 32:{ copyfCuts = new AliRDHFCutsLctopKpi(*(static_cast(fCuts))); - fNvar = 14; + fNvar = 18; fPartName="Lambdac"; fDauNames="p+K+pi"; break; diff --git a/PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx b/PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx index 4930cc20130..65613bb08a4 100644 --- a/PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx +++ b/PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx @@ -22,7 +22,7 @@ // in bins of cut variables // // Origin: Francesco Prino (prino@to.infn.it) // // Renu Bala (bala@to.infn.it) // -// // +// Davide Caffarri (cafarri@pd.infn.it) // /////////////////////////////////////////////////////////////////// #include "AliAODMCParticle.h" @@ -107,8 +107,10 @@ Bool_t AliCFVertexingHF3Prong::SetRecoCandidateParam(AliAODRecoDecayHF *recoCand pdgDaughter[1]=321; pdgDaughter[2]=211; }else if(fDecay==kLctopKpi){ - AliError("LambdaC not yet implemented"); - return bSignAssoc; + pdgCand=4122; + pdgDaughter[0]=2212; + pdgDaughter[1]=321; + pdgDaughter[2]=211; }else{ AliError("WRONG DECAY SETTING"); return bSignAssoc; @@ -164,8 +166,7 @@ Bool_t AliCFVertexingHF3Prong::GetGeneratedValuesFromMCParticle(Double_t* vector }else if(fDecay==kDstoKKpi){ pdgCand=431; }else if(fDecay==kLctopKpi){ - AliError("LambdaC not yet implemented"); - return bGenValues; + pdgCand=4122; }else{ AliError("WRONG DECAY SETTING"); return bGenValues; @@ -301,6 +302,13 @@ Bool_t AliCFVertexingHF3Prong::GetGeneratedValuesFromMCParticle(Double_t* vector vectorMC[12] = fCentValue; // reconstructed centrality value vectorMC[13] = 1.; // always filling with 1 at MC level + if (fDecay==kLctopKpi){ + vectorMC[14] = 0.; + vectorMC[15] = 0.; + vectorMC[16] = 0.; + vectorMC[17] = 0.; + } + bGenValues = kTRUE; return bGenValues; @@ -319,8 +327,9 @@ Bool_t AliCFVertexingHF3Prong::GetRecoValuesFromCandidate(Double_t *vectorReco) }else if(fDecay==kDstoKKpi){ pdgCand=431; }else if(fDecay==kLctopKpi){ - AliError("LambdaC not yet implemented"); - return bFillRecoValues; + pdgCand=4122; + // AliError("LambdaC not yet implemented"); + // return bFillRecoValues; }else{ AliError("WRONG DECAY SETTING"); return bFillRecoValues; @@ -333,6 +342,10 @@ Bool_t AliCFVertexingHF3Prong::GetRecoValuesFromCandidate(Double_t *vectorReco) Double_t pt = decay3->Pt(); Double_t cosPointingAngle = decay3->CosPointingAngle(); Double_t phi = decay3->Phi(); + Double_t dist12= decay3->GetDist12toPrim(); + Double_t dist23 = decay3->GetDist23toPrim(); + Double_t sigmVert = decay3->GetSigmaVert(); + Int_t daughtSorted[3]; Int_t tmpIndex=0; @@ -363,7 +376,10 @@ Bool_t AliCFVertexingHF3Prong::GetRecoValuesFromCandidate(Double_t *vectorReco) daughtSorted[2]=tmp; } - + Double_t d0prong0 = decay3->Getd0Prong(daughtSorted[0]); + Double_t d0prong1 = decay3->Getd0Prong(daughtSorted[1]); + Double_t d0prong2 = decay3->Getd0Prong(daughtSorted[2]); + vectorReco[0] = pt; vectorReco[1] = rapidity; vectorReco[2] = phi; @@ -379,6 +395,14 @@ Bool_t AliCFVertexingHF3Prong::GetRecoValuesFromCandidate(Double_t *vectorReco) vectorReco[12] = fCentValue; //reconstructed centrality value vectorReco[13] = fFake; // whether the reconstructed candidate was a fake (fFake = 0) or not (fFake = 2) + if(fDecay==kLctopKpi){ + Double_t sumd02 =(d0prong0*d0prong0 + d0prong1*d0prong1 + d0prong2*d0prong2); + vectorReco[14] = dist12*1.E4; + vectorReco[15] = dist23*1.E4; + vectorReco[16] = sigmVert*1.E4; + vectorReco[17] = sumd02*1.E8; + } + bFillRecoValues = kTRUE; return bFillRecoValues; @@ -404,8 +428,13 @@ Bool_t AliCFVertexingHF3Prong::CheckMCChannelDecay() const pdgDaughter[1]=321; pdgDaughter[2]=211; }else if(fDecay==kLctopKpi){ - AliError("LambdaC not yet implemented"); - return checkCD; + pdgCand=4122; + pdgDaughter[0]=2212; + pdgDaughter[1]=321; + pdgDaughter[2]=211; + + // AliError("LambdaC not yet implemented"); + // return checkCD; }else{ AliError("WRONG DECAY SETTING"); return checkCD; diff --git a/PWG3/vertexingHF/macros/AddTaskCFVertexingHF3ProngLc.C b/PWG3/vertexingHF/macros/AddTaskCFVertexingHF3ProngLc.C new file mode 100644 index 00000000000..b5b94cda62f --- /dev/null +++ b/PWG3/vertexingHF/macros/AddTaskCFVertexingHF3ProngLc.C @@ -0,0 +1,634 @@ +//DEFINITION OF A FEW CONSTANTS +const Double_t ymin = -2.1 ; +const Double_t ymax = 2.1 ; +// const Double_t ptmin_0_4 = 0.0 ; +// const Double_t ptmax_0_4 = 4.0 ; +// const Double_t ptmin_4_8 = 4.0 ; +// const Double_t ptmax_4_8 = 8.0 ; +// const Double_t ptmin_8_10 = 8.0 ; +// const Double_t ptmax_8_10 = 10.0 ; +const Double_t cosmin = -1.05; +const Double_t cosmax = 1.05; +const Double_t cTmin = 0; // micron +const Double_t cTmax = 500; // micron +const Double_t dcamin = 0; // micron +const Double_t dcamax = 500; // micron +const Double_t d0min = -1000; // micron +const Double_t d0max = 1000; // micron +const Double_t d0xd0min = -100000; // micron +const Double_t d0xd0max = 100000; // micron +const Double_t phimin = 0.0; +//const Double_t phimax = 2Pi; // defined in the macro!!!!!!!!!!!!!! +const Int_t mintrackrefsTPC = 2 ; +const Int_t mintrackrefsITS = 3 ; +const Int_t charge = 1 ; +const Int_t minclustersTPC = 50 ; +// cuts +const Double_t ptmin = 0.1; +const Double_t ptmax = 9999.; +const Double_t etamin = -0.9; +const Double_t etamax = 0.9; +const Double_t zmin = -15; +const Double_t zmax = 15; +const Int_t minITSClusters = 5; + +const Float_t centmin = 0.; +const Float_t centmax = 100.; +const Float_t fakemin = -0.5; +const Float_t fakemax = 2.5.; + +const Double_t distTwoPartmin=0; +const Double_t distTwoPartmax=600; + +const Double_t dispVtxmin = 0; +const Double_t dispVtxmax = 600; + +const Double_t sumd02min = 0.; +const Double_t sumd02max = 50000.; + +//---------------------------------------------------- + +AliCFTaskVertexingHF *AddTaskCFVertexingHF3ProngLc(const char* cutFile = "./cuts4LctopKpi.root",Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 4122, Char_t isSign = 2) +{ + printf("Addig CF task using cuts from file %s\n",cutFile); + + // isSign = 0 --> D0 only + // isSign = 1 --> D0bar only + // isSign = 2 --> D0 + D0bar + + TString expected; + if (isSign == 0 && pdgCode < 0){ + AliError(Form("Error setting PDG code (%d) and sign (0 --> particle (%d) only): they are not compatible, returning",pdgCode)); + return 0x0; + } + else if (isSign == 1 && pdgCode > 0){ + AliError(Form("Error setting PDG code (%d) and sign (1 --> antiparticle (%d) only): they are not compatible, returning",pdgCode)); + return 0x0; + } + else if (isSign > 2 || isSign < 0){ + AliError(Form("Sign not valid (%d, possible values are 0, 1, 2), returning")); + return 0x0; + } + + TFile* fileCuts = new TFile(cutFile); + AliRDHFCutsLctopKpi *cutsLctopKpi = (AliRDHFCutsLctopKpi*)fileCuts->Get("LctopKpiProdCuts"); + + // 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 + if(isKeepDfromBOnly) isKeepDfromB = true; + + + /* + Double_t ptmin_0_4; + Double_t ptmax_0_4; + Double_t ptmin_4_8; + Double_t ptmax_4_8; + Double_t ptmin_8_10; + Double_t ptmax_8_10; + + if(!isKeepDfromB){ + ptmin_0_4 = 0.0 ; + ptmax_0_4 = 4.0 ; + ptmin_4_8 = 4.0 ; + ptmax_4_8 = 8.0 ; + ptmin_8_10 = 8.0 ; + ptmax_8_10 = 10.0 ; + } else{ + ptmin_0_4 = 0.0 ; + ptmax_0_4 = 3.0 ; + ptmin_4_8 = 3.0 ; + ptmax_4_8 = 5.0 ; + ptmin_8_10 = 5.0 ; + ptmax_8_10 = 10.0 ; + } + */ + + //CONTAINER DEFINITION + Info("AliCFTaskVertexingHF","SETUP CONTAINER"); + //the sensitive variables, their indices + UInt_t ipt = 0; + UInt_t iy = 1; + UInt_t iphi = 2; + UInt_t icT = 3; + UInt_t ipointing = 4; + UInt_t iptpi = 5; + UInt_t iptK = 6; + UInt_t iptpi2 = 7; + UInt_t id0pi = 8; + UInt_t id0K = 9; + UInt_t id0pi2 = 10; + UInt_t iz = 11; + UInt_t icent = 12; + UInt_t ifake = 13; + + UInt_t idist12 = 14; + UInt_t idist23 = 15; + UInt_t idispVtx = 16; + UInt_t isumd02 = 17; + + const Double_t phimax = 2*TMath::Pi(); + + //Setting up the container grid... + UInt_t nstep = 10; //number of selection steps: MC with limited acceptance, MC, Acceptance, Vertex, Refit, Reco (no cuts), RecoAcceptance, RecoITSClusters (RecoAcceptance included), RecoPPR (RecoAcceptance+RecoITSCluster included), RecoPID + const Int_t nvar = 18; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle, phi +// const Int_t nbin0_0_4 = 8 ; //bins in pt from 0 to 4 GeV +// const Int_t nbin0_4_8 = 4 ; //bins in pt from 4 to 8 GeV +// const Int_t nbin0_8_10 = 1 ; //bins in pt from 8 to 10 GeV + +/* + Int_t nbin0_0_4; + Int_t nbin0_4_8; + Int_t nbin0_8_10; + if (!isKeepDfromB){ + nbin0_0_4 = 8 ; //bins in pt from 0 to 4 GeV + nbin0_4_8 = 4 ; //bins in pt from 4 to 8 GeV + nbin0_8_10 = 1 ; //bins in pt from 8 to 10 GeV + }else{ + nbin0_0_4 = 3 ; //bins in pt from 0 to 3 GeV + nbin0_4_8 = 1 ; //bins in pt from 3 to 5 GeV + nbin0_8_10 = 1 ; //bins in pt from 5 to 10 GeV + } +*/ + const Int_t nbin0 = cutsLctopKpi->GetNPtBins(); // bins in pT + printf("pT: nbin (from cuts file) = %d\n",nbin0); + const Int_t nbin1 = 42 ; //bins in y + const Int_t nbin2 = 20 ; //bins in phi + const Int_t nbin3 = 24 ; //bins in cT + const Int_t nbin4 = 1050 ; //bins in cosPointingAngle + const Int_t nbin5_0_4 = 8 ; //bins in ptPi from 0 to 4 GeV + const Int_t nbin5_4_8 = 4 ; //bins in ptPi from 4 to 8 GeV + const Int_t nbin5_8_10 = 1 ; //bins in ptPi from 8 to 10 GeV + const Int_t nbin6_0_4 = 8 ; //bins in ptKa from 0 to 4 GeV + const Int_t nbin6_4_8 = 4 ; //bins in ptKa from 4 to 8 GeV + const Int_t nbin6_8_10 = 1 ; //bins in ptKa from 8 to 10 GeV + const Int_t nbin7_0_4 = 8 ; //bins in ptpi2 from 0 to 4 GeV + const Int_t nbin7_4_8 = 4 ; //bins in ptpi2 from 4 to 8 GeV + const Int_t nbin7_8_10 = 1 ; //bins in ptpi2 from 8 to 10 GeV + const Int_t nbin8 = 100 ; //bins in d0pi + const Int_t nbin9 = 100 ; //bins in d0K + const Int_t nbin10 = 100 ; //bins in d0pi2 + const Int_t nbin11 = 60 ; //bins in z vertex + const Int_t nbin12 = 10; //bins in centrality + const Int_t nbin13 = 3; //bins in fake + + const Int_t nbin14 = 10; //bins dist12 + const Int_t nbin15 = 10; //bins dist23 + const Int_t nbin16 = 10; //bin sigmaVtx + const Int_t nbin17 = 10; //bin sumD0^2 + + + //arrays for the number of bins in each dimension + Int_t iBin[nvar]; + //iBin[0]=nbin0_0_4+nbin0_4_8+nbin0_8_10; + iBin[0]=nbin0; + iBin[1]=nbin1; + iBin[2]=nbin2; + // iBin[3]=nbin3_0_4+nbin3_4_8+nbin3_8_10; + //iBin[4]=nbin4_0_4+nbin4_4_8+nbin4_8_10; + iBin[3]=nbin3; + iBin[4]=nbin4; + iBin[5]=nbin0; + iBin[6]=nbin0; + iBin[7]=nbin0; + iBin[8]=nbin8; + iBin[9]=nbin9; + iBin[10]=nbin10; + iBin[11]=nbin11; + iBin[12]=nbin12; + + iBin[13]=nbin13; + iBin[14]=nbin14; + iBin[15]=nbin15; + iBin[16]=nbin16; + iBin[17]=nbin17; + + //arrays for lower bounds : + Double_t *binLim0=new Double_t[iBin[0]+1]; + Double_t *binLim1=new Double_t[iBin[1]+1]; + Double_t *binLim2=new Double_t[iBin[2]+1]; + Double_t *binLim3=new Double_t[iBin[3]+1]; + Double_t *binLim4=new Double_t[iBin[4]+1]; + Double_t *binLim5=new Double_t[iBin[5]+1]; + Double_t *binLim6=new Double_t[iBin[6]+1]; + Double_t *binLim7=new Double_t[iBin[7]+1]; + Double_t *binLim8=new Double_t[iBin[8]+1]; + Double_t *binLim9=new Double_t[iBin[9]+1]; + Double_t *binLim10=new Double_t[iBin[10]+1]; + Double_t *binLim11=new Double_t[iBin[11]+1]; + Double_t *binLim12=new Double_t[iBin[12]+1]; + + Double_t *binLim13=new Double_t[iBin[13]+1]; + Double_t *binLim14=new Double_t[iBin[14]+1]; + Double_t *binLim15=new Double_t[iBin[15]+1]; + Double_t *binLim16=new Double_t[iBin[16]+1]; + Double_t *binLim17=new Double_t[iBin[17]+1]; + + // checking limits + /* + if (ptmax_0_4 != ptmin_4_8) { + Error("AliCFHeavyFlavourTaskMultiVarMultiStep","max lim 1st range != min lim 2nd range, please check!"); + } + if (ptmax_4_8 != ptmin_8_10) { + Error("AliCFHeavyFlavourTaskMultiVarMultiStep","max lim 2nd range != min lim 3rd range, please check!"); + } + */ + // values for bin lower bounds + // pt + Float_t* floatbinLim0 = cutsLctopKpi->GetPtBinLimits(); + for (Int_t ibin0 = 0 ; ibin0 SetBinLimits(ipt,binLim0); + printf("y\n"); + container -> SetBinLimits(iy,binLim1); + printf("Phi\n"); + container -> SetBinLimits(iphi,binLim2); + printf("cT\n"); + container -> SetBinLimits(icT,binLim3); + printf("pointing angle\n"); + container -> SetBinLimits(ipointing,binLim4); + printf("ptpi\n"); + container -> SetBinLimits(iptpi,binLim5); + printf("ptK\n"); + container -> SetBinLimits(iptK,binLim6); + printf("ptpi2\n"); + container -> SetBinLimits(iptpi2,binLim7); + printf("d0pi\n"); + container -> SetBinLimits(id0pi,binLim8); + printf("d0K\n"); + container -> SetBinLimits(id0K,binLim9); + printf("d0pi2\n"); + container -> SetBinLimits(id0pi2,binLim10); + printf("z \n"); + container -> SetBinLimits(iz,binLim11); + printf("cent\n"); + container -> SetBinLimits(icent,binLim12); + printf("fake\n"); + container -> SetBinLimits(ifake,binLim13); + printf("dist12\n"); + container -> SetBinLimits(idist12,binLim14); + printf("dist23\n"); + container -> SetBinLimits(idist23,binLim15); + printf("dispVtx\n"); + container -> SetBinLimits(idispVtx,binLim16); + printf("sumd0^2\n"); + container -> SetBinLimits(isumd02,binLim17); + + + container -> SetStepTitle(0, "MCLimAcc"); + container -> SetStepTitle(1, "MC"); + container -> SetStepTitle(2, "MCAcc"); + container -> SetStepTitle(3, "RecoVertex"); + container -> SetStepTitle(4, "RecoRefit"); + container -> SetStepTitle(5, "Reco"); + container -> SetStepTitle(6, "RecoAcc"); + container -> SetStepTitle(7, "RecoITSCluster"); + container -> SetStepTitle(8, "RecoCuts"); + container -> SetStepTitle(9, "RecoPID"); + + container -> SetVarTitle(ipt,"pt"); + container -> SetVarTitle(iy,"y"); + container -> SetVarTitle(iphi, "phi"); + container -> SetVarTitle(icT, "ct"); + container -> SetVarTitle(ipointing, "pionting"); + container -> SetVarTitle(iptpi, "ptpi"); + container -> SetVarTitle(iptK, "ptK"); + container -> SetVarTitle(iptpi2, "ptpi2"); + container -> SetVarTitle(id0pi, "d0pi"); + container -> SetVarTitle(id0K, "d0K"); + container -> SetVarTitle(id0pi2, "d0pi2"); + container -> SetVarTitle(iz, "z"); + container -> SetVarTitle(icent, "centrality"); + container -> SetVarTitle(ifake, "fake"); + container -> SetVarTitle(idist12, "dist12toVtx"); + container -> SetVarTitle(idist23, "dist23toVtx"); + container -> SetVarTitle(idispVtx, "dispertionToSecVtx"); + container -> SetVarTitle(isumd02, "sumd0^2"); + + //CREATE THE CUTS ----------------------------------------------- + + // Gen-Level kinematic cuts + AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts"); + + //Particle-Level cuts: + AliCFParticleGenCuts* mcGenCuts = new AliCFParticleGenCuts("mcGenCuts","MC particle generation cuts"); + Bool_t useAbsolute = kTRUE; + if (isSign != 2){ + useAbsolute = kFALSE; + } + mcGenCuts->SetRequirePdgCode(pdgCode, useAbsolute); // kTRUE set in order to include antiparticle + mcGenCuts->SetAODMC(1); //special flag for reading MC in AOD tree (important) + + // Acceptance cuts: + AliCFAcceptanceCuts* accCuts = new AliCFAcceptanceCuts("accCuts", "Acceptance cuts"); + AliCFTrackKineCuts *kineAccCuts = new AliCFTrackKineCuts("kineAccCuts","Kine-Acceptance cuts"); + kineAccCuts->SetPtRange(ptmin,ptmax); + kineAccCuts->SetEtaRange(etamin,etamax); + + // Rec-Level kinematic cuts + AliCFTrackKineCuts *recKineCuts = new AliCFTrackKineCuts("recKineCuts","rec-level kine cuts"); + + AliCFTrackQualityCuts *recQualityCuts = new AliCFTrackQualityCuts("recQualityCuts","rec-level quality cuts"); + + AliCFTrackIsPrimaryCuts *recIsPrimaryCuts = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts","rec-level isPrimary cuts"); + + printf("CREATE MC KINE CUTS\n"); + TObjArray* mcList = new TObjArray(0) ; + mcList->AddLast(mcKineCuts); + mcList->AddLast(mcGenCuts); + + printf("CREATE ACCEPTANCE CUTS\n"); + TObjArray* accList = new TObjArray(0) ; + accList->AddLast(kineAccCuts); + + printf("CREATE RECONSTRUCTION CUTS\n"); + TObjArray* recList = new TObjArray(0) ; // not used!! + recList->AddLast(recKineCuts); + recList->AddLast(recQualityCuts); + recList->AddLast(recIsPrimaryCuts); + + TObjArray* emptyList = new TObjArray(0); + + //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK + printf("CREATE INTERFACE AND CUTS\n"); + AliCFManager* man = new AliCFManager() ; + man->SetParticleContainer(container); + man->SetParticleCutsList(0 , mcList); // MC, Limited Acceptance + man->SetParticleCutsList(1 , mcList); // MC + man->SetParticleCutsList(2 , accList); // Acceptance + man->SetParticleCutsList(3 , emptyList); // Vertex + man->SetParticleCutsList(4 , emptyList); // Refit + man->SetParticleCutsList(5 , emptyList); // AOD + man->SetParticleCutsList(6 , emptyList); // AOD in Acceptance + man->SetParticleCutsList(7 , emptyList); // AOD with required n. of ITS clusters + man->SetParticleCutsList(8 , emptyList); // AOD Reco (PPR cuts implemented in Task) + man->SetParticleCutsList(9 , emptyList); // AOD Reco PID + + // Get the pointer to the existing analysis manager via the static access method. + //============================================================================== + AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); + if (!mgr) { + ::Error("AddTaskCompareHF", "No analysis manager to connect to."); + return NULL; + } + //CREATE THE TASK + printf("CREATE TASK\n"); + + // create the task + AliCFTaskVertexingHF *task = new AliCFTaskVertexingHF("AliCFTaskVertexingHF",cutsLctopKpi); + task->SetFillFromGenerated(kFALSE); + task->SetDecayChannel(32); + task->SetUseWeight(kFALSE); + task->SetCFManager(man); //here is set the CF manager + task->SetSign(isSign); + task->SetCentralitySelection(kTRUE); + task->SetRejectCandidateIfNotFromQuark(kTRUE); // put to false if you want to keep HIJING D0!! + task->SetUseMCVertex(kFALSE); // put to true if you want to do studies on pp + + if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2); + if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1); + + Printf("***************** CONTAINER SETTINGS *****************"); + Printf("decay channel = %d",(Int_t)task->GetDecayChannel()); + Printf("FillFromGenerated = %d",(Int_t)task->GetFillFromGenerated()); + Printf("Dselection = %d",(Int_t)task->GetDselection()); + Printf("UseWeight = %d",(Int_t)task->GetUseWeight()); + Printf("Sign = %d",(Int_t)task->GetSign()); + Printf("Centrality selection = %d",(Int_t)task->GetCentralitySelection()); + Printf("Fake selection = %d",(Int_t)task->GetFakeSelection()); + Printf("RejectCandidateIfNotFromQuark selection = %d",(Int_t)task->GetRejectCandidateIfNotFromQuark()); + Printf("UseMCVertex selection = %d",(Int_t)task->GetUseMCVertex()); + Printf("***************END CONTAINER SETTINGS *****************\n"); + + //-----------------------------------------------------------// + // create correlation matrix for unfolding - only eta-pt // + //-----------------------------------------------------------// + + Bool_t AcceptanceUnf = kTRUE; // unfold at acceptance level, otherwise PPR + + Int_t thnDim[4]; + + //first half : reconstructed + //second half : MC + + thnDim[0] = iBin[0]; + thnDim[2] = iBin[0]; + thnDim[1] = iBin[1]; + thnDim[3] = iBin[1]; + + TString nameCorr=""; + if(!isKeepDfromB) { + nameCorr="CFHFcorr0_3Prong_CommonFramework"; + } + else if(isKeepDfromBOnly){ + nameCorr= "CFHFcorr0KeepDfromBOnly_3Prong_CommonFramework"; + } + else { + nameCorr="CFHFcorr0allD_3Prong_CommonFramework"; + } + + THnSparseD* correlation = new THnSparseD(nameCorr,"THnSparse with correlations",4,thnDim); + Double_t** binEdges = new Double_t[2]; + + // set bin limits + + binEdges[0]= binLim0; + binEdges[1]= binLim1; + + correlation->SetBinEdges(0,binEdges[0]); + correlation->SetBinEdges(2,binEdges[0]); + + correlation->SetBinEdges(1,binEdges[1]); + correlation->SetBinEdges(3,binEdges[1]); + + correlation->Sumw2(); + + // correlation matrix ready + //------------------------------------------------// + + task->SetCorrelationMatrix(correlation); // correlation matrix for unfolding + + // Create and connect containers for input/output + + // ------ input data ------ + AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); + + // ----- output data ----- + + TString outputfile = AliAnalysisManager::GetCommonFileName(); + TString output1name="", output2name="", output3name="", output4name="";; + output2name=nameContainer; + output3name=nameCorr; + if(!isKeepDfromB) { + outputfile += ":PWG3_D2H_CFtaskLctopKpi_CommonFramework"; + output1name="CFHFchist0_3Prong_CommonFramework"; + } + else if(isKeepDfromBOnly){ + outputfile += ":PWG3_D2H_CFtaskLctopKpiKeepDfromBOnly_CommonFramework"; + output1name="CFHFchist0DfromB_3Prong_CommonFramework"; + } + else{ + outputfile += ":PWG3_D2H_CFtaskLctopKpiKeepDfromB_CommonFramework"; + output1name="CFHFchist0allD_3Prong_CommonFramework"; + } + + output4name= "Cuts_3Prong_CommonFramework"; + + //now comes user's output objects : + // output TH1I for event counting + AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(output1name, TH1I::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); + // output Correction Framework Container (for acceptance & efficiency calculations) + AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(output2name, AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); + // Unfolding - correlation matrix + AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(output3name, THnSparseD::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); + AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(output4name, AliRDHFCuts::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); + + mgr->AddTask(task); + + mgr->ConnectInput(task,0,mgr->GetCommonInputContainer()); + mgr->ConnectOutput(task,1,coutput1); + mgr->ConnectOutput(task,2,coutput2); + mgr->ConnectOutput(task,3,coutput3); + mgr->ConnectOutput(task,4,coutput4); + + return task; +} + -- 2.39.3