Second config macro for the train
authormajanik <malgorzata.anna.janik@cern.ch>
Thu, 3 Jul 2014 09:07:05 +0000 (11:07 +0200)
committermajanik <majanik@cern.ch>
Thu, 3 Jul 2014 09:14:11 +0000 (11:14 +0200)
PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train4/DCA1D/ConfigFemtoAnalysis.C [new file with mode: 0644]

diff --git a/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train4/DCA1D/ConfigFemtoAnalysis.C b/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train4/DCA1D/ConfigFemtoAnalysis.C
new file mode 100644 (file)
index 0000000..89c0f65
--- /dev/null
@@ -0,0 +1,512 @@
+/*********************************************************************
+ *                                                                                                                                                                                      *
+ * Configfemtoanalysis.C - configuration macro for the femtoscopic      *
+ * analysis, meant as a QA process for two-particle effects                             *
+ *                                                                                                                                                                                      *
+ * Author: Adam Kisiel (Adam.Kisiel@cern.ch)                                                                    *
+ *                                                                                                                                                                                      *
+ *********************************************************************/
+
+#if !defined(__CINT__) || defined(__MAKECINT_)
+#include "AliFemtoManager.h"
+#include "AliFemtoEventReaderESDChain.h"
+#include "AliFemtoEventReaderESDChainKine.h"
+#include "AliFemtoEventReaderAODChain.h"
+#include "AliFemtoSimpleAnalysis.h"
+#include "AliFemtoBasicEventCut.h"
+#include "AliFemtoESDTrackCut.h"
+#include "AliFemtoCorrFctn.h"
+#include "AliFemtoCutMonitorParticleYPt.h"
+#include "AliFemtoCutMonitorParticleVertPos.h"
+#include "AliFemtoCutMonitorParticleMomRes.h"
+#include "AliFemtoCutMonitorParticlePID.h"
+#include "AliFemtoCutMonitorEventMult.h"
+#include "AliFemtoCutMonitorEventVertex.h"
+#include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
+#include "AliFemtoPairCutAntiGamma.h"
+#include "AliFemtoPairCutRadialDistance.h"
+#include "AliFemtoQinvCorrFctn.h"
+#include "AliFemtoCorrFctnNonIdDR.h"
+#include "AliFemtoCorrFctnDEtaDPhiCorrections.h"
+#include "AliFemtoShareQualityCorrFctn.h"
+#include "AliFemtoTPCInnerCorrFctn.h"
+#include "AliFemtoVertexMultAnalysis.h"
+#include "AliFemtoCorrFctn3DSpherical.h"
+#include "AliFemtoChi2CorrFctn.h"
+#include "AliFemtoCorrFctnTPCNcls.h"
+#include "AliFemtoBPLCMS3DCorrFctn.h"
+#include "AliFemtoCorrFctn3DLCMSSym.h"
+#include "AliFemtoModelBPLCMSCorrFctn.h"
+#include "AliFemtoModelCorrFctn3DSpherical.h"
+#include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
+#include "AliFemtoModelGausRinvFreezeOutGenerator.h"
+#include "AliFemtoModelManager.h"
+#include "AliFemtoModelWeightGeneratorBasic.h"
+#include "AliFemtoModelWeightGeneratorLednicky.h"
+#include "AliFemtoCorrFctnDirectYlm.h"
+#include "AliFemtoModelCorrFctnDirectYlm.h"
+#include "AliFemtoModelCorrFctnSource.h"
+#include "AliFemtoCutMonitorParticlePtPDG.h"
+#include "AliFemtoKTPairCut.h"
+#include "AliFemtoPairCutPt.h"
+#endif
+
+//________________________________________________________________________
+AliFemtoManager* ConfigFemtoAnalysis(const char* params="") {
+
+       double PionMass = 0.13956995;
+       double KaonMass = 0.493677;
+       double ProtonMass = 0.938272013;
+       
+       const int numOfMultBins = 5;    
+       const int numOfChTypes = 13;
+       const int numOfkTbins = 6;
+
+       char *parameter[15];
+       if(strlen(params)!=0)
+         {
+           parameter[0] = strtok(params, ","); // Splits spaces between words in params
+           cout<<"Parameter [0] (filterbit):"<<parameter[0]<<endl; // Writes first parameter
+           parameter[1] = strtok(NULL, ",");
+           cout<<"Parameter [1] (ktdep):"<<parameter[1]<<" "<<endl;
+           parameter[2] = strtok(NULL, ",");
+           cout<<"Parameter [2] (multdep):"<<parameter[2]<<" "<<endl;    
+           parameter[3] = strtok(NULL, ",");
+           cout<<"Parameter [3]: (MinPlpContribSPD)"<<parameter[3]<<" "<<endl;
+           parameter[4] = strtok(NULL, ",");
+           cout<<"Parameter [4]: (multbino)"<<parameter[4]<<" "<<endl;
+           parameter[5] = strtok(NULL, ",");
+           cout<<"Parameter [5]: (zvertbino)"<<parameter[5]<<" "<<endl;
+           parameter[6] = strtok(NULL, ",");
+           cout<<"Parameter [6]: (ifGlobalTracks=true/false)"<<parameter[6]<<" "<<endl;
+           parameter[7] = strtok(NULL, ",");
+           cout<<"Parameter [7]: (shareQuality)"<<parameter[7]<<" "<<endl;
+           parameter[8] = strtok(NULL, ",");
+           cout<<"Parameter [8]: (shareFraction)"<<parameter[8]<<" "<<endl;
+           parameter[9] = strtok(NULL, ",");
+           cout<<"Parameter [9]: (ifElectronRejection)"<<parameter[9]<<" "<<endl;
+           parameter[10] = strtok(NULL, ",");
+           cout<<"Parameter [10]: (nSigma)"<<parameter[10]<<" "<<endl;
+           parameter[11] = strtok(NULL, ",");
+           cout<<"Parameter [12]: (etaMin)"<<parameter[11]<<" "<<endl;
+           parameter[12] = strtok(NULL, ",");
+           cout<<"Parameter [12]: (etaMax)"<<parameter[12]<<" "<<endl;
+           parameter[13] = strtok(NULL, ",");
+           cout<<"Parameter [13]: (ispileup)"<<parameter[13]<<" "<<endl;
+         }
+       int filterbit = atoi(parameter[0]); //96 / 768 / 128 
+       int runktdep = atoi(parameter[1]); //0
+       int runmultdep = atoi(parameter[2]); //0
+       int minPlpContribSPD = atoi(parameter[3]); //3
+       int multbino = atoi(parameter[4]); //30
+       int zvertbino = atoi(parameter[5]); //10
+       Bool_t ifGlobalTracks=kFALSE; if(atoi(parameter[6]))ifGlobalTracks=kTRUE;//kTRUE 
+       double shareQuality = atof(parameter[7]); //0.00
+       double shareFraction = atof(parameter[8]); //0.05
+       bool ifElectronRejection = atoi(parameter[9]); //true
+       double nSigmaVal = atof(parameter[10]); //3.0
+       double nEtaMin = atof(parameter[11]); //-0.8
+       double nEtaMax = atof(parameter[12]);  //0.8
+       bool ifIsPileUp = atoi(parameter[13]); //true
+
+       int runmults[numOfMultBins] = {0, 0, 0, 0, 1};
+       if(runmultdep)    {runmults[0]=1; runmults[1]=1; runmults[2]=1;   }
+       int multbins[numOfMultBins+1] = {2, 20, 50,150,2,150};
+       
+       int runch[numOfChTypes] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+       const char *chrgs[numOfChTypes] = { "PP", "aPaP", "PaP", "KpKp", "KmKm", "KpKm", "PIpPIp", "PImPIm", "PIpPIm", "all", "plus", "minus", "mixed" };
+       
+       int runktdep = 1;
+       double ktrng[numOfkTbins+1] = {0.0, 0, 0, 0, 0, 0};
+       double ktrngAll[numOfkTbins+1] = {0.0, 7.0, 1.2, 2.0, 3.0, 4.0, 100.0};
+       double ktrngPion[numOfkTbins+1] = {0.0, 0.7, 0.9, 1.1, 1.4, 2.5, 100.0};
+       double ktrngKaon[numOfkTbins+1] = {0.0, 1.5, 2.5, 3.5, 100.0, 0, 0};
+       double ktrngProton[numOfkTbins+1] = {0.0, 2.75, 100, 0, 0};
+
+       int runqinv = 1;
+       int runshlcms = 1;// 0:PRF(PAP), 1:LCMS(PP,APAP)
+
+       int runtype = 0; // Types 0 - global, 1 - ITS only, 2 - TPC Inner       //global tracks ->mfit ITS+TPC
+       int owncuts = 0; 
+       int owndca = 0;
+
+       int gammacut = 0;       // cut na ee z gamma 
+       
+       double shqmax = 0.5; 
+       int nbinssh = 100;
+
+       //AliFemtoEventReaderESDChain *Reader = new AliFemtoEventReaderESDChain();
+       //Reader->SetUseMultiplicity(AliFemtoEventReaderESDChain::kGlobalCount);
+
+
+       AliFemtoEventReaderAODChain *Reader = new AliFemtoEventReaderAODChain();
+       Reader->SetFilterMask(filterbit);
+       Reader->SetDCAglobalTrack(ifGlobalTracks); //false for FB7, true for the rest //we do not use DCA at all
+       Reader->SetUseMultiplicity(AliFemtoEventReaderAOD::kReference);
+       Reader->SetMinPlpContribSPD(minPlpContribSPD);
+       Reader->SetIsPileUpEvent(ifIsPileUp);
+
+       AliFemtoManager* Manager = new AliFemtoManager();
+       Manager->SetEventReader(Reader);
+
+       AliFemtoVertexMultAnalysis              *anetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoBasicEventCut                            *mecetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorEventMult      *cutPassEvMetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorEventMult      *cutFailEvMetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorEventVertex *cutPassEvVetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorEventVertex *cutFailEvVetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoESDTrackCut                      *dtc1etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoESDTrackCut                      *dtc2etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoESDTrackCut                      *dtc3etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticleYPt *cutPass1YPtetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticleYPt *cutFail1YPtetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticlePID *cutPass1PIDetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticlePID *cutFail1PIDetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticleYPt *cutPass2YPtetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticleYPt *cutFail2YPtetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticlePID *cutPass2PIDetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticlePID *cutFail2PIDetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticleYPt *cutPass3YPtetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticleYPt *cutFail3YPtetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticlePID *cutPass3PIDetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoCutMonitorParticlePID *cutFail3PIDetaphitpc[numOfMultBins*numOfChTypes];
+       //       AliFemtoShareQualityTPCEntranceSepPairCut                      *sqpcetaphitpcsame[numOfMultBins*numOfChTypes];
+       //AliFemtoPairCutAntiGamma                      *sqpcetaphitpc[numOfMultBins*numOfChTypes];
+       //AliFemtoPairCutRadialDistance                 *sqpcetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoShareQualityPairCut                     *sqpcetaphitpc[numOfMultBins*numOfChTypes];
+       //      AliFemtoChi2CorrFctn                                    *cchiqinvetaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoPairCutPt                                       *ktpcuts[numOfMultBins*numOfChTypes*numOfkTbins];
+       AliFemtoQinvCorrFctn                                    *cqinvkttpc[numOfMultBins*numOfChTypes*numOfkTbins];
+       AliFemtoQinvCorrFctn                                    *cqinvtpc[numOfMultBins*numOfChTypes];
+       AliFemtoCorrFctnDEtaDPhiCorrections                     *cdedpetaphi[numOfMultBins*numOfChTypes];
+       AliFemtoCorrFctnDEtaDPhiCorrections                     *cdedpetaphiPt[numOfMultBins*numOfChTypes*numOfkTbins];
+
+
+       
+       // *** Third QA task - HBT analysis with all pair cuts off, TPC only ***
+       // *** Begin pion-pion (positive) analysis ***
+       int aniter = 0; 
+
+       for (int imult = 0; imult < numOfMultBins; imult++)
+       {
+               if (runmults[imult])
+               {
+                       for (int ichg = 0; ichg < numOfChTypes; ichg++)
+                       {
+                               if (runch[ichg])
+                               {
+
+                                       aniter = ichg * numOfMultBins + imult;
+                                       anetaphitpc[aniter] = new AliFemtoVertexMultAnalysis(zvertbino, -10.0, 10.0, multbino, multbins[imult], multbins[imult+1]);
+                                       anetaphitpc[aniter]->SetNumEventsToMix(10);
+                                       anetaphitpc[aniter]->SetMinSizePartCollection(1);
+                                       anetaphitpc[aniter]->SetVerboseMode(kFALSE);//~~~~~~~~~~~~~~~~
+
+                                       //*** Event cut ***
+                                       mecetaphitpc[aniter] = new AliFemtoBasicEventCut();
+                                       mecetaphitpc[aniter]->SetEventMult(0.001,100000);
+                                       mecetaphitpc[aniter]->SetVertZPos(-10,10);//cm
+
+                                       //****** event monitors **********      
+                                       cutPassEvMetaphitpc[aniter] = new AliFemtoCutMonitorEventMult(Form("cutPass%stpcM%i", chrgs[ichg], imult));
+                                       cutFailEvMetaphitpc[aniter] = new AliFemtoCutMonitorEventMult(Form("cutFail%stpcM%i", chrgs[ichg], imult));
+                                       mecetaphitpc[aniter]->AddCutMonitor(cutPassEvMetaphitpc[aniter], cutFailEvMetaphitpc[aniter]);
+               
+                                       cutPassEvVetaphitpc[aniter] = new AliFemtoCutMonitorEventVertex(Form("cutPass%stpcM%i", chrgs[ichg], imult));
+                                       cutFailEvVetaphitpc[aniter] = new AliFemtoCutMonitorEventVertex(Form("cutFail%stpcM%i", chrgs[ichg], imult));
+                                       mecetaphitpc[aniter]->AddCutMonitor(cutPassEvVetaphitpc[aniter], cutFailEvVetaphitpc[aniter]);
+
+
+                                       // ***** single particle track cuts *********
+                                       dtc1etaphitpc[aniter] = new AliFemtoESDTrackCut();
+                                       dtc2etaphitpc[aniter] = new AliFemtoESDTrackCut();
+                                       dtc1etaphitpc[aniter]->SetNsigmaTPCTOF(kTRUE);
+                                       dtc2etaphitpc[aniter]->SetNsigmaTPCTOF(kTRUE);
+                                       dtc1etaphitpc[aniter]->SetNsigma(nSigmaVal);
+                                       dtc2etaphitpc[aniter]->SetNsigma(nSigmaVal);
+                                       //dtc3etaphitpc[aniter]->SetNsigma(3.0);
+
+                                       dtc1etaphitpc[aniter]->SetCharge(1.0);
+                                       dtc2etaphitpc[aniter]->SetCharge(-1.0);
+
+                                       dtc1etaphitpc[aniter]->SetEta(nEtaMin,nEtaMax);
+                                       dtc2etaphitpc[aniter]->SetEta(nEtaMin,nEtaMax);
+
+
+                                       dtc1etaphitpc[aniter]->SetElectronRejection(ifElectronRejection);       
+                                       dtc2etaphitpc[aniter]->SetElectronRejection(ifElectronRejection);
+
+
+
+                                        if (ichg == 0 ||ichg == 1 ||ichg == 2)//protons 0-2
+                                          {
+                                            dtc1etaphitpc[aniter]->SetPt(0.5,4);
+                                            dtc2etaphitpc[aniter]->SetPt(0.5,4);
+                                           
+                                           dtc1etaphitpc[aniter]->SetMass(ProtonMass);         
+                                           dtc1etaphitpc[aniter]->SetMostProbableProton();
+                                           dtc2etaphitpc[aniter]->SetMass(ProtonMass);         
+                                           dtc2etaphitpc[aniter]->SetMostProbableProton();
+                                          }
+
+                                       if (ichg == 3 ||ichg == 4 ||ichg == 5)//kaons 3-5
+                                          {
+                                            dtc1etaphitpc[aniter]->SetPt(0.3,4);
+                                            dtc2etaphitpc[aniter]->SetPt(0.3,4);
+                                        
+                                           dtc1etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc1etaphitpc[aniter]->SetMostProbableKaon();
+                                           dtc2etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc2etaphitpc[aniter]->SetMostProbableKaon();
+
+                                          }
+                                        if (ichg == 6 ||ichg == 7 ||ichg == 8)//pions 6-8
+                                          {
+                                            dtc1etaphitpc[aniter]->SetPt(0.2,4);
+                                           dtc2etaphitpc[aniter]->SetPt(0.2,4);
+
+                                           dtc1etaphitpc[aniter]->SetMass(PionMass);           
+                                           dtc1etaphitpc[aniter]->SetMostProbablePion();
+                                           dtc2etaphitpc[aniter]->SetMass(PionMass);           
+                                           dtc2etaphitpc[aniter]->SetMostProbablePion();
+                                          }
+                                        if (ichg == 9)//all
+                                          {
+
+                                           dtc3etaphitpc[aniter] = new AliFemtoESDTrackCut();
+                                           dtc3etaphitpc[aniter]->SetNsigmaTPCTOF(kTRUE);
+                                           dtc3etaphitpc[aniter]->SetEta(nEtaMin,nEtaMax);
+                                           dtc3etaphitpc[aniter]->SetElectronRejection(ifElectronRejection); 
+                                            dtc3etaphitpc[aniter]->SetPt(0.2,4);
+                                          }
+                                        if (ichg == 10 ||ichg == 11 ||ichg == 12)//plus,minus,mixed
+                                          {
+                                            dtc1etaphitpc[aniter]->SetPt(0.2,4);
+                                            dtc2etaphitpc[aniter]->SetPt(0.2,4);
+                                          }
+
+                                       //****** DCA ******
+
+                                       if(owndca){
+                                         dtc1etaphitpc[aniter]->SetMaxImpactXYPtDep(0.018, 0.035, -1.01);      //      DCA xy
+                                         //dtc1etaphitpc[aniter]->SetMaxImpactXYPtDep(0.0182, 0.0350, -1.01);
+                                         dtc1etaphitpc[aniter]->SetMaxImpactZ(2);      //DCA Z
+                                         dtc2etaphitpc[aniter]->SetMaxImpactXYPtDep(0.018, 0.035, -1.01);      //      DCA xy
+                                         dtc2etaphitpc[aniter]->SetMaxImpactZ(2);      //DCA Z
+                                         if (ichg == 9){dtc3etaphitpc[aniter]->SetMaxImpactXYPtDep(0.018, 0.035, -1.01);       //      DCA xy
+                                         dtc3etaphitpc[aniter]->SetMaxImpactZ(2);}     //DCA Z
+                                       }
+                                       //****** Track quality cuts ******
+
+                                       if(owncuts){
+
+                                         dtc1etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
+                                         dtc1etaphitpc[aniter]->SetminTPCncls(70);
+                                         dtc1etaphitpc[aniter]->SetRemoveKinks(kTRUE);
+                                         dtc1etaphitpc[aniter]->SetLabel(kFALSE);
+                                         //    dtc1etaphitpc[aniter]->SetMaxITSChiNdof(6.0);
+                                         dtc1etaphitpc[aniter]->SetMaxTPCChiNdof(4.0); // pisac
+                                         //dtc1etaphitpc[aniter]->SetMaxSigmaToVertex(6.0);
+
+                                         dtc2etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
+                                         dtc2etaphitpc[aniter]->SetminTPCncls(70);
+                                         dtc2etaphitpc[aniter]->SetRemoveKinks(kTRUE);
+                                         dtc2etaphitpc[aniter]->SetLabel(kFALSE);
+                                         //    dtc2etaphitpc[aniter]->SetMaxITSChiNdof(6.0);
+                                         dtc2etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
+                                         //    dtc2etaphitpc[aniter]->SetMaxSigmaToVertex(6.0);
+                                         if (ichg == 9){
+                                           dtc3etaphitpc[aniter]->SetStatus(AliESDtrack::kTPCrefit|AliESDtrack::kITSrefit);
+                                           dtc3etaphitpc[aniter]->SetminTPCncls(70);
+                                           dtc3etaphitpc[aniter]->SetRemoveKinks(kTRUE);
+                                           dtc3etaphitpc[aniter]->SetLabel(kFALSE);
+                                           //  dtc3etaphitpc[aniter]->SetMaxITSChiNdof(6.0);
+                                           dtc3etaphitpc[aniter]->SetMaxTPCChiNdof(4.0);
+                                           //  dtc3etaphitpc[aniter]->SetMaxSigmaToVertex(6.0);
+                                         }
+       
+                                       }
+                                       //**************** track Monitors ***************
+
+                                       
+                                       if(1)//ichg>8)
+                                         {
+                                           if(ichg<2 || ichg==3||ichg==4 || ichg==6|| ichg==7||ichg==9||ichg==10||ichg==11){ 
+                                             cutPass3YPtetaphitpc[aniter] = new AliFemtoCutMonitorParticleYPt(Form("cutPass%stpcM%i", chrgs[ichg], imult),PionMass);
+                                             cutFail3YPtetaphitpc[aniter] = new AliFemtoCutMonitorParticleYPt(Form("cutFail%stpcM%i", chrgs[ichg], imult),PionMass);
+                                           }
+                                           if(ichg==9) dtc3etaphitpc[aniter]->AddCutMonitor(cutPass3YPtetaphitpc[aniter], cutFail3YPtetaphitpc[aniter]);
+                                           if(ichg==0||ichg==3||ichg==6||ichg==10) dtc1etaphitpc[aniter]->AddCutMonitor(cutPass3YPtetaphitpc[aniter], cutFail3YPtetaphitpc[aniter]);
+                                           if(ichg==1||ichg==4||ichg==7||ichg==11) dtc2etaphitpc[aniter]->AddCutMonitor(cutPass3YPtetaphitpc[aniter], cutFail3YPtetaphitpc[aniter]);
+
+                                           if(ichg<2){ //PP, PaP
+                                             cutPass3PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutPass%stpcM%i", chrgs[ichg], imult),2);//0-pion,1-kaon,2-proton
+                                             cutFail3PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutFail%stpcM%i", chrgs[ichg], imult),2);
+                                             if(ichg==0) dtc1etaphitpc[aniter]->AddCutMonitor(cutPass3PIDetaphitpc[aniter], cutFail3PIDetaphitpc[aniter]);
+                                             if(ichg==1) dtc2etaphitpc[aniter]->AddCutMonitor(cutPass3PIDetaphitpc[aniter], cutFail3PIDetaphitpc[aniter]);
+                                           }
+                                           else if(ichg>=3 && ichg<=4){//KpKp, KmKm
+                                             cutPass3PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutPass%stpcM%i", chrgs[ichg], imult),1);//0-pion,1-kaon,2-proton
+                                             cutFail3PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutFail%stpcM%i", chrgs[ichg], imult),1);
+                                             if(ichg==3) dtc1etaphitpc[aniter]->AddCutMonitor(cutPass3PIDetaphitpc[aniter], cutFail3PIDetaphitpc[aniter]);
+                                             if(ichg==4) dtc2etaphitpc[aniter]->AddCutMonitor(cutPass3PIDetaphitpc[aniter], cutFail3PIDetaphitpc[aniter]);
+                                           }
+                                           else if(ichg==6||ichg==10||ichg==7||ichg==11||ichg==9){ //pions, all
+                                             cutPass3PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutPass%stpcM%i", chrgs[ichg], imult),0);//0-pion,1-kaon,2-proton
+                                             cutFail3PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutFail%stpcM%i", chrgs[ichg], imult),0);
+                                             if(ichg==6||ichg==10) dtc1etaphitpc[aniter]->AddCutMonitor(cutPass3PIDetaphitpc[aniter], cutFail3PIDetaphitpc[aniter]);
+                                             if(ichg==7||ichg==11) dtc2etaphitpc[aniter]->AddCutMonitor(cutPass3PIDetaphitpc[aniter], cutFail3PIDetaphitpc[aniter]);
+                                             if(ichg==9) dtc3etaphitpc[aniter]->AddCutMonitor(cutPass3PIDetaphitpc[aniter], cutFail3PIDetaphitpc[aniter]);
+                                           }
+                                         }
+                                        
+                                       //******** Two - track cuts ************
+                                       //sqpcetaphitpc[aniter] = new AliFemtoPairCutAntiGamma();
+                                       sqpcetaphitpc[aniter] = new AliFemtoShareQualityPairCut();
+                               
+                                       sqpcetaphitpc[aniter]->SetShareQualityMax(shareQuality);                // two track cuts on splitting and merging  //1- wylaczany 0 -wlaczany   
+                                       sqpcetaphitpc[aniter]->SetShareFractionMax(shareFraction);      //  ile moga miec wspolnych klastrow //1 - wylaczany, 0.05 - wlaczany
+                                       sqpcetaphitpc[aniter]->SetRemoveSameLabel(kFALSE);
+                                       // sqpcetaphitpc[aniter]->SetMaximumRadius(0.82);
+                                       // sqpcetaphitpc[aniter]->SetMinimumRadius(0.8);
+                                       // sqpcetaphitpc[aniter]->SetPhiStarDifferenceMinimum(0.02);
+                                       // sqpcetaphitpc[aniter]->SetEtaDifferenceMinimum(0.02);
+                                       /*
+                                       if (gammacut == 0)
+                                         {
+                                           sqpcetaphitpc[aniter]->SetMaxEEMinv(0.0);
+                                           sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.0);
+                                         }
+                                       else if (gammacut == 1)
+                                         {
+                                           sqpcetaphitpc[aniter]->SetMaxEEMinv(0.002);
+                                           sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.008);
+                                         }
+                                       */
+                                       // sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(1.5);
+                                       // sqpcetaphitpc[aniter]->SetRadialDistanceMinimum(0.12, 0.03);
+                                       // sqpcetaphitpc[aniter]->SetEtaDifferenceMinimum(0.02);
+                                         
+                                       
+               
+
+                                       //***** Setting cuts ***********
+
+               
+                                       // setting event cut
+                                       anetaphitpc[aniter]->SetEventCut(mecetaphitpc[aniter]);
+                                       //setting single track cuts
+                                       if(ichg==0 || ichg==3  || ichg==6 || ichg==10) //positive like-sign
+                                       {
+                                               anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);
+                                               anetaphitpc[aniter]->SetSecondParticleCut(dtc1etaphitpc[aniter]);
+                                       }
+                                       if(ichg==1 || ichg==4 || ichg==7 || ichg==11)//negative like-sign
+                                       {
+                                               anetaphitpc[aniter]->SetFirstParticleCut(dtc2etaphitpc[aniter]);
+                                               anetaphitpc[aniter]->SetSecondParticleCut(dtc2etaphitpc[aniter]);
+                                       }
+                                       if(ichg==2 || ichg==5 || ichg==8 || ichg==12)//unlike-sign
+                                       {
+                                               anetaphitpc[aniter]->SetFirstParticleCut(dtc1etaphitpc[aniter]);
+                                               anetaphitpc[aniter]->SetSecondParticleCut(dtc2etaphitpc[aniter]);
+                                       }
+                                       if(ichg==9) //all
+                                        {
+                                         anetaphitpc[aniter]->SetFirstParticleCut(dtc3etaphitpc[aniter]);
+                                         anetaphitpc[aniter]->SetSecondParticleCut(dtc3etaphitpc[aniter]);
+                                        }
+
+                                       //setting two-track cuts
+                                       anetaphitpc[aniter]->SetPairCut(sqpcetaphitpc[aniter]);
+
+
+                                       //**** Correlation functions *******
+
+                                       cdedpetaphi[aniter] = new AliFemtoCorrFctnDEtaDPhiCorrections(Form("cdedp%stpcM%i", chrgs[ichg], imult),35, 35);
+                                       if(ichg==0 || ichg==1 || ichg==2)
+                                         cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kProton, AliFemtoCorrFctnDEtaDPhiCorrections::kProton/*,1,1,1,0*/);
+                                       //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kProton, AliFemtoCorrFctnDEtaDPhiCorrections::kProton,1,1,1,1);
+                                       else if(ichg==3 || ichg==4 || ichg==5)
+                                         cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kKaon, AliFemtoCorrFctnDEtaDPhiCorrections::kKaon/*,1,1,1,0*/);
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kKaon, AliFemtoCorrFctnDEtaDPhiCorrections::kKaon,1,1,1,1);  
+                                        
+                                       else if(ichg==6 || ichg==7 || ichg==8)
+                                         cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kPion/*,1,1,1,0*/);
+                                       
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kPion,1,1,1,1);  
+                                       
+                                       else
+                                         cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kAll, AliFemtoCorrFctnDEtaDPhiCorrections::kAll/*,1,1,1,0*/);
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kAll, AliFemtoCorrFctnDEtaDPhiCorrections::kAll,1,1,1,1);
+                                       
+                            
+
+            
+                                       anetaphitpc[aniter]->AddCorrFctn(cdedpetaphi[aniter]);
+
+               
+                                       if (runktdep)
+                                       {
+
+                                         if(ichg<=2){
+                                         for(int kit=0;kit<=numOfkTbins;kit++)
+                                           ktrng[kit]=ktrngProton[kit];
+                                         }
+                                         else if(ichg>2&&ichg<6){
+                                           for(int kit=0;kit<=numOfkTbins;kit++)
+                                             ktrng[kit]=ktrngKaon[kit];
+                                          }
+                                         else if(ichg>=6&&ichg<=8){
+                                           for(int kit=0;kit<=numOfkTbins;kit++)
+                                             ktrng[kit]=ktrngPion[kit];
+                                          }
+                                         else if(ichg>=9){
+                                           for(int kit=0;kit<=numOfkTbins;kit++)
+                                             ktrng[kit]=ktrngAll[kit];
+                                          }
+
+
+                                               int ktm;
+                                               for (int ikt=0; ikt<numOfkTbins; ikt++)
+                                               {
+                                                       if(ktrng[ikt+1]==0) continue;
+                                                       ktm = aniter * numOfkTbins + ikt;
+                                                       ktpcuts[ktm] = new AliFemtoPairCutPt(ktrng[ikt], ktrng[ikt+1]);
+                               
+                                                       //cqinvkttpc[ktm] = new AliFemtoQinvCorrFctn(Form("cqinv%stpcM%ikT%i", chrgs[ichg], imult, ikt),nbinssh,0.0,(imult>6)?shqmax*2.5:shqmax);
+                                                       //cqinvkttpc[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
+                                                       //anetaphitpc[aniter]->AddCorrFctn(cqinvkttpc[ktm]);
+
+                                                       cdedpetaphiPt[ktm] = new AliFemtoCorrFctnDEtaDPhiCorrections(Form("cdedp%stpcM%ipT%i", chrgs[ichg], imult,ikt),35, 35);
+                                                       cdedpetaphiPt[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
+
+                                                       if(ichg==0 || ichg==1 || ichg==2)
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kProton/*,1,1,1,1*/);
+                                                       else if(ichg==3 || ichg==4 || ichg==5)
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kKaon, AliFemtoCorrFctnDEtaDPhiCorrections::kKaon);
+                                                       else if(ichg==6 || ichg==7 || ichg==8)
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kProton, AliFemtoCorrFctnDEtaDPhiCorrections::kPion);
+                                                       else
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Data/AOD/SystematicStudies/PIDSqrtNsigma/Corrections/4D/4Dmap_DataDCA.root.root", AliFemtoCorrFctnDEtaDPhiCorrections::kAll, AliFemtoCorrFctnDEtaDPhiCorrections::kAll);
+                               
+
+                                                       /*if(ichg==0 || ichg==1 || ichg==2)
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromFile("alien:///alice/cern.ch/user/l/lgraczyk/2014/DEtaDPhi/CorrectionTables/pTab.txt","alien:///alice/cern.ch/user/l/lgraczyk/2014/DEtaDPhi/CorrectionTables/protonCorrTab.txt");
+                                                       else if(ichg==3 || ichg==4 || ichg==5)
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromFile("alien:///alice/cern.ch/user/l/lgraczyk/2014/DEtaDPhi/CorrectionTables/pTab.txt","alien:///alice/cern.ch/user/l/lgraczyk/2014/DEtaDPhi/CorrectionTables/kaonCorrTab.txt");      
+                                                       else if(ichg==6 || ichg==7 || ichg==8)
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromFile("alien:///alice/cern.ch/user/l/lgraczyk/2014/DEtaDPhi/CorrectionTables/pTab.txt","alien:///alice/cern.ch/user/l/lgraczyk/2014/DEtaDPhi/CorrectionTables/pionCorrTab.txt");
+                                                       else
+                                                       cdedpetaphiPt[ktm]->LoadCorrectionTabFromFile("alien:///alice/cern.ch/user/l/lgraczyk/2014/DEtaDPhi/CorrectionTables/pTab.txt","alien:///alice/cern.ch/user/l/lgraczyk/2014/DEtaDPhi/CorrectionTables/allCorrTab.txt");         */              
+                                                       anetaphitpc[aniter]->AddCorrFctn(cdedpetaphiPt[ktm]);
+
+                                               }
+                                       }               
+                                       Manager->AddAnalysis(anetaphitpc[aniter]);      
+                               }
+                       }
+               }
+       }
+       return Manager;
+}