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)
130 //___________________________________________________________________________
131 AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts, TF1* func) :
132 AliAnalysisTaskSE(name),
134 fHistEventsProcessed(0x0),
142 fCountRecoITSClusters(0),
147 fFillFromGenerated(kFALSE),
148 fOriginDselection(0),
149 fAcceptanceUnf(kTRUE),
153 fUseFlatPtWeight(kFALSE),
155 fUseNchWeight(kFALSE),
160 fCentralitySelection(kTRUE),
162 fRejectIfNoQuark(kTRUE),
163 fUseMCVertex(kFALSE),
166 fConfiguration(kCheetah), // by default, setting the fast configuration
171 fLctoV0bachelorOption(1),
172 fGenLctoV0bachelorOption(0),
173 fUseSelectionBit(kTRUE)
176 // Constructor. Initialization of Inputs and Outputs
179 DefineInput(0) and DefineOutput(0)
180 are taken care of by AliAnalysisTaskSE constructor
182 DefineOutput(1,TH1I::Class());
183 DefineOutput(2,AliCFContainer::Class());
184 DefineOutput(3,THnSparseD::Class());
185 DefineOutput(4,AliRDHFCuts::Class());
190 //___________________________________________________________________________
191 AliCFTaskVertexingHF& AliCFTaskVertexingHF::operator=(const AliCFTaskVertexingHF& c)
194 // Assignment operator
197 AliAnalysisTaskSE::operator=(c) ;
198 fCFManager = c.fCFManager;
199 fHistEventsProcessed = c.fHistEventsProcessed;
201 fFuncWeight = c.fFuncWeight;
202 fHistoMeasNch = c.fHistoMeasNch;
203 fHistoMCNch = c.fHistoMCNch;
208 //___________________________________________________________________________
209 AliCFTaskVertexingHF::AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c) :
210 AliAnalysisTaskSE(c),
211 fCFManager(c.fCFManager),
212 fHistEventsProcessed(c.fHistEventsProcessed),
213 fCorrelation(c.fCorrelation),
214 fCountMC(c.fCountMC),
215 fCountAcc(c.fCountAcc),
216 fCountVertex(c.fCountVertex),
217 fCountRefit(c.fCountRefit),
218 fCountReco(c.fCountReco),
219 fCountRecoAcc(c.fCountRecoAcc),
220 fCountRecoITSClusters(c.fCountRecoITSClusters),
221 fCountRecoPPR(c.fCountRecoPPR),
222 fCountRecoPID(c.fCountRecoPID),
224 fDecayChannel(c.fDecayChannel),
225 fFillFromGenerated(c.fFillFromGenerated),
226 fOriginDselection(c.fOriginDselection),
227 fAcceptanceUnf(c.fAcceptanceUnf),
229 fUseWeight(c.fUseWeight),
231 fUseFlatPtWeight(c.fUseFlatPtWeight),
232 fUseZWeight(c.fUseZWeight),
233 fUseNchWeight(c.fUseNchWeight),
235 fPartName(c.fPartName),
236 fDauNames(c.fDauNames),
238 fCentralitySelection(c.fCentralitySelection),
239 fFakeSelection(c.fFakeSelection),
240 fRejectIfNoQuark(c.fRejectIfNoQuark),
241 fUseMCVertex(c.fUseMCVertex),
242 fDsOption(c.fDsOption),
243 fGenDsOption(c.fGenDsOption),
244 fConfiguration(c.fConfiguration),
245 fFuncWeight(c.fFuncWeight),
246 fHistoMeasNch(c.fHistoMeasNch),
247 fHistoMCNch(c.fHistoMCNch),
248 fResonantDecay(c.fResonantDecay),
249 fLctoV0bachelorOption(c.fLctoV0bachelorOption),
250 fGenLctoV0bachelorOption(c.fGenLctoV0bachelorOption),
251 fUseSelectionBit(c.fUseSelectionBit)
258 //___________________________________________________________________________
259 AliCFTaskVertexingHF::~AliCFTaskVertexingHF()
264 if (fCFManager) delete fCFManager ;
265 if (fHistEventsProcessed) delete fHistEventsProcessed ;
266 if (fCorrelation) delete fCorrelation ;
267 if (fCuts) delete fCuts;
268 if (fFuncWeight) delete fFuncWeight;
269 if (fHistoMeasNch) delete fHistoMeasNch;
270 if (fHistoMCNch) delete fHistoMCNch;
273 //_________________________________________________________________________-
274 void AliCFTaskVertexingHF::Init()
280 if (fDebug>1) printf("AliCFTaskVertexingHF::Init()");
281 if(fUseWeight && fUseZWeight) { AliFatal("Can not use at the same time pt and z-vtx weights, please choose"); return; }
282 if(fUseWeight && fUseNchWeight) { AliFatal("Can not use at the same time pt and Nch weights, please choose"); return; }
283 if(fUseNchWeight && !fHistoMCNch) { AliFatal("Need to pass the MC Nch distribution to use Nch weights"); return; }
284 if(fUseNchWeight) CreateMeasuredNchHisto();
286 AliRDHFCuts *copyfCuts = 0x0;
288 AliFatal("No cuts defined - Exiting...");
292 switch (fDecayChannel){
294 copyfCuts = new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts)));
295 switch (fConfiguration) {
296 case kSnail: // slow configuration: all variables in
299 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
308 copyfCuts = new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts)));
309 switch (fConfiguration) {
310 case kSnail: // slow configuration: all variables in
313 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
322 copyfCuts = new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fCuts)));
323 switch (fConfiguration) {
324 case kSnail: // slow configuration: all variables in
327 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
332 fDauNames="V0+bachelor";
336 copyfCuts = new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fCuts)));
337 switch (fConfiguration) {
338 case kSnail: // slow configuration: all variables in
341 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
350 copyfCuts = new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fCuts)));
351 switch (fConfiguration) {
352 case kSnail: // slow configuration: all variables in
355 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
364 copyfCuts = new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fCuts)));
365 switch (fConfiguration) {
366 case kSnail: // slow configuration: all variables in
369 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
378 copyfCuts = new AliRDHFCutsD0toKpipipi(*(static_cast<AliRDHFCutsD0toKpipipi*>(fCuts)));
379 switch (fConfiguration) {
380 case kSnail: // slow configuration: all variables in
383 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
388 fDauNames="K+pi+pi+pi";
392 AliFatal("The decay channel MUST be defined according to AliCFVertexing::DecayChannel - Exiting...");
396 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
398 copyfCuts->SetName(nameoutput);
401 PostData(4, copyfCuts);
404 AliFatal("Failing initializing AliRDHFCuts object - Exiting...");
410 //_________________________________________________
411 void AliCFTaskVertexingHF::UserExec(Option_t *)
414 // Main loop function
417 PostData(1,fHistEventsProcessed) ;
418 PostData(2,fCFManager->GetParticleContainer()) ;
419 PostData(3,fCorrelation) ;
421 if (fFillFromGenerated){
422 AliWarning("Flag to fill container with generated value ON ---> dca, d0pi, d0K, d0xd0, cosPointingAngle will be set as dummy!");
426 Error("UserExec","NO EVENT FOUND!");
430 AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
432 TClonesArray *arrayBranch=0;
434 if(!aodEvent && AODEvent() && IsStandardAOD()) {
435 // In case there is an AOD handler writing a standard AOD, use the AOD
436 // event in memory rather than the input (ESD) event.
437 aodEvent = dynamic_cast<AliAODEvent*> (AODEvent());
438 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
439 // have to taken from the AOD event hold by the AliAODExtension
440 AliAODHandler* aodHandler = (AliAODHandler*)
441 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
442 if(aodHandler->GetExtensions()) {
443 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
444 AliAODEvent *aodFromExt = ext->GetAOD();
446 switch (fDecayChannel){
448 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
452 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
456 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
462 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
466 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
475 switch (fDecayChannel){
477 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("D0toKpi");
481 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Dstar");
485 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("CascadesHF");
491 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Charm3Prong");
495 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Charm4Prong");
503 AliAODVertex *aodVtx = (AliAODVertex*)aodEvent->GetPrimaryVertex();
507 AliError("Could not find array of HF vertices");
513 fCFManager->SetRecEventInfo(aodEvent);
514 fCFManager->SetMCEventInfo(aodEvent);
516 //******** DEFINE number of variables of the container***** for now set at 13, in the future in the config macro.
518 //loop on the MC event
520 TClonesArray* mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
522 AliError("Could not find Monte-Carlo in AOD");
527 Int_t icountReco = 0;
528 Int_t icountVertex = 0;
529 Int_t icountRefit = 0;
530 Int_t icountRecoAcc = 0;
531 Int_t icountRecoITSClusters = 0;
532 Int_t icountRecoPPR = 0;
533 Int_t icountRecoPID = 0;
536 AliAODMCHeader *mcHeader = dynamic_cast<AliAODMCHeader*>(aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
538 AliError("Could not find MC Header in AOD");
542 Double_t* containerInput = new Double_t[fNvar];
543 Double_t* containerInputMC = new Double_t[fNvar];
546 AliCFVertexingHF* cfVtxHF=0x0;
547 switch (fDecayChannel){
549 cfVtxHF = new AliCFVertexingHF2Prong(mcArray, fOriginDselection);
553 cfVtxHF = new AliCFVertexingHFCascade(mcArray, fOriginDselection);
557 cfVtxHF = new AliCFVertexingHFLctoV0bachelor(mcArray, fOriginDselection,fGenLctoV0bachelorOption); // Lc -> K0S+proton
563 cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel);
564 if(fDecayChannel==33){
565 ((AliCFVertexingHF3Prong*)cfVtxHF)->SetGeneratedDsOption(fGenDsOption);
570 cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel,fResonantDecay);
573 //cfVtxHF = new AliCFVertexingHF4Prong(mcArray, originDselection); // not there yet
580 AliError("No AliCFVertexingHF initialized");
581 delete[] containerInput;
582 delete[] containerInputMC;
586 Double_t zPrimVertex = aodVtx ->GetZ();
587 Double_t zMCVertex = mcHeader->GetVtxZ();
588 Int_t runnumber = aodEvent->GetRunNumber();
590 if(fUseZWeight) fWeight *= GetZWeight(zMCVertex,runnumber);
592 Int_t nChargedMCPhysicalPrimary=AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(mcArray,-1.0,1.0);
593 fWeight *= GetNchWeight(nChargedMCPhysicalPrimary);
594 AliDebug(2,Form("Using Nch weights, Mult=%d Weight=%f\n",nChargedMCPhysicalPrimary,fWeight));
597 if (TMath::Abs(zMCVertex) > fCuts->GetMaxVtxZ()){
598 AliDebug(3,Form("z coordinate of MC vertex = %f, it was required to be within [-%f, +%f], skipping event", zMCVertex, fCuts->GetMaxVtxZ(), fCuts->GetMaxVtxZ()));
599 delete[] containerInput;
600 delete[] containerInputMC;
604 AliESDtrackCuts** trackCuts = new AliESDtrackCuts*[cfVtxHF->GetNProngs()];
605 if (fDecayChannel == 21){
606 // for the D*, setting the third element of the array of the track cuts to those for the soft pion
607 for (Int_t iProng = 0; iProng<cfVtxHF->GetNProngs()-1; iProng++){
608 trackCuts[iProng]=fCuts->GetTrackCuts();
610 trackCuts[2] = fCuts->GetTrackCutsSoftPi();
612 else if (fDecayChannel == 22) {
613 // for the Lc->V0+bachelor, setting the second and third elements of the array of the track cuts to those for the V0 daughters
614 trackCuts[0]=fCuts->GetTrackCuts();
615 trackCuts[1]=fCuts->GetTrackCutsV0daughters();
616 trackCuts[2]=fCuts->GetTrackCutsV0daughters();
619 for (Int_t iProng = 0; iProng<cfVtxHF->GetNProngs(); iProng++){
620 trackCuts[iProng]=fCuts->GetTrackCuts();
624 //General settings: vertex, feed down and fill reco container with generated values.
625 cfVtxHF->SetRecoPrimVertex(zPrimVertex);
626 cfVtxHF->SetMCPrimaryVertex(zMCVertex);
627 cfVtxHF->SetFillFromGenerated(fFillFromGenerated);
628 cfVtxHF->SetNVar(fNvar);
629 cfVtxHF->SetFakeSelection(fFakeSelection);
630 cfVtxHF->SetRejectCandidateIfNotFromQuark(fRejectIfNoQuark);
631 cfVtxHF->SetConfiguration(fConfiguration);
633 // switch-off the trigger class selection (doesn't work for MC)
634 fCuts->SetTriggerClass("");
636 // MC vertex, to be used, in case, for pp
637 if (fUseMCVertex) fCuts->SetUseMCVertex();
639 if (fCentralitySelection){ // keep only the requested centrality
640 if(fCuts->IsEventSelectedInCentrality(aodEvent)!=0) {
641 delete[] containerInput;
642 delete[] containerInputMC;
646 } else { // keep all centralities
647 fCuts->SetMinCentrality(0.);
648 fCuts->SetMaxCentrality(100.);
651 Float_t centValue = fCuts->GetCentrality(aodEvent);
652 cfVtxHF->SetCentralityValue(centValue);
654 // number of tracklets - multiplicity estimator
655 Double_t multiplicity = (Double_t)(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aodEvent,-1.,1.)); // casted to double because the CF is filled with doubles
656 cfVtxHF->SetMultiplicity(multiplicity);
658 for (Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) {
659 AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(mcArray->At(iPart));
661 AliError("Failed casting particle from MC array!, Skipping particle");
664 // check the MC-level cuts, must be the desidered particle
665 if (!fCFManager->CheckParticleCuts(0, mcPart)) {
666 AliDebug(2,"Check the MC-level cuts - not desidered particle");
667 continue; // 0 stands for MC level
669 cfVtxHF->SetMCCandidateParam(iPart);
672 cquarks += cfVtxHF->MCcquarkCounting(mcPart);
674 if (!(cfVtxHF->SetLabelArray())){
675 AliDebug(2,Form("Impossible to set the label array (decaychannel = %d)",fDecayChannel));
679 //check the candiate family at MC level
680 if (!(cfVtxHF->CheckMCPartFamily(mcPart, mcArray))) {
681 AliDebug(2,Form("Check on the family wrong!!! (decaychannel = %d)",fDecayChannel));
685 AliInfo(Form("Check on the family OK!!! (decaychannel = %d)",fDecayChannel));
688 //Fill the MC container
689 Bool_t mcContainerFilled = cfVtxHF -> FillMCContainer(containerInputMC);
690 AliDebug(2,Form("mcContainerFilled = %d)",mcContainerFilled));
691 if (mcContainerFilled) {
693 if (fFuncWeight){ // using user-defined function
694 AliDebug(2,"Using function");
695 fWeight = fFuncWeight->Eval(containerInputMC[0]);
698 AliDebug(2,"Using FONLL");
699 fWeight = GetWeight(containerInputMC[0]);
701 AliDebug(2,Form("pt = %f, weight = %f",containerInputMC[0], fWeight));
703 if (!fCuts->IsInFiducialAcceptance(containerInputMC[0],containerInputMC[1])) continue;
704 //MC Limited Acceptance
705 if (TMath::Abs(containerInputMC[1]) < 0.5) {
706 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepGeneratedLimAcc, fWeight);
707 AliDebug(3,"MC Lim Acc container filled\n");
711 fCFManager->GetParticleContainer()->Fill(containerInputMC, kStepGenerated, fWeight);
713 AliDebug(3,"MC cointainer filled \n");
716 // check the MC-Acceptance level cuts
717 // since standard CF functions are not applicable, using Kine Cuts on daughters
718 Bool_t mcAccepStep = cfVtxHF-> MCAcceptanceStep();
720 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepAcceptance, fWeight);
721 AliDebug(3,"MC acceptance cut passed\n");
725 if (fCuts->IsEventSelected(aodEvent)){
726 // filling the container if the vertex is ok
727 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepVertex, fWeight) ;
728 AliDebug(3,"Vertex cut passed and container filled\n");
731 //mc Refit requirement
732 Bool_t mcRefitStep = cfVtxHF->MCRefitStep(aodEvent, &trackCuts[0]);
734 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepRefit, fWeight);
735 AliDebug(3,"MC Refit cut passed and container filled\n");
739 AliDebug(3,"MC Refit cut not passed\n");
744 AliDebug (3, "MC vertex step not passed\n");
749 AliDebug (3, "MC in acceptance step not passed\n");
754 AliDebug (3, "MC container not filled\n");
758 if (cquarks<2) AliDebug(2,Form("Event with %d c-quarks", cquarks));
759 AliDebug(2,Form("Found %i MC particles that are %s!!",icountMC,fPartName.Data()));
760 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Acc cuts!!",icountAcc,fPartName.Data()));
761 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Vertex cuts!!",icountVertex,fPartName.Data()));
762 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Refit cuts!!",icountRefit,fPartName.Data()));
764 // Now go to rec level
765 fCountMC += icountMC;
766 fCountAcc += icountAcc;
767 fCountVertex+= icountVertex;
768 fCountRefit+= icountRefit;
770 AliDebug(2,Form("Found %d vertices for decay channel %d",arrayBranch->GetEntriesFast(),fDecayChannel));
772 for(Int_t iCandid = 0; iCandid<arrayBranch->GetEntriesFast();iCandid++){
773 AliAODRecoDecayHF* charmCandidate=0x0;
774 switch (fDecayChannel){
776 charmCandidate = (AliAODRecoDecayHF2Prong*)arrayBranch->At(iCandid);
781 charmCandidate = (AliAODRecoCascadeHF*)arrayBranch->At(iCandid);
787 charmCandidate = (AliAODRecoDecayHF3Prong*)arrayBranch->At(iCandid);
791 charmCandidate = (AliAODRecoDecayHF4Prong*)arrayBranch->At(iCandid);
798 Bool_t unsetvtx=kFALSE;
799 if(!charmCandidate->GetOwnPrimaryVtx()) {
800 charmCandidate->SetOwnPrimaryVtx(aodVtx); // needed to compute all variables
804 Bool_t signAssociation = cfVtxHF->SetRecoCandidateParam((AliAODRecoDecayHF*)charmCandidate);
805 if (!signAssociation){
806 charmCandidate = 0x0;
810 Int_t isPartOrAntipart = cfVtxHF->CheckReflexion(fSign);
811 if (isPartOrAntipart == 0){
812 AliDebug(2, Form("The candidate pdg code doesn't match the requirement set in the task (fSign = %d)",fSign));
816 AliDebug(3,Form("iCandid=%d - signAssociation=%d, isPartOrAntipart=%d",iCandid, signAssociation, isPartOrAntipart));
818 Bool_t recoContFilled = cfVtxHF->FillRecoContainer(containerInput);
821 // weight according to pt
823 if (fFuncWeight){ // using user-defined function
824 AliDebug(2, "Using function");
825 fWeight = fFuncWeight->Eval(containerInput[0]);
828 AliDebug(2, "Using FONLL");
829 fWeight = GetWeight(containerInput[0]);
831 AliDebug(2, Form("pt = %f, weight = %f",containerInput[0], fWeight));
834 if (!fCuts->IsInFiducialAcceptance(containerInput[0],containerInput[1])) continue;
837 Bool_t recoStep = cfVtxHF->RecoStep();
838 Bool_t vtxCheck = fCuts->IsEventSelected(aodEvent);
841 // Selection on the filtering bit
842 Bool_t isBitSelected = kTRUE;
843 if(fDecayChannel==2) {
844 if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) isBitSelected = kFALSE;
845 }else if(fDecayChannel==31){
846 if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kDplusCuts)) isBitSelected = kFALSE;
847 }else if(fDecayChannel==33){
848 if(fUseSelectionBit && !charmCandidate->HasSelectionBit(AliRDHFCuts::kDsCuts)) isBitSelected = kFALSE;
850 if(!isBitSelected) continue;
854 if (recoStep && recoContFilled && vtxCheck){
855 fCFManager->GetParticleContainer()->Fill(containerInput,kStepReconstructed, fWeight) ;
857 AliDebug(3,"Reco step passed and container filled\n");
859 //Reco in the acceptance -- take care of UNFOLDING!!!!
860 Bool_t recoAcceptanceStep = cfVtxHF->RecoAcceptStep(&trackCuts[0]);
861 if (recoAcceptanceStep) {
862 fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoAcceptance, fWeight) ;
864 AliDebug(3,"Reco acceptance cut passed and container filled\n");
867 Double_t fill[4]; //fill response matrix
868 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fill);
869 if (bUnfolding) fCorrelation->Fill(fill);
872 //Number of ITS cluster requirements
873 Int_t recoITSnCluster = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kTracks);
874 if (recoITSnCluster){
875 fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoITSClusters, fWeight) ;
876 icountRecoITSClusters++;
877 AliDebug(3,"Reco n ITS cluster cut passed and container filled\n");
879 Bool_t iscutsusingpid = fCuts->GetIsUsePID();
880 Int_t recoAnalysisCuts = -1, recoPidSelection = -1;
881 fCuts->SetUsePID(kFALSE);
882 recoAnalysisCuts = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
884 if (fDecayChannel==33){ // Ds case, where more possibilities are considered
885 Bool_t keepDs=ProcessDs(recoAnalysisCuts);
886 if(keepDs) recoAnalysisCuts=3;
888 else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
889 Bool_t keepLctoV0bachelor=ProcessLctoV0Bachelor(recoAnalysisCuts);
890 if (keepLctoV0bachelor) recoAnalysisCuts=3;
895 fCuts->SetUsePID(iscutsusingpid); //restoring usage of the PID from the cuts object
896 Bool_t tempAn=(recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart);
897 if (fDecayChannel == 32) tempAn=(recoAnalysisCuts >0 || recoAnalysisCuts == isPartOrAntipart);
900 fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPPR, fWeight);
902 AliDebug(3,"Reco Analysis cuts passed and container filled \n");
904 //recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kPID);
905 //if((fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==isPartOrAntipart)||(fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==3)){
906 recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
908 if (fDecayChannel==33){ // Ds case, where more possibilities are considered
909 Bool_t keepDs=ProcessDs(recoPidSelection);
910 if(keepDs) recoPidSelection=3;
911 } else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
912 Bool_t keepLctoV0bachelor=ProcessLctoV0Bachelor(recoAnalysisCuts);
913 if (keepLctoV0bachelor) recoAnalysisCuts=3;
916 Bool_t tempPid=(recoPidSelection == 3 || recoPidSelection == isPartOrAntipart);
917 if (fDecayChannel == 32) tempPid=(recoPidSelection >0 || recoPidSelection == isPartOrAntipart);
920 fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPID, fWeight);
922 AliDebug(3,"Reco PID cuts passed and container filled \n");
924 Double_t fill[4]; //fill response matrix
925 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fill);
926 if (bUnfolding) fCorrelation->Fill(fill);
930 AliDebug(3, "Analysis Cuts step not passed \n");
935 AliDebug(3, "PID selection not passed \n");
940 AliDebug(3, "Number of ITS cluster step not passed\n");
945 AliDebug(3, "Reco acceptance step not passed\n");
950 AliDebug(3, "Reco step not passed\n");
955 if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
956 } // end loop on candidate
958 fCountReco+= icountReco;
959 fCountRecoAcc+= icountRecoAcc;
960 fCountRecoITSClusters+= icountRecoITSClusters;
961 fCountRecoPPR+= icountRecoPPR;
962 fCountRecoPID+= icountRecoPID;
964 fHistEventsProcessed->Fill(0);
966 delete[] containerInput;
967 delete[] containerInputMC;
970 // for (Int_t i=0; i<cfVtxHF->GetNProngs(); i++){
971 // delete [] trackCuts[i];
979 //___________________________________________________________________________
980 void AliCFTaskVertexingHF::Terminate(Option_t*)
982 // The Terminate() function is the last function to be called during
983 // a query. It always runs on the client, it can be used to present
984 // the results graphically or save the results to file.
986 AliAnalysisTaskSE::Terminate();
988 AliInfo(Form("Found %i MC particles that are %s in MC, in %d events",fCountMC,fPartName.Data(),fEvents));
989 AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, in %d events",fCountAcc,fPartName.Data(),fEvents));
990 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));
991 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));
992 AliInfo(Form("Found %i reco %s that are decaying in %s, in %d events",fCountReco,fPartName.Data(),fDauNames.Data(),fEvents));
993 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));
994 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));
995 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));
996 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));
998 // draw some example plots....
999 AliCFContainer *cont= dynamic_cast<AliCFContainer*> (GetOutputData(2));
1001 printf("CONTAINER NOT FOUND\n");
1004 // projecting the containers to obtain histograms
1005 // first argument = variable, second argument = step
1007 TH1D** h = new TH1D*[3];
1008 Int_t nvarToPlot = 0;
1009 if (fConfiguration == kSnail){
1010 //h = new TH1D[3][12];
1011 for (Int_t ih = 0; ih<3; ih++){
1012 if(fDecayChannel==22){
1017 h[ih] = new TH1D[nvarToPlot];
1019 for(Int_t iC=1;iC<nvarToPlot; iC++){
1021 h[0][iC] = *(cont->ShowProjection(iC,0));
1022 // MC-Acceptance level
1023 h[1][iC] = *(cont->ShowProjection(iC,1));
1025 h[2][iC] = *(cont->ShowProjection(iC,4));
1029 //h = new TH1D[3][12];
1031 for (Int_t ih = 0; ih<3; ih++){
1032 h[ih] = new TH1D[nvarToPlot];
1034 for(Int_t iC=0;iC<nvarToPlot; iC++){
1036 h[0][iC] = *(cont->ShowProjection(iC,0));
1037 // MC-Acceptance level
1038 h[1][iC] = *(cont->ShowProjection(iC,1));
1040 h[2][iC] = *(cont->ShowProjection(iC,4));
1044 //Int_t nvarToPlot = 0;
1045 if (fConfiguration == kSnail){
1046 if(fDecayChannel==31){
1048 titles = new TString[nvarToPlot];
1049 titles[0]="pT_Dplus (GeV/c)";
1050 titles[1]="rapidity";
1051 titles[2]="phi (rad)";
1052 titles[3]="cT (#mum)";
1053 titles[4]="cosPointingAngle";
1054 titles[5]="pT_1 (GeV/c)";
1055 titles[6]="pT_2 (GeV/c)";
1056 titles[7]="pT_3 (GeV/c)";
1057 titles[8]="d0_1 (#mum)";
1058 titles[9]="d0_2 (#mum)";
1059 titles[10]="d0_3 (#mum)";
1060 titles[11]="zVertex (cm)";
1061 } else if (fDecayChannel==22) {
1063 titles = new TString[nvarToPlot];
1064 titles[0]="pT_Lc (GeV/c)";
1065 titles[1]="rapidity";
1066 titles[2]="phi (rad)";
1067 titles[3]="cosPAV0";
1068 titles[4]="onTheFlyStatusV0";
1069 titles[5]="centrality";
1071 titles[7]="multiplicity";
1072 titles[8]="pT_bachelor (GeV/c)";
1073 titles[9]="pT_V0pos (GeV/c)";
1074 titles[10]="pT_V0neg (GeV/c)";
1075 titles[11]="invMassV0 (GeV/c2)";
1076 titles[12]="dcaV0 (nSigma)";
1077 titles[13]="c#tauV0 (#mum)";
1078 titles[14]="c#tau (#mum)";
1082 titles = new TString[nvarToPlot];
1083 titles[0]="pT_D0 (GeV/c)";
1084 titles[1]="rapidity";
1085 titles[2]="cosThetaStar";
1086 titles[3]="pT_pi (GeV/c)";
1087 titles[4]="pT_K (Gev/c)";
1088 titles[5]="cT (#mum)";
1089 titles[6]="dca (#mum)";
1090 titles[7]="d0_pi (#mum)";
1091 titles[8]="d0_K (#mum)";
1092 titles[9]="d0xd0 (#mum^2)";
1093 titles[10]="cosPointingAngle";
1094 titles[11]="phi (rad)";
1099 titles = new TString[nvarToPlot];
1100 if (fDecayChannel==22) {
1101 titles[0]="pT_candidate (GeV/c)";
1102 titles[1]="rapidity";
1103 titles[2]="phi (rad)";
1104 titles[3]="cosPAV0";
1105 titles[4]="onTheFlyStatusV0";
1106 titles[5]="centrality";
1108 titles[7]="multiplicity";
1110 titles[0]="pT_candidate (GeV/c)";
1111 titles[1]="rapidity";
1112 titles[2]="cT (#mum)";
1114 titles[4]="z_{vtx}";
1115 titles[5]="centrality";
1117 titles[7]="multiplicity";
1121 Int_t markers[16]={20,24,21,25,27,28,
1124 Int_t colors[3]={2,8,4};
1125 for(Int_t iC=0;iC<nvarToPlot; iC++){
1126 for(Int_t iStep=0;iStep<3;iStep++){
1127 h[iStep][iC].SetTitle(titles[iC].Data());
1128 h[iStep][iC].GetXaxis()->SetTitle(titles[iC].Data());
1129 Double_t maxh=h[iStep][iC].GetMaximum();
1130 h[iStep][iC].GetYaxis()->SetRangeUser(0,maxh*1.2);
1131 h[iStep][iC].SetMarkerStyle(markers[iC]);
1132 h[iStep][iC].SetMarkerColor(colors[iStep]);
1136 gStyle->SetCanvasColor(0);
1137 gStyle->SetFrameFillColor(0);
1138 gStyle->SetTitleFillColor(0);
1139 gStyle->SetStatColor(0);
1141 // drawing in 2 separate canvas for a matter of clearity
1142 TCanvas * c1 =new TCanvas(Form("c1New_%d",fDecayChannel),"Vars 0, 1, 2, 3",1100,1200);
1145 for(Int_t iVar=0; iVar<4; iVar++){
1147 h[0][iVar].DrawCopy("p");
1149 h[1][iVar].DrawCopy("p");
1151 h[2][iVar].DrawCopy("p");
1154 TCanvas * c2 =new TCanvas(Form("c2New_%d",fDecayChannel),"Vars 4, 5, 6, 7",1100,1200);
1157 for(Int_t iVar=4; iVar<8; iVar++){
1159 h[0][iVar].DrawCopy("p");
1161 h[1][iVar].DrawCopy("p");
1163 h[2][iVar].DrawCopy("p");
1166 if (fConfiguration == kSnail){
1167 TCanvas * c3 =new TCanvas(Form("c3New_%d",fDecayChannel),"Vars 8, 9, 10, 11",1100,1200);
1170 for(Int_t iVar=8; iVar<12; iVar++){
1172 h[0][iVar].DrawCopy("p");
1174 h[1][iVar].DrawCopy("p");
1176 h[2][iVar].DrawCopy("p");
1178 if (fDecayChannel==22) {
1179 TCanvas * c4 =new TCanvas(Form("c4New_%d",fDecayChannel),"Vars 12, 13, 14, 15",1100,1200);
1182 for(Int_t iVar=12; iVar<16; iVar++){
1184 h[0][iVar].DrawCopy("p");
1186 h[1][iVar].DrawCopy("p");
1188 h[2][iVar].DrawCopy("p");
1194 THnSparseD* hcorr = dynamic_cast<THnSparseD*> (GetOutputData(3));
1196 TH2D* corr1 = hcorr->Projection(0,2);
1197 TH2D* corr2 = hcorr->Projection(1,3);
1199 TCanvas * c7 =new TCanvas(Form("c7New_%d",fDecayChannel),"",800,400);
1202 corr1->DrawCopy("text");
1204 corr2->DrawCopy("text");
1206 TFile* file_projection = new TFile("CFtaskHFprojectionNew.root","RECREATE");
1211 for(Int_t iC=0;iC<nvarToPlot; iC++){
1212 for(Int_t iStep=0;iStep<3;iStep++){
1213 h[iStep][iC].Write(Form("Step%d_%s",iStep,titles[iC].Data()));
1216 file_projection->Close();
1217 for (Int_t ih = 0; ih<3; ih++) delete [] h[ih];
1223 //___________________________________________________________________________
1224 void AliCFTaskVertexingHF::UserCreateOutputObjects()
1226 //HERE ONE CAN CREATE OUTPUT OBJECTS, IN PARTICULAR IF THE OBJECT PARAMETERS DON'T NEED
1227 //TO BE SET BEFORE THE EXECUTION OF THE TASK
1229 Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName());
1231 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
1232 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1233 AliPIDResponse *localPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
1235 if (fCuts->GetIsUsePID() && fDecayChannel==22) {
1237 fCuts->GetPidHF()->SetPidResponse(localPIDResponse);
1238 fCuts->GetPidHF()->SetOldPid(kFALSE);
1239 AliRDHFCutsLctoV0* lcv0Cuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
1241 lcv0Cuts->GetPidV0pos()->SetPidResponse(localPIDResponse);
1242 lcv0Cuts->GetPidV0neg()->SetPidResponse(localPIDResponse);
1243 lcv0Cuts->GetPidV0pos()->SetOldPid(kFALSE);
1244 lcv0Cuts->GetPidV0neg()->SetOldPid(kFALSE);
1250 const char* nameoutput=GetOutputSlot(1)->GetContainer()->GetName();
1251 fHistEventsProcessed = new TH1I(nameoutput,"",1,0,1) ;
1253 PostData(1,fHistEventsProcessed) ;
1254 PostData(2,fCFManager->GetParticleContainer()) ;
1255 PostData(3,fCorrelation) ;
1260 //_________________________________________________________________________
1261 Double_t AliCFTaskVertexingHF::GetWeight(Float_t pt)
1264 // calculating the weight to fill the container
1268 // p0 = 1.63297e-01 --> 0.322643
1274 // p0 = 1.85906e-01 --> 0.36609
1279 Double_t func1[4] = {0.322643,2.96275,2.30301,2.5};
1280 Double_t func2[4] = {0.36609,1.94635,1.40463,2.5};
1282 Double_t dndpt_func1 = dNdptFit(pt,func1);
1283 if(fUseFlatPtWeight) dndpt_func1 = 1./30.;
1284 Double_t dndpt_func2 = dNdptFit(pt,func2);
1285 AliDebug(2,Form("pt = %f, FONLL = %f, Pythia = %f, ratio = %f",pt,dndpt_func1,dndpt_func2,dndpt_func1/dndpt_func2));
1286 return dndpt_func1/dndpt_func2;
1289 //__________________________________________________________________________________________________
1290 Double_t AliCFTaskVertexingHF::dNdptFit(Float_t pt, Double_t* par)
1293 // calculating dNdpt
1296 Double_t denom = TMath::Power((pt/par[1]), par[3] );
1297 Double_t dNdpt = par[0]*pt/TMath::Power(1.+denom, par[2]);
1302 //__________________________________________________________________________________________________
1303 Double_t AliCFTaskVertexingHF::GetZWeight(Float_t z, Int_t runnumber){
1305 // calculating the z-vtx weight for the given run range
1308 if(runnumber>146824 || runnumber<146803) return 1.0;
1310 Double_t func1[3] = {1.0, -0.5, 6.5 };
1311 Double_t func2[3] = {1.0, -0.5, 5.5 };
1313 Double_t dzFunc1 = DodzFit(z,func1);
1314 Double_t dzFunc2 = DodzFit(z,func2);
1316 return dzFunc1/dzFunc2;
1319 //__________________________________________________________________________________________________
1320 Double_t AliCFTaskVertexingHF::DodzFit(Float_t z, Double_t* par) {
1323 // Gaussian z-vtx shape
1325 //gaussian = [0]/TMath::Sqrt(2.*TMath::Pi())/[2]*exp[-(x-[1])*(x-[1])/(2*[2]*[2])]
1327 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]);
1331 //__________________________________________________________________________________________________
1332 Double_t AliCFTaskVertexingHF::GetNchWeight(Int_t nch){
1334 // calculates the Nch weight using the measured and generateed Nch distributions
1336 if(nch<=0) return 0.;
1337 Double_t pMeas=fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(nch));
1338 Double_t pMC=fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(nch));
1341 //__________________________________________________________________________________________________
1342 void AliCFTaskVertexingHF::CreateMeasuredNchHisto(){
1343 // creates historgam with measured multiplcity distribution in pp 7 TeV collisions (from Eur. Phys. J. C (2010) 68: 345–354)
1344 Double_t nchbins[66]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1345 10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1346 20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1347 30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1348 40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1349 50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1350 60.50,62.50,64.50,66.50,68.50,70.50};
1351 Double_t pch[65]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1352 0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1353 0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1354 0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1355 0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1356 0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1357 0.000296,0.000265,0.000193,0.00016,0.000126};
1359 if(fHistoMeasNch) delete fHistoMeasNch;
1360 fHistoMeasNch=new TH1F("hMeaseNch","",65,nchbins);
1361 for(Int_t i=0; i<65; i++){
1362 fHistoMeasNch->SetBinContent(i+1,pch[i]);
1363 fHistoMeasNch->SetBinError(i+1,0.);
1367 //__________________________________________________________________________________________________
1368 Bool_t AliCFTaskVertexingHF::ProcessDs(Int_t recoAnalysisCuts) const{
1369 // processes output of Ds is selected
1371 if(recoAnalysisCuts > 0){
1372 Int_t isKKpi=recoAnalysisCuts&1;
1373 Int_t ispiKK=recoAnalysisCuts&2;
1374 Int_t isPhiKKpi=recoAnalysisCuts&4;
1375 Int_t isPhipiKK=recoAnalysisCuts&8;
1376 Int_t isK0starKKpi=recoAnalysisCuts&16;
1377 Int_t isK0starpiKK=recoAnalysisCuts&32;
1379 if(isKKpi && isPhiKKpi) keep=kTRUE;
1380 if(ispiKK && isPhipiKK) keep=kTRUE;
1382 else if(fDsOption==2){
1383 if(isKKpi && isK0starKKpi) keep=kTRUE;
1384 if(ispiKK && isK0starpiKK) keep=kTRUE;
1386 else if(fDsOption==3)keep=kTRUE;
1390 //__________________________________________________________________________________________________
1391 Bool_t AliCFTaskVertexingHF::ProcessLctoV0Bachelor(Int_t recoAnalysisCuts) const{
1392 // processes output of Lc->V0+bnachelor is selected
1394 if(recoAnalysisCuts > 0){
1396 Int_t isK0Sp = recoAnalysisCuts&1;
1397 Int_t isLambdaBarpi = recoAnalysisCuts&2;
1398 Int_t isLambdapi = recoAnalysisCuts&4;
1400 if(fLctoV0bachelorOption==1){
1401 if(isK0Sp) keep=kTRUE;
1403 else if(fLctoV0bachelorOption==2){
1404 if(isLambdaBarpi) keep=kTRUE;
1406 else if(fLctoV0bachelorOption==4){
1407 if(isLambdapi) keep=kTRUE;
1409 else if(fLctoV0bachelorOption==7) {
1410 if (isK0Sp || isLambdaBarpi || isLambdapi) keep=kTRUE;