Corrected end-of-line behavior
authorhristov <Peter.Hristov@cern.ch>
Wed, 15 Jan 2014 17:45:35 +0000 (18:45 +0100)
committerhristov <Peter.Hristov@cern.ch>
Wed, 15 Jan 2014 17:45:35 +0000 (18:45 +0100)
96 files changed:
ANALYSIS/ESDfilter/macros/AddTaskESDFilter.C
ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx
HLT/CALO/AliHLTCaloDigitMaker.cxx
ITS/UPGRADE/AliITSUClusterizer.h
OADB/AliOADBCentrality.h
PWG/FLOW/Tasks/AliAnalysisTaskFlowCascade.cxx
PWG/FLOW/Tasks/AliAnalysisTaskFlowCascade.h
PWG/muon/AliAnalysisTaskESDMuonFilter.h
PWG/muon/AliUtilityMuonAncestor.cxx
PWG/muon/AliUtilityMuonAncestor.h
PWGCF/Correlations/DPhi/AliAnalysisTaskMinijet.h
PWGCF/Correlations/DPhi/TriggerPID/AliAnalysisTaskPIDCORR.h
PWGCF/Correlations/DPhi/TriggerPID/AliTwoParticlePIDCorr.cxx
PWGCF/Correlations/macros/dphicorrelations/AddTaskContMC.C
PWGCF/Correlations/macros/fd/AddTaskPicoTracksDhc.C
PWGCF/Correlations/macros/minijet/analyse_pA.C
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBFPsi.h
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskEventMixingBF.cxx
PWGCF/EBYE/LRC/AliAnalysisTaskLRC.h
PWGCF/EBYE/LRC/AliLRCProcess.cxx
PWGCF/EBYE/PIDFluctuation/task/AliEbyEParticleRatioFluctuationTask.cxx
PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C
PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C
PWGCF/EBYE/macros/runBalanceFunctionPsi.C
PWGCF/FEMTOSCOPY/macros/Train/Kch_Eta05Pt01415/ConfigFemtoAnalysis.C
PWGCF/FLOW/macros/AddTaskFlowCascade.C
PWGCF/FLOW/macros/AddTaskFlowHigherOrdersPID.C
PWGCF/FLOW/macros/runTaskFlowHigherOrdersAllPID.C
PWGDQ/dielectron/AliDielectronBtoJPSItoEle.h
PWGDQ/dielectron/AliDielectronBtoJPSItoEleCDFfitFCN.h
PWGDQ/dielectron/AliDielectronBtoJPSItoEleCDFfitHandler.h
PWGDQ/dielectron/macrosLMEE/AddTask_oezdemir_pp2012.C
PWGDQ/dielectron/macrosLMEE/AddTask_shin_pPb.C
PWGDQ/dielectron/macrosLMEE/AddTask_shin_pPbTRD.C
PWGDQ/dielectron/macrosLMEE/Config_shin_pPbTRD.C
PWGDQ/dielectron/macrosLMEE/Configpp2012Oezdemir.C
PWGGA/EMCALTasks/AliAnalysisTaskEMCALPhoton.h
PWGGA/GammaConv/AliAnaConvCorrBase.h
PWGGA/GammaConv/AliAnaConvCorrPion.h
PWGGA/GammaConv/AliDalitzElectronCuts.cxx
PWGGA/PHOSTasks/PHOS_pp_pi0/AliAnalysisTaskPi0.h
PWGGA/PHOSTasks/PHOS_pp_pi0/macros/MakeFinalSpectrum.C
PWGGA/PHOSTasks/PHOS_pp_pi0/macros/makeMmixPU_CB.C
PWGGA/PHOSTasks/PHOS_pp_pi0/macros/makeMmixPU_GS.C
PWGHF/correlationHF/AliHFAssociatedTrackCuts.cxx
PWGHF/correlationHF/AliHFAssociatedTrackCuts.h
PWGHF/correlationHF/AliHFCorrelator.cxx
PWGHF/correlationHF/AliHFCorrelator.h
PWGHF/correlationHF/macros/AddTaskDStarCorrelations.C
PWGHF/hfe/AliAnalysisTaskFlowTPCTOFEPSP.cxx
PWGHF/hfe/AliAnalysisTaskFlowTPCTOFEPSP.h
PWGHF/hfe/AliAnalysisTaskHFEQA.cxx
PWGHF/hfe/AliAnalysisTaskHFEQA.h
PWGHF/hfe/macros/AddTaskFlowITSTPCTOFQCSP.C
PWGHF/hfe/macros/AddTaskFlowTPCEMCalQCSP.C
PWGHF/hfe/macros/AddTaskHFEnpePbPb.C
PWGHF/hfe/macros/configs/PbPb/ConfigHFECal.C
PWGHF/vertexingHF/AliAnalysisTaskSECharmFraction.h
PWGJE/FlavourJetTasks/AliAnalysisTaskFlavourJetCorrelations.h
PWGJE/FlavourJetTasks/AliAnalysisTaskSEDmesonsFilterCJ.cxx
PWGJE/FlavourJetTasks/AliAnalysisTaskSEDmesonsFilterCJ.h
PWGJE/FlavourJetTasks/macros/AddTaskFlavourJetCorrelations.C
PWGJE/FlavourJetTasks/macros/AddTaskSEDmesonsFilterCJ.C
PWGJE/macros/PID/AddUpSystematicErrors.C
PWGJE/macros/PID/PID.C
PWGJE/macros/PID/SystematicErrorEstimation.C
PWGLF/QATasks/AliAnalysisTaskQAHighPtDeDx.cxx
PWGLF/QATasks/macros/AddTaskQAHighPtDeDx.C
PWGLF/QATasks/post/multistrangeQA.C
PWGLF/RESONANCES/macros/lego_train/AddRsnDaughterCutsPhiNsigma.C
PWGLF/SPECTRA/Nuclei/B2/macros/Config_Deuteron_TOF_LHC10x.C
PWGLF/SPECTRA/Nuclei/B2/macros/Config_Deuteron_TPC_LHC10x.C
PWGLF/SPECTRA/Nuclei/B2/macros/Config_He3_TPC_LHC10x.C
PWGLF/SPECTRA/Nuclei/B2/macros/LHC10bcde.C
PWGLF/SPECTRA/PiKaPr/TPCTOFpA/AddTaskTPCTOFpA.C
PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraAOD.C
PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraAllChAOD.C
PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraBoth.C
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAllChAOD.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAllChAOD.h
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraBoth.cxx
PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckCascadepp276.cxx
PWGLF/STRANGENESS/Cascades/AliAnalysisTaskCheckPerformanceCascadepp276.cxx
PWGLF/STRANGENESS/Correlations/macros/runGridLambdaOverK0sJets.C
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskHdibaryonLPpi.cxx
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskHdibaryonLPpi.h
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskHelium3Pi.cxx
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskHelium3PiMC.cxx
PWGLF/totEt/AliAnalysisTaskHadEt.h
PWGLF/totEt/AliAnalysisTaskTotEt.h
PWGPP/AliAnalysisTaskFilteredTree.cxx
STARLIGHT/starlight/Readme
STARLIGHT/starlight/config/my.input
STARLIGHT/starlight/dpmjet/dpmjetint.f

index 2fbdd73..f9ea353 100644 (file)
-\r
-Bool_t AddTrackCutsLHC10bcde(AliAnalysisTaskESDfilter* esdFilter);\r
-Bool_t AddTrackCutsLHC10h(AliAnalysisTaskESDfilter* esdFilter);\r
-Bool_t AddTrackCutsLHC11h(AliAnalysisTaskESDfilter* esdFilter);\r
-Bool_t enableTPCOnlyAODTracksLocalFlag=kFALSE;\r
-\r
-\r
-AliAnalysisTaskESDfilter *AddTaskESDFilter(Bool_t useKineFilter=kTRUE, \r
-                                           Bool_t writeMuonAOD=kFALSE,\r
-                                           Bool_t writeDimuonAOD=kFALSE,\r
-                                           Bool_t usePhysicsSelection=kFALSE,\r
-                                           Bool_t useCentralityTask=kFALSE, /*obsolete*/\r
-                                           Bool_t enableTPCOnlyAODTracks=kFALSE,\r
-                                           Bool_t disableCascades=kFALSE,\r
-                                           Bool_t disableKinks=kFALSE, \r
-                                           Int_t runFlag = 1100,\r
-                                           Int_t  muonMCMode = 2, \r
-                                           Bool_t useV0Filter=kTRUE)\r
-{\r
-  // Creates a filter task and adds it to the analysis manager.\r
-   // Get the pointer to the existing analysis manager via the static access method.\r
-   //==============================================================================\r
-   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
-   if (!mgr) {\r
-      ::Error("AddTaskESDFilter", "No analysis manager to connect to.");\r
-     return NULL;\r
-   }   \r
-   \r
-   // This task requires an ESD input handler and an AOD output handler.\r
-   // Check this using the analysis manager.\r
-   //===============================================================================\r
-   TString type = mgr->GetInputEventHandler()->GetDataType();\r
-   if (!type.Contains("ESD")) {\r
-      ::Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an ESD input handler.");\r
-      return NULL;\r
-   }   \r
-   // Check if AOD output handler exist.\r
-   AliAODHandler *aod_h = (AliAODHandler*)mgr->GetOutputEventHandler();\r
-   if (!aod_h) {\r
-      ::Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an AOD output handler.");\r
-      return NULL;\r
-   }\r
-   // Check if MC handler is connected in case kine filter requested\r
-   AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();\r
-   if (!mcH && useKineFilter) {\r
-      ::Error("AddTaskESDFilter", "No MC handler connected while kine filtering requested");\r
-      return NULL;\r
-   }   \r
-   \r
-   // Create the task, add it to the manager and configure it.\r
-   //===========================================================================   \r
-   // Barrel tracks filter\r
-   AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");\r
-   if (disableCascades) esdfilter->DisableCascades();\r
-   if  (disableKinks) esdfilter->DisableKinks();\r
-  \r
-   mgr->AddTask(esdfilter);\r
-  \r
-   // Muons\r
-   Bool_t onlyMuon=kTRUE;\r
-   Bool_t keepAllEvents=kTRUE;\r
-   Int_t mcMode= useKineFilter ? muonMCMode : 0; // use 1 instead of 2 to get all MC information instead of just ancestors of mu tracks\r
-   AliAnalysisTaskESDMuonFilter *esdmuonfilter = new AliAnalysisTaskESDMuonFilter("ESD Muon Filter",onlyMuon,keepAllEvents,mcMode);\r
-   mgr->AddTask(esdmuonfilter);\r
-   if(usePhysicsSelection){\r
-     esdfilter->SelectCollisionCandidates(AliVEvent::kAny);\r
-     esdmuonfilter->SelectCollisionCandidates(AliVEvent::kAny);\r
-   }  \r
-\r
-   // Filtering of MC particles (decays conversions etc)\r
-   // this task has to go AFTER all other filter tasks\r
-   // since it fills the AODMC array with all\r
-   // selected MC Particles, only this way we have the \r
-   // AODMCparticle information available for following tasks\r
-   AliAnalysisTaskMCParticleFilter *kinefilter = 0;\r
-   if (useKineFilter) {\r
-      kinefilter = new AliAnalysisTaskMCParticleFilter("Particle Kine Filter");\r
-      mgr->AddTask(kinefilter);\r
-   }   \r
-\r
-   enableTPCOnlyAODTracksLocalFlag = enableTPCOnlyAODTracks;\r
-   if((runFlag/100)==10){\r
-     if((runFlag%100)==0) AddTrackCutsLHC10bcde(esdfilter);\r
-     else AddTrackCutsLHC10h(esdfilter);\r
-   }\r
-   else {\r
-     // default 11h\r
-     AddTrackCutsLHC11h(esdfilter);\r
-   }\r
-\r
-   // Filter with cuts on V0s\r
-   if (useV0Filter) {\r
-     AliESDv0Cuts*   esdV0Cuts = new AliESDv0Cuts("Standard V0 Cuts pp", "ESD V0 Cuts");\r
-     esdV0Cuts->SetMinRadius(0.2);\r
-     esdV0Cuts->SetMaxRadius(200);\r
-     esdV0Cuts->SetMinDcaPosToVertex(0.05);\r
-     esdV0Cuts->SetMinDcaNegToVertex(0.05);\r
-     esdV0Cuts->SetMaxDcaV0Daughters(1.5);\r
-     esdV0Cuts->SetMinCosinePointingAngle(0.99);\r
-     AliAnalysisFilter* v0Filter = new AliAnalysisFilter("v0Filter");\r
-     v0Filter->AddCuts(esdV0Cuts);\r
-\r
-     esdfilter->SetV0Filter(v0Filter);\r
-   }  \r
-\r
-   // Enable writing of Muon AODs\r
-   esdmuonfilter->SetWriteMuonAOD(writeMuonAOD);\r
-   \r
-   // Enable writing of Dimuon AODs\r
-   esdmuonfilter->SetWriteDimuonAOD(writeDimuonAOD);\r
\r
-   // Create ONLY the output containers for the data produced by the task.\r
-   // Get and connect other common input/output containers via the manager as below\r
-   //==============================================================================\r
-   mgr->ConnectInput  (esdfilter,  0, mgr->GetCommonInputContainer());\r
-   mgr->ConnectOutput (esdfilter,  0, mgr->GetCommonOutputContainer());\r
-   mgr->ConnectInput  (esdmuonfilter, 0, mgr->GetCommonInputContainer());\r
-   if (useKineFilter) {\r
-      mgr->ConnectInput  (kinefilter,  0, mgr->GetCommonInputContainer());\r
-      mgr->ConnectOutput (kinefilter,  0, mgr->GetCommonOutputContainer());\r
-      AliAnalysisDataContainer *coutputEx = mgr->CreateContainer("cFilterList", TList::Class(),\r
-                                                                  AliAnalysisManager::kOutputContainer,"pyxsec_hists.root");\r
-      mgr->ConnectOutput (kinefilter,  1,coutputEx);\r
-   }   \r
-   return esdfilter;\r
-}\r
\r
-\r
-\r
-\r
-Bool_t AddTrackCutsLHC10h(AliAnalysisTaskESDfilter* esdfilter){\r
-\r
-  Printf("%s%d: Creating Track Cuts for LHC10h",(char*)__FILE__,__LINE__);\r
-\r
-  // Cuts on primary tracks\r
-  AliESDtrackCuts* esdTrackCutsL = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();\r
-  \r
-  // ITS stand-alone tracks\r
-  AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("ITS stand-alone Track Cuts", "ESD Track Cuts");\r
-  esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);\r
-  \r
-  // Pixel OR necessary for the electrons\r
-  AliESDtrackCuts *itsStrong = new AliESDtrackCuts("ITSorSPD", "pixel requirement for ITS");\r
-  itsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
-  \r
-  \r
-  // PID for the electrons\r
-  AliESDpidCuts *electronID = new AliESDpidCuts("Electrons", "Electron PID cuts");\r
-  electronID->SetTPCnSigmaCut(AliPID::kElectron, 3.5);\r
-  \r
-  // tighter cuts on primary particles for high pT tracks\r
-  // take the standard cuts, which include already \r
-  // ITSrefit and use only primaries...\r
-  \r
-  // ITS cuts for new jet analysis \r
-  //  gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");\r
-  //  AliESDtrackCuts* esdTrackCutsHG0 = CreateTrackCutsPWGJE(10001006);\r
-\r
-  AliESDtrackCuts *jetCuts1006 = new AliESDtrackCuts("AliESDtrackCuts"); \r
-\r
-  TFormula *f1NClustersTPCLinearPtDep = new TFormula("f1NClustersTPCLinearPtDep","70.+30./20.*x");\r
-  jetCuts1006->SetMinNClustersTPCPtDep(f1NClustersTPCLinearPtDep,20.);\r
-  jetCuts1006->SetMinNClustersTPC(70);\r
-  jetCuts1006->SetMaxChi2PerClusterTPC(4);\r
-  jetCuts1006->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1\r
-  jetCuts1006->SetAcceptKinkDaughters(kFALSE);\r
-  jetCuts1006->SetRequireTPCRefit(kTRUE);\r
-  jetCuts1006->SetMaxFractionSharedTPCClusters(0.4);\r
-  // ITS\r
-  jetCuts1006->SetRequireITSRefit(kTRUE);\r
-  //accept secondaries\r
-  jetCuts1006->SetMaxDCAToVertexXY(2.4);\r
-  jetCuts1006->SetMaxDCAToVertexZ(3.2);\r
-  jetCuts1006->SetDCAToVertex2D(kTRUE);\r
-  //reject fakes\r
-  jetCuts1006->SetMaxChi2PerClusterITS(36);\r
-  jetCuts1006->SetMaxChi2TPCConstrainedGlobal(36);\r
-\r
-  jetCuts1006->SetRequireSigmaToVertex(kFALSE);\r
-\r
-  jetCuts1006->SetEtaRange(-0.9,0.9);\r
-  jetCuts1006->SetPtRange(0.15, 1E+15.);\r
-\r
-  AliESDtrackCuts* esdTrackCutsHG0 = jetCuts1006->Clone("JetCuts10001006");\r
-  esdTrackCutsHG0->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
-\r
-\r
-  // throw out tracks with too low number of clusters in\r
-  // the first pass (be consistent with TPC only tracks)\r
-  // N.B. the number off crossed rows still acts on the tracks after\r
-  // all iterations if we require tpc standalone, number of clusters\r
-  // and chi2 TPC cuts act on track after the first iteration\r
-  //   esdTrackCutsH0->SetRequireTPCStandAlone(kTRUE);\r
-  //   esdTrackCutsH0->SetMinNClustersTPC(80); // <--- first pass\r
-  \r
-  \r
-  // the complement to the one with SPD requirement\r
-  //  AliESDtrackCuts* esdTrackCutsHG1 = CreateTrackCutsPWGJE(10011006);\r
-  AliESDtrackCuts* esdTrackCutsHG1 = jetCuts1006->Clone("JetCuts10011006");\r
-  esdTrackCutsHG1->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);\r
-\r
-  // the tracks that must not be taken pass this cut and\r
-  // non HGC1 and HG\r
-  //  AliESDtrackCuts* esdTrackCutsHG2 = CreateTrackCutsPWGJE(10021006);\r
-  AliESDtrackCuts* esdTrackCutsHG2 = jetCuts1006->Clone("JetCuts10021006");\r
-  esdTrackCutsHG2->SetMaxChi2PerClusterITS(1E10);\r
-\r
-\r
-  // standard cuts also used in R_AA analysis\r
-  //   "Global track RAA analysis QM2011 + Chi2ITS<36";\r
-  //  AliESDtrackCuts* esdTrackCutsH2 = CreateTrackCutsPWGJE(1000);\r
-  AliESDtrackCuts* esdTrackCutsH2 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,1);\r
-  esdTrackCutsH2->SetMinNCrossedRowsTPC(120);\r
-  esdTrackCutsH2->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);\r
-  esdTrackCutsH2->SetMaxChi2PerClusterITS(36);\r
-  esdTrackCutsH2->SetMaxFractionSharedTPCClusters(0.4);\r
-  esdTrackCutsH2->SetMaxChi2TPCConstrainedGlobal(36);\r
-\r
-  esdTrackCutsH2->SetEtaRange(-0.9,0.9);\r
-  esdTrackCutsH2->SetPtRange(0.15, 1e10);\r
-\r
-\r
-  //  AliESDtrackCuts* esdTrackCutsGCOnly = CreateTrackCutsPWGJE(10041006);\r
-  AliESDtrackCuts* esdTrackCutsGCOnly = jetCuts1006->Clone("JetCuts10041006");\r
-  esdTrackCutsGCOnly->SetRequireITSRefit(kFALSE);\r
-\r
-  // TPC only tracks\r
-  AliESDtrackCuts* esdTrackCutsTPCCOnly = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();\r
-  esdTrackCutsTPCCOnly->SetMinNClustersTPC(70);\r
-  \r
-  // Compose the filter\r
-  AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");\r
-  // 1, 1<<0\r
-  trackFilter->AddCuts(esdTrackCutsL);\r
-  // 2 1<<1\r
-  trackFilter->AddCuts(esdTrackCutsITSsa);\r
-  // 4 1<<2\r
-  trackFilter->AddCuts(itsStrong);\r
-  itsStrong->SetFilterMask(1);        // AND with Standard track cuts \r
-  // 8 1<<3\r
-  trackFilter->AddCuts(electronID);\r
-  electronID->SetFilterMask(4);       // AND with Pixel Cuts\r
-  // 16 1<<4\r
-  trackFilter->AddCuts(esdTrackCutsHG0);\r
-  // 32 1<<5\r
-  trackFilter->AddCuts(esdTrackCutsHG1);\r
-  // 64 1<<6\r
-  trackFilter->AddCuts(esdTrackCutsHG2);\r
-  // 128 1<<7\r
-  trackFilter->AddCuts(esdTrackCutsTPCCOnly); // add QM TPC only track cuts\r
-  if(enableTPCOnlyAODTracksLocalFlag)esdfilter->SetTPCOnlyFilterMask(128);\r
-  // 256 1<<8\r
-  trackFilter->AddCuts(esdTrackCutsGCOnly);\r
-  // 512 1<<9                         \r
-  AliESDtrackCuts* esdTrackCutsHG1_tmp = new AliESDtrackCuts(*esdTrackCutsHG1); // avoid double delete\r
-  trackFilter->AddCuts(esdTrackCutsHG1_tmp); // add once more for tpc only tracks\r
-  // 1024 1<<10                        \r
-  trackFilter->AddCuts(esdTrackCutsH2); // add r_aa cuts\r
-\r
-  \r
-  \r
-  esdfilter->SetGlobalConstrainedFilterMask(1<<8|1<<9); // these tracks are written out as global constrained tracks\r
-  esdfilter->SetHybridFilterMaskGlobalConstrainedGlobal((1<<4)); // these normal global tracks will be marked as hybrid\r
-  esdfilter->SetWriteHybridGlobalConstrainedOnly(kTRUE); // write only the complement\r
-  //     esdfilter->SetTPCConstrainedFilterMask(1<<11); // these tracks are written out as tpc constrained tracks\r
-\r
-  esdfilter->SetTrackFilter(trackFilter);\r
-  return kTRUE;\r
-  \r
-}\r
-\r
-\r
-Bool_t AddTrackCutsLHC11h(AliAnalysisTaskESDfilter* esdfilter){\r
-\r
-\r
-  Printf("%s%d: Creating Track Cuts LHC11h",(char*)__FILE__,__LINE__);\r
-\r
-  // Cuts on primary tracks\r
-   AliESDtrackCuts* esdTrackCutsL = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();\r
-\r
-   // ITS stand-alone tracks\r
-   AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("ITS stand-alone Track Cuts", "ESD Track Cuts");\r
-   esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);\r
-\r
-   // Pixel OR necessary for the electrons\r
-   AliESDtrackCuts *itsStrong = new AliESDtrackCuts("ITSorSPD", "pixel requirement for ITS");\r
-   itsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
-\r
-\r
-   // PID for the electrons\r
-   AliESDpidCuts *electronID = new AliESDpidCuts("Electrons", "Electron PID cuts");\r
-   electronID->SetTPCnSigmaCut(AliPID::kElectron, 3.5);\r
-\r
-   // standard cuts with very loose DCA\r
-   AliESDtrackCuts* esdTrackCutsH = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE); \r
-   esdTrackCutsH->SetMaxDCAToVertexXY(2.4);\r
-   esdTrackCutsH->SetMaxDCAToVertexZ(3.2);\r
-   esdTrackCutsH->SetDCAToVertex2D(kTRUE);\r
-\r
-   // standard cuts with tight DCA cut\r
-   AliESDtrackCuts* esdTrackCutsH2 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();\r
-\r
-   // standard cuts with tight DCA but with requiring the first SDD cluster instead of an SPD cluster\r
-   // tracks selected by this cut are exclusive to those selected by the previous cut\r
-   AliESDtrackCuts* esdTrackCutsH3 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(); \r
-   esdTrackCutsH3->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);\r
-   esdTrackCutsH3->SetClusterRequirementITS(AliESDtrackCuts::kSDD, AliESDtrackCuts::kFirst);\r
\r
-   // TPC only tracks: Optionally enable the writing of TPConly information\r
-   // constrained to SPD vertex in the filter below\r
-   AliESDtrackCuts* esdTrackCutsTPCOnly = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();\r
-   // The following line is needed for 2010 PbPb reprocessing and pp, but not for 2011 PbPb\r
-   //esdTrackCutsTPCOnly->SetMinNClustersTPC(70);\r
-\r
-   // Extra cuts for hybrids\r
-   // first the global tracks we want to take\r
-   AliESDtrackCuts* esdTrackCutsHTG = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE); \r
-   esdTrackCutsHTG->SetName("Global Hybrid tracks, loose DCA");\r
-   esdTrackCutsHTG->SetMaxDCAToVertexXY(2.4);\r
-   esdTrackCutsHTG->SetMaxDCAToVertexZ(3.2);\r
-   esdTrackCutsHTG->SetDCAToVertex2D(kTRUE);\r
-   esdTrackCutsHTG->SetMaxChi2TPCConstrainedGlobal(36);\r
-   esdTrackCutsHTG->SetMaxFractionSharedTPCClusters(0.4);\r
-   \r
-\r
-   // Than the complementary tracks which will be stored as global\r
-   // constraint, complement is done in the ESDFilter task\r
-   AliESDtrackCuts* esdTrackCutsHTGC = new AliESDtrackCuts(*esdTrackCutsHTG);\r
-   esdTrackCutsHTGC->SetName("Global Constraint Hybrid tracks, loose DCA no it requirement");\r
-   esdTrackCutsHTGC->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kOff);\r
-   esdTrackCutsHTGC->SetRequireITSRefit(kTRUE);\r
-\r
-   // standard cuts with tight DCA cut, using cluster cut instead of crossed rows (a la 2010 default)\r
-   AliESDtrackCuts* esdTrackCutsH2Cluster = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE, 0);\r
-\r
-   // Compose the filter\r
-   AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");\r
-   // 1, 1<<0\r
-   trackFilter->AddCuts(esdTrackCutsL);\r
-   // 2, 1<<1\r
-   trackFilter->AddCuts(esdTrackCutsITSsa);\r
-   // 4, 1<<2\r
-   trackFilter->AddCuts(itsStrong);\r
-   itsStrong->SetFilterMask(1);        // AND with Standard track cuts \r
-   // 8, 1<<3\r
-   trackFilter->AddCuts(electronID);\r
-   electronID->SetFilterMask(4);       // AND with Pixel Cuts\r
-   // 16, 1<<4\r
-   trackFilter->AddCuts(esdTrackCutsH);\r
-   // 32, 1<<5\r
-   trackFilter->AddCuts(esdTrackCutsH2);\r
-   // 64, 1<<6\r
-   trackFilter->AddCuts(esdTrackCutsH3);\r
-   // 128 , 1 << 7\r
-   trackFilter->AddCuts(esdTrackCutsTPCOnly);\r
-   if(enableTPCOnlyAODTracksLocalFlag)esdfilter->SetTPCOnlyFilterMask(128);\r
-   // 256, 1 << 8 Global Hybrids\r
-   trackFilter->AddCuts(esdTrackCutsHTG);\r
-   esdfilter->SetHybridFilterMaskGlobalConstrainedGlobal((1<<8)); // these normal global tracks will be marked as hybrid    \r
-   // 512, 1<< 9 GlobalConstraint Hybrids\r
-   trackFilter->AddCuts(esdTrackCutsHTGC);\r
-   esdfilter->SetGlobalConstrainedFilterMask(1<<9); // these tracks are written out as global constrained tracks \r
-   esdfilter->SetWriteHybridGlobalConstrainedOnly(kTRUE); // write only the complement\r
-   // 1024, 1<< 10 // tight DCA cuts\r
-   trackFilter->AddCuts(esdTrackCutsH2Cluster);\r
-   esdfilter->SetTrackFilter(trackFilter);\r
-\r
-   return kTRUE;\r
-\r
-}\r
-\r
-Bool_t AddTrackCutsLHC10bcde(AliAnalysisTaskESDfilter* esdfilter){\r
-\r
-\r
-  Printf("%s%d: Creating Track Cuts LHC10bcde",(char*)__FILE__,__LINE__);\r
-\r
-  // Cuts on primary tracks\r
-   AliESDtrackCuts* esdTrackCutsL = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();\r
-\r
-   // ITS stand-alone tracks\r
-   AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("ITS stand-alone Track Cuts", "ESD Track Cuts");\r
-   esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);\r
-\r
-   // Pixel OR necessary for the electrons\r
-   AliESDtrackCuts *itsStrong = new AliESDtrackCuts("ITSorSPD", "pixel requirement for ITS");\r
-   itsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
-\r
-\r
-   // PID for the electrons\r
-   AliESDpidCuts *electronID = new AliESDpidCuts("Electrons", "Electron PID cuts");\r
-   electronID->SetTPCnSigmaCut(AliPID::kElectron, 3.5);\r
-\r
-   // standard cuts with very loose DCA\r
-   AliESDtrackCuts* esdTrackCutsH = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE); \r
-   esdTrackCutsH->SetMaxDCAToVertexXY(2.4);\r
-   esdTrackCutsH->SetMaxDCAToVertexZ(3.2);\r
-   esdTrackCutsH->SetDCAToVertex2D(kTRUE);\r
-\r
-   // standard cuts with tight DCA cut\r
-   AliESDtrackCuts* esdTrackCutsH2 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();\r
-\r
-   // standard cuts with tight DCA but with requiring the first SDD cluster instead of an SPD cluster\r
-   // tracks selected by this cut are exclusive to those selected by the previous cut\r
-   AliESDtrackCuts* esdTrackCutsH3 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(); \r
-   esdTrackCutsH3->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);\r
-   esdTrackCutsH3->SetClusterRequirementITS(AliESDtrackCuts::kSDD, AliESDtrackCuts::kFirst);\r
\r
-   // TPC only tracks: Optionally enable the writing of TPConly information\r
-   // constrained to SPD vertex in the filter below\r
-   AliESDtrackCuts* esdTrackCutsTPCOnly = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();\r
-   // The following line is needed for 2010 PbPb reprocessing and pp, but not for 2011 PbPb\r
-   esdTrackCutsTPCOnly->SetMinNClustersTPC(70);\r
-\r
-   // Extra cuts for hybrids\r
-   // first the global tracks we want to take\r
-   // take the HTGs from 10h\r
-\r
-   //  gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");\r
-   //  AliESDtrackCuts* esdTrackCutsHG0 = CreateTrackCutsPWGJE(10001006);\r
-\r
-   AliESDtrackCuts *jetCuts1006 = new AliESDtrackCuts("AliESDtrackCuts"); \r
-\r
-   TFormula *f1NClustersTPCLinearPtDep = new TFormula("f1NClustersTPCLinearPtDep","70.+30./20.*x");\r
-   jetCuts1006->SetMinNClustersTPCPtDep(f1NClustersTPCLinearPtDep,20.);\r
-   jetCuts1006->SetMinNClustersTPC(70);\r
-   jetCuts1006->SetMaxChi2PerClusterTPC(4);\r
-   jetCuts1006->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1\r
-   jetCuts1006->SetAcceptKinkDaughters(kFALSE);\r
-   jetCuts1006->SetRequireTPCRefit(kTRUE);\r
-   jetCuts1006->SetMaxFractionSharedTPCClusters(0.4);\r
-   // ITS\r
-   jetCuts1006->SetRequireITSRefit(kTRUE);\r
-   //accept secondaries\r
-   jetCuts1006->SetMaxDCAToVertexXY(2.4);\r
-   jetCuts1006->SetMaxDCAToVertexZ(3.2);\r
-   jetCuts1006->SetDCAToVertex2D(kTRUE);\r
-   //reject fakes\r
-   jetCuts1006->SetMaxChi2PerClusterITS(36);\r
-   jetCuts1006->SetMaxChi2TPCConstrainedGlobal(36);\r
-\r
-   jetCuts1006->SetRequireSigmaToVertex(kFALSE);\r
-   \r
-   jetCuts1006->SetEtaRange(-0.9,0.9);\r
-   jetCuts1006->SetPtRange(0.15, 1E+15.);\r
-   \r
-   AliESDtrackCuts* esdTrackCutsHTG = jetCuts1006->Clone("JetCuts10001006");\r
-   esdTrackCutsHTG->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);\r
-\r
-   // Than the complementary tracks which will be stored as global\r
-   // constraint, complement is done in the ESDFilter task\r
-   // HGC from 10h\r
-\r
-   AliESDtrackCuts* esdTrackCutsHTGC = jetCuts1006->Clone("JetCuts10041006");\r
-   esdTrackCutsHTGC->SetRequireITSRefit(kFALSE);\r
-\r
-   // standard cuts with tight DCA cut, using cluster cut instead of crossed rows (a la 2010 default)\r
-   AliESDtrackCuts* esdTrackCutsH2Cluster = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE, 0);\r
-\r
-   // Compose the filter\r
-   AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");\r
-   // 1, 1<<0\r
-   trackFilter->AddCuts(esdTrackCutsL);\r
-   // 2, 1<<1\r
-   trackFilter->AddCuts(esdTrackCutsITSsa);\r
-   // 4, 1<<2\r
-   trackFilter->AddCuts(itsStrong);\r
-   itsStrong->SetFilterMask(1);        // AND with Standard track cuts \r
-   // 8, 1<<3\r
-   trackFilter->AddCuts(electronID);\r
-   electronID->SetFilterMask(4);       // AND with Pixel Cuts\r
-   // 16, 1<<4\r
-   trackFilter->AddCuts(esdTrackCutsH);\r
-   // 32, 1<<5\r
-   trackFilter->AddCuts(esdTrackCutsH2);\r
-   // 64, 1<<6\r
-   trackFilter->AddCuts(esdTrackCutsH3);\r
-   // 128 , 1 << 7\r
-   trackFilter->AddCuts(esdTrackCutsTPCOnly);\r
-   if(enableTPCOnlyAODTracksLocalFlag)esdfilter->SetTPCOnlyFilterMask(128);\r
-   // 256, 1 << 8 Global Hybrids\r
-   trackFilter->AddCuts(esdTrackCutsHTG);\r
-   esdfilter->SetHybridFilterMaskGlobalConstrainedGlobal((1<<8)); // these normal global tracks will be marked as hybrid    \r
-   // 512, 1<< 9 GlobalConstraint Hybrids\r
-   trackFilter->AddCuts(esdTrackCutsHTGC);\r
-   esdfilter->SetGlobalConstrainedFilterMask(1<<9); // these tracks are written out as global constrained tracks \r
-   esdfilter->SetWriteHybridGlobalConstrainedOnly(kTRUE); // write only the complement\r
-   // 1024, 1<< 10 // tight DCA cuts\r
-   trackFilter->AddCuts(esdTrackCutsH2Cluster);\r
-   esdfilter->SetTrackFilter(trackFilter);\r
-\r
-   return kTRUE;\r
-\r
-}\r
+
+Bool_t AddTrackCutsLHC10bcde(AliAnalysisTaskESDfilter* esdFilter);
+Bool_t AddTrackCutsLHC10h(AliAnalysisTaskESDfilter* esdFilter);
+Bool_t AddTrackCutsLHC11h(AliAnalysisTaskESDfilter* esdFilter);
+Bool_t enableTPCOnlyAODTracksLocalFlag=kFALSE;
+
+
+AliAnalysisTaskESDfilter *AddTaskESDFilter(Bool_t useKineFilter=kTRUE, 
+                                           Bool_t writeMuonAOD=kFALSE,
+                                           Bool_t writeDimuonAOD=kFALSE,
+                                           Bool_t usePhysicsSelection=kFALSE,
+                                           Bool_t useCentralityTask=kFALSE, /*obsolete*/
+                                           Bool_t enableTPCOnlyAODTracks=kFALSE,
+                                           Bool_t disableCascades=kFALSE,
+                                           Bool_t disableKinks=kFALSE, 
+                                           Int_t runFlag = 1100,
+                                           Int_t  muonMCMode = 2, 
+                                           Bool_t useV0Filter=kTRUE)
+{
+  // Creates a filter task and adds it to the analysis manager.
+   // Get the pointer to the existing analysis manager via the static access method.
+   //==============================================================================
+   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+   if (!mgr) {
+      ::Error("AddTaskESDFilter", "No analysis manager to connect to.");
+     return NULL;
+   }   
+   
+   // This task requires an ESD input handler and an AOD output handler.
+   // Check this using the analysis manager.
+   //===============================================================================
+   TString type = mgr->GetInputEventHandler()->GetDataType();
+   if (!type.Contains("ESD")) {
+      ::Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an ESD input handler.");
+      return NULL;
+   }   
+   // Check if AOD output handler exist.
+   AliAODHandler *aod_h = (AliAODHandler*)mgr->GetOutputEventHandler();
+   if (!aod_h) {
+      ::Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an AOD output handler.");
+      return NULL;
+   }
+   // Check if MC handler is connected in case kine filter requested
+   AliMCEventHandler *mcH = (AliMCEventHandler*)mgr->GetMCtruthEventHandler();
+   if (!mcH && useKineFilter) {
+      ::Error("AddTaskESDFilter", "No MC handler connected while kine filtering requested");
+      return NULL;
+   }   
+   
+   // Create the task, add it to the manager and configure it.
+   //===========================================================================   
+   // Barrel tracks filter
+   AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
+   if (disableCascades) esdfilter->DisableCascades();
+   if  (disableKinks) esdfilter->DisableKinks();
+  
+   mgr->AddTask(esdfilter);
+  
+   // Muons
+   Bool_t onlyMuon=kTRUE;
+   Bool_t keepAllEvents=kTRUE;
+   Int_t mcMode= useKineFilter ? muonMCMode : 0; // use 1 instead of 2 to get all MC information instead of just ancestors of mu tracks
+   AliAnalysisTaskESDMuonFilter *esdmuonfilter = new AliAnalysisTaskESDMuonFilter("ESD Muon Filter",onlyMuon,keepAllEvents,mcMode);
+   mgr->AddTask(esdmuonfilter);
+   if(usePhysicsSelection){
+     esdfilter->SelectCollisionCandidates(AliVEvent::kAny);
+     esdmuonfilter->SelectCollisionCandidates(AliVEvent::kAny);
+   }  
+
+   // Filtering of MC particles (decays conversions etc)
+   // this task has to go AFTER all other filter tasks
+   // since it fills the AODMC array with all
+   // selected MC Particles, only this way we have the 
+   // AODMCparticle information available for following tasks
+   AliAnalysisTaskMCParticleFilter *kinefilter = 0;
+   if (useKineFilter) {
+      kinefilter = new AliAnalysisTaskMCParticleFilter("Particle Kine Filter");
+      mgr->AddTask(kinefilter);
+   }   
+
+   enableTPCOnlyAODTracksLocalFlag = enableTPCOnlyAODTracks;
+   if((runFlag/100)==10){
+     if((runFlag%100)==0) AddTrackCutsLHC10bcde(esdfilter);
+     else AddTrackCutsLHC10h(esdfilter);
+   }
+   else {
+     // default 11h
+     AddTrackCutsLHC11h(esdfilter);
+   }
+
+   // Filter with cuts on V0s
+   if (useV0Filter) {
+     AliESDv0Cuts*   esdV0Cuts = new AliESDv0Cuts("Standard V0 Cuts pp", "ESD V0 Cuts");
+     esdV0Cuts->SetMinRadius(0.2);
+     esdV0Cuts->SetMaxRadius(200);
+     esdV0Cuts->SetMinDcaPosToVertex(0.05);
+     esdV0Cuts->SetMinDcaNegToVertex(0.05);
+     esdV0Cuts->SetMaxDcaV0Daughters(1.5);
+     esdV0Cuts->SetMinCosinePointingAngle(0.99);
+     AliAnalysisFilter* v0Filter = new AliAnalysisFilter("v0Filter");
+     v0Filter->AddCuts(esdV0Cuts);
+
+     esdfilter->SetV0Filter(v0Filter);
+   }  
+
+   // Enable writing of Muon AODs
+   esdmuonfilter->SetWriteMuonAOD(writeMuonAOD);
+   
+   // Enable writing of Dimuon AODs
+   esdmuonfilter->SetWriteDimuonAOD(writeDimuonAOD);
+   // Create ONLY the output containers for the data produced by the task.
+   // Get and connect other common input/output containers via the manager as below
+   //==============================================================================
+   mgr->ConnectInput  (esdfilter,  0, mgr->GetCommonInputContainer());
+   mgr->ConnectOutput (esdfilter,  0, mgr->GetCommonOutputContainer());
+   mgr->ConnectInput  (esdmuonfilter, 0, mgr->GetCommonInputContainer());
+   if (useKineFilter) {
+      mgr->ConnectInput  (kinefilter,  0, mgr->GetCommonInputContainer());
+      mgr->ConnectOutput (kinefilter,  0, mgr->GetCommonOutputContainer());
+      AliAnalysisDataContainer *coutputEx = mgr->CreateContainer("cFilterList", TList::Class(),
+                                                                  AliAnalysisManager::kOutputContainer,"pyxsec_hists.root");
+      mgr->ConnectOutput (kinefilter,  1,coutputEx);
+   }   
+   return esdfilter;
+}
+
+
+
+Bool_t AddTrackCutsLHC10h(AliAnalysisTaskESDfilter* esdfilter){
+
+  Printf("%s%d: Creating Track Cuts for LHC10h",(char*)__FILE__,__LINE__);
+
+  // Cuts on primary tracks
+  AliESDtrackCuts* esdTrackCutsL = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+  
+  // ITS stand-alone tracks
+  AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("ITS stand-alone Track Cuts", "ESD Track Cuts");
+  esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);
+  
+  // Pixel OR necessary for the electrons
+  AliESDtrackCuts *itsStrong = new AliESDtrackCuts("ITSorSPD", "pixel requirement for ITS");
+  itsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
+  
+  
+  // PID for the electrons
+  AliESDpidCuts *electronID = new AliESDpidCuts("Electrons", "Electron PID cuts");
+  electronID->SetTPCnSigmaCut(AliPID::kElectron, 3.5);
+  
+  // tighter cuts on primary particles for high pT tracks
+  // take the standard cuts, which include already 
+  // ITSrefit and use only primaries...
+  
+  // ITS cuts for new jet analysis 
+  //  gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");
+  //  AliESDtrackCuts* esdTrackCutsHG0 = CreateTrackCutsPWGJE(10001006);
+
+  AliESDtrackCuts *jetCuts1006 = new AliESDtrackCuts("AliESDtrackCuts"); 
+
+  TFormula *f1NClustersTPCLinearPtDep = new TFormula("f1NClustersTPCLinearPtDep","70.+30./20.*x");
+  jetCuts1006->SetMinNClustersTPCPtDep(f1NClustersTPCLinearPtDep,20.);
+  jetCuts1006->SetMinNClustersTPC(70);
+  jetCuts1006->SetMaxChi2PerClusterTPC(4);
+  jetCuts1006->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
+  jetCuts1006->SetAcceptKinkDaughters(kFALSE);
+  jetCuts1006->SetRequireTPCRefit(kTRUE);
+  jetCuts1006->SetMaxFractionSharedTPCClusters(0.4);
+  // ITS
+  jetCuts1006->SetRequireITSRefit(kTRUE);
+  //accept secondaries
+  jetCuts1006->SetMaxDCAToVertexXY(2.4);
+  jetCuts1006->SetMaxDCAToVertexZ(3.2);
+  jetCuts1006->SetDCAToVertex2D(kTRUE);
+  //reject fakes
+  jetCuts1006->SetMaxChi2PerClusterITS(36);
+  jetCuts1006->SetMaxChi2TPCConstrainedGlobal(36);
+
+  jetCuts1006->SetRequireSigmaToVertex(kFALSE);
+
+  jetCuts1006->SetEtaRange(-0.9,0.9);
+  jetCuts1006->SetPtRange(0.15, 1E+15.);
+
+  AliESDtrackCuts* esdTrackCutsHG0 = jetCuts1006->Clone("JetCuts10001006");
+  esdTrackCutsHG0->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
+
+
+  // throw out tracks with too low number of clusters in
+  // the first pass (be consistent with TPC only tracks)
+  // N.B. the number off crossed rows still acts on the tracks after
+  // all iterations if we require tpc standalone, number of clusters
+  // and chi2 TPC cuts act on track after the first iteration
+  //   esdTrackCutsH0->SetRequireTPCStandAlone(kTRUE);
+  //   esdTrackCutsH0->SetMinNClustersTPC(80); // <--- first pass
+  
+  
+  // the complement to the one with SPD requirement
+  //  AliESDtrackCuts* esdTrackCutsHG1 = CreateTrackCutsPWGJE(10011006);
+  AliESDtrackCuts* esdTrackCutsHG1 = jetCuts1006->Clone("JetCuts10011006");
+  esdTrackCutsHG1->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);
+
+  // the tracks that must not be taken pass this cut and
+  // non HGC1 and HG
+  //  AliESDtrackCuts* esdTrackCutsHG2 = CreateTrackCutsPWGJE(10021006);
+  AliESDtrackCuts* esdTrackCutsHG2 = jetCuts1006->Clone("JetCuts10021006");
+  esdTrackCutsHG2->SetMaxChi2PerClusterITS(1E10);
+
+
+  // standard cuts also used in R_AA analysis
+  //   "Global track RAA analysis QM2011 + Chi2ITS<36";
+  //  AliESDtrackCuts* esdTrackCutsH2 = CreateTrackCutsPWGJE(1000);
+  AliESDtrackCuts* esdTrackCutsH2 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE,1);
+  esdTrackCutsH2->SetMinNCrossedRowsTPC(120);
+  esdTrackCutsH2->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
+  esdTrackCutsH2->SetMaxChi2PerClusterITS(36);
+  esdTrackCutsH2->SetMaxFractionSharedTPCClusters(0.4);
+  esdTrackCutsH2->SetMaxChi2TPCConstrainedGlobal(36);
+
+  esdTrackCutsH2->SetEtaRange(-0.9,0.9);
+  esdTrackCutsH2->SetPtRange(0.15, 1e10);
+
+
+  //  AliESDtrackCuts* esdTrackCutsGCOnly = CreateTrackCutsPWGJE(10041006);
+  AliESDtrackCuts* esdTrackCutsGCOnly = jetCuts1006->Clone("JetCuts10041006");
+  esdTrackCutsGCOnly->SetRequireITSRefit(kFALSE);
+
+  // TPC only tracks
+  AliESDtrackCuts* esdTrackCutsTPCCOnly = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+  esdTrackCutsTPCCOnly->SetMinNClustersTPC(70);
+  
+  // Compose the filter
+  AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
+  // 1, 1<<0
+  trackFilter->AddCuts(esdTrackCutsL);
+  // 2 1<<1
+  trackFilter->AddCuts(esdTrackCutsITSsa);
+  // 4 1<<2
+  trackFilter->AddCuts(itsStrong);
+  itsStrong->SetFilterMask(1);        // AND with Standard track cuts 
+  // 8 1<<3
+  trackFilter->AddCuts(electronID);
+  electronID->SetFilterMask(4);       // AND with Pixel Cuts
+  // 16 1<<4
+  trackFilter->AddCuts(esdTrackCutsHG0);
+  // 32 1<<5
+  trackFilter->AddCuts(esdTrackCutsHG1);
+  // 64 1<<6
+  trackFilter->AddCuts(esdTrackCutsHG2);
+  // 128 1<<7
+  trackFilter->AddCuts(esdTrackCutsTPCCOnly); // add QM TPC only track cuts
+  if(enableTPCOnlyAODTracksLocalFlag)esdfilter->SetTPCOnlyFilterMask(128);
+  // 256 1<<8
+  trackFilter->AddCuts(esdTrackCutsGCOnly);
+  // 512 1<<9                         
+  AliESDtrackCuts* esdTrackCutsHG1_tmp = new AliESDtrackCuts(*esdTrackCutsHG1); // avoid double delete
+  trackFilter->AddCuts(esdTrackCutsHG1_tmp); // add once more for tpc only tracks
+  // 1024 1<<10                        
+  trackFilter->AddCuts(esdTrackCutsH2); // add r_aa cuts
+
+  
+  
+  esdfilter->SetGlobalConstrainedFilterMask(1<<8|1<<9); // these tracks are written out as global constrained tracks
+  esdfilter->SetHybridFilterMaskGlobalConstrainedGlobal((1<<4)); // these normal global tracks will be marked as hybrid
+  esdfilter->SetWriteHybridGlobalConstrainedOnly(kTRUE); // write only the complement
+  //     esdfilter->SetTPCConstrainedFilterMask(1<<11); // these tracks are written out as tpc constrained tracks
+
+  esdfilter->SetTrackFilter(trackFilter);
+  return kTRUE;
+  
+}
+
+
+Bool_t AddTrackCutsLHC11h(AliAnalysisTaskESDfilter* esdfilter){
+
+
+  Printf("%s%d: Creating Track Cuts LHC11h",(char*)__FILE__,__LINE__);
+
+  // Cuts on primary tracks
+   AliESDtrackCuts* esdTrackCutsL = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+
+   // ITS stand-alone tracks
+   AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("ITS stand-alone Track Cuts", "ESD Track Cuts");
+   esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);
+
+   // Pixel OR necessary for the electrons
+   AliESDtrackCuts *itsStrong = new AliESDtrackCuts("ITSorSPD", "pixel requirement for ITS");
+   itsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
+
+
+   // PID for the electrons
+   AliESDpidCuts *electronID = new AliESDpidCuts("Electrons", "Electron PID cuts");
+   electronID->SetTPCnSigmaCut(AliPID::kElectron, 3.5);
+
+   // standard cuts with very loose DCA
+   AliESDtrackCuts* esdTrackCutsH = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE); 
+   esdTrackCutsH->SetMaxDCAToVertexXY(2.4);
+   esdTrackCutsH->SetMaxDCAToVertexZ(3.2);
+   esdTrackCutsH->SetDCAToVertex2D(kTRUE);
+
+   // standard cuts with tight DCA cut
+   AliESDtrackCuts* esdTrackCutsH2 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
+
+   // standard cuts with tight DCA but with requiring the first SDD cluster instead of an SPD cluster
+   // tracks selected by this cut are exclusive to those selected by the previous cut
+   AliESDtrackCuts* esdTrackCutsH3 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(); 
+   esdTrackCutsH3->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);
+   esdTrackCutsH3->SetClusterRequirementITS(AliESDtrackCuts::kSDD, AliESDtrackCuts::kFirst);
+   // TPC only tracks: Optionally enable the writing of TPConly information
+   // constrained to SPD vertex in the filter below
+   AliESDtrackCuts* esdTrackCutsTPCOnly = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+   // The following line is needed for 2010 PbPb reprocessing and pp, but not for 2011 PbPb
+   //esdTrackCutsTPCOnly->SetMinNClustersTPC(70);
+
+   // Extra cuts for hybrids
+   // first the global tracks we want to take
+   AliESDtrackCuts* esdTrackCutsHTG = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE); 
+   esdTrackCutsHTG->SetName("Global Hybrid tracks, loose DCA");
+   esdTrackCutsHTG->SetMaxDCAToVertexXY(2.4);
+   esdTrackCutsHTG->SetMaxDCAToVertexZ(3.2);
+   esdTrackCutsHTG->SetDCAToVertex2D(kTRUE);
+   esdTrackCutsHTG->SetMaxChi2TPCConstrainedGlobal(36);
+   esdTrackCutsHTG->SetMaxFractionSharedTPCClusters(0.4);
+   
+
+   // Than the complementary tracks which will be stored as global
+   // constraint, complement is done in the ESDFilter task
+   AliESDtrackCuts* esdTrackCutsHTGC = new AliESDtrackCuts(*esdTrackCutsHTG);
+   esdTrackCutsHTGC->SetName("Global Constraint Hybrid tracks, loose DCA no it requirement");
+   esdTrackCutsHTGC->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kOff);
+   esdTrackCutsHTGC->SetRequireITSRefit(kTRUE);
+
+   // standard cuts with tight DCA cut, using cluster cut instead of crossed rows (a la 2010 default)
+   AliESDtrackCuts* esdTrackCutsH2Cluster = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE, 0);
+
+   // Compose the filter
+   AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
+   // 1, 1<<0
+   trackFilter->AddCuts(esdTrackCutsL);
+   // 2, 1<<1
+   trackFilter->AddCuts(esdTrackCutsITSsa);
+   // 4, 1<<2
+   trackFilter->AddCuts(itsStrong);
+   itsStrong->SetFilterMask(1);        // AND with Standard track cuts 
+   // 8, 1<<3
+   trackFilter->AddCuts(electronID);
+   electronID->SetFilterMask(4);       // AND with Pixel Cuts
+   // 16, 1<<4
+   trackFilter->AddCuts(esdTrackCutsH);
+   // 32, 1<<5
+   trackFilter->AddCuts(esdTrackCutsH2);
+   // 64, 1<<6
+   trackFilter->AddCuts(esdTrackCutsH3);
+   // 128 , 1 << 7
+   trackFilter->AddCuts(esdTrackCutsTPCOnly);
+   if(enableTPCOnlyAODTracksLocalFlag)esdfilter->SetTPCOnlyFilterMask(128);
+   // 256, 1 << 8 Global Hybrids
+   trackFilter->AddCuts(esdTrackCutsHTG);
+   esdfilter->SetHybridFilterMaskGlobalConstrainedGlobal((1<<8)); // these normal global tracks will be marked as hybrid    
+   // 512, 1<< 9 GlobalConstraint Hybrids
+   trackFilter->AddCuts(esdTrackCutsHTGC);
+   esdfilter->SetGlobalConstrainedFilterMask(1<<9); // these tracks are written out as global constrained tracks 
+   esdfilter->SetWriteHybridGlobalConstrainedOnly(kTRUE); // write only the complement
+   // 1024, 1<< 10 // tight DCA cuts
+   trackFilter->AddCuts(esdTrackCutsH2Cluster);
+   esdfilter->SetTrackFilter(trackFilter);
+
+   return kTRUE;
+
+}
+
+Bool_t AddTrackCutsLHC10bcde(AliAnalysisTaskESDfilter* esdfilter){
+
+
+  Printf("%s%d: Creating Track Cuts LHC10bcde",(char*)__FILE__,__LINE__);
+
+  // Cuts on primary tracks
+   AliESDtrackCuts* esdTrackCutsL = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+
+   // ITS stand-alone tracks
+   AliESDtrackCuts* esdTrackCutsITSsa = new AliESDtrackCuts("ITS stand-alone Track Cuts", "ESD Track Cuts");
+   esdTrackCutsITSsa->SetRequireITSStandAlone(kTRUE);
+
+   // Pixel OR necessary for the electrons
+   AliESDtrackCuts *itsStrong = new AliESDtrackCuts("ITSorSPD", "pixel requirement for ITS");
+   itsStrong->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
+
+
+   // PID for the electrons
+   AliESDpidCuts *electronID = new AliESDpidCuts("Electrons", "Electron PID cuts");
+   electronID->SetTPCnSigmaCut(AliPID::kElectron, 3.5);
+
+   // standard cuts with very loose DCA
+   AliESDtrackCuts* esdTrackCutsH = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE); 
+   esdTrackCutsH->SetMaxDCAToVertexXY(2.4);
+   esdTrackCutsH->SetMaxDCAToVertexZ(3.2);
+   esdTrackCutsH->SetDCAToVertex2D(kTRUE);
+
+   // standard cuts with tight DCA cut
+   AliESDtrackCuts* esdTrackCutsH2 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
+
+   // standard cuts with tight DCA but with requiring the first SDD cluster instead of an SPD cluster
+   // tracks selected by this cut are exclusive to those selected by the previous cut
+   AliESDtrackCuts* esdTrackCutsH3 = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(); 
+   esdTrackCutsH3->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kNone);
+   esdTrackCutsH3->SetClusterRequirementITS(AliESDtrackCuts::kSDD, AliESDtrackCuts::kFirst);
+   // TPC only tracks: Optionally enable the writing of TPConly information
+   // constrained to SPD vertex in the filter below
+   AliESDtrackCuts* esdTrackCutsTPCOnly = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+   // The following line is needed for 2010 PbPb reprocessing and pp, but not for 2011 PbPb
+   esdTrackCutsTPCOnly->SetMinNClustersTPC(70);
+
+   // Extra cuts for hybrids
+   // first the global tracks we want to take
+   // take the HTGs from 10h
+
+   //  gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");
+   //  AliESDtrackCuts* esdTrackCutsHG0 = CreateTrackCutsPWGJE(10001006);
+
+   AliESDtrackCuts *jetCuts1006 = new AliESDtrackCuts("AliESDtrackCuts"); 
+
+   TFormula *f1NClustersTPCLinearPtDep = new TFormula("f1NClustersTPCLinearPtDep","70.+30./20.*x");
+   jetCuts1006->SetMinNClustersTPCPtDep(f1NClustersTPCLinearPtDep,20.);
+   jetCuts1006->SetMinNClustersTPC(70);
+   jetCuts1006->SetMaxChi2PerClusterTPC(4);
+   jetCuts1006->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
+   jetCuts1006->SetAcceptKinkDaughters(kFALSE);
+   jetCuts1006->SetRequireTPCRefit(kTRUE);
+   jetCuts1006->SetMaxFractionSharedTPCClusters(0.4);
+   // ITS
+   jetCuts1006->SetRequireITSRefit(kTRUE);
+   //accept secondaries
+   jetCuts1006->SetMaxDCAToVertexXY(2.4);
+   jetCuts1006->SetMaxDCAToVertexZ(3.2);
+   jetCuts1006->SetDCAToVertex2D(kTRUE);
+   //reject fakes
+   jetCuts1006->SetMaxChi2PerClusterITS(36);
+   jetCuts1006->SetMaxChi2TPCConstrainedGlobal(36);
+
+   jetCuts1006->SetRequireSigmaToVertex(kFALSE);
+   
+   jetCuts1006->SetEtaRange(-0.9,0.9);
+   jetCuts1006->SetPtRange(0.15, 1E+15.);
+   
+   AliESDtrackCuts* esdTrackCutsHTG = jetCuts1006->Clone("JetCuts10001006");
+   esdTrackCutsHTG->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
+
+   // Than the complementary tracks which will be stored as global
+   // constraint, complement is done in the ESDFilter task
+   // HGC from 10h
+
+   AliESDtrackCuts* esdTrackCutsHTGC = jetCuts1006->Clone("JetCuts10041006");
+   esdTrackCutsHTGC->SetRequireITSRefit(kFALSE);
+
+   // standard cuts with tight DCA cut, using cluster cut instead of crossed rows (a la 2010 default)
+   AliESDtrackCuts* esdTrackCutsH2Cluster = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE, 0);
+
+   // Compose the filter
+   AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
+   // 1, 1<<0
+   trackFilter->AddCuts(esdTrackCutsL);
+   // 2, 1<<1
+   trackFilter->AddCuts(esdTrackCutsITSsa);
+   // 4, 1<<2
+   trackFilter->AddCuts(itsStrong);
+   itsStrong->SetFilterMask(1);        // AND with Standard track cuts 
+   // 8, 1<<3
+   trackFilter->AddCuts(electronID);
+   electronID->SetFilterMask(4);       // AND with Pixel Cuts
+   // 16, 1<<4
+   trackFilter->AddCuts(esdTrackCutsH);
+   // 32, 1<<5
+   trackFilter->AddCuts(esdTrackCutsH2);
+   // 64, 1<<6
+   trackFilter->AddCuts(esdTrackCutsH3);
+   // 128 , 1 << 7
+   trackFilter->AddCuts(esdTrackCutsTPCOnly);
+   if(enableTPCOnlyAODTracksLocalFlag)esdfilter->SetTPCOnlyFilterMask(128);
+   // 256, 1 << 8 Global Hybrids
+   trackFilter->AddCuts(esdTrackCutsHTG);
+   esdfilter->SetHybridFilterMaskGlobalConstrainedGlobal((1<<8)); // these normal global tracks will be marked as hybrid    
+   // 512, 1<< 9 GlobalConstraint Hybrids
+   trackFilter->AddCuts(esdTrackCutsHTGC);
+   esdfilter->SetGlobalConstrainedFilterMask(1<<9); // these tracks are written out as global constrained tracks 
+   esdfilter->SetWriteHybridGlobalConstrainedOnly(kTRUE); // write only the complement
+   // 1024, 1<< 10 // tight DCA cuts
+   trackFilter->AddCuts(esdTrackCutsH2Cluster);
+   esdfilter->SetTrackFilter(trackFilter);
+
+   return kTRUE;
+
+}
index 8b83a53..dff80e8 100644 (file)
@@ -195,7 +195,7 @@ void AliTRDTenderSupply::ProcessEvent()
 
   fESD = fTender->GetEvent();
   if (!fESD) return;
-  if(fNormalizationFactorArray) fNormalizationFactor = GetNormalizationFactor(fESD->GetRunNumber());\r
+  if(fNormalizationFactorArray) fNormalizationFactor = GetNormalizationFactor(fESD->GetRunNumber());
   Int_t ntracks=fESD->GetNumberOfTracks();
 
 
@@ -490,7 +490,7 @@ void AliTRDTenderSupply::ApplyRunByRunCorrection(AliESDtrack *const track) {
 
   TVectorD *corrfactor = dynamic_cast<TVectorD *>(fRunByRunCorrection->GetObject(fTender->GetRun()));
   if(!corrfactor){ 
-    // No correction available - simply return\r
+    // No correction available - simply return
     AliDebug(2, "Couldn't derive gain correction factor from OADB");
     return;
   }
@@ -524,7 +524,7 @@ void AliTRDTenderSupply::SetNormalizationFactor(Double_t norm, Int_t runMin, Int
 //_____________________________________________________
 Double_t AliTRDTenderSupply::GetNormalizationFactor(Int_t runnumber){
   // 
-  // Load the normalization factor\r
+  // Load the normalization factor
   //
   Double_t norm = 1.;
   if(fNormalizationFactorArray){
index eaa94b5..da5e875 100644 (file)
-// $Id$\r
-\r
-/**************************************************************************\r
- * This file is property of and copyright by the ALICE HLT Project        * \r
- * All rights reserved.                                                   *\r
- *                                                                        *\r
- * Primary Authors: Oystein Djuvsland                                     *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          * \r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
- /** \r
- * @file   AliHLTCaloDigitMaker.cxx\r
- * @author Oystein Djuvsland\r
- * @date \r
- * @brief  Digit maker for CALO HLT  \r
- */\r
-      \r
-\r
-// see header file for class documentation\r
-// or\r
-// refer to README to build package\r
-// or\r
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt\r
-\r
-#include "AliHLTCaloDigitMaker.h"\r
-#include "AliHLTCaloConstantsHandler.h"\r
-#include "AliHLTCaloMapper.h"\r
-#include "AliHLTCaloChannelDataStruct.h"\r
-#include "AliHLTCaloChannelDataHeaderStruct.h"\r
-#include "AliHLTCaloDigitDataStruct.h"\r
-#include "AliHLTCaloCoordinate.h"\r
-#include "AliHLTCaloSharedMemoryInterfacev2.h" // added by PTH\r
-//#include "AliPHOSEMCAGeometry.h"\r
-#include "TH2F.h"\r
-#include "AliHLTCaloConstants.h"\r
-#include "AliHLTLogging.h"\r
-\r
-ClassImp(AliHLTCaloDigitMaker);\r
-\r
-//using namespace CaloHLTConst;\r
-\r
-AliHLTCaloDigitMaker::AliHLTCaloDigitMaker(TString det) :\r
-  AliHLTCaloConstantsHandler(det),\r
-  AliHLTLogging(),\r
-  fShmPtr(0),\r
-  fDigitStructPtr(0),\r
-  fDigitCount(0),\r
-  fMapperPtr(0),\r
-  fHighGainFactors(0),\r
-  fLowGainFactors(0),\r
-  fBadChannelMask(0),\r
-  fChannelBook(0),\r
-  fMaxEnergy(900),\r
-  fMinTime(0.0),\r
-  fMaxTime(1008.0)\r
-{\r
-  // See header file for documentation\r
-\r
-  fShmPtr = new AliHLTCaloSharedMemoryInterfacev2(det);\r
-\r
-  fHighGainFactors = new Float_t*[fCaloConstants->GetNXCOLUMNSMOD()];\r
-  fLowGainFactors = new Float_t*[fCaloConstants->GetNXCOLUMNSMOD()];\r
-  \r
-  fBadChannelMask = new Bool_t**[fCaloConstants->GetNXCOLUMNSMOD()];\r
-  \r
-  fChannelBook= new AliHLTCaloDigitDataStruct**[fCaloConstants->GetNXCOLUMNSMOD()];\r
-  \r
-  for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)\r
-    {\r
-      fHighGainFactors[x] = new Float_t[fCaloConstants->GetNZROWSMOD()];\r
-      fLowGainFactors[x] = new Float_t[fCaloConstants->GetNZROWSMOD()];\r
-\r
-      fBadChannelMask[x] = new Bool_t*[fCaloConstants->GetNZROWSMOD()];\r
-\r
-      fChannelBook[x] = new AliHLTCaloDigitDataStruct*[fCaloConstants->GetNZROWSMOD()];\r
-\r
-      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)\r
-       {\r
-\r
-         fHighGainFactors[x][z] = 0.0153;\r
-         fLowGainFactors[x][z] = 0.245;\r
-        \r
-         fBadChannelMask[x][z] = new Bool_t[fCaloConstants->GetNGAINS()];\r
-         fBadChannelMask[x][z][fCaloConstants->GetHIGHGAIN()] = false;\r
-         fBadChannelMask[x][z][fCaloConstants->GetLOWGAIN()] = false; \r
-         \r
-         fChannelBook[x][z] = 0;\r
-         \r
-       }\r
-    }    \r
-}\r
-\r
-AliHLTCaloDigitMaker::~AliHLTCaloDigitMaker() \r
-{\r
-  //See header file for documentation\r
-  delete [] fHighGainFactors;\r
-  delete [] fLowGainFactors;\r
-  delete [] fBadChannelMask;  \r
-  delete [] fChannelBook;\r
-  delete fShmPtr;\r
-\r
-}\r
-\r
-Int_t\r
-AliHLTCaloDigitMaker::MakeDigits(AliHLTCaloChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize)\r
-{\r
-  //See header file for documentation\r
-  \r
-  Reset();\r
-\r
-  UInt_t totSize = sizeof(AliHLTCaloDigitDataStruct);\r
-  \r
-//   Int_t xMod = -1;\r
-//   Int_t zMod = -1;\r
-  \r
-\r
-  AliHLTCaloCoordinate coord;\r
-  \r
-  \r
-  AliHLTCaloChannelDataStruct* currentchannel = 0;\r
-  \r
-  fShmPtr->SetMemory(channelDataHeader);\r
-  currentchannel = fShmPtr->NextChannel();\r
-\r
-  while(currentchannel != 0)\r
-    {\r
-      if(availableSize < totSize) return -1;\r
-\r
-      fMapperPtr->ChannelId2Coordinate(currentchannel->fChannelID, coord);\r
-      \r
-      //      fMapperPtr->GetLocalCoord(currentchannel->fChannelID, locCoord);\r
-      if(UseDigit(coord, currentchannel))\r
-      {\r
-       AddDigit(currentchannel, coord);\r
-       //      j++;          \r
-       totSize += sizeof(AliHLTCaloDigitDataStruct);\r
-      }\r
-      currentchannel = fShmPtr->NextChannel(); // Get the next channel\r
-    }\r
-//       if(currentchannel)\r
-//     {\r
-//       fMapperPtr->GetLocalCoord(currentchannel->fChannelID, locCoord);\r
-//       if(UseDigit(coord1, currentchannel))\r
-//         {\r
-//           AddDigit(currentchannel, coord1, locCoord);\r
-//           j++;            \r
-//           totSize += sizeof(AliHLTCaloDigitDataStruct);\r
-//         }\r
-//       currentchannel = fShmPtr->NextChannel(); // Get the next channel\r
-//     }\r
-//     }\r
-   \r
-//   fDigitCount += j;\r
-   return fDigitCount; \r
-}\r
-\r
-void \r
-AliHLTCaloDigitMaker::SetGlobalHighGainFactor(Float_t factor)\r
-{\r
-  //See header file for documentation\r
-  for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)\r
-    {\r
-      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)\r
-       {\r
-         fHighGainFactors[x][z] = factor;\r
-       }\r
-    }\r
-}\r
-\r
-\r
-void\r
-AliHLTCaloDigitMaker::SetGlobalLowGainFactor(Float_t factor)\r
-{\r
-  //See header file for documentation\r
-  for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)\r
-    {\r
-      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)\r
-       {\r
-         fLowGainFactors[x][z] = factor;\r
-       }\r
-    }\r
-}\r
-\r
-\r
-void\r
-AliHLTCaloDigitMaker::SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut)\r
-{\r
- for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)\r
-    {\r
-      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)\r
-       {\r
-         if(badChannelHGHist->GetBinContent(x, z) < qCut && badChannelHGHist->GetBinContent(x, z) > 0)\r
-           {\r
-             fBadChannelMask[x][z][fCaloConstants->GetHIGHGAIN()] = true;\r
-           }\r
-         else\r
-           {\r
-             fBadChannelMask[x][z][fCaloConstants->GetHIGHGAIN()] = false;\r
-           }\r
-         if(badChannelLGHist->GetBinContent(x, z) < qCut && badChannelLGHist->GetBinContent(x, z) > 0)\r
-           {\r
-             fBadChannelMask[x][z][fCaloConstants->GetLOWGAIN()] = false;\r
-           }\r
-         else\r
-           {\r
-             fBadChannelMask[x][z][fCaloConstants->GetLOWGAIN()] = false;\r
-           }\r
-       }\r
-    }\r
-}\r
-\r
-void\r
-AliHLTCaloDigitMaker::Reset()\r
-{\r
-  fDigitCount = 0;\r
-  for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)\r
-    {\r
-      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)\r
-       {\r
-         fChannelBook[x][z] = 0;\r
-       }\r
-    }    \r
-\r
-}\r
-\r
-\r
-void AliHLTCaloDigitMaker::AddDigit(AliHLTCaloChannelDataStruct* channelData, AliHLTCaloCoordinate &coord)\r
-{\r
-\r
-  // Some book keeping of the pointers\r
-  AliHLTCaloDigitDataStruct *tmpDigit = fDigitStructPtr + 1;\r
-\r
-  // Check if we already have a digit in this position, and correct the book keeping correspondently\r
-  if(fChannelBook[coord.fX][coord.fZ]) \r
-    {\r
-      tmpDigit = fDigitStructPtr;\r
-      fDigitStructPtr = fChannelBook[coord.fX][coord.fZ];\r
-      fDigitCount--;\r
-      //      printf("Going to overwrite digit: x = %d, z = %d, gain = %d, energy = %f\n", fDigitStructPtr->fX, fDigitStructPtr->fZ, fDigitStructPtr->fGain, fDigitStructPtr->fEnergy);\r
-    }\r
-  \r
-  fChannelBook[coord.fX][coord.fZ] = fDigitStructPtr;\r
\r
-  fDigitStructPtr->fX = coord.fX;\r
-  fDigitStructPtr->fZ = coord.fZ;\r
-  fDigitStructPtr->fGain = coord.fGain;\r
-  fDigitStructPtr->fOverflow = false;\r
-  fDigitStructPtr->fAssociatedCluster = -1;\r
-  \r
-  fDigitStructPtr->fID = fDigitStructPtr->fZ * fCaloConstants->GetNXCOLUMNSMOD() + fDigitStructPtr->fX;\r
-  \r
-  if(coord.fGain == fCaloConstants->GetHIGHGAIN() )\r
-    {\r
-      fDigitStructPtr->fEnergy = channelData->fEnergy*fHighGainFactors[coord.fX][coord.fZ];\r
-      fDigitStructPtr->fHgPresent = true;\r
-      if(channelData->fEnergy >= fMaxEnergy)\r
-       {\r
-         fDigitStructPtr->fOverflow = true;\r
-       }\r
-      \r
-      HLTDebug("HG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f \n", \r
-              coord.fX, coord.fZ, channelData->fEnergy, fDigitStructPtr->fEnergy);\r
-    }\r
-  else\r
-    {\r
-      fDigitStructPtr->fEnergy = channelData->fEnergy*fLowGainFactors[coord.fX][coord.fZ];\r
-      if(channelData->fEnergy >= fMaxEnergy)\r
-       {\r
-         fDigitStructPtr->fOverflow = true;\r
-       }\r
-      HLTDebug("LG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f\n", coord.fX, coord.fZ, channelData->fEnergy, fDigitStructPtr->fEnergy); \r
-    }\r
-  fDigitStructPtr->fTime = channelData->fTime * 0.0000001; //TODO\r
-  fDigitStructPtr->fCrazyness = channelData->fCrazyness;\r
-  fDigitStructPtr->fModule = coord.fModuleId;\r
-  fDigitStructPtr = tmpDigit;\r
-  //  fDigitStructPtr++;\r
-  fDigitCount++;\r
-}\r
-\r
-bool AliHLTCaloDigitMaker::UseDigit(AliHLTCaloCoordinate &channelCoordinates, AliHLTCaloChannelDataStruct *channel) \r
-{\r
-   \r
-   if(fBadChannelMask[channelCoordinates.fX][channelCoordinates.fZ][0] == true) return false;\r
-   if(channel->fTime < fMinTime || channel->fTime > fMaxTime) return false;\r
-   \r
-  AliHLTCaloDigitDataStruct *tmpDigit = fChannelBook[channelCoordinates.fX][channelCoordinates.fZ];\r
-  //printf("UseDigit: Got digit, x: %d, z: %d, gain: %d, amp: %f\n", channelCoordinates.fX, channelCoordinates.fZ, channelCoordinates.fGain, channel->fEnergy);\r
-  if(tmpDigit)\r
-    {\r
-      if(channelCoordinates.fGain == fCaloConstants->GetLOWGAIN())\r
-       {\r
-                 //printf("UseDigit: Already have digit with, x: %d, z: %d, with high gain \n", channelCoordinates.fX, channelCoordinates.fZ);\r
-         if(tmpDigit->fOverflow)\r
-           {\r
-                    // printf("But it was in overflow! Let's use this low gain!\n");\r
-             return true;\r
-           }\r
-         return false;\r
-       }\r
-      else\r
-       {\r
-                 //printf("UseDigit: Already have digit with, x: %d, z: %d, with low gain: %d\n", channelCoordinates.fX, channelCoordinates.fZ);\r
-         if(channel->fEnergy > fMaxEnergy )\r
-           {\r
-             tmpDigit->fHgPresent = true;\r
-             return false;\r
-           }\r
-         return true;\r
-       }\r
-    }\r
-  return true;\r
-}\r
-\r
-void AliHLTCaloDigitMaker::SetBadChannel(Int_t x, Int_t z, Bool_t bad)\r
-{\r
-   // See header file for class documentation\r
-   fBadChannelMask[x][z][0] = bad;\r
-   fBadChannelMask[x][z][1] = bad;\r
-}\r
-\r
-void AliHLTCaloDigitMaker::SetGain(Int_t x, Int_t z, Float_t ratio, Float_t gain)\r
-{\r
-   // See header file for class documentation\r
-   HLTDebug("Applying gain: %f for channel x: %d, z: %d", gain, x, z); \r
-   fHighGainFactors[x][z] = gain;\r
-   fLowGainFactors[x][z] = gain * ratio;\r
-   \r
-}\r
+// $Id$
+
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * All rights reserved.                                                   *
+ *                                                                        *
+ * Primary Authors: Oystein Djuvsland                                     *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          * 
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+ /** 
+ * @file   AliHLTCaloDigitMaker.cxx
+ * @author Oystein Djuvsland
+ * @date 
+ * @brief  Digit maker for CALO HLT  
+ */
+      
+
+// see header file for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+
+#include "AliHLTCaloDigitMaker.h"
+#include "AliHLTCaloConstantsHandler.h"
+#include "AliHLTCaloMapper.h"
+#include "AliHLTCaloChannelDataStruct.h"
+#include "AliHLTCaloChannelDataHeaderStruct.h"
+#include "AliHLTCaloDigitDataStruct.h"
+#include "AliHLTCaloCoordinate.h"
+#include "AliHLTCaloSharedMemoryInterfacev2.h" // added by PTH
+//#include "AliPHOSEMCAGeometry.h"
+#include "TH2F.h"
+#include "AliHLTCaloConstants.h"
+#include "AliHLTLogging.h"
+
+ClassImp(AliHLTCaloDigitMaker);
+
+//using namespace CaloHLTConst;
+
+AliHLTCaloDigitMaker::AliHLTCaloDigitMaker(TString det) :
+  AliHLTCaloConstantsHandler(det),
+  AliHLTLogging(),
+  fShmPtr(0),
+  fDigitStructPtr(0),
+  fDigitCount(0),
+  fMapperPtr(0),
+  fHighGainFactors(0),
+  fLowGainFactors(0),
+  fBadChannelMask(0),
+  fChannelBook(0),
+  fMaxEnergy(900),
+  fMinTime(0.0),
+  fMaxTime(1008.0)
+{
+  // See header file for documentation
+
+  fShmPtr = new AliHLTCaloSharedMemoryInterfacev2(det);
+
+  fHighGainFactors = new Float_t*[fCaloConstants->GetNXCOLUMNSMOD()];
+  fLowGainFactors = new Float_t*[fCaloConstants->GetNXCOLUMNSMOD()];
+  
+  fBadChannelMask = new Bool_t**[fCaloConstants->GetNXCOLUMNSMOD()];
+  
+  fChannelBook= new AliHLTCaloDigitDataStruct**[fCaloConstants->GetNXCOLUMNSMOD()];
+  
+  for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)
+    {
+      fHighGainFactors[x] = new Float_t[fCaloConstants->GetNZROWSMOD()];
+      fLowGainFactors[x] = new Float_t[fCaloConstants->GetNZROWSMOD()];
+
+      fBadChannelMask[x] = new Bool_t*[fCaloConstants->GetNZROWSMOD()];
+
+      fChannelBook[x] = new AliHLTCaloDigitDataStruct*[fCaloConstants->GetNZROWSMOD()];
+
+      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)
+       {
+
+         fHighGainFactors[x][z] = 0.0153;
+         fLowGainFactors[x][z] = 0.245;
+        
+         fBadChannelMask[x][z] = new Bool_t[fCaloConstants->GetNGAINS()];
+         fBadChannelMask[x][z][fCaloConstants->GetHIGHGAIN()] = false;
+         fBadChannelMask[x][z][fCaloConstants->GetLOWGAIN()] = false; 
+         
+         fChannelBook[x][z] = 0;
+         
+       }
+    }    
+}
+
+AliHLTCaloDigitMaker::~AliHLTCaloDigitMaker() 
+{
+  //See header file for documentation
+  delete [] fHighGainFactors;
+  delete [] fLowGainFactors;
+  delete [] fBadChannelMask;  
+  delete [] fChannelBook;
+  delete fShmPtr;
+
+}
+
+Int_t
+AliHLTCaloDigitMaker::MakeDigits(AliHLTCaloChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize)
+{
+  //See header file for documentation
+  
+  Reset();
+
+  UInt_t totSize = sizeof(AliHLTCaloDigitDataStruct);
+  
+//   Int_t xMod = -1;
+//   Int_t zMod = -1;
+  
+
+  AliHLTCaloCoordinate coord;
+  
+  
+  AliHLTCaloChannelDataStruct* currentchannel = 0;
+  
+  fShmPtr->SetMemory(channelDataHeader);
+  currentchannel = fShmPtr->NextChannel();
+
+  while(currentchannel != 0)
+    {
+      if(availableSize < totSize) return -1;
+
+      fMapperPtr->ChannelId2Coordinate(currentchannel->fChannelID, coord);
+      
+      //      fMapperPtr->GetLocalCoord(currentchannel->fChannelID, locCoord);
+      if(UseDigit(coord, currentchannel))
+      {
+       AddDigit(currentchannel, coord);
+       //      j++;          
+       totSize += sizeof(AliHLTCaloDigitDataStruct);
+      }
+      currentchannel = fShmPtr->NextChannel(); // Get the next channel
+    }
+//       if(currentchannel)
+//     {
+//       fMapperPtr->GetLocalCoord(currentchannel->fChannelID, locCoord);
+//       if(UseDigit(coord1, currentchannel))
+//         {
+//           AddDigit(currentchannel, coord1, locCoord);
+//           j++;            
+//           totSize += sizeof(AliHLTCaloDigitDataStruct);
+//         }
+//       currentchannel = fShmPtr->NextChannel(); // Get the next channel
+//     }
+//     }
+   
+//   fDigitCount += j;
+   return fDigitCount; 
+}
+
+void 
+AliHLTCaloDigitMaker::SetGlobalHighGainFactor(Float_t factor)
+{
+  //See header file for documentation
+  for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)
+    {
+      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)
+       {
+         fHighGainFactors[x][z] = factor;
+       }
+    }
+}
+
+
+void
+AliHLTCaloDigitMaker::SetGlobalLowGainFactor(Float_t factor)
+{
+  //See header file for documentation
+  for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)
+    {
+      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)
+       {
+         fLowGainFactors[x][z] = factor;
+       }
+    }
+}
+
+
+void
+AliHLTCaloDigitMaker::SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut)
+{
+ for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)
+    {
+      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)
+       {
+         if(badChannelHGHist->GetBinContent(x, z) < qCut && badChannelHGHist->GetBinContent(x, z) > 0)
+           {
+             fBadChannelMask[x][z][fCaloConstants->GetHIGHGAIN()] = true;
+           }
+         else
+           {
+             fBadChannelMask[x][z][fCaloConstants->GetHIGHGAIN()] = false;
+           }
+         if(badChannelLGHist->GetBinContent(x, z) < qCut && badChannelLGHist->GetBinContent(x, z) > 0)
+           {
+             fBadChannelMask[x][z][fCaloConstants->GetLOWGAIN()] = false;
+           }
+         else
+           {
+             fBadChannelMask[x][z][fCaloConstants->GetLOWGAIN()] = false;
+           }
+       }
+    }
+}
+
+void
+AliHLTCaloDigitMaker::Reset()
+{
+  fDigitCount = 0;
+  for(int x = 0; x < fCaloConstants->GetNXCOLUMNSMOD(); x++)
+    {
+      for(int z = 0; z < fCaloConstants->GetNZROWSMOD(); z++)
+       {
+         fChannelBook[x][z] = 0;
+       }
+    }    
+
+}
+
+
+void AliHLTCaloDigitMaker::AddDigit(AliHLTCaloChannelDataStruct* channelData, AliHLTCaloCoordinate &coord)
+{
+
+  // Some book keeping of the pointers
+  AliHLTCaloDigitDataStruct *tmpDigit = fDigitStructPtr + 1;
+
+  // Check if we already have a digit in this position, and correct the book keeping correspondently
+  if(fChannelBook[coord.fX][coord.fZ]) 
+    {
+      tmpDigit = fDigitStructPtr;
+      fDigitStructPtr = fChannelBook[coord.fX][coord.fZ];
+      fDigitCount--;
+      //      printf("Going to overwrite digit: x = %d, z = %d, gain = %d, energy = %f\n", fDigitStructPtr->fX, fDigitStructPtr->fZ, fDigitStructPtr->fGain, fDigitStructPtr->fEnergy);
+    }
+  
+  fChannelBook[coord.fX][coord.fZ] = fDigitStructPtr;
+  fDigitStructPtr->fX = coord.fX;
+  fDigitStructPtr->fZ = coord.fZ;
+  fDigitStructPtr->fGain = coord.fGain;
+  fDigitStructPtr->fOverflow = false;
+  fDigitStructPtr->fAssociatedCluster = -1;
+  
+  fDigitStructPtr->fID = fDigitStructPtr->fZ * fCaloConstants->GetNXCOLUMNSMOD() + fDigitStructPtr->fX;
+  
+  if(coord.fGain == fCaloConstants->GetHIGHGAIN() )
+    {
+      fDigitStructPtr->fEnergy = channelData->fEnergy*fHighGainFactors[coord.fX][coord.fZ];
+      fDigitStructPtr->fHgPresent = true;
+      if(channelData->fEnergy >= fMaxEnergy)
+       {
+         fDigitStructPtr->fOverflow = true;
+       }
+      
+      HLTDebug("HG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f \n", 
+              coord.fX, coord.fZ, channelData->fEnergy, fDigitStructPtr->fEnergy);
+    }
+  else
+    {
+      fDigitStructPtr->fEnergy = channelData->fEnergy*fLowGainFactors[coord.fX][coord.fZ];
+      if(channelData->fEnergy >= fMaxEnergy)
+       {
+         fDigitStructPtr->fOverflow = true;
+       }
+      HLTDebug("LG channel (x = %d, z = %d) with amplitude: %f --> Digit with energy: %f\n", coord.fX, coord.fZ, channelData->fEnergy, fDigitStructPtr->fEnergy); 
+    }
+  fDigitStructPtr->fTime = channelData->fTime * 0.0000001; //TODO
+  fDigitStructPtr->fCrazyness = channelData->fCrazyness;
+  fDigitStructPtr->fModule = coord.fModuleId;
+  fDigitStructPtr = tmpDigit;
+  //  fDigitStructPtr++;
+  fDigitCount++;
+}
+
+bool AliHLTCaloDigitMaker::UseDigit(AliHLTCaloCoordinate &channelCoordinates, AliHLTCaloChannelDataStruct *channel) 
+{
+   
+   if(fBadChannelMask[channelCoordinates.fX][channelCoordinates.fZ][0] == true) return false;
+   if(channel->fTime < fMinTime || channel->fTime > fMaxTime) return false;
+   
+  AliHLTCaloDigitDataStruct *tmpDigit = fChannelBook[channelCoordinates.fX][channelCoordinates.fZ];
+  //printf("UseDigit: Got digit, x: %d, z: %d, gain: %d, amp: %f\n", channelCoordinates.fX, channelCoordinates.fZ, channelCoordinates.fGain, channel->fEnergy);
+  if(tmpDigit)
+    {
+      if(channelCoordinates.fGain == fCaloConstants->GetLOWGAIN())
+       {
+                 //printf("UseDigit: Already have digit with, x: %d, z: %d, with high gain \n", channelCoordinates.fX, channelCoordinates.fZ);
+         if(tmpDigit->fOverflow)
+           {
+                    // printf("But it was in overflow! Let's use this low gain!\n");
+             return true;
+           }
+         return false;
+       }
+      else
+       {
+                 //printf("UseDigit: Already have digit with, x: %d, z: %d, with low gain: %d\n", channelCoordinates.fX, channelCoordinates.fZ);
+         if(channel->fEnergy > fMaxEnergy )
+           {
+             tmpDigit->fHgPresent = true;
+             return false;
+           }
+         return true;
+       }
+    }
+  return true;
+}
+
+void AliHLTCaloDigitMaker::SetBadChannel(Int_t x, Int_t z, Bool_t bad)
+{
+   // See header file for class documentation
+   fBadChannelMask[x][z][0] = bad;
+   fBadChannelMask[x][z][1] = bad;
+}
+
+void AliHLTCaloDigitMaker::SetGain(Int_t x, Int_t z, Float_t ratio, Float_t gain)
+{
+   // See header file for class documentation
+   HLTDebug("Applying gain: %f for channel x: %d, z: %d", gain, x, z); 
+   fHighGainFactors[x][z] = gain;
+   fLowGainFactors[x][z] = gain * ratio;
+   
+}
index 42ec7d3..249b727 100644 (file)
-#ifndef ALIITSUCLUSTERIZER_H\r
-#define ALIITSUCLUSTERIZER_H\r
-\r
-#include <TClonesArray.h>\r
-\r
-//#define _ClusterTopology_  // uncomment this to produce the tree with cluster topology\r
-\r
-class TTree;\r
-class TObjAray;\r
-class AliITSUSegmentationPix;\r
-class AliITSdigit;\r
-class AliCluster;\r
-class AliITSUClusterPix;\r
-class AliITSURecoParam;\r
-//\r
-#ifdef  _ClusterTopology_\r
-#include <TBits.h>\r
-class TFile;\r
-#endif //_ClusterTopology_\r
-\r
-\r
-class AliITSUClusterizer : public TObject \r
-{\r
-  //\r
- public:\r
-  enum {kDigitChunkSize=1024, kMaxLabels=20,kMaxLabInCluster=3};\r
-  //\r
-  AliITSUClusterizer(Int_t nrowInit=0);\r
-  virtual ~AliITSUClusterizer();\r
-  void SetRawData(Bool_t v=kTRUE)                      {fRawData = v;}\r
-  void Clusterize();\r
-  void SetSegmentation(const AliITSUSegmentationPix *segm);\r
-  void SetRecoParam(const AliITSURecoParam* param)     {fRecoParam = param;}\r
-  void SetLayerID(Int_t id)                            {fLayerID = id;}\r
-  void SetVolID(Int_t id)                              {fVolID = id;}\r
-  void SetNRow(Int_t nrow);\r
-  void SetAllowDiagonalClusterization(Bool_t v)        {fAllowDiagonalClusterization = v;}\r
-  void PrepareLorentzAngleCorrection(Double_t bz);\r
-  //\r
-  // interface methods\r
-  void MakeRecPointBranch(TTree */*treeR*/)            {};\r
-  void SetRecPointTreeAddress(TTree */*treeR*/)        {};\r
-  void DigitsToRecPoints(const TObjArray */*digList*/) {};\r
-  \r
-  void SetDigits(const TClonesArray *digits)       {fInputDigits=digits;fInputDigitsReadIndex=0;}\r
-  void SetClusters(TClonesArray *clusters)         {fOutputClusters=clusters;}\r
-  //\r
-  // labeling methods\r
-  void AddLabel(int label);\r
-  void CheckLabels();\r
-  //\r
- protected: // transient data types\r
-  struct AliITSUClusterizerClusterDigit {\r
-    AliITSUClusterizerClusterDigit *fNext;\r
-    AliITSdigit *fDigit;\r
-  };\r
-  \r
-  struct AliITSUClusterizerClusterCand;\r
-  struct AliITSUClusterizerClusterPart {\r
-    AliITSUClusterizerClusterPart *fNextInRow;\r
-    AliITSUClusterizerClusterPart *fPrevInCluster;\r
-    AliITSUClusterizerClusterPart *fNextInCluster;\r
-    AliITSUClusterizerClusterCand *fParent;\r
-    Int_t fUBegin;\r
-    Int_t fUEnd;\r
-  };\r
-  \r
-  struct AliITSUClusterizerClusterCand {\r
-    AliITSUClusterizerClusterCand  *fNext; // only used for memory management\r
-    AliITSUClusterizerClusterPart  *fFirstPart;\r
-    AliITSUClusterizerClusterDigit *fFirstDigit;\r
-    AliITSUClusterizerClusterDigit *fLastDigit ;\r
-  };\r
-\r
- protected:\r
-  //\r
-  // allocation and deallocation\r
-  AliITSUClusterizerClusterDigit* AllocDigitFreelist();\r
-  AliITSUClusterizerClusterCand*  AllocCand();\r
-  void                            DeallocCand(AliITSUClusterizerClusterCand *cand);\r
-  AliITSUClusterizerClusterPart*  AllocPart();\r
-  void                            DeallocPart(AliITSUClusterizerClusterPart *part) {DeallocParts(part,part); }\r
-  void                            DeallocParts(AliITSUClusterizerClusterPart *first,AliITSUClusterizerClusterPart *last);\r
-  AliITSUClusterizerClusterDigit* AllocDigit();\r
-  void                            DeallocDigit(AliITSUClusterizerClusterDigit *digit) {DeallocDigits(digit,digit);}\r
-  void                            DeallocDigits(AliITSUClusterizerClusterDigit *first,AliITSUClusterizerClusterDigit *last);\r
-\r
-  // input "iterator"\r
-  AliITSUClusterizerClusterDigit* NextDigit();\r
-  // output "iterator"\r
-  AliCluster*                     NextCluster() {return (AliCluster*)fOutputClusters->New(fOutputClusters->GetEntriesFast());}\r
-  \r
-  // modifiers\r
-  void SetAllowDiagonalClusterization();\r
-\r
-  void AttachDigitToCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterDigit *digit);\r
-  void AttachPartToCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterPart *part);\r
-  void DetachPartFromCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterPart *part);\r
-  void MergeCands(AliITSUClusterizerClusterCand *a,AliITSUClusterizerClusterCand *b);\r
-  void Transform(AliITSUClusterPix *cluster, AliITSUClusterizerClusterCand *cand);\r
-  void CloseCand(AliITSUClusterizerClusterCand *cand);\r
-  void ClosePart(AliITSUClusterizerClusterPart *part);\r
-\r
-  void CloseRemainingParts(AliITSUClusterizerClusterPart *part);\r
-  //\r
- protected:\r
-  //\r
-  Int_t fVolID;                             // Volume id (module index)\r
-  Bool_t fAllowDiagonalClusterization;      // allow clusters with pixels having common corners only\r
-  const AliITSUSegmentationPix* fSegm;      // Segmentation or local coord calc.\r
-  const AliITSURecoParam*       fRecoParam; // reco params\r
-  //\r
-  // Digit Input\r
-  const TClonesArray *fInputDigits;         // supplied digits\r
-  Int_t         fInputDigitsReadIndex;      // digits counter\r
-  Int_t         fLayerID;                   // current layer id\r
-  //\r
-  Int_t         fCurrLabels[kMaxLabels];    // labels collected for current cluster\r
-  Int_t         fNLabels;                   // number of collected labels\r
-  Bool_t        fRawData;                   // is raw data processed?\r
-  //\r
-  Double_t      fLorAngCorrection;          // Lorentz Angle correction for current layer\r
-  // Cluster Output\r
-  TClonesArray *fOutputClusters;            // external container to store clusters\r
-  //\r
-  // temporary variables\r
-  AliITSUClusterizerClusterDigit *fDigitFreelist    ; //! pool of local digits\r
-  AliITSUClusterizerClusterPart  *fPartFreelist     ; //! pool of unfinished clusters\r
-  AliITSUClusterizerClusterCand  *fCandFreelist     ; //! pool of clusters\r
-  AliITSUClusterizerClusterDigit *fDigitFreelistBptrFirst; //! pointer in the pool\r
-  AliITSUClusterizerClusterDigit *fDigitFreelistBptrLast ; //! pointer in the pool\r
-  AliITSUClusterizerClusterPart  *fPartFreelistBptr ; //! pointer in the pool\r
-  AliITSUClusterizerClusterCand  *fCandFreelistBptr ; //!pointer in the pool\r
-  //\r
-#ifdef _ClusterTopology_\r
-  TTree* fTreeTopology;   // output tree for the cluster topology in the special mode\r
-  TFile* fFileTopology;   // output file for the cluster topology in the special mode\r
-  TBits  fTopology;       // container for the clusters topology pattern\r
-  UShort_t fMinCol;       // min col number\r
-  UShort_t fMinRow;       // min row number\r
-  void   InitTopologyTree();\r
-  void   SaveTopologyTree();\r
-  void   FillClusterTopology(AliITSUClusterizerClusterCand *cand);\r
-#endif //_ClusterTopology_\r
- private:\r
-  AliITSUClusterizer(const AliITSUClusterizer&); //Not implemented\r
-  AliITSUClusterizer& operator=(const AliITSUClusterizer&); //Not implemented\r
-  //\r
-  ClassDef(AliITSUClusterizer,0)\r
-};\r
-\r
-\r
-//_______________________________________________________________________________\r
-inline void AliITSUClusterizer::DeallocCand(AliITSUClusterizerClusterCand *cand)\r
-{\r
-  // free candidate\r
-  cand->fNext=fCandFreelist;\r
-  fCandFreelist=cand;\r
-}\r
-\r
-//_______________________________________________________________________________\r
-inline void AliITSUClusterizer::DeallocParts(AliITSUClusterizerClusterPart *first,AliITSUClusterizerClusterPart *last)\r
-{\r
-  // free cluster part\r
-  last->fNextInRow=fPartFreelist;\r
-  fPartFreelist=first;\r
-}\r
-\r
-//_______________________________________________________________________________\r
-inline AliITSUClusterizer::AliITSUClusterizerClusterDigit* AliITSUClusterizer::AllocDigit()\r
-{\r
-  // allocate digits\r
-  if (!fDigitFreelist) fDigitFreelist = AllocDigitFreelist();\r
-  AliITSUClusterizerClusterDigit *digit = fDigitFreelist;\r
-  fDigitFreelist = fDigitFreelist->fNext;\r
-  return digit;\r
-}\r
-\r
-//_______________________________________________________________________________\r
-inline AliITSUClusterizer::AliITSUClusterizerClusterPart* AliITSUClusterizer::AllocPart()\r
-{\r
-  // allocate cluster part\r
-  AliITSUClusterizerClusterPart *part=fPartFreelist;\r
-  fPartFreelist=fPartFreelist->fNextInRow;\r
-  return part;\r
-}\r
-\r
-//_______________________________________________________________________________\r
-inline AliITSUClusterizer::AliITSUClusterizerClusterCand* AliITSUClusterizer::AllocCand()\r
-{\r
-  // allocate cluster \r
-  AliITSUClusterizerClusterCand *cand=fCandFreelist;\r
-  fCandFreelist=fCandFreelist->fNext;\r
-  return cand;\r
-}\r
-\r
-//_______________________________________________________________________________\r
-inline void AliITSUClusterizer::DeallocDigits(AliITSUClusterizerClusterDigit *first, AliITSUClusterizerClusterDigit *last) \r
-{\r
-  // free digit\r
-  last->fNext = fDigitFreelist;\r
-  fDigitFreelist = first;\r
-}\r
-\r
-//_______________________________________________________________________________\r
-inline void AliITSUClusterizer::AttachDigitToCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterDigit *digit) \r
-{\r
-  // attach digit\r
-  digit->fNext = cand->fFirstDigit;\r
-  cand->fFirstDigit = digit;\r
-}\r
-\r
-//_______________________________________________________________________________\r
-inline void AliITSUClusterizer::DetachPartFromCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterPart *part) \r
-{\r
-  // remove cluster part \r
-  if (part->fPrevInCluster)    part->fPrevInCluster->fNextInCluster=part->fNextInCluster;\r
-  else                         cand->fFirstPart=part->fNextInCluster;\r
-  if (part->fNextInCluster)    part->fNextInCluster->fPrevInCluster=part->fPrevInCluster;\r
-}\r
-\r
-//______________________________________________________________________________\r
-inline void AliITSUClusterizer::AddLabel(int label)\r
-{\r
-  // add new label\r
-  if (fNLabels==kMaxLabels) return;\r
-  for (int i=fNLabels;i--;) if (fCurrLabels[i]==label) return;\r
-  fCurrLabels[fNLabels++] = label;\r
-}\r
-\r
-\r
-#endif\r
-\r
+#ifndef ALIITSUCLUSTERIZER_H
+#define ALIITSUCLUSTERIZER_H
+
+#include <TClonesArray.h>
+
+//#define _ClusterTopology_  // uncomment this to produce the tree with cluster topology
+
+class TTree;
+class TObjAray;
+class AliITSUSegmentationPix;
+class AliITSdigit;
+class AliCluster;
+class AliITSUClusterPix;
+class AliITSURecoParam;
+//
+#ifdef  _ClusterTopology_
+#include <TBits.h>
+class TFile;
+#endif //_ClusterTopology_
+
+
+class AliITSUClusterizer : public TObject 
+{
+  //
+ public:
+  enum {kDigitChunkSize=1024, kMaxLabels=20,kMaxLabInCluster=3};
+  //
+  AliITSUClusterizer(Int_t nrowInit=0);
+  virtual ~AliITSUClusterizer();
+  void SetRawData(Bool_t v=kTRUE)                      {fRawData = v;}
+  void Clusterize();
+  void SetSegmentation(const AliITSUSegmentationPix *segm);
+  void SetRecoParam(const AliITSURecoParam* param)     {fRecoParam = param;}
+  void SetLayerID(Int_t id)                            {fLayerID = id;}
+  void SetVolID(Int_t id)                              {fVolID = id;}
+  void SetNRow(Int_t nrow);
+  void SetAllowDiagonalClusterization(Bool_t v)        {fAllowDiagonalClusterization = v;}
+  void PrepareLorentzAngleCorrection(Double_t bz);
+  //
+  // interface methods
+  void MakeRecPointBranch(TTree */*treeR*/)            {};
+  void SetRecPointTreeAddress(TTree */*treeR*/)        {};
+  void DigitsToRecPoints(const TObjArray */*digList*/) {};
+  
+  void SetDigits(const TClonesArray *digits)       {fInputDigits=digits;fInputDigitsReadIndex=0;}
+  void SetClusters(TClonesArray *clusters)         {fOutputClusters=clusters;}
+  //
+  // labeling methods
+  void AddLabel(int label);
+  void CheckLabels();
+  //
+ protected: // transient data types
+  struct AliITSUClusterizerClusterDigit {
+    AliITSUClusterizerClusterDigit *fNext;
+    AliITSdigit *fDigit;
+  };
+  
+  struct AliITSUClusterizerClusterCand;
+  struct AliITSUClusterizerClusterPart {
+    AliITSUClusterizerClusterPart *fNextInRow;
+    AliITSUClusterizerClusterPart *fPrevInCluster;
+    AliITSUClusterizerClusterPart *fNextInCluster;
+    AliITSUClusterizerClusterCand *fParent;
+    Int_t fUBegin;
+    Int_t fUEnd;
+  };
+  
+  struct AliITSUClusterizerClusterCand {
+    AliITSUClusterizerClusterCand  *fNext; // only used for memory management
+    AliITSUClusterizerClusterPart  *fFirstPart;
+    AliITSUClusterizerClusterDigit *fFirstDigit;
+    AliITSUClusterizerClusterDigit *fLastDigit ;
+  };
+
+ protected:
+  //
+  // allocation and deallocation
+  AliITSUClusterizerClusterDigit* AllocDigitFreelist();
+  AliITSUClusterizerClusterCand*  AllocCand();
+  void                            DeallocCand(AliITSUClusterizerClusterCand *cand);
+  AliITSUClusterizerClusterPart*  AllocPart();
+  void                            DeallocPart(AliITSUClusterizerClusterPart *part) {DeallocParts(part,part); }
+  void                            DeallocParts(AliITSUClusterizerClusterPart *first,AliITSUClusterizerClusterPart *last);
+  AliITSUClusterizerClusterDigit* AllocDigit();
+  void                            DeallocDigit(AliITSUClusterizerClusterDigit *digit) {DeallocDigits(digit,digit);}
+  void                            DeallocDigits(AliITSUClusterizerClusterDigit *first,AliITSUClusterizerClusterDigit *last);
+
+  // input "iterator"
+  AliITSUClusterizerClusterDigit* NextDigit();
+  // output "iterator"
+  AliCluster*                     NextCluster() {return (AliCluster*)fOutputClusters->New(fOutputClusters->GetEntriesFast());}
+  
+  // modifiers
+  void SetAllowDiagonalClusterization();
+
+  void AttachDigitToCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterDigit *digit);
+  void AttachPartToCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterPart *part);
+  void DetachPartFromCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterPart *part);
+  void MergeCands(AliITSUClusterizerClusterCand *a,AliITSUClusterizerClusterCand *b);
+  void Transform(AliITSUClusterPix *cluster, AliITSUClusterizerClusterCand *cand);
+  void CloseCand(AliITSUClusterizerClusterCand *cand);
+  void ClosePart(AliITSUClusterizerClusterPart *part);
+
+  void CloseRemainingParts(AliITSUClusterizerClusterPart *part);
+  //
+ protected:
+  //
+  Int_t fVolID;                             // Volume id (module index)
+  Bool_t fAllowDiagonalClusterization;      // allow clusters with pixels having common corners only
+  const AliITSUSegmentationPix* fSegm;      // Segmentation or local coord calc.
+  const AliITSURecoParam*       fRecoParam; // reco params
+  //
+  // Digit Input
+  const TClonesArray *fInputDigits;         // supplied digits
+  Int_t         fInputDigitsReadIndex;      // digits counter
+  Int_t         fLayerID;                   // current layer id
+  //
+  Int_t         fCurrLabels[kMaxLabels];    // labels collected for current cluster
+  Int_t         fNLabels;                   // number of collected labels
+  Bool_t        fRawData;                   // is raw data processed?
+  //
+  Double_t      fLorAngCorrection;          // Lorentz Angle correction for current layer
+  // Cluster Output
+  TClonesArray *fOutputClusters;            // external container to store clusters
+  //
+  // temporary variables
+  AliITSUClusterizerClusterDigit *fDigitFreelist    ; //! pool of local digits
+  AliITSUClusterizerClusterPart  *fPartFreelist     ; //! pool of unfinished clusters
+  AliITSUClusterizerClusterCand  *fCandFreelist     ; //! pool of clusters
+  AliITSUClusterizerClusterDigit *fDigitFreelistBptrFirst; //! pointer in the pool
+  AliITSUClusterizerClusterDigit *fDigitFreelistBptrLast ; //! pointer in the pool
+  AliITSUClusterizerClusterPart  *fPartFreelistBptr ; //! pointer in the pool
+  AliITSUClusterizerClusterCand  *fCandFreelistBptr ; //!pointer in the pool
+  //
+#ifdef _ClusterTopology_
+  TTree* fTreeTopology;   // output tree for the cluster topology in the special mode
+  TFile* fFileTopology;   // output file for the cluster topology in the special mode
+  TBits  fTopology;       // container for the clusters topology pattern
+  UShort_t fMinCol;       // min col number
+  UShort_t fMinRow;       // min row number
+  void   InitTopologyTree();
+  void   SaveTopologyTree();
+  void   FillClusterTopology(AliITSUClusterizerClusterCand *cand);
+#endif //_ClusterTopology_
+ private:
+  AliITSUClusterizer(const AliITSUClusterizer&); //Not implemented
+  AliITSUClusterizer& operator=(const AliITSUClusterizer&); //Not implemented
+  //
+  ClassDef(AliITSUClusterizer,0)
+};
+
+
+//_______________________________________________________________________________
+inline void AliITSUClusterizer::DeallocCand(AliITSUClusterizerClusterCand *cand)
+{
+  // free candidate
+  cand->fNext=fCandFreelist;
+  fCandFreelist=cand;
+}
+
+//_______________________________________________________________________________
+inline void AliITSUClusterizer::DeallocParts(AliITSUClusterizerClusterPart *first,AliITSUClusterizerClusterPart *last)
+{
+  // free cluster part
+  last->fNextInRow=fPartFreelist;
+  fPartFreelist=first;
+}
+
+//_______________________________________________________________________________
+inline AliITSUClusterizer::AliITSUClusterizerClusterDigit* AliITSUClusterizer::AllocDigit()
+{
+  // allocate digits
+  if (!fDigitFreelist) fDigitFreelist = AllocDigitFreelist();
+  AliITSUClusterizerClusterDigit *digit = fDigitFreelist;
+  fDigitFreelist = fDigitFreelist->fNext;
+  return digit;
+}
+
+//_______________________________________________________________________________
+inline AliITSUClusterizer::AliITSUClusterizerClusterPart* AliITSUClusterizer::AllocPart()
+{
+  // allocate cluster part
+  AliITSUClusterizerClusterPart *part=fPartFreelist;
+  fPartFreelist=fPartFreelist->fNextInRow;
+  return part;
+}
+
+//_______________________________________________________________________________
+inline AliITSUClusterizer::AliITSUClusterizerClusterCand* AliITSUClusterizer::AllocCand()
+{
+  // allocate cluster 
+  AliITSUClusterizerClusterCand *cand=fCandFreelist;
+  fCandFreelist=fCandFreelist->fNext;
+  return cand;
+}
+
+//_______________________________________________________________________________
+inline void AliITSUClusterizer::DeallocDigits(AliITSUClusterizerClusterDigit *first, AliITSUClusterizerClusterDigit *last) 
+{
+  // free digit
+  last->fNext = fDigitFreelist;
+  fDigitFreelist = first;
+}
+
+//_______________________________________________________________________________
+inline void AliITSUClusterizer::AttachDigitToCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterDigit *digit) 
+{
+  // attach digit
+  digit->fNext = cand->fFirstDigit;
+  cand->fFirstDigit = digit;
+}
+
+//_______________________________________________________________________________
+inline void AliITSUClusterizer::DetachPartFromCand(AliITSUClusterizerClusterCand *cand,AliITSUClusterizerClusterPart *part) 
+{
+  // remove cluster part 
+  if (part->fPrevInCluster)    part->fPrevInCluster->fNextInCluster=part->fNextInCluster;
+  else                         cand->fFirstPart=part->fNextInCluster;
+  if (part->fNextInCluster)    part->fNextInCluster->fPrevInCluster=part->fPrevInCluster;
+}
+
+//______________________________________________________________________________
+inline void AliITSUClusterizer::AddLabel(int label)
+{
+  // add new label
+  if (fNLabels==kMaxLabels) return;
+  for (int i=fNLabels;i--;) if (fCurrLabels[i]==label) return;
+  fCurrLabels[fNLabels++] = label;
+}
+
+
+#endif
+
index 21965d5..210ae96 100644 (file)
-#ifndef AliOADBCentrality_H\r
-#define AliOADBCentrality_H\r
-/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice                               */\r
-\r
-/* $Id$ */\r
-\r
-//-------------------------------------------------------------------------\r
-//     OADB class for run dependent centrality scaling factors and \r
-//     data for centrality determination\r
-//     Author: Andreas Morsch, CERN\r
-//-------------------------------------------------------------------------\r
-\r
-#include <TNamed.h>\r
-#include <TList.h>\r
-#include <TH1F.h>\r
-#include <TH2F.h>\r
-\r
-\r
-class AliOADBCentrality : public TNamed {\r
-\r
- public :\r
-  AliOADBCentrality();\r
-  AliOADBCentrality(char* name);\r
-  virtual ~AliOADBCentrality();\r
-  Float_t V0MScaleFactor()   const  {return fV0MScaleFactor;}\r
-  Float_t SPDScaleFactor()   const  {return fSPDScaleFactor;}\r
-  Float_t TPCScaleFactor()   const  {return fTPCScaleFactor;}\r
-  Float_t V0MScaleFactorMC() const  {return fV0MScaleFactorMC;}\r
-\r
-  Float_t V0MSPDOutlierPar0()      const  {return fV0MSPDOutlierPar0      ;}\r
-  Float_t V0MSPDOutlierPar1()      const  {return fV0MSPDOutlierPar1      ;}\r
-  Float_t V0MTPCOutlierPar0()      const  {return fV0MTPCOutlierPar0      ;}\r
-  Float_t V0MTPCOutlierPar1()      const  {return fV0MTPCOutlierPar1      ;}\r
-\r
-  Float_t V0MSPDSigmaOutlierPar0() const  {return fV0MSPDSigmaOutlierPar0 ;}\r
-  Float_t V0MSPDSigmaOutlierPar1() const  {return fV0MSPDSigmaOutlierPar1 ;}\r
-  Float_t V0MSPDSigmaOutlierPar2() const  {return fV0MSPDSigmaOutlierPar2 ;}\r
-  Float_t V0MTPCSigmaOutlierPar0() const  {return fV0MTPCSigmaOutlierPar0 ;}\r
-  Float_t V0MTPCSigmaOutlierPar1() const  {return fV0MTPCSigmaOutlierPar1 ;}\r
-  Float_t V0MTPCSigmaOutlierPar2() const  {return fV0MTPCSigmaOutlierPar2 ;}\r
-\r
-  Float_t V0MZDCOutlierPar0()      const  {return fV0MZDCOutlierPar0      ;}\r
-  Float_t V0MZDCOutlierPar1()      const  {return fV0MZDCOutlierPar1      ;}\r
-  Float_t V0MZDCEcalOutlierPar0()  const  {return fV0MZDCEcalOutlierPar0  ;}\r
-  Float_t V0MZDCEcalOutlierPar1()  const  {return fV0MZDCEcalOutlierPar1  ;}\r
-\r
-  Float_t ZVCut()       const {return fZVCut;}\r
-  Float_t OutliersCut() const {return fOutliersCut;}\r
-  Bool_t UseScaling()   const {return fUseScaling;}\r
-  Bool_t UseCleaning()  const {return fUseCleaning;}\r
-\r
-  TH1F*   V0hist()         const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0M_percentile")));}\r
-  TH1F*   V0Ahist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0A_percentile")));}\r
-  TH1F*   V0A123hist()     const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0A123_percentile")));}\r
-  TH1F*   V0Chist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0C_percentile")));}\r
-  TH1F*   V0Eqhist()       const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0MEq_percentile")));}\r
-  TH1F*   V0AEqhist()      const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0AEq_percentile")));}\r
-  TH1F*   V0CEqhist()      const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0CEq_percentile")));}\r
-  TH1F*   TPChist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultTRK_percentile")));}\r
-  TH1F*   CNDhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCND_percentile")));}\r
-  TH1F*   SPDhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCL1_percentile")));}\r
-  TH1F*   FMDhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultFMD_percentile")));}\r
-  TH1F*   ZNAhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNA_percentile")));}\r
-  TH1F*   ZNChist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNC_percentile")));}\r
-  TH1F*   ZPAhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPA_percentile")));}\r
-  TH1F*   ZPChist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPC_percentile")));}\r
-  TH2F*   ZEMvsZDChist()   const  {return ((TH2F*) (Hists2D()->FindObject("fHOutMultZEMvsZDC")));}\r
-\r
-  TH1F*   NPAhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultNPA_percentile")));}\r
-  TH1F*   NPAhistDPM()     const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultNPADPM_percentile")));}\r
-\r
-  TH1F*   V0histtrue()     const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0Mtrue_percentile")));}\r
-  TH1F*   V0Ahisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0Atrue_percentile")));}\r
-  TH1F*   V0Chisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0Ctrue_percentile")));}\r
-  TH1F*   V0Eqhisttrue()   const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0MEqtrue_percentile")));}\r
-  TH1F*   V0AEqhisttrue()  const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0AEqtrue_percentile")));}\r
-  TH1F*   V0CEqhisttrue()  const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0CEqtrue_percentile")));}\r
-  TH1F*   TPChisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultTRKtrue_percentile")));}\r
-  TH1F*   CNDhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCNDtrue_percentile")));}\r
-  TH1F*   SPDhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCL1true_percentile")));}\r
-  TH1F*   FMDhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultFMDtrue_percentile")));}\r
-  TH1F*   ZNAhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNAtrue_percentile")));}\r
-  TH1F*   ZNChisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNCtrue_percentile")));}\r
-  TH1F*   ZPAhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPAtrue_percentile")));}\r
-  TH1F*   ZPChisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPCtrue_percentile")));}\r
\r
-  TH1F*   V0histtrueDPM()     const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0MtrueDPM_percentile")));}\r
-  TH1F*   V0AhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0AtrueDPM_percentile")));}\r
-  TH1F*   V0ChisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0CtrueDPM_percentile")));}\r
-  TH1F*   V0EqhisttrueDPM()   const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0MEqtrueDPM_percentile")));}\r
-  TH1F*   V0AEqhisttrueDPM()  const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0AEqtrueDPM_percentile")));}\r
-  TH1F*   V0CEqhisttrueDPM()  const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0CEqtrueDPM_percentile")));}\r
-  TH1F*   TPChisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultTRKtrueDPM_percentile")));}\r
-  TH1F*   CNDhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCNDtrueDPM_percentile")));}\r
-  TH1F*   SPDhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCL1trueDPM_percentile")));}\r
-  TH1F*   FMDhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultFMDtrueDPM_percentile")));}\r
-  TH1F*   ZNAhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNAtrueDPM_percentile")));}\r
-  TH1F*   ZNChisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNCtrueDPM_percentile")));}\r
-  TH1F*   ZPAhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPAtrueDPM_percentile")));}\r
-  TH1F*   ZPChisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPCtrueDPM_percentile")));}\r
-  TList*  Hists1D()        const  {return f1DHistos;}\r
-  TList*  Hists2D()        const  {return f2DHistos;}\r
-\r
-  void    SetScaleFactors(Float_t v0m, Float_t spd, Float_t tpc, Float_t v0mMC)\r
-  {fV0MScaleFactor = v0m; fSPDScaleFactor = spd; fTPCScaleFactor = tpc; fV0MScaleFactorMC = v0mMC;}\r
-  \r
-  void    SetOutlierV0MSPDFactors(Float_t a1, Float_t a2, Float_t a3, Float_t a4, Float_t a5)\r
-  {fV0MSPDOutlierPar0=a1;fV0MSPDOutlierPar1=a2;fV0MSPDSigmaOutlierPar0=a3;fV0MSPDSigmaOutlierPar1=a4;fV0MSPDSigmaOutlierPar2=a5;}\r
-  \r
-  void    SetOutlierV0MTPCFactors(Float_t a1, Float_t a2, Float_t a3, Float_t a4, Float_t a5)\r
-  {fV0MTPCOutlierPar0=a1;fV0MTPCOutlierPar1=a2;fV0MTPCSigmaOutlierPar0=a3;fV0MTPCSigmaOutlierPar1=a4;fV0MTPCSigmaOutlierPar2=a5;}\r
-\r
-  void    SetOutlierV0MZDCFactors(Float_t a1, Float_t a2)\r
-  {fV0MZDCOutlierPar0=a1;fV0MZDCOutlierPar1=a2;}\r
-  \r
-  void    SetOutlierV0MZDCEcalFactors(Float_t a1, Float_t a2)\r
-  {fV0MZDCEcalOutlierPar0=a1;fV0MZDCEcalOutlierPar1=a2;}\r
-  \r
-  void    SetHistReferences(TList* l1, TList* l2)\r
-  {f1DHistos = l1; f2DHistos = l2;}\r
-\r
-  void SetZVCut(Float_t z)\r
-  {fZVCut=z;}\r
-\r
-  void SetOutliersCut(Float_t o)\r
-  {fOutliersCut=o;}\r
-\r
-  void SetUseScaling(Bool_t x)\r
-  {fUseScaling=x;}\r
-\r
-  void SetUseCleaning(Bool_t x)\r
-  {fUseCleaning=x;}\r
-\r
-\r
- private:\r
-  AliOADBCentrality(const AliOADBCentrality& cont); \r
-  AliOADBCentrality& operator=(const AliOADBCentrality& cont);\r
-\r
- private:\r
-  Float_t fV0MScaleFactor;     // V0  scale factor\r
-  Float_t fSPDScaleFactor;     // SPD scale factor\r
-  Float_t fTPCScaleFactor;     // TPC scale factor\r
-  Float_t fV0MScaleFactorMC;   // V0  scale factor for MC\r
-\r
-  Float_t fV0MSPDOutlierPar0;  // V0-SPD outlier parameterisation Par0\r
-  Float_t fV0MSPDOutlierPar1;  // Par1\r
-  Float_t fV0MTPCOutlierPar0;  // Par2\r
-  Float_t fV0MTPCOutlierPar1;  // Par3\r
-\r
-  Float_t fV0MSPDSigmaOutlierPar0; // V0-SPD Sigma outlier parameterisation Par0\r
-  Float_t fV0MSPDSigmaOutlierPar1; // Par1\r
-  Float_t fV0MSPDSigmaOutlierPar2; // Par2\r
-  Float_t fV0MTPCSigmaOutlierPar0; // Par3\r
-  Float_t fV0MTPCSigmaOutlierPar1; // Par4\r
-  Float_t fV0MTPCSigmaOutlierPar2; // Par5\r
-\r
-  Float_t fV0MZDCOutlierPar0;     // V0-ZDC outlier parameterisation Par0\r
-  Float_t fV0MZDCOutlierPar1;     // Par1\r
-  Float_t fV0MZDCEcalOutlierPar0; // Par2\r
-  Float_t fV0MZDCEcalOutlierPar1; // Par3\r
-\r
-  Float_t fZVCut;                 // zV-cut\r
-  Float_t fOutliersCut;           // outlier cuts\r
-  Bool_t fUseScaling;             // Flag for scaling\r
-  Bool_t fUseCleaning;            // Flag for cleaning\r
-\r
-  TList*    f1DHistos; // Reference to list of 1D Centrality histos \r
-  TList*    f2DHistos; // Reference to list of 2D Centrality histos\r
-  ClassDef(AliOADBCentrality, 3);\r
-};\r
-\r
-#endif\r
+#ifndef AliOADBCentrality_H
+#define AliOADBCentrality_H
+/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+//-------------------------------------------------------------------------
+//     OADB class for run dependent centrality scaling factors and 
+//     data for centrality determination
+//     Author: Andreas Morsch, CERN
+//-------------------------------------------------------------------------
+
+#include <TNamed.h>
+#include <TList.h>
+#include <TH1F.h>
+#include <TH2F.h>
+
+
+class AliOADBCentrality : public TNamed {
+
+ public :
+  AliOADBCentrality();
+  AliOADBCentrality(char* name);
+  virtual ~AliOADBCentrality();
+  Float_t V0MScaleFactor()   const  {return fV0MScaleFactor;}
+  Float_t SPDScaleFactor()   const  {return fSPDScaleFactor;}
+  Float_t TPCScaleFactor()   const  {return fTPCScaleFactor;}
+  Float_t V0MScaleFactorMC() const  {return fV0MScaleFactorMC;}
+
+  Float_t V0MSPDOutlierPar0()      const  {return fV0MSPDOutlierPar0      ;}
+  Float_t V0MSPDOutlierPar1()      const  {return fV0MSPDOutlierPar1      ;}
+  Float_t V0MTPCOutlierPar0()      const  {return fV0MTPCOutlierPar0      ;}
+  Float_t V0MTPCOutlierPar1()      const  {return fV0MTPCOutlierPar1      ;}
+
+  Float_t V0MSPDSigmaOutlierPar0() const  {return fV0MSPDSigmaOutlierPar0 ;}
+  Float_t V0MSPDSigmaOutlierPar1() const  {return fV0MSPDSigmaOutlierPar1 ;}
+  Float_t V0MSPDSigmaOutlierPar2() const  {return fV0MSPDSigmaOutlierPar2 ;}
+  Float_t V0MTPCSigmaOutlierPar0() const  {return fV0MTPCSigmaOutlierPar0 ;}
+  Float_t V0MTPCSigmaOutlierPar1() const  {return fV0MTPCSigmaOutlierPar1 ;}
+  Float_t V0MTPCSigmaOutlierPar2() const  {return fV0MTPCSigmaOutlierPar2 ;}
+
+  Float_t V0MZDCOutlierPar0()      const  {return fV0MZDCOutlierPar0      ;}
+  Float_t V0MZDCOutlierPar1()      const  {return fV0MZDCOutlierPar1      ;}
+  Float_t V0MZDCEcalOutlierPar0()  const  {return fV0MZDCEcalOutlierPar0  ;}
+  Float_t V0MZDCEcalOutlierPar1()  const  {return fV0MZDCEcalOutlierPar1  ;}
+
+  Float_t ZVCut()       const {return fZVCut;}
+  Float_t OutliersCut() const {return fOutliersCut;}
+  Bool_t UseScaling()   const {return fUseScaling;}
+  Bool_t UseCleaning()  const {return fUseCleaning;}
+
+  TH1F*   V0hist()         const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0M_percentile")));}
+  TH1F*   V0Ahist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0A_percentile")));}
+  TH1F*   V0A123hist()     const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0A123_percentile")));}
+  TH1F*   V0Chist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0C_percentile")));}
+  TH1F*   V0Eqhist()       const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0MEq_percentile")));}
+  TH1F*   V0AEqhist()      const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0AEq_percentile")));}
+  TH1F*   V0CEqhist()      const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0CEq_percentile")));}
+  TH1F*   TPChist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultTRK_percentile")));}
+  TH1F*   CNDhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCND_percentile")));}
+  TH1F*   SPDhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCL1_percentile")));}
+  TH1F*   FMDhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultFMD_percentile")));}
+  TH1F*   ZNAhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNA_percentile")));}
+  TH1F*   ZNChist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNC_percentile")));}
+  TH1F*   ZPAhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPA_percentile")));}
+  TH1F*   ZPChist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPC_percentile")));}
+  TH2F*   ZEMvsZDChist()   const  {return ((TH2F*) (Hists2D()->FindObject("fHOutMultZEMvsZDC")));}
+
+  TH1F*   NPAhist()        const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultNPA_percentile")));}
+  TH1F*   NPAhistDPM()     const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultNPADPM_percentile")));}
+
+  TH1F*   V0histtrue()     const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0Mtrue_percentile")));}
+  TH1F*   V0Ahisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0Atrue_percentile")));}
+  TH1F*   V0Chisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0Ctrue_percentile")));}
+  TH1F*   V0Eqhisttrue()   const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0MEqtrue_percentile")));}
+  TH1F*   V0AEqhisttrue()  const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0AEqtrue_percentile")));}
+  TH1F*   V0CEqhisttrue()  const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0CEqtrue_percentile")));}
+  TH1F*   TPChisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultTRKtrue_percentile")));}
+  TH1F*   CNDhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCNDtrue_percentile")));}
+  TH1F*   SPDhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCL1true_percentile")));}
+  TH1F*   FMDhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultFMDtrue_percentile")));}
+  TH1F*   ZNAhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNAtrue_percentile")));}
+  TH1F*   ZNChisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNCtrue_percentile")));}
+  TH1F*   ZPAhisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPAtrue_percentile")));}
+  TH1F*   ZPChisttrue()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPCtrue_percentile")));}
+  TH1F*   V0histtrueDPM()     const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0MtrueDPM_percentile")));}
+  TH1F*   V0AhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0AtrueDPM_percentile")));}
+  TH1F*   V0ChisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0CtrueDPM_percentile")));}
+  TH1F*   V0EqhisttrueDPM()   const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0MEqtrueDPM_percentile")));}
+  TH1F*   V0AEqhisttrueDPM()  const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0AEqtrueDPM_percentile")));}
+  TH1F*   V0CEqhisttrueDPM()  const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultV0CEqtrueDPM_percentile")));}
+  TH1F*   TPChisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultTRKtrueDPM_percentile")));}
+  TH1F*   CNDhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCNDtrueDPM_percentile")));}
+  TH1F*   SPDhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultCL1trueDPM_percentile")));}
+  TH1F*   FMDhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultFMDtrueDPM_percentile")));}
+  TH1F*   ZNAhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNAtrueDPM_percentile")));}
+  TH1F*   ZNChisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZNCtrueDPM_percentile")));}
+  TH1F*   ZPAhisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPAtrueDPM_percentile")));}
+  TH1F*   ZPChisttrueDPM()    const  {return ((TH1F*) (Hists1D()->FindObject("fHOutMultZPCtrueDPM_percentile")));}
+  TList*  Hists1D()        const  {return f1DHistos;}
+  TList*  Hists2D()        const  {return f2DHistos;}
+
+  void    SetScaleFactors(Float_t v0m, Float_t spd, Float_t tpc, Float_t v0mMC)
+  {fV0MScaleFactor = v0m; fSPDScaleFactor = spd; fTPCScaleFactor = tpc; fV0MScaleFactorMC = v0mMC;}
+  
+  void    SetOutlierV0MSPDFactors(Float_t a1, Float_t a2, Float_t a3, Float_t a4, Float_t a5)
+  {fV0MSPDOutlierPar0=a1;fV0MSPDOutlierPar1=a2;fV0MSPDSigmaOutlierPar0=a3;fV0MSPDSigmaOutlierPar1=a4;fV0MSPDSigmaOutlierPar2=a5;}
+  
+  void    SetOutlierV0MTPCFactors(Float_t a1, Float_t a2, Float_t a3, Float_t a4, Float_t a5)
+  {fV0MTPCOutlierPar0=a1;fV0MTPCOutlierPar1=a2;fV0MTPCSigmaOutlierPar0=a3;fV0MTPCSigmaOutlierPar1=a4;fV0MTPCSigmaOutlierPar2=a5;}
+
+  void    SetOutlierV0MZDCFactors(Float_t a1, Float_t a2)
+  {fV0MZDCOutlierPar0=a1;fV0MZDCOutlierPar1=a2;}
+  
+  void    SetOutlierV0MZDCEcalFactors(Float_t a1, Float_t a2)
+  {fV0MZDCEcalOutlierPar0=a1;fV0MZDCEcalOutlierPar1=a2;}
+  
+  void    SetHistReferences(TList* l1, TList* l2)
+  {f1DHistos = l1; f2DHistos = l2;}
+
+  void SetZVCut(Float_t z)
+  {fZVCut=z;}
+
+  void SetOutliersCut(Float_t o)
+  {fOutliersCut=o;}
+
+  void SetUseScaling(Bool_t x)
+  {fUseScaling=x;}
+
+  void SetUseCleaning(Bool_t x)
+  {fUseCleaning=x;}
+
+
+ private:
+  AliOADBCentrality(const AliOADBCentrality& cont); 
+  AliOADBCentrality& operator=(const AliOADBCentrality& cont);
+
+ private:
+  Float_t fV0MScaleFactor;     // V0  scale factor
+  Float_t fSPDScaleFactor;     // SPD scale factor
+  Float_t fTPCScaleFactor;     // TPC scale factor
+  Float_t fV0MScaleFactorMC;   // V0  scale factor for MC
+
+  Float_t fV0MSPDOutlierPar0;  // V0-SPD outlier parameterisation Par0
+  Float_t fV0MSPDOutlierPar1;  // Par1
+  Float_t fV0MTPCOutlierPar0;  // Par2
+  Float_t fV0MTPCOutlierPar1;  // Par3
+
+  Float_t fV0MSPDSigmaOutlierPar0; // V0-SPD Sigma outlier parameterisation Par0
+  Float_t fV0MSPDSigmaOutlierPar1; // Par1
+  Float_t fV0MSPDSigmaOutlierPar2; // Par2
+  Float_t fV0MTPCSigmaOutlierPar0; // Par3
+  Float_t fV0MTPCSigmaOutlierPar1; // Par4
+  Float_t fV0MTPCSigmaOutlierPar2; // Par5
+
+  Float_t fV0MZDCOutlierPar0;     // V0-ZDC outlier parameterisation Par0
+  Float_t fV0MZDCOutlierPar1;     // Par1
+  Float_t fV0MZDCEcalOutlierPar0; // Par2
+  Float_t fV0MZDCEcalOutlierPar1; // Par3
+
+  Float_t fZVCut;                 // zV-cut
+  Float_t fOutliersCut;           // outlier cuts
+  Bool_t fUseScaling;             // Flag for scaling
+  Bool_t fUseCleaning;            // Flag for cleaning
+
+  TList*    f1DHistos; // Reference to list of 1D Centrality histos 
+  TList*    f2DHistos; // Reference to list of 2D Centrality histos
+  ClassDef(AliOADBCentrality, 3);
+};
+
+#endif
index 4f5c8d5..8729779 100644 (file)
-/**************************************************************************\r
-* Copyright(c) 1998-2008,ALICE Experiment at CERN,All rights reserved.    *\r
-*                                                                         *\r
-* Author: The ALICE Off-line Project.                                     *\r
-* Contributors are mentioned in the code where appropriate.               *\r
-*                                                                         *\r
-* Permission to use,copy,modify and distribute this software and its      *\r
-* documentation strictly for non-commercial purposes is hereby granted    *\r
-* without fee,provided that the above copyright notice appears in all     *\r
-* copies and that both the copyright notice and this permission notice    *\r
-* appear in the supporting documentation. The authors make no claims      *\r
-* about the suitability of this software for any purpose. It is           *\r
-* provided "as is" without express or implied warranty.                   *\r
-**************************************************************************/\r
-\r
-/////////////////////////////////////////////////////\r
-// AliAnalysisTaskFlowCascade:\r
-// Analysis task to select Xi and Omega candidates for flow analysis.\r
-//\r
-// Author: Zhong-Bao.Yin@cern.ch\r
-//////////////////////////////////////////////////////\r
-\r
-#include "TChain.h"\r
-#include "TList.h"\r
-#include "TH1D.h"\r
-#include "TH2D.h"\r
-#include "TH3D.h"\r
-#include "TProfile.h"\r
-#include "TVector3.h"\r
-\r
-#include "AliAnalysisTaskSE.h"\r
-#include "AliAnalysisManager.h"\r
-\r
-#include "AliVParticle.h"\r
-#include "AliESDEvent.h"\r
-#include "AliESDInputHandler.h"\r
-#include "AliESDv0.h"\r
-#include "AliESDcascade.h"\r
-#include "AliESDtrack.h"\r
-#include "AliESDtrackCuts.h"\r
-#include "AliCentrality.h"\r
-#include "AliVVertex.h"\r
-#include "AliESDVZERO.h"\r
-#include "AliESDUtils.h"\r
-\r
-#include "AliTPCPIDResponse.h"\r
-#include "AliTOFPIDResponse.h"\r
-#include "AliPIDResponse.h"\r
-\r
-#include "AliAODEvent.h"\r
-#include "AliAODInputHandler.h"\r
-#include "AliAODTrack.h"\r
-#include "AliAODVZERO.h"\r
-#include "AliAODcascade.h"\r
-\r
-#include "TMath.h"\r
-#include "TObjArray.h"\r
-#include "AliFlowCandidateTrack.h"\r
-\r
-#include "AliFlowTrackCuts.h"\r
-#include "AliFlowEventCuts.h"\r
-#include "AliFlowEvent.h"\r
-#include "AliFlowCommonConstants.h"\r
-\r
-#include "AliAnalysisTaskFlowCascade.h"\r
-\r
-ClassImp(AliAnalysisTaskFlowCascade)\r
-\r
-//_____________________________________________________________________________\r
-  AliAnalysisTaskFlowCascade::AliAnalysisTaskFlowCascade() :\r
-    AliAnalysisTaskSE(),\r
-    //    fMinCent(0), fMaxCent(0),\r
-    fSpecie(0),\r
-    fMassBins(0),\r
-    fMinMass(0.0),\r
-    fMaxMass(0.0),\r
-    fCutsEvent(NULL),\r
-    fCutsRPTPC(NULL),\r
-    fCutsRPVZE(NULL),\r
-    fCutsPOI(NULL),\r
-    fCutsDau(NULL),\r
-    fPIDResponse(NULL),\r
-    fFlowEventTPC(NULL),\r
-    fFlowEventVZE(NULL),\r
-    fCandidates(NULL),\r
-    fQAList(NULL)\r
-{\r
-  //ctor                                                                       \r
-  for (Int_t i=0; i!=8; ++i)\r
-    fCascadeCuts[i] = 0;\r
-  \r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliAnalysisTaskFlowCascade\r
-::AliAnalysisTaskFlowCascade(const char *name,\r
-                            AliFlowEventCuts *cutsEvent, \r
-                            AliFlowTrackCuts *cutsRPTPC,\r
-                            AliFlowTrackCuts *cutsRPVZE,\r
-                            /* AliESDtrackCuts */ AliFlowTrackCuts *cutsDau ) :\r
-  AliAnalysisTaskSE(name),\r
-  //fMinCent(minCent), fMaxCent(maxCent),\r
-  fSpecie(0),\r
-  fMassBins(0),\r
-  fMinMass(0.0),\r
-  fMaxMass(0.0),\r
-  fCutsEvent(cutsEvent),\r
-  fCutsRPTPC(cutsRPTPC),\r
-  fCutsRPVZE(cutsRPVZE),\r
-  fCutsPOI(NULL),\r
-  fCutsDau(cutsDau),\r
-  fPIDResponse(NULL),\r
-  fFlowEventTPC(NULL),\r
-  fFlowEventVZE(NULL),\r
-  fCandidates(NULL),\r
-  fQAList(NULL)\r
-{\r
-  //ctor                                                                       \r
-  for (Int_t i=0; i!=8; ++i)\r
-    fCascadeCuts[i] = 0;\r
-\r
-  DefineInput( 0,TChain::Class());\r
-  DefineOutput(1,AliFlowEventSimple::Class()); // TPC object\r
-  DefineOutput(2,AliFlowEventSimple::Class()); // VZE object\r
-  DefineOutput(3,TList::Class());\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliAnalysisTaskFlowCascade::~AliAnalysisTaskFlowCascade()\r
-{\r
-  if(fQAList) delete fQAList;\r
-  if (fFlowEventTPC) delete fFlowEventTPC;\r
-  if (fFlowEventVZE) delete fFlowEventVZE;\r
-  if (fCandidates)   delete fCandidates;\r
-  if (fCutsDau)      delete fCutsDau;\r
-  if (fCutsPOI)      delete fCutsPOI;\r
-  if (fCutsRPTPC)   delete fCutsRPTPC;\r
-  if (fCutsRPVZE)   delete fCutsRPVZE;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::UserCreateOutputObjects()\r
-{\r
-\r
-  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();\r
-  AliInputEventHandler* inputHandler\r
-    = (AliInputEventHandler*) (man->GetInputEventHandler());\r
-  fPIDResponse = inputHandler->GetPIDResponse();\r
-  \r
-  fQAList = new TList();\r
-  fQAList->SetOwner();\r
-  AddQAEvents();\r
-  AddQACandidates();\r
-  //  PostData(3,fQAList);\r
-\r
-  AliFlowCommonConstants* cc = AliFlowCommonConstants::GetMaster();\r
-  cc->SetNbinsMult(1);\r
-  cc->SetMultMin(0);\r
-  cc->SetMultMax(1);\r
-\r
-  cc->SetNbinsPt(20);\r
-  cc->SetPtMin(0.0);\r
-  cc->SetPtMax(10.0);\r
-\r
-  cc->SetNbinsPhi(1);\r
-  cc->SetPhiMin(0.0);\r
-  cc->SetPhiMax(TMath::TwoPi());\r
-\r
-  cc->SetNbinsEta(1);\r
-  cc->SetEtaMin(-2.0);\r
-  cc->SetEtaMax(+2.0);\r
-\r
-  cc->SetNbinsQ(3);\r
-  cc->SetQMin(0.0);\r
-  cc->SetQMax(3.0);\r
-\r
-  cc->SetNbinsMass(fMassBins);\r
-  cc->SetMassMin(fMinMass);\r
-  cc->SetMassMax(fMaxMass);\r
-\r
-  fCutsPOI = new AliFlowTrackCuts("null_cuts");\r
-  fCutsPOI->SetParamType(fCutsRPTPC->GetParamType());\r
-  fCutsPOI->SetPtRange(+1,-1); // select nothing QUICK   \r
-  fCutsPOI->SetEtaRange(+1,-1); // select nothing VZERO  \r
-\r
-  fFlowEventTPC = new AliFlowEvent(3000);\r
-  fFlowEventVZE = new AliFlowEvent(1000);\r
-  fCandidates = new TObjArray(100);\r
-  fCandidates->SetOwner();\r
-\r
-  PostData(1,fFlowEventTPC);\r
-  PostData(2,fFlowEventVZE);\r
-  PostData(3,fQAList);\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::AddQAEvents()\r
-{\r
-  TList *tQAEvents = new TList();\r
-  tQAEvents->SetName("Events");\r
-  tQAEvents->SetOwner();\r
-  TH1I* tEvent = new TH1I("Event","Number of Events",   3,0,3);\r
-  tQAEvents->Add(tEvent);\r
-  \r
-  TH1D *tTPCRFP = new TH1D("RFPTPC",\r
-                          "TPC Reference Flow Particles;multiplicity",\r
-                          100, 0, 3000); \r
-  tQAEvents->Add(tTPCRFP);\r
-  TH1D *tVZERFP = new TH1D("RFPVZE", \r
-                          "VZERO Reference Flow Particles;multiplicity",\r
-                          100, 0, 30000); \r
-  tQAEvents->Add(tVZERFP);\r
-\r
-  TProfile *tCuts = new TProfile("Cuts","Analysis Cuts",10,0,10);\r
-  tCuts->Fill(0.5,fCascadeCuts[0],1); \r
-  tCuts->GetXaxis()->SetBinLabel(1,"dcaXiDau");\r
-  tCuts->Fill(1.5,fCascadeCuts[1],1); \r
-  tCuts->GetXaxis()->SetBinLabel(2,"XiCPA");\r
-  tCuts->Fill(2.5,fCascadeCuts[2],1); \r
-  tCuts->GetXaxis()->SetBinLabel(3,"dcaV0Vtx");\r
-  tCuts->Fill(3.5,fCascadeCuts[3],1); \r
-  tCuts->GetXaxis()->SetBinLabel(4,"dcaBachVtx");\r
-  tCuts->Fill(4.5,fCascadeCuts[4],1); \r
-  tCuts->GetXaxis()->SetBinLabel(5,"dcaV0Dau");\r
-  tCuts->Fill(5.5,fCascadeCuts[5],1); \r
-  tCuts->GetXaxis()->SetBinLabel(6,"V0CPA");\r
-  tCuts->Fill(6.5,fCascadeCuts[6],1); \r
-  tCuts->GetXaxis()->SetBinLabel(7,"dcaV0DauVtx");\r
-  tCuts->Fill(7.5,fCascadeCuts[7],1); \r
-  tCuts->GetXaxis()->SetBinLabel(8,"V0Mass");\r
-  tQAEvents->Add(tCuts);\r
-\r
-  fQAList->Add(tQAEvents);\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::AddQACandidates()\r
-{\r
-  TList *tQACandidates;\r
-  \r
-  tQACandidates = new TList();\r
-  tQACandidates->SetOwner();\r
-  tQACandidates->SetName("Candidates");\r
-\r
-  TH1F* tChi2Xi = new TH1F("Chi2Xi", \r
-                      "Cascade #chi^{2}; #chi^{2}; Number of Cascades", \r
-                      160, 0, 160);\r
-  tQACandidates->Add(tChi2Xi);\r
-\r
-  TH1F* tDCAXiDaughters \r
-    = new TH1F( "DcaXiDaughters",  \r
-               "DCA between Xi Daughters; DCA (cm); Number of Cascades", \r
-               100, 0., 0.5);\r
-  tQACandidates->Add(tDCAXiDaughters);\r
-\r
-  TH1F * tDCABachToPrimVertex\r
-    = new TH1F("DcaBachToPrimVertex", \r
-              "DCA of Bach. to Prim. Vertex; DCA (cm);Number of Cascades", \r
-              250, 0., 2.5);\r
-  tQACandidates->Add(tDCABachToPrimVertex);\r
-  \r
-  TH1F * tXiCosOfPointingAngle\r
-    = new TH1F("XiCosOfPointingAngle",\r
-              "Cos of Xi Pointing Angle; Cos (Xi Point.Angl);Number of Xis", \r
-              200, 0.99, 1.0);\r
-  tQACandidates->Add(tXiCosOfPointingAngle);\r
-\r
-  TH1F * tXiRadius = new TH1F("XiRadius",  \r
-                             "Casc. decay transv. radius; r (cm); Counts" , \r
-                             1050, 0., 105.0 );\r
-  tQACandidates->Add(tXiRadius);\r
-  \r
-  TH1F *tMassLambda \r
-    = new TH1F("MassLambdaAsCascDghter",\r
-              "#Lambda assoc. to Casc. candidates; Eff. Mass (GeV/c^{2}); Counts", \r
-              300,1.00,1.3);\r
-  tQACandidates->Add(tMassLambda);\r
-\r
-  TH1F *tV0Chi2 = new TH1F("V0Chi2Xi", \r
-                      "V0 #chi^{2}, in cascade; #chi^{2};Counts", \r
-                      160, 0, 40);\r
-  tQACandidates->Add(tV0Chi2);\r
-  \r
-  TH1F * tV0CosOfPointingAngle \r
-    = new TH1F("V0CosOfPointingAngleXi", \r
-              "Cos of V0 Pointing Angle, in cascade;Cos(V0 Point. Angl); Counts", \r
-              200, 0.98, 1.0);\r
-  tQACandidates->Add(tV0CosOfPointingAngle);\r
-\r
-  TH1F *tV0Radius  = new TH1F("V0RadiusXi", \r
-                         "V0 decay radius, in cascade; radius (cm); Counts", \r
-                         1050, 0., 105.0);\r
-  tQACandidates->Add(tV0Radius);\r
-  \r
-  TH1F * tDcaV0DaughtersXi \r
-    = new TH1F("DcaV0DaughtersXi", \r
-              "DCA between V0 daughters, in cascade;DCA (cm);Number of V0s", \r
-              120, 0., 0.6);\r
-  tQACandidates->Add(tDcaV0DaughtersXi);\r
-\r
-  TH1F * tDcaV0ToPrimVertex \r
-    = new TH1F("DcaV0ToPrimVertexXi", \r
-              "DCA of V0 to Prim. Vertex, in cascade;DCA (cm);Number of Cascades", 200, 0., 1.);\r
-  tQACandidates->Add(tDcaV0ToPrimVertex);\r
-\r
-  TH1F * tDCAPosToPrimVertex =\r
-    new TH1F("DcaPosToPrimVertexXi", \r
-            "DCA of V0 pos daughter to Prim. Vertex;DCA (cm);Counts", \r
-            300, 0, 3);\r
-  tQACandidates->Add(tDCAPosToPrimVertex);\r
-\r
-  TH1F * tDCANegToPrimVertex \r
-    =  new TH1F("DcaNegToPrimVertexXi", \r
-               "DCA of V0 neg daughter to Prim. Vertex;DCA (cm);Counts", \r
-               300, 0, 3);\r
-  tQACandidates->Add(tDCANegToPrimVertex);\r
-\r
-  TH1F *tV0toXiCosOfPointingAngle \r
-    = new TH1F("V0toXiCosOfPointingAngle", \r
-              "Cos. of V0 Ptng Angl Xi vtx; Cos(V0 Point. Angl / Xi vtx); Counts", \r
-              100, 0.99, 1.0);\r
-  tQACandidates->Add(tV0toXiCosOfPointingAngle);\r
-\r
-  TH2F *th2Armenteros \r
-    = new TH2F("Armenteros", \r
-              "#alpha_{Arm}(casc. cand.) Vs Pt_{Arm}(casc. cand.); #alpha_{Arm} ; Pt_{Arm} (GeV/c)", \r
-              140, -1.2, 1.2, 300, 0., 0.3);\r
-  tQACandidates->Add(th2Armenteros);\r
-\r
-  TH2F *th2TPCdEdxOfCascDghters\r
-    = new TH2F( "TPCdEdxOfCascDghters",\r
-               "TPC dE/dx of the cascade daughters; charge x || #vec{p}_{TPC inner wall}(Casc. daughter) || (GeV/c); TPC signal (ADC) ", \r
-               200, -10.0, 10.0, 450, 0., 900.);\r
-  tQACandidates->Add(th2TPCdEdxOfCascDghters);\r
-\r
-  TH2F *th2MassVsPtAll \r
-    = new TH2F("MassVsPtAll", \r
-              "M_{candidates} vs Pt; Pt (GeV/c); M (GeV/c^{2})", \r
-              100, 0., 10., fMassBins, fMinMass, fMaxMass);\r
-  tQACandidates->Add(th2MassVsPtAll);\r
-\r
-  TH1F *tDistToVtxZAfter \r
-    = new TH1F("DistToVtxZAfter", \r
-              "Distance to vtx z after propagation to vtx; z [cm]", \r
-              100, -5., 5.);\r
-  tQACandidates->Add(tDistToVtxZAfter);\r
-\r
-  TH1F * tDistToVtxXYAfter \r
-    = new TH1F("DistToVtxXYAfter", \r
-              "Distance to vtx xy after propagation to vtx",\r
-              500, 0., 50.);\r
-  tQACandidates->Add(tDistToVtxXYAfter);\r
-\r
-  TH2F *th2DistToVtxZBeforeVsAfter \r
-    = new TH2F("DistToVtxZBeforeVsAfter", \r
-              "Distance to vtx z before vs after propagation; Distance before [cm]; Distance after [cm]", \r
-              500, -50., 50., 100, -5., 5.);\r
-  tQACandidates->Add(th2DistToVtxZBeforeVsAfter);\r
-\r
-  TH2F *th2DistToVtxXYBeforeVsAfter\r
-    = new TH2F("DistToVtxXYBeforeVsAfter",\r
-              "Distance to vtx xy before vs after propagation; Distance before [cm]; Distance after [cm]", \r
-              500, 0., 50, 500, 0., 50);\r
-  tQACandidates->Add(th2DistToVtxXYBeforeVsAfter);\r
-\r
-  TH2F * th2PxBeforeVsAfter \r
-    = new TH2F("PxBeforeVsAfter", \r
-              "Px before vs after propagation; Px [GeV/c]; Px' [GeV/c]", \r
-              200, -10., 10, 200, -10., 10.);\r
-  tQACandidates->Add(th2PxBeforeVsAfter);\r
-\r
-  TH2F * th2PyBeforeVsAfter\r
-    = new TH2F("PyBeforeVsAfter",\r
-               "Py before vs after propagation; Py [GeV/c]; Py' [GeV/c]",\r
-               200, -10., 10, 200, -10., 10.);\r
-  tQACandidates->Add(th2PyBeforeVsAfter);\r
-  \r
-  TH2F * th2PhiPosBeforeVsAfter\r
-    = new TH2F("PhiPosBeforeVsAfter", \r
-              "Phi for positively charged candidates before vs after propagation; #phi; #phi'", \r
-              360, 0., 2.0*TMath::Pi(), 360, 0., 2.0*TMath::Pi());\r
-  tQACandidates->Add(th2PhiPosBeforeVsAfter);\r
-\r
-  TH2F *th2PhiNegBeforeVsAfter\r
-    = new TH2F("PhiNegBeforeVsAfter",\r
-               "Phi for negatively charged candidates before vs after propagation; #phi; #phi'",\r
-               360, 0., 2.0*TMath::Pi(), 360, 0., 2.0*TMath::Pi());\r
-  tQACandidates->Add(th2PhiNegBeforeVsAfter);\r
-\r
-  fQAList->Add(tQACandidates);\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::NotifyRun()\r
-{\r
-}\r
-//_____________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::UserExec(Option_t *)\r
-{\r
-  AliESDEvent *fESD = dynamic_cast<AliESDEvent*>(InputEvent());\r
-  AliAODEvent *fAOD = dynamic_cast<AliAODEvent*>(InputEvent());\r
-  Bool_t acceptEvent=kFALSE; \r
-  fCandidates->SetLast(-1);\r
-\r
-  if(fESD) {\r
-    // recorrecting VZERO (for pass 1 only)\r
-    /*\r
-    Float_t *vChCorr = new Float_t[64];\r
-    Float_t dummy;\r
-    AliESDUtils::GetCorrV0(fESD,dummy,NULL,vChCorr);\r
-    AliESDVZERO *vzero = (AliESDVZERO*) fESD->GetVZEROData();\r
-    vzero->SetMultiplicity( vChCorr );\r
-    delete [] vChCorr;\r
-    */\r
-    //\r
-\r
-    ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(0);\r
-    \r
-    const AliVVertex *vtxGlb = fESD->GetPrimaryVertexTracks();\r
-    const AliVVertex *vtxSPD = fESD->GetPrimaryVertexSPD();\r
-    if(!vtxGlb || !vtxSPD) return;\r
-    if( fCutsEvent->IsSelected(fESD, 0) && (TMath::Abs(vtxSPD->GetZ()-vtxGlb->GetZ()) <= 0.5) ) {\r
-      acceptEvent = kTRUE;\r
-    ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(2);\r
-      ReadFromESDv0(fESD);\r
-    }\r
-  } else if(fAOD) {\r
-    const AliVVertex *vtxGlb = fAOD->GetPrimaryVertex();\r
-    const AliVVertex *vtxSPD = fAOD->GetPrimaryVertexSPD();\r
-    if(!vtxGlb || !vtxSPD) return;\r
-\r
-    ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(0);\r
-        \r
-    if(fCutsEvent->IsSelected(fAOD, 0) && (TMath::Abs(vtxSPD->GetZ()-vtxGlb->GetZ()) <= 0.5) ) {\r
-      acceptEvent = kTRUE;\r
-      ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(2);\r
-      ReadFromAODv0(fAOD);\r
-    }\r
-\r
-    \r
-    /*\r
-\r
-    AliAODHeader *aodHeader = fAOD->GetHeader();\r
-    if(!aodHeader) return;\r
-    AliCentrality *centrality = aodHeader->GetCentralityP();\r
-    if(!centrality) return;\r
-    Double_t cent = centrality->GetCentralityPercentile("V0M" );\r
-    Double_t cent1 = centrality->GetCentralityPercentile("TRK" );\r
-    if(TMath::Abs(cent-cent1) >= 5.) return;\r
-    \r
-    if(cent<fMinCent||cent>=fMaxCent) return; //centrality cut\r
-    \r
-    Double_t zvtx = fAOD->GetPrimaryVertex()->GetZ();\r
-    if(TMath::Abs(zvtx)>10.) return; //vertex cut\r
-    \r
-    ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(2);\r
-    ReadFromAODv0(fAOD);\r
-    */  \r
-  }\r
-  \r
-  if(!acceptEvent) return;\r
-\r
-  ((TH1D*)((TList*)fQAList->FindObject("Events"))->FindObject("RFPTPC"))\r
-    ->Fill(fFlowEventTPC->GetNumberOfRPs() );\r
-  Double_t mult=0;\r
-  for(Int_t i=0; i != fFlowEventVZE->GetNumberOfRPs(); ++i) {\r
-    AliFlowTrackSimple *pTrack = fFlowEventVZE->GetTrack(i);\r
-    mult += pTrack->Weight();\r
-  }\r
-  ((TH1D*)((TList*)fQAList->FindObject("Events"))->FindObject("RFPVZE"))\r
-    ->Fill( mult );\r
-\r
-  //  if(fDebug) printf("TPCevent %d | VZEevent %d\n",\r
-  //                  fFlowEventTPC->NumberOfTracks(),\r
-  //                  fFlowEventVZE->NumberOfTracks() );\r
-  AddCandidates();\r
-\r
-  PostData(1,fFlowEventTPC);\r
-  PostData(2,fFlowEventVZE);\r
-  PostData(3,fQAList);\r
-\r
-  return;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::AddCandidates(){\r
-  \r
-  //  if(fDebug) printf("I received %d candidates\n",\r
-  //               fCandidates->GetEntriesFast());\r
-  for(int iCand=0; iCand!=fCandidates->GetEntriesFast(); ++iCand ) {\r
-    AliFlowCandidateTrack *cand \r
-      = dynamic_cast<AliFlowCandidateTrack*>(fCandidates->At(iCand));\r
-    if(!cand) continue;\r
-    // if(fDebug) \r
-    //  printf(" >Checking at candidate %d with %d daughters: mass %f\n",\r
-    //      iCand, cand->GetNDaughters(), cand->Mass());\r
-    \r
-    // untagging ===>                      \r
-    for(int iDau=0; iDau != cand->GetNDaughters(); ++iDau) {\r
-      // if(fDebug) \r
-      // printf(" >Daughter %d with fID %d", iDau, cand->GetIDDaughter(iDau));\r
-      for(int iRPs=0; iRPs != fFlowEventTPC->NumberOfTracks(); ++iRPs ) {\r
-        AliFlowTrack *iRP \r
-         = dynamic_cast<AliFlowTrack*>(fFlowEventTPC->GetTrack( iRPs ));\r
-        if (!iRP) continue;\r
-        if( !iRP->InRPSelection() ) continue;\r
-        if( cand->GetIDDaughter(iDau) == iRP->GetID() ) {\r
-          //if(fDebug) printf(" was in RP set");\r
-          iRP->SetForRPSelection(kFALSE);\r
-          fFlowEventTPC->SetNumberOfRPs( fFlowEventTPC->GetNumberOfRPs() -1 );\r
-        }\r
-      }\r
-      //if(fDebug) printf("\n");\r
-    }\r
-    // <=== untagging\r
-    cand->SetForPOISelection(kTRUE);\r
-    fFlowEventTPC->InsertTrack( ((AliFlowTrack*) cand) );\r
-    fFlowEventVZE->InsertTrack( ((AliFlowTrack*) cand) );\r
-  }\r
-\r
-  //  if(fDebug) printf("TPCevent %d | VZEevent %d\n",\r
-  //                fFlowEventTPC->NumberOfTracks(),\r
-  //                fFlowEventVZE->NumberOfTracks() );\r
-\r
-}\r
-\r
-//______________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::ReadFromESDv0(AliESDEvent *fESD)\r
-{\r
-  //AliFlowTrackCuts* cutsPOI = new AliFlowTrackCuts("null_cuts");\r
-  //cutsPOI->SetParamType( fCutsRP->GetParamType() );\r
-  //cutsPOI->SetParamType( AliFlowTrackCuts::kGlobal );\r
-  // cutsPOI->SetPtRange(+1,-1); // select nothing\r
-  //cutsPOI->SetEtaRange(+1,-1); // select nothing VZERO\r
-\r
-  fCutsRPTPC->SetEvent(fESD,MCEvent());\r
-  fCutsRPVZE->SetEvent(fESD,MCEvent());\r
-\r
-  fCutsPOI->SetEvent(fESD,MCEvent());\r
-\r
-  fFlowEventTPC->Fill(fCutsRPTPC,fCutsPOI);\r
-  fFlowEventVZE->Fill(fCutsRPVZE,fCutsPOI);\r
-  \r
-  Double_t trkPrimaryVtxPos[3] = {-100., -100., -100.};\r
-  Double_t bestPrimaryVtxPos[3] = {-100., -100., -100.};\r
-  int nCascades=fESD->GetNumberOfCascades();\r
-  \r
-  const AliESDVertex *primaryTrackingESDVtx = fESD->GetPrimaryVertexTracks();\r
-  primaryTrackingESDVtx->GetXYZ(trkPrimaryVtxPos);\r
-  \r
-  const AliESDVertex *primaryBestESDVtx = fESD->GetPrimaryVertex();\r
-  primaryBestESDVtx->GetXYZ(bestPrimaryVtxPos);\r
-\r
-  Double_t b = fESD->GetMagneticField();\r
-\r
-  for(int i = 0; i != nCascades; ++i) {\r
-    \r
-    // Double_t trkPrimaryVtxRadius3D = -500.;\r
-    // Double_t bestPrimaryVtxRadius3D = -500.;\r
-    Double_t effMassXi = 0.;\r
-    Double_t chi2Xi = -1.;\r
-    Double_t dcaXiDaughters = -1.;\r
-    Double_t XiCosOfPointingAngle = -1.;\r
-    Double_t posXi[3] = {-1000., -1000., -1000.};\r
-    Double_t XiRadius = -1000.;\r
-\r
-    // Double_t innerWallMomCascDghters[3] = {-100., -100., -100.};\r
-    //Double_t tpcSignalCascDghters[3] = {-100., -100., -100.};\r
-\r
-    Double_t invMassLambdaAsCascDghter = 0.;\r
-    Double_t V0Chi2Xi = -1.;\r
-    Double_t dcaV0DaughtersXi = -1.;\r
-    \r
-    Double_t dcaBachToPrimaryVtxXi = -1.;\r
-    Double_t dcaV0ToPrimaryVtxXi = -1.;\r
-    Double_t dcaPosToPrimaryVtxXi = -1.;\r
-    Double_t dcaNegToPrimaryVtxXi = -1.;\r
-    Double_t V0CosOfPointingAngleXi = -1.;\r
-    Double_t posV0Xi[3] = {-1000., -1000., -1000.};\r
-    Double_t V0RadiusXi = -1000.;\r
-    Double_t V0quality = 0.;\r
-\r
-    Double_t invMassXiMinus = 0.;\r
-    Double_t invMassXiPlus = 0.;\r
-    Double_t invMassOmegaMinus = 0.;\r
-    Double_t invMassOmegaPlus = 0.;\r
-\r
-    /*\r
-    Bool_t isPosInXiProton = kFALSE;\r
-    Bool_t isPosInXiPion = kFALSE;\r
-    Bool_t isPosInOmegaProton = kFALSE;\r
-    Bool_t isPosInOmegaPion = kFALSE;\r
-    \r
-    Bool_t isNegInXiProton = kFALSE;\r
-    Bool_t isNegInXiPion = kFALSE;\r
-    Bool_t isNegInOmegaProton = kFALSE;\r
-    Bool_t isNegInOmegaPion = kFALSE;\r
-\r
-    Bool_t isBachelorKaon = kFALSE;\r
-    Bool_t isBachelorPion = kFALSE;\r
-    */\r
-\r
-    Bool_t isBachelorKaonForTPC = kFALSE;\r
-    Bool_t isBachelorPionForTPC = kFALSE;\r
-    Bool_t isNegPionForTPC = kFALSE;\r
-    Bool_t isPosPionForTPC = kFALSE;\r
-    Bool_t isNegProtonForTPC = kFALSE;\r
-    Bool_t isPosProtonForTPC = kFALSE;\r
-\r
-    Double_t XiPx = 0., XiPy = 0., XiPz = 0.;\r
-    Double_t XiPt = 0.;\r
-    Double_t XiPtot = 0.;\r
-    \r
-    Double_t bachPx = 0., bachPy = 0., bachPz = 0.;\r
-    Double_t bachPt = 0.;\r
-    Double_t bachPtot = 0.;\r
-    \r
-    //Short_t chargeXi = -2;\r
-    Double_t V0toXiCosOfPointingAngle = 0.;\r
-    \r
-    Double_t rapXi = -20.;\r
-    Double_t rapOmega = -20.;\r
-    Double_t phi = 6.3;\r
-    Double_t alphaXi = -200.;\r
-    Double_t ptArmXi = -200.;\r
-    //    TLorentzVector lv1, lv2, lv3, lv12, lvXi;\r
-\r
-    Double_t distToVtxZBefore = -999.;\r
-    Double_t distToVtxZAfter = -999.;\r
-    Double_t distToVtxXYBefore = -999.;\r
-    Double_t distToVtxXYAfter = -999.;\r
-    Double_t XiPAfter[3] = {-999., -999., -999.};\r
-    Double_t phiAfter = -999.;\r
-    \r
-    AliESDcascade *xi = fESD->GetCascade(i);\r
-    if(!xi) continue;\r
-    \r
-    if(xi->Charge()<0)\r
-      xi->ChangeMassHypothesis(V0quality, 3312); // Xi- hypothesis\r
-    else if(xi->Charge() > 0)\r
-      xi->ChangeMassHypothesis(V0quality, -3312);\r
-    else continue;\r
-\r
-    effMassXi = xi->GetEffMassXi();\r
-    chi2Xi = xi->GetChi2Xi();\r
-    dcaXiDaughters = xi->GetDcaXiDaughters();\r
-    XiCosOfPointingAngle \r
-      = xi->GetCascadeCosineOfPointingAngle(bestPrimaryVtxPos[0],\r
-                                           bestPrimaryVtxPos[1],\r
-                                           bestPrimaryVtxPos[2]);\r
-    xi->GetXYZcascade(posXi[0], posXi[1], posXi[2]);\r
-    XiRadius = TMath::Sqrt(posXi[0]*posXi[0]\r
-                          +posXi[1]*posXi[1]\r
-                          +posXi[2]*posXi[2]);\r
-    \r
-    UInt_t idxPosXi = (UInt_t)TMath::Abs(xi->GetPindex());\r
-    UInt_t idxNegXi = (UInt_t)TMath::Abs(xi->GetNindex());\r
-    UInt_t idxBach = (UInt_t)TMath::Abs(xi->GetBindex());\r
-\r
-    if(idxBach == idxPosXi || idxBach == idxNegXi) continue;\r
-\r
-    AliESDtrack *pTrkXi = fESD->GetTrack(idxPosXi);\r
-    AliESDtrack *nTrkXi = fESD->GetTrack(idxNegXi);\r
-    AliESDtrack *bTrkXi = fESD->GetTrack(idxBach);\r
-\r
-    if( !pTrkXi || !nTrkXi || !bTrkXi ) continue;\r
-\r
-    if( !fCutsDau->IsSelected(pTrkXi) \r
-       || !fCutsDau->IsSelected(nTrkXi)\r
-       || !fCutsDau->IsSelected(bTrkXi) ) continue;\r
-\r
-    const AliExternalTrackParam *pExtTrk = pTrkXi->GetInnerParam();\r
-    const AliExternalTrackParam *nExtTrk = nTrkXi->GetInnerParam();\r
-    const AliExternalTrackParam *bExtTrk = bTrkXi->GetInnerParam();\r
-    \r
-    if(pExtTrk && pTrkXi->IsOn(AliESDtrack::kTPCin)){\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(pExtTrk->GetP()*pExtTrk->Charge(), pTrkXi->GetTPCsignal());\r
-    }\r
-    if(nExtTrk && nTrkXi->IsOn(AliESDtrack::kTPCin)){\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(nExtTrk->GetP()*nExtTrk->Charge(), nTrkXi->GetTPCsignal());\r
-    }\r
-    if(bExtTrk && bTrkXi->IsOn(AliESDtrack::kTPCin)){\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(bExtTrk->GetP()*bExtTrk->Charge(), bTrkXi->GetTPCsignal());\r
-    }\r
-    \r
-    invMassLambdaAsCascDghter = xi->GetEffMass(); // from V0\r
-    dcaV0DaughtersXi = xi->GetDcaV0Daughters();\r
-    V0Chi2Xi = xi->GetChi2V0();\r
-    V0CosOfPointingAngleXi \r
-      = xi->GetV0CosineOfPointingAngle(bestPrimaryVtxPos[0],\r
-                                      bestPrimaryVtxPos[1],\r
-                                      bestPrimaryVtxPos[2]);\r
-    dcaV0ToPrimaryVtxXi = xi->GetD(bestPrimaryVtxPos[0], \r
-                                  bestPrimaryVtxPos[1],\r
-                                  bestPrimaryVtxPos[2]);\r
-    dcaBachToPrimaryVtxXi = TMath::Abs(bTrkXi->GetD(bestPrimaryVtxPos[0],\r
-                                                   bestPrimaryVtxPos[1],\r
-                                                   bestPrimaryVtxPos[2]));\r
-    \r
-    //V0\r
-    xi->GetXYZ(posV0Xi[0], posV0Xi[1], posV0Xi[2]);\r
-    V0RadiusXi = TMath::Sqrt(posV0Xi[0]*posV0Xi[0]\r
-                            +posV0Xi[1]*posV0Xi[1]\r
-                            +posV0Xi[2]*posV0Xi[2]);\r
-    dcaPosToPrimaryVtxXi = TMath::Abs(pTrkXi->GetD(bestPrimaryVtxPos[0],\r
-                                                  bestPrimaryVtxPos[1],\r
-                                                  bestPrimaryVtxPos[2]));\r
-    dcaNegToPrimaryVtxXi = TMath::Abs(nTrkXi->GetD(bestPrimaryVtxPos[0],\r
-                                                  bestPrimaryVtxPos[1],\r
-                                                  bestPrimaryVtxPos[2]));\r
-\r
-    //apply cuts\r
-    //if(XiRadius < 0.9 || XiRadius > 100.) continue;\r
-    //if(dcaXiDaughters > 0.2) continue;\r
-    //if(XiCosOfPointingAngle < 0.99) continue;\r
-    //if(dcaV0ToPrimaryVtxXi < 0.03) continue;\r
-    //if(dcaBachToPrimaryVtxXi < 0.01) continue;\r
-    \r
-    if(dcaXiDaughters > fCascadeCuts[0]) continue;\r
-    if(XiCosOfPointingAngle < fCascadeCuts[1]) continue;\r
-    if(dcaV0ToPrimaryVtxXi < fCascadeCuts[2]) continue;\r
-    if(dcaBachToPrimaryVtxXi < fCascadeCuts[3]) continue;\r
-\r
-    //V0 mass cut?\r
-    //  if(TMath::Abs(invMassLambdaAsCascDghter-1.11568) > 0.01) continue;\r
-    if(TMath::Abs(invMassLambdaAsCascDghter-1.11568) > fCascadeCuts[7]) \r
-      continue;\r
-    \r
-    //if(dcaV0DaughtersXi > 1.) continue;\r
-    //if(V0CosOfPointingAngleXi > 0.9999) continue;\r
-    //if(dcaPosToPrimaryVtxXi < 0.1) continue;\r
-    //if(dcaNegToPrimaryVtxXi < 0.1) continue;\r
-\r
-    if(dcaV0DaughtersXi > fCascadeCuts[4]) continue;\r
-    if(V0CosOfPointingAngleXi > fCascadeCuts[5]) continue;\r
-    if(dcaPosToPrimaryVtxXi < fCascadeCuts[6]) continue;\r
-    if(dcaNegToPrimaryVtxXi < fCascadeCuts[6]) continue;\r
-\r
-    //if(V0RadiusXi < 1.0 || V0RadiusXi > 100) continue;\r
-    \r
-    //other cuts?\r
-    // change mass hypothesis to cover all the possibilities\r
-    if(bTrkXi->Charge()<0){\r
-      V0quality = 0.;\r
-      xi->ChangeMassHypothesis(V0quality, 3312); //Xi- hyp.\r
-      invMassXiMinus = xi->GetEffMassXi();\r
-\r
-      V0quality = 0.;\r
-      xi->ChangeMassHypothesis(V0quality, 3334); //Omega- hyp.\r
-      invMassOmegaMinus = xi->GetEffMassXi();\r
-\r
-      V0quality = 0.;\r
-      xi->ChangeMassHypothesis(V0quality, 3312); //back to default hyp.\r
-    }\r
-\r
-    if(bTrkXi->Charge() > 0){\r
-      V0quality = 0.;\r
-      xi->ChangeMassHypothesis(V0quality, -3312); //anti-Xi- hyp.\r
-      invMassXiPlus = xi->GetEffMassXi();\r
-\r
-      V0quality = 0.;\r
-      xi->ChangeMassHypothesis(V0quality, -3334); //anti-Omega- hyp.\r
-      invMassOmegaPlus = xi->GetEffMassXi();\r
-\r
-      V0quality = 0.;\r
-      xi->ChangeMassHypothesis(V0quality, -3312); //back to default hyp.\r
-    }\r
-\r
-    //PID on the daughter tracks\r
-    /*\r
-    //A - Combined PID\r
-    //Resonable guess the priors for the cascade track sample\r
-    //(e, mu, pi, K, p)\r
-    Double_t priorsGuessXi[5] = {0, 0, 2, 0, 1};\r
-    Double_t priorsGuessOmega[5] = {0, 0, 1, 1, 1};\r
-\r
-    //Combined bachelor-daughter PID\r
-    AliPID pidXi;\r
-    pidXi.SetPriors(priorsGuessXi);\r
-    AliPID pidOmega;\r
-    pidOmega.SetPriors(priorsGuessOmega);\r
-\r
-    if(pTrkXi->IsOn(AliESDtrack::kESDpid)){// combined PID exists\r
-      Double_t r[10] = {0.};\r
-      pTrkXi->GetESDpid(r);\r
-      pidXi.SetProbabilities(r);\r
-      pidOmega.SetProbabilities(r);\r
-\r
-      //Check if the V0 postive track is proton (case for Xi-)\r
-      Double_t pProton = pidXi.GetProbability(AliPID::kProton);\r
-      if(pProton > pidXi.GetProbability(AliPID::kElectron)\r
-         && pProton > pidXi.GetProbability(AliPID::kMuon)\r
-         && pProton > pidXi.GetProbability(AliPID::kPion)\r
-         && pProton > pidXi.GetProbability(AliPID::kKaon))\r
-        isPosInXiProton = kTRUE;\r
-        \r
-      //Check if the V0 postive track is a pi+ (case for Xi+)\r
-      Double_t pPion = pidXi.GetProbability(AliPID::kPion);\r
-      if(pPion > pidXi.GetProbability(AliPID::kElectron)\r
-         && pPion > pidXi.GetProbability(AliPID::kMuon)\r
-         && pPion > pidXi.GetProbability(AliPID::kKaon)\r
-         && pPion > pidXi.GetProbability(AliPID::kProton))\r
-        isPosInXiPion = kTRUE;\r
-      // Check if the V0 positive track is a proton (case for Omega-)\r
-      pProton = pidOmega.GetProbability(AliPID::kProton);\r
-      if(pProton > pidOmega.GetProbability(AliPID::kElectron)\r
-         && pProton > pidOmega.GetProbability(AliPID::kMuon)\r
-         && pProton > pidOmega.GetProbability(AliPID::kPion)\r
-         && pProton > pidOmega.GetProbability(AliPID::kKaon))\r
-        isPosInOmegaProton = kTRUE;\r
-    \r
-      // Check if the V0 positive track is a pi+ (case for Omega+)\r
-      pPion =  pidOmega.GetProbability(AliPID::kPion);\r
-      if(pPion > pidOmega.GetProbability(AliPID::kElectron)\r
-         && pPion > pidOmega.GetProbability(AliPID::kMuon)\r
-         && pPion > pidOmega.GetProbability(AliPID::kKaon)\r
-         && pPion > pidOmega.GetProbability(AliPID::kProton))\r
-        isPosInOmegaPion = kTRUE;\r
-    }\r
-\r
-    //Combined V0-negative-daughter PID\r
-    pidXi.SetPriors(priorsGuessXi);\r
-    pidOmega.SetPriors(priorsGuessOmega);\r
-    if(nTrkXi->IsOn(AliESDtrack::kESDpid)){\r
-      Double_t r[10] = {0.};\r
-      nTrkXi->GetESDpid(r);\r
-      pidXi.SetProbabilities(r);\r
-      pidOmega.SetProbabilities(r);\r
-      \r
-      // Check if the V0 negative track is a pi- (case for Xi-)\r
-      Double_t pPion = pidXi.GetProbability(AliPID::kPion);\r
-      if(pPion > pidXi.GetProbability(AliPID::kElectron)\r
-         && pPion > pidXi.GetProbability(AliPID::kMuon)\r
-         && pPion >  pidXi.GetProbability(AliPID::kKaon)\r
-         && pPion > pidXi.GetProbability(AliPID::kProton))\r
-        isNegInXiPion = kTRUE;\r
-\r
-      // Check if the V0 negative track is an anti-proton (case for Xi+)\r
-      Double_t pProton = pidXi.GetProbability(AliPID::kProton);\r
-      if(pProton > pidXi.GetProbability(AliPID::kElectron)\r
-         && pProton > pidXi.GetProbability(AliPID::kMuon)\r
-         && pProton > pidXi.GetProbability(AliPID::kPion) \r
-         && pProton > pidXi.GetProbability(AliPID::kKaon))\r
-        isNegInXiProton = kTRUE;\r
-      \r
-      // Check if the V0 negative track is a pi- (case for Omega-)\r
-      pPion = pidOmega.GetProbability(AliPID::kPion);\r
-      if(pPion > pidOmega.GetProbability(AliPID::kElectron)\r
-         && pPion > pidOmega.GetProbability(AliPID::kMuon)\r
-         && pPion > pidOmega.GetProbability(AliPID::kKaon)\r
-         && pPion > pidOmega.GetProbability(AliPID::kProton))\r
-        isNegInOmegaPion = kTRUE;\r
-      \r
-      // Check if the V0 negative track is an anti-proton (case for Omega+)   \r
-      pProton =  pidOmega.GetProbability(AliPID::kProton);\r
-      if(pProton > pidOmega.GetProbability(AliPID::kElectron)\r
-         && pProton > pidOmega.GetProbability(AliPID::kMuon)\r
-         && pProton > pidOmega.GetProbability(AliPID::kPion)\r
-         && pProton > pidOmega.GetProbability(AliPID::kKaon))\r
-        isNegInOmegaProton = kTRUE;\r
-      \r
-    }\r
-\r
-    // Combined bachelor PID\r
-    pidXi.SetPriors(priorsGuessXi);\r
-    pidOmega.SetPriors(priorsGuessOmega);\r
-    if(bTrkXi->IsOn(AliESDtrack::kESDpid)){//Combined PID exists\r
-      Double_t r[10] = {0.};\r
-      bTrkXi->GetESDpid(r);\r
-      pidXi.SetProbabilities(r);\r
-      pidOmega.SetProbabilities(r);\r
-      \r
-      //Check if the bachelor track is a pion\r
-      Double_t pPion = pidXi.GetProbability(AliPID::kPion);\r
-      if(pPion >  pidXi.GetProbability(AliPID::kElectron)\r
-        && pPion >  pidXi.GetProbability(AliPID::kMuon)\r
-        && pPion > pidXi.GetProbability(AliPID::kKaon)\r
-        && pPion > pidXi.GetProbability(AliPID::kProton))\r
-       isBachelorPion = kTRUE;\r
-      \r
-      // Check if the bachelor track is a kaon\r
-      Double_t pKaon = pidOmega.GetProbability(AliPID::kKaon);\r
-      if(pKaon > pidOmega.GetProbability(AliPID::kElectron)\r
-        && pKaon > pidOmega.GetProbability(AliPID::kMuon)\r
-        && pKaon > pidOmega.GetProbability(AliPID::kPion)\r
-        && pKaon > pidOmega.GetProbability(AliPID::kProton))\r
-       isBachelorKaon = kTRUE;\r
-    }\r
-    */\r
-\r
-\r
-    //B - TPC PID: 3-sigma bands on Bethe-Bloch curve\r
-    //Bachelor\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(bTrkXi, AliPID::kKaon))<3.)\r
-      isBachelorKaonForTPC = kTRUE;\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(bTrkXi, AliPID::kPion))<3.)\r
-      isBachelorPionForTPC = kTRUE;\r
-\r
-    //Negative V0 daughter\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(nTrkXi, AliPID::kPion))<3.)\r
-      isNegPionForTPC = kTRUE;\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(nTrkXi, AliPID::kProton))<3.)\r
-      isNegProtonForTPC = kTRUE;\r
-    \r
-    //Positive V0 daughter\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(pTrkXi, AliPID::kPion))<3.)\r
-      isPosPionForTPC = kTRUE;\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(pTrkXi, AliPID::kProton))<3.)\r
-      isPosProtonForTPC = kTRUE;\r
\r
-   \r
-    //Extra QA information\r
-    xi->GetPxPyPz(XiPx, XiPy, XiPz);\r
-    XiPt = TMath::Sqrt(XiPx*XiPx + XiPy*XiPy);\r
-    XiPtot= TMath::Sqrt(XiPx*XiPx + XiPy*XiPy + XiPz*XiPz);\r
-    \r
-    XiPAfter[0] = XiPx;\r
-    XiPAfter[1] = XiPy;\r
-    XiPAfter[2] = XiPz;\r
-\r
-    xi->GetBPxPyPz(bachPx, bachPy, bachPz);\r
-    bachPt = TMath::Sqrt(bachPx*bachPx + bachPy*bachPy);\r
-    bachPtot = TMath::Sqrt(bachPx*bachPx + bachPy*bachPy + bachPz*bachPz);\r
-\r
-    //chargeXi = xi->Charge();\r
-    \r
-    V0toXiCosOfPointingAngle \r
-      = xi->GetV0CosineOfPointingAngle(posXi[0], posXi[1], posXi[2]);\r
-    rapXi = xi->RapXi();\r
-    rapOmega = xi->RapOmega();\r
-    phi = xi->Phi();\r
-    alphaXi = xi->AlphaXi();\r
-    ptArmXi = xi->PtArmXi();\r
-\r
-    distToVtxZBefore = posXi[2]-bestPrimaryVtxPos[2];\r
-    distToVtxXYBefore \r
-      = TMath::Sqrt((posXi[0] - bestPrimaryVtxPos[0])\r
-                   *(posXi[0] - bestPrimaryVtxPos[0])\r
-                   +(posXi[1] - bestPrimaryVtxPos[1])\r
-                    *(posXi[1] - bestPrimaryVtxPos[1]));\r
-    \r
-    //propagation to the best primary vertex to determine the momentum\r
-    Propagate(bestPrimaryVtxPos, posXi, XiPAfter, b, xi->Charge());\r
-    distToVtxZAfter = posXi[2] - bestPrimaryVtxPos[2];\r
-    distToVtxXYAfter = TMath::Sqrt((posXi[0] - bestPrimaryVtxPos[0])\r
-                                  *(posXi[0] - bestPrimaryVtxPos[0])\r
-                                  +(posXi[1] - bestPrimaryVtxPos[1])\r
-                                  *(posXi[1] - bestPrimaryVtxPos[1]));\r
-    phiAfter = TMath::Pi() + TMath::ATan2(-XiPAfter[1],-XiPAfter[0]);\r
-    \r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxZAfter"))->Fill(distToVtxZAfter);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxXYAfter"))->Fill(distToVtxXYAfter);\r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxZBeforeVsAfter"))->Fill(distToVtxZBefore, distToVtxZAfter);\r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxXYBeforeVsAfter"))->Fill(distToVtxXYBefore, distToVtxXYAfter);\r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PxBeforeVsAfter"))->Fill(XiPx, XiPAfter[0]);\r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PyBeforeVsAfter"))->Fill(XiPy, XiPAfter[1]);\r
-    if(xi->Charge()>0)\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PhiPosBeforeVsAfter"))->Fill(phi, phiAfter);\r
-    else if(xi->Charge()<0)\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PhiNegBeforeVsAfter"))->Fill(phi, phiAfter);\r
-\r
-    \r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("Chi2Xi"))->Fill(chi2Xi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaXiDaughters"))->Fill(dcaXiDaughters);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaBachToPrimVertex"))->Fill(dcaBachToPrimaryVtxXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("XiCosOfPointingAngle"))->Fill(XiCosOfPointingAngle);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("XiRadius"))->Fill(XiRadius);\r
-    \r
-    //V0\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassLambdaAsCascDghter"))->Fill(invMassLambdaAsCascDghter);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0Chi2Xi"))->Fill(V0Chi2Xi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaV0DaughtersXi"))->Fill(dcaV0DaughtersXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0CosOfPointingAngleXi"))->Fill(V0CosOfPointingAngleXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0RadiusXi"))->Fill(V0RadiusXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaV0ToPrimVertexXi"))->Fill(dcaV0ToPrimaryVtxXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaPosToPrimVertexXi"))->Fill(dcaPosToPrimaryVtxXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaNegToPrimVertexXi"))->Fill(dcaNegToPrimaryVtxXi);\r
-    \r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0toXiCosOfPointingAngle"))->Fill(V0toXiCosOfPointingAngle);\r
-    \r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("Armenteros"))->Fill(alphaXi, ptArmXi);\r
-  \r
-    //PID cuts with TPC cuts\r
-    if(xi->Charge() < 0){\r
-      if(isPosProtonForTPC\r
-         && isNegPionForTPC){\r
-       \r
-       switch(fSpecie) {\r
-       case 0:\r
-         if(isBachelorPionForTPC && TMath::Abs(rapXi) < 0.8){\r
-           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassXiMinus);\r
-         \r
-         //candidate inserting\r
-           MakeTrack(invMassXiMinus, XiPt, /*xi->Phi()*/\r
-                     phiAfter, xi->Eta(),  pTrkXi->GetID(),\r
-                     nTrkXi->GetID(), bTrkXi->GetID());\r
-         }\r
-         break;\r
-         \r
-       case 1:\r
-         if(isBachelorKaonForTPC && TMath::Abs(rapOmega) < 0.8){\r
-           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassOmegaMinus);\r
-           MakeTrack(invMassOmegaMinus, XiPt, /*xi->Phi()*/\r
-                     phiAfter, xi->Eta(),\r
-                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());\r
-         }\r
-         break;\r
-       }\r
-      }\r
-    }\r
-\r
-    if(xi->Charge() > 0){\r
-      if(isNegProtonForTPC\r
-         && isPosPionForTPC){\r
-       \r
-       switch (fSpecie){\r
-       case 0:\r
-         if(isBachelorPionForTPC && TMath::Abs(rapXi) < 0.8){\r
-           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassXiPlus);\r
-         \r
-         //candidate inserting                                              \r
-           MakeTrack(invMassXiPlus, XiPt, /*xi->Phi()*/\r
-                     phiAfter, xi->Eta(),\r
-                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());\r
-         }\r
-         break;\r
-\r
-       case 1:\r
-         if(isBachelorKaonForTPC && TMath::Abs(rapOmega) < 0.8){\r
-           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassOmegaPlus);\r
-           MakeTrack(invMassOmegaPlus, XiPt, /*xi->Phi()*/\r
-                     phiAfter, xi->Eta(),\r
-                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());\r
-         }\r
-         break;\r
-       }\r
-      }\r
-    }\r
-  \r
-  }\r
-\r
-  return;\r
-}\r
-\r
-//______________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::ReadFromAODv0(AliAODEvent *fAOD)\r
-{\r
-  \r
-  fCutsRPTPC->SetEvent(fAOD, MCEvent());\r
-  fCutsRPVZE->SetEvent(fAOD, MCEvent());\r
-  fCutsPOI->SetEvent(fAOD, MCEvent());\r
-  fFlowEventTPC->Fill(fCutsRPTPC, fCutsPOI);\r
-  fFlowEventVZE->Fill(fCutsRPVZE, fCutsPOI);\r
-\r
-  //  Double_t trkPrimaryVtxPos[3] = {-100., -100., -100.};\r
-  Double_t bestPrimaryVtxPos[3] = {-100., -100., -100.};\r
-\r
-  Double_t b = fAOD->GetMagneticField();\r
-\r
-  int nCascades=fAOD->GetNumberOfCascades();\r
-  const AliAODVertex *primaryBestAODVtx = fAOD->GetPrimaryVertex();\r
-  primaryBestAODVtx->GetXYZ(bestPrimaryVtxPos);\r
-  \r
-  // calculation part dedicated to Xi vertices\r
-  for(Int_t iXi = 0; iXi < nCascades; iXi++){\r
-    Double_t effMassXi = 0.;\r
-    Double_t chi2Xi = -1.;\r
-    Double_t dcaXiDaughters = -1.;\r
-    Double_t XiCosOfPointingAngle = -1.;\r
-    Double_t posXi[3] = {-1000., -1000., -1000.};\r
-    Double_t XiRadius = -1000.;\r
-    \r
-    Double_t invMassLambdaAsCascDghter = 0.;\r
-    Double_t V0Chi2Xi = -1.;\r
-    Double_t dcaV0DaughtersXi = -1.;\r
-    \r
-    Double_t dcaBachToPrimaryVtxXi = -1.;\r
-    Double_t dcaV0ToPrimaryVtxXi = -1.;\r
-    Double_t dcaPosToPrimaryVtxXi = -1.;\r
-    Double_t dcaNegToPrimaryVtxXi = -1.;\r
-    Double_t V0CosOfPointingAngleXi = -1.;\r
-    Double_t posV0Xi[3] = {-1000., -1000., -1000.};\r
-    Double_t V0RadiusXi = -1000.;\r
-    //    Double_t V0quality = 0.;\r
-\r
-    Double_t invMassXiMinus = 0.;\r
-    Double_t invMassXiPlus = 0.;\r
-    Double_t invMassOmegaMinus = 0.;\r
-    Double_t invMassOmegaPlus = 0.;\r
-    \r
-    /*\r
-    Bool_t isPosInXiProton = kFALSE;\r
-    Bool_t isPosInXiPion = kFALSE;\r
-    Bool_t isPosInOmegaProton = kFALSE;\r
-    Bool_t isPosInOmegaPion = kFALSE;\r
-    \r
-    Bool_t isNegInXiProton = kFALSE;\r
-    Bool_t isNegInXiPion = kFALSE;\r
-    Bool_t isNegInOmegaProton = kFALSE;\r
-    Bool_t isNegInOmegaPion = kFALSE;\r
-\r
-    Bool_t isBachelorKaon = kFALSE;\r
-    Bool_t isBachelorPion = kFALSE;\r
-    */\r
-\r
-\r
-    Bool_t isBachelorKaonForTPC = kFALSE;\r
-    Bool_t isBachelorPionForTPC = kFALSE;\r
-    Bool_t isNegPionForTPC = kFALSE;\r
-    Bool_t isPosPionForTPC = kFALSE;\r
-    Bool_t isNegProtonForTPC = kFALSE;\r
-    Bool_t isPosProtonForTPC = kFALSE;\r
-    \r
-    Double_t XiPx = 0., XiPy = 0., XiPz = 0.;\r
-    Double_t XiPt = 0.;\r
-    Double_t XiPtot = 0.;\r
-    \r
-    Double_t bachPx = 0., bachPy = 0., bachPz = 0.;\r
-    Double_t bachPt = 0.;\r
-    Double_t bachPtot = 0.;\r
-    \r
-    //Short_t chargeXi = -2;\r
-    Double_t V0toXiCosOfPointingAngle = 0.;\r
-    \r
-    Double_t rapXi = -20.;\r
-    Double_t rapOmega = -20.;\r
-    Double_t phi = 6.3;\r
-    Double_t alphaXi = -200.;\r
-    Double_t ptArmXi = -200.;\r
-\r
-    Double_t distToVtxZBefore = -999.;\r
-    Double_t distToVtxZAfter = -999.;\r
-    Double_t distToVtxXYBefore = -999.;\r
-    Double_t distToVtxXYAfter = -999.;\r
-    Double_t XiPAfter[3] = {-999., -999., -999.};\r
-    Double_t phiAfter = -999.;\r
-\r
-    const AliAODcascade *xi = fAOD->GetCascade(iXi);\r
-    if (!xi) continue;\r
-\r
-    effMassXi = xi->MassXi(); //default working hypothesis: Xi- decay\r
-    chi2Xi = xi->Chi2Xi();\r
-    dcaXiDaughters = xi->DcaXiDaughters();\r
-    XiCosOfPointingAngle = xi->CosPointingAngleXi(bestPrimaryVtxPos[0],\r
-                                                 bestPrimaryVtxPos[1],\r
-                                                 bestPrimaryVtxPos[2]);\r
-    posXi[0] = xi->DecayVertexXiX();\r
-    posXi[1] = xi->DecayVertexXiY();\r
-    posXi[2] = xi->DecayVertexXiZ();\r
-    XiRadius = TMath::Sqrt(posXi[0]*posXi[0]\r
-                           +posXi[1]*posXi[1]\r
-                           +posXi[2]*posXi[2]);\r
-\r
-    AliAODTrack *pTrkXi = dynamic_cast<AliAODTrack*>( xi->GetDaughter(0) );\r
-    AliAODTrack *nTrkXi = dynamic_cast<AliAODTrack*>( xi->GetDaughter(1) );\r
-    AliAODTrack *bTrkXi \r
-      = dynamic_cast<AliAODTrack*>( xi->GetDecayVertexXi()->GetDaughter(0) );\r
-\r
-    if(!pTrkXi || !nTrkXi || !bTrkXi) continue;\r
-\r
-    UInt_t idxPosXi  = (UInt_t) TMath::Abs( pTrkXi->GetID() );\r
-    UInt_t idxNegXi  = (UInt_t) TMath::Abs( nTrkXi->GetID() );\r
-    UInt_t idxBach   = (UInt_t) TMath::Abs( bTrkXi->GetID() );\r
-\r
-    if(idxBach == idxNegXi || idxBach == idxPosXi) continue;\r
-\r
-    if( !fCutsDau->IsSelected(pTrkXi) \r
-        || !fCutsDau->IsSelected(nTrkXi)\r
-        || !fCutsDau->IsSelected(bTrkXi) ) continue;\r
-\r
-    \r
-    if(pTrkXi->IsOn(AliESDtrack::kTPCin)){\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(pTrkXi->P()*pTrkXi->Charge(), pTrkXi->GetTPCsignal());\r
-    }\r
-    if( nTrkXi->IsOn(AliESDtrack::kTPCin) ){\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(nTrkXi->P()*nTrkXi->Charge(), nTrkXi->GetTPCsignal());\r
-    }\r
-    if(bTrkXi->IsOn(AliESDtrack::kTPCin)){\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(bTrkXi->P()*bTrkXi->Charge(), bTrkXi->GetTPCsignal());\r
-    }\r
-    \r
-    if(xi->ChargeXi() < 0)\r
-      invMassLambdaAsCascDghter = xi->MassLambda();\r
-    else\r
-      invMassLambdaAsCascDghter = xi->MassAntiLambda();\r
-    \r
-    dcaV0DaughtersXi = xi->DcaV0Daughters();\r
-    V0Chi2Xi = xi->Chi2V0();\r
-    V0CosOfPointingAngleXi \r
-      = xi->CosPointingAngle(bestPrimaryVtxPos);\r
-    dcaV0ToPrimaryVtxXi = xi->DcaV0ToPrimVertex();\r
-    dcaBachToPrimaryVtxXi = xi->DcaBachToPrimVertex();\r
-    \r
-    //V0\r
-    posV0Xi[0] = xi->DecayVertexV0X();\r
-    posV0Xi[1] = xi->DecayVertexV0Y();\r
-    posV0Xi[2] = xi->DecayVertexV0Z();\r
-    V0RadiusXi = TMath::Sqrt(posV0Xi[0]*posV0Xi[0]\r
-                             +posV0Xi[1]*posV0Xi[1]\r
-                             +posV0Xi[2]*posV0Xi[2]);\r
-    dcaPosToPrimaryVtxXi = xi->DcaPosToPrimVertex();\r
-    dcaNegToPrimaryVtxXi = xi->DcaNegToPrimVertex();\r
-\r
-    //apply cuts ?\r
-    // if(XiRadius < 1. || XiRadius > 100.) continue;\r
-    //if(dcaXiDaughters > 0.1) continue;\r
-    //if(XiCosOfPointingAngle < 0.999) continue;\r
-    //if(dcaV0ToPrimaryVtxXi < 0.05) continue;\r
-    //if(dcaBachToPrimaryVtxXi < 0.03) continue;\r
-\r
-    if(dcaXiDaughters > fCascadeCuts[0]) continue;\r
-    if(XiCosOfPointingAngle < fCascadeCuts[1]) continue;\r
-    if(dcaV0ToPrimaryVtxXi < fCascadeCuts[2]) continue;\r
-    if(dcaBachToPrimaryVtxXi < fCascadeCuts[3]) continue;\r
-    \r
-    //V0 mass cut?\r
-    //if(TMath::Abs(invMassLambdaAsCascDghter-1.11568) > 0.006) continue;\r
-    if(TMath::Abs(invMassLambdaAsCascDghter-1.11568) > fCascadeCuts[7]) \r
-      continue;\r
-\r
-    //if(dcaV0DaughtersXi > 1.) continue;\r
-    //if(V0CosOfPointingAngleXi > 0.9999) continue;\r
-    //if(dcaPosToPrimaryVtxXi < 0.1) continue;\r
-    //if(dcaNegToPrimaryVtxXi < 0.1) continue;\r
-    if(dcaV0DaughtersXi > fCascadeCuts[4]) continue;\r
-    if(V0CosOfPointingAngleXi > fCascadeCuts[5]) continue;\r
-    if(dcaPosToPrimaryVtxXi < fCascadeCuts[6]) continue;\r
-    if(dcaNegToPrimaryVtxXi < fCascadeCuts[6]) continue;\r
-    \r
-    // if(V0RadiusXi < 1.0 || V0RadiusXi > 100) continue;\r
-    \r
-    //other cuts?\r
-\r
-\r
-    //???\r
-    if(xi->ChargeXi()<0){\r
-      invMassXiMinus = xi->MassXi();\r
-      invMassOmegaMinus = xi->MassOmega();\r
-    }else{\r
-      invMassXiPlus = xi->MassXi();\r
-      invMassOmegaPlus = xi->MassOmega();\r
-    }\r
-\r
-    /*\r
-    if(pTrkXi->GetMostProbablePID() == AliAODTrack::kProton) {\r
-      isPosInXiProton = kTRUE;\r
-      isPosInOmegaProton = kTRUE;\r
-    }\r
-    if(pTrkXi->GetMostProbablePID() == AliAODTrack::kPion){\r
-      isPosInXiPion = kTRUE;\r
-      isPosInOmegaPion = kTRUE;\r
-    }\r
-    \r
-    if(nTrkXi->GetMostProbablePID() == AliAODTrack::kPion){\r
-      isNegInXiPion = kTRUE;\r
-      isNegInOmegaPion = kTRUE;\r
-    }\r
-    if(nTrkXi->GetMostProbablePID() == AliAODTrack::kProton){\r
-      isNegInXiProton = kTRUE;\r
-      isNegInOmegaProton = kTRUE;\r
-    }\r
-\r
-    if(bTrkXi->GetMostProbablePID() == AliAODTrack::kPion)\r
-      isBachelorPion = kTRUE;\r
-    if(bTrkXi->GetMostProbablePID() == AliAODTrack::kKaon)\r
-      isBachelorKaon = kTRUE;\r
-    */\r
-\r
-    //PID with TPC only: \r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(bTrkXi, AliPID::kKaon))<3.)\r
-      isBachelorKaonForTPC = kTRUE;\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(bTrkXi, AliPID::kPion))<3.)\r
-      isBachelorPionForTPC = kTRUE;\r
-\r
-    //Negative V0 daughter\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(nTrkXi, AliPID::kPion))<3.)\r
-      isNegPionForTPC = kTRUE;\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(nTrkXi, AliPID::kProton))<3.)\r
-      isNegProtonForTPC = kTRUE;\r
-    \r
-    //Positive V0 daughter\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(pTrkXi, AliPID::kPion))<3.)\r
-      isPosPionForTPC = kTRUE;\r
-    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(pTrkXi, AliPID::kProton))<3.)\r
-      isPosProtonForTPC = kTRUE;\r
-\r
-    //Extra QA information\r
-    XiPx = xi->MomXiX();\r
-    XiPy = xi->MomXiY();\r
-    XiPz = xi->MomXiZ();\r
-    XiPt = TMath::Sqrt(XiPx*XiPx + XiPy*XiPy);\r
-    XiPtot= TMath::Sqrt(XiPx*XiPx + XiPy*XiPy + XiPz*XiPz);\r
-    \r
-    bachPx = xi->MomBachX();\r
-    bachPy = xi->MomBachY();\r
-    bachPz = xi->MomBachZ();\r
-    \r
-    bachPt = TMath::Sqrt(bachPx*bachPx + bachPy*bachPy);\r
-    bachPtot = TMath::Sqrt(bachPx*bachPx + bachPy*bachPy + bachPz*bachPz);\r
-  \r
-    V0toXiCosOfPointingAngle = xi->CosPointingAngle( xi->GetDecayVertexXi() );\r
-    \r
-    rapXi = xi->RapXi();\r
-    rapOmega = xi->RapOmega();\r
-    phi = xi->Phi();\r
-    alphaXi = xi->AlphaXi();\r
-    ptArmXi = xi->PtArmXi();\r
-\r
-    distToVtxZBefore = posXi[2]-bestPrimaryVtxPos[2];\r
-    distToVtxXYBefore\r
-      = TMath::Sqrt((posXi[0] - bestPrimaryVtxPos[0])\r
-                    *(posXi[0] - bestPrimaryVtxPos[0])\r
-                    +(posXi[1] - bestPrimaryVtxPos[1])\r
-                    *(posXi[1] - bestPrimaryVtxPos[1]));\r
-\r
-\r
-    XiPAfter[0] = XiPx;\r
-    XiPAfter[1] = XiPy;\r
-    XiPAfter[2] = XiPz;\r
-    //propagation to the best primary vertex to determine the momentum\r
-    Propagate(bestPrimaryVtxPos, posXi, XiPAfter, b, xi->ChargeXi());\r
-    distToVtxZAfter = posXi[2] - bestPrimaryVtxPos[2];\r
-    distToVtxXYAfter = TMath::Sqrt((posXi[0] - bestPrimaryVtxPos[0])\r
-                                   *(posXi[0] - bestPrimaryVtxPos[0])\r
-                                   +(posXi[1] - bestPrimaryVtxPos[1])\r
-                                   *(posXi[1] - bestPrimaryVtxPos[1]));\r
-    phiAfter = TMath::Pi() + TMath::ATan2(-XiPAfter[1],-XiPAfter[0]);\r
-\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxZAfter"))->Fill(distToVtxZAfter);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxXYAfter"))->Fill(distToVtxXYAfter);\r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxZBeforeVsAfter"))->Fill(distToVtxZBefore, distToVtxZAfter);\r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxXYBeforeVsAfter"))->Fill(distToVtxXYBefore, distToVtxXYAfter);\r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PxBeforeVsAfter"))->Fill(XiPx, XiPAfter[0]);\r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PyBeforeVsAfter"))->Fill(XiPy, XiPAfter[1]);\r
-    if(xi->ChargeXi()>0)\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PhiPosBeforeVsAfter"))->Fill(phi, phiAfter);\r
-    else if(xi->ChargeXi()<0)\r
-      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PhiNegBeforeVsAfter"))->Fill(phi, phiAfter);\r
-    \r
-    //for default hypothesis\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("Chi2Xi"))->Fill(chi2Xi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaXiDaughters"))->Fill(dcaXiDaughters);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaBachToPrimVertex"))->Fill(dcaBachToPrimaryVtxXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("XiCosOfPointingAngle"))->Fill(XiCosOfPointingAngle);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("XiRadius"))->Fill(XiRadius);\r
-    \r
-    //V0\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassLambdaAsCascDghter"))->Fill(invMassLambdaAsCascDghter);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0Chi2Xi"))->Fill(V0Chi2Xi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaV0DaughtersXi"))->Fill(dcaV0DaughtersXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0CosOfPointingAngleXi"))->Fill(V0CosOfPointingAngleXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0RadiusXi"))->Fill(V0RadiusXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaV0ToPrimVertexXi"))->Fill(dcaV0ToPrimaryVtxXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaPosToPrimVertexXi"))->Fill(dcaPosToPrimaryVtxXi);\r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaNegToPrimVertexXi"))->Fill(dcaNegToPrimaryVtxXi);\r
-    \r
-    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0toXiCosOfPointingAngle"))->Fill(V0toXiCosOfPointingAngle);\r
-    \r
-    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("Armenteros"))->Fill(alphaXi, ptArmXi);\r
-  \r
-    //with PID cuts\r
-    if(xi->ChargeXi()<0){\r
-      if(isPosProtonForTPC && isNegPionForTPC){\r
-       switch (fSpecie){\r
-       case 0:\r
-         if( isBachelorPionForTPC && TMath::Abs(rapXi) < 0.8){\r
-           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassXiMinus);\r
-           MakeTrack(invMassXiMinus, XiPt, /*xi->Phi(),*/\r
-                     phiAfter, xi->Eta(), \r
-                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());\r
-         }// endif\r
-      \r
-         break;\r
-\r
-       case 1:\r
-         if(isBachelorKaonForTPC && TMath::Abs(rapOmega) < 0.8\r
-            && (invMassXiMinus > 1.32486 || invMassXiMinus < 1.30486)){\r
-           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassOmegaMinus);      \r
-           \r
-           MakeTrack(invMassOmegaMinus, XiPt, /* xi->Phi(),*/\r
-                     phiAfter,   xi->Eta(),\r
-                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());\r
-         }//endif\r
-         break;\r
-       }\r
-      }\r
-    }//end if ChargeXi()<0\r
-    \r
-    if(xi->ChargeXi() > 0){\r
-      if(isNegProtonForTPC && isPosPionForTPC){ \r
-       switch(fSpecie){\r
-       case 0:\r
-         if (isBachelorPionForTPC  && TMath::Abs(rapXi) < 0.8){\r
-           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassXiPlus);\r
-         \r
-           //candidate inserting                                              \r
-           MakeTrack(invMassXiPlus, XiPt, /* xi->Phi(),*/\r
-                     phiAfter, xi->Eta(),\r
-                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());\r
-         }//endif particle id\r
-         break;\r
-         \r
-       case 1:\r
-         if(isBachelorKaonForTPC && TMath::Abs(rapOmega) < 0.8\r
-            && (invMassXiPlus > 1.32486 || invMassXiPlus < 1.30486)){\r
-           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassOmegaPlus);\r
-           MakeTrack(invMassOmegaPlus, XiPt, /* xi->Phi(),*/\r
-                     phiAfter, xi->Eta(),\r
-                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());\r
-         }//endif particle id\r
-       }\r
-      }\r
-    }//endif ChargeXi()>0  \r
-  }//for Xi candidate loop\r
-\r
-  return;\r
-\r
-}\r
-\r
-\r
-void AliAnalysisTaskFlowCascade::MakeTrack( double mass, \r
-                                           double pt, \r
-                                           double phi, \r
-                                           double eta, \r
-                                           int iid, \r
-                                           int jid,\r
-                                           int kid) {\r
-  // create track for flow tasks        \r
-  if(fCandidates->GetLast()+1>=fCandidates->GetSize()) {\r
-    fCandidates->Expand( 2*fCandidates->GetSize() );\r
-  }\r
-  Bool_t overwrite = kTRUE;\r
-\r
-  AliFlowCandidateTrack *sTrack \r
-    = (static_cast<AliFlowCandidateTrack*> (fCandidates->At( fCandidates->GetLast()+1 )));\r
-  if( !sTrack ) { // creates new\r
-    sTrack = new AliFlowCandidateTrack();\r
-    overwrite = kFALSE;\r
-  } else { // overwrites\r
-    sTrack->ClearMe();\r
-  }\r
-\r
-\r
-  sTrack->SetMass(mass);\r
-  sTrack->SetPt(pt);\r
-  sTrack->SetPhi(phi);\r
-  sTrack->SetEta(eta);\r
-  sTrack->AddDaughter(iid);\r
-  sTrack->AddDaughter(jid);\r
-  sTrack->AddDaughter(kid);\r
-  sTrack->SetForPOISelection(kTRUE);\r
-  sTrack->SetForRPSelection(kFALSE);\r
\r
-  if(overwrite) {\r
-    fCandidates->SetLast( fCandidates->GetLast()+1 );\r
-  } else {\r
-    fCandidates->AddLast(sTrack);\r
-  }\r
-  \r
-  return;\r
-}\r
-//_____________________________________________________________________________\r
-void AliAnalysisTaskFlowCascade::Terminate(Option_t *)\r
-{\r
-\r
-}\r
-\r
-void AliAnalysisTaskFlowCascade::Propagate(Double_t vv[3], \r
-                                          Double_t x[3], \r
-                                          Double_t p[3], \r
-                                          Double_t bz, \r
-                                          Short_t sign){\r
-  //Propagation to the primary vertex to determine the px and py\r
-  //x, p are the position and momentum as input and output\r
-  //bz is the magnetic field along z direction\r
-  //sign is the charge of particle for propagation\r
-\r
-  Double_t pp = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);\r
-  Double_t len = (vv[2]-x[2])*pp/p[2];\r
-  Double_t a = -kB2C*bz*sign;  \r
-\r
-  Double_t rho = a/pp;\r
-  x[0] += p[0]*TMath::Sin(rho*len)/a - p[1]*(1-TMath::Cos(rho*len))/a;\r
-  x[1] += p[1]*TMath::Sin(rho*len)/a + p[0]*(1-TMath::Cos(rho*len))/a;\r
-  x[2] += p[2]*len/pp;\r
-\r
-  Double_t p0=p[0];\r
-  p[0] = p0  *TMath::Cos(rho*len) - p[1]*TMath::Sin(rho*len);\r
-  p[1] = p[1]*TMath::Cos(rho*len) + p0  *TMath::Sin(rho*len);\r
-}\r
-\r
-\r
-//=====================================================================       \r
-void AliAnalysisTaskFlowCascade::SetCommonConstants(Int_t massBins, \r
-                                                   Double_t minMass, \r
-                                                   Double_t maxMass)\r
-{\r
-  // setter for mass bins                          \r
-                          \r
-  fMassBins = massBins;\r
-  fMinMass = minMass;\r
-  fMaxMass = maxMass;\r
-}\r
-\r
-\r
-//====================================================================         \r
-void AliAnalysisTaskFlowCascade::SetCuts2010(int set) {\r
-\r
-  // fCascadeCuts[0]: DcaXiDaughter; fCascadeCuts[1]: XiCosOfPointingAngle\r
-  // fCascadeCuts[2]: DcaV0ToPrimaryVtxXi; fCascadeCuts[3]: DcaBachToPrimaryVtxXi\r
-  // fCascadeCuts[4]: DcaV0DaughersXi; fCascadeCuts[5]: V0CosOfPointingAngleXi\r
-  // fCascadeCuts[6]: DcaV0DaughterToPrimaryVtxXi; fCascadeCuts[7]: V0MassWidth\r
-  \r
-  switch(set){\r
-  \r
-  case 0: //tighter\r
-    fCascadeCuts[0] = 0.2; fCascadeCuts[1] = 0.999;\r
-    fCascadeCuts[2] = 0.03; fCascadeCuts[3] = 0.05;\r
-    fCascadeCuts[4] = .5; fCascadeCuts[5] = 0.9998;\r
-    fCascadeCuts[6] = 0.1; fCascadeCuts[7] = 0.006;\r
-    break;\r
-    \r
-  case 1: //middle\r
-    fCascadeCuts[0] = 0.3; fCascadeCuts[1] = 0.99;\r
-    fCascadeCuts[2] = 0.01; fCascadeCuts[3] = 0.03;\r
-    fCascadeCuts[4] = .6; fCascadeCuts[5] = 0.9999;\r
-    fCascadeCuts[6] = 0.1; fCascadeCuts[7] = 0.008;\r
-    break;\r
-\r
-  case 2: //looser\r
-    fCascadeCuts[0] = 0.3; fCascadeCuts[1] = 0.99;\r
-    fCascadeCuts[2] = 0.01; fCascadeCuts[3] = 0.03;\r
-    fCascadeCuts[4] = 1.; fCascadeCuts[5] = 1.;\r
-    fCascadeCuts[6] = 0.1; fCascadeCuts[7] = 0.01;\r
-    break;\r
-  }\r
-  \r
-}\r
+/**************************************************************************
+* Copyright(c) 1998-2008,ALICE Experiment at CERN,All rights reserved.    *
+*                                                                         *
+* Author: The ALICE Off-line Project.                                     *
+* Contributors are mentioned in the code where appropriate.               *
+*                                                                         *
+* Permission to use,copy,modify and distribute this software and its      *
+* documentation strictly for non-commercial purposes is hereby granted    *
+* without fee,provided that the above copyright notice appears in all     *
+* copies and that both the copyright notice and this permission notice    *
+* appear in the supporting documentation. The authors make no claims      *
+* about the suitability of this software for any purpose. It is           *
+* provided "as is" without express or implied warranty.                   *
+**************************************************************************/
+
+/////////////////////////////////////////////////////
+// AliAnalysisTaskFlowCascade:
+// Analysis task to select Xi and Omega candidates for flow analysis.
+//
+// Author: Zhong-Bao.Yin@cern.ch
+//////////////////////////////////////////////////////
+
+#include "TChain.h"
+#include "TList.h"
+#include "TH1D.h"
+#include "TH2D.h"
+#include "TH3D.h"
+#include "TProfile.h"
+#include "TVector3.h"
+
+#include "AliAnalysisTaskSE.h"
+#include "AliAnalysisManager.h"
+
+#include "AliVParticle.h"
+#include "AliESDEvent.h"
+#include "AliESDInputHandler.h"
+#include "AliESDv0.h"
+#include "AliESDcascade.h"
+#include "AliESDtrack.h"
+#include "AliESDtrackCuts.h"
+#include "AliCentrality.h"
+#include "AliVVertex.h"
+#include "AliESDVZERO.h"
+#include "AliESDUtils.h"
+
+#include "AliTPCPIDResponse.h"
+#include "AliTOFPIDResponse.h"
+#include "AliPIDResponse.h"
+
+#include "AliAODEvent.h"
+#include "AliAODInputHandler.h"
+#include "AliAODTrack.h"
+#include "AliAODVZERO.h"
+#include "AliAODcascade.h"
+
+#include "TMath.h"
+#include "TObjArray.h"
+#include "AliFlowCandidateTrack.h"
+
+#include "AliFlowTrackCuts.h"
+#include "AliFlowEventCuts.h"
+#include "AliFlowEvent.h"
+#include "AliFlowCommonConstants.h"
+
+#include "AliAnalysisTaskFlowCascade.h"
+
+ClassImp(AliAnalysisTaskFlowCascade)
+
+//_____________________________________________________________________________
+  AliAnalysisTaskFlowCascade::AliAnalysisTaskFlowCascade() :
+    AliAnalysisTaskSE(),
+    //    fMinCent(0), fMaxCent(0),
+    fSpecie(0),
+    fMassBins(0),
+    fMinMass(0.0),
+    fMaxMass(0.0),
+    fCutsEvent(NULL),
+    fCutsRPTPC(NULL),
+    fCutsRPVZE(NULL),
+    fCutsPOI(NULL),
+    fCutsDau(NULL),
+    fPIDResponse(NULL),
+    fFlowEventTPC(NULL),
+    fFlowEventVZE(NULL),
+    fCandidates(NULL),
+    fQAList(NULL)
+{
+  //ctor                                                                       
+  for (Int_t i=0; i!=8; ++i)
+    fCascadeCuts[i] = 0;
+  
+}
+
+//_____________________________________________________________________________
+AliAnalysisTaskFlowCascade
+::AliAnalysisTaskFlowCascade(const char *name,
+                            AliFlowEventCuts *cutsEvent, 
+                            AliFlowTrackCuts *cutsRPTPC,
+                            AliFlowTrackCuts *cutsRPVZE,
+                            /* AliESDtrackCuts */ AliFlowTrackCuts *cutsDau ) :
+  AliAnalysisTaskSE(name),
+  //fMinCent(minCent), fMaxCent(maxCent),
+  fSpecie(0),
+  fMassBins(0),
+  fMinMass(0.0),
+  fMaxMass(0.0),
+  fCutsEvent(cutsEvent),
+  fCutsRPTPC(cutsRPTPC),
+  fCutsRPVZE(cutsRPVZE),
+  fCutsPOI(NULL),
+  fCutsDau(cutsDau),
+  fPIDResponse(NULL),
+  fFlowEventTPC(NULL),
+  fFlowEventVZE(NULL),
+  fCandidates(NULL),
+  fQAList(NULL)
+{
+  //ctor                                                                       
+  for (Int_t i=0; i!=8; ++i)
+    fCascadeCuts[i] = 0;
+
+  DefineInput( 0,TChain::Class());
+  DefineOutput(1,AliFlowEventSimple::Class()); // TPC object
+  DefineOutput(2,AliFlowEventSimple::Class()); // VZE object
+  DefineOutput(3,TList::Class());
+}
+
+//_____________________________________________________________________________
+AliAnalysisTaskFlowCascade::~AliAnalysisTaskFlowCascade()
+{
+  if(fQAList) delete fQAList;
+  if (fFlowEventTPC) delete fFlowEventTPC;
+  if (fFlowEventVZE) delete fFlowEventVZE;
+  if (fCandidates)   delete fCandidates;
+  if (fCutsDau)      delete fCutsDau;
+  if (fCutsPOI)      delete fCutsPOI;
+  if (fCutsRPTPC)   delete fCutsRPTPC;
+  if (fCutsRPVZE)   delete fCutsRPVZE;
+}
+
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowCascade::UserCreateOutputObjects()
+{
+
+  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
+  AliInputEventHandler* inputHandler
+    = (AliInputEventHandler*) (man->GetInputEventHandler());
+  fPIDResponse = inputHandler->GetPIDResponse();
+  
+  fQAList = new TList();
+  fQAList->SetOwner();
+  AddQAEvents();
+  AddQACandidates();
+  //  PostData(3,fQAList);
+
+  AliFlowCommonConstants* cc = AliFlowCommonConstants::GetMaster();
+  cc->SetNbinsMult(1);
+  cc->SetMultMin(0);
+  cc->SetMultMax(1);
+
+  cc->SetNbinsPt(20);
+  cc->SetPtMin(0.0);
+  cc->SetPtMax(10.0);
+
+  cc->SetNbinsPhi(1);
+  cc->SetPhiMin(0.0);
+  cc->SetPhiMax(TMath::TwoPi());
+
+  cc->SetNbinsEta(1);
+  cc->SetEtaMin(-2.0);
+  cc->SetEtaMax(+2.0);
+
+  cc->SetNbinsQ(3);
+  cc->SetQMin(0.0);
+  cc->SetQMax(3.0);
+
+  cc->SetNbinsMass(fMassBins);
+  cc->SetMassMin(fMinMass);
+  cc->SetMassMax(fMaxMass);
+
+  fCutsPOI = new AliFlowTrackCuts("null_cuts");
+  fCutsPOI->SetParamType(fCutsRPTPC->GetParamType());
+  fCutsPOI->SetPtRange(+1,-1); // select nothing QUICK   
+  fCutsPOI->SetEtaRange(+1,-1); // select nothing VZERO  
+
+  fFlowEventTPC = new AliFlowEvent(3000);
+  fFlowEventVZE = new AliFlowEvent(1000);
+  fCandidates = new TObjArray(100);
+  fCandidates->SetOwner();
+
+  PostData(1,fFlowEventTPC);
+  PostData(2,fFlowEventVZE);
+  PostData(3,fQAList);
+}
+
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowCascade::AddQAEvents()
+{
+  TList *tQAEvents = new TList();
+  tQAEvents->SetName("Events");
+  tQAEvents->SetOwner();
+  TH1I* tEvent = new TH1I("Event","Number of Events",   3,0,3);
+  tQAEvents->Add(tEvent);
+  
+  TH1D *tTPCRFP = new TH1D("RFPTPC",
+                          "TPC Reference Flow Particles;multiplicity",
+                          100, 0, 3000); 
+  tQAEvents->Add(tTPCRFP);
+  TH1D *tVZERFP = new TH1D("RFPVZE", 
+                          "VZERO Reference Flow Particles;multiplicity",
+                          100, 0, 30000); 
+  tQAEvents->Add(tVZERFP);
+
+  TProfile *tCuts = new TProfile("Cuts","Analysis Cuts",10,0,10);
+  tCuts->Fill(0.5,fCascadeCuts[0],1); 
+  tCuts->GetXaxis()->SetBinLabel(1,"dcaXiDau");
+  tCuts->Fill(1.5,fCascadeCuts[1],1); 
+  tCuts->GetXaxis()->SetBinLabel(2,"XiCPA");
+  tCuts->Fill(2.5,fCascadeCuts[2],1); 
+  tCuts->GetXaxis()->SetBinLabel(3,"dcaV0Vtx");
+  tCuts->Fill(3.5,fCascadeCuts[3],1); 
+  tCuts->GetXaxis()->SetBinLabel(4,"dcaBachVtx");
+  tCuts->Fill(4.5,fCascadeCuts[4],1); 
+  tCuts->GetXaxis()->SetBinLabel(5,"dcaV0Dau");
+  tCuts->Fill(5.5,fCascadeCuts[5],1); 
+  tCuts->GetXaxis()->SetBinLabel(6,"V0CPA");
+  tCuts->Fill(6.5,fCascadeCuts[6],1); 
+  tCuts->GetXaxis()->SetBinLabel(7,"dcaV0DauVtx");
+  tCuts->Fill(7.5,fCascadeCuts[7],1); 
+  tCuts->GetXaxis()->SetBinLabel(8,"V0Mass");
+  tQAEvents->Add(tCuts);
+
+  fQAList->Add(tQAEvents);
+}
+
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowCascade::AddQACandidates()
+{
+  TList *tQACandidates;
+  
+  tQACandidates = new TList();
+  tQACandidates->SetOwner();
+  tQACandidates->SetName("Candidates");
+
+  TH1F* tChi2Xi = new TH1F("Chi2Xi", 
+                      "Cascade #chi^{2}; #chi^{2}; Number of Cascades", 
+                      160, 0, 160);
+  tQACandidates->Add(tChi2Xi);
+
+  TH1F* tDCAXiDaughters 
+    = new TH1F( "DcaXiDaughters",  
+               "DCA between Xi Daughters; DCA (cm); Number of Cascades", 
+               100, 0., 0.5);
+  tQACandidates->Add(tDCAXiDaughters);
+
+  TH1F * tDCABachToPrimVertex
+    = new TH1F("DcaBachToPrimVertex", 
+              "DCA of Bach. to Prim. Vertex; DCA (cm);Number of Cascades", 
+              250, 0., 2.5);
+  tQACandidates->Add(tDCABachToPrimVertex);
+  
+  TH1F * tXiCosOfPointingAngle
+    = new TH1F("XiCosOfPointingAngle",
+              "Cos of Xi Pointing Angle; Cos (Xi Point.Angl);Number of Xis", 
+              200, 0.99, 1.0);
+  tQACandidates->Add(tXiCosOfPointingAngle);
+
+  TH1F * tXiRadius = new TH1F("XiRadius",  
+                             "Casc. decay transv. radius; r (cm); Counts" , 
+                             1050, 0., 105.0 );
+  tQACandidates->Add(tXiRadius);
+  
+  TH1F *tMassLambda 
+    = new TH1F("MassLambdaAsCascDghter",
+              "#Lambda assoc. to Casc. candidates; Eff. Mass (GeV/c^{2}); Counts", 
+              300,1.00,1.3);
+  tQACandidates->Add(tMassLambda);
+
+  TH1F *tV0Chi2 = new TH1F("V0Chi2Xi", 
+                      "V0 #chi^{2}, in cascade; #chi^{2};Counts", 
+                      160, 0, 40);
+  tQACandidates->Add(tV0Chi2);
+  
+  TH1F * tV0CosOfPointingAngle 
+    = new TH1F("V0CosOfPointingAngleXi", 
+              "Cos of V0 Pointing Angle, in cascade;Cos(V0 Point. Angl); Counts", 
+              200, 0.98, 1.0);
+  tQACandidates->Add(tV0CosOfPointingAngle);
+
+  TH1F *tV0Radius  = new TH1F("V0RadiusXi", 
+                         "V0 decay radius, in cascade; radius (cm); Counts", 
+                         1050, 0., 105.0);
+  tQACandidates->Add(tV0Radius);
+  
+  TH1F * tDcaV0DaughtersXi 
+    = new TH1F("DcaV0DaughtersXi", 
+              "DCA between V0 daughters, in cascade;DCA (cm);Number of V0s", 
+              120, 0., 0.6);
+  tQACandidates->Add(tDcaV0DaughtersXi);
+
+  TH1F * tDcaV0ToPrimVertex 
+    = new TH1F("DcaV0ToPrimVertexXi", 
+              "DCA of V0 to Prim. Vertex, in cascade;DCA (cm);Number of Cascades", 200, 0., 1.);
+  tQACandidates->Add(tDcaV0ToPrimVertex);
+
+  TH1F * tDCAPosToPrimVertex =
+    new TH1F("DcaPosToPrimVertexXi", 
+            "DCA of V0 pos daughter to Prim. Vertex;DCA (cm);Counts", 
+            300, 0, 3);
+  tQACandidates->Add(tDCAPosToPrimVertex);
+
+  TH1F * tDCANegToPrimVertex 
+    =  new TH1F("DcaNegToPrimVertexXi", 
+               "DCA of V0 neg daughter to Prim. Vertex;DCA (cm);Counts", 
+               300, 0, 3);
+  tQACandidates->Add(tDCANegToPrimVertex);
+
+  TH1F *tV0toXiCosOfPointingAngle 
+    = new TH1F("V0toXiCosOfPointingAngle", 
+              "Cos. of V0 Ptng Angl Xi vtx; Cos(V0 Point. Angl / Xi vtx); Counts", 
+              100, 0.99, 1.0);
+  tQACandidates->Add(tV0toXiCosOfPointingAngle);
+
+  TH2F *th2Armenteros 
+    = new TH2F("Armenteros", 
+              "#alpha_{Arm}(casc. cand.) Vs Pt_{Arm}(casc. cand.); #alpha_{Arm} ; Pt_{Arm} (GeV/c)", 
+              140, -1.2, 1.2, 300, 0., 0.3);
+  tQACandidates->Add(th2Armenteros);
+
+  TH2F *th2TPCdEdxOfCascDghters
+    = new TH2F( "TPCdEdxOfCascDghters",
+               "TPC dE/dx of the cascade daughters; charge x || #vec{p}_{TPC inner wall}(Casc. daughter) || (GeV/c); TPC signal (ADC) ", 
+               200, -10.0, 10.0, 450, 0., 900.);
+  tQACandidates->Add(th2TPCdEdxOfCascDghters);
+
+  TH2F *th2MassVsPtAll 
+    = new TH2F("MassVsPtAll", 
+              "M_{candidates} vs Pt; Pt (GeV/c); M (GeV/c^{2})", 
+              100, 0., 10., fMassBins, fMinMass, fMaxMass);
+  tQACandidates->Add(th2MassVsPtAll);
+
+  TH1F *tDistToVtxZAfter 
+    = new TH1F("DistToVtxZAfter", 
+              "Distance to vtx z after propagation to vtx; z [cm]", 
+              100, -5., 5.);
+  tQACandidates->Add(tDistToVtxZAfter);
+
+  TH1F * tDistToVtxXYAfter 
+    = new TH1F("DistToVtxXYAfter", 
+              "Distance to vtx xy after propagation to vtx",
+              500, 0., 50.);
+  tQACandidates->Add(tDistToVtxXYAfter);
+
+  TH2F *th2DistToVtxZBeforeVsAfter 
+    = new TH2F("DistToVtxZBeforeVsAfter", 
+              "Distance to vtx z before vs after propagation; Distance before [cm]; Distance after [cm]", 
+              500, -50., 50., 100, -5., 5.);
+  tQACandidates->Add(th2DistToVtxZBeforeVsAfter);
+
+  TH2F *th2DistToVtxXYBeforeVsAfter
+    = new TH2F("DistToVtxXYBeforeVsAfter",
+              "Distance to vtx xy before vs after propagation; Distance before [cm]; Distance after [cm]", 
+              500, 0., 50, 500, 0., 50);
+  tQACandidates->Add(th2DistToVtxXYBeforeVsAfter);
+
+  TH2F * th2PxBeforeVsAfter 
+    = new TH2F("PxBeforeVsAfter", 
+              "Px before vs after propagation; Px [GeV/c]; Px' [GeV/c]", 
+              200, -10., 10, 200, -10., 10.);
+  tQACandidates->Add(th2PxBeforeVsAfter);
+
+  TH2F * th2PyBeforeVsAfter
+    = new TH2F("PyBeforeVsAfter",
+               "Py before vs after propagation; Py [GeV/c]; Py' [GeV/c]",
+               200, -10., 10, 200, -10., 10.);
+  tQACandidates->Add(th2PyBeforeVsAfter);
+  
+  TH2F * th2PhiPosBeforeVsAfter
+    = new TH2F("PhiPosBeforeVsAfter", 
+              "Phi for positively charged candidates before vs after propagation; #phi; #phi'", 
+              360, 0., 2.0*TMath::Pi(), 360, 0., 2.0*TMath::Pi());
+  tQACandidates->Add(th2PhiPosBeforeVsAfter);
+
+  TH2F *th2PhiNegBeforeVsAfter
+    = new TH2F("PhiNegBeforeVsAfter",
+               "Phi for negatively charged candidates before vs after propagation; #phi; #phi'",
+               360, 0., 2.0*TMath::Pi(), 360, 0., 2.0*TMath::Pi());
+  tQACandidates->Add(th2PhiNegBeforeVsAfter);
+
+  fQAList->Add(tQACandidates);
+}
+
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowCascade::NotifyRun()
+{
+}
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowCascade::UserExec(Option_t *)
+{
+  AliESDEvent *fESD = dynamic_cast<AliESDEvent*>(InputEvent());
+  AliAODEvent *fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
+  Bool_t acceptEvent=kFALSE; 
+  fCandidates->SetLast(-1);
+
+  if(fESD) {
+    // recorrecting VZERO (for pass 1 only)
+    /*
+    Float_t *vChCorr = new Float_t[64];
+    Float_t dummy;
+    AliESDUtils::GetCorrV0(fESD,dummy,NULL,vChCorr);
+    AliESDVZERO *vzero = (AliESDVZERO*) fESD->GetVZEROData();
+    vzero->SetMultiplicity( vChCorr );
+    delete [] vChCorr;
+    */
+    //
+
+    ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(0);
+    
+    const AliVVertex *vtxGlb = fESD->GetPrimaryVertexTracks();
+    const AliVVertex *vtxSPD = fESD->GetPrimaryVertexSPD();
+    if(!vtxGlb || !vtxSPD) return;
+    if( fCutsEvent->IsSelected(fESD, 0) && (TMath::Abs(vtxSPD->GetZ()-vtxGlb->GetZ()) <= 0.5) ) {
+      acceptEvent = kTRUE;
+    ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(2);
+      ReadFromESDv0(fESD);
+    }
+  } else if(fAOD) {
+    const AliVVertex *vtxGlb = fAOD->GetPrimaryVertex();
+    const AliVVertex *vtxSPD = fAOD->GetPrimaryVertexSPD();
+    if(!vtxGlb || !vtxSPD) return;
+
+    ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(0);
+        
+    if(fCutsEvent->IsSelected(fAOD, 0) && (TMath::Abs(vtxSPD->GetZ()-vtxGlb->GetZ()) <= 0.5) ) {
+      acceptEvent = kTRUE;
+      ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(2);
+      ReadFromAODv0(fAOD);
+    }
+
+    
+    /*
+
+    AliAODHeader *aodHeader = fAOD->GetHeader();
+    if(!aodHeader) return;
+    AliCentrality *centrality = aodHeader->GetCentralityP();
+    if(!centrality) return;
+    Double_t cent = centrality->GetCentralityPercentile("V0M" );
+    Double_t cent1 = centrality->GetCentralityPercentile("TRK" );
+    if(TMath::Abs(cent-cent1) >= 5.) return;
+    
+    if(cent<fMinCent||cent>=fMaxCent) return; //centrality cut
+    
+    Double_t zvtx = fAOD->GetPrimaryVertex()->GetZ();
+    if(TMath::Abs(zvtx)>10.) return; //vertex cut
+    
+    ((TH1I*)((TList*)fQAList->FindObject("Events"))->FindObject("Event"))->Fill(2);
+    ReadFromAODv0(fAOD);
+    */  
+  }
+  
+  if(!acceptEvent) return;
+
+  ((TH1D*)((TList*)fQAList->FindObject("Events"))->FindObject("RFPTPC"))
+    ->Fill(fFlowEventTPC->GetNumberOfRPs() );
+  Double_t mult=0;
+  for(Int_t i=0; i != fFlowEventVZE->GetNumberOfRPs(); ++i) {
+    AliFlowTrackSimple *pTrack = fFlowEventVZE->GetTrack(i);
+    mult += pTrack->Weight();
+  }
+  ((TH1D*)((TList*)fQAList->FindObject("Events"))->FindObject("RFPVZE"))
+    ->Fill( mult );
+
+  //  if(fDebug) printf("TPCevent %d | VZEevent %d\n",
+  //                  fFlowEventTPC->NumberOfTracks(),
+  //                  fFlowEventVZE->NumberOfTracks() );
+  AddCandidates();
+
+  PostData(1,fFlowEventTPC);
+  PostData(2,fFlowEventVZE);
+  PostData(3,fQAList);
+
+  return;
+}
+
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowCascade::AddCandidates(){
+  
+  //  if(fDebug) printf("I received %d candidates\n",
+  //               fCandidates->GetEntriesFast());
+  for(int iCand=0; iCand!=fCandidates->GetEntriesFast(); ++iCand ) {
+    AliFlowCandidateTrack *cand 
+      = dynamic_cast<AliFlowCandidateTrack*>(fCandidates->At(iCand));
+    if(!cand) continue;
+    // if(fDebug) 
+    //  printf(" >Checking at candidate %d with %d daughters: mass %f\n",
+    //      iCand, cand->GetNDaughters(), cand->Mass());
+    
+    // untagging ===>                      
+    for(int iDau=0; iDau != cand->GetNDaughters(); ++iDau) {
+      // if(fDebug) 
+      // printf(" >Daughter %d with fID %d", iDau, cand->GetIDDaughter(iDau));
+      for(int iRPs=0; iRPs != fFlowEventTPC->NumberOfTracks(); ++iRPs ) {
+        AliFlowTrack *iRP 
+         = dynamic_cast<AliFlowTrack*>(fFlowEventTPC->GetTrack( iRPs ));
+        if (!iRP) continue;
+        if( !iRP->InRPSelection() ) continue;
+        if( cand->GetIDDaughter(iDau) == iRP->GetID() ) {
+          //if(fDebug) printf(" was in RP set");
+          iRP->SetForRPSelection(kFALSE);
+          fFlowEventTPC->SetNumberOfRPs( fFlowEventTPC->GetNumberOfRPs() -1 );
+        }
+      }
+      //if(fDebug) printf("\n");
+    }
+    // <=== untagging
+    cand->SetForPOISelection(kTRUE);
+    fFlowEventTPC->InsertTrack( ((AliFlowTrack*) cand) );
+    fFlowEventVZE->InsertTrack( ((AliFlowTrack*) cand) );
+  }
+
+  //  if(fDebug) printf("TPCevent %d | VZEevent %d\n",
+  //                fFlowEventTPC->NumberOfTracks(),
+  //                fFlowEventVZE->NumberOfTracks() );
+
+}
+
+//______________________________________________________________________________
+void AliAnalysisTaskFlowCascade::ReadFromESDv0(AliESDEvent *fESD)
+{
+  //AliFlowTrackCuts* cutsPOI = new AliFlowTrackCuts("null_cuts");
+  //cutsPOI->SetParamType( fCutsRP->GetParamType() );
+  //cutsPOI->SetParamType( AliFlowTrackCuts::kGlobal );
+  // cutsPOI->SetPtRange(+1,-1); // select nothing
+  //cutsPOI->SetEtaRange(+1,-1); // select nothing VZERO
+
+  fCutsRPTPC->SetEvent(fESD,MCEvent());
+  fCutsRPVZE->SetEvent(fESD,MCEvent());
+
+  fCutsPOI->SetEvent(fESD,MCEvent());
+
+  fFlowEventTPC->Fill(fCutsRPTPC,fCutsPOI);
+  fFlowEventVZE->Fill(fCutsRPVZE,fCutsPOI);
+  
+  Double_t trkPrimaryVtxPos[3] = {-100., -100., -100.};
+  Double_t bestPrimaryVtxPos[3] = {-100., -100., -100.};
+  int nCascades=fESD->GetNumberOfCascades();
+  
+  const AliESDVertex *primaryTrackingESDVtx = fESD->GetPrimaryVertexTracks();
+  primaryTrackingESDVtx->GetXYZ(trkPrimaryVtxPos);
+  
+  const AliESDVertex *primaryBestESDVtx = fESD->GetPrimaryVertex();
+  primaryBestESDVtx->GetXYZ(bestPrimaryVtxPos);
+
+  Double_t b = fESD->GetMagneticField();
+
+  for(int i = 0; i != nCascades; ++i) {
+    
+    // Double_t trkPrimaryVtxRadius3D = -500.;
+    // Double_t bestPrimaryVtxRadius3D = -500.;
+    Double_t effMassXi = 0.;
+    Double_t chi2Xi = -1.;
+    Double_t dcaXiDaughters = -1.;
+    Double_t XiCosOfPointingAngle = -1.;
+    Double_t posXi[3] = {-1000., -1000., -1000.};
+    Double_t XiRadius = -1000.;
+
+    // Double_t innerWallMomCascDghters[3] = {-100., -100., -100.};
+    //Double_t tpcSignalCascDghters[3] = {-100., -100., -100.};
+
+    Double_t invMassLambdaAsCascDghter = 0.;
+    Double_t V0Chi2Xi = -1.;
+    Double_t dcaV0DaughtersXi = -1.;
+    
+    Double_t dcaBachToPrimaryVtxXi = -1.;
+    Double_t dcaV0ToPrimaryVtxXi = -1.;
+    Double_t dcaPosToPrimaryVtxXi = -1.;
+    Double_t dcaNegToPrimaryVtxXi = -1.;
+    Double_t V0CosOfPointingAngleXi = -1.;
+    Double_t posV0Xi[3] = {-1000., -1000., -1000.};
+    Double_t V0RadiusXi = -1000.;
+    Double_t V0quality = 0.;
+
+    Double_t invMassXiMinus = 0.;
+    Double_t invMassXiPlus = 0.;
+    Double_t invMassOmegaMinus = 0.;
+    Double_t invMassOmegaPlus = 0.;
+
+    /*
+    Bool_t isPosInXiProton = kFALSE;
+    Bool_t isPosInXiPion = kFALSE;
+    Bool_t isPosInOmegaProton = kFALSE;
+    Bool_t isPosInOmegaPion = kFALSE;
+    
+    Bool_t isNegInXiProton = kFALSE;
+    Bool_t isNegInXiPion = kFALSE;
+    Bool_t isNegInOmegaProton = kFALSE;
+    Bool_t isNegInOmegaPion = kFALSE;
+
+    Bool_t isBachelorKaon = kFALSE;
+    Bool_t isBachelorPion = kFALSE;
+    */
+
+    Bool_t isBachelorKaonForTPC = kFALSE;
+    Bool_t isBachelorPionForTPC = kFALSE;
+    Bool_t isNegPionForTPC = kFALSE;
+    Bool_t isPosPionForTPC = kFALSE;
+    Bool_t isNegProtonForTPC = kFALSE;
+    Bool_t isPosProtonForTPC = kFALSE;
+
+    Double_t XiPx = 0., XiPy = 0., XiPz = 0.;
+    Double_t XiPt = 0.;
+    Double_t XiPtot = 0.;
+    
+    Double_t bachPx = 0., bachPy = 0., bachPz = 0.;
+    Double_t bachPt = 0.;
+    Double_t bachPtot = 0.;
+    
+    //Short_t chargeXi = -2;
+    Double_t V0toXiCosOfPointingAngle = 0.;
+    
+    Double_t rapXi = -20.;
+    Double_t rapOmega = -20.;
+    Double_t phi = 6.3;
+    Double_t alphaXi = -200.;
+    Double_t ptArmXi = -200.;
+    //    TLorentzVector lv1, lv2, lv3, lv12, lvXi;
+
+    Double_t distToVtxZBefore = -999.;
+    Double_t distToVtxZAfter = -999.;
+    Double_t distToVtxXYBefore = -999.;
+    Double_t distToVtxXYAfter = -999.;
+    Double_t XiPAfter[3] = {-999., -999., -999.};
+    Double_t phiAfter = -999.;
+    
+    AliESDcascade *xi = fESD->GetCascade(i);
+    if(!xi) continue;
+    
+    if(xi->Charge()<0)
+      xi->ChangeMassHypothesis(V0quality, 3312); // Xi- hypothesis
+    else if(xi->Charge() > 0)
+      xi->ChangeMassHypothesis(V0quality, -3312);
+    else continue;
+
+    effMassXi = xi->GetEffMassXi();
+    chi2Xi = xi->GetChi2Xi();
+    dcaXiDaughters = xi->GetDcaXiDaughters();
+    XiCosOfPointingAngle 
+      = xi->GetCascadeCosineOfPointingAngle(bestPrimaryVtxPos[0],
+                                           bestPrimaryVtxPos[1],
+                                           bestPrimaryVtxPos[2]);
+    xi->GetXYZcascade(posXi[0], posXi[1], posXi[2]);
+    XiRadius = TMath::Sqrt(posXi[0]*posXi[0]
+                          +posXi[1]*posXi[1]
+                          +posXi[2]*posXi[2]);
+    
+    UInt_t idxPosXi = (UInt_t)TMath::Abs(xi->GetPindex());
+    UInt_t idxNegXi = (UInt_t)TMath::Abs(xi->GetNindex());
+    UInt_t idxBach = (UInt_t)TMath::Abs(xi->GetBindex());
+
+    if(idxBach == idxPosXi || idxBach == idxNegXi) continue;
+
+    AliESDtrack *pTrkXi = fESD->GetTrack(idxPosXi);
+    AliESDtrack *nTrkXi = fESD->GetTrack(idxNegXi);
+    AliESDtrack *bTrkXi = fESD->GetTrack(idxBach);
+
+    if( !pTrkXi || !nTrkXi || !bTrkXi ) continue;
+
+    if( !fCutsDau->IsSelected(pTrkXi) 
+       || !fCutsDau->IsSelected(nTrkXi)
+       || !fCutsDau->IsSelected(bTrkXi) ) continue;
+
+    const AliExternalTrackParam *pExtTrk = pTrkXi->GetInnerParam();
+    const AliExternalTrackParam *nExtTrk = nTrkXi->GetInnerParam();
+    const AliExternalTrackParam *bExtTrk = bTrkXi->GetInnerParam();
+    
+    if(pExtTrk && pTrkXi->IsOn(AliESDtrack::kTPCin)){
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(pExtTrk->GetP()*pExtTrk->Charge(), pTrkXi->GetTPCsignal());
+    }
+    if(nExtTrk && nTrkXi->IsOn(AliESDtrack::kTPCin)){
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(nExtTrk->GetP()*nExtTrk->Charge(), nTrkXi->GetTPCsignal());
+    }
+    if(bExtTrk && bTrkXi->IsOn(AliESDtrack::kTPCin)){
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(bExtTrk->GetP()*bExtTrk->Charge(), bTrkXi->GetTPCsignal());
+    }
+    
+    invMassLambdaAsCascDghter = xi->GetEffMass(); // from V0
+    dcaV0DaughtersXi = xi->GetDcaV0Daughters();
+    V0Chi2Xi = xi->GetChi2V0();
+    V0CosOfPointingAngleXi 
+      = xi->GetV0CosineOfPointingAngle(bestPrimaryVtxPos[0],
+                                      bestPrimaryVtxPos[1],
+                                      bestPrimaryVtxPos[2]);
+    dcaV0ToPrimaryVtxXi = xi->GetD(bestPrimaryVtxPos[0], 
+                                  bestPrimaryVtxPos[1],
+                                  bestPrimaryVtxPos[2]);
+    dcaBachToPrimaryVtxXi = TMath::Abs(bTrkXi->GetD(bestPrimaryVtxPos[0],
+                                                   bestPrimaryVtxPos[1],
+                                                   bestPrimaryVtxPos[2]));
+    
+    //V0
+    xi->GetXYZ(posV0Xi[0], posV0Xi[1], posV0Xi[2]);
+    V0RadiusXi = TMath::Sqrt(posV0Xi[0]*posV0Xi[0]
+                            +posV0Xi[1]*posV0Xi[1]
+                            +posV0Xi[2]*posV0Xi[2]);
+    dcaPosToPrimaryVtxXi = TMath::Abs(pTrkXi->GetD(bestPrimaryVtxPos[0],
+                                                  bestPrimaryVtxPos[1],
+                                                  bestPrimaryVtxPos[2]));
+    dcaNegToPrimaryVtxXi = TMath::Abs(nTrkXi->GetD(bestPrimaryVtxPos[0],
+                                                  bestPrimaryVtxPos[1],
+                                                  bestPrimaryVtxPos[2]));
+
+    //apply cuts
+    //if(XiRadius < 0.9 || XiRadius > 100.) continue;
+    //if(dcaXiDaughters > 0.2) continue;
+    //if(XiCosOfPointingAngle < 0.99) continue;
+    //if(dcaV0ToPrimaryVtxXi < 0.03) continue;
+    //if(dcaBachToPrimaryVtxXi < 0.01) continue;
+    
+    if(dcaXiDaughters > fCascadeCuts[0]) continue;
+    if(XiCosOfPointingAngle < fCascadeCuts[1]) continue;
+    if(dcaV0ToPrimaryVtxXi < fCascadeCuts[2]) continue;
+    if(dcaBachToPrimaryVtxXi < fCascadeCuts[3]) continue;
+
+    //V0 mass cut?
+    //  if(TMath::Abs(invMassLambdaAsCascDghter-1.11568) > 0.01) continue;
+    if(TMath::Abs(invMassLambdaAsCascDghter-1.11568) > fCascadeCuts[7]) 
+      continue;
+    
+    //if(dcaV0DaughtersXi > 1.) continue;
+    //if(V0CosOfPointingAngleXi > 0.9999) continue;
+    //if(dcaPosToPrimaryVtxXi < 0.1) continue;
+    //if(dcaNegToPrimaryVtxXi < 0.1) continue;
+
+    if(dcaV0DaughtersXi > fCascadeCuts[4]) continue;
+    if(V0CosOfPointingAngleXi > fCascadeCuts[5]) continue;
+    if(dcaPosToPrimaryVtxXi < fCascadeCuts[6]) continue;
+    if(dcaNegToPrimaryVtxXi < fCascadeCuts[6]) continue;
+
+    //if(V0RadiusXi < 1.0 || V0RadiusXi > 100) continue;
+    
+    //other cuts?
+    // change mass hypothesis to cover all the possibilities
+    if(bTrkXi->Charge()<0){
+      V0quality = 0.;
+      xi->ChangeMassHypothesis(V0quality, 3312); //Xi- hyp.
+      invMassXiMinus = xi->GetEffMassXi();
+
+      V0quality = 0.;
+      xi->ChangeMassHypothesis(V0quality, 3334); //Omega- hyp.
+      invMassOmegaMinus = xi->GetEffMassXi();
+
+      V0quality = 0.;
+      xi->ChangeMassHypothesis(V0quality, 3312); //back to default hyp.
+    }
+
+    if(bTrkXi->Charge() > 0){
+      V0quality = 0.;
+      xi->ChangeMassHypothesis(V0quality, -3312); //anti-Xi- hyp.
+      invMassXiPlus = xi->GetEffMassXi();
+
+      V0quality = 0.;
+      xi->ChangeMassHypothesis(V0quality, -3334); //anti-Omega- hyp.
+      invMassOmegaPlus = xi->GetEffMassXi();
+
+      V0quality = 0.;
+      xi->ChangeMassHypothesis(V0quality, -3312); //back to default hyp.
+    }
+
+    //PID on the daughter tracks
+    /*
+    //A - Combined PID
+    //Resonable guess the priors for the cascade track sample
+    //(e, mu, pi, K, p)
+    Double_t priorsGuessXi[5] = {0, 0, 2, 0, 1};
+    Double_t priorsGuessOmega[5] = {0, 0, 1, 1, 1};
+
+    //Combined bachelor-daughter PID
+    AliPID pidXi;
+    pidXi.SetPriors(priorsGuessXi);
+    AliPID pidOmega;
+    pidOmega.SetPriors(priorsGuessOmega);
+
+    if(pTrkXi->IsOn(AliESDtrack::kESDpid)){// combined PID exists
+      Double_t r[10] = {0.};
+      pTrkXi->GetESDpid(r);
+      pidXi.SetProbabilities(r);
+      pidOmega.SetProbabilities(r);
+
+      //Check if the V0 postive track is proton (case for Xi-)
+      Double_t pProton = pidXi.GetProbability(AliPID::kProton);
+      if(pProton > pidXi.GetProbability(AliPID::kElectron)
+         && pProton > pidXi.GetProbability(AliPID::kMuon)
+         && pProton > pidXi.GetProbability(AliPID::kPion)
+         && pProton > pidXi.GetProbability(AliPID::kKaon))
+        isPosInXiProton = kTRUE;
+        
+      //Check if the V0 postive track is a pi+ (case for Xi+)
+      Double_t pPion = pidXi.GetProbability(AliPID::kPion);
+      if(pPion > pidXi.GetProbability(AliPID::kElectron)
+         && pPion > pidXi.GetProbability(AliPID::kMuon)
+         && pPion > pidXi.GetProbability(AliPID::kKaon)
+         && pPion > pidXi.GetProbability(AliPID::kProton))
+        isPosInXiPion = kTRUE;
+      // Check if the V0 positive track is a proton (case for Omega-)
+      pProton = pidOmega.GetProbability(AliPID::kProton);
+      if(pProton > pidOmega.GetProbability(AliPID::kElectron)
+         && pProton > pidOmega.GetProbability(AliPID::kMuon)
+         && pProton > pidOmega.GetProbability(AliPID::kPion)
+         && pProton > pidOmega.GetProbability(AliPID::kKaon))
+        isPosInOmegaProton = kTRUE;
+    
+      // Check if the V0 positive track is a pi+ (case for Omega+)
+      pPion =  pidOmega.GetProbability(AliPID::kPion);
+      if(pPion > pidOmega.GetProbability(AliPID::kElectron)
+         && pPion > pidOmega.GetProbability(AliPID::kMuon)
+         && pPion > pidOmega.GetProbability(AliPID::kKaon)
+         && pPion > pidOmega.GetProbability(AliPID::kProton))
+        isPosInOmegaPion = kTRUE;
+    }
+
+    //Combined V0-negative-daughter PID
+    pidXi.SetPriors(priorsGuessXi);
+    pidOmega.SetPriors(priorsGuessOmega);
+    if(nTrkXi->IsOn(AliESDtrack::kESDpid)){
+      Double_t r[10] = {0.};
+      nTrkXi->GetESDpid(r);
+      pidXi.SetProbabilities(r);
+      pidOmega.SetProbabilities(r);
+      
+      // Check if the V0 negative track is a pi- (case for Xi-)
+      Double_t pPion = pidXi.GetProbability(AliPID::kPion);
+      if(pPion > pidXi.GetProbability(AliPID::kElectron)
+         && pPion > pidXi.GetProbability(AliPID::kMuon)
+         && pPion >  pidXi.GetProbability(AliPID::kKaon)
+         && pPion > pidXi.GetProbability(AliPID::kProton))
+        isNegInXiPion = kTRUE;
+
+      // Check if the V0 negative track is an anti-proton (case for Xi+)
+      Double_t pProton = pidXi.GetProbability(AliPID::kProton);
+      if(pProton > pidXi.GetProbability(AliPID::kElectron)
+         && pProton > pidXi.GetProbability(AliPID::kMuon)
+         && pProton > pidXi.GetProbability(AliPID::kPion) 
+         && pProton > pidXi.GetProbability(AliPID::kKaon))
+        isNegInXiProton = kTRUE;
+      
+      // Check if the V0 negative track is a pi- (case for Omega-)
+      pPion = pidOmega.GetProbability(AliPID::kPion);
+      if(pPion > pidOmega.GetProbability(AliPID::kElectron)
+         && pPion > pidOmega.GetProbability(AliPID::kMuon)
+         && pPion > pidOmega.GetProbability(AliPID::kKaon)
+         && pPion > pidOmega.GetProbability(AliPID::kProton))
+        isNegInOmegaPion = kTRUE;
+      
+      // Check if the V0 negative track is an anti-proton (case for Omega+)   
+      pProton =  pidOmega.GetProbability(AliPID::kProton);
+      if(pProton > pidOmega.GetProbability(AliPID::kElectron)
+         && pProton > pidOmega.GetProbability(AliPID::kMuon)
+         && pProton > pidOmega.GetProbability(AliPID::kPion)
+         && pProton > pidOmega.GetProbability(AliPID::kKaon))
+        isNegInOmegaProton = kTRUE;
+      
+    }
+
+    // Combined bachelor PID
+    pidXi.SetPriors(priorsGuessXi);
+    pidOmega.SetPriors(priorsGuessOmega);
+    if(bTrkXi->IsOn(AliESDtrack::kESDpid)){//Combined PID exists
+      Double_t r[10] = {0.};
+      bTrkXi->GetESDpid(r);
+      pidXi.SetProbabilities(r);
+      pidOmega.SetProbabilities(r);
+      
+      //Check if the bachelor track is a pion
+      Double_t pPion = pidXi.GetProbability(AliPID::kPion);
+      if(pPion >  pidXi.GetProbability(AliPID::kElectron)
+        && pPion >  pidXi.GetProbability(AliPID::kMuon)
+        && pPion > pidXi.GetProbability(AliPID::kKaon)
+        && pPion > pidXi.GetProbability(AliPID::kProton))
+       isBachelorPion = kTRUE;
+      
+      // Check if the bachelor track is a kaon
+      Double_t pKaon = pidOmega.GetProbability(AliPID::kKaon);
+      if(pKaon > pidOmega.GetProbability(AliPID::kElectron)
+        && pKaon > pidOmega.GetProbability(AliPID::kMuon)
+        && pKaon > pidOmega.GetProbability(AliPID::kPion)
+        && pKaon > pidOmega.GetProbability(AliPID::kProton))
+       isBachelorKaon = kTRUE;
+    }
+    */
+
+
+    //B - TPC PID: 3-sigma bands on Bethe-Bloch curve
+    //Bachelor
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(bTrkXi, AliPID::kKaon))<3.)
+      isBachelorKaonForTPC = kTRUE;
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(bTrkXi, AliPID::kPion))<3.)
+      isBachelorPionForTPC = kTRUE;
+
+    //Negative V0 daughter
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(nTrkXi, AliPID::kPion))<3.)
+      isNegPionForTPC = kTRUE;
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(nTrkXi, AliPID::kProton))<3.)
+      isNegProtonForTPC = kTRUE;
+    
+    //Positive V0 daughter
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(pTrkXi, AliPID::kPion))<3.)
+      isPosPionForTPC = kTRUE;
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(pTrkXi, AliPID::kProton))<3.)
+      isPosProtonForTPC = kTRUE;
+   
+    //Extra QA information
+    xi->GetPxPyPz(XiPx, XiPy, XiPz);
+    XiPt = TMath::Sqrt(XiPx*XiPx + XiPy*XiPy);
+    XiPtot= TMath::Sqrt(XiPx*XiPx + XiPy*XiPy + XiPz*XiPz);
+    
+    XiPAfter[0] = XiPx;
+    XiPAfter[1] = XiPy;
+    XiPAfter[2] = XiPz;
+
+    xi->GetBPxPyPz(bachPx, bachPy, bachPz);
+    bachPt = TMath::Sqrt(bachPx*bachPx + bachPy*bachPy);
+    bachPtot = TMath::Sqrt(bachPx*bachPx + bachPy*bachPy + bachPz*bachPz);
+
+    //chargeXi = xi->Charge();
+    
+    V0toXiCosOfPointingAngle 
+      = xi->GetV0CosineOfPointingAngle(posXi[0], posXi[1], posXi[2]);
+    rapXi = xi->RapXi();
+    rapOmega = xi->RapOmega();
+    phi = xi->Phi();
+    alphaXi = xi->AlphaXi();
+    ptArmXi = xi->PtArmXi();
+
+    distToVtxZBefore = posXi[2]-bestPrimaryVtxPos[2];
+    distToVtxXYBefore 
+      = TMath::Sqrt((posXi[0] - bestPrimaryVtxPos[0])
+                   *(posXi[0] - bestPrimaryVtxPos[0])
+                   +(posXi[1] - bestPrimaryVtxPos[1])
+                    *(posXi[1] - bestPrimaryVtxPos[1]));
+    
+    //propagation to the best primary vertex to determine the momentum
+    Propagate(bestPrimaryVtxPos, posXi, XiPAfter, b, xi->Charge());
+    distToVtxZAfter = posXi[2] - bestPrimaryVtxPos[2];
+    distToVtxXYAfter = TMath::Sqrt((posXi[0] - bestPrimaryVtxPos[0])
+                                  *(posXi[0] - bestPrimaryVtxPos[0])
+                                  +(posXi[1] - bestPrimaryVtxPos[1])
+                                  *(posXi[1] - bestPrimaryVtxPos[1]));
+    phiAfter = TMath::Pi() + TMath::ATan2(-XiPAfter[1],-XiPAfter[0]);
+    
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxZAfter"))->Fill(distToVtxZAfter);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxXYAfter"))->Fill(distToVtxXYAfter);
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxZBeforeVsAfter"))->Fill(distToVtxZBefore, distToVtxZAfter);
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxXYBeforeVsAfter"))->Fill(distToVtxXYBefore, distToVtxXYAfter);
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PxBeforeVsAfter"))->Fill(XiPx, XiPAfter[0]);
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PyBeforeVsAfter"))->Fill(XiPy, XiPAfter[1]);
+    if(xi->Charge()>0)
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PhiPosBeforeVsAfter"))->Fill(phi, phiAfter);
+    else if(xi->Charge()<0)
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PhiNegBeforeVsAfter"))->Fill(phi, phiAfter);
+
+    
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("Chi2Xi"))->Fill(chi2Xi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaXiDaughters"))->Fill(dcaXiDaughters);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaBachToPrimVertex"))->Fill(dcaBachToPrimaryVtxXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("XiCosOfPointingAngle"))->Fill(XiCosOfPointingAngle);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("XiRadius"))->Fill(XiRadius);
+    
+    //V0
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassLambdaAsCascDghter"))->Fill(invMassLambdaAsCascDghter);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0Chi2Xi"))->Fill(V0Chi2Xi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaV0DaughtersXi"))->Fill(dcaV0DaughtersXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0CosOfPointingAngleXi"))->Fill(V0CosOfPointingAngleXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0RadiusXi"))->Fill(V0RadiusXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaV0ToPrimVertexXi"))->Fill(dcaV0ToPrimaryVtxXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaPosToPrimVertexXi"))->Fill(dcaPosToPrimaryVtxXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaNegToPrimVertexXi"))->Fill(dcaNegToPrimaryVtxXi);
+    
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0toXiCosOfPointingAngle"))->Fill(V0toXiCosOfPointingAngle);
+    
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("Armenteros"))->Fill(alphaXi, ptArmXi);
+  
+    //PID cuts with TPC cuts
+    if(xi->Charge() < 0){
+      if(isPosProtonForTPC
+         && isNegPionForTPC){
+       
+       switch(fSpecie) {
+       case 0:
+         if(isBachelorPionForTPC && TMath::Abs(rapXi) < 0.8){
+           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassXiMinus);
+         
+         //candidate inserting
+           MakeTrack(invMassXiMinus, XiPt, /*xi->Phi()*/
+                     phiAfter, xi->Eta(),  pTrkXi->GetID(),
+                     nTrkXi->GetID(), bTrkXi->GetID());
+         }
+         break;
+         
+       case 1:
+         if(isBachelorKaonForTPC && TMath::Abs(rapOmega) < 0.8){
+           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassOmegaMinus);
+           MakeTrack(invMassOmegaMinus, XiPt, /*xi->Phi()*/
+                     phiAfter, xi->Eta(),
+                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());
+         }
+         break;
+       }
+      }
+    }
+
+    if(xi->Charge() > 0){
+      if(isNegProtonForTPC
+         && isPosPionForTPC){
+       
+       switch (fSpecie){
+       case 0:
+         if(isBachelorPionForTPC && TMath::Abs(rapXi) < 0.8){
+           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassXiPlus);
+         
+         //candidate inserting                                              
+           MakeTrack(invMassXiPlus, XiPt, /*xi->Phi()*/
+                     phiAfter, xi->Eta(),
+                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());
+         }
+         break;
+
+       case 1:
+         if(isBachelorKaonForTPC && TMath::Abs(rapOmega) < 0.8){
+           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassOmegaPlus);
+           MakeTrack(invMassOmegaPlus, XiPt, /*xi->Phi()*/
+                     phiAfter, xi->Eta(),
+                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());
+         }
+         break;
+       }
+      }
+    }
+  
+  }
+
+  return;
+}
+
+//______________________________________________________________________________
+void AliAnalysisTaskFlowCascade::ReadFromAODv0(AliAODEvent *fAOD)
+{
+  
+  fCutsRPTPC->SetEvent(fAOD, MCEvent());
+  fCutsRPVZE->SetEvent(fAOD, MCEvent());
+  fCutsPOI->SetEvent(fAOD, MCEvent());
+  fFlowEventTPC->Fill(fCutsRPTPC, fCutsPOI);
+  fFlowEventVZE->Fill(fCutsRPVZE, fCutsPOI);
+
+  //  Double_t trkPrimaryVtxPos[3] = {-100., -100., -100.};
+  Double_t bestPrimaryVtxPos[3] = {-100., -100., -100.};
+
+  Double_t b = fAOD->GetMagneticField();
+
+  int nCascades=fAOD->GetNumberOfCascades();
+  const AliAODVertex *primaryBestAODVtx = fAOD->GetPrimaryVertex();
+  primaryBestAODVtx->GetXYZ(bestPrimaryVtxPos);
+  
+  // calculation part dedicated to Xi vertices
+  for(Int_t iXi = 0; iXi < nCascades; iXi++){
+    Double_t effMassXi = 0.;
+    Double_t chi2Xi = -1.;
+    Double_t dcaXiDaughters = -1.;
+    Double_t XiCosOfPointingAngle = -1.;
+    Double_t posXi[3] = {-1000., -1000., -1000.};
+    Double_t XiRadius = -1000.;
+    
+    Double_t invMassLambdaAsCascDghter = 0.;
+    Double_t V0Chi2Xi = -1.;
+    Double_t dcaV0DaughtersXi = -1.;
+    
+    Double_t dcaBachToPrimaryVtxXi = -1.;
+    Double_t dcaV0ToPrimaryVtxXi = -1.;
+    Double_t dcaPosToPrimaryVtxXi = -1.;
+    Double_t dcaNegToPrimaryVtxXi = -1.;
+    Double_t V0CosOfPointingAngleXi = -1.;
+    Double_t posV0Xi[3] = {-1000., -1000., -1000.};
+    Double_t V0RadiusXi = -1000.;
+    //    Double_t V0quality = 0.;
+
+    Double_t invMassXiMinus = 0.;
+    Double_t invMassXiPlus = 0.;
+    Double_t invMassOmegaMinus = 0.;
+    Double_t invMassOmegaPlus = 0.;
+    
+    /*
+    Bool_t isPosInXiProton = kFALSE;
+    Bool_t isPosInXiPion = kFALSE;
+    Bool_t isPosInOmegaProton = kFALSE;
+    Bool_t isPosInOmegaPion = kFALSE;
+    
+    Bool_t isNegInXiProton = kFALSE;
+    Bool_t isNegInXiPion = kFALSE;
+    Bool_t isNegInOmegaProton = kFALSE;
+    Bool_t isNegInOmegaPion = kFALSE;
+
+    Bool_t isBachelorKaon = kFALSE;
+    Bool_t isBachelorPion = kFALSE;
+    */
+
+
+    Bool_t isBachelorKaonForTPC = kFALSE;
+    Bool_t isBachelorPionForTPC = kFALSE;
+    Bool_t isNegPionForTPC = kFALSE;
+    Bool_t isPosPionForTPC = kFALSE;
+    Bool_t isNegProtonForTPC = kFALSE;
+    Bool_t isPosProtonForTPC = kFALSE;
+    
+    Double_t XiPx = 0., XiPy = 0., XiPz = 0.;
+    Double_t XiPt = 0.;
+    Double_t XiPtot = 0.;
+    
+    Double_t bachPx = 0., bachPy = 0., bachPz = 0.;
+    Double_t bachPt = 0.;
+    Double_t bachPtot = 0.;
+    
+    //Short_t chargeXi = -2;
+    Double_t V0toXiCosOfPointingAngle = 0.;
+    
+    Double_t rapXi = -20.;
+    Double_t rapOmega = -20.;
+    Double_t phi = 6.3;
+    Double_t alphaXi = -200.;
+    Double_t ptArmXi = -200.;
+
+    Double_t distToVtxZBefore = -999.;
+    Double_t distToVtxZAfter = -999.;
+    Double_t distToVtxXYBefore = -999.;
+    Double_t distToVtxXYAfter = -999.;
+    Double_t XiPAfter[3] = {-999., -999., -999.};
+    Double_t phiAfter = -999.;
+
+    const AliAODcascade *xi = fAOD->GetCascade(iXi);
+    if (!xi) continue;
+
+    effMassXi = xi->MassXi(); //default working hypothesis: Xi- decay
+    chi2Xi = xi->Chi2Xi();
+    dcaXiDaughters = xi->DcaXiDaughters();
+    XiCosOfPointingAngle = xi->CosPointingAngleXi(bestPrimaryVtxPos[0],
+                                                 bestPrimaryVtxPos[1],
+                                                 bestPrimaryVtxPos[2]);
+    posXi[0] = xi->DecayVertexXiX();
+    posXi[1] = xi->DecayVertexXiY();
+    posXi[2] = xi->DecayVertexXiZ();
+    XiRadius = TMath::Sqrt(posXi[0]*posXi[0]
+                           +posXi[1]*posXi[1]
+                           +posXi[2]*posXi[2]);
+
+    AliAODTrack *pTrkXi = dynamic_cast<AliAODTrack*>( xi->GetDaughter(0) );
+    AliAODTrack *nTrkXi = dynamic_cast<AliAODTrack*>( xi->GetDaughter(1) );
+    AliAODTrack *bTrkXi 
+      = dynamic_cast<AliAODTrack*>( xi->GetDecayVertexXi()->GetDaughter(0) );
+
+    if(!pTrkXi || !nTrkXi || !bTrkXi) continue;
+
+    UInt_t idxPosXi  = (UInt_t) TMath::Abs( pTrkXi->GetID() );
+    UInt_t idxNegXi  = (UInt_t) TMath::Abs( nTrkXi->GetID() );
+    UInt_t idxBach   = (UInt_t) TMath::Abs( bTrkXi->GetID() );
+
+    if(idxBach == idxNegXi || idxBach == idxPosXi) continue;
+
+    if( !fCutsDau->IsSelected(pTrkXi) 
+        || !fCutsDau->IsSelected(nTrkXi)
+        || !fCutsDau->IsSelected(bTrkXi) ) continue;
+
+    
+    if(pTrkXi->IsOn(AliESDtrack::kTPCin)){
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(pTrkXi->P()*pTrkXi->Charge(), pTrkXi->GetTPCsignal());
+    }
+    if( nTrkXi->IsOn(AliESDtrack::kTPCin) ){
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(nTrkXi->P()*nTrkXi->Charge(), nTrkXi->GetTPCsignal());
+    }
+    if(bTrkXi->IsOn(AliESDtrack::kTPCin)){
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("TPCdEdxOfCascDghters"))->Fill(bTrkXi->P()*bTrkXi->Charge(), bTrkXi->GetTPCsignal());
+    }
+    
+    if(xi->ChargeXi() < 0)
+      invMassLambdaAsCascDghter = xi->MassLambda();
+    else
+      invMassLambdaAsCascDghter = xi->MassAntiLambda();
+    
+    dcaV0DaughtersXi = xi->DcaV0Daughters();
+    V0Chi2Xi = xi->Chi2V0();
+    V0CosOfPointingAngleXi 
+      = xi->CosPointingAngle(bestPrimaryVtxPos);
+    dcaV0ToPrimaryVtxXi = xi->DcaV0ToPrimVertex();
+    dcaBachToPrimaryVtxXi = xi->DcaBachToPrimVertex();
+    
+    //V0
+    posV0Xi[0] = xi->DecayVertexV0X();
+    posV0Xi[1] = xi->DecayVertexV0Y();
+    posV0Xi[2] = xi->DecayVertexV0Z();
+    V0RadiusXi = TMath::Sqrt(posV0Xi[0]*posV0Xi[0]
+                             +posV0Xi[1]*posV0Xi[1]
+                             +posV0Xi[2]*posV0Xi[2]);
+    dcaPosToPrimaryVtxXi = xi->DcaPosToPrimVertex();
+    dcaNegToPrimaryVtxXi = xi->DcaNegToPrimVertex();
+
+    //apply cuts ?
+    // if(XiRadius < 1. || XiRadius > 100.) continue;
+    //if(dcaXiDaughters > 0.1) continue;
+    //if(XiCosOfPointingAngle < 0.999) continue;
+    //if(dcaV0ToPrimaryVtxXi < 0.05) continue;
+    //if(dcaBachToPrimaryVtxXi < 0.03) continue;
+
+    if(dcaXiDaughters > fCascadeCuts[0]) continue;
+    if(XiCosOfPointingAngle < fCascadeCuts[1]) continue;
+    if(dcaV0ToPrimaryVtxXi < fCascadeCuts[2]) continue;
+    if(dcaBachToPrimaryVtxXi < fCascadeCuts[3]) continue;
+    
+    //V0 mass cut?
+    //if(TMath::Abs(invMassLambdaAsCascDghter-1.11568) > 0.006) continue;
+    if(TMath::Abs(invMassLambdaAsCascDghter-1.11568) > fCascadeCuts[7]) 
+      continue;
+
+    //if(dcaV0DaughtersXi > 1.) continue;
+    //if(V0CosOfPointingAngleXi > 0.9999) continue;
+    //if(dcaPosToPrimaryVtxXi < 0.1) continue;
+    //if(dcaNegToPrimaryVtxXi < 0.1) continue;
+    if(dcaV0DaughtersXi > fCascadeCuts[4]) continue;
+    if(V0CosOfPointingAngleXi > fCascadeCuts[5]) continue;
+    if(dcaPosToPrimaryVtxXi < fCascadeCuts[6]) continue;
+    if(dcaNegToPrimaryVtxXi < fCascadeCuts[6]) continue;
+    
+    // if(V0RadiusXi < 1.0 || V0RadiusXi > 100) continue;
+    
+    //other cuts?
+
+
+    //???
+    if(xi->ChargeXi()<0){
+      invMassXiMinus = xi->MassXi();
+      invMassOmegaMinus = xi->MassOmega();
+    }else{
+      invMassXiPlus = xi->MassXi();
+      invMassOmegaPlus = xi->MassOmega();
+    }
+
+    /*
+    if(pTrkXi->GetMostProbablePID() == AliAODTrack::kProton) {
+      isPosInXiProton = kTRUE;
+      isPosInOmegaProton = kTRUE;
+    }
+    if(pTrkXi->GetMostProbablePID() == AliAODTrack::kPion){
+      isPosInXiPion = kTRUE;
+      isPosInOmegaPion = kTRUE;
+    }
+    
+    if(nTrkXi->GetMostProbablePID() == AliAODTrack::kPion){
+      isNegInXiPion = kTRUE;
+      isNegInOmegaPion = kTRUE;
+    }
+    if(nTrkXi->GetMostProbablePID() == AliAODTrack::kProton){
+      isNegInXiProton = kTRUE;
+      isNegInOmegaProton = kTRUE;
+    }
+
+    if(bTrkXi->GetMostProbablePID() == AliAODTrack::kPion)
+      isBachelorPion = kTRUE;
+    if(bTrkXi->GetMostProbablePID() == AliAODTrack::kKaon)
+      isBachelorKaon = kTRUE;
+    */
+
+    //PID with TPC only: 
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(bTrkXi, AliPID::kKaon))<3.)
+      isBachelorKaonForTPC = kTRUE;
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(bTrkXi, AliPID::kPion))<3.)
+      isBachelorPionForTPC = kTRUE;
+
+    //Negative V0 daughter
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(nTrkXi, AliPID::kPion))<3.)
+      isNegPionForTPC = kTRUE;
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(nTrkXi, AliPID::kProton))<3.)
+      isNegProtonForTPC = kTRUE;
+    
+    //Positive V0 daughter
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(pTrkXi, AliPID::kPion))<3.)
+      isPosPionForTPC = kTRUE;
+    if(TMath::Abs(fPIDResponse->NumberOfSigmasTPC(pTrkXi, AliPID::kProton))<3.)
+      isPosProtonForTPC = kTRUE;
+
+    //Extra QA information
+    XiPx = xi->MomXiX();
+    XiPy = xi->MomXiY();
+    XiPz = xi->MomXiZ();
+    XiPt = TMath::Sqrt(XiPx*XiPx + XiPy*XiPy);
+    XiPtot= TMath::Sqrt(XiPx*XiPx + XiPy*XiPy + XiPz*XiPz);
+    
+    bachPx = xi->MomBachX();
+    bachPy = xi->MomBachY();
+    bachPz = xi->MomBachZ();
+    
+    bachPt = TMath::Sqrt(bachPx*bachPx + bachPy*bachPy);
+    bachPtot = TMath::Sqrt(bachPx*bachPx + bachPy*bachPy + bachPz*bachPz);
+  
+    V0toXiCosOfPointingAngle = xi->CosPointingAngle( xi->GetDecayVertexXi() );
+    
+    rapXi = xi->RapXi();
+    rapOmega = xi->RapOmega();
+    phi = xi->Phi();
+    alphaXi = xi->AlphaXi();
+    ptArmXi = xi->PtArmXi();
+
+    distToVtxZBefore = posXi[2]-bestPrimaryVtxPos[2];
+    distToVtxXYBefore
+      = TMath::Sqrt((posXi[0] - bestPrimaryVtxPos[0])
+                    *(posXi[0] - bestPrimaryVtxPos[0])
+                    +(posXi[1] - bestPrimaryVtxPos[1])
+                    *(posXi[1] - bestPrimaryVtxPos[1]));
+
+
+    XiPAfter[0] = XiPx;
+    XiPAfter[1] = XiPy;
+    XiPAfter[2] = XiPz;
+    //propagation to the best primary vertex to determine the momentum
+    Propagate(bestPrimaryVtxPos, posXi, XiPAfter, b, xi->ChargeXi());
+    distToVtxZAfter = posXi[2] - bestPrimaryVtxPos[2];
+    distToVtxXYAfter = TMath::Sqrt((posXi[0] - bestPrimaryVtxPos[0])
+                                   *(posXi[0] - bestPrimaryVtxPos[0])
+                                   +(posXi[1] - bestPrimaryVtxPos[1])
+                                   *(posXi[1] - bestPrimaryVtxPos[1]));
+    phiAfter = TMath::Pi() + TMath::ATan2(-XiPAfter[1],-XiPAfter[0]);
+
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxZAfter"))->Fill(distToVtxZAfter);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxXYAfter"))->Fill(distToVtxXYAfter);
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxZBeforeVsAfter"))->Fill(distToVtxZBefore, distToVtxZAfter);
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DistToVtxXYBeforeVsAfter"))->Fill(distToVtxXYBefore, distToVtxXYAfter);
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PxBeforeVsAfter"))->Fill(XiPx, XiPAfter[0]);
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PyBeforeVsAfter"))->Fill(XiPy, XiPAfter[1]);
+    if(xi->ChargeXi()>0)
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PhiPosBeforeVsAfter"))->Fill(phi, phiAfter);
+    else if(xi->ChargeXi()<0)
+      ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("PhiNegBeforeVsAfter"))->Fill(phi, phiAfter);
+    
+    //for default hypothesis
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("Chi2Xi"))->Fill(chi2Xi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaXiDaughters"))->Fill(dcaXiDaughters);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaBachToPrimVertex"))->Fill(dcaBachToPrimaryVtxXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("XiCosOfPointingAngle"))->Fill(XiCosOfPointingAngle);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("XiRadius"))->Fill(XiRadius);
+    
+    //V0
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassLambdaAsCascDghter"))->Fill(invMassLambdaAsCascDghter);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0Chi2Xi"))->Fill(V0Chi2Xi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaV0DaughtersXi"))->Fill(dcaV0DaughtersXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0CosOfPointingAngleXi"))->Fill(V0CosOfPointingAngleXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0RadiusXi"))->Fill(V0RadiusXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaV0ToPrimVertexXi"))->Fill(dcaV0ToPrimaryVtxXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaPosToPrimVertexXi"))->Fill(dcaPosToPrimaryVtxXi);
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("DcaNegToPrimVertexXi"))->Fill(dcaNegToPrimaryVtxXi);
+    
+    ((TH1F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("V0toXiCosOfPointingAngle"))->Fill(V0toXiCosOfPointingAngle);
+    
+    ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("Armenteros"))->Fill(alphaXi, ptArmXi);
+  
+    //with PID cuts
+    if(xi->ChargeXi()<0){
+      if(isPosProtonForTPC && isNegPionForTPC){
+       switch (fSpecie){
+       case 0:
+         if( isBachelorPionForTPC && TMath::Abs(rapXi) < 0.8){
+           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassXiMinus);
+           MakeTrack(invMassXiMinus, XiPt, /*xi->Phi(),*/
+                     phiAfter, xi->Eta(), 
+                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());
+         }// endif
+      
+         break;
+
+       case 1:
+         if(isBachelorKaonForTPC && TMath::Abs(rapOmega) < 0.8
+            && (invMassXiMinus > 1.32486 || invMassXiMinus < 1.30486)){
+           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassOmegaMinus);      
+           
+           MakeTrack(invMassOmegaMinus, XiPt, /* xi->Phi(),*/
+                     phiAfter,   xi->Eta(),
+                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());
+         }//endif
+         break;
+       }
+      }
+    }//end if ChargeXi()<0
+    
+    if(xi->ChargeXi() > 0){
+      if(isNegProtonForTPC && isPosPionForTPC){ 
+       switch(fSpecie){
+       case 0:
+         if (isBachelorPionForTPC  && TMath::Abs(rapXi) < 0.8){
+           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassXiPlus);
+         
+           //candidate inserting                                              
+           MakeTrack(invMassXiPlus, XiPt, /* xi->Phi(),*/
+                     phiAfter, xi->Eta(),
+                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());
+         }//endif particle id
+         break;
+         
+       case 1:
+         if(isBachelorKaonForTPC && TMath::Abs(rapOmega) < 0.8
+            && (invMassXiPlus > 1.32486 || invMassXiPlus < 1.30486)){
+           ((TH2F*)((TList*)fQAList->FindObject("Candidates"))->FindObject("MassVsPtAll"))->Fill(XiPt, invMassOmegaPlus);
+           MakeTrack(invMassOmegaPlus, XiPt, /* xi->Phi(),*/
+                     phiAfter, xi->Eta(),
+                     pTrkXi->GetID(), nTrkXi->GetID(), bTrkXi->GetID());
+         }//endif particle id
+       }
+      }
+    }//endif ChargeXi()>0  
+  }//for Xi candidate loop
+
+  return;
+
+}
+
+
+void AliAnalysisTaskFlowCascade::MakeTrack( double mass, 
+                                           double pt, 
+                                           double phi, 
+                                           double eta, 
+                                           int iid, 
+                                           int jid,
+                                           int kid) {
+  // create track for flow tasks        
+  if(fCandidates->GetLast()+1>=fCandidates->GetSize()) {
+    fCandidates->Expand( 2*fCandidates->GetSize() );
+  }
+  Bool_t overwrite = kTRUE;
+
+  AliFlowCandidateTrack *sTrack 
+    = (static_cast<AliFlowCandidateTrack*> (fCandidates->At( fCandidates->GetLast()+1 )));
+  if( !sTrack ) { // creates new
+    sTrack = new AliFlowCandidateTrack();
+    overwrite = kFALSE;
+  } else { // overwrites
+    sTrack->ClearMe();
+  }
+
+
+  sTrack->SetMass(mass);
+  sTrack->SetPt(pt);
+  sTrack->SetPhi(phi);
+  sTrack->SetEta(eta);
+  sTrack->AddDaughter(iid);
+  sTrack->AddDaughter(jid);
+  sTrack->AddDaughter(kid);
+  sTrack->SetForPOISelection(kTRUE);
+  sTrack->SetForRPSelection(kFALSE);
+  if(overwrite) {
+    fCandidates->SetLast( fCandidates->GetLast()+1 );
+  } else {
+    fCandidates->AddLast(sTrack);
+  }
+  
+  return;
+}
+//_____________________________________________________________________________
+void AliAnalysisTaskFlowCascade::Terminate(Option_t *)
+{
+
+}
+
+void AliAnalysisTaskFlowCascade::Propagate(Double_t vv[3], 
+                                          Double_t x[3], 
+                                          Double_t p[3], 
+                                          Double_t bz, 
+                                          Short_t sign){
+  //Propagation to the primary vertex to determine the px and py
+  //x, p are the position and momentum as input and output
+  //bz is the magnetic field along z direction
+  //sign is the charge of particle for propagation
+
+  Double_t pp = TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
+  Double_t len = (vv[2]-x[2])*pp/p[2];
+  Double_t a = -kB2C*bz*sign;  
+
+  Double_t rho = a/pp;
+  x[0] += p[0]*TMath::Sin(rho*len)/a - p[1]*(1-TMath::Cos(rho*len))/a;
+  x[1] += p[1]*TMath::Sin(rho*len)/a + p[0]*(1-TMath::Cos(rho*len))/a;
+  x[2] += p[2]*len/pp;
+
+  Double_t p0=p[0];
+  p[0] = p0  *TMath::Cos(rho*len) - p[1]*TMath::Sin(rho*len);
+  p[1] = p[1]*TMath::Cos(rho*len) + p0  *TMath::Sin(rho*len);
+}
+
+
+//=====================================================================       
+void AliAnalysisTaskFlowCascade::SetCommonConstants(Int_t massBins, 
+                                                   Double_t minMass, 
+                                                   Double_t maxMass)
+{
+  // setter for mass bins                          
+                          
+  fMassBins = massBins;
+  fMinMass = minMass;
+  fMaxMass = maxMass;
+}
+
+
+//====================================================================         
+void AliAnalysisTaskFlowCascade::SetCuts2010(int set) {
+
+  // fCascadeCuts[0]: DcaXiDaughter; fCascadeCuts[1]: XiCosOfPointingAngle
+  // fCascadeCuts[2]: DcaV0ToPrimaryVtxXi; fCascadeCuts[3]: DcaBachToPrimaryVtxXi
+  // fCascadeCuts[4]: DcaV0DaughersXi; fCascadeCuts[5]: V0CosOfPointingAngleXi
+  // fCascadeCuts[6]: DcaV0DaughterToPrimaryVtxXi; fCascadeCuts[7]: V0MassWidth
+  
+  switch(set){
+  
+  case 0: //tighter
+    fCascadeCuts[0] = 0.2; fCascadeCuts[1] = 0.999;
+    fCascadeCuts[2] = 0.03; fCascadeCuts[3] = 0.05;
+    fCascadeCuts[4] = .5; fCascadeCuts[5] = 0.9998;
+    fCascadeCuts[6] = 0.1; fCascadeCuts[7] = 0.006;
+    break;
+    
+  case 1: //middle
+    fCascadeCuts[0] = 0.3; fCascadeCuts[1] = 0.99;
+    fCascadeCuts[2] = 0.01; fCascadeCuts[3] = 0.03;
+    fCascadeCuts[4] = .6; fCascadeCuts[5] = 0.9999;
+    fCascadeCuts[6] = 0.1; fCascadeCuts[7] = 0.008;
+    break;
+
+  case 2: //looser
+    fCascadeCuts[0] = 0.3; fCascadeCuts[1] = 0.99;
+    fCascadeCuts[2] = 0.01; fCascadeCuts[3] = 0.03;
+    fCascadeCuts[4] = 1.; fCascadeCuts[5] = 1.;
+    fCascadeCuts[6] = 0.1; fCascadeCuts[7] = 0.01;
+    break;
+  }
+  
+}
index cd24925..1ce481d 100644 (file)
@@ -1,85 +1,85 @@
-/////////////////////////////////////////////////////\r
-// AliAnalysisTaskFlowCascade:\r
-// Analysis task to select Xi and Omega candidates for flow analysis.\r
-// Author: \r
-//////////////////////////////////////////////////////\r
-\r
-/* Copyright(c) 1998-1999, ALICExperiment at CERN, All rights reserved. *\r
-* See cxx source for full Copyright notice */\r
-/* $Id: $ */\r
-\r
-#ifndef AliAnalysisTaskFlowCascade_H\r
-#define AliAnalysisTaskFlowCascade_H\r
-\r
-#include "AliAnalysisTaskSE.h"\r
-\r
-class AliESDtrackCuts;\r
-class AliFlowEventCuts;\r
-class TList;\r
-class TH1D;\r
-class TH2D;\r
-class TH3D;\r
-class AliFlowCandidateTrack;\r
-class TVector3;\r
-class AliPIDResponse;\r
-class AliFlowEvent;\r
-class AliAnalysisTaskFlowCascade : public AliAnalysisTaskSE {\r
-  private:\r
-  AliAnalysisTaskFlowCascade(const AliAnalysisTaskFlowCascade& analysisTask);\r
-  AliAnalysisTaskFlowCascade& \r
-    operator=(const AliAnalysisTaskFlowCascade& analysisTask);\r
-\r
-  //Progate to the primary vertex\r
-  void Propagate(Double_t vv[3], Double_t x[3], Double_t p[3], Double_t bz, \r
-                Short_t sign);\r
-\r
-  void AddQAEvents();\r
-  void AddQACandidates();\r
-  void ReadFromESDv0(AliESDEvent *fESD);\r
-  void ReadFromAODv0(AliAODEvent *fAOD);\r
-\r
-  void AddCandidates();\r
-\r
-  void MakeTrack( double mass, double pt, \r
-                 double phi, double eta, \r
-                 int iid, int jid, int kid );\r
-  \r
-  //  double fMinCent, fMaxCent;   //\r
-  Int_t fSpecie; //0 for Xi and 1 for Omega\r
-  Double_t fCascadeCuts[8]; // cuts for cascade selection\r
-  Int_t fMassBins;   // to configure FLOWCOMMON                               \r
-  Double_t fMinMass; // to configure FLOWCOMMON                               \r
-  Double_t fMaxMass; // to configure FLOWCOMMON\r
-  \r
-  AliFlowEventCuts *fCutsEvent; // event cuts \r
-  AliFlowTrackCuts *fCutsRPTPC;    // cuts for RPs\r
-  AliFlowTrackCuts *fCutsRPVZE;    // cuts for RPs\r
-  AliFlowTrackCuts *fCutsPOI; // null cuts for POI\r
-  AliFlowTrackCuts *fCutsDau; // cuts for daughters\r
-  AliPIDResponse *fPIDResponse;\r
-  AliFlowEvent  *fFlowEventTPC;  //flow event TPC                             \r
-  AliFlowEvent  *fFlowEventVZE;  //flow event VZE \r
-  TObjArray *fCandidates; // Array of selected candidates\r
-  TList *fQAList;               //! list for QA histos\r
-\r
- public:\r
-  AliAnalysisTaskFlowCascade();\r
-  AliAnalysisTaskFlowCascade(const char *name, \r
-                            AliFlowEventCuts *cutsEvent, \r
-                            AliFlowTrackCuts *cutsRPTPC,\r
-                            AliFlowTrackCuts *cutsRPVZE,\r
-                            /* AliESDtrackCuts */AliFlowTrackCuts *cutsDau);\r
-  //void SetDebug() {fDebug = true;}\r
-  void SetSpecie(int specie){fSpecie = specie;}\r
-  void SetCommonConstants(Int_t massBins, Double_t minMass, Double_t maxMass);\r
-  void SetCuts2010(int setOfCuts);\r
-  virtual ~AliAnalysisTaskFlowCascade();\r
-  virtual void UserCreateOutputObjects();\r
-  virtual void UserExec(Option_t *);\r
-  virtual void Terminate(Option_t *);\r
-  virtual void NotifyRun();\r
-  \r
-  ClassDef(AliAnalysisTaskFlowCascade, 2);\r
-};\r
-\r
-#endif\r
+/////////////////////////////////////////////////////
+// AliAnalysisTaskFlowCascade:
+// Analysis task to select Xi and Omega candidates for flow analysis.
+// Author: 
+//////////////////////////////////////////////////////
+
+/* Copyright(c) 1998-1999, ALICExperiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice */
+/* $Id: $ */
+
+#ifndef AliAnalysisTaskFlowCascade_H
+#define AliAnalysisTaskFlowCascade_H
+
+#include "AliAnalysisTaskSE.h"
+
+class AliESDtrackCuts;
+class AliFlowEventCuts;
+class TList;
+class TH1D;
+class TH2D;
+class TH3D;
+class AliFlowCandidateTrack;
+class TVector3;
+class AliPIDResponse;
+class AliFlowEvent;
+class AliAnalysisTaskFlowCascade : public AliAnalysisTaskSE {
+  private:
+  AliAnalysisTaskFlowCascade(const AliAnalysisTaskFlowCascade& analysisTask);
+  AliAnalysisTaskFlowCascade& 
+    operator=(const AliAnalysisTaskFlowCascade& analysisTask);
+
+  //Progate to the primary vertex
+  void Propagate(Double_t vv[3], Double_t x[3], Double_t p[3], Double_t bz, 
+                Short_t sign);
+
+  void AddQAEvents();
+  void AddQACandidates();
+  void ReadFromESDv0(AliESDEvent *fESD);
+  void ReadFromAODv0(AliAODEvent *fAOD);
+
+  void AddCandidates();
+
+  void MakeTrack( double mass, double pt, 
+                 double phi, double eta, 
+                 int iid, int jid, int kid );
+  
+  //  double fMinCent, fMaxCent;   //
+  Int_t fSpecie; //0 for Xi and 1 for Omega
+  Double_t fCascadeCuts[8]; // cuts for cascade selection
+  Int_t fMassBins;   // to configure FLOWCOMMON                               
+  Double_t fMinMass; // to configure FLOWCOMMON                               
+  Double_t fMaxMass; // to configure FLOWCOMMON
+  
+  AliFlowEventCuts *fCutsEvent; // event cuts 
+  AliFlowTrackCuts *fCutsRPTPC;    // cuts for RPs
+  AliFlowTrackCuts *fCutsRPVZE;    // cuts for RPs
+  AliFlowTrackCuts *fCutsPOI; // null cuts for POI
+  AliFlowTrackCuts *fCutsDau; // cuts for daughters
+  AliPIDResponse *fPIDResponse;
+  AliFlowEvent  *fFlowEventTPC;  //flow event TPC                             
+  AliFlowEvent  *fFlowEventVZE;  //flow event VZE 
+  TObjArray *fCandidates; // Array of selected candidates
+  TList *fQAList;               //! list for QA histos
+
+ public:
+  AliAnalysisTaskFlowCascade();
+  AliAnalysisTaskFlowCascade(const char *name, 
+                            AliFlowEventCuts *cutsEvent, 
+                            AliFlowTrackCuts *cutsRPTPC,
+                            AliFlowTrackCuts *cutsRPVZE,
+                            /* AliESDtrackCuts */AliFlowTrackCuts *cutsDau);
+  //void SetDebug() {fDebug = true;}
+  void SetSpecie(int specie){fSpecie = specie;}
+  void SetCommonConstants(Int_t massBins, Double_t minMass, Double_t maxMass);
+  void SetCuts2010(int setOfCuts);
+  virtual ~AliAnalysisTaskFlowCascade();
+  virtual void UserCreateOutputObjects();
+  virtual void UserExec(Option_t *);
+  virtual void Terminate(Option_t *);
+  virtual void NotifyRun();
+  
+  ClassDef(AliAnalysisTaskFlowCascade, 2);
+};
+
+#endif
index 91cd333..295cb0e 100644 (file)
@@ -1,57 +1,57 @@
-#ifndef ALIANALYSISTASKESDMUONFILTER_H\r
-#define ALIANALYSISTASKESDMUONFILTER_H\r
\r
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- * See cxx source for full Copyright notice                               */\r
-\r
-/* $Id$ */ \r
-\r
-///\r
-/// \brief Add the muon tracks to the generic AOD track branch during the\r
-/// filtering of the ESD.\r
-///\r
-/// \author R. Arnaldi 5/5/08 and L. Aphecetche January 2011\r
-\r
-#ifndef ALIANALYSISTASKSE_H\r
-#  include "AliAnalysisTaskSE.h"\r
-#endif\r
-\r
-class AliAnalysisFilter;\r
-\r
-class AliAnalysisTaskESDMuonFilter : public AliAnalysisTaskSE\r
-{\r
-public:\r
-  AliAnalysisTaskESDMuonFilter(Bool_t onlyMuon=kTRUE, Bool_t keepAllEvents=kTRUE, Int_t mcMode=0, Bool_t withSPDtracklets=kFALSE);\r
-  AliAnalysisTaskESDMuonFilter(const char* name, Bool_t onlyMuon=kTRUE, Bool_t keepAllEvents=kTRUE, Int_t mcMode=0, Bool_t withSPDtracklets=kFALSE);\r
-  virtual ~AliAnalysisTaskESDMuonFilter() {;}\r
-  \r
-  virtual void UserCreateOutputObjects();\r
-  virtual void Init();\r
-  virtual void LocalInit() {Init();}\r
-  virtual void UserExec(Option_t *option);\r
-  \r
-  virtual void ConvertESDtoAOD();\r
-  \r
-  virtual void SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;}\r
-  void SetWriteMuonAOD(Bool_t enableMuonAOD){fEnableMuonAOD = enableMuonAOD;}\r
-  void SetWriteDimuonAOD(Bool_t enableDimuonAOD){fEnableDimuonAOD = enableDimuonAOD;}\r
-  \r
-  void PrintTask(Option_t *option="", Int_t indent=0) const;\r
-  \r
-private:\r
-  AliAnalysisTaskESDMuonFilter(const AliAnalysisTaskESDMuonFilter&);\r
-  AliAnalysisTaskESDMuonFilter& operator=(const AliAnalysisTaskESDMuonFilter&);\r
-  void AddFilteredAOD(const char* aodfilename, const char* title);\r
-  \r
-  AliAnalysisFilter* fTrackFilter; ///<  Track Filter\r
-  Bool_t fEnableMuonAOD; ///< flag for enabling Muon AOD production\r
-  Bool_t fEnableDimuonAOD; ///< flag for enabling Dimuon AOD production\r
-  Bool_t fOnlyMuon; ///< flag for disabling branches irrelevant for (most) muon analyses\r
-  Bool_t fKeepAllEvents; ///< keep even events where there's no muons (to get e.g. unbiased vertex distribution)\r
-  Int_t  fMCMode; ///< whether and how we're filtering MC data\r
-  Bool_t fWithSPDTracklets; ///< whether or not we keep SPD tracklets\r
-  \r
-  ClassDef(AliAnalysisTaskESDMuonFilter, 6); // Analysis task for standard ESD filtering\r
-};\r
-\r
-#endif\r
+#ifndef ALIANALYSISTASKESDMUONFILTER_H
+#define ALIANALYSISTASKESDMUONFILTER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */ 
+
+///
+/// \brief Add the muon tracks to the generic AOD track branch during the
+/// filtering of the ESD.
+///
+/// \author R. Arnaldi 5/5/08 and L. Aphecetche January 2011
+
+#ifndef ALIANALYSISTASKSE_H
+#  include "AliAnalysisTaskSE.h"
+#endif
+
+class AliAnalysisFilter;
+
+class AliAnalysisTaskESDMuonFilter : public AliAnalysisTaskSE
+{
+public:
+  AliAnalysisTaskESDMuonFilter(Bool_t onlyMuon=kTRUE, Bool_t keepAllEvents=kTRUE, Int_t mcMode=0, Bool_t withSPDtracklets=kFALSE);
+  AliAnalysisTaskESDMuonFilter(const char* name, Bool_t onlyMuon=kTRUE, Bool_t keepAllEvents=kTRUE, Int_t mcMode=0, Bool_t withSPDtracklets=kFALSE);
+  virtual ~AliAnalysisTaskESDMuonFilter() {;}
+  
+  virtual void UserCreateOutputObjects();
+  virtual void Init();
+  virtual void LocalInit() {Init();}
+  virtual void UserExec(Option_t *option);
+  
+  virtual void ConvertESDtoAOD();
+  
+  virtual void SetTrackFilter(AliAnalysisFilter* trackF) {fTrackFilter = trackF;}
+  void SetWriteMuonAOD(Bool_t enableMuonAOD){fEnableMuonAOD = enableMuonAOD;}
+  void SetWriteDimuonAOD(Bool_t enableDimuonAOD){fEnableDimuonAOD = enableDimuonAOD;}
+  
+  void PrintTask(Option_t *option="", Int_t indent=0) const;
+  
+private:
+  AliAnalysisTaskESDMuonFilter(const AliAnalysisTaskESDMuonFilter&);
+  AliAnalysisTaskESDMuonFilter& operator=(const AliAnalysisTaskESDMuonFilter&);
+  void AddFilteredAOD(const char* aodfilename, const char* title);
+  
+  AliAnalysisFilter* fTrackFilter; ///<  Track Filter
+  Bool_t fEnableMuonAOD; ///< flag for enabling Muon AOD production
+  Bool_t fEnableDimuonAOD; ///< flag for enabling Dimuon AOD production
+  Bool_t fOnlyMuon; ///< flag for disabling branches irrelevant for (most) muon analyses
+  Bool_t fKeepAllEvents; ///< keep even events where there's no muons (to get e.g. unbiased vertex distribution)
+  Int_t  fMCMode; ///< whether and how we're filtering MC data
+  Bool_t fWithSPDTracklets; ///< whether or not we keep SPD tracklets
+  
+  ClassDef(AliAnalysisTaskESDMuonFilter, 6); // Analysis task for standard ESD filtering
+};
+
+#endif
index 968a10a..eea875b 100644 (file)
-/**************************************************************************\r
- * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-\r
-/* $Id: AliUtilityMuonAncestor.cxx 47782 2011-02-24 18:37:31Z martinez $ */\r
-\r
-//-----------------------------------------------------------------------------\r
-/// \class AliUtilityMuonAncestor\r
-/// Static utilities to get the muon ancestor in MC\r
-///\r
-/// \author Diego Stocco\r
-//-----------------------------------------------------------------------------\r
-\r
-#include "AliUtilityMuonAncestor.h"\r
-\r
-// ROOT includes\r
-#include "TDatabasePDG.h"\r
-#include "TParticlePDG.h"\r
-#include "TPDGCode.h"\r
-#include "TMCProcess.h"\r
-#include "TMath.h"\r
-\r
-// STEER includes\r
-#include "AliMCEvent.h"\r
-#include "AliVParticle.h"\r
-#include "AliMCParticle.h"\r
-#include "AliAODMCParticle.h"\r
-#include "AliLog.h"\r
-\r
-// PWGmuon includes\r
-#include "AliAnalysisMuonUtility.h"\r
-\r
-/// \cond CLASSIMP\r
-ClassImp(AliUtilityMuonAncestor) // Class implementation in ROOT context\r
-/// \endcond\r
-\r
-//_________________________________________________________\r
-AliUtilityMuonAncestor::AliUtilityMuonAncestor() :\r
-TObject(),\r
-fPx(0.),\r
-fPy(0.),\r
-fPz(0.),\r
-fMask(0),\r
-fAncestor(-999)\r
-{\r
-  /// Default constructor\r
-}\r
-\r
-\r
-//_________________________________________________________\r
-AliUtilityMuonAncestor::~AliUtilityMuonAncestor()\r
-{\r
-  /// Default destructor\r
-}\r
-\r
-//_________________________________________________________\r
-AliUtilityMuonAncestor::AliUtilityMuonAncestor(const AliUtilityMuonAncestor& obj) :\r
-TObject(obj),\r
-fPx(obj.fPx),\r
-fPy(obj.fPy),\r
-fPz(obj.fPz),\r
-fMask(obj.fMask),\r
-fAncestor(obj.fAncestor)\r
-{\r
-  /// Copy constructor\r
-}\r
-\r
-//_________________________________________________________\r
-AliUtilityMuonAncestor& AliUtilityMuonAncestor::operator=(const AliUtilityMuonAncestor& obj)\r
-{\r
-  /// Copy operator\r
-  if ( this != &obj ) {\r
-    TObject::operator=(obj);\r
-    fPx = obj.fPx;\r
-    fPy = obj.fPy;\r
-    fPz = obj.fPz;\r
-    fMask = obj.fMask;\r
-    fAncestor = obj.fAncestor;\r
-  }\r
-  return *this;\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::BuildAncestor ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Build ancestor\r
-  \r
-  // If track is the same as the one in memory, do not re-build the track ancestor\r
-  if ( track->Px() == fPx && track->Py() == fPy && track->Pz() == fPz ) return kTRUE;\r
-  fPx = track->Px();\r
-  fPy = track->Py();\r
-  fPz = track->Pz();\r
-  fMask = 0;\r
-  fAncestor = -999;\r
-  if ( ! mcEvent ) return kFALSE;\r
-  \r
-  AliVParticle* mcParticle = 0x0;\r
-  \r
-  if ( AliAnalysisMuonUtility::IsMCTrack(track) ) mcParticle = track;\r
-  else {\r
-    Int_t trackLabel = track->GetLabel();\r
-    if ( trackLabel < 0 ) return kFALSE;\r
-    mcParticle = mcEvent->GetTrack(trackLabel);\r
-  }\r
-  \r
-  // Track is MC (or matches a MC track)\r
-  SETBIT(fMask,kIsID);\r
-  \r
-  Int_t recoPdg = mcParticle->PdgCode();\r
-  \r
-  // Track is not a muon\r
-  if ( TMath::Abs(recoPdg) == 13 ) SETBIT(fMask,kIsMuon);\r
-  \r
-  Int_t imother = AliAnalysisMuonUtility::GetMotherIndex(mcParticle);\r
-\r
-  while ( imother >= 0 ) {\r
-    AliVParticle* part = mcEvent->GetTrack(imother);\r
-    \r
-    Int_t absPdg = TMath::Abs(part->PdgCode());\r
-    \r
-    // This is a quark\r
-    if ( absPdg < 10 ) return kTRUE;\r
-    \r
-    fAncestor = imother;\r
-    Bool_t isPrimary = AliAnalysisMuonUtility::IsPrimary(part, mcEvent);\r
-    \r
-    if ( isPrimary ) {\r
-      Int_t mpdg = absPdg%100000;\r
-      if ( mpdg >= 100 && mpdg < 10000 ) {\r
-        Int_t flv  = Int_t ( mpdg / TMath::Power(10, Int_t(TMath::Log10(mpdg) )));\r
-        if ( flv < 4 ) SETBIT(fMask,kHasLightParent);\r
-        else if ( flv >= 6 ) continue;\r
-        else {\r
-          TParticlePDG* partPdg = TDatabasePDG::Instance()->GetParticle(part->PdgCode());\r
-          if ( partPdg && ! partPdg->AntiParticle() ) SETBIT(fMask,kHasQuarkoniumParent);\r
-          else if ( flv == 4 ) SETBIT(fMask,kHasCharmParent);\r
-          else SETBIT(fMask,kHasBeautyParent);\r
-        }\r
-      } // absPdg within 100 and 10000\r
-    } // is primary\r
-    else {\r
-      UInt_t mcProcess = AliAnalysisMuonUtility::GetMCProcess(part);\r
-      if ( mcProcess == kPHadronic ||\r
-           ( mcProcess == 0 && part->Zv() < -90. ) ) {\r
-        // The MC process is not well computed in the AODs of old MC productions\r
-        // In this case, declare the particle as "secondary" if it is produced inside the front absorber\r
-        SETBIT(fMask,kIsSecondary);\r
-//        return kTRUE;\r
-      }\r
-    } // is secondary\r
-    \r
-    imother = AliAnalysisMuonUtility::GetMotherIndex(part);\r
-    \r
-  } // loop on mothers\r
-  return kTRUE;\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::CheckAncestor ( AliVParticle* track, const AliMCEvent* mcEvent, Int_t ancestorPdg, Bool_t matchAbsPdg )\r
-{\r
-  /// Check ancestor\r
-  Int_t pdgCode = GetAncestorPdg(track, mcEvent);\r
-  if ( matchAbsPdg ) {\r
-    pdgCode = TMath::Abs(pdgCode);\r
-    ancestorPdg = TMath::Abs(ancestorPdg);\r
-  }\r
-  return ( pdgCode == ancestorPdg );\r
-}\r
-\r
-//_________________________________________________________\r
-Int_t AliUtilityMuonAncestor::GetAncestor ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Return ancestor (compute it if necessary)\r
-  BuildAncestor(track,mcEvent);\r
-  return fAncestor;\r
-}\r
-\r
-//_________________________________________________________\r
-Int_t AliUtilityMuonAncestor::GetAncestorPdg ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Return ancestor Pdg\r
-  if ( BuildAncestor(track,mcEvent) ) {\r
-    if ( fAncestor >= 0 ) return mcEvent->GetTrack(fAncestor)->PdgCode();\r
-  }\r
-  return 0;\r
-}\r
-\r
-//_________________________________________________________\r
-Long64_t AliUtilityMuonAncestor::GetMask ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Return mask\r
-  BuildAncestor(track,mcEvent);\r
-  return fMask;\r
-}\r
-\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsBeautyMu ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Muon from beauty decays\r
-  Long64_t mask = GetMask(track,mcEvent);\r
-  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kHasBeautyParent) & ! TESTBIT(mask,kHasLightParent) );\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsBJpsiMu ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Muon B->J/psi decays\r
-  if ( IsBeautyMu(track,mcEvent) ) {\r
-    Int_t imother = AliAnalysisMuonUtility::GetMotherIndex(track);\r
-    if ( imother >= 0 ) return ( mcEvent->GetTrack(imother)->PdgCode() == 443 );\r
-  }\r
-  return kFALSE;\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsCharmMu ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Muon from charm decays\r
-  Long64_t mask = GetMask(track,mcEvent);\r
-  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kHasCharmParent) && ! TESTBIT(mask,kHasBeautyParent) && ! TESTBIT(mask,kHasLightParent) );\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsDecayMu ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Muon from light hadron decays\r
-  Long64_t mask = GetMask(track,mcEvent);\r
-  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kHasLightParent) && ! TESTBIT(mask,kIsSecondary) );\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsHadron ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Reconstructed hadron\r
-  Long64_t mask = GetMask(track,mcEvent);\r
-  return ( TESTBIT(mask,kIsID) && ! TESTBIT(mask,kIsMuon) );\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsMuon ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Track is muon\r
-  Long64_t mask = GetMask(track,mcEvent);\r
-  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) );\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsQuarkoniumMu ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Mu from quarkonium decay\r
-  Long64_t mask = GetMask(track,mcEvent);\r
-  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kHasQuarkoniumParent) );\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsSecondaryMu ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Muon from secondary decays in absorber\r
-  Long64_t mask = GetMask(track,mcEvent);\r
-  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kIsSecondary) );\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsUnidentified ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Unidentified muon\r
-  Long64_t mask = GetMask(track,mcEvent);\r
-  return ( ! TESTBIT(mask,kIsID) );\r
-}\r
-\r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsWBosonMu ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Muon from W boson decays\r
-  return ( IsMuon(track,mcEvent) && CheckAncestor(track,mcEvent,24) );\r
-}\r
-          \r
-//_________________________________________________________\r
-Bool_t AliUtilityMuonAncestor::IsZBosonMu ( AliVParticle* track, const AliMCEvent* mcEvent )\r
-{\r
-  /// Muon from Z boson decays\r
-  return ( IsMuon(track,mcEvent) && CheckAncestor(track,mcEvent,kZ0) );\r
-}\r
+/**************************************************************************
+ * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliUtilityMuonAncestor.cxx 47782 2011-02-24 18:37:31Z martinez $ */
+
+//-----------------------------------------------------------------------------
+/// \class AliUtilityMuonAncestor
+/// Static utilities to get the muon ancestor in MC
+///
+/// \author Diego Stocco
+//-----------------------------------------------------------------------------
+
+#include "AliUtilityMuonAncestor.h"
+
+// ROOT includes
+#include "TDatabasePDG.h"
+#include "TParticlePDG.h"
+#include "TPDGCode.h"
+#include "TMCProcess.h"
+#include "TMath.h"
+
+// STEER includes
+#include "AliMCEvent.h"
+#include "AliVParticle.h"
+#include "AliMCParticle.h"
+#include "AliAODMCParticle.h"
+#include "AliLog.h"
+
+// PWGmuon includes
+#include "AliAnalysisMuonUtility.h"
+
+/// \cond CLASSIMP
+ClassImp(AliUtilityMuonAncestor) // Class implementation in ROOT context
+/// \endcond
+
+//_________________________________________________________
+AliUtilityMuonAncestor::AliUtilityMuonAncestor() :
+TObject(),
+fPx(0.),
+fPy(0.),
+fPz(0.),
+fMask(0),
+fAncestor(-999)
+{
+  /// Default constructor
+}
+
+
+//_________________________________________________________
+AliUtilityMuonAncestor::~AliUtilityMuonAncestor()
+{
+  /// Default destructor
+}
+
+//_________________________________________________________
+AliUtilityMuonAncestor::AliUtilityMuonAncestor(const AliUtilityMuonAncestor& obj) :
+TObject(obj),
+fPx(obj.fPx),
+fPy(obj.fPy),
+fPz(obj.fPz),
+fMask(obj.fMask),
+fAncestor(obj.fAncestor)
+{
+  /// Copy constructor
+}
+
+//_________________________________________________________
+AliUtilityMuonAncestor& AliUtilityMuonAncestor::operator=(const AliUtilityMuonAncestor& obj)
+{
+  /// Copy operator
+  if ( this != &obj ) {
+    TObject::operator=(obj);
+    fPx = obj.fPx;
+    fPy = obj.fPy;
+    fPz = obj.fPz;
+    fMask = obj.fMask;
+    fAncestor = obj.fAncestor;
+  }
+  return *this;
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::BuildAncestor ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Build ancestor
+  
+  // If track is the same as the one in memory, do not re-build the track ancestor
+  if ( track->Px() == fPx && track->Py() == fPy && track->Pz() == fPz ) return kTRUE;
+  fPx = track->Px();
+  fPy = track->Py();
+  fPz = track->Pz();
+  fMask = 0;
+  fAncestor = -999;
+  if ( ! mcEvent ) return kFALSE;
+  
+  AliVParticle* mcParticle = 0x0;
+  
+  if ( AliAnalysisMuonUtility::IsMCTrack(track) ) mcParticle = track;
+  else {
+    Int_t trackLabel = track->GetLabel();
+    if ( trackLabel < 0 ) return kFALSE;
+    mcParticle = mcEvent->GetTrack(trackLabel);
+  }
+  
+  // Track is MC (or matches a MC track)
+  SETBIT(fMask,kIsID);
+  
+  Int_t recoPdg = mcParticle->PdgCode();
+  
+  // Track is not a muon
+  if ( TMath::Abs(recoPdg) == 13 ) SETBIT(fMask,kIsMuon);
+  
+  Int_t imother = AliAnalysisMuonUtility::GetMotherIndex(mcParticle);
+
+  while ( imother >= 0 ) {
+    AliVParticle* part = mcEvent->GetTrack(imother);
+    
+    Int_t absPdg = TMath::Abs(part->PdgCode());
+    
+    // This is a quark
+    if ( absPdg < 10 ) return kTRUE;
+    
+    fAncestor = imother;
+    Bool_t isPrimary = AliAnalysisMuonUtility::IsPrimary(part, mcEvent);
+    
+    if ( isPrimary ) {
+      Int_t mpdg = absPdg%100000;
+      if ( mpdg >= 100 && mpdg < 10000 ) {
+        Int_t flv  = Int_t ( mpdg / TMath::Power(10, Int_t(TMath::Log10(mpdg) )));
+        if ( flv < 4 ) SETBIT(fMask,kHasLightParent);
+        else if ( flv >= 6 ) continue;
+        else {
+          TParticlePDG* partPdg = TDatabasePDG::Instance()->GetParticle(part->PdgCode());
+          if ( partPdg && ! partPdg->AntiParticle() ) SETBIT(fMask,kHasQuarkoniumParent);
+          else if ( flv == 4 ) SETBIT(fMask,kHasCharmParent);
+          else SETBIT(fMask,kHasBeautyParent);
+        }
+      } // absPdg within 100 and 10000
+    } // is primary
+    else {
+      UInt_t mcProcess = AliAnalysisMuonUtility::GetMCProcess(part);
+      if ( mcProcess == kPHadronic ||
+           ( mcProcess == 0 && part->Zv() < -90. ) ) {
+        // The MC process is not well computed in the AODs of old MC productions
+        // In this case, declare the particle as "secondary" if it is produced inside the front absorber
+        SETBIT(fMask,kIsSecondary);
+//        return kTRUE;
+      }
+    } // is secondary
+    
+    imother = AliAnalysisMuonUtility::GetMotherIndex(part);
+    
+  } // loop on mothers
+  return kTRUE;
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::CheckAncestor ( AliVParticle* track, const AliMCEvent* mcEvent, Int_t ancestorPdg, Bool_t matchAbsPdg )
+{
+  /// Check ancestor
+  Int_t pdgCode = GetAncestorPdg(track, mcEvent);
+  if ( matchAbsPdg ) {
+    pdgCode = TMath::Abs(pdgCode);
+    ancestorPdg = TMath::Abs(ancestorPdg);
+  }
+  return ( pdgCode == ancestorPdg );
+}
+
+//_________________________________________________________
+Int_t AliUtilityMuonAncestor::GetAncestor ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Return ancestor (compute it if necessary)
+  BuildAncestor(track,mcEvent);
+  return fAncestor;
+}
+
+//_________________________________________________________
+Int_t AliUtilityMuonAncestor::GetAncestorPdg ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Return ancestor Pdg
+  if ( BuildAncestor(track,mcEvent) ) {
+    if ( fAncestor >= 0 ) return mcEvent->GetTrack(fAncestor)->PdgCode();
+  }
+  return 0;
+}
+
+//_________________________________________________________
+Long64_t AliUtilityMuonAncestor::GetMask ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Return mask
+  BuildAncestor(track,mcEvent);
+  return fMask;
+}
+
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsBeautyMu ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Muon from beauty decays
+  Long64_t mask = GetMask(track,mcEvent);
+  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kHasBeautyParent) & ! TESTBIT(mask,kHasLightParent) );
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsBJpsiMu ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Muon B->J/psi decays
+  if ( IsBeautyMu(track,mcEvent) ) {
+    Int_t imother = AliAnalysisMuonUtility::GetMotherIndex(track);
+    if ( imother >= 0 ) return ( mcEvent->GetTrack(imother)->PdgCode() == 443 );
+  }
+  return kFALSE;
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsCharmMu ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Muon from charm decays
+  Long64_t mask = GetMask(track,mcEvent);
+  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kHasCharmParent) && ! TESTBIT(mask,kHasBeautyParent) && ! TESTBIT(mask,kHasLightParent) );
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsDecayMu ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Muon from light hadron decays
+  Long64_t mask = GetMask(track,mcEvent);
+  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kHasLightParent) && ! TESTBIT(mask,kIsSecondary) );
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsHadron ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Reconstructed hadron
+  Long64_t mask = GetMask(track,mcEvent);
+  return ( TESTBIT(mask,kIsID) && ! TESTBIT(mask,kIsMuon) );
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsMuon ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Track is muon
+  Long64_t mask = GetMask(track,mcEvent);
+  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) );
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsQuarkoniumMu ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Mu from quarkonium decay
+  Long64_t mask = GetMask(track,mcEvent);
+  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kHasQuarkoniumParent) );
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsSecondaryMu ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Muon from secondary decays in absorber
+  Long64_t mask = GetMask(track,mcEvent);
+  return ( TESTBIT(mask,kIsID) && TESTBIT(mask,kIsMuon) && TESTBIT(mask,kIsSecondary) );
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsUnidentified ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Unidentified muon
+  Long64_t mask = GetMask(track,mcEvent);
+  return ( ! TESTBIT(mask,kIsID) );
+}
+
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsWBosonMu ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Muon from W boson decays
+  return ( IsMuon(track,mcEvent) && CheckAncestor(track,mcEvent,24) );
+}
+          
+//_________________________________________________________
+Bool_t AliUtilityMuonAncestor::IsZBosonMu ( AliVParticle* track, const AliMCEvent* mcEvent )
+{
+  /// Muon from Z boson decays
+  return ( IsMuon(track,mcEvent) && CheckAncestor(track,mcEvent,kZ0) );
+}
index f007aa3..7389ca0 100644 (file)
@@ -1,68 +1,68 @@
-#ifndef ALIUTILITYMUONANCESTOR_H\r
-#define ALIUTILITYMUONANCESTOR_H\r
-\r
-/* $Id: AliUtilityMuonAncestor.h 47782 2011-02-24 18:37:31Z martinez $ */ \r
-\r
-//\r
-// MC utility to classify single muons\r
-//\r
-// Author: Diego Stocco\r
-//\r
-\r
-#include "TObject.h"\r
-\r
-class AliMCEvent;\r
-class AliVParticle;\r
-\r
-class AliUtilityMuonAncestor : public TObject {\r
-public:\r
-  \r
-  AliUtilityMuonAncestor();\r
-  ~AliUtilityMuonAncestor();\r
-  AliUtilityMuonAncestor(const AliUtilityMuonAncestor& obj);\r
-  AliUtilityMuonAncestor& operator=(const AliUtilityMuonAncestor& obj);\r
-  \r
-  enum {\r
-    kIsID,\r
-    kIsMuon,\r
-    kIsSecondary,\r
-    kHasLightParent,\r
-    kHasCharmParent,\r
-    kHasBeautyParent,\r
-    kHasQuarkoniumParent\r
-  };\r
-  \r
-  Bool_t CheckAncestor ( AliVParticle* track, const AliMCEvent* mcEvent, Int_t ancestorPdg, Bool_t matchAbsPdg = kTRUE );\r
-  \r
-  Int_t GetAncestor ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Int_t GetAncestorPdg ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Long64_t GetMask ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-\r
-  Bool_t IsBeautyMu ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsBJpsiMu ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsCharmMu ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsDecayMu ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsHadron ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsMuon ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsQuarkoniumMu ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsSecondaryMu ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsUnidentified ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsWBosonMu ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  Bool_t IsZBosonMu ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-\r
-  \r
-private:\r
-  Bool_t BuildAncestor ( AliVParticle* track, const AliMCEvent* mcEvent );\r
-  \r
-  \r
-  \r
-  Double_t fPx; ///< Particle px\r
-  Double_t fPy; ///< Particle py\r
-  Double_t fPz; ///< Particle pz\r
-  Long64_t fMask; ///< Mask\r
-  Int_t fAncestor; ///< Ancestor position in stack\r
-  \r
-  ClassDef(AliUtilityMuonAncestor, 0);\r
-};\r
-\r
-#endif\r
+#ifndef ALIUTILITYMUONANCESTOR_H
+#define ALIUTILITYMUONANCESTOR_H
+
+/* $Id: AliUtilityMuonAncestor.h 47782 2011-02-24 18:37:31Z martinez $ */ 
+
+//
+// MC utility to classify single muons
+//
+// Author: Diego Stocco
+//
+
+#include "TObject.h"
+
+class AliMCEvent;
+class AliVParticle;
+
+class AliUtilityMuonAncestor : public TObject {
+public:
+  
+  AliUtilityMuonAncestor();
+  ~AliUtilityMuonAncestor();
+  AliUtilityMuonAncestor(const AliUtilityMuonAncestor& obj);
+  AliUtilityMuonAncestor& operator=(const AliUtilityMuonAncestor& obj);
+  
+  enum {
+    kIsID,
+    kIsMuon,
+    kIsSecondary,
+    kHasLightParent,
+    kHasCharmParent,
+    kHasBeautyParent,
+    kHasQuarkoniumParent
+  };
+  
+  Bool_t CheckAncestor ( AliVParticle* track, const AliMCEvent* mcEvent, Int_t ancestorPdg, Bool_t matchAbsPdg = kTRUE );
+  
+  Int_t GetAncestor ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Int_t GetAncestorPdg ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Long64_t GetMask ( AliVParticle* track, const AliMCEvent* mcEvent );
+
+  Bool_t IsBeautyMu ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsBJpsiMu ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsCharmMu ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsDecayMu ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsHadron ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsMuon ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsQuarkoniumMu ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsSecondaryMu ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsUnidentified ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsWBosonMu ( AliVParticle* track, const AliMCEvent* mcEvent );
+  Bool_t IsZBosonMu ( AliVParticle* track, const AliMCEvent* mcEvent );
+
+  
+private:
+  Bool_t BuildAncestor ( AliVParticle* track, const AliMCEvent* mcEvent );
+  
+  
+  
+  Double_t fPx; ///< Particle px
+  Double_t fPy; ///< Particle py
+  Double_t fPz; ///< Particle pz
+  Long64_t fMask; ///< Mask
+  Int_t fAncestor; ///< Ancestor position in stack
+  
+  ClassDef(AliUtilityMuonAncestor, 0);
+};
+
+#endif
index 7fa97ab..85a3a1c 100644 (file)
-#ifndef ALIANALYSISTASKMINIJET_H\r
-#define ALIANALYSISTASKMINIJET_H\r
-\r
-// Two-particle correlations using all particles over pt threshold\r
-// Extract mini-jet yield and fragmentation properties via Delta-Phi histograms\r
-// Can use ESD or AOD, reconstructed and Monte Carlo data as input\r
-// Author: eva.sicking@cern.ch\r
-\r
-class TList;\r
-class TH1F;\r
-class TH2F;\r
-class TProfile;\r
-class THnSparse;\r
-class AliESDtrackCuts;\r
-\r
-#include "AliAnalysisTaskSE.h"\r
-#include <vector>\r
-\r
-class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {\r
- public:\r
-  AliAnalysisTaskMinijet(const char *name="<default name>");\r
-  virtual ~AliAnalysisTaskMinijet();\r
-  \r
-  virtual void UserCreateOutputObjects();\r
-  virtual void UserExec(Option_t* option);\r
-  virtual void Terminate(Option_t *);\r
-  virtual void SetCuts(AliESDtrackCuts* cuts){fCuts = cuts;}\r
-  \r
-  void         SetUseMC(Bool_t useMC=kTRUE, Bool_t mcOnly=kFALSE)    {fUseMC = useMC; fMcOnly=mcOnly;}\r
-  void         SetAnalyseOnlyPrimaries(Bool_t analysePrimOnly)       {fAnalysePrimOnly = analysePrimOnly;} // not used anymore\r
-  void         SetPtRange(Float_t ptMin, Float_t ptMax)              {fPtMin = ptMin; fPtMax = ptMax; }\r
-  void         SetTriggerPtCut(Float_t triggerPtCut)                 {fTriggerPtCut = triggerPtCut;}  \r
-  void         SetAssociatePtCut(Float_t associatePtCut)             {fAssociatePtCut = associatePtCut;} \r
-  void         SetModeEsdAod(Int_t mode)                             {fMode = mode;}\r
-  void         SetTriggerMask(Int_t triggerType)                     {fTriggerType = triggerType;}\r
-  void         SetFilterBit(Int_t filterBit)                         {fFilterBit = filterBit;}\r
-  void         SetMaxVertexZ(Float_t vertexZCut)                     {fVertexZCut = vertexZCut;}\r
-  void         SetMaxEta(Float_t etaCut)                             {fEtaCut = etaCut;}\r
-  void         SetMaxEtaSeed(Float_t etaCutSeed)                     {fEtaCutSeed = etaCutSeed;}\r
-  void         SetSelectParticles(Int_t selectParticles)             {fSelectParticles = selectParticles;}\r
-  void         SetSelectParticlesAssoc(Int_t selectParticlesAssoc)   {fSelectParticlesAssoc = selectParticlesAssoc;}\r
-  void         SetCheckSDD(Bool_t checkSDD, Int_t selOption)         {fCheckSDD = checkSDD; fSelOption = selOption;}\r
-  void         SetCorrStrangeness(Bool_t corrStrangeness)            {fCorrStrangeness = corrStrangeness;}\r
-  void         SetThreeParticleCorrelation(Bool_t threeParticleCorr) {fThreeParticleCorr = threeParticleCorr;}\r
-  void         SetRejectCorrupted(Bool_t rejectChunks, Int_t nTPC)   {fRejectChunks = rejectChunks; fNTPC = nTPC;}\r
-\r
-    void         SetCentralityMethod(TString centralityMethod)                   {fCentralityMethod = centralityMethod;}\r
-    \r
-    \r
- private:\r
-\r
-  Double_t ReadEventESD         (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
-                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
-                             std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
-  Double_t ReadEventESDRecMcProp(std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
-                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
-                             std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
-  Double_t ReadEventESDMC       (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
-                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
-                             std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
-  \r
-  Double_t ReadEventAOD         (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
-                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
-                             std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
-  Double_t ReadEventAODRecMcProp(std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
-                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
-                             std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
-  Double_t ReadEventAODMC       (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,\r
-                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,\r
-                             std::vector<Float_t> &strangnessWeight,\r
-                             std::vector<Double_t> &nTracksTracklets, const Int_t step);\r
-  \r
-  void  Analyse         (const std::vector<Float_t> &pt, \r
-                        const std::vector<Float_t> &eta, \r
-                        const std::vector<Float_t> &phi, \r
-                        const std::vector<Short_t> &charge, \r
-                        const std::vector<Float_t> &strangnessWeight,\r
-                        const Double_t ntacks, const Int_t ntacklets=0,\r
-                        const Int_t nAll=0, const Int_t step=0);\r
-  \r
-  Bool_t                 SelectParticlePlusCharged(const Short_t charge, const Int_t pdg, const Bool_t prim);\r
-  Bool_t                 SelectParticle(const Short_t charge, const Int_t pdg, const Bool_t prim);\r
-  Bool_t                 CheckEvent(const Bool_t recVertex);\r
-  const Double_t*        CreateLogAxis(const Int_t nbins, const Double_t xmin, const Double_t xmax); \r
-  Bool_t                 CheckLikeSign(const Short_t chargeEventAxis, const Short_t chargeOthers);\r
-\r
-\r
-  Bool_t       fUseMC;                      // flag for Monte Carlo usages\r
-  Bool_t       fMcOnly;                     // flag defines, if only MC data is used in analysis or also reconstructed data\r
-  Double_t     fBSign;                      // magnetic field\r
-  Bool_t       fAnalysePrimOnly;            // flag for analysis of primaries only (also in reconstructed data)\r
-  Float_t      fPtMin;                      // set lower limit for pt acceptance for mutliplicity defintion\r
-  Float_t      fPtMax;                      // set upper limit for pt acceptance for mutliplicity defintion\r
-  AliESDtrackCuts* fCuts;                   // List of cuts for ESDs\r
-  Float_t      fTriggerPtCut;               // cut on particle pt used as event axis\r
-  Float_t      fAssociatePtCut;             // cut on particle pt used for correlations\r
-  Int_t        fMode;                       // ESD(=0) of AOD(=1) reading \r
-  Int_t        fTriggerType;                // sets trigger -> AliVEvent::kMB, AliVEvent::kHighMult\r
-  Int_t        fFilterBit;                  // Filter bit written in ESD filter, select track type\r
-  Float_t      fVertexZCut;                 // vertex cut\r
-  Float_t      fEtaCut;                     // eta acceptance cut\r
-  Float_t      fEtaCutSeed;                 // eta acceptance cut for seed\r
-  Int_t        fSelectParticles;            // only in cas of MC: use also neutral particles or not \r
-  Int_t        fSelectParticlesAssoc;       // only in cas of MC: use also neutral particles or not \r
-  Bool_t       fCheckSDD;                   // check if SDD was in read out partition (needed for LHC11a)\r
-  Int_t        fSelOption;                  // 0 = use hit in SDD for event selection, 1 = use trigger for event selection\r
-  Bool_t       fCorrStrangeness;            // for data correction -> Pythia simulations underestimate contamination from strangness\r
-  Bool_t       fThreeParticleCorr;          // perform three particle correlation\r
-  Bool_t       fRejectChunks;               // rejection of chunks in which no ITS tracks are reconstructed\r
-  Int_t        fNTPC;                       // track number limit for rejection decision.\r
-\r
-  AliESDEvent *fESDEvent;                   //! esd event\r
-  AliAODEvent *fAODEvent;                   //! aod event\r
-  Double_t        fNMcPrimAccept;              // global variable for mc multiplucity\r
-  Double_t        fNRecAccept;                 // global variable for rec multiplucity\r
-  Float_t      fNRecAcceptStrangeCorr;                 // global variable for rec multiplucity\r
-  Double_t        fNMcPrimAcceptTracklet;      // global variable for mc multiplucity\r
-  Double_t        fNRecAcceptTracklet;         // global variable for rec multiplucity\r
-  Float_t      fVzEvent;                    // global variable for rec vertex position\r
-  Double_t     fMeanPtRec;                  // global variable for rec mean pt\r
-  Double_t     fLeadingPtRec;               // global variable for rec mean pt\r
-\r
-  TList             *fHists;                       // output list\r
-  TH1F       *fStep;                        // how many events have passed which correction step\r
-  TH1F       *fEventStat;                   // how many events are accepted by trigger, vertex selection, 1 track in acceptance (for real data)\r
-  TH1F       *fHistPt;                      // Pt spectrum ESD\r
-  TH1F       *fHistPtMC;                    // Pt spectrum MC\r
-  TH2F       *fNContrNtracklets;            // control histogram for vertex->nContributers and number of tracklets\r
-  TH2F       *fNContrNtracks;               // control histogram for vertex->nContributers and number of tracks\r
-  TH2F       *fCorruptedChunks;             // control histogram: TPC tracks versus ITS-TPC-tracks\r
-  TH2F       *fCorruptedChunksAfter;        // control histogram: TPC tracks versus ITS-TPC-tracks\r
-\r
-  TH2F       *fNmcNch;                      // N mc - N ch rec\r
-  TProfile   *fPNmcNch;                     // N mc - N ch rec\r
-  TH2F       *fNmcNchVtx;                   // N mc - N ch rec for events with reconstructed vertex\r
-  TH2F       *fNmcNchVtxStrangeCorr;        // N mc - N ch rec for events with reconstructed vertex + strangeness correction\r
-  TProfile   *fPNmcNchVtx;                  // N mc - N ch rec for events with reconstructed vertex\r
-  TH2F       *fNmcNchTracklet;              // N mc - N ch rec\r
-  TProfile   *fPNmcNchTracklet;             // N mc - N ch rec\r
-  TH2F       *fNmcNchVtxTracklet;           // N mc - N ch rec for events with reconstructed vertex\r
-  TProfile   *fPNmcNchVtxTracklet;          // N mc - N ch rec for events with reconstructed vertex\r
-  TH2F       *fChargedPi0;                  // charged versus charged+Pi0\r
-  TH1F       *fVertexCheck;                 // check which fraction of events has vtx_rec but no good vtx_mc\r
-  TH1F       *fPropagateDca;                // check of AliAODtrack::PropagateToDca\r
-\r
-  THnSparse  *fMapSingleTrig[8];            //! multi-dim histo for trigger track properties\r
-  THnSparse  *fMapPair[8];                  //! multi-dim histo for pair properties\r
-  THnSparse  *fMapEvent[8];                 //! multi-dim histo for event properties\r
-  THnSparse  *fMapAll[8];                   //! multi-dim histo for properties of all analysed tracks\r
-  THnSparse  *fMapThree[8];                 //! multi-dim histo for properties of three particle correlations\r
-  \r
-  TH1F       * fVertexZ[8];                 // z of vertex\r
-  TH1F       * fNcharge[8];                 // pt\r
-  TH1F       * fPt[8];                      // pt\r
-  TH1F       * fEta[8];                     // eta\r
-  TH1F       * fPhi[8];                     // phi\r
-  TH1F       * fDcaXY[8];                   // dca xy direction\r
-  TH1F       * fDcaZ[8];                    // dca z direction\r
-\r
-  TH1F       * fPtSeed[8];                  // pt of seed (event axis)\r
-  TH1F       * fEtaSeed[8];                 // eta of seed \r
-  TH1F       * fPhiSeed[8];                 // phi of seed\r
-\r
-  TH1F       * fPtOthers[8];                // pt of all other particels used in dEtadPhi\r
-  TH1F       * fEtaOthers[8];               // eta of all other particels used in dEtadPhi\r
-  TH1F       * fPhiOthers[8];               // phi of all other particels used in dEtadPhi\r
-  TH2F       * fPtEtaOthers[8];             // pt-eta of all other particels used in dEtadPhi\r
-\r
-\r
-  TH2F       * fPhiEta[8];                  // eta - phi\r
-  TH2F       * fDPhiDEtaEventAxis[8];       // correlation dEta-dPhi towards event axis\r
-  TH2F       * fDPhiDEtaEventAxisSeeds[8];  // correlation dEta-dPhi towards event axis of trigger particles\r
-  TH1F       * fTriggerNch[8];              // number of triggers with accepted-track number\r
-  TH2F       * fTriggerNchSeeds[8];         // number of triggers with accepted-track number\r
-  TH1F       * fTriggerTracklet[8];         // number of triggers with accepted-tracklet number\r
-  TH2F       * fNch07Nch[8];                // nCharged with pT>fTriggerPtCut vs nCharged\r
-  TProfile   * fPNch07Nch[8];               // nCharged with pT>fTriggerPtCut vs nCharged\r
-  \r
-  TH2F       * fNch07Tracklet[8];           // nCharged with pT>fTriggerPtCut vs nTracklet\r
-  TH2F       * fNchTracklet[8];             // nCharged vs nTracklet\r
-  TProfile   * fPNch07Tracklet[8];           // nCharged with pT>fTriggerPtCut vs nTracklet\r
-\r
-  TH1F       * fDPhiEventAxis[8];           // delta phi of associate tracks to event axis\r
-  TH2F       * fDPhi1DPhi2[8];              // dPhi1 versus dPhi2: three particle correlation test\r
-    \r
-    TString fCentralityMethod;        //centrality pA\r
\r
-  AliAnalysisTaskMinijet(const AliAnalysisTaskMinijet&); // not implemented\r
-  AliAnalysisTaskMinijet& operator=(const AliAnalysisTaskMinijet&); // not implemented\r
-  \r
-  ClassDef(AliAnalysisTaskMinijet, 2); // mini jet analysis with two particle correlations\r
-};\r
-\r
-#endif\r
+#ifndef ALIANALYSISTASKMINIJET_H
+#define ALIANALYSISTASKMINIJET_H
+
+// Two-particle correlations using all particles over pt threshold
+// Extract mini-jet yield and fragmentation properties via Delta-Phi histograms
+// Can use ESD or AOD, reconstructed and Monte Carlo data as input
+// Author: eva.sicking@cern.ch
+
+class TList;
+class TH1F;
+class TH2F;
+class TProfile;
+class THnSparse;
+class AliESDtrackCuts;
+
+#include "AliAnalysisTaskSE.h"
+#include <vector>
+
+class AliAnalysisTaskMinijet : public AliAnalysisTaskSE {
+ public:
+  AliAnalysisTaskMinijet(const char *name="<default name>");
+  virtual ~AliAnalysisTaskMinijet();
+  
+  virtual void UserCreateOutputObjects();
+  virtual void UserExec(Option_t* option);
+  virtual void Terminate(Option_t *);
+  virtual void SetCuts(AliESDtrackCuts* cuts){fCuts = cuts;}
+  
+  void         SetUseMC(Bool_t useMC=kTRUE, Bool_t mcOnly=kFALSE)    {fUseMC = useMC; fMcOnly=mcOnly;}
+  void         SetAnalyseOnlyPrimaries(Bool_t analysePrimOnly)       {fAnalysePrimOnly = analysePrimOnly;} // not used anymore
+  void         SetPtRange(Float_t ptMin, Float_t ptMax)              {fPtMin = ptMin; fPtMax = ptMax; }
+  void         SetTriggerPtCut(Float_t triggerPtCut)                 {fTriggerPtCut = triggerPtCut;}  
+  void         SetAssociatePtCut(Float_t associatePtCut)             {fAssociatePtCut = associatePtCut;} 
+  void         SetModeEsdAod(Int_t mode)                             {fMode = mode;}
+  void         SetTriggerMask(Int_t triggerType)                     {fTriggerType = triggerType;}
+  void         SetFilterBit(Int_t filterBit)                         {fFilterBit = filterBit;}
+  void         SetMaxVertexZ(Float_t vertexZCut)                     {fVertexZCut = vertexZCut;}
+  void         SetMaxEta(Float_t etaCut)                             {fEtaCut = etaCut;}
+  void         SetMaxEtaSeed(Float_t etaCutSeed)                     {fEtaCutSeed = etaCutSeed;}
+  void         SetSelectParticles(Int_t selectParticles)             {fSelectParticles = selectParticles;}
+  void         SetSelectParticlesAssoc(Int_t selectParticlesAssoc)   {fSelectParticlesAssoc = selectParticlesAssoc;}
+  void         SetCheckSDD(Bool_t checkSDD, Int_t selOption)         {fCheckSDD = checkSDD; fSelOption = selOption;}
+  void         SetCorrStrangeness(Bool_t corrStrangeness)            {fCorrStrangeness = corrStrangeness;}
+  void         SetThreeParticleCorrelation(Bool_t threeParticleCorr) {fThreeParticleCorr = threeParticleCorr;}
+  void         SetRejectCorrupted(Bool_t rejectChunks, Int_t nTPC)   {fRejectChunks = rejectChunks; fNTPC = nTPC;}
+
+    void         SetCentralityMethod(TString centralityMethod)                   {fCentralityMethod = centralityMethod;}
+    
+    
+ private:
+
+  Double_t ReadEventESD         (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,
+                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,
+                             std::vector<Float_t> &strangnessWeight,
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);
+  Double_t ReadEventESDRecMcProp(std::vector<Float_t> &pt,  std::vector<Float_t> &eta,
+                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,
+                             std::vector<Float_t> &strangnessWeight,
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);
+  Double_t ReadEventESDMC       (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,
+                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,
+                             std::vector<Float_t> &strangnessWeight,
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);
+  
+  Double_t ReadEventAOD         (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,
+                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,
+                             std::vector<Float_t> &strangnessWeight,
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);
+  Double_t ReadEventAODRecMcProp(std::vector<Float_t> &pt,  std::vector<Float_t> &eta,
+                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,
+                             std::vector<Float_t> &strangnessWeight,
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);
+  Double_t ReadEventAODMC       (std::vector<Float_t> &pt,  std::vector<Float_t> &eta,
+                             std::vector<Float_t> &phi,  std::vector<Short_t> &charge,
+                             std::vector<Float_t> &strangnessWeight,
+                             std::vector<Double_t> &nTracksTracklets, const Int_t step);
+  
+  void  Analyse         (const std::vector<Float_t> &pt, 
+                        const std::vector<Float_t> &eta, 
+                        const std::vector<Float_t> &phi, 
+                        const std::vector<Short_t> &charge, 
+                        const std::vector<Float_t> &strangnessWeight,
+                        const Double_t ntacks, const Int_t ntacklets=0,
+                        const Int_t nAll=0, const Int_t step=0);
+  
+  Bool_t                 SelectParticlePlusCharged(const Short_t charge, const Int_t pdg, const Bool_t prim);
+  Bool_t                 SelectParticle(const Short_t charge, const Int_t pdg, const Bool_t prim);
+  Bool_t                 CheckEvent(const Bool_t recVertex);
+  const Double_t*        CreateLogAxis(const Int_t nbins, const Double_t xmin, const Double_t xmax); 
+  Bool_t                 CheckLikeSign(const Short_t chargeEventAxis, const Short_t chargeOthers);
+
+
+  Bool_t       fUseMC;                      // flag for Monte Carlo usages
+  Bool_t       fMcOnly;                     // flag defines, if only MC data is used in analysis or also reconstructed data
+  Double_t     fBSign;                      // magnetic field
+  Bool_t       fAnalysePrimOnly;            // flag for analysis of primaries only (also in reconstructed data)
+  Float_t      fPtMin;                      // set lower limit for pt acceptance for mutliplicity defintion
+  Float_t      fPtMax;                      // set upper limit for pt acceptance for mutliplicity defintion
+  AliESDtrackCuts* fCuts;                   // List of cuts for ESDs
+  Float_t      fTriggerPtCut;               // cut on particle pt used as event axis
+  Float_t      fAssociatePtCut;             // cut on particle pt used for correlations
+  Int_t        fMode;                       // ESD(=0) of AOD(=1) reading 
+  Int_t        fTriggerType;                // sets trigger -> AliVEvent::kMB, AliVEvent::kHighMult
+  Int_t        fFilterBit;                  // Filter bit written in ESD filter, select track type
+  Float_t      fVertexZCut;                 // vertex cut
+  Float_t      fEtaCut;                     // eta acceptance cut
+  Float_t      fEtaCutSeed;                 // eta acceptance cut for seed
+  Int_t        fSelectParticles;            // only in cas of MC: use also neutral particles or not 
+  Int_t        fSelectParticlesAssoc;       // only in cas of MC: use also neutral particles or not 
+  Bool_t       fCheckSDD;                   // check if SDD was in read out partition (needed for LHC11a)
+  Int_t        fSelOption;                  // 0 = use hit in SDD for event selection, 1 = use trigger for event selection
+  Bool_t       fCorrStrangeness;            // for data correction -> Pythia simulations underestimate contamination from strangness
+  Bool_t       fThreeParticleCorr;          // perform three particle correlation
+  Bool_t       fRejectChunks;               // rejection of chunks in which no ITS tracks are reconstructed
+  Int_t        fNTPC;                       // track number limit for rejection decision.
+
+  AliESDEvent *fESDEvent;                   //! esd event
+  AliAODEvent *fAODEvent;                   //! aod event
+  Double_t        fNMcPrimAccept;              // global variable for mc multiplucity
+  Double_t        fNRecAccept;                 // global variable for rec multiplucity
+  Float_t      fNRecAcceptStrangeCorr;                 // global variable for rec multiplucity
+  Double_t        fNMcPrimAcceptTracklet;      // global variable for mc multiplucity
+  Double_t        fNRecAcceptTracklet;         // global variable for rec multiplucity
+  Float_t      fVzEvent;                    // global variable for rec vertex position
+  Double_t     fMeanPtRec;                  // global variable for rec mean pt
+  Double_t     fLeadingPtRec;               // global variable for rec mean pt
+
+  TList             *fHists;                       // output list
+  TH1F       *fStep;                        // how many events have passed which correction step
+  TH1F       *fEventStat;                   // how many events are accepted by trigger, vertex selection, 1 track in acceptance (for real data)
+  TH1F       *fHistPt;                      // Pt spectrum ESD
+  TH1F       *fHistPtMC;                    // Pt spectrum MC
+  TH2F       *fNContrNtracklets;            // control histogram for vertex->nContributers and number of tracklets
+  TH2F       *fNContrNtracks;               // control histogram for vertex->nContributers and number of tracks
+  TH2F       *fCorruptedChunks;             // control histogram: TPC tracks versus ITS-TPC-tracks
+  TH2F       *fCorruptedChunksAfter;        // control histogram: TPC tracks versus ITS-TPC-tracks
+
+  TH2F       *fNmcNch;                      // N mc - N ch rec
+  TProfile   *fPNmcNch;                     // N mc - N ch rec
+  TH2F       *fNmcNchVtx;                   // N mc - N ch rec for events with reconstructed vertex
+  TH2F       *fNmcNchVtxStrangeCorr;        // N mc - N ch rec for events with reconstructed vertex + strangeness correction
+  TProfile   *fPNmcNchVtx;                  // N mc - N ch rec for events with reconstructed vertex
+  TH2F       *fNmcNchTracklet;              // N mc - N ch rec
+  TProfile   *fPNmcNchTracklet;             // N mc - N ch rec
+  TH2F       *fNmcNchVtxTracklet;           // N mc - N ch rec for events with reconstructed vertex
+  TProfile   *fPNmcNchVtxTracklet;          // N mc - N ch rec for events with reconstructed vertex
+  TH2F       *fChargedPi0;                  // charged versus charged+Pi0
+  TH1F       *fVertexCheck;                 // check which fraction of events has vtx_rec but no good vtx_mc
+  TH1F       *fPropagateDca;                // check of AliAODtrack::PropagateToDca
+
+  THnSparse  *fMapSingleTrig[8];            //! multi-dim histo for trigger track properties
+  THnSparse  *fMapPair[8];                  //! multi-dim histo for pair properties
+  THnSparse  *fMapEvent[8];                 //! multi-dim histo for event properties
+  THnSparse  *fMapAll[8];                   //! multi-dim histo for properties of all analysed tracks
+  THnSparse  *fMapThree[8];                 //! multi-dim histo for properties of three particle correlations
+  
+  TH1F       * fVertexZ[8];                 // z of vertex
+  TH1F       * fNcharge[8];                 // pt
+  TH1F       * fPt[8];                      // pt
+  TH1F       * fEta[8];                     // eta
+  TH1F       * fPhi[8];                     // phi
+  TH1F       * fDcaXY[8];                   // dca xy direction
+  TH1F       * fDcaZ[8];                    // dca z direction
+
+  TH1F       * fPtSeed[8];                  // pt of seed (event axis)
+  TH1F       * fEtaSeed[8];                 // eta of seed 
+  TH1F       * fPhiSeed[8];                 // phi of seed
+
+  TH1F       * fPtOthers[8];                // pt of all other particels used in dEtadPhi
+  TH1F       * fEtaOthers[8];               // eta of all other particels used in dEtadPhi
+  TH1F       * fPhiOthers[8];               // phi of all other particels used in dEtadPhi
+  TH2F       * fPtEtaOthers[8];             // pt-eta of all other particels used in dEtadPhi
+
+
+  TH2F       * fPhiEta[8];                  // eta - phi
+  TH2F       * fDPhiDEtaEventAxis[8];       // correlation dEta-dPhi towards event axis
+  TH2F       * fDPhiDEtaEventAxisSeeds[8];  // correlation dEta-dPhi towards event axis of trigger particles
+  TH1F       * fTriggerNch[8];              // number of triggers with accepted-track number
+  TH2F       * fTriggerNchSeeds[8];         // number of triggers with accepted-track number
+  TH1F       * fTriggerTracklet[8];         // number of triggers with accepted-tracklet number
+  TH2F       * fNch07Nch[8];                // nCharged with pT>fTriggerPtCut vs nCharged
+  TProfile   * fPNch07Nch[8];               // nCharged with pT>fTriggerPtCut vs nCharged
+  
+  TH2F       * fNch07Tracklet[8];           // nCharged with pT>fTriggerPtCut vs nTracklet
+  TH2F       * fNchTracklet[8];             // nCharged vs nTracklet
+  TProfile   * fPNch07Tracklet[8];           // nCharged with pT>fTriggerPtCut vs nTracklet
+
+  TH1F       * fDPhiEventAxis[8];           // delta phi of associate tracks to event axis
+  TH2F       * fDPhi1DPhi2[8];              // dPhi1 versus dPhi2: three particle correlation test
+    
+    TString fCentralityMethod;        //centrality pA
+  AliAnalysisTaskMinijet(const AliAnalysisTaskMinijet&); // not implemented
+  AliAnalysisTaskMinijet& operator=(const AliAnalysisTaskMinijet&); // not implemented
+  
+  ClassDef(AliAnalysisTaskMinijet, 2); // mini jet analysis with two particle correlations
+};
+
+#endif
index 5d59f51..e6bc790 100644 (file)
@@ -156,7 +156,7 @@ private:
     
     ClassDef( AliPIDCorrParticle, 1); // class which contains only quantities requires for this analysis to reduce memory consumption for event mixing
 };
-\r
+
 
 
 #endif
index f55cb1f..5992aad 100644 (file)
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-\r
-#include "AliTwoParticlePIDCorr.h"\r
-#include "AliVParticle.h"\r
-#include "TFormula.h"\r
-#include "TAxis.h"\r
-#include "TChain.h"\r
-#include "TTree.h"\r
-#include "TH1F.h"\r
-#include "TH2F.h"\r
-#include "TH3F.h"\r
-#include "TList.h"\r
-#include "TFile.h"\r
-\r
-#include "AliCentrality.h"\r
-#include "Riostream.h"\r
-\r
-#include <TSpline.h>\r
-#include <AliPID.h>\r
-#include "AliESDpid.h"\r
-#include "AliAODpidUtil.h"\r
-#include <AliPIDResponse.h>\r
-\r
-#include <AliAnalysisManager.h>\r
-#include <AliInputEventHandler.h>\r
-#include "AliAODInputHandler.h"\r
-\r
-#include "AliAnalysisTaskSE.h"\r
-#include "AliAnalysisManager.h"\r
-#include "AliCentrality.h"\r
-\r
-#include "AliVEvent.h"\r
-#include "AliAODEvent.h"\r
-#include "AliAODTrack.h"\r
-#include "AliVTrack.h"\r
-\r
-#include "THnSparse.h"\r
-\r
-#include "AliAODMCHeader.h"\r
-#include "AliAODMCParticle.h"\r
-#include "AliMCEventHandler.h"\r
-#include "AliMCEvent.h"\r
-#include "AliMCParticle.h"\r
-#include "TParticle.h"\r
-#include <TDatabasePDG.h>\r
-#include <TParticlePDG.h>\r
-\r
-#include "AliGenCocktailEventHeader.h"\r
-#include "AliGenEventHeader.h"\r
-\r
-#include "AliEventPoolManager.h"\r
-//#include "AliAnalysisUtils.h"\r
-using namespace AliPIDNameSpace;\r
-using namespace std;\r
-\r
-ClassImp(AliTwoParticlePIDCorr)\r
-ClassImp(LRCParticlePID)\r
-//________________________________________________________________________\r
-AliTwoParticlePIDCorr::AliTwoParticlePIDCorr() // All data members should be initialised here\r
-:AliAnalysisTaskSE(),\r
-  fOutput(0),\r
-  fCentralityMethod("V0A"),\r
-  fSampleType("pPb"),\r
-fnTracksVertex(1),  // QA tracks pointing to principal vertex (= 3 default)\r
-  trkVtx(0),\r
-  zvtx(0),\r
-  fFilterBit(768),\r
-  fzvtxcut(10.0),\r
-  ffilltrigassoUNID(kFALSE),\r
-  ffilltrigUNIDassoID(kFALSE),\r
-  ffilltrigIDassoUNID(kTRUE),\r
-  ffilltrigIDassoID(kFALSE),\r
-  ffilltrigIDassoIDMCTRUTH(kFALSE),\r
-  fPtOrderMCTruth(kFALSE),\r
-  fTriggerSpeciesSelection(kFALSE),\r
-  fAssociatedSpeciesSelection(kFALSE),\r
-  fTriggerSpecies(SpPion),\r
-  fAssociatedSpecies(SpPion),\r
-  fCustomBinning(""),\r
-  fBinningString(""),\r
-  fcontainPIDtrig(kTRUE),\r
-  fcontainPIDasso(kFALSE),\r
-//frejectPileUp(kFALSE),\r
-  fminPt(0.2),\r
-  fmaxPt(10.0),\r
-  fmineta(-0.8),\r
-  fmaxeta(0.8),\r
-  fminprotonsigmacut(-6.0),\r
-  fmaxprotonsigmacut(-3.0),\r
-  fminpionsigmacut(0.0),\r
-  fmaxpionsigmacut(4.0),\r
-  fselectprimaryTruth(kTRUE),\r
-  fonlyprimarydatareco(kFALSE),\r
-  fdcacut(kFALSE),\r
-  fdcacutvalue(3.0),\r
-  ffillhistQAReco(kFALSE),\r
-  ffillhistQATruth(kFALSE),\r
-  kTrackVariablesPair(0),\r
-  fminPtTrig(0),\r
-  fmaxPtTrig(0),\r
-  fminPtComboeff(2.0),\r
-  fmaxPtComboeff(4.0), \r
-  fminPtAsso(0),\r
-  fmaxPtAsso(0), \r
-  fhistcentrality(0),\r
-  fEventCounter(0),\r
-  fEtaSpectrasso(0),\r
-  fphiSpectraasso(0),\r
-  MCtruthpt(0),\r
-  MCtrutheta(0),\r
-  MCtruthphi(0),\r
-  MCtruthpionpt(0),\r
-  MCtruthpioneta(0),\r
-  MCtruthpionphi(0),\r
-  MCtruthkaonpt(0),\r
-  MCtruthkaoneta(0),\r
-  MCtruthkaonphi(0),\r
-  MCtruthprotonpt(0),\r
-  MCtruthprotoneta(0),\r
-  MCtruthprotonphi(0),\r
-  fPioncont(0),\r
-  fKaoncont(0),\r
-  fProtoncont(0),\r
-  fCentralityCorrelation(0x0),\r
-  fHistoTPCdEdx(0x0),\r
-  fHistoTOFbeta(0x0),\r
-  fTPCTOFPion3d(0),\r
-  fTPCTOFKaon3d(0),\r
-  fTPCTOFProton3d(0),\r
-  fPionPt(0),\r
-  fPionEta(0),\r
-  fPionPhi(0),\r
-  fKaonPt(0),\r
-  fKaonEta(0),\r
-  fKaonPhi(0),\r
-  fProtonPt(0),\r
-  fProtonEta(0),\r
-  fProtonPhi(0),\r
-  fCorrelatonTruthPrimary(0),\r
-  fCorrelatonTruthPrimarymix(0),\r
-  fTHnCorrUNID(0),\r
-  fTHnCorrUNIDmix(0),\r
-  fTHnCorrID(0),\r
-  fTHnCorrIDmix(0),\r
-  fTHnCorrIDUNID(0),\r
-  fTHnCorrIDUNIDmix(0),\r
-  fTHnTrigcount(0),\r
-  fTHnTrigcountMCTruthPrim(0),\r
-  fPoolMgr(0x0),\r
-  fArrayMC(0),\r
-  fAnalysisType("MCAOD"), \r
-  fefffilename(""),\r
-  twoTrackEfficiencyCutValue(0.02),\r
-//fControlConvResoncances(0),\r
-  fPID(NULL),\r
- eventno(0),\r
-  fPtTOFPIDmin(0.6),\r
-  fPtTOFPIDmax(4.0),\r
-  fRequestTOFPID(kTRUE),\r
-  fPIDType(NSigmaTPCTOF),\r
-  fNSigmaPID(3),\r
-  fUseExclusiveNSigma(kFALSE),\r
-  fRemoveTracksT0Fill(kFALSE),\r
-fSelectCharge(0),\r
-fTriggerSelectCharge(0),\r
-fAssociatedSelectCharge(0),\r
-fTriggerRestrictEta(-1),\r
-fEtaOrdering(kFALSE),\r
-fCutConversions(kFALSE),\r
-fCutResonances(kFALSE),\r
-fRejectResonanceDaughters(-1),\r
-  fOnlyOneEtaSide(0),\r
-fInjectedSignals(kFALSE),\r
-  fRemoveWeakDecays(kFALSE),\r
-fRemoveDuplicates(kFALSE),\r
-  fapplyTrigefficiency(kFALSE),\r
-  fapplyAssoefficiency(kFALSE),\r
-  ffillefficiency(kFALSE),\r
-  fmesoneffrequired(kFALSE),\r
-  fkaonprotoneffrequired(kFALSE),\r
-//fAnalysisUtils(0x0),\r
-  fDCAXYCut(0)     \r
-\r
-{ \r
- for ( Int_t i = 0; i < 16; i++) { \r
-    fHistQA[i] = NULL;\r
-  }\r
-\r
- for ( Int_t i = 0; i < 6; i++ ){\r
-    fTHnrecomatchedallPid[i] = NULL;\r
-    fTHngenprimPidTruth[i] = NULL;\r
-    effcorection[i]=NULL;\r
-    //effmap[i]=NULL;\r
-\r
-  }\r
-\r
- for(Int_t ipart=0;ipart<NSpecies;ipart++)\r
-    for(Int_t ipid=0;ipid<=NSigmaPIDType;ipid++)\r
-      fnsigmas[ipart][ipid]=999.;\r
-\r
- for(Int_t ipart=0;ipart<NSpecies;ipart++) {fHasDoubleCounting[ipart]=kFALSE;}\r
-\r
-  }\r
-//________________________________________________________________________\r
-AliTwoParticlePIDCorr::AliTwoParticlePIDCorr(const char *name) // All data members should be initialised here\r
-  :AliAnalysisTaskSE(name),\r
- fOutput(0),\r
- fCentralityMethod("V0A"),\r
-  fSampleType("pPb"),\r
-  fnTracksVertex(1),  // QA tracks pointing to principal vertex (= 3 default)\r
-  trkVtx(0),\r
-  zvtx(0),\r
-  fFilterBit(768),\r
-  fzvtxcut(10.0),\r
-  ffilltrigassoUNID(kFALSE),\r
-  ffilltrigUNIDassoID(kFALSE),\r
-  ffilltrigIDassoUNID(kTRUE),\r
-  ffilltrigIDassoID(kFALSE),\r
-  ffilltrigIDassoIDMCTRUTH(kFALSE),\r
-  fPtOrderMCTruth(kFALSE),\r
-  fTriggerSpeciesSelection(kFALSE),\r
-  fAssociatedSpeciesSelection(kFALSE),\r
-  fTriggerSpecies(SpPion),\r
-  fAssociatedSpecies(SpPion),\r
-  fCustomBinning(""),\r
-  fBinningString(""),\r
-  fcontainPIDtrig(kTRUE),\r
-  fcontainPIDasso(kFALSE),\r
-   // frejectPileUp(kFALSE),\r
-  fminPt(0.2),\r
-  fmaxPt(10.0),\r
-  fmineta(-0.8),\r
-  fmaxeta(0.8),\r
-   fminprotonsigmacut(-6.0),\r
-   fmaxprotonsigmacut(-3.0),\r
-   fminpionsigmacut(0.0),\r
-   fmaxpionsigmacut(4.0),\r
-  fselectprimaryTruth(kTRUE),\r
-  fonlyprimarydatareco(kFALSE),\r
-   fdcacut(kFALSE),\r
-  fdcacutvalue(3.0),\r
-  ffillhistQAReco(kFALSE),\r
-  ffillhistQATruth(kFALSE),\r
- kTrackVariablesPair(0),\r
-  fminPtTrig(0),\r
-  fmaxPtTrig(0),\r
-  fminPtComboeff(2.0),\r
-  fmaxPtComboeff(4.0), \r
-  fminPtAsso(0),\r
-  fmaxPtAsso(0), \r
-  fhistcentrality(0),\r
-  fEventCounter(0),\r
-  fEtaSpectrasso(0),\r
-  fphiSpectraasso(0),\r
-  MCtruthpt(0),\r
-  MCtrutheta(0),\r
-  MCtruthphi(0),\r
-  MCtruthpionpt(0),\r
-  MCtruthpioneta(0),\r
-  MCtruthpionphi(0),\r
-  MCtruthkaonpt(0),\r
-  MCtruthkaoneta(0),\r
-  MCtruthkaonphi(0),\r
-  MCtruthprotonpt(0),\r
-  MCtruthprotoneta(0),\r
-  MCtruthprotonphi(0),\r
-  fPioncont(0),\r
-  fKaoncont(0),\r
-  fProtoncont(0),\r
-  fCentralityCorrelation(0x0),\r
-  fHistoTPCdEdx(0x0),\r
-  fHistoTOFbeta(0x0),\r
-  fTPCTOFPion3d(0),\r
-  fTPCTOFKaon3d(0),\r
-  fTPCTOFProton3d(0),\r
-  fPionPt(0),\r
-  fPionEta(0),\r
-  fPionPhi(0),\r
-  fKaonPt(0),\r
-  fKaonEta(0),\r
-  fKaonPhi(0),\r
-  fProtonPt(0),\r
-  fProtonEta(0),\r
-  fProtonPhi(0),\r
-  fCorrelatonTruthPrimary(0),\r
- fCorrelatonTruthPrimarymix(0),\r
-  fTHnCorrUNID(0),\r
-  fTHnCorrUNIDmix(0),\r
-  fTHnCorrID(0),\r
-  fTHnCorrIDmix(0),\r
-  fTHnCorrIDUNID(0),\r
-  fTHnCorrIDUNIDmix(0),\r
-  fTHnTrigcount(0),\r
-  fTHnTrigcountMCTruthPrim(0),\r
-   fPoolMgr(0x0),\r
-  fArrayMC(0),\r
-  fAnalysisType("MCAOD"),\r
-   fefffilename(""), \r
-  twoTrackEfficiencyCutValue(0.02),\r
-//fControlConvResoncances(0),\r
-  fPID(NULL),\r
- eventno(0),\r
- fPtTOFPIDmin(0.6),\r
-  fPtTOFPIDmax(4.0),\r
-  fRequestTOFPID(kTRUE),\r
-  fPIDType(NSigmaTPCTOF),\r
-  fNSigmaPID(3),\r
-  fUseExclusiveNSigma(kFALSE),\r
-  fRemoveTracksT0Fill(kFALSE),\r
-fSelectCharge(0),\r
-fTriggerSelectCharge(0),\r
-fAssociatedSelectCharge(0),\r
-fTriggerRestrictEta(-1),\r
-fEtaOrdering(kFALSE),\r
-fCutConversions(kFALSE),\r
-fCutResonances(kFALSE),\r
-fRejectResonanceDaughters(-1),\r
-  fOnlyOneEtaSide(0),\r
-fInjectedSignals(kFALSE),\r
-  fRemoveWeakDecays(kFALSE),\r
-fRemoveDuplicates(kFALSE),\r
-  fapplyTrigefficiency(kFALSE),\r
-  fapplyAssoefficiency(kFALSE),\r
-  ffillefficiency(kFALSE),\r
- fmesoneffrequired(kFALSE),\r
- fkaonprotoneffrequired(kFALSE),\r
-   //fAnalysisUtils(0x0),\r
-  fDCAXYCut(0)         \r
-{\r
-  \r
-   for ( Int_t i = 0; i < 16; i++) { \r
-    fHistQA[i] = NULL;\r
-  }\r
\r
-for ( Int_t i = 0; i < 6; i++ ){\r
-    fTHnrecomatchedallPid[i] = NULL;\r
-    fTHngenprimPidTruth[i] = NULL;\r
-    effcorection[i]=NULL;\r
-    //effmap[i]=NULL;\r
-\r
-  }\r
-\r
- for(Int_t ipart=0;ipart<NSpecies;ipart++)\r
-    for(Int_t ipid=0;ipid<=NSigmaPIDType;ipid++)\r
-      fnsigmas[ipart][ipid]=999.;\r
-\r
-   for(Int_t ipart=0;ipart<NSpecies;ipart++) {fHasDoubleCounting[ipart]=kFALSE;}\r
-\r
-  // The last in the above list should not have a comma after it\r
-  \r
-  // Constructor\r
-  // Define input and output slots here (never in the dummy constructor)\r
-  // Input slot #0 works with a TChain - it is connected to the default input container\r
-  // Output slot #1 writes into a TH1 container\r
\r
-  DefineOutput(1, TList::Class());                                        // for output list\r
-\r
-}\r
-\r
-//________________________________________________________________________\r
-AliTwoParticlePIDCorr::~AliTwoParticlePIDCorr()\r
-{\r
-  // Destructor. Clean-up the output list, but not the histograms that are put inside\r
-  // (the list is owner and will clean-up these histograms). Protect in PROOF case.\r
-  if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {\r
-    delete fOutput;\r
-\r
-  }\r
-  if (fPID) delete fPID;\r
-   \r
-  }\r
-//________________________________________________________________________\r
-Float_t AliTwoParticlePIDCorr::PhiRange(Float_t DPhi)\r
-\r
-{\r
-       //\r
-       // Puts the argument in the range [-pi/2,3 pi/2].\r
-       //\r
-       \r
-       if (DPhi < -TMath::Pi()/2) DPhi += 2*TMath::Pi();\r
-       if (DPhi > 3*TMath::Pi()/2) DPhi -= 2*TMath::Pi();      \r
-\r
-       return DPhi;\r
-       \r
-}\r
-//________________________________________________________________________\r
-void AliTwoParticlePIDCorr::UserCreateOutputObjects()\r
-{\r
-  // Create histograms\r
-  // Called once (on the worker node)\r
-  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();\r
-  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());\r
-  fPID = inputHandler->GetPIDResponse();\r
-\r
-  //AliAnalysisUtils *fUtils = new AliAnalysisUtils();\r
-\r
-//get the efficiency correction map\r
-\r
-\r
-  fOutput = new TList();\r
-  fOutput->SetOwner();  // IMPORTANT!  \r
-\r
-    Int_t centmultbins=10;\r
-    Double_t centmultmin=0.0;\r
-    Double_t centmultmax=100.0;\r
-  if(fSampleType=="pPb" || fSampleType=="PbPb")\r
-   {\r
-      centmultbins=10;\r
-      centmultmin=0.0;\r
-      centmultmax=100.0;\r
-   }\r
- if(fSampleType=="pp")\r
-   {\r
-     centmultbins=10;\r
-     centmultmin=0.0;\r
-     centmultmax=200.0;\r
-   }\r
-\r
-fhistcentrality=new TH1F("fhistcentrality","fhistcentrality",centmultbins*4,centmultmin,centmultmax);\r
-fOutput->Add(fhistcentrality);\r
-\r
-  fEventCounter = new TH1F("fEventCounter","EventCounter", 10, 0.5,10.5);\r
-  fEventCounter->GetXaxis()->SetBinLabel(1,"Event Accesed");\r
-  fEventCounter->GetXaxis()->SetBinLabel(2,"Have a vertex");\r
-  fEventCounter->GetXaxis()->SetBinLabel(5,"After vertex Cut");\r
-  fEventCounter->GetXaxis()->SetBinLabel(6,"Within 0-100% centrality");\r
-  fEventCounter->GetXaxis()->SetBinLabel(7,"Event Analyzed");\r
-  //fEventCounter->GetXaxis()->SetBinLabel(8,"Event Analysis finished");\r
-  fOutput->Add(fEventCounter);\r
-  \r
-fEtaSpectrasso=new TH2F("fEtaSpectraasso","fEtaSpectraasso",180,-0.9,0.9,100,0.,20. );\r
-fOutput->Add(fEtaSpectrasso);\r
-\r
-fphiSpectraasso=new TH2F("fphiSpectraasso","fphiSpectraasso",72,0,2*TMath::Pi(),100,0.,20.);\r
-fOutput->Add(fphiSpectraasso);\r
-\r
-\r
- if(fSampleType=="pPb" || fSampleType=="PbPb"){ fCentralityCorrelation = new TH2D("fCentralityCorrelation", ";centrality;multiplicity", 101, 0, 101, 20000, 0,40000);\r
-      fOutput->Add(fCentralityCorrelation);\r
- }\r
-\r
-fHistoTPCdEdx = new TH2F("hHistoTPCdEdx", ";p_{T} (GeV/c);dE/dx (au.)",200,0.0,10.0,500, 0., 500.);\r
-fOutput->Add(fHistoTPCdEdx);\r
-fHistoTOFbeta = new TH2F(Form("hHistoTOFbeta"), ";p_{T} (GeV/c);v/c",70, 0., 7., 500, 0.1, 1.1);\r
-  fOutput->Add(fHistoTOFbeta);\r
-  \r
-   fTPCTOFPion3d=new TH3F ("fTPCTOFpion3d", "fTPCTOFpion3d",100,0., 10., 120,-60.,60.,120,-60.,60);\r
-   fOutput->Add(fTPCTOFPion3d);\r
-  \r
-   fTPCTOFKaon3d=new TH3F ("fTPCTOFKaon3d", "fTPCTOFKaon3d",100,0., 10., 120,-60.,60.,120,-60.,60);\r
-   fOutput->Add(fTPCTOFKaon3d);\r
-\r
-   fTPCTOFProton3d=new TH3F ("fTPCTOFProton3d", "fTPCTOFProton3d",100,0., 10., 120,-60.,60.,120,-60.,60);\r
-   fOutput->Add(fTPCTOFProton3d);\r
-\r
-if(ffillhistQAReco)\r
-    {\r
-    fPionPt = new TH1F("fHistQAPionPt","p_{T} distribution",200,0.,10.);\r
- fOutput->Add(fPionPt);\r
-    fPionEta= new TH1F("fHistQAPionEta","#eta distribution",360,-1.8,1.8);\r
- fOutput->Add(fPionEta);\r
-    fPionPhi = new TH1F("fHistQAPionPhi","#phi distribution",340,0,6.8);\r
- fOutput->Add(fPionPhi);\r
-  \r
-    fKaonPt = new TH1F("fHistQAKaonPt","p_{T} distribution",200,0.,10.);\r
- fOutput->Add(fKaonPt);\r
-    fKaonEta= new TH1F("fHistQAKaonEta","#eta distribution",360,-1.8,1.8);\r
- fOutput->Add(fKaonEta);\r
-    fKaonPhi = new TH1F("fHistQAKaonPhi","#phi distribution",340,0,6.8);\r
- fOutput->Add(fKaonPhi);\r
-  \r
-    fProtonPt = new TH1F("fHistQAProtonPt","p_{T} distribution",200,0.,10.);\r
- fOutput->Add(fProtonPt);\r
-    fProtonEta= new TH1F("fHistQAProtonEta","#eta distribution",360,-1.8,1.8);\r
- fOutput->Add(fProtonEta);\r
-    fProtonPhi= new TH1F("fHistQAProtonPhi","#phi distribution",340,0,6.8);\r
- fOutput->Add(fProtonPhi);\r
-    }\r
-\r
-  fHistQA[0] = new TH1F("fHistQAvx", "Histo Vx All ", 50, -5., 5.);\r
-  fHistQA[1] = new TH1F("fHistQAvy", "Histo Vy All", 50, -5., 5.);\r
-  fHistQA[2] = new TH1F("fHistQAvz", "Histo Vz All", 50, -25., 25.);  \r
-  fHistQA[3] = new TH1F("fHistQAvxA", "Histo Vx  After Cut ", 50, -5., 5.);\r
-  fHistQA[4] = new TH1F("fHistQAvyA", "Histo Vy After Cut", 50, -5., 5.);\r
-  fHistQA[5] = new TH1F("fHistQAvzA", "Histo Vz After Cut", 50, -25., 25.);\r
-  fHistQA[6] = new TH1F("fHistQADcaXyC", "Histo DCAxy after cut", 50, -5., 5.);\r
-  fHistQA[7] = new TH1F("fHistQADcaZC", "Histo DCAz after cut", 50, -5., 5.);   \r
-  fHistQA[8] = new TH1F("fHistQAPt","p_{T} distribution",200,0.,10.);\r
-  fHistQA[9] = new TH1F("fHistQAEta","#eta distribution",360,-1.8,1.8);\r
-  fHistQA[10] = new TH1F("fHistQAPhi","#phi distribution",340,0,6.8);\r
-  fHistQA[11] = new TH1F("fHistQANCls","Number of TPC cluster",200,0,200);\r
-  fHistQA[13] = new TH1F("fHistQAChi2","Chi2 per NDF",100,0,10);\r
- fHistQA[12] = new TH1F("fHistQANCls1","Number of TPC cluster1",200,0,200);\r
- fHistQA[14] = new TH1F("nCrossedRowsTPC","Number of TPC ccrossed rows",200,0,200);\r
- fHistQA[15] = new TH1F("ratioCrossedRowsOverFindableClustersTPC","Number of TPC ccrossed rows find clusters",200,0,2);\r
-\r
-for(Int_t i = 0; i < 16; i++)\r
-    {\r
-      fOutput->Add(fHistQA[i]);\r
-    }\r
-\r
-   kTrackVariablesPair=6 ;\r
-\r
- if(fcontainPIDtrig && !fcontainPIDasso) kTrackVariablesPair=7;\r
\r
- if(!fcontainPIDtrig && fcontainPIDasso) kTrackVariablesPair=7;\r
\r
- if(fcontainPIDtrig && fcontainPIDasso) kTrackVariablesPair=8;\r
\r
\r
-// two particle histograms\r
-  Int_t iBinPair[kTrackVariablesPair];         // binning for track variables\r
-  Double_t* dBinsPair[kTrackVariablesPair];    // bins for track variables  \r
-  TString* axisTitlePair;  // axis titles for track variables\r
-  axisTitlePair=new TString[kTrackVariablesPair];\r
-\r
- TString defaultBinningStr;\r
-  defaultBinningStr =   "eta: -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0\n"\r
-    "p_t_assoc: 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 8.0,10.0\n"\r
-    "p_t_leading_course: 0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0,10.0\n"\r
-    "p_t_eff:0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 4.5, 5.0,5.5, 6.0, 7.0, 8.0,9.0,10.0\n"\r
-    "vertex: -10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10\n"\r
-  "delta_phi: -1.570796, -1.483530, -1.396263, -1.308997, -1.221730, -1.134464, -1.047198, -0.959931, -0.872665, -0.785398, -0.698132, -0.610865, -0.523599, -0.436332, -0.349066, -0.261799, -0.174533, -0.087266, 0.0, 0.087266, 0.174533, 0.261799, 0.349066, 0.436332, 0.523599, 0.610865, 0.698132, 0.785398, 0.872665, 0.959931, 1.047198, 1.134464, 1.221730, 1.308997, 1.396263, 1.483530, 1.570796, 1.658063, 1.745329, 1.832596, 1.919862, 2.007129, 2.094395, 2.181662, 2.268928, 2.356194, 2.443461, 2.530727, 2.617994, 2.705260, 2.792527, 2.879793, 2.967060, 3.054326, 3.141593, 3.228859, 3.316126, 3.403392, 3.490659, 3.577925, 3.665191, 3.752458, 3.839724, 3.926991, 4.014257, 4.101524, 4.188790, 4.276057, 4.363323, 4.450590, 4.537856, 4.625123, 4.712389\n" // this binning starts at -pi/2 and is modulo 3 \r
-       "delta_eta: -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0,2.1, 2.2, 2.3, 2.4\n"\r
-      "multiplicity: 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1\n";\r
-\r
-  if(fcontainPIDtrig){\r
-      defaultBinningStr += "PIDTrig: -0.5,0.5,1.5,2.5,3.5\n"; // course\r
-  }\r
-  if(fcontainPIDasso){\r
-      defaultBinningStr += "PIDAsso: -0.5,0.5,1.5,2.5,3.5\n"; // course\r
-  }\r
- // =========================================================\r
-  // Customization (adopted from AliUEHistograms)\r
-  // =========================================================\r
-\r
-  TObjArray* lines = defaultBinningStr.Tokenize("\n");\r
-  for (Int_t i=0; i<lines->GetEntriesFast(); i++)\r
-  {\r
-    TString line(lines->At(i)->GetName());\r
-    TString tag = line(0, line.Index(":")+1);\r
-    if (!fCustomBinning.BeginsWith(tag) && !fCustomBinning.Contains(TString("\n") + tag))\r
-      fBinningString += line + "\n";\r
-    else\r
-      AliInfo(Form("Using custom binning for %s", tag.Data()));\r
-  }\r
-  delete lines;\r
-  fBinningString += fCustomBinning;\r
-  \r
-  AliInfo(Form("Used THn Binning:\n%s",fBinningString.Data()));\r
-\r
- // =========================================================\r
-  // Now set the bins\r
-  // =======================