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)
129 //___________________________________________________________________________
130 AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts, TF1* func) :
131 AliAnalysisTaskSE(name),
133 fHistEventsProcessed(0x0),
141 fCountRecoITSClusters(0),
146 fFillFromGenerated(kFALSE),
147 fOriginDselection(0),
148 fAcceptanceUnf(kTRUE),
152 fUseFlatPtWeight(kFALSE),
154 fUseNchWeight(kFALSE),
159 fCentralitySelection(kTRUE),
161 fRejectIfNoQuark(kTRUE),
162 fUseMCVertex(kFALSE),
165 fConfiguration(kCheetah), // by default, setting the fast configuration
170 fLctoV0bachelorOption(1),
171 fGenLctoV0bachelorOption(0)
174 // Constructor. Initialization of Inputs and Outputs
177 DefineInput(0) and DefineOutput(0)
178 are taken care of by AliAnalysisTaskSE constructor
180 DefineOutput(1,TH1I::Class());
181 DefineOutput(2,AliCFContainer::Class());
182 DefineOutput(3,THnSparseD::Class());
183 DefineOutput(4,AliRDHFCuts::Class());
188 //___________________________________________________________________________
189 AliCFTaskVertexingHF& AliCFTaskVertexingHF::operator=(const AliCFTaskVertexingHF& c)
192 // Assignment operator
195 AliAnalysisTaskSE::operator=(c) ;
196 fCFManager = c.fCFManager;
197 fHistEventsProcessed = c.fHistEventsProcessed;
199 fFuncWeight = c.fFuncWeight;
200 fHistoMeasNch = c.fHistoMeasNch;
201 fHistoMCNch = c.fHistoMCNch;
206 //___________________________________________________________________________
207 AliCFTaskVertexingHF::AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c) :
208 AliAnalysisTaskSE(c),
209 fCFManager(c.fCFManager),
210 fHistEventsProcessed(c.fHistEventsProcessed),
211 fCorrelation(c.fCorrelation),
212 fCountMC(c.fCountMC),
213 fCountAcc(c.fCountAcc),
214 fCountVertex(c.fCountVertex),
215 fCountRefit(c.fCountRefit),
216 fCountReco(c.fCountReco),
217 fCountRecoAcc(c.fCountRecoAcc),
218 fCountRecoITSClusters(c.fCountRecoITSClusters),
219 fCountRecoPPR(c.fCountRecoPPR),
220 fCountRecoPID(c.fCountRecoPID),
222 fDecayChannel(c.fDecayChannel),
223 fFillFromGenerated(c.fFillFromGenerated),
224 fOriginDselection(c.fOriginDselection),
225 fAcceptanceUnf(c.fAcceptanceUnf),
227 fUseWeight(c.fUseWeight),
229 fUseFlatPtWeight(c.fUseFlatPtWeight),
230 fUseZWeight(c.fUseZWeight),
231 fUseNchWeight(c.fUseNchWeight),
233 fPartName(c.fPartName),
234 fDauNames(c.fDauNames),
236 fCentralitySelection(c.fCentralitySelection),
237 fFakeSelection(c.fFakeSelection),
238 fRejectIfNoQuark(c.fRejectIfNoQuark),
239 fUseMCVertex(c.fUseMCVertex),
240 fDsOption(c.fDsOption),
241 fGenDsOption(c.fGenDsOption),
242 fConfiguration(c.fConfiguration),
243 fFuncWeight(c.fFuncWeight),
244 fHistoMeasNch(c.fHistoMeasNch),
245 fHistoMCNch(c.fHistoMCNch),
246 fResonantDecay(c.fResonantDecay),
247 fLctoV0bachelorOption(c.fLctoV0bachelorOption),
248 fGenLctoV0bachelorOption(c.fGenLctoV0bachelorOption)
255 //___________________________________________________________________________
256 AliCFTaskVertexingHF::~AliCFTaskVertexingHF()
261 if (fCFManager) delete fCFManager ;
262 if (fHistEventsProcessed) delete fHistEventsProcessed ;
263 if (fCorrelation) delete fCorrelation ;
264 if (fCuts) delete fCuts;
265 if (fFuncWeight) delete fFuncWeight;
266 if (fHistoMeasNch) delete fHistoMeasNch;
267 if (fHistoMCNch) delete fHistoMCNch;
270 //_________________________________________________________________________-
271 void AliCFTaskVertexingHF::Init()
277 if (fDebug>1) printf("AliCFTaskVertexingHF::Init()");
278 if(fUseWeight && fUseZWeight) { AliFatal("Can not use at the same time pt and z-vtx weights, please choose"); return; }
279 if(fUseWeight && fUseNchWeight) { AliFatal("Can not use at the same time pt and Nch weights, please choose"); return; }
280 if(fUseNchWeight && !fHistoMCNch) { AliFatal("Need to pass the MC Nch distribution to use Nch weights"); return; }
281 if(fUseNchWeight) CreateMeasuredNchHisto();
283 AliRDHFCuts *copyfCuts = 0x0;
285 AliFatal("No cuts defined - Exiting...");
289 switch (fDecayChannel){
291 copyfCuts = new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fCuts)));
292 switch (fConfiguration) {
293 case kSnail: // slow configuration: all variables in
296 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
305 copyfCuts = new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fCuts)));
306 switch (fConfiguration) {
307 case kSnail: // slow configuration: all variables in
310 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
319 copyfCuts = new AliRDHFCutsLctoV0(*(static_cast<AliRDHFCutsLctoV0*>(fCuts)));
320 switch (fConfiguration) {
321 case kSnail: // slow configuration: all variables in
324 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
329 fDauNames="V0+bachelor";
333 copyfCuts = new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fCuts)));
334 switch (fConfiguration) {
335 case kSnail: // slow configuration: all variables in
338 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
347 copyfCuts = new AliRDHFCutsLctopKpi(*(static_cast<AliRDHFCutsLctopKpi*>(fCuts)));
348 switch (fConfiguration) {
349 case kSnail: // slow configuration: all variables in
352 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
361 copyfCuts = new AliRDHFCutsDstoKKpi(*(static_cast<AliRDHFCutsDstoKKpi*>(fCuts)));
362 switch (fConfiguration) {
363 case kSnail: // slow configuration: all variables in
366 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
375 copyfCuts = new AliRDHFCutsD0toKpipipi(*(static_cast<AliRDHFCutsD0toKpipipi*>(fCuts)));
376 switch (fConfiguration) {
377 case kSnail: // slow configuration: all variables in
380 case kCheetah:// fast configuration: only pt_candidate, y, phi, ct, fake, z_vtx, centrality, multiplicity will be filled
385 fDauNames="K+pi+pi+pi";
389 AliFatal("The decay channel MUST be defined according to AliCFVertexing::DecayChannel - Exiting...");
393 const char* nameoutput=GetOutputSlot(4)->GetContainer()->GetName();
395 copyfCuts->SetName(nameoutput);
398 PostData(4, copyfCuts);
401 AliFatal("Failing initializing AliRDHFCuts object - Exiting...");
407 //_________________________________________________
408 void AliCFTaskVertexingHF::UserExec(Option_t *)
411 // Main loop function
414 PostData(1,fHistEventsProcessed) ;
415 PostData(2,fCFManager->GetParticleContainer()) ;
416 PostData(3,fCorrelation) ;
418 if (fFillFromGenerated){
419 AliWarning("Flag to fill container with generated value ON ---> dca, d0pi, d0K, d0xd0, cosPointingAngle will be set as dummy!");
423 Error("UserExec","NO EVENT FOUND!");
427 AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
429 TClonesArray *arrayBranch=0;
431 if(!aodEvent && AODEvent() && IsStandardAOD()) {
432 // In case there is an AOD handler writing a standard AOD, use the AOD
433 // event in memory rather than the input (ESD) event.
434 aodEvent = dynamic_cast<AliAODEvent*> (AODEvent());
435 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
436 // have to taken from the AOD event hold by the AliAODExtension
437 AliAODHandler* aodHandler = (AliAODHandler*)
438 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
439 if(aodHandler->GetExtensions()) {
440 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
441 AliAODEvent *aodFromExt = ext->GetAOD();
443 switch (fDecayChannel){
445 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
449 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
453 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("CascadesHF");
459 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
463 arrayBranch=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm4Prong");
472 switch (fDecayChannel){
474 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("D0toKpi");
478 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Dstar");
482 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("CascadesHF");
488 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Charm3Prong");
492 arrayBranch=(TClonesArray*)aodEvent->GetList()->FindObject("Charm4Prong");
500 AliAODVertex *aodVtx = (AliAODVertex*)aodEvent->GetPrimaryVertex();
504 AliError("Could not find array of HF vertices");
510 fCFManager->SetRecEventInfo(aodEvent);
511 fCFManager->SetMCEventInfo(aodEvent);
513 //******** DEFINE number of variables of the container***** for now set at 13, in the future in the config macro.
515 //loop on the MC event
517 TClonesArray* mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
519 AliError("Could not find Monte-Carlo in AOD");
524 Int_t icountReco = 0;
525 Int_t icountVertex = 0;
526 Int_t icountRefit = 0;
527 Int_t icountRecoAcc = 0;
528 Int_t icountRecoITSClusters = 0;
529 Int_t icountRecoPPR = 0;
530 Int_t icountRecoPID = 0;
533 AliAODMCHeader *mcHeader = dynamic_cast<AliAODMCHeader*>(aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName()));
535 AliError("Could not find MC Header in AOD");
539 Double_t* containerInput = new Double_t[fNvar];
540 Double_t* containerInputMC = new Double_t[fNvar];
543 AliCFVertexingHF* cfVtxHF=0x0;
544 switch (fDecayChannel){
546 cfVtxHF = new AliCFVertexingHF2Prong(mcArray, fOriginDselection);
550 cfVtxHF = new AliCFVertexingHFCascade(mcArray, fOriginDselection);
554 cfVtxHF = new AliCFVertexingHFLctoV0bachelor(mcArray, fOriginDselection,fGenLctoV0bachelorOption); // Lc -> K0S+proton
560 cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel);
561 if(fDecayChannel==33){
562 ((AliCFVertexingHF3Prong*)cfVtxHF)->SetGeneratedDsOption(fGenDsOption);
567 cfVtxHF = new AliCFVertexingHF3Prong(mcArray, fOriginDselection, fDecayChannel,fResonantDecay);
570 //cfVtxHF = new AliCFVertexingHF4Prong(mcArray, originDselection); // not there yet
577 AliError("No AliCFVertexingHF initialized");
578 delete[] containerInput;
579 delete[] containerInputMC;
583 Double_t zPrimVertex = aodVtx ->GetZ();
584 Double_t zMCVertex = mcHeader->GetVtxZ();
585 Int_t runnumber = aodEvent->GetRunNumber();
587 if(fUseZWeight) fWeight *= GetZWeight(zMCVertex,runnumber);
589 Int_t nChargedMCPhysicalPrimary=AliVertexingHFUtils::GetGeneratedPhysicalPrimariesInEtaRange(mcArray,-1.0,1.0);
590 fWeight *= GetNchWeight(nChargedMCPhysicalPrimary);
591 AliDebug(2,Form("Using Nch weights, Mult=%d Weight=%f\n",nChargedMCPhysicalPrimary,fWeight));
594 if (TMath::Abs(zMCVertex) > fCuts->GetMaxVtxZ()){
595 AliDebug(3,Form("z coordinate of MC vertex = %f, it was required to be within [-%f, +%f], skipping event", zMCVertex, fCuts->GetMaxVtxZ(), fCuts->GetMaxVtxZ()));
596 delete[] containerInput;
597 delete[] containerInputMC;
601 AliESDtrackCuts** trackCuts = new AliESDtrackCuts*[cfVtxHF->GetNProngs()];
602 if (fDecayChannel == 21){
603 // for the D*, setting the third element of the array of the track cuts to those for the soft pion
604 for (Int_t iProng = 0; iProng<cfVtxHF->GetNProngs()-1; iProng++){
605 trackCuts[iProng]=fCuts->GetTrackCuts();
607 trackCuts[2] = fCuts->GetTrackCutsSoftPi();
609 else if (fDecayChannel == 22) {
610 // for the Lc->V0+bachelor, setting the second and third elements of the array of the track cuts to those for the V0 daughters
611 trackCuts[0]=fCuts->GetTrackCuts();
612 trackCuts[1]=fCuts->GetTrackCutsV0daughters();
613 trackCuts[2]=fCuts->GetTrackCutsV0daughters();
616 for (Int_t iProng = 0; iProng<cfVtxHF->GetNProngs(); iProng++){
617 trackCuts[iProng]=fCuts->GetTrackCuts();
621 //General settings: vertex, feed down and fill reco container with generated values.
622 cfVtxHF->SetRecoPrimVertex(zPrimVertex);
623 cfVtxHF->SetMCPrimaryVertex(zMCVertex);
624 cfVtxHF->SetFillFromGenerated(fFillFromGenerated);
625 cfVtxHF->SetNVar(fNvar);
626 cfVtxHF->SetFakeSelection(fFakeSelection);
627 cfVtxHF->SetRejectCandidateIfNotFromQuark(fRejectIfNoQuark);
628 cfVtxHF->SetConfiguration(fConfiguration);
630 // switch-off the trigger class selection (doesn't work for MC)
631 fCuts->SetTriggerClass("");
633 // MC vertex, to be used, in case, for pp
634 if (fUseMCVertex) fCuts->SetUseMCVertex();
636 if (fCentralitySelection){ // keep only the requested centrality
637 if(fCuts->IsEventSelectedInCentrality(aodEvent)!=0) {
638 delete[] containerInput;
639 delete[] containerInputMC;
643 } else { // keep all centralities
644 fCuts->SetMinCentrality(0.);
645 fCuts->SetMaxCentrality(100.);
648 Float_t centValue = fCuts->GetCentrality(aodEvent);
649 cfVtxHF->SetCentralityValue(centValue);
651 // number of tracklets - multiplicity estimator
652 Double_t multiplicity = (Double_t)(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aodEvent,-1.,1.)); // casted to double because the CF is filled with doubles
653 cfVtxHF->SetMultiplicity(multiplicity);
655 for (Int_t iPart=0; iPart<mcArray->GetEntriesFast(); iPart++) {
656 AliAODMCParticle* mcPart = dynamic_cast<AliAODMCParticle*>(mcArray->At(iPart));
658 AliError("Failed casting particle from MC array!, Skipping particle");
661 // check the MC-level cuts, must be the desidered particle
662 if (!fCFManager->CheckParticleCuts(0, mcPart)) {
663 AliDebug(2,"Check the MC-level cuts - not desidered particle");
664 continue; // 0 stands for MC level
666 cfVtxHF->SetMCCandidateParam(iPart);
669 cquarks += cfVtxHF->MCcquarkCounting(mcPart);
671 if (!(cfVtxHF->SetLabelArray())){
672 AliDebug(2,Form("Impossible to set the label array (decaychannel = %d)",fDecayChannel));
676 //check the candiate family at MC level
677 if (!(cfVtxHF->CheckMCPartFamily(mcPart, mcArray))) {
678 AliDebug(2,Form("Check on the family wrong!!! (decaychannel = %d)",fDecayChannel));
682 AliInfo(Form("Check on the family OK!!! (decaychannel = %d)",fDecayChannel));
685 //Fill the MC container
686 Bool_t mcContainerFilled = cfVtxHF -> FillMCContainer(containerInputMC);
687 AliDebug(2,Form("mcContainerFilled = %d)",mcContainerFilled));
688 if (mcContainerFilled) {
690 if (fFuncWeight){ // using user-defined function
691 AliDebug(2,"Using function");
692 fWeight = fFuncWeight->Eval(containerInputMC[0]);
695 AliDebug(2,"Using FONLL");
696 fWeight = GetWeight(containerInputMC[0]);
698 AliDebug(2,Form("pt = %f, weight = %f",containerInputMC[0], fWeight));
700 if (!fCuts->IsInFiducialAcceptance(containerInputMC[0],containerInputMC[1])) continue;
701 //MC Limited Acceptance
702 if (TMath::Abs(containerInputMC[1]) < 0.5) {
703 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepGeneratedLimAcc, fWeight);
704 AliDebug(3,"MC Lim Acc container filled\n");
708 fCFManager->GetParticleContainer()->Fill(containerInputMC, kStepGenerated, fWeight);
710 AliDebug(3,"MC cointainer filled \n");
713 // check the MC-Acceptance level cuts
714 // since standard CF functions are not applicable, using Kine Cuts on daughters
715 Bool_t mcAccepStep = cfVtxHF-> MCAcceptanceStep();
717 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepAcceptance, fWeight);
718 AliDebug(3,"MC acceptance cut passed\n");
722 if (fCuts->IsEventSelected(aodEvent)){
723 // filling the container if the vertex is ok
724 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepVertex, fWeight) ;
725 AliDebug(3,"Vertex cut passed and container filled\n");
728 //mc Refit requirement
729 Bool_t mcRefitStep = cfVtxHF->MCRefitStep(aodEvent, &trackCuts[0]);
731 fCFManager->GetParticleContainer()->Fill(containerInputMC,kStepRefit, fWeight);
732 AliDebug(3,"MC Refit cut passed and container filled\n");
736 AliDebug(3,"MC Refit cut not passed\n");
741 AliDebug (3, "MC vertex step not passed\n");
746 AliDebug (3, "MC in acceptance step not passed\n");
751 AliDebug (3, "MC container not filled\n");
755 if (cquarks<2) AliDebug(2,Form("Event with %d c-quarks", cquarks));
756 AliDebug(2,Form("Found %i MC particles that are %s!!",icountMC,fPartName.Data()));
757 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Acc cuts!!",icountAcc,fPartName.Data()));
758 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Vertex cuts!!",icountVertex,fPartName.Data()));
759 AliDebug(2,Form("Found %i MC particles that are %s and satisfy Refit cuts!!",icountRefit,fPartName.Data()));
761 // Now go to rec level
762 fCountMC += icountMC;
763 fCountAcc += icountAcc;
764 fCountVertex+= icountVertex;
765 fCountRefit+= icountRefit;
767 AliDebug(2,Form("Found %d vertices for decay channel %d",arrayBranch->GetEntriesFast(),fDecayChannel));
769 for(Int_t iCandid = 0; iCandid<arrayBranch->GetEntriesFast();iCandid++){
770 AliAODRecoDecayHF* charmCandidate=0x0;
771 switch (fDecayChannel){
773 charmCandidate = (AliAODRecoDecayHF2Prong*)arrayBranch->At(iCandid);
778 charmCandidate = (AliAODRecoCascadeHF*)arrayBranch->At(iCandid);
784 charmCandidate = (AliAODRecoDecayHF3Prong*)arrayBranch->At(iCandid);
788 charmCandidate = (AliAODRecoDecayHF4Prong*)arrayBranch->At(iCandid);
795 Bool_t unsetvtx=kFALSE;
796 if(!charmCandidate->GetOwnPrimaryVtx()) {
797 charmCandidate->SetOwnPrimaryVtx(aodVtx); // needed to compute all variables
801 Bool_t signAssociation = cfVtxHF->SetRecoCandidateParam((AliAODRecoDecayHF*)charmCandidate);
802 if (!signAssociation){
803 charmCandidate = 0x0;
807 Int_t isPartOrAntipart = cfVtxHF->CheckReflexion(fSign);
808 if (isPartOrAntipart == 0){
809 AliDebug(2, Form("The candidate pdg code doesn't match the requirement set in the task (fSign = %d)",fSign));
813 AliDebug(3,Form("iCandid=%d - signAssociation=%d, isPartOrAntipart=%d",iCandid, signAssociation, isPartOrAntipart));
815 Bool_t recoContFilled = cfVtxHF->FillRecoContainer(containerInput);
818 // weight according to pt
820 if (fFuncWeight){ // using user-defined function
821 AliDebug(2, "Using function");
822 fWeight = fFuncWeight->Eval(containerInput[0]);
825 AliDebug(2, "Using FONLL");
826 fWeight = GetWeight(containerInput[0]);
828 AliDebug(2, Form("pt = %f, weight = %f",containerInput[0], fWeight));
831 if (!fCuts->IsInFiducialAcceptance(containerInput[0],containerInput[1])) continue;
834 Bool_t recoStep = cfVtxHF->RecoStep();
835 Bool_t vtxCheck = fCuts->IsEventSelected(aodEvent);
838 if (recoStep && recoContFilled && vtxCheck){
839 fCFManager->GetParticleContainer()->Fill(containerInput,kStepReconstructed, fWeight) ;
841 AliDebug(3,"Reco step passed and container filled\n");
843 //Reco in the acceptance -- take care of UNFOLDING!!!!
844 Bool_t recoAcceptanceStep = cfVtxHF->RecoAcceptStep(&trackCuts[0]);
845 if (recoAcceptanceStep) {
846 fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoAcceptance, fWeight) ;
848 AliDebug(3,"Reco acceptance cut passed and container filled\n");
851 Double_t fill[4]; //fill response matrix
852 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fill);
853 if (bUnfolding) fCorrelation->Fill(fill);
856 //Number of ITS cluster requirements
857 Int_t recoITSnCluster = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kTracks);
858 if (recoITSnCluster){
859 fCFManager->GetParticleContainer()->Fill(containerInput,kStepRecoITSClusters, fWeight) ;
860 icountRecoITSClusters++;
861 AliDebug(3,"Reco n ITS cluster cut passed and container filled\n");
863 Bool_t iscutsusingpid = fCuts->GetIsUsePID();
864 Int_t recoAnalysisCuts = -1, recoPidSelection = -1;
865 fCuts->SetUsePID(kFALSE);
866 recoAnalysisCuts = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
868 if (fDecayChannel==33){ // Ds case, where more possibilities are considered
869 Bool_t keepDs=ProcessDs(recoAnalysisCuts);
870 if(keepDs) recoAnalysisCuts=3;
872 else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
873 Bool_t keepLctoV0bachelor=ProcessLctoV0Bachelor(recoAnalysisCuts);
874 if (keepLctoV0bachelor) recoAnalysisCuts=3;
879 fCuts->SetUsePID(iscutsusingpid); //restoring usage of the PID from the cuts object
880 Bool_t tempAn=(recoAnalysisCuts == 3 || recoAnalysisCuts == isPartOrAntipart);
881 if (fDecayChannel == 32) tempAn=(recoAnalysisCuts >0 || recoAnalysisCuts == isPartOrAntipart);
884 fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPPR, fWeight);
886 AliDebug(3,"Reco Analysis cuts passed and container filled \n");
888 //recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kPID);
889 //if((fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==isPartOrAntipart)||(fCuts->CombineSelectionLevels(3,recoAnalysisCuts,recoPidSelection)==3)){
890 recoPidSelection = fCuts->IsSelected(charmCandidate, AliRDHFCuts::kCandidate, aodEvent);
892 if (fDecayChannel==33){ // Ds case, where more possibilities are considered
893 Bool_t keepDs=ProcessDs(recoPidSelection);
894 if(keepDs) recoPidSelection=3;
895 } else if (fDecayChannel==22){ // Lc->V0+bachelor case, where more possibilities are considered
896 Bool_t keepLctoV0bachelor=ProcessLctoV0Bachelor(recoAnalysisCuts);
897 if (keepLctoV0bachelor) recoAnalysisCuts=3;
900 Bool_t tempPid=(recoPidSelection == 3 || recoPidSelection == isPartOrAntipart);
901 if (fDecayChannel == 32) tempPid=(recoPidSelection >0 || recoPidSelection == isPartOrAntipart);
904 fCFManager->GetParticleContainer()->Fill(containerInput, kStepRecoPID, fWeight);
906 AliDebug(3,"Reco PID cuts passed and container filled \n");
908 Double_t fill[4]; //fill response matrix
909 Bool_t bUnfolding = cfVtxHF -> FillUnfoldingMatrix(fill);
910 if (bUnfolding) fCorrelation->Fill(fill);
914 AliDebug(3, "Analysis Cuts step not passed \n");
919 AliDebug(3, "PID selection not passed \n");
924 AliDebug(3, "Number of ITS cluster step not passed\n");
929 AliDebug(3, "Reco acceptance step not passed\n");
934 AliDebug(3, "Reco step not passed\n");
939 if(unsetvtx) charmCandidate->UnsetOwnPrimaryVtx();
940 } // end loop on candidate
942 fCountReco+= icountReco;
943 fCountRecoAcc+= icountRecoAcc;
944 fCountRecoITSClusters+= icountRecoITSClusters;
945 fCountRecoPPR+= icountRecoPPR;
946 fCountRecoPID+= icountRecoPID;
948 fHistEventsProcessed->Fill(0);
950 delete[] containerInput;
951 delete[] containerInputMC;
954 // for (Int_t i=0; i<cfVtxHF->GetNProngs(); i++){
955 // delete [] trackCuts[i];
963 //___________________________________________________________________________
964 void AliCFTaskVertexingHF::Terminate(Option_t*)
966 // The Terminate() function is the last function to be called during
967 // a query. It always runs on the client, it can be used to present
968 // the results graphically or save the results to file.
970 AliAnalysisTaskSE::Terminate();
972 AliInfo(Form("Found %i MC particles that are %s in MC, in %d events",fCountMC,fPartName.Data(),fEvents));
973 AliInfo(Form("Found %i MC particles that are %s in MC and satisfy Acc cuts, in %d events",fCountAcc,fPartName.Data(),fEvents));
974 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));
975 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));
976 AliInfo(Form("Found %i reco %s that are decaying in %s, in %d events",fCountReco,fPartName.Data(),fDauNames.Data(),fEvents));
977 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));
978 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));
979 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));
980 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));
982 // draw some example plots....
983 AliCFContainer *cont= dynamic_cast<AliCFContainer*> (GetOutputData(2));
985 printf("CONTAINER NOT FOUND\n");
988 // projecting the containers to obtain histograms
989 // first argument = variable, second argument = step
991 TH1D** h = new TH1D*[3];
992 Int_t nvarToPlot = 0;
993 if (fConfiguration == kSnail){
994 //h = new TH1D[3][12];
995 for (Int_t ih = 0; ih<3; ih++){
996 if(fDecayChannel==22){
1001 h[ih] = new TH1D[nvarToPlot];
1003 for(Int_t iC=1;iC<nvarToPlot; iC++){
1005 h[0][iC] = *(cont->ShowProjection(iC,0));
1006 // MC-Acceptance level
1007 h[1][iC] = *(cont->ShowProjection(iC,1));
1009 h[2][iC] = *(cont->ShowProjection(iC,4));
1013 //h = new TH1D[3][12];
1015 for (Int_t ih = 0; ih<3; ih++){
1016 h[ih] = new TH1D[nvarToPlot];
1018 for(Int_t iC=0;iC<nvarToPlot; iC++){
1020 h[0][iC] = *(cont->ShowProjection(iC,0));
1021 // MC-Acceptance level
1022 h[1][iC] = *(cont->ShowProjection(iC,1));
1024 h[2][iC] = *(cont->ShowProjection(iC,4));
1028 //Int_t nvarToPlot = 0;
1029 if (fConfiguration == kSnail){
1030 if(fDecayChannel==31){
1032 titles = new TString[nvarToPlot];
1033 titles[0]="pT_Dplus (GeV/c)";
1034 titles[1]="rapidity";
1035 titles[2]="phi (rad)";
1036 titles[3]="cT (#mum)";
1037 titles[4]="cosPointingAngle";
1038 titles[5]="pT_1 (GeV/c)";
1039 titles[6]="pT_2 (GeV/c)";
1040 titles[7]="pT_3 (GeV/c)";
1041 titles[8]="d0_1 (#mum)";
1042 titles[9]="d0_2 (#mum)";
1043 titles[10]="d0_3 (#mum)";
1044 titles[11]="zVertex (cm)";
1045 } else if (fDecayChannel==22) {
1047 titles = new TString[nvarToPlot];
1048 titles[0]="pT_Lc (GeV/c)";
1049 titles[1]="rapidity";
1050 titles[2]="phi (rad)";
1051 titles[3]="cosPAV0";
1052 titles[4]="onTheFlyStatusV0";
1053 titles[5]="centrality";
1055 titles[7]="multiplicity";
1056 titles[8]="pT_bachelor (GeV/c)";
1057 titles[9]="pT_V0pos (GeV/c)";
1058 titles[10]="pT_V0neg (GeV/c)";
1059 titles[11]="invMassV0 (GeV/c2)";
1060 titles[12]="dcaV0 (nSigma)";
1061 titles[13]="c#tauV0 (#mum)";
1062 titles[14]="c#tau (#mum)";
1066 titles = new TString[nvarToPlot];
1067 titles[0]="pT_D0 (GeV/c)";
1068 titles[1]="rapidity";
1069 titles[2]="cosThetaStar";
1070 titles[3]="pT_pi (GeV/c)";
1071 titles[4]="pT_K (Gev/c)";
1072 titles[5]="cT (#mum)";
1073 titles[6]="dca (#mum)";
1074 titles[7]="d0_pi (#mum)";
1075 titles[8]="d0_K (#mum)";
1076 titles[9]="d0xd0 (#mum^2)";
1077 titles[10]="cosPointingAngle";
1078 titles[11]="phi (rad)";
1083 titles = new TString[nvarToPlot];
1084 if (fDecayChannel==22) {
1085 titles[0]="pT_candidate (GeV/c)";
1086 titles[1]="rapidity";
1087 titles[2]="phi (rad)";
1088 titles[3]="cosPAV0";
1089 titles[4]="onTheFlyStatusV0";
1090 titles[5]="centrality";
1092 titles[7]="multiplicity";
1094 titles[0]="pT_candidate (GeV/c)";
1095 titles[1]="rapidity";
1096 titles[2]="cT (#mum)";
1098 titles[4]="z_{vtx}";
1099 titles[5]="centrality";
1101 titles[7]="multiplicity";
1105 Int_t markers[16]={20,24,21,25,27,28,
1108 Int_t colors[3]={2,8,4};
1109 for(Int_t iC=0;iC<nvarToPlot; iC++){
1110 for(Int_t iStep=0;iStep<3;iStep++){
1111 h[iStep][iC].SetTitle(titles[iC].Data());
1112 h[iStep][iC].GetXaxis()->SetTitle(titles[iC].Data());
1113 Double_t maxh=h[iStep][iC].GetMaximum();
1114 h[iStep][iC].GetYaxis()->SetRangeUser(0,maxh*1.2);
1115 h[iStep][iC].SetMarkerStyle(markers[iC]);
1116 h[iStep][iC].SetMarkerColor(colors[iStep]);
1120 gStyle->SetCanvasColor(0);
1121 gStyle->SetFrameFillColor(0);
1122 gStyle->SetTitleFillColor(0);
1123 gStyle->SetStatColor(0);
1125 // drawing in 2 separate canvas for a matter of clearity
1126 TCanvas * c1 =new TCanvas(Form("c1New_%d",fDecayChannel),"Vars 0, 1, 2, 3",1100,1200);
1129 for(Int_t iVar=0; iVar<4; iVar++){
1131 h[0][iVar].DrawCopy("p");
1133 h[1][iVar].DrawCopy("p");
1135 h[2][iVar].DrawCopy("p");
1138 TCanvas * c2 =new TCanvas(Form("c2New_%d",fDecayChannel),"Vars 4, 5, 6, 7",1100,1200);
1141 for(Int_t iVar=4; iVar<8; iVar++){
1143 h[0][iVar].DrawCopy("p");
1145 h[1][iVar].DrawCopy("p");
1147 h[2][iVar].DrawCopy("p");
1150 if (fConfiguration == kSnail){
1151 TCanvas * c3 =new TCanvas(Form("c3New_%d",fDecayChannel),"Vars 8, 9, 10, 11",1100,1200);
1154 for(Int_t iVar=8; iVar<12; iVar++){
1156 h[0][iVar].DrawCopy("p");
1158 h[1][iVar].DrawCopy("p");
1160 h[2][iVar].DrawCopy("p");
1162 if (fDecayChannel==22) {
1163 TCanvas * c4 =new TCanvas(Form("c4New_%d",fDecayChannel),"Vars 12, 13, 14, 15",1100,1200);
1166 for(Int_t iVar=12; iVar<16; iVar++){
1168 h[0][iVar].DrawCopy("p");
1170 h[1][iVar].DrawCopy("p");
1172 h[2][iVar].DrawCopy("p");
1178 THnSparseD* hcorr = dynamic_cast<THnSparseD*> (GetOutputData(3));
1180 TH2D* corr1 = hcorr->Projection(0,2);
1181 TH2D* corr2 = hcorr->Projection(1,3);
1183 TCanvas * c7 =new TCanvas(Form("c7New_%d",fDecayChannel),"",800,400);
1186 corr1->DrawCopy("text");
1188 corr2->DrawCopy("text");
1190 TFile* file_projection = new TFile("CFtaskHFprojectionNew.root","RECREATE");
1195 for(Int_t iC=0;iC<nvarToPlot; iC++){
1196 for(Int_t iStep=0;iStep<3;iStep++){
1197 h[iStep][iC].Write(Form("Step%d_%s",iStep,titles[iC].Data()));
1200 file_projection->Close();
1201 for (Int_t ih = 0; ih<3; ih++) delete [] h[ih];
1207 //___________________________________________________________________________
1208 void AliCFTaskVertexingHF::UserCreateOutputObjects()
1210 //HERE ONE CAN CREATE OUTPUT OBJECTS, IN PARTICULAR IF THE OBJECT PARAMETERS DON'T NEED
1211 //TO BE SET BEFORE THE EXECUTION OF THE TASK
1213 Info("UserCreateOutputObjects","CreateOutputObjects of task %s\n", GetName());
1215 AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
1216 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
1217 AliPIDResponse *localPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
1219 if (fCuts->GetIsUsePID() && fDecayChannel==22) {
1221 fCuts->GetPidHF()->SetPidResponse(localPIDResponse);
1222 fCuts->GetPidHF()->SetOldPid(kFALSE);
1223 AliRDHFCutsLctoV0* lcv0Cuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
1225 lcv0Cuts->GetPidV0pos()->SetPidResponse(localPIDResponse);
1226 lcv0Cuts->GetPidV0neg()->SetPidResponse(localPIDResponse);
1227 lcv0Cuts->GetPidV0pos()->SetOldPid(kFALSE);
1228 lcv0Cuts->GetPidV0neg()->SetOldPid(kFALSE);
1234 const char* nameoutput=GetOutputSlot(1)->GetContainer()->GetName();
1235 fHistEventsProcessed = new TH1I(nameoutput,"",1,0,1) ;
1237 PostData(1,fHistEventsProcessed) ;
1238 PostData(2,fCFManager->GetParticleContainer()) ;
1239 PostData(3,fCorrelation) ;
1244 //_________________________________________________________________________
1245 Double_t AliCFTaskVertexingHF::GetWeight(Float_t pt)
1248 // calculating the weight to fill the container
1252 // p0 = 1.63297e-01 --> 0.322643
1258 // p0 = 1.85906e-01 --> 0.36609
1263 Double_t func1[4] = {0.322643,2.96275,2.30301,2.5};
1264 Double_t func2[4] = {0.36609,1.94635,1.40463,2.5};
1266 Double_t dndpt_func1 = dNdptFit(pt,func1);
1267 if(fUseFlatPtWeight) dndpt_func1 = 1./30.;
1268 Double_t dndpt_func2 = dNdptFit(pt,func2);
1269 AliDebug(2,Form("pt = %f, FONLL = %f, Pythia = %f, ratio = %f",pt,dndpt_func1,dndpt_func2,dndpt_func1/dndpt_func2));
1270 return dndpt_func1/dndpt_func2;
1273 //__________________________________________________________________________________________________
1274 Double_t AliCFTaskVertexingHF::dNdptFit(Float_t pt, Double_t* par)
1277 // calculating dNdpt
1280 Double_t denom = TMath::Power((pt/par[1]), par[3] );
1281 Double_t dNdpt = par[0]*pt/TMath::Power(1.+denom, par[2]);
1286 //__________________________________________________________________________________________________
1287 Double_t AliCFTaskVertexingHF::GetZWeight(Float_t z, Int_t runnumber){
1289 // calculating the z-vtx weight for the given run range
1292 if(runnumber>146824 || runnumber<146803) return 1.0;
1294 Double_t func1[3] = {1.0, -0.5, 6.5 };
1295 Double_t func2[3] = {1.0, -0.5, 5.5 };
1297 Double_t dzFunc1 = DodzFit(z,func1);
1298 Double_t dzFunc2 = DodzFit(z,func2);
1300 return dzFunc1/dzFunc2;
1303 //__________________________________________________________________________________________________
1304 Double_t AliCFTaskVertexingHF::DodzFit(Float_t z, Double_t* par) {
1307 // Gaussian z-vtx shape
1309 //gaussian = [0]/TMath::Sqrt(2.*TMath::Pi())/[2]*exp[-(x-[1])*(x-[1])/(2*[2]*[2])]
1311 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]);
1315 //__________________________________________________________________________________________________
1316 Double_t AliCFTaskVertexingHF::GetNchWeight(Int_t nch){
1318 // calculates the Nch weight using the measured and generateed Nch distributions
1320 if(nch<=0) return 0.;
1321 Double_t pMeas=fHistoMeasNch->GetBinContent(fHistoMeasNch->FindBin(nch));
1322 Double_t pMC=fHistoMCNch->GetBinContent(fHistoMCNch->FindBin(nch));
1325 //__________________________________________________________________________________________________
1326 void AliCFTaskVertexingHF::CreateMeasuredNchHisto(){
1327 // creates historgam with measured multiplcity distribution in pp 7 TeV collisions (from Eur. Phys. J. C (2010) 68: 345–354)
1328 Double_t nchbins[66]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1329 10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1330 20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1331 30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1332 40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1333 50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1334 60.50,62.50,64.50,66.50,68.50,70.50};
1335 Double_t pch[65]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1336 0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1337 0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1338 0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1339 0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1340 0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1341 0.000296,0.000265,0.000193,0.00016,0.000126};
1343 if(fHistoMeasNch) delete fHistoMeasNch;
1344 fHistoMeasNch=new TH1F("hMeaseNch","",65,nchbins);
1345 for(Int_t i=0; i<65; i++){
1346 fHistoMeasNch->SetBinContent(i+1,pch[i]);
1347 fHistoMeasNch->SetBinError(i+1,0.);
1351 //__________________________________________________________________________________________________
1352 Bool_t AliCFTaskVertexingHF::ProcessDs(Int_t recoAnalysisCuts) const{
1353 // processes output of Ds is selected
1355 if(recoAnalysisCuts > 0){
1356 Int_t isKKpi=recoAnalysisCuts&1;
1357 Int_t ispiKK=recoAnalysisCuts&2;
1358 Int_t isPhiKKpi=recoAnalysisCuts&4;
1359 Int_t isPhipiKK=recoAnalysisCuts&8;
1360 Int_t isK0starKKpi=recoAnalysisCuts&16;
1361 Int_t isK0starpiKK=recoAnalysisCuts&32;
1363 if(isKKpi && isPhiKKpi) keep=kTRUE;
1364 if(ispiKK && isPhipiKK) keep=kTRUE;
1366 else if(fDsOption==2){
1367 if(isKKpi && isK0starKKpi) keep=kTRUE;
1368 if(ispiKK && isK0starpiKK) keep=kTRUE;
1370 else if(fDsOption==3)keep=kTRUE;
1374 //__________________________________________________________________________________________________
1375 Bool_t AliCFTaskVertexingHF::ProcessLctoV0Bachelor(Int_t recoAnalysisCuts) const{
1376 // processes output of Lc->V0+bnachelor is selected
1378 if(recoAnalysisCuts > 0){
1380 Int_t isK0Sp = recoAnalysisCuts&1;
1381 Int_t isLambdaBarpi = recoAnalysisCuts&2;
1382 Int_t isLambdapi = recoAnalysisCuts&4;
1384 if(fLctoV0bachelorOption==1){
1385 if(isK0Sp) keep=kTRUE;
1387 else if(fLctoV0bachelorOption==2){
1388 if(isLambdaBarpi) keep=kTRUE;
1390 else if(fLctoV0bachelorOption==4){
1391 if(isLambdapi) keep=kTRUE;
1393 else if(fLctoV0bachelorOption==7) {
1394 if (isK0Sp || isLambdaBarpi || isLambdapi) keep=kTRUE;