From b7af2639aba365ff2a8666e673e96c23b4a4dfcf Mon Sep 17 00:00:00 2001 From: dainese Date: Mon, 21 Feb 2011 10:10:58 +0000 Subject: [PATCH] Added centrality treatment and ignoring fake status of daughter tracks (Davide) --- PWG3/vertexingHF/AliCFTaskVertexingHF.cxx | 79 +++++++++++-------- PWG3/vertexingHF/AliCFTaskVertexingHF.h | 6 +- PWG3/vertexingHF/AliCFVertexingHF.cxx | 58 +++++++------- PWG3/vertexingHF/AliCFVertexingHF.h | 6 +- PWG3/vertexingHF/AliCFVertexingHF2Prong.cxx | 4 + PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx | 9 ++- PWG3/vertexingHF/AliCFVertexingHFCascade.cxx | 22 +----- .../vertexingHF/macros/AddTaskCFVertexingHF.C | 23 +++++- .../macros/AddTaskCFVertexingHF3Prong.C | 22 +++++- 9 files changed, 139 insertions(+), 90 deletions(-) diff --git a/PWG3/vertexingHF/AliCFTaskVertexingHF.cxx b/PWG3/vertexingHF/AliCFTaskVertexingHF.cxx index c2e5e48bb72..51e2fbb93e3 100644 --- a/PWG3/vertexingHF/AliCFTaskVertexingHF.cxx +++ b/PWG3/vertexingHF/AliCFTaskVertexingHF.cxx @@ -97,7 +97,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF() : fNvar(0), fPartName(""), fDauNames(""), - fSign(2) + fSign(2), + fCentralitySelection(kTRUE) { // //Default ctor @@ -129,7 +130,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts fNvar(0), fPartName(""), fDauNames(""), - fSign(2) + fSign(2), + fCentralitySelection(kTRUE) { // // Constructor. Initialization of Inputs and Outputs @@ -187,7 +189,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c) : fNvar(c.fNvar), fPartName(c.fPartName), fDauNames(c.fDauNames), - fSign(c.fSign) + fSign(c.fSign), + fCentralitySelection(c.fCentralitySelection) { // // Copy Constructor @@ -223,42 +226,42 @@ void AliCFTaskVertexingHF::Init() switch (fDecayChannel){ case 2:{ copyfCuts = new AliRDHFCutsD0toKpi(*(dynamic_cast(fCuts))); - fNvar = 13; + fNvar = 14; fPartName="D0"; fDauNames="K+pi"; break; } case 21:{ copyfCuts = new AliRDHFCutsDStartoKpipi(*(dynamic_cast(fCuts))); - fNvar = 13; + fNvar = 14; fPartName="Dstar"; fDauNames="K+pi+pi"; break; } case 31:{ copyfCuts = new AliRDHFCutsDplustoKpipi(*(dynamic_cast(fCuts))); - fNvar = 12; + fNvar = 13; fPartName="Dplus"; fDauNames="K+pi+pi"; break; } case 32:{ copyfCuts = new AliRDHFCutsLctopKpi(*(dynamic_cast(fCuts))); - fNvar = 12; + fNvar = 13; fPartName="Lambdac"; fDauNames="p+K+pi"; break; } case 33:{ copyfCuts = new AliRDHFCutsDstoKKpi(*(dynamic_cast(fCuts))); - fNvar = 12; + fNvar = 13; fPartName="Ds"; fDauNames="K+K+pi"; break; } case 4:{ copyfCuts = new AliRDHFCutsD0toKpipipi(*(dynamic_cast(fCuts))); - fNvar = 13; + fNvar = 14; fPartName="D0"; fDauNames="K+pi+pi+pi"; break; @@ -293,6 +296,7 @@ void AliCFTaskVertexingHF::UserExec(Option_t *) PostData(2,fCFManager->GetParticleContainer()) ; PostData(3,fCorrelation) ; + AliESDtrackCuts* trackCuts = fCuts->GetTrackCuts(); if (fFillFromGenerated){ @@ -449,32 +453,39 @@ void AliCFTaskVertexingHF::UserExec(Option_t *) cfVtxHF->SetRecoPrimVertex(zPrimVertex); cfVtxHF->SetMCPrimaryVertex(zMCVertex); cfVtxHF->SetFillFromGenerated(fFillFromGenerated); + cfVtxHF->SetNVar(fNvar); + + if (fCentralitySelection) + if(fCuts->IsEventSelectedInCentrality(aodEvent)!=0) return; + + Float_t centValue = fCuts->GetCentrality(aodEvent); + cfVtxHF->SetCentralityValue(centValue); for (Int_t iPart=0; iPartGetEntriesFast(); iPart++) { - - AliAODMCParticle* mcPart = dynamic_cast(mcArray->At(iPart)); - if (!mcPart){ - AliError("Failed casting particle from MC array!, Skipping particle"); - continue; - } - // check the MC-level cuts, must be the desidered particle - if (!fCFManager->CheckParticleCuts(0, mcPart)) continue; // 0 stands for MC level - - cfVtxHF->SetMCCandidateParam(iPart); - cfVtxHF->SetNVar(fNvar); - //counting c quarks - cquarks += cfVtxHF->MCcquarkCounting(mcPart); - - if (!(cfVtxHF->SetLabelArray())){ - AliDebug(2,Form("Impossible to set the label array (decaychannel = %d)",fDecayChannel)); - continue; - } - - //check the candiate family at MC level - if (!(cfVtxHF->CheckMCPartFamily(mcPart, mcArray))) { - AliDebug(2,Form("Check on the family wrong!!! (decaychannel = %d)",fDecayChannel)); - continue; - } + AliAODMCParticle* mcPart = dynamic_cast(mcArray->At(iPart)); + if (!mcPart){ + AliError("Failed casting particle from MC array!, Skipping particle"); + continue; + } + // check the MC-level cuts, must be the desidered particle + if (!fCFManager->CheckParticleCuts(0, mcPart)) { + continue; // 0 stands for MC level + } + cfVtxHF->SetMCCandidateParam(iPart); + + //counting c quarks + cquarks += cfVtxHF->MCcquarkCounting(mcPart); + + if (!(cfVtxHF->SetLabelArray())){ + AliDebug(2,Form("Impossible to set the label array (decaychannel = %d)",fDecayChannel)); + continue; + } + + //check the candiate family at MC level + if (!(cfVtxHF->CheckMCPartFamily(mcPart, mcArray))) { + AliDebug(2,Form("Check on the family wrong!!! (decaychannel = %d)",fDecayChannel)); + continue; + } else{ AliDebug(2,Form("Check on the family OK!!! (decaychannel = %d)",fDecayChannel)); } @@ -517,6 +528,8 @@ void AliCFTaskVertexingHF::UserExec(Option_t *) fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepRefit, fWeight); AliDebug(3,"MC Refit cut passed and container filled\n"); icountRefit++; + + } else{ AliDebug(3,"MC Refit cut not passed\n"); diff --git a/PWG3/vertexingHF/AliCFTaskVertexingHF.h b/PWG3/vertexingHF/AliCFTaskVertexingHF.h index 424cc5220dd..0d2b78fde82 100644 --- a/PWG3/vertexingHF/AliCFTaskVertexingHF.h +++ b/PWG3/vertexingHF/AliCFTaskVertexingHF.h @@ -94,6 +94,8 @@ public: void SetSign(Char_t isSign) {fSign = isSign;} Char_t GetSign() {return fSign;} + void SetCentralitySelection(Bool_t centSelec = kTRUE) {fCentralitySelection = centSelec;} Bool_t GetCentralitySelection() {return fCentralitySelection;} + protected: AliCFManager *fCFManager; // pointer to the CF manager TH1I *fHistEventsProcessed; //! simple histo for monitoring the number of events processed @@ -119,8 +121,10 @@ protected: TString fPartName; // D meson name TString fDauNames; // daughter in fin state Char_t fSign; // flag to decide wheter to keep D0 only (0), D0bar only (1), or both D0 and D0bar (2) + Bool_t fCentralitySelection; //flag to switch off the centrality selection + - ClassDef(AliCFTaskVertexingHF,4); // class for HF corrections as a function of many variables + ClassDef(AliCFTaskVertexingHF,5); // class for HF corrections as a function of many variables }; #endif diff --git a/PWG3/vertexingHF/AliCFVertexingHF.cxx b/PWG3/vertexingHF/AliCFVertexingHF.cxx index 3c88fae77b7..3d7f5b1279f 100644 --- a/PWG3/vertexingHF/AliCFVertexingHF.cxx +++ b/PWG3/vertexingHF/AliCFVertexingHF.cxx @@ -50,7 +50,8 @@ AliCFVertexingHF::AliCFVertexingHF() : fKeepDfromBOnly(kFALSE), fmcLabel(0), fProngs(-1), - fLabelArray(0x0) + fLabelArray(0x0), + fCentValue(0.) { // // constructor @@ -77,7 +78,8 @@ AliCFVertexingHF::AliCFVertexingHF(TClonesArray *mcArray, UShort_t originDselect fKeepDfromBOnly(kFALSE), fmcLabel(0), fProngs(-1), - fLabelArray(0x0) + fLabelArray(0x0), + fCentValue(0.) { // // constructor with mcArray @@ -98,8 +100,8 @@ AliCFVertexingHF::~AliCFVertexingHF() if (fRecoCandidate) fRecoCandidate = 0x0; if (fmcPartCandidate) fmcPartCandidate = 0x0; if (fLabelArray){ - delete [] fLabelArray; - fLabelArray = 0x0; + delete [] fLabelArray; + fLabelArray = 0x0; } } @@ -125,6 +127,7 @@ AliCFVertexingHF& AliCFVertexingHF::operator=(const AliCFVertexingHF& c) fKeepDfromBOnly = c.fKeepDfromBOnly; fmcLabel = c.fmcLabel; fProngs=c.fProngs; + fCentValue=c.fCentValue; if (fProngs > 0){ fLabelArray = new Int_t[fProngs]; for(Int_t iP=0; iPGetStatus()&AliESDtrack::kITSpureSA) continue; Bool_t foundTrack = kFALSE; for (Int_t ilabel = 0; ilabelGetLabel() = %d",ilabel,fLabelArray[ilabel],track->GetLabel())); - if (track->GetLabel() == temp[ilabel]) { - foundTrack = kTRUE; - temp[ilabel] = 0; - break; - } + AliDebug(3,Form("fLabelArray[%d] = %d, track->GetLabel() = %d",ilabel,fLabelArray[ilabel],TMath::Abs(track->GetLabel()))); + if (TMath::Abs(track->GetLabel()) == temp[ilabel]) { + foundTrack = kTRUE; + temp[ilabel] = 0; + break; + } } if (foundTrack){ - foundDaughters++; - AliDebug(4,Form("daughter %d \n",foundDaughters)); - if(trackCuts->GetRequireTPCRefit()){ - if(track->GetStatus()&AliESDtrack::kTPCrefit) { - bRefitStep = kTRUE; - } + foundDaughters++; + AliDebug(4,Form("daughter %d \n",foundDaughters)); + if(trackCuts->GetRequireTPCRefit()){ + if(track->GetStatus()&AliESDtrack::kTPCrefit) { + bRefitStep = kTRUE; + } else { AliDebug(3, "Refit cut not passed , missing TPC refit\n"); delete [] temp; @@ -701,8 +705,8 @@ Bool_t AliCFVertexingHF::SetLabelArray() } else{ AliError("Failed casting the daughter particle, returning a NULL label array"); - delete [] fLabelArray; - fLabelArray = 0x0; + //delete [] fLabelArray; + //fLabelArray = 0x0; return bLabelArray; } } @@ -723,8 +727,8 @@ Bool_t AliCFVertexingHF::SetLabelArray() } else{ AliError("Error while casting particle! returning a NULL array"); - delete [] fLabelArray; - fLabelArray = 0x0; + //delete [] fLabelArray; + //fLabelArray = 0x0; return bLabelArray; } } @@ -745,8 +749,8 @@ Bool_t AliCFVertexingHF::SetLabelArray() } else{ AliError("Error while casting resonant daughter! returning a NULL array"); - delete [] fLabelArray; - fLabelArray = 0x0; + //delete [] fLabelArray; + //fLabelArray = 0x0; return bLabelArray; } } diff --git a/PWG3/vertexingHF/AliCFVertexingHF.h b/PWG3/vertexingHF/AliCFVertexingHF.h index d1fb0a2fdd9..06653f82a5c 100644 --- a/PWG3/vertexingHF/AliCFVertexingHF.h +++ b/PWG3/vertexingHF/AliCFVertexingHF.h @@ -98,6 +98,8 @@ class AliCFVertexingHF : public TObject { Int_t CheckReflexion(Char_t isSign); Bool_t SetLabelArray(); + void SetCentralityValue(Float_t centValue) {fCentValue = centValue;} + protected: TClonesArray *fmcArray; //mcArray candidate @@ -117,7 +119,9 @@ class AliCFVertexingHF : public TObject { Int_t fProngs; // n. of prongs Int_t* fLabelArray; //[fProngs] array of labels - ClassDef(AliCFVertexingHF, 2); + Float_t fCentValue; // centrality value + + ClassDef(AliCFVertexingHF, 3); }; diff --git a/PWG3/vertexingHF/AliCFVertexingHF2Prong.cxx b/PWG3/vertexingHF/AliCFVertexingHF2Prong.cxx index b43338a49e8..084d3f6e3ee 100644 --- a/PWG3/vertexingHF/AliCFVertexingHF2Prong.cxx +++ b/PWG3/vertexingHF/AliCFVertexingHF2Prong.cxx @@ -190,6 +190,8 @@ Bool_t AliCFVertexingHF2Prong::GetGeneratedValuesFromMCParticle(Double_t* vector vectorMC[10] = 1.01; // dummy value, meaningless in MC vectorMC[11] = fmcPartCandidate->Phi(); vectorMC[12] = fzMCVertex; // z of reconstructed of primary vertex + vectorMC[13] = fCentValue; //reconstructed centrality + delete decay; bGenValues = kTRUE; return bGenValues; @@ -254,6 +256,8 @@ Bool_t AliCFVertexingHF2Prong::GetRecoValuesFromCandidate(Double_t *vectorReco) vectorReco[10] = cosPointingAngle; // in micron vectorReco[11] = phi; vectorReco[12] = fzPrimVertex; // z of reconstructed of primary vertex + vectorReco[13] = fCentValue; //reconstructed centrality + bFillRecoValues = kTRUE; return bFillRecoValues; diff --git a/PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx b/PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx index 58b841be433..6db60acafe6 100644 --- a/PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx +++ b/PWG3/vertexingHF/AliCFVertexingHF3Prong.cxx @@ -130,6 +130,7 @@ Bool_t AliCFVertexingHF3Prong::GetGeneratedValuesFromMCParticle(Double_t* vector // d0_2 // d0_3 // zPrimVert + // centrality Bool_t bGenValues = kFALSE; @@ -273,6 +274,8 @@ Bool_t AliCFVertexingHF3Prong::GetGeneratedValuesFromMCParticle(Double_t* vector vectorMC[9] = 0.; // imppar1, dummy value, meaningless in MC, in micron vectorMC[10] = 0.; // imppar2, dummy value, meaningless in MC, in micron vectorMC[11] = fzMCVertex; // z of reconstructed of primary vertex + vectorMC[12] = fCentValue; // reconstructed centrality value + bGenValues = kTRUE; return bGenValues; @@ -312,7 +315,7 @@ Bool_t AliCFVertexingHF3Prong::GetRecoValuesFromCandidate(Double_t *vectorReco) Int_t nDauOS=0; for(Int_t iDau=0; iDau<3; iDau++){ AliAODTrack *trk = (AliAODTrack*)decay3->GetDaughter(iDau); - Int_t label = trk->GetLabel(); + Int_t label = TMath::Abs(trk->GetLabel()); Short_t chargedau=trk->Charge(); if(chargedau==charge){ daughtSorted[tmpIndex]=label; @@ -348,7 +351,9 @@ Bool_t AliCFVertexingHF3Prong::GetRecoValuesFromCandidate(Double_t *vectorReco) vectorReco[9] = decay3->Getd0Prong(daughtSorted[1]); vectorReco[10] = decay3->Getd0Prong(daughtSorted[2]); vectorReco[11] = fzPrimVertex; // z of reconstructed of primary vertex - + vectorReco[12] = fCentValue; //reconstructed centrality value + + bFillRecoValues = kTRUE; return bFillRecoValues; } diff --git a/PWG3/vertexingHF/AliCFVertexingHFCascade.cxx b/PWG3/vertexingHF/AliCFVertexingHFCascade.cxx index 39127170f21..ed12506c5a7 100644 --- a/PWG3/vertexingHF/AliCFVertexingHFCascade.cxx +++ b/PWG3/vertexingHF/AliCFVertexingHFCascade.cxx @@ -115,15 +115,6 @@ Bool_t AliCFVertexingHFCascade::GetGeneratedValuesFromMCParticle(Double_t* vecto //the D0 AliAODMCParticle* mcPartDaughterD0 = dynamic_cast(fmcArray->At(daughter0ds)); AliAODMCParticle* mcPartDaughterPis = dynamic_cast(fmcArray->At(daughter1ds)); - if (!mcPartDaughterD0 || !mcPartDaughterPis){ - if (!mcPartDaughterD0){ - AliError("Error while casting the MC D0, returning FALSE"); - } - if (!mcPartDaughterD0){ - AliError("Error while casting the MC soft pion, returning FALSE"); - } - return bGenValues; - } Double_t vtx1[3] = {0,0,0}; // primary vertex Double_t vtx2daughter0[3] = {0,0,0}; // secondary vertex from daughter 0 @@ -137,16 +128,6 @@ Bool_t AliCFVertexingHFCascade::GetGeneratedValuesFromMCParticle(Double_t* vecto AliAODMCParticle* mcPartDaughter0 = dynamic_cast(fmcArray->At(daughter0)); //D0 AliAODMCParticle* mcPartDaughter1 = dynamic_cast(fmcArray->At(daughter1)); //pis - if (!mcPartDaughter0 || !mcPartDaughter1){ - if (!mcPartDaughter0){ - AliError("Error while casting the MC daughter 0, returning FALSE"); - } - if (!mcPartDaughter1){ - AliError("Error while casting the MC daughter 1, returning FALSE"); - } - return bGenValues; - } - // getting vertex from daughters mcPartDaughter0->XvYvZv(vtx2daughter0); // cm mcPartDaughter1->XvYvZv(vtx2daughter1); //cm @@ -229,7 +210,7 @@ Bool_t AliCFVertexingHFCascade::GetGeneratedValuesFromMCParticle(Double_t* vecto vectorMC[10] = 1.01; // dummy value, meaningless in MC vectorMC[11] = fmcPartCandidate->Phi(); vectorMC[12] = fzMCVertex; // z of reconstructed of primary vertex - + vectorMC[13] = fCentValue; // reconstructed centrality delete decay; bGenValues = kTRUE; @@ -297,6 +278,7 @@ Bool_t AliCFVertexingHFCascade::GetRecoValuesFromCandidate(Double_t *vectorReco) vectorReco[10] = cosPointingAngle; // in micron vectorReco[11] = phi; vectorReco[12] = fzPrimVertex; // z of reconstructed of primary vertex + vectorReco[13] = fCentValue; bFillRecoValues = kTRUE; diff --git a/PWG3/vertexingHF/macros/AddTaskCFVertexingHF.C b/PWG3/vertexingHF/macros/AddTaskCFVertexingHF.C index 673d3b766b3..d24caea067e 100644 --- a/PWG3/vertexingHF/macros/AddTaskCFVertexingHF.C +++ b/PWG3/vertexingHF/macros/AddTaskCFVertexingHF.C @@ -25,6 +25,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.; + //---------------------------------------------------- AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.root",Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 421, Char_t isSign = 2) @@ -50,7 +53,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. } TFile* fileCuts = new TFile(cutFile); - AliRDHFCutsD0toKpi *cutsD0toKpi = (AliRDHFCutsD0toKpi*)fileCuts->Get("D0toKpiCutsStandard"); + AliRDHFCutsD0toKpi *cutsD0toKpi = (AliRDHFCutsD0toKpi*)fileCuts->Get("D0toKpiCuts"); // 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 @@ -90,12 +93,13 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. UInt_t ipointing = 10; UInt_t iphi = 11; UInt_t iz = 12; + UInt_t icent = 13; 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 = 13 ; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle, phi + const Int_t nvar = 14 ; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle, phi //Setting the bins: pt, ptPi, and ptK are considered seprately because for them you can either define the binning by hand, or using the cuts file @@ -197,6 +201,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. const Int_t nbin10 = 1050 ; //bins in cosPointingAngle const Int_t nbin11 = 20 ; //bins in Phi const Int_t nbin12 = 60 ; //bins in z vertex + const Int_t nbin13 = 10; //bins in centrality iBin[1]=nbin1; iBin[2]=nbin2; @@ -208,6 +213,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. iBin[10]=nbin10; iBin[11]=nbin11; iBin[12]=nbin12; + iBin[13]=nbin13; //arrays for lower bounds : Double_t *binLim1=new Double_t[iBin[1]+1]; @@ -220,6 +226,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. 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]; // y for(Int_t i=0; i<=nbin1; i++) binLim1[i]=(Double_t)ymin + (ymax-ymin) /nbin1*(Double_t)i ; @@ -253,6 +260,10 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. binLim12[i]=(Double_t)zmin + (zmax-zmin) /nbin12*(Double_t)i ; } + for(Int_t i=0; i<=nbin13; i++) { + binLim13[i]=(Double_t)centmin + (centmax-centmin)/nbin13 * (Double_t)i; + } + //one "container" for MC TString nameContainer=""; if(!isKeepDfromB) { @@ -293,6 +304,8 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. container -> SetBinLimits(iphi,binLim11); printf("z\n"); container -> SetBinLimits(iz,binLim12); + printf("cent\n"); + container -> SetBinLimits(icent,binLim13); container -> SetStepTitle(0, "MCLimAcc"); container -> SetStepTitle(1, "MC"); @@ -303,7 +316,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. container -> SetStepTitle(6, "RecoAcc"); container -> SetStepTitle(7, "RecoITSCluster"); container -> SetStepTitle(8, "RecoCuts"); - container -> SetStepTitle(8, "RecoPID"); + container -> SetStepTitle(9, "RecoPID"); container -> SetVarTitle(ipt,"pt"); container -> SetVarTitle(iy,"y"); @@ -318,6 +331,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. container -> SetVarTitle(ipointing, "piointing"); container -> SetVarTitle(iphi, "phi"); container -> SetVarTitle(iz, "z"); + container -> SetVarTitle(icent, "centrality"); //CREATE THE CUTS ----------------------------------------------- @@ -396,6 +410,8 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. task->SetDecayChannel(2); task->SetUseWeight(kFALSE); task->SetSign(isSign); + task->SetCentralitySelection(kTRUE); + if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2); if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1); @@ -405,6 +421,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts. 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("***************END CONTAINER SETTINGS *****************\n"); //-----------------------------------------------------------// diff --git a/PWG3/vertexingHF/macros/AddTaskCFVertexingHF3Prong.C b/PWG3/vertexingHF/macros/AddTaskCFVertexingHF3Prong.C index cb93a0d8d23..53a0df850c6 100644 --- a/PWG3/vertexingHF/macros/AddTaskCFVertexingHF3Prong.C +++ b/PWG3/vertexingHF/macros/AddTaskCFVertexingHF3Prong.C @@ -32,6 +32,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.; + //---------------------------------------------------- AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./DplustoKpipiCuts.root",Bool_t isKeepDfromB=kFALSE, Bool_t isKeepDfromBOnly=kFALSE, Int_t pdgCode = 411, Char_t isSign = 2) @@ -104,12 +107,13 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust UInt_t id0K = 9; UInt_t id0pi2 = 10; UInt_t iz = 11; + UInt_t icent = 12; 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 = 12 ; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle, phi + const Int_t nvar = 13 ; //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 @@ -147,6 +151,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust 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 //arrays for the number of bins in each dimension Int_t iBin[nvar]; @@ -165,6 +170,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust iBin[9]=nbin9; iBin[10]=nbin10; iBin[11]=nbin11; + iBin[12]=nbin12; //arrays for lower bounds : @@ -180,7 +186,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust 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]; // checking limits /* @@ -275,6 +281,11 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust // Info("AliCFHeavyFlavourTaskMultiVarMultiStep",Form("i-th bin, lower limit = %f", binLim12[i])); } + for(Int_t i=0; i<=nbin12; i++) { + binLim12[i]=(Double_t)centmin + (centmax-centmin)/nbin12 * (Double_t)i; + } + + // debugging printings //Info("AliCFHeavyFlavourTaskMultiVarMultiStep","Printing lower limits for bins in pt"); //for (Int_t i =0; i<= iBin[0]; i++){ @@ -327,6 +338,8 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust container -> SetBinLimits(id0pi2,binLim10); printf("z \n"); container -> SetBinLimits(iz,binLim11); + printf("cent\n"); + container -> SetBinLimits(icent,binLim12); container -> SetStepTitle(0, "MCLimAcc"); @@ -352,6 +365,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust container -> SetVarTitle(id0K, "d0K"); container -> SetVarTitle(id0pi2, "d0pi2"); container -> SetVarTitle(iz, "z"); + container -> SetVarTitle(icent, "centrality"); //CREATE THE CUTS ----------------------------------------------- @@ -430,6 +444,8 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust task->SetUseWeight(kFALSE); task->SetCFManager(man); //here is set the CF manager task->SetSign(isSign); + task->SetCentralitySelection(kTRUE); + if (isKeepDfromB && !isKeepDfromBOnly) task->SetDselection(2); if (isKeepDfromB && isKeepDfromBOnly) task->SetDselection(1); @@ -439,7 +455,7 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF3Prong(const char* cutFile = "./Dplust 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()); //-----------------------------------------------------------// // create correlation matrix for unfolding - only eta-pt // //-----------------------------------------------------------// -- 2.39.3