1 /**************************************************************************
2 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //-----------------------------------------------------------------------
17 // Class for HF corrections as a function of many variables
18 // 6 Steps introduced: MC, MC Acc, Reco, Reco Acc, Reco Acc + ITS Cl,
19 // Reco Acc + ITS Cl + PPR cuts
20 // 12 variables used: pt, y, cosThetaStar, ptPi, ptK, ct,
21 // dca, d0Pi, d0K, d0Pixd0K, cosPointingAngle, phi
23 //-----------------------------------------------------------------------
24 // Author : C. Zampolli, CERN
25 // D. Caffarri, Univ & INFN Padova caffarri@pd.infn.it
26 //-----------------------------------------------------------------------
27 //-----------------------------------------------------------------------
28 // Base class for HF Unfolding (pt and eta)
29 // correlation matrix filled at Acceptance and PPR level
30 // Author: A.Grelli , Utrecht - agrelli@uu.nl
31 //-----------------------------------------------------------------------
33 #include <TParticle.h>
34 #include <TDatabasePDG.h>
40 #include "AliCFTaskVertexingHF.h"
42 #include "AliMCEvent.h"
43 #include "AliCFManager.h"
44 #include "AliCFContainer.h"
46 #include "AliInputEventHandler.h"
47 #include "AliAnalysisManager.h"
48 #include "AliAODHandler.h"
49 #include "AliAODEvent.h"
50 #include "AliAODRecoDecay.h"
51 #include "AliAODRecoDecayHF.h"
52 #include "AliAODRecoDecayHF2Prong.h"
53 #include "AliAODRecoDecayHF3Prong.h"
54 #include "AliAODRecoDecayHF4Prong.h"
55 #include "AliAODRecoCascadeHF.h"
56 #include "AliAODMCParticle.h"
57 #include "AliAODMCHeader.h"
58 #include "AliESDtrack.h"
60 #include "THnSparse.h"
62 #include "AliESDtrackCuts.h"
63 #include "AliRDHFCuts.h"
64 #include "AliRDHFCutsD0toKpi.h"
65 #include "AliRDHFCutsDplustoKpipi.h"
66 #include "AliRDHFCutsDStartoKpipi.h"
67 #include "AliRDHFCutsDstoKKpi.h"
68 #include "AliRDHFCutsLctopKpi.h"
69 #include "AliRDHFCutsD0toKpipipi.h"
70 #include "AliRDHFCutsLctoV0.h"
71 #include "AliCFVertexingHF2Prong.h"
72 #include "AliCFVertexingHF3Prong.h"
73 #include "AliCFVertexingHFCascade.h"
74 #include "AliCFVertexingHFLctoV0bachelor.h"
75 #include "AliCFVertexingHF.h"
76 #include "AliVertexingHFUtils.h"
77 #include "AliAnalysisDataSlot.h"
78 #include "AliAnalysisDataContainer.h"
79 #include "AliPIDResponse.h"
81 //__________________________________________________________________________
82 AliCFTaskVertexingHF::AliCFTaskVertexingHF() :
85 fHistEventsProcessed(0x0),
93 fCountRecoITSClusters(0),
98 fFillFromGenerated(kFALSE),
100 fAcceptanceUnf(kTRUE),
104 fUseFlatPtWeight(kFALSE),
106 fUseNchWeight(kFALSE),
111 fCentralitySelection(kTRUE),
113 fRejectIfNoQuark(kTRUE),
114 fUseMCVertex(kFALSE),
117 fConfiguration(kCheetah), // by default, setting the fast configuration
122 fLctoV0bachelorOption(1),
123 fGenLctoV0bachelorOption(0),
124 fUseSelectionBit(kTRUE),
131 //___________________________________________________________________________
132 AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts, TF1* func) :
133 AliAnalysisTaskSE(name),
135 fHistEventsProcessed(0x0),
143 fCountRecoITSClusters(0),
148 fFillFromGenerated(kFALSE),
149 fOriginDselection(0),
150 fAcceptanceUnf(kTRUE),
154 fUseFlatPtWeight(kFALSE),
156 fUseNchWeight(kFALSE),
161 fCentralitySelection(kTRUE),
163 fRejectIfNoQuark(kTRUE),
164 fUseMCVertex(kFALSE),
167 fConfiguration(kCheetah), // by default, setting the fast configuration
172 fLctoV0bachelorOption(1),
173 fGenLctoV0bachelorOption(0),
174 fUseSelectionBit(kTRUE),
178 // Constructor. Initialization of Inputs and Outputs
181 DefineInput(0) and DefineOutput(0)
182 are taken care of by AliAnalysisTaskSE constructor
184 DefineOutput(1,TH1I::Class());
185 DefineOutput(2,AliCFContainer::Class());
186 DefineOutput(3,THnSparseD::Class());
187 DefineOutput(4,AliRDHFCuts::Class());
192 //___________________________________________________________________________
193 AliCFTaskVertexingHF& AliCFTaskVertexingHF::operator=(const AliCFTaskVertexingHF& c)
196 // Assignment operator
199 AliAnalysisTaskSE::operator=(c) ;
200 fCFManager = c.fCFManager;
201 fHistEventsProcessed = c.fHistEventsProcessed;
203 fFuncWeight = c.fFuncWeight;
204 fHistoMeasNch = c.fHistoMeasNch;
205 fHistoMCNch = c.fHistoMCNch;
210 //___________________________________________________________________________
211 AliCFTaskVertexingHF::AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c) :
212 AliAnalysisTaskSE(c),
213 fCFManager(c.fCFManager),
214 fHistEventsProcessed(c.fHistEventsProcessed),
215 fCorrelation(c.fCorrelation),
216 fCountMC(c.fCountMC),
217 fCountAcc(c.fCountAcc),
218 fCountVertex(c.fCountVertex),
219 fCountRefit(c.fCountRefit),
220 fCountReco(c.fCountReco),
221 fCountRecoAcc(c.fCountRecoAcc),
222 fCountRecoITSClusters(c.fCountRecoITSClusters),
223 fCountRecoPPR(c.fCountRecoPPR),
224 fCountRecoPID(c.fCountRecoPID),
226 fDecayChannel(c.fDecayChannel),
227 fFillFromGenerated(c.fFillFromGenerated),
228 fOriginDselection(c.fOriginDselection),
229 fAcceptanceUnf(c.fAcceptanceUnf),
231 fUseWeight(c.fUseWeight),
233 fUseFlatPtWeight(c.fUseFlatPtWeight),
234 fUseZWeight(c.fUseZWeight),
235 fUseNchWeight(c.fUseNchWeight),
237 fPartName(c.fPartName),
238 fDauNames(c.fDauNames),
240 fCentralitySelection(c.fCentralitySelection),
241 fFakeSelection(c.fFakeSelection),
242 fRejectIfNoQuark(c.fRejectIfNoQuark),
243 fUseMCVertex(c.fUseMCVertex),
244 fDsOption(c.fDsOption),
245 fGenDsOption(c.fGenDsOption),
246 fConfiguration(c.fConfiguration),
247 fFuncWeight(c.fFuncWeight),
248 fHistoMeasNch(c.fHistoMeasNch),
249 fHistoMCNch(c.fHistoMCNch),
250 fResonantDecay(c.fResonantDecay),
251 fLctoV0bachelorOption(c.fLctoV0bachelorOption),
252 fGenLctoV0bachelorOption(c.fGenLctoV0bachelorOption),
253 fUseSelectionBit(c.fUseSelectionBit),
261 //___________________________________________________________________________
262 AliCFTaskVertexingHF::~AliCFTaskVertexingHF()
267 if (fCFManager) delete fCFManager ;
268 if (fHistEventsProcessed) delete fHistEventsProcessed ;
269 if (fCorrelation) delete fCorrelation ;
270 if (fCuts) delete fCuts;
271 if (fFuncWeight) delete fFuncWeight;
272 if (fHistoMeasNch) delete fHistoMeasNch;
273 if (fHistoMCNch) delete fHistoMCNch;
276 //_________________________________________________________________________-
277 void AliCFTaskVertexingHF::Init()
283 if (fDebug>1) printf("AliCFTaskVertexingHF::Init()");
284 if(fUseWeight && fUseZWeight) { AliFatal("Can not use at the same time pt and z-vtx weights, please choose"); return; }
285 if(fUseWeight && fUseNchWeight) { AliFatal("Can not use at the same time pt and Nch weights, please choose"); return; }
286 if(fUseNchWeight && !fHistoMCNch) { AliFatal("Need to pass the MC Nch distribution to use Nch weights"); return; }
287 if(fUseNchWeight) CreateMeasuredNchHisto();
289 AliRDHFCuts *copyfCuts = 0x0;
291 AliFatal("No cuts defined - Exiting...");
295 switch (fDecayChannel){
298 copyfCuts = new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts)));
299 switch (fConfiguration) {
300 case kSnail: // slow configuration: all variables in
303 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
313 copyfCuts = new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts)));
314 switch (fConfiguration) {
315 case kSnail: // slow configuration: all variables in
318 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
328 copyfCuts = new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fCuts)));
329 switch (fConfiguration) {
330 case kSnail: // slow configuration: all variables in
333 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
338 fDauNames="V0+bachelor";
343 copyfCuts = new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fCuts)));
344 switch (fConfiguration) {
345 case kSnail: // slow configuration: all variables in
348 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
358 copyfCuts = new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fCuts)));
359 switch (fConfiguration) {
360 case kSnail: // slow configuration: all variables in
363 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
373 copyfCuts = new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fCuts)));
374 switch (fConfiguration) {
375 case kSnail: // slow configuration: all variables in
378 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
388 copyfCuts = new AliRDHFCutsD0toKpipipi(*(static_cast<AliRDHFCutsD0toKpipipi*>(fCuts)));
389 switch (fConfiguration) {
390 case kSnail: // slow configuration: all variables in
393 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
398 fDauNames="K+pi+pi+pi";
402 AliFatal("The decay channel MUST be defined according to AliCFVertexing::DecayChannel - Exiting...");
406 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
408 copyfCuts->SetName(nameoutput);
411 PostData(4, copyfCuts);
414 AliFatal("Failing initializing AliRDHFCuts object - Exiting...");
420 //_________________________________________________
421 void AliCFTaskVertexingHF::UserExec(Option_t *)
424 // Main loop function
427 PostData(1,fHistEventsProcessed) ;
428 PostData(2,fCFManager->GetParticleContainer()) ;
429 PostData(3,fCorrelation) ;
431 if (fFillFromGenerated){
432 AliWarning("Flag to fill container with generated value ON ---> dca, d0pi, d0K, d0xd0, cosPointingAngle will be set as dummy!");
436 Error("UserExec","NO EVENT FOUND!");
440 AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
442 TClonesArray *arrayBranch=0;
444 if(!aodEvent && AODEvent() && IsStandardAOD()) {
445 // In case there is an AOD handler writing a standard AOD, use the AOD
446 // event in memory rather than the input (ESD) event.
447 aodEvent = dynamic_cast<AliAODEvent*> (AODEvent());
448 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
449 // have to taken from the AOD event hold by the AliAODExtension
450 AliAODHandler* aodHandler = (AliAODHandler*)
451 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
452 if(aodHandler->GetExtensions()) {
453 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
454 AliAODEvent *aodFromExt = ext->GetAOD();
456 switch (fDecayChannel){
458 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
462 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
466 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
472 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
476 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
485 switch (fDecayChannel){
487 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("D0toKpi");
491 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Dstar");
495 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("CascadesHF");
501 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Charm3Prong");
505 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Charm4Prong");
513 AliAODVertex *aodVtx = (AliAODVertex*)aodEvent->GetPrimaryVertex();
517 AliError("Could not find array of HF vertices");
523 fCFManager->SetRecEventInfo(aodEvent);
524 fCFManager->SetMCEventInfo(aodEvent);
526 //******** DEFINE number of variables of the container***** for now set at 13, in the future in the config macro.
528 //loop on the MC event
530 TClonesArray* mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
532 AliError("Could not find Monte-Carlo in AOD");
537 Int_t icountReco = 0;
538 Int_t icountVertex = 0;
539 Int_t icountRefit = 0;
540 Int_t icountRecoAcc = 0;
541 Int_t icountRecoITSClusters = 0;
542 Int_t icountRecoPPR = 0;
543 Int_t icountRecoPID = 0;
546 AliAODMCHeader *mcHeader = dynamic_cast<AliAODMCHeader*>(aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
548 AliError("Could not find MC Header in AOD");
552 fHistEventsProcessed->Fill(0.5);
554 Double_t* containerInput = new Double_t[fNvar];
555 Double_t* containerInputMC = new Double_t[fNvar];
558 AliCFVertexingHF* cfVtxHF=0x0;
559 switch (fDecayChannel){
561 cfVtxHF = new AliCFVertexingHF2Prong(mcArray, fOriginDselection);
565 cfVtxHF = new AliCFVertexingHFCascade(mcArray, fOriginDselection);
569 cfVtxHF = new AliCFVertexingHFLctoV0bachelor(mcArray, fOriginDselection,fGenLctoV0bachelorOption); // Lc -> K0S+proton
575 cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel);
576 if(fDecayChannel==33){
577 ((AliCFVertexingHF3Prong*)cfVtxHF)->SetGeneratedDsOption(fGenDsOption);
582 cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel,fResonantDecay);
585 //cfVtxHF = new AliCFVertexingHF4Prong(mcArray, originDselection); // not there yet
592 AliError("No AliCFVertexingHF initialized");
593 delete[] containerInput;
594 delete[] containerInputMC;
598 Double_t zPrimVertex = aodVtx ->GetZ();
599 Double_t zMCVertex = mcHeader->GetVtxZ();
600 Int_t runnumber = aodEvent->GetRunNumber();
602 if(fUseZWeight) fWeight *= GetZWeight(zMCVertex,runnumber);
604 Int_t nChargedMCPhysicalPrimary=AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(mcArray,-1.0,1.0);
605 fWeight *= GetNchWeight(nChargedMCPhysicalPrimary);
606 AliDebug(2,Form("Using Nch weights, Mult=%d Weight=%f\n",nChargedMCPhysicalPrimary,fWeight));
609 if (TMath::Abs(zMCVertex) > fCuts->GetMaxVtxZ()){
610 AliDebug(3,Form("z coordinate of MC vertex = %f, it was required to be within [-%f, +%f], skipping event", zMCVertex, fCuts->GetMaxVtxZ(), fCuts->GetMaxVtxZ()));
611 delete[] containerInput;
612 delete[] containerInputMC;
616 AliESDtrackCuts** trackCuts = new AliESDtrackCuts*[cfVtxHF->GetNProngs()];
617 if (fDecayChannel == 21){
618 // for the D*, setting the third element of the array of the track cuts to those for the soft pion
619 for (Int_t iProng = 0; iProng<cfVtxHF->GetNProngs()-1; iProng++){
620 trackCuts[iProng]=fCuts->GetTrackCuts();
622 trackCuts[2] = fCuts->GetTrackCutsSoftPi();
624 else if (fDecayChannel == 22) {
625 // for the Lc->V0+bachelor, setting the second and third elements of the array of the track cuts to those for the V0 daughters
626 trackCuts[0]=fCuts->GetTrackCuts();
627 trackCuts[1]=fCuts->GetTrackCutsV0daughters();
628 trackCuts[2]=fCuts->GetTrackCutsV0daughters();
631 for (Int_t iProng = 0; iProng<cfVtxHF->GetNProngs(); iProng++){
632 trackCuts[iProng]=fCuts->GetTrackCuts();
636 //General settings: vertex, feed down and fill reco container with generated values.
637 cfVtxHF->SetRecoPrimVertex(zPrimVertex);
638 cfVtxHF->SetMCPrimaryVertex(zMCVertex);
639 cfVtxHF->SetFillFromGenerated(fFillFromGenerated);
640 cfVtxHF->SetNVar(fNvar);
641 cfVtxHF->SetFakeSelection(fFakeSelection);
642 cfVtxHF->SetRejectCandidateIfNotFromQuark(fRejectIfNoQuark);
643 cfVtxHF->SetConfiguration(fConfiguration);
645 // switch-off the trigger class selection (doesn't work for MC)
646 fCuts->SetTriggerClass("");
648 // MC vertex, to be used, in case, for pp
649 if (fUseMCVertex) fCuts->SetUseMCVertex();
651 if (fCentralitySelection){ // keep only the requested centrality
652 if(fCuts->IsEventSelectedInCentrality(aodEvent)!=0) {
653 delete[] containerInput;
654 delete[] containerInputMC;
658 } else { // keep all centralities
659 fCuts->SetMinCentrality(0.);
660 fCuts->SetMaxCentrality(100.);
663 Float_t centValue = fCuts->GetCentrality(aodEvent);
664 cfVtxHF->SetCentralityValue(centValue);
666 // number of tracklets - multiplicity estimator
667 Double_t multiplicity = (Double_t)(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aodEvent,-1.,1.)); // casted to double because the CF is filled with doubles
668 cfVtxHF->SetMultiplicity(multiplicity);
670 for (Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) {
671 AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(mcArray->At(iPart));
673 AliError("Failed casting particle from MC array!, Skipping particle");
678 cquarks += cfVtxHF->MCcquarkCounting(mcPart);
680 // check the MC-level cuts, must be the desidered particle
681 if (!fCFManager->CheckParticleCuts(0, mcPart)) {
682 AliDebug(2,"Check the MC-level cuts - not desidered particle");
683 continue; // 0 stands for MC level
685 cfVtxHF->SetMCCandidateParam(iPart);
688 if (!(cfVtxHF->SetLabelArray())){
689 AliDebug(2,Form("Impossible to set the label array (decaychannel = %d)",fDecayChannel));
693 //check the candiate family at MC level
694 if (!(cfVtxHF->CheckMCPartFamily(mcPart, mcArray))) {
695 AliDebug(2,Form("Check on the family wrong!!! (decaychannel = %d)",fDecayChannel));
699 AliInfo(Form("Check on the family OK!!! (decaychannel = %d)",fDecayChannel));
702 //Fill the MC container
703 Bool_t mcContainerFilled = cfVtxHF -> FillMCContainer(containerInputMC);
704 AliDebug(2,Form("mcContainerFilled = %d)",mcContainerFilled));
705 if (mcContainerFilled) {
707 if (fFuncWeight){ // using user-defined function
708 AliDebug(2,"Using function");
709 fWeight = fFuncWeight->Eval(containerInputMC[0]);
712 AliDebug(2,"Using FONLL");
713 fWeight = GetWeight(containerInputMC[0]);
715 AliDebug(2,Form("pt = %f, weight = %f",containerInputMC[0], fWeight));
717 if (!fCuts->IsInFiducialAcceptance(containerInputMC[0],containerInputMC[1])) continue;
718 //MC Limited Acceptance
719 if (TMath::Abs(containerInputMC[1]) < 0.5) {
720 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepGeneratedLimAcc, fWeight);
721 AliDebug(3,"MC Lim Acc container filled\n");
725 fCFManager->GetParticleContainer()->Fill(containerInputMC, kStepGenerated, fWeight);
727 AliDebug(3,"MC cointainer filled \n");
730 // check the MC-Acceptance level cuts
731 // since standard CF functions are not applicable, using Kine Cuts on daughters
732 Bool_t mcAccepStep = cfVtxHF-> MCAcceptanceStep();
734 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepAcceptance, fWeight);
735 AliDebug(3,"MC acceptance cut passed\n");
739 if (fCuts->IsEventSelected(aodEvent)){
740 // filling the container if the vertex is ok
741 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepVertex, fWeight) ;
742 AliDebug(3,"Vertex cut passed and container filled\n");
745 //mc Refit requirement
746 Bool_t mcRefitStep = cfVtxHF->MCRefitStep(aodEvent, &trackCuts[0]);
748 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepRefit, fWeight);
749 AliDebug(3,"MC Refit cut passed and container filled\n");
753 AliDebug(3,"MC Refit cut not passed\n");
758 AliDebug (3, "MC vertex step not passed\n");
763 AliDebug (3, "MC in acceptance step not passed\n");
768 AliDebug (3, "MC container not filled\n");
772 if (cquarks<2) AliDebug(2,Form("Event with %d c-quarks", cquarks));
773 AliDebug(2,Form("Found %i MC particles that are %s!!",icountMC,fPartName.Data()));
774 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Acc cuts!!",icountAcc,fPartName.Data()));
775 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Vertex cuts!!",icountVertex,fPartName.Data()));
776 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Refit cuts!!",icountRefit,fPartName.Data()));
778 // Now go to rec level
779 fCountMC += icountMC;
780 fCountAcc += icountAcc;
781 fCountVertex+= icountVertex;
782 fCountRefit+= icountRefit;
784 AliDebug(2,Form("Found %d vertices for decay channel %d",arrayBranch->GetEntriesFast(),fDecayChannel));
786 for(Int_t iCandid = 0; iCandid<arrayBranch->GetEntriesFast();iCandid++){
787 AliAODRecoDecayHF* charmCandidate=0x0;
788 switch (fDecayChannel){
790 charmCandidate = (AliAODRecoDecayHF2Prong*)arrayBranch->At(iCandid);
795 charmCandidate = (AliAODRecoCascadeHF*)arrayBranch->At(iCandid);
801 charmCandidate = (AliAODRecoDecayHF3Prong*)arrayBranch->At(iCandid);
805 charmCandidate = (AliAODRecoDecayHF4Prong*)arrayBranch->At(iCandid);
812 Bool_t unsetvtx=kFALSE;
813 if(!charmCandidate->GetOwnPrimaryVtx()) {
814 charmCandidate->SetOwnPrimaryVtx(aodVtx); // needed to compute all variables
818 Bool_t signAssociation = cfVtxHF->SetRecoCandidateParam((AliAODRecoDecayHF*)charmCandidate);
819 if (!signAssociation){
820 charmCandidate = 0x0;
824 Int_t isPartOrAntipart = cfVtxHF->CheckReflexion(fSign);
825 if (isPartOrAntipart == 0){
826 AliDebug(2, Form("The candidate pdg code doesn't match the requirement set in the task (fSign = %d)",fSign));
830 AliDebug(3,Form("iCandid=%d - signAssociation=%d, isPartOrAntipart=%d",iCandid, signAssociation, isPartOrAntipart));
832 Bool_t recoContFilled = cfVtxHF->FillRecoContainer(containerInput);
835 // weight according to pt
837 if (fFuncWeight){ // using user-defined function
838 AliDebug(2, "Using function");
839 fWeight = fFuncWeight->Eval(containerInput[0]);
842 AliDebug(2, "Using FONLL");
843 fWeight = GetWeight(containerInput[0]);
845 AliDebug(2, Form("pt = %f, weight = %f",containerInput[0], fWeight));
848 if (!fCuts->IsInFiducialAcceptance(containerInput[0],containerInput[1])) continue;
851 Bool_t recoStep = cfVtxHF->RecoStep();
852 Bool_t vtxCheck = fCuts->IsEventSelected(aodEvent);
855 // Selection on the filtering bit
856 Bool_t isBitSelected = kTRUE;
857 if(fDecayChannel==2) {
858 if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) isBitSelected = kFALSE;
859 }else if(fDecayChannel==31){
860 if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kDplusCuts)) isBitSelected = kFALSE;
861 }else if(fDecayChannel==33){
862 if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kDsCuts)) isBitSelected = kFALSE;
864 if(!isBitSelected) continue;
868 if (recoStep && recoContFilled && vtxCheck){
869 fCFManager->GetParticleContainer()->Fill(containerInput,kStepReconstructed, fWeight) ;
871 AliDebug(3,"Reco step passed and container filled\n");
873 //Reco in the acceptance -- take care of UNFOLDING!!!!
874 Bool_t recoAcceptanceStep = cfVtxHF->RecoAcceptStep(&trackCuts[0]);
875 if (recoAcceptanceStep) {
876 fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoAcceptance, fWeight) ;
878 AliDebug(3,"Reco acceptance cut passed and container filled\n");
881 Double_t fill[4]; //fill response matrix
882 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fPDGcode,fill);
883 if (bUnfolding) fCorrelation->Fill(fill);
886 //Number of ITS cluster requirements
887 Int_t recoITSnCluster = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kTracks);
888 if (recoITSnCluster){
889 fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoITSClusters, fWeight) ;
890 icountRecoITSClusters++;
891 AliDebug(3,"Reco n ITS cluster cut passed and container filled\n");
893 Bool_t iscutsusingpid = fCuts->GetIsUsePID();
894 Int_t recoAnalysisCuts = -1, recoPidSelection = -1;
895 fCuts->SetUsePID(kFALSE);
896 recoAnalysisCuts = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
898 if (fDecayChannel==33){ // Ds case, where more possibilities are considered
899 Bool_t keepDs=ProcessDs(recoAnalysisCuts);
900 if(keepDs) recoAnalysisCuts=3;
902 else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
903 Bool_t keepLctoV0bachelor=ProcessLctoV0Bachelor(recoAnalysisCuts);
904 if (keepLctoV0bachelor) recoAnalysisCuts=3;
909 fCuts->SetUsePID(iscutsusingpid); //restoring usage of the PID from the cuts object
910 Bool_t tempAn=(recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart);
911 if (fDecayChannel == 32) tempAn=(recoAnalysisCuts >0 || recoAnalysisCuts == isPartOrAntipart);
914 fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPPR, fWeight);
916 AliDebug(3,"Reco Analysis cuts passed and container filled \n");
918 //recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kPID);
919 //if((fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==isPartOrAntipart)||(fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==3)){
920 recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
922 if (fDecayChannel==33){ // Ds case, where more possibilities are considered
923 Bool_t keepDs=ProcessDs(recoPidSelection);
924 if(keepDs) recoPidSelection=3;
925 } else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
926 Bool_t keepLctoV0bachelor=ProcessLctoV0Bachelor(recoPidSelection);
927 if (keepLctoV0bachelor) recoPidSelection=3;
930 Bool_t tempPid=(recoPidSelection == 3 || recoPidSelection == isPartOrAntipart);
931 if (fDecayChannel == 32) tempPid=(recoPidSelection >0 || recoPidSelection == isPartOrAntipart);
934 fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPID, fWeight);
936 AliDebug(3,"Reco PID cuts passed and container filled \n");
938 Double_t fill[4]; //fill response matrix
939 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fPDGcode,fill);
940 if (bUnfolding) fCorrelation->Fill(fill);
944 AliDebug(3, "Analysis Cuts step not passed \n");
949 AliDebug(3, "PID selection not passed \n");
954 AliDebug(3, "Number of ITS cluster step not passed\n");
959 AliDebug(3, "Reco acceptance step not passed\n");
964 AliDebug(3, "Reco step not passed\n");
969 if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
970 } // end loop on candidate
972 fCountReco+= icountReco;
973 fCountRecoAcc+= icountRecoAcc;
974 fCountRecoITSClusters+= icountRecoITSClusters;
975 fCountRecoPPR+= icountRecoPPR;
976 fCountRecoPID+= icountRecoPID;
978 fHistEventsProcessed->Fill(1.5);
980 delete[] containerInput;
981 delete[] containerInputMC;
984 // for (Int_t i=0; i<cfVtxHF->GetNProngs(); i++){
985 // delete [] trackCuts[i];
993 //___________________________________________________________________________
994 void AliCFTaskVertexingHF::Terminate(Option_t*)
996 // The Terminate() function is the last function to be called during
997 // a query. It always runs on the client, it can be used to present
998 // the results graphically or save the results to file.
1000 AliAnalysisTaskSE::Terminate();
1002 AliInfo(Form("Found %i MC particles that are %s in MC, in %d events",fCountMC,fPartName.Data(),fEvents));
1003 AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, in %d events",fCountAcc,fPartName.Data(),fEvents));
1004 AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, and satisfy Vertex requirement in %d events",fCountVertex,fPartName.Data(),fEvents));
1005 AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, and satisfy ITS+TPC refit requirementin %d events",fCountRefit,fPartName.Data(),fEvents));
1006 AliInfo(Form("Found %i reco %s that are decaying in %s, in %d events",fCountReco,fPartName.Data(),fDauNames.Data(),fEvents));
1007 AliInfo(Form("Among the above, found %i reco %s that are decaying in %s and are in the requested acceptance, in %d events",fCountRecoAcc,fPartName.Data(),fDauNames.Data(),fEvents));
1008 AliInfo(Form("Among the above, found %i reco %s that are decaying in %s and have at least 5 clusters in ITS, in %d events",fCountRecoITSClusters,fPartName.Data(),fDauNames.Data(),fEvents));
1009 AliInfo(Form("Among the above, found %i reco %s that are decaying in %s and satisfy PPR cuts, in %d events",fCountRecoPPR,fPartName.Data(),fDauNames.Data(),fEvents));
1010 AliInfo(Form("Among the above, found %i reco %s that are decaying in %s and satisfy PPR+PID cuts, in %d events",fCountRecoPID,fPartName.Data(),fDauNames.Data(),fEvents));
1012 // draw some example plots....
1013 AliCFContainer *cont= dynamic_cast<AliCFContainer*> (GetOutputData(2));
1015 printf("CONTAINER NOT FOUND\n");
1018 // projecting the containers to obtain histograms
1019 // first argument = variable, second argument = step
1021 TH1D** h = new TH1D*[3];
1022 Int_t nvarToPlot = 0;
1023 if (fConfiguration == kSnail){
1024 //h = new TH1D[3][12];
1025 for (Int_t ih = 0; ih<3; ih++){
1026 if(fDecayChannel==22){
1031 h[ih] = new TH1D[nvarToPlot];
1033 for(Int_t iC=1;iC<nvarToPlot; iC++){
1035 h[0][iC] = *(cont->ShowProjection(iC,0));
1036 // MC-Acceptance level
1037 h[1][iC] = *(cont->ShowProjection(iC,1));
1039 h[2][iC] = *(cont->ShowProjection(iC,4));
1043 //h = new TH1D[3][12];
1045 for (Int_t ih = 0; ih<3; ih++){
1046 h[ih] = new TH1D[nvarToPlot];
1048 for(Int_t iC=0;iC<nvarToPlot; iC++){
1050 h[0][iC] = *(cont->ShowProjection(iC,0));
1051 // MC-Acceptance level
1052 h[1][iC] = *(cont->ShowProjection(iC,1));
1054 h[2][iC] = *(cont->ShowProjection(iC,4));
1058 //Int_t nvarToPlot = 0;
1059 if (fConfiguration == kSnail){
1060 if(fDecayChannel==31){
1062 titles = new TString[nvarToPlot];
1063 titles[0]="pT_Dplus (GeV/c)";
1064 titles[1]="rapidity";
1065 titles[2]="phi (rad)";
1066 titles[3]="cT (#mum)";
1067 titles[4]="cosPointingAngle";
1068 titles[5]="pT_1 (GeV/c)";
1069 titles[6]="pT_2 (GeV/c)";
1070 titles[7]="pT_3 (GeV/c)";
1071 titles[8]="d0_1 (#mum)";
1072 titles[9]="d0_2 (#mum)";
1073 titles[10]="d0_3 (#mum)";
1074 titles[11]="zVertex (cm)";
1075 } else if (fDecayChannel==22) {
1077 titles = new TString[nvarToPlot];
1078 titles[0]="pT_Lc (GeV/c)";
1079 titles[1]="rapidity";
1080 titles[2]="phi (rad)";
1081 titles[3]="cosPAV0";
1082 titles[4]="onTheFlyStatusV0";
1083 titles[5]="centrality";
1085 titles[7]="multiplicity";
1086 titles[8]="pT_bachelor (GeV/c)";
1087 titles[9]="pT_V0pos (GeV/c)";
1088 titles[10]="pT_V0neg (GeV/c)";
1089 titles[11]="invMassV0 (GeV/c2)";
1090 titles[12]="dcaV0 (nSigma)";
1091 titles[13]="c#tauV0 (#mum)";
1092 titles[14]="c#tau (#mum)";
1096 titles = new TString[nvarToPlot];
1097 titles[0]="pT_D0 (GeV/c)";
1098 titles[1]="rapidity";
1099 titles[2]="cosThetaStar";
1100 titles[3]="pT_pi (GeV/c)";
1101 titles[4]="pT_K (Gev/c)";
1102 titles[5]="cT (#mum)";
1103 titles[6]="dca (#mum)";
1104 titles[7]="d0_pi (#mum)";
1105 titles[8]="d0_K (#mum)";
1106 titles[9]="d0xd0 (#mum^2)";
1107 titles[10]="cosPointingAngle";
1108 titles[11]="phi (rad)";
1113 titles = new TString[nvarToPlot];
1114 if (fDecayChannel==22) {
1115 titles[0]="pT_candidate (GeV/c)";
1116 titles[1]="rapidity";
1117 titles[2]="phi (rad)";
1118 titles[3]="cosPAV0";
1119 titles[4]="onTheFlyStatusV0";
1120 titles[5]="centrality";
1122 titles[7]="multiplicity";
1124 titles[0]="pT_candidate (GeV/c)";
1125 titles[1]="rapidity";
1126 titles[2]="cT (#mum)";
1128 titles[4]="z_{vtx}";
1129 titles[5]="centrality";
1131 titles[7]="multiplicity";
1135 Int_t markers[16]={20,24,21,25,27,28,
1138 Int_t colors[3]={2,8,4};
1139 for(Int_t iC=0;iC<nvarToPlot; iC++){
1140 for(Int_t iStep=0;iStep<3;iStep++){
1141 h[iStep][iC].SetTitle(titles[iC].Data());
1142 h[iStep][iC].GetXaxis()->SetTitle(titles[iC].Data());
1143 Double_t maxh=h[iStep][iC].GetMaximum();
1144 h[iStep][iC].GetYaxis()->SetRangeUser(0,maxh*1.2);
1145 h[iStep][iC].SetMarkerStyle(markers[iC]);
1146 h[iStep][iC].SetMarkerColor(colors[iStep]);
1150 gStyle->SetCanvasColor(0);
1151 gStyle->SetFrameFillColor(0);
1152 gStyle->SetTitleFillColor(0);
1153 gStyle->SetStatColor(0);
1155 // drawing in 2 separate canvas for a matter of clearity
1156 TCanvas * c1 =new TCanvas(Form("c1New_%d",fDecayChannel),"Vars 0, 1, 2, 3",1100,1200);
1159 for(Int_t iVar=0; iVar<4; iVar++){
1161 h[0][iVar].DrawCopy("p");
1163 h[1][iVar].DrawCopy("p");
1165 h[2][iVar].DrawCopy("p");
1168 TCanvas * c2 =new TCanvas(Form("c2New_%d",fDecayChannel),"Vars 4, 5, 6, 7",1100,1200);
1171 for(Int_t iVar=4; iVar<8; iVar++){
1173 h[0][iVar].DrawCopy("p");
1175 h[1][iVar].DrawCopy("p");
1177 h[2][iVar].DrawCopy("p");
1180 if (fConfiguration == kSnail){
1181 TCanvas * c3 =new TCanvas(Form("c3New_%d",fDecayChannel),"Vars 8, 9, 10, 11",1100,1200);
1184 for(Int_t iVar=8; iVar<12; iVar++){
1186 h[0][iVar].DrawCopy("p");
1188 h[1][iVar].DrawCopy("p");
1190 h[2][iVar].DrawCopy("p");
1192 if (fDecayChannel==22) {
1193 TCanvas * c4 =new TCanvas(Form("c4New_%d",fDecayChannel),"Vars 12, 13, 14, 15",1100,1200);
1196 for(Int_t iVar=12; iVar<16; iVar++){
1198 h[0][iVar].DrawCopy("p");
1200 h[1][iVar].DrawCopy("p");
1202 h[2][iVar].DrawCopy("p");
1208 THnSparseD* hcorr = dynamic_cast<THnSparseD*> (GetOutputData(3));
1210 TH2D* corr1 = hcorr->Projection(0,2);
1211 TH2D* corr2 = hcorr->Projection(1,3);
1213 TCanvas * c7 =new TCanvas(Form("c7New_%d",fDecayChannel),"",800,400);
1216 corr1->DrawCopy("text");
1218 corr2->DrawCopy("text");
1220 TFile* file_projection = new TFile("CFtaskHFprojectionNew.root","RECREATE");
1225 for(Int_t iC=0;iC<nvarToPlot; iC++){
1226 for(Int_t iStep=0;iStep<3;iStep++){
1227 h[iStep][iC].Write(Form("Step%d_%s",iStep,titles[iC].Data()));
1230 file_projection->Close();
1231 for (Int_t ih = 0; ih<3; ih++) delete [] h[ih];
1237 //___________________________________________________________________________
1238 void AliCFTaskVertexingHF::UserCreateOutputObjects()
1240 //HERE ONE CAN CREATE OUTPUT OBJECTS, IN PARTICULAR IF THE OBJECT PARAMETERS DON'T NEED
1241 //TO BE SET BEFORE THE EXECUTION OF THE TASK
1243 Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName());
1245 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
1246 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1247 AliPIDResponse *localPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
1249 if (fCuts->GetIsUsePID() && fDecayChannel==22) {
1251 fCuts->GetPidHF()->SetPidResponse(localPIDResponse);
1252 fCuts->GetPidHF()->SetOldPid(kFALSE);
1253 AliRDHFCutsLctoV0* lcv0Cuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
1255 lcv0Cuts->GetPidV0pos()->SetPidResponse(localPIDResponse);
1256 lcv0Cuts->GetPidV0neg()->SetPidResponse(localPIDResponse);
1257 lcv0Cuts->GetPidV0pos()->SetOldPid(kFALSE);
1258 lcv0Cuts->GetPidV0neg()->SetOldPid(kFALSE);
1264 const char* nameoutput=GetOutputSlot(1)->GetContainer()->GetName();
1265 fHistEventsProcessed = new TH1I(nameoutput,"",2,0,2) ;
1266 fHistEventsProcessed->GetXaxis()->SetBinLabel(1,"Events processed (all)");
1267 fHistEventsProcessed->GetXaxis()->SetBinLabel(2,"Events analyzed (after selection)");
1269 PostData(1,fHistEventsProcessed) ;
1270 PostData(2,fCFManager->GetParticleContainer()) ;
1271 PostData(3,fCorrelation) ;
1276 //_________________________________________________________________________
1277 void AliCFTaskVertexingHF::SetPtWeightsFromFONLL276overLHC12a17a(){
1278 // ad-hoc weight function from ratio of
1279 // pt spectra from FONLL 2.76 TeV and
1280 // pt spectra from MC production LHC12a17a (PYTHIA Perugia0 with pthard bins)
1281 if(fFuncWeight) delete fFuncWeight;
1282 fFuncWeight=new TF1("funcWeight","[0]+[1]*TMath::Exp(-[2]*x)",0.,50.);
1283 fFuncWeight->SetParameter(0,4.63891e-02);
1284 fFuncWeight->SetParameter(1,1.51674e+01);
1285 fFuncWeight->SetParameter(2,4.09941e-01);
1287 //_________________________________________________________________________
1288 void AliCFTaskVertexingHF::SetPtWeightsFromDataPbPb276overLHC12a17a(){
1289 // ad-hoc weight function from ratio of
1290 // D0 pt spectra in PbPb 2011 0-10% centrality and
1291 // pt spectra from MC production LHC12a17a (PYTHIA Perugia0 with pthard bins)
1292 if(fFuncWeight) delete fFuncWeight;
1293 fFuncWeight=new TF1("funcWeight","[0]+[1]/TMath::Power(x,[2])",0.05,50.);
1294 fFuncWeight->SetParameter(0,1.43116e-02);
1295 fFuncWeight->SetParameter(1,4.37758e+02);
1296 fFuncWeight->SetParameter(2,3.08583);
1298 //_________________________________________________________________________
1299 Double_t AliCFTaskVertexingHF::GetWeight(Float_t pt)
1302 // calculating the weight to fill the container
1306 // p0 = 1.63297e-01 --> 0.322643
1312 // p0 = 1.85906e-01 --> 0.36609
1317 Double_t func1[4] = {0.322643,2.96275,2.30301,2.5};
1318 Double_t func2[4] = {0.36609,1.94635,1.40463,2.5};
1320 Double_t dndpt_func1 = dNdptFit(pt,func1);
1321 if(fUseFlatPtWeight) dndpt_func1 = 1./30.;
1322 Double_t dndpt_func2 = dNdptFit(pt,func2);
1323 AliDebug(2,Form("pt = %f, FONLL = %f, Pythia = %f, ratio = %f",pt,dndpt_func1,dndpt_func2,dndpt_func1/dndpt_func2));
1324 return dndpt_func1/dndpt_func2;
1327 //__________________________________________________________________________________________________
1328 Double_t AliCFTaskVertexingHF::dNdptFit(Float_t pt, Double_t* par)
1331 // calculating dNdpt
1334 Double_t denom = TMath::Power((pt/par[1]), par[3] );
1335 Double_t dNdpt = par[0]*pt/TMath::Power(1.+denom, par[2]);
1340 //__________________________________________________________________________________________________
1341 Double_t AliCFTaskVertexingHF::GetZWeight(Float_t z, Int_t runnumber){
1343 // calculating the z-vtx weight for the given run range
1346 if(runnumber>146824 || runnumber<146803) return 1.0;
1348 Double_t func1[3] = {1.0, -0.5, 6.5 };
1349 Double_t func2[3] = {1.0, -0.5, 5.5 };
1351 Double_t dzFunc1 = DodzFit(z,func1);
1352 Double_t dzFunc2 = DodzFit(z,func2);
1354 return dzFunc1/dzFunc2;
1357 //__________________________________________________________________________________________________
1358 Double_t AliCFTaskVertexingHF::DodzFit(Float_t z, Double_t* par) {
1361 // Gaussian z-vtx shape
1363 //gaussian = [0]/TMath::Sqrt(2.*TMath::Pi())/[2]*exp[-(x-[1])*(x-[1])/(2*[2]*[2])]
1365 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]);
1369 //__________________________________________________________________________________________________
1370 Double_t AliCFTaskVertexingHF::GetNchWeight(Int_t nch){
1372 // calculates the Nch weight using the measured and generateed Nch distributions
1374 if(nch<=0) return 0.;
1375 Double_t pMeas=fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(nch));
1376 Double_t pMC=fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(nch));
1379 //__________________________________________________________________________________________________
1380 void AliCFTaskVertexingHF::CreateMeasuredNchHisto(){
1381 // creates historgam with measured multiplcity distribution in pp 7 TeV collisions (from Eur. Phys. J. C (2010) 68: 345–354)
1382 Double_t nchbins[66]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1383 10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1384 20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1385 30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1386 40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1387 50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1388 60.50,62.50,64.50,66.50,68.50,70.50};
1389 Double_t pch[65]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1390 0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1391 0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1392 0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1393 0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1394 0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1395 0.000296,0.000265,0.000193,0.00016,0.000126};
1397 if(fHistoMeasNch) delete fHistoMeasNch;
1398 fHistoMeasNch=new TH1F("hMeaseNch","",65,nchbins);
1399 for(Int_t i=0; i<65; i++){
1400 fHistoMeasNch->SetBinContent(i+1,pch[i]);
1401 fHistoMeasNch->SetBinError(i+1,0.);
1405 //__________________________________________________________________________________________________
1406 Bool_t AliCFTaskVertexingHF::ProcessDs(Int_t recoAnalysisCuts) const{
1407 // processes output of Ds is selected
1409 if(recoAnalysisCuts > 0){
1410 Int_t isKKpi=recoAnalysisCuts&1;
1411 Int_t ispiKK=recoAnalysisCuts&2;
1412 Int_t isPhiKKpi=recoAnalysisCuts&4;
1413 Int_t isPhipiKK=recoAnalysisCuts&8;
1414 Int_t isK0starKKpi=recoAnalysisCuts&16;
1415 Int_t isK0starpiKK=recoAnalysisCuts&32;
1417 if(isKKpi && isPhiKKpi) keep=kTRUE;
1418 if(ispiKK && isPhipiKK) keep=kTRUE;
1420 else if(fDsOption==2){
1421 if(isKKpi && isK0starKKpi) keep=kTRUE;
1422 if(ispiKK && isK0starpiKK) keep=kTRUE;
1424 else if(fDsOption==3)keep=kTRUE;
1428 //__________________________________________________________________________________________________
1429 Bool_t AliCFTaskVertexingHF::ProcessLctoV0Bachelor(Int_t recoAnalysisCuts) const{
1430 // processes output of Lc->V0+bnachelor is selected
1432 if(recoAnalysisCuts > 0){
1434 Int_t isK0Sp = recoAnalysisCuts&1;
1435 Int_t isLambdaBarpi = recoAnalysisCuts&2;
1436 Int_t isLambdapi = recoAnalysisCuts&4;
1438 if(fLctoV0bachelorOption==1){
1439 if(isK0Sp) keep=kTRUE;
1441 else if(fLctoV0bachelorOption==2){
1442 if(isLambdaBarpi) keep=kTRUE;
1444 else if(fLctoV0bachelorOption==4){
1445 if(isLambdapi) keep=kTRUE;
1447 else if(fLctoV0bachelorOption==7) {
1448 if (isK0Sp || isLambdaBarpi || isLambdapi) keep=kTRUE;