Untriggered DEtaDPhi: new PID methods for analysis in MJTrackCut, new configs for...
authormajanik <majanik@cern.ch>
Fri, 18 Jul 2014 13:28:02 +0000 (15:28 +0200)
committermajanik <majanik@cern.ch>
Fri, 18 Jul 2014 13:28:47 +0000 (15:28 +0200)
PWGCF/CMakelibPWGCFfemtoscopyUser.pkg
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.cxx
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.h
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx [new file with mode: 0644]
PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.h [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/FB96_1DMCCorrExclusive/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/FB96_1DMCCorrNoDoubleCounting/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/NoCorrectionsExclusive/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/NoCorrectionsNoDoubleCounting/ConfigFemtoAnalysis.C [new file with mode: 0644]
PWGCF/PWGCFfemtoscopyUserLinkDef.h

index 65f243c..a77a09c 100644 (file)
@@ -25,7 +25,7 @@
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS  FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityKTPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoKKTrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoTPCInnerCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoChi2CorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnSource.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDEtaDPhi.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelBPLCMSCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelGausRinvFreezeOutGenerator.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnTrueQ.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelAllHiddenInfo.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCchiNdof.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQATrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQAEventCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCncls.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepQAPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityQAPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDG.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnTPCNcls.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhiCorrections.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnGammaMonitor.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQinvCorrFctnEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctn3DSphericalEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoBPLCMS3DCorrFctnEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleEtCorr.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutPt.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoAvgSepCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDGV0.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoAnalysisAzimuthalPbPb.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistanceLM.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPicoEventRP.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistanceKK.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutResonances.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnMinvMonitor.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnPairFractions.cxx FEMTOSCOPY/AliFemtoUser/AliAnalysisTaskParticleEfficiency.cxx)
+set ( SRCS  FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityKTPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoKKTrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoTPCInnerCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoChi2CorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnSource.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDEtaDPhi.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelBPLCMSCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelGausRinvFreezeOutGenerator.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnTrueQ.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnNonIdDR.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DSpherical.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctn3DLCMSSpherical.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelAllHiddenInfo.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCchiNdof.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQATrackCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQAEventCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorTrackTPCncls.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityTPCEntranceSepQAPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityQAPairCut.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDirectYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoModelCorrFctnDirectYlm.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDG.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnTPCNcls.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhi.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnDEtaDPhiCorrections.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnGammaMonitor.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoQinvCorrFctnEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctn3DSphericalEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoBPLCMS3DCorrFctnEMCIC.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutAntiGamma.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleEtCorr.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistance.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutPt.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoAvgSepCorrFctn.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticlePtPDGV0.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoAnalysisAzimuthalPbPb.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistanceLM.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPicoEventRP.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutRadialDistanceKK.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutResonances.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnMinvMonitor.cxx FEMTOSCOPY/AliFemtoUser/AliFemtoCorrFctnPairFractions.cxx FEMTOSCOPY/AliFemtoUser/AliAnalysisTaskParticleEfficiency.cxx)
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
index 567b2c2..ecd4e99 100644 (file)
@@ -37,6 +37,7 @@ AliFemtoCorrFctnDEtaDPhi::AliFemtoCorrFctnDEtaDPhi(char* title, const int& aPhiB
   fDCosPtDenominator(0),
   fPhi(0),
   fEta(0),
+  fPtSumDist(0),
   fYtYtNumerator(0),
   fYtYtDenominator(0),
   fIfCorrectionHist(kNone),
@@ -60,6 +61,11 @@ AliFemtoCorrFctnDEtaDPhi::AliFemtoCorrFctnDEtaDPhi(char* title, const int& aPhiB
   strncat(tTitDenD,title, 100);
   fDPhiDEtaDenominator = new TH2D(tTitDenD,title,aPhiBins,fphiL,fphiT,aEtaBins,-2.0,2.0);
 
+  char tTitNum[101] = "PtSumDist";
+  strncat(tTitNum,title, 100);
+  fPtSumDist = new TH1D(tTitNum,title,200,0,10);
+  fPtSumDist->Sumw2();
+
   // set up numerator
   char tTitNumDPhi[101] = "NumDPhi";
   strncat(tTitNumDPhi,title, 100);
@@ -155,6 +161,7 @@ AliFemtoCorrFctnDEtaDPhi::AliFemtoCorrFctnDEtaDPhi(const AliFemtoCorrFctnDEtaDPh
   fDCosPtDenominator(0),
   fPhi(0),
   fEta(0),
+  fPtSumDist(0),
   fYtYtNumerator(0),
   fYtYtDenominator(0),
   fIfCorrectionHist(kNone),
@@ -219,6 +226,11 @@ AliFemtoCorrFctnDEtaDPhi::AliFemtoCorrFctnDEtaDPhi(const AliFemtoCorrFctnDEtaDPh
   else
     fEta = 0;
 
+ if (aCorrFctn.fPtSumDist)
+   fPtSumDist = new TH1D(*aCorrFctn.fPtSumDist);
+ else
+   fPtSumDist = 0;
+
  if (aCorrFctn.fYtYtNumerator)
    fYtYtNumerator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator);
  else 
@@ -250,6 +262,9 @@ AliFemtoCorrFctnDEtaDPhi::~AliFemtoCorrFctnDEtaDPhi(){
   // destructor
   delete fDPhiDEtaNumerator;
   delete fDPhiDEtaDenominator;
+  delete fPtSumDist;
+
+
   delete fDPhiNumerator;
   delete fDPhiDenominator;
   delete fDCosNumerator;
@@ -331,6 +346,11 @@ AliFemtoCorrFctnDEtaDPhi& AliFemtoCorrFctnDEtaDPhi::operator=(const AliFemtoCorr
   else
     fEta = 0;
 
+ if (aCorrFctn.fPtSumDist)
+   fPtSumDist = new TH1D(*aCorrFctn.fPtSumDist);
+ else
+   fPtSumDist = 0;
+
  if (aCorrFctn.fYtYtNumerator)
    fYtYtNumerator = new TH2D(*aCorrFctn.fDPhiDEtaDenominator);
  else 
@@ -418,6 +438,7 @@ void AliFemtoCorrFctnDEtaDPhi::AddRealPair( AliFemtoPair* pair){
    double pt1 = TMath::Hypot(px1, py1);
    double pt2 = TMath::Hypot(px2, py2);
 //   double ptmin = pt1>pt2 ? pt2 : pt1;
+  fPtSumDist->Fill(pt1+pt2);
 
 //   double cosphi = (px1*px2 + py1*py2 + pz1*pz2)/
 //     sqrt((px1*px1 + py1*py1 + pz1*pz1)*(px2*px2 + py2*py2 + pz2*pz2));
@@ -526,6 +547,7 @@ void AliFemtoCorrFctnDEtaDPhi::WriteHistos()
   // Write out result histograms
   fDPhiDEtaNumerator->Write();
   fDPhiDEtaDenominator->Write();
+  fPtSumDist->Write();
   /*fDPhiNumerator->Write();
   fDPhiDenominator->Write();
   fDCosNumerator->Write();
@@ -556,6 +578,7 @@ TList* AliFemtoCorrFctnDEtaDPhi::GetOutputList()
 
   tOutputList->Add(fDPhiDEtaNumerator);
   tOutputList->Add(fDPhiDEtaDenominator);
+  tOutputList->Add(fPtSumDist);
   /*tOutputList->Add(fDPhiNumerator);
   tOutputList->Add(fDPhiDenominator);
   tOutputList->Add(fDCosNumerator);
index 7ad57b0..6dd7d97 100644 (file)
@@ -58,6 +58,7 @@ private:
 
   TH1D *fPhi;
   TH1D *fEta;
+  TH1D *fPtSumDist;
 
   TH2D *fYtYtNumerator;
   TH2D *fYtYtDenominator; 
index 3bc501a..6188381 100644 (file)
@@ -429,16 +429,16 @@ bool AliFemtoESDTrackCut::Pass(const AliFemtoTrack* track)
              imost = 9;
            }
          }
-         if (fMostProbable == 10) {
+         if (fMostProbable == 10) {//cut on Nsigma in pT not p
            if (IsPionNSigma(track->Pt(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
              imost = 10;
          }
-         else if (fMostProbable == 11) {
+         else if (fMostProbable == 11) {//cut on Nsigma in pT not p
            if (IsKaonNSigma(track->Pt(), track->NSigmaTPCK(), track->NSigmaTOFK())){
              imost = 11;
            }
          }
-         else if (fMostProbable == 12) { // proton nsigma-PID required contour adjusting (in LHC10h)
+         else if (fMostProbable == 12) { //cut on Nsigma in pT not p
            if ( IsProtonNSigma(track->Pt(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
              imost = 12;
          }
diff --git a/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx b/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx
new file mode 100644 (file)
index 0000000..b009e8d
--- /dev/null
@@ -0,0 +1,1230 @@
+/*
+***************************************************************************
+*
+* $Id$
+*
+*
+***************************************************************************
+*
+*
+*
+*
+***************************************************************************
+*
+* $Log$
+* Revision 1.3  2007/05/22 09:01:42  akisiel
+* Add the possibiloity to save cut settings in the ROOT file
+*
+* Revision 1.2  2007/05/21 10:38:25  akisiel
+* More coding rule conformance
+*
+* Revision 1.1  2007/05/16 10:25:06  akisiel
+* Making the directory structure of AliFemtoUser flat. All files go into one common directory
+*
+* Revision 1.4  2007/05/03 09:46:10  akisiel
+* Fixing Effective C++ warnings
+*
+* Revision 1.3  2007/04/27 07:25:59  akisiel
+* Make revisions needed for compilation from the main AliRoot tree
+*
+* Revision 1.1.1.1  2007/04/25 15:38:41  panos
+* Importing the HBT code dir
+*
+* Revision 1.4  2007-04-03 16:00:08  mchojnacki
+* Changes to iprove memory managing
+*
+* Revision 1.3  2007/03/13 15:30:03  mchojnacki
+* adding reader for simulated data
+*
+* Revision 1.2  2007/03/08 14:58:03  mchojnacki
+* adding some alice stuff
+*
+* Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
+* First version on CVS
+*
+**************************************************************************/
+
+#include "AliFemtoMJTrackCut.h"
+#include <cstdio>
+
+#ifdef __ROOT__
+ClassImp(AliFemtoMJTrackCut)
+#endif
+
+
+// electron
+// 0.13 - 1.8
+// 0       7.594129e-02    8.256141e-03
+// 1       -5.535827e-01   8.170825e-02
+// 2       1.728591e+00    3.104210e-01
+// 3       -2.827893e+00   5.827802e-01
+// 4       2.503553e+00    5.736207e-01
+// 5       -1.125965e+00   2.821170e-01
+// 6       2.009036e-01    5.438876e-02
+
+// pion
+// 0.13 - 2.0
+// 0       1.063457e+00    8.872043e-03
+// 1       -4.222208e-01   2.534402e-02
+// 2       1.042004e-01    1.503945e-02
+
+// kaon
+// 0.18 - 2.0
+// 0       -7.289406e-02   1.686074e-03
+// 1       4.415666e-01    1.143939e-02
+// 2       -2.996790e-01   1.840964e-02
+// 3       6.704652e-02    7.783990e-03
+
+// proton
+// 0.26 - 2.0
+// 0       -3.730200e-02   2.347311e-03
+// 1       1.163684e-01    1.319316e-02
+// 2       8.354116e-02    1.997948e-02
+// 3       -4.608098e-02   8.336400e-03
+
+
+  AliFemtoMJTrackCut::AliFemtoMJTrackCut() :
+    fCharge(0),
+    fLabel(0),
+    fStatus(0),
+    fPIDMethod(knSigma),
+  fNsigmaTPCTOF(kFALSE),
+  fNsigmaTPConly(kFALSE),
+  fNsigma(3.),
+    fminTPCclsF(0),
+    fminTPCncls(0),
+    fminITScls(0),
+    fMaxITSchiNdof(1000.0),
+    fMaxTPCchiNdof(1000.0),
+    fMaxSigmaToVertex(1000.0),
+    fNTracksPassed(0),
+    fNTracksFailed(0),
+    fRemoveKinks(kFALSE),
+    fRemoveITSFake(kFALSE),
+    fMostProbable(0),
+    fMaxImpactXY(1000.0),
+  fMinImpactXY(-1000.0),
+    fMaxImpactZ(1000.0),
+    fMaxImpactXYPtOff(1000.0),
+    fMaxImpactXYPtNrm(1000.0),
+    fMaxImpactXYPtPow(1000.0),
+    fMinPforTOFpid(0.0),
+    fMaxPforTOFpid(10000.0),
+    fMinPforTPCpid(0.0),
+    fMaxPforTPCpid(10000.0),
+    fMinPforITSpid(0.0),
+   fMaxPforITSpid(10000.0),
+   fElectronRejection(0)
+{
+  // Default constructor
+  fNTracksPassed = fNTracksFailed = 0;
+  fCharge = 0;  // takes both charges 0
+  fPt[0]=0.0;              fPt[1] = 100.0;//100
+  fRapidity[0]=-2;       fRapidity[1]=2;//-2 2
+  fEta[0]=-2;       fEta[1]=2;//-2 2
+  fPidProbElectron[0]=-1;fPidProbElectron[1]=2;
+  fPidProbPion[0]=-1;    fPidProbPion[1]=2;
+  fPidProbKaon[0]=-1;fPidProbKaon[1]=2;
+  fPidProbProton[0]=-1;fPidProbProton[1]=2;
+  fPidProbMuon[0]=-1;fPidProbMuon[1]=2;
+  for (Int_t i = 0; i < 3; i++)
+    fCutClusterRequirementITS[i] = AliESDtrackCuts::kOff;
+  fLabel=false;
+  fStatus=0;
+  fminTPCclsF=0;
+  fminITScls=0;
+  fPIDMethod=knSigma;
+  fNsigmaTPCTOF=kFALSE;
+  fNsigmaTPConly=kFALSE;
+  fNsigma=3.;
+}
+//------------------------------
+AliFemtoMJTrackCut::~AliFemtoMJTrackCut(){
+  /* noop */
+}
+//------------------------------
+bool AliFemtoMJTrackCut::Pass(const AliFemtoTrack* track)
+{
+  //cout<<"AliFemtoMJTrackCut::Pass"<<endl;
+
+  // test the particle and return
+  // true if it meets all the criteria
+  // false if it doesn't meet at least one of the criteria
+  float tMost[5];
+
+  //cout<<"AliFemtoESD  cut"<<endl;
+  //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
+  if (fStatus!=0)
+    {
+      //cout<<" status "<<track->Label()<<" "<<track->Flags()<<" "<<track->TPCnclsF()<<" "<<track->ITSncls()<<endl;
+      if ((track->Flags()&fStatus)!=fStatus)
+       {
+         //      cout<<track->Flags()<<" "<<fStatus<<" no go through status"<<endl;
+         return false;
+       }
+
+    }
+  if (fRemoveKinks) {
+    if ((track->KinkIndex(0)) || (track->KinkIndex(1)) || (track->KinkIndex(2)))
+      return false;
+  }
+  if (fRemoveITSFake) {
+    if (track->ITSncls() < 0)
+      return false;
+  }
+  if (fminTPCclsF>track->TPCnclsF())
+    {
+      //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
+      return false;
+    }
+  if (fminTPCncls>track->TPCncls())
+    {
+      //cout<<" No go because TPC Number of ClsF"<<fminTPCclsF<< " "<<track->TPCnclsF()<<endl;
+      return false;
+    }
+  if (fminITScls>track->ITSncls())
+    {
+      //cout<<" No go because ITS Number of Cls"<<fminITScls<< " "<<track->ITSncls()<<endl;
+      return false;
+    }
+
+  if (fMaxImpactXY < TMath::Abs(track->ImpactD()))
+    return false;
+
+  if (fMinImpactXY > TMath::Abs(track->ImpactD()))
+    return false;
+
+  if (fMaxImpactZ < TMath::Abs(track->ImpactZ()))
+    return false;
+
+  if (fMaxSigmaToVertex < track->SigmaToVertex()) {
+    return false;
+  }
+
+  if (track->ITSncls() > 0)
+    if ((track->ITSchi2()/track->ITSncls()) > fMaxITSchiNdof) {
+      return false;
+    }
+
+  if (track->TPCncls() > 0)
+    if ((track->TPCchi2()/track->TPCncls()) > fMaxTPCchiNdof) {
+      return false;
+    }
+  //ITS cluster requirenments
+  for (Int_t i = 0; i < 3; i++)
+    if(!CheckITSClusterRequirement(fCutClusterRequirementITS[i], track->HasPointOnITSLayer(i*2), track->HasPointOnITSLayer(i*2+1)))
+      return false;
+
+  if (fLabel)
+    {
+      //cout<<"labels"<<endl;
+      if(track->Label()<0)
+       {
+         fNTracksFailed++;
+         //   cout<<"No Go Through the cut"<<endl;
+         //  cout<<fLabel<<" Label="<<track->Label()<<endl;
+         return false;
+       }
+    }
+  if (fCharge!=0)
+    {
+      //cout<<"AliFemtoESD  cut ch "<<endl;
+      //cout<<fCharge<<" Charge="<<track->Charge()<<endl;
+      if (track->Charge()!= fCharge)
+       {
+         fNTracksFailed++;
+         //  cout<<"No Go Through the cut"<<endl;
+         // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
+         return false;
+       }
+    }
+
+
+
+
+  Bool_t tTPCPidIn = (track->Flags()&AliFemtoTrack::kTPCpid)>0;
+  Bool_t tITSPidIn = (track->Flags()&AliFemtoTrack::kITSpid)>0;
+  Bool_t tTOFPidIn = (track->Flags()&AliFemtoTrack::kTOFpid)>0;
+
+  if(fMinPforTOFpid > 0 && track->P().Mag() > fMinPforTOFpid &&
+     track->P().Mag() < fMaxPforTOFpid && !tTOFPidIn)
+    {
+      fNTracksFailed++;
+      return false;
+    }
+
+  if(fMinPforTPCpid > 0 && track->P().Mag() > fMinPforTPCpid &&
+     track->P().Mag() < fMaxPforTPCpid && !tTPCPidIn)
+    {
+      fNTracksFailed++;
+      return false;
+    }
+
+  if(fMinPforITSpid > 0 && track->P().Mag() > fMinPforITSpid &&
+     track->P().Mag() < fMaxPforITSpid && !tITSPidIn)
+    {
+      fNTracksFailed++;
+      return false;
+    }
+
+
+  float tEnergy = ::sqrt(track->P().Mag2()+fMass*fMass);
+  float tRapidity = 0;
+  if(tEnergy-track->P().z()!=0 && (tEnergy+track->P().z())/(tEnergy-track->P().z())>0)
+    tRapidity = 0.5*::log((tEnergy+track->P().z())/(tEnergy-track->P().z()));
+  float tPt = ::sqrt((track->P().x())*(track->P().x())+(track->P().y())*(track->P().y()));
+  float tEta = track->P().PseudoRapidity();
+
+  if (fMaxImpactXYPtOff < 999.0) {
+    if ((fMaxImpactXYPtOff + fMaxImpactXYPtNrm*TMath::Power(tPt, fMaxImpactXYPtPow)) < TMath::Abs(track->ImpactD())) {
+      fNTracksFailed++;
+      return false;
+    }
+  }
+
+  if ((tRapidity<fRapidity[0])||(tRapidity>fRapidity[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
+      return false;
+    }
+  if ((tEta<fEta[0])||(tEta>fEta[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fEta[0]<<" < Eta ="<<tEta<<" <"<<fEta[1]<<endl;
+      return false;
+    }
+  if ((tPt<fPt[0])||(tPt>fPt[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
+      return false;
+    }
+
+
+
+
+  //   cout << "Track has pids: "
+  //        << track->PidProbElectron() << " "
+  //        << track->PidProbMuon() << " "
+  //        << track->PidProbPion() << " "
+  //        << track->PidProbKaon() << " "
+  //        << track->PidProbProton() << " "
+  //        << track->PidProbElectron()+track->PidProbMuon()+track->PidProbPion()+track->PidProbKaon()+track->PidProbProton() << endl;
+
+
+  if ((track->PidProbElectron()<fPidProbElectron[0])||(track->PidProbElectron()>fPidProbElectron[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbElectron[0]<<" < e ="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
+      return false;
+    }
+  if ((track->PidProbPion()<fPidProbPion[0])||(track->PidProbPion()>fPidProbPion[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbPion[0]<<" < pi ="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
+      return false;
+    }
+  if ((track->PidProbKaon()<fPidProbKaon[0])||(track->PidProbKaon()>fPidProbKaon[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbKaon[0]<<" < k ="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
+      return false;
+    }
+  if ((track->PidProbProton()<fPidProbProton[0])||(track->PidProbProton()>fPidProbProton[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbProton[0]<<" < p  ="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
+      return false;
+    }
+  if ((track->PidProbMuon()<fPidProbMuon[0])||(track->PidProbMuon()>fPidProbMuon[1]))
+    {
+      fNTracksFailed++;
+      //cout<<"No Go Through the cut"<<endl;
+      //cout<<fPidProbMuon[0]<<" <  mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
+      return false;
+    }
+
+  //****N Sigma Method -- electron rejection****
+  if(fElectronRejection) 
+    if(!IsElectron(track->NSigmaTPCE(),track->NSigmaTPCPi(),track->NSigmaTPCK(), track->NSigmaTPCP())) 
+      return false;
+
+
+  if (fMostProbable) {
+
+    int imost=0;
+    tMost[0] = track->PidProbElectron()*PidFractionElectron(track->P().Mag());
+    tMost[1] = 0.0;
+    tMost[2] = track->PidProbPion()*PidFractionPion(track->P().Mag());
+    tMost[3] = track->PidProbKaon()*PidFractionKaon(track->P().Mag());
+    tMost[4] = track->PidProbProton()*PidFractionProton(track->P().Mag());
+    float ipidmax = 0.0;
+
+    //****N Sigma Method****
+       if(fPIDMethod==0){
+         // Looking for pions
+         if (fMostProbable == 2) {
+           if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
+             imost = 2;
+
+         }
+         else if (fMostProbable == 3) {
+
+
+           if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK())){
+
+             imost = 3;
+           }
+         }
+         else if (fMostProbable == 4) { // proton nsigma-PID required contour adjusting (in LHC10h)
+           if ( IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) // && (TMath::Abs(track->NSigmaTPCP()) < TMath::Abs(track->NSigmaTPCPi())) && (TMath::Abs(track->NSigmaTPCP()) < TMath::Abs(track->NSigmaTPCK())) && (TMath::Abs(track->NSigmaTOFP()) < TMath::Abs(track->NSigmaTOFPi())) && (TMath::Abs(track->NSigmaTOFP()) < TMath::Abs(track->NSigmaTOFK()))
+                // && IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())
+                )
+             imost = 4;
+         }
+         else if (fMostProbable == 5) { // no-protons
+           if ( !IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
+             imost = 5;
+         }
+         else if (fMostProbable == 6) { //pions OR kaons OR protons
+           if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
+             imost = 6;
+           else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
+             imost = 6;
+           else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
+             imost = 6;
+         }
+         else if (fMostProbable == 7) { // pions OR kaons OR protons OR electrons
+           if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
+             imost = 7;
+           else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
+             imost = 7;
+           else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
+             imost = 7;
+           else if (TMath::Abs(track->NSigmaTPCE())<3)
+             imost = 7;
+
+         }
+         else if (fMostProbable == 8) { // TOF matching
+           if(track->NSigmaTOFPi() != -1000 || track->Pt()<0.5){
+             imost = 8;
+           }
+         }
+         else if (fMostProbable == 9) { // Other: no kaons, no pions, no protons
+           if (IsPionNSigma(track->P().Mag(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
+             imost = -1;
+           else if (IsKaonNSigma(track->P().Mag(), track->NSigmaTPCK(), track->NSigmaTOFK()))
+             imost = -1;
+           else if (IsProtonNSigma(track->P().Mag(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
+             imost = -1;
+           else if(track->NSigmaTOFPi() != -1000 || track->Pt()<0.5){
+             imost = 9;
+           }
+         }
+         if (fMostProbable == 10) {//cut on Nsigma in pT not p
+           if (IsPionNSigma(track->Pt(), track->NSigmaTPCPi(), track->NSigmaTOFPi()))
+             imost = 10;
+         }
+         else if (fMostProbable == 11) {//cut on Nsigma in pT not p
+           if (IsKaonNSigma(track->Pt(), track->NSigmaTPCK(), track->NSigmaTOFK())){
+             imost = 11;
+           }
+         }
+         else if (fMostProbable == 12) { //cut on Nsigma in pT not p
+           if ( IsProtonNSigma(track->Pt(), track->NSigmaTPCP(), track->NSigmaTOFP()) )
+             imost = 12;
+         }
+         else if (fMostProbable == 13) { //cut on Nsigma in pT not p, EXCLUSIVE PID
+           if ((IsPionNSigma(track->Pt(),track->NSigmaTPCPi(), track->NSigmaTOFPi()) && !IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP())))
+             imost = 13;
+         }
+         else if (fMostProbable == 14) { //cut on Nsigma in pT not p, EXCLUSIVE PID
+           bool isPionNsigma = (IsPionNSigma(track->Pt(),track->NSigmaTPCPi(), track->NSigmaTOFPi()) && !IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()));
+           if ( !isPionNsigma && IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()))
+             imost = 14;
+         }
+         else if (fMostProbable == 15) { //cut on Nsigma in pT not p, EXCLUSIVE PID
+           bool isPionNsigma = (IsPionNSigma(track->Pt(),track->NSigmaTPCPi(), track->NSigmaTOFPi()) && !IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()));
+           bool isKaonNsigma = (!isPionNsigma && IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()) && !IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()));
+           if (!isPionNsigma && !isKaonNsigma && IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()))
+             imost = 15;
+         }
+         //*************** Without double counting, pions ************************
+         else if (fMostProbable == 16) { //cut on Nsigma in pT not p,  without double counting
+           double nSigmaPIDPi = 0, nSigmaPIDK = 0, nSigmaPIDP = 0;
+           if(track->Pt()<0.5){
+             nSigmaPIDPi = abs(track->NSigmaTPCPi());
+             nSigmaPIDK  = abs(track->NSigmaTPCK());
+             nSigmaPIDP  = abs(track->NSigmaTPCP());
+           }
+           else{
+             nSigmaPIDPi = TMath::Hypot(track->NSigmaTOFPi(), track->NSigmaTPCPi());
+             nSigmaPIDK= TMath::Hypot(track->NSigmaTOFK(), track->NSigmaTPCK());
+             nSigmaPIDP= TMath::Hypot(track->NSigmaTOFP(), track->NSigmaTPCP());
+           }
+           bool isPionNsigma = 0;
+
+           if(nSigmaPIDPi<nSigmaPIDK && nSigmaPIDPi<nSigmaPIDP){
+             isPionNsigma = (IsPionNSigma(track->Pt(),track->NSigmaTPCPi(), track->NSigmaTOFPi()));
+             if(isPionNsigma) imost=16;
+           }
+         }
+
+         else if (fMostProbable == 17) { //cut on Nsigma in pT not p,  without double counting
+           double nSigmaPIDPi = 0, nSigmaPIDK = 0, nSigmaPIDP = 0;
+           if(track->Pt()<0.5){
+             nSigmaPIDPi = abs(track->NSigmaTPCPi());
+             nSigmaPIDK  = abs(track->NSigmaTPCK());
+             nSigmaPIDP  = abs(track->NSigmaTPCP());
+           }
+           else{
+             nSigmaPIDPi = TMath::Hypot(track->NSigmaTOFPi(), track->NSigmaTPCPi());
+             nSigmaPIDK= TMath::Hypot(track->NSigmaTOFK(), track->NSigmaTPCK());
+             nSigmaPIDP= TMath::Hypot(track->NSigmaTOFP(), track->NSigmaTPCP());
+           }
+
+           bool isKaonNsigma = 0;
+           if(nSigmaPIDK<nSigmaPIDPi && nSigmaPIDK<nSigmaPIDP){
+             isKaonNsigma = (IsKaonNSigma(track->Pt(),track->NSigmaTPCK(), track->NSigmaTOFK()));
+             if(isKaonNsigma) imost=17;
+           }
+         }
+
+         else if (fMostProbable == 18) { //cut on Nsigma in pT not p,  without double counting
+           double nSigmaPIDPi = 0, nSigmaPIDK = 0, nSigmaPIDP = 0;
+           if(track->Pt()<0.5){
+             nSigmaPIDPi = abs(track->NSigmaTPCPi());
+             nSigmaPIDK  = abs(track->NSigmaTPCK());
+             nSigmaPIDP  = abs(track->NSigmaTPCP());
+           }
+           else{
+             nSigmaPIDPi = TMath::Hypot(track->NSigmaTOFPi(), track->NSigmaTPCPi());
+             nSigmaPIDK= TMath::Hypot(track->NSigmaTOFK(), track->NSigmaTPCK());
+             nSigmaPIDP= TMath::Hypot(track->NSigmaTOFP(), track->NSigmaTPCP());
+           }
+           bool isProtonNsigma  = 0;
+           
+           if(nSigmaPIDP<nSigmaPIDPi && nSigmaPIDP<nSigmaPIDK){
+             isProtonNsigma = (IsProtonNSigma(track->Pt(),track->NSigmaTPCP(), track->NSigmaTOFP()));
+           }
+           if(isProtonNsigma) imost=18;
+         }
+       }
+
+
+
+
+    //****Contour Method****
+       if(fPIDMethod==1){
+         for (int ip=0; ip<5; ip++)
+           if (tMost[ip] > ipidmax) { ipidmax = tMost[ip]; imost = ip; };
+
+         // Looking for pions
+         if (fMostProbable == 2) {
+           if (imost == 2) {
+             // Using the TPC to reject non-pions
+             if (!(IsPionTPCdEdx(track->P().Mag(), track->TPCsignal())))
+               imost = 0;
+             if (0) {
+               // Using the TOF to reject non-pions
+               if (track->P().Mag() < 0.6) {
+                 if (tTOFPidIn)
+                   if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
+                     imost = 0;
+               }
+               else {
+                 if (tTOFPidIn) {
+                   if (!IsPionTOFTime(track->P().Mag(), track->TOFpionTime()))
+                     imost = 0;
+                 }
+                 else {
+                   imost = 0;
+                 }
+               }
+             }
+           }
+         }
+
+         // Looking for kaons
+         else if (fMostProbable == 3) {
+           //       if (imost == 3) {
+           // Using the TPC to reject non-kaons
+           if (track->P().Mag() < 0.6) {
+             if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
+               imost = 0;
+             else imost = 3;
+             if (1) {
+               // Using the TOF to reject non-kaons
+               if (tTOFPidIn)
+                 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
+                   imost = 0;
+             }
+           }
+           else {
+             if (1) {
+               if (tTOFPidIn) {
+                 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
+                   imost = 0;
+                 else
+                   imost = 3;
+               }
+               else {
+                 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
+                   imost = 0;
+                 else
+                   imost = 3;
+               }
+             }
+           }
+           //       }
+         }
+
+         // Looking for protons
+         else if (fMostProbable == 4) {
+           //       if (imost == 3) {
+           // Using the TPC to reject non-kaons
+           if (track->P().Mag() < 0.8) {
+             if (!(IsProtonTPCdEdx(track->P().Mag(), track->TPCsignal())))
+               imost = 0;
+             else imost = 4;
+             if (0) {
+               // Using the TOF to reject non-kaons
+               if (tTOFPidIn)
+                 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
+                   imost = 0;
+             }
+           }
+           else {
+             if (0) {
+               if (tTOFPidIn) {
+                 if (!IsKaonTOFTime(track->P().Mag(), track->TOFkaonTime()))
+                   imost = 0;
+                 else
+                   imost = 3;
+               }
+               else {
+                 if (!(IsKaonTPCdEdx(track->P().Mag(), track->TPCsignal())))
+                   imost = 0;
+                 else
+                   imost = 3;
+               }
+             }
+           }
+           //       }
+         }
+       }
+    if (imost != fMostProbable) return false;
+  }
+
+  //fan
+  //cout<<"****** Go Through the cut ******"<<endl;
+  // cout<<fLabel<<" Label="<<track->Label()<<endl;
+  // cout<<fCharge<<" Charge="<<track->Charge()<<endl;
+  // cout<<fPt[0]<<" < Pt ="<<Pt<<" <"<<fPt[1]<<endl;
+  //cout<<fRapidity[0]<<" < Rapidity ="<<tRapidity<<" <"<<fRapidity[1]<<endl;
+  //cout<<fPidProbElectron[0]<<" <  e="<<track->PidProbElectron()<<" <"<<fPidProbElectron[1]<<endl;
+  //cout<<fPidProbPion[0]<<" <  pi="<<track->PidProbPion()<<" <"<<fPidProbPion[1]<<endl;
+  //cout<<fPidProbKaon[0]<<" <  k="<<track->PidProbKaon()<<" <"<<fPidProbKaon[1]<<endl;
+  //cout<<fPidProbProton[0]<<" <  p="<<track->PidProbProton()<<" <"<<fPidProbProton[1]<<endl;
+  //cout<<fPidProbMuon[0]<<" <  mi="<<track->PidProbMuon()<<" <"<<fPidProbMuon[1]<<endl;
+  fNTracksPassed++ ;
+  return true;
+
+
+}
+//------------------------------
+AliFemtoString AliFemtoMJTrackCut::Report()
+{
+  // Prepare report from the execution
+  string tStemp;
+  char tCtemp[100];
+  snprintf(tCtemp , 100, "Particle mass:\t%E\n",this->Mass());
+  tStemp=tCtemp;
+  snprintf(tCtemp , 100, "Particle charge:\t%d\n",fCharge);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle pT:\t%E - %E\n",fPt[0],fPt[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle rapidity:\t%E - %E\n",fRapidity[0],fRapidity[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Particle eta:\t%E - %E\n",fEta[0],fEta[1]);
+  tStemp+=tCtemp;
+  snprintf(tCtemp , 100, "Number of tracks which passed:\t%ld  Number which failed:\t%ld\n",fNTracksPassed,fNTracksFailed);
+  tStemp += tCtemp;
+  AliFemtoString returnThis = tStemp;
+  return returnThis;
+}
+TList *AliFemtoMJTrackCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+  char buf[200];
+  snprintf(buf, 200, "AliFemtoMJTrackCut.mass=%f", this->Mass());
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoMJTrackCut.charge=%i", fCharge);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobpion.minimum=%f", fPidProbPion[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobpion.maximum=%f", fPidProbPion[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobkaon.minimum=%f", fPidProbKaon[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobkaon.maximum=%f", fPidProbKaon[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobproton.minimum=%f", fPidProbProton[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobproton.maximum=%f", fPidProbProton[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobelectron.minimum=%f", fPidProbElectron[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobelectron.maximum=%f", fPidProbElectron[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobMuon.minimum=%f", fPidProbMuon[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pidprobMuon.maximum=%f", fPidProbMuon[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.minimumtpcclusters=%i", fminTPCclsF);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.minimumitsclusters=%i", fminTPCclsF);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pt.minimum=%f", fPt[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.pt.maximum=%f", fPt[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.rapidity.minimum=%f", fRapidity[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.rapidity.maximum=%f", fRapidity[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.removekinks=%i", fRemoveKinks);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.maxitschindof=%f", fMaxITSchiNdof);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.maxtpcchindof=%f", fMaxTPCchiNdof);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.maxsigmatovertex=%f", fMaxSigmaToVertex);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.maximpactxy=%f", fMaxImpactXY);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoMJTrackCut.maximpactz=%f", fMaxImpactZ);
+  tListSetttings->AddLast(new TObjString(buf));
+  if (fMostProbable) {
+    if (fMostProbable == 2)
+      snprintf(buf, 200, "AliFemtoMJTrackCut.mostprobable=%s", "Pion");
+    if (fMostProbable == 3)
+      snprintf(buf, 200, "AliFemtoMJTrackCut.mostprobable=%s", "Kaon");
+    if (fMostProbable == 4)
+      snprintf(buf, 200, "AliFemtoMJTrackCut.mostprobable=%s", "Proton");
+    tListSetttings->AddLast(new TObjString(buf));
+  }
+  return tListSetttings;
+}
+void AliFemtoMJTrackCut::SetRemoveKinks(const bool& flag)
+{
+  fRemoveKinks = flag;
+}
+
+void AliFemtoMJTrackCut::SetRemoveITSFake(const bool& flag)
+{
+  fRemoveITSFake = flag;
+}
+
+// electron
+// 0.13 - 1.8
+// 0       7.594129e-02    8.256141e-03
+// 1       -5.535827e-01   8.170825e-02
+// 2       1.728591e+00    3.104210e-01
+// 3       -2.827893e+00   5.827802e-01
+// 4       2.503553e+00    5.736207e-01
+// 5       -1.125965e+00   2.821170e-01
+// 6       2.009036e-01    5.438876e-02
+float AliFemtoMJTrackCut::PidFractionElectron(float mom) const
+{
+  // Provide a parameterized fraction of electrons dependent on momentum
+  if (mom<0.13)
+    return (7.594129e-02
+           -5.535827e-01*0.13
+           +1.728591e+00*0.13*0.13
+           -2.827893e+00*0.13*0.13*0.13
+           +2.503553e+00*0.13*0.13*0.13*0.13
+           -1.125965e+00*0.13*0.13*0.13*0.13*0.13
+           +2.009036e-01*0.13*0.13*0.13*0.13*0.13*0.13);
+
+  if (mom>1.8)
+    return (7.594129e-02
+           -5.535827e-01*1.8
+           +1.728591e+00*1.8*1.8
+           -2.827893e+00*1.8*1.8*1.8
+           +2.503553e+00*1.8*1.8*1.8*1.8
+           -1.125965e+00*1.8*1.8*1.8*1.8*1.8
+           +2.009036e-01*1.8*1.8*1.8*1.8*1.8*1.8);
+  return (7.594129e-02
+         -5.535827e-01*mom
+         +1.728591e+00*mom*mom
+         -2.827893e+00*mom*mom*mom
+         +2.503553e+00*mom*mom*mom*mom
+         -1.125965e+00*mom*mom*mom*mom*mom
+         +2.009036e-01*mom*mom*mom*mom*mom*mom);
+}
+
+// pion
+// 0.13 - 2.0
+// 0       1.063457e+00    8.872043e-03
+// 1       -4.222208e-01   2.534402e-02
+// 2       1.042004e-01    1.503945e-02
+float AliFemtoMJTrackCut::PidFractionPion(float mom) const
+{
+  // Provide a parameterized fraction of pions dependent on momentum
+  if (mom<0.13)
+    return ( 1.063457e+00
+            -4.222208e-01*0.13
+            +1.042004e-01*0.0169);
+  if (mom>2.0)
+    return ( 1.063457e+00
+            -4.222208e-01*2.0
+            +1.042004e-01*4.0);
+  return ( 1.063457e+00
+          -4.222208e-01*mom
+          +1.042004e-01*mom*mom);
+}
+
+// kaon
+// 0.18 - 2.0
+// 0       -7.289406e-02   1.686074e-03
+// 1       4.415666e-01    1.143939e-02
+// 2       -2.996790e-01   1.840964e-02
+// 3       6.704652e-02    7.783990e-03
+float AliFemtoMJTrackCut::PidFractionKaon(float mom) const
+{
+  // Provide a parameterized fraction of kaons dependent on momentum
+  if (mom<0.18)
+    return (-7.289406e-02
+           +4.415666e-01*0.18
+           -2.996790e-01*0.18*0.18
+           +6.704652e-02*0.18*0.18*0.18);
+  if (mom>2.0)
+    return (-7.289406e-02
+           +4.415666e-01*2.0
+           -2.996790e-01*2.0*2.0
+           +6.704652e-02*2.0*2.0*2.0);
+  return (-7.289406e-02
+         +4.415666e-01*mom
+         -2.996790e-01*mom*mom
+         +6.704652e-02*mom*mom*mom);
+}
+
+// proton
+// 0.26 - 2.0
+// 0       -3.730200e-02   2.347311e-03
+// 1       1.163684e-01    1.319316e-02
+// 2       8.354116e-02    1.997948e-02
+// 3       -4.608098e-02   8.336400e-03
+float AliFemtoMJTrackCut::PidFractionProton(float mom) const
+{
+  // Provide a parameterized fraction of protons dependent on momentum
+  if (mom<0.26) return  0.0;
+  if (mom>2.0)
+    return (-3.730200e-02
+           +1.163684e-01*2.0
+           +8.354116e-02*2.0*2.0
+           -4.608098e-02*2.0*2.0*2.0);
+  return (-3.730200e-02
+         +1.163684e-01*mom
+         +8.354116e-02*mom*mom
+         -4.608098e-02*mom*mom*mom);
+}
+
+void AliFemtoMJTrackCut::SetMomRangeTOFpidIs(const float& minp, const float& maxp)
+{
+  fMinPforTOFpid = minp;
+  fMaxPforTOFpid = maxp;
+}
+
+void AliFemtoMJTrackCut::SetMomRangeTPCpidIs(const float& minp, const float& maxp)
+{
+  fMinPforTPCpid = minp;
+  fMaxPforTPCpid = maxp;
+}
+
+void AliFemtoMJTrackCut::SetMomRangeITSpidIs(const float& minp, const float& maxp)
+{
+  fMinPforITSpid = minp;
+  fMaxPforITSpid = maxp;
+}
+
+bool AliFemtoMJTrackCut::IsPionTPCdEdx(float mom, float dEdx)
+{
+  //   double a1 = -95.4545, b1 = 86.5455;
+  //   double a2 = 0.0,      b2 = 56.0;
+  double a1 = -343.75,  b1 = 168.125;
+  double a2 = 0.0,      b2 = 65.0;
+
+  if (mom < 0.32) {
+    if (dEdx < a1*mom+b1) return true;
+  }
+  if (dEdx < a2*mom+b2) return true;
+
+  return false;
+}
+
+bool AliFemtoMJTrackCut::IsKaonTPCdEdx(float mom, float dEdx)
+{
+
+//   double a1 = -547.0; double b1 =  297.0;
+//   double a2 = -125.0; double b2 =  145.0;
+//   double a3 = -420.0; double b3 =  357.0;
+//   double a4 = -110.0; double b4 =  171.0;
+//   double b5 =   72.0;
+
+//   if (mom<0.2) return false;
+
+//   if (mom<0.36) {
+//     if (dEdx < a1*mom+b1) return false;
+//     if (dEdx > a3*mom+b3) return false;
+//   }
+//   else if (mom<0.6) {
+//     if (dEdx < a2*mom+b2) return false;
+//     if (dEdx > a3*mom+b3) return false;
+//   }
+//   else if (mom<0.9) {
+//     if (dEdx > a4*mom+b4) return false;
+//     if (dEdx <        b5) return false;
+//   }
+//   else
+//     return false;
+//   //   else {
+//   //     if (dEdx > b5) return false;
+//   //   }
+
+//   return true;
+
+  double a1 = -268.896; double b1 =  198.669;
+  double a2 = -49.0012;  double b2 =  88.7214;
+
+  if (mom<0.2) return false;
+
+  if (mom>0.3 && mom<0.5) {
+    if (dEdx < a1*mom+b1) return false;
+  }
+  else  if (mom<1.2) {
+    if (dEdx < a2*mom+b2) return false;
+  }
+
+  return true;
+
+}
+
+bool AliFemtoMJTrackCut::IsProtonTPCdEdx(float mom, float dEdx)
+{
+  double a1 = -1800.0; double b1 =  940.0;
+  double a2 = -500.0;  double b2 =  420.0;
+  double a3 = -216.7;  double b3 =  250.0;
+
+  if (mom<0.2) return false;
+
+  if (mom>0.3 && mom<0.4) {
+    if (dEdx < a1*mom+b1) return false;
+  }
+  else  if (mom<0.6) {
+    if (dEdx < a2*mom+b2) return false;
+  }
+  else  if (mom<0.9) {
+    if (dEdx < a3*mom+b3) return false;
+  }
+
+  return true;
+
+}
+
+bool AliFemtoMJTrackCut::IsPionTOFTime(float mom, float ttof)
+{
+  double a1 = -427.0; double b1 =  916.0;
+  double a2 =  327.0; double b2 = -888.0;
+  if (mom<0.3) return kFALSE;
+  if (mom>2.0) return kFALSE;
+  if (ttof > a1*mom+b1) return kFALSE;
+  if (ttof < a2*mom+b2) return kFALSE;
+
+  return kTRUE;
+}
+
+bool AliFemtoMJTrackCut::IsKaonTOFTime(float mom, float ttof)
+{
+  double a1 =   000.0; double b1 =  -500.0;
+  double a2 =   000.0; double b2 =   500.0;
+  double a3 =   850.0; double b3 = -1503.0;
+  double a4 = -1637.0; double b4 =  3621.0;
+
+  if (mom<0.3) return kFALSE;
+  if (mom>2.06) return kFALSE;
+  if (mom<1.2) {
+    if (ttof > a2*mom+b2) return kFALSE;
+    if (ttof < a1*mom+b1) return kFALSE;
+  }
+  if (mom<1.9) {
+    if (ttof > a2*mom+b2) return kFALSE;
+    if (ttof < a3*mom+b3) return kFALSE;
+  }
+  if (mom<2.06) {
+    if (ttof > a4*mom+b4) return kFALSE;
+    if (ttof < a3*mom+b3) return kFALSE;
+  }
+  return kTRUE;
+}
+
+bool AliFemtoMJTrackCut::IsProtonTOFTime(float mom, float ttof)
+{
+  double a1 =   000.0; double b1 =  -915.0;
+  double a2 =   000.0; double b2 =   600.0;
+  double a3 =   572.0; double b3 = -1715.0;
+
+  if (mom<0.3) return kFALSE;
+  if (mom>3.0) return kFALSE;
+  if (mom<1.4) {
+    if (ttof > a2*mom+b2) return kFALSE;
+    if (ttof < a1*mom+b1) return kFALSE;
+  }
+  if (mom<3.0) {
+    if (ttof > a2*mom+b2) return kFALSE;
+    if (ttof < a3*mom+b3) return kFALSE;
+  }
+  return kTRUE;
+}
+
+
+
+
+bool AliFemtoMJTrackCut::IsKaonTPCdEdxNSigma(float mom, float nsigmaK)
+{
+//  cout<<" AliFemtoMJTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
+
+
+  if(mom<0.35 && TMath::Abs(nsigmaK)<5.0)return true;
+  if(mom>=0.35 && mom<0.5 && TMath::Abs(nsigmaK)<3.0)return true;
+  if(mom>=0.5 && mom<0.7 && TMath::Abs(nsigmaK)<2.0)return true;
+
+  return false;
+}
+
+bool AliFemtoMJTrackCut::IsKaonTOFNSigma(float mom, float nsigmaK)
+{
+//  cout<<" AliFemtoMJTrackCut::IsKaonTPCdEdxNSigma "<<mom<<" "<<nsigmaK<<endl;
+  //fan
+  //  if(mom<1.5 && TMath::Abs(nsigmaK)<3.0)return true;
+  if(mom>=1.5 && TMath::Abs(nsigmaK)<2.0)return true;
+  return false;
+}
+
+/*
+bool AliFemtoMJTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
+{
+
+
+  if(mom<0.5)
+    {
+         if(TMath::Abs(nsigmaTPCK)<2.0)
+          {
+          return true;
+          }
+          else
+          {
+          return false;
+          }
+    }
+
+
+   if(mom>=0.5)
+    {
+         if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0)
+         {
+         return true;
+         }
+         else
+         {
+         return false;
+         }
+    }
+
+//   if(mom>1.5 || mom<0.15)return false;
+
+
+}
+
+*/
+
+//old
+bool AliFemtoMJTrackCut::IsKaonNSigma(float mom, float nsigmaTPCK, float nsigmaTOFK)
+{
+  if (fNsigmaTPCTOF) {
+    if (mom > 0.5) {
+      //        if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
+      if (TMath::Hypot( nsigmaTOFK, nsigmaTPCK ) < fNsigma)
+       return true;
+    }
+    else {
+      if (TMath::Abs(nsigmaTPCK) < fNsigma)
+       return true;
+    }
+  }
+  else {
+
+    if(mom<0.4)
+      {
+       if(nsigmaTOFK<-999.)
+         {
+           if(TMath::Abs(nsigmaTPCK)<2.0) return true;
+         }
+       else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
+      }
+    else if(mom>=0.4 && mom<=0.6)
+      {
+       if(nsigmaTOFK<-999.)
+         {
+           if(TMath::Abs(nsigmaTPCK)<2.0) return true;
+         }
+       else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
+      }
+    else if(nsigmaTOFK<-999.)
+      {
+       return false;
+      }
+    else if(TMath::Abs(nsigmaTOFK)<3.0 && TMath::Abs(nsigmaTPCK)<3.0) return true;
+  }
+  return false;
+}
+
+
+
+bool AliFemtoMJTrackCut::IsPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi)
+{
+  if (fNsigmaTPCTOF) {
+    if (mom > 0.5) {
+      //        if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
+      if (TMath::Hypot( nsigmaTOFPi, nsigmaTPCPi ) < fNsigma)
+       return true;
+    }
+    else {
+      if (TMath::Abs(nsigmaTPCPi) < fNsigma)
+       return true;
+    }
+  }
+  else {
+    if(mom<0.65)
+      {
+       if(nsigmaTOFPi<-999.)
+         {
+           if(mom<0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
+           else if(mom<0.5 && mom>=0.35 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
+           else if(mom>=0.5 && TMath::Abs(nsigmaTPCPi)<2.0) return true;
+           else return false;
+         }
+       else if(TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<3.0) return true;
+      }
+    else if(nsigmaTOFPi<-999.)
+      {
+       return false;
+      }
+    else if(mom<1.5 && TMath::Abs(nsigmaTOFPi)<3.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
+    else if(mom>=1.5 && TMath::Abs(nsigmaTOFPi)<2.0 && TMath::Abs(nsigmaTPCPi)<5.0) return true;
+  }
+  return false;
+}
+
+
+bool AliFemtoMJTrackCut::IsProtonNSigma(float mom, float nsigmaTPCP, float nsigmaTOFP)
+{
+
+  if (fNsigmaTPCTOF) {
+    if (mom > 0.5) {
+//        if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP )/TMath::Sqrt(2) < 3.0)
+        if (TMath::Hypot( nsigmaTOFP, nsigmaTPCP ) < fNsigma)
+            return true;
+       }
+    else {
+        if (TMath::Abs(nsigmaTPCP) < fNsigma)
+            return true;
+    }
+  }
+  else if (fNsigmaTPConly) {
+    if (TMath::Abs(nsigmaTPCP) < fNsigma)
+      return true;
+  }
+  else {
+    if (mom > 0.8 && mom < 2.5) {
+      if ( TMath::Abs(nsigmaTPCP) < 3.0 && TMath::Abs(nsigmaTOFP) < 3.0)
+        return true;
+    }
+    else if (mom > 2.5) {
+      if ( TMath::Abs(nsigmaTPCP) < 3.0 && TMath::Abs(nsigmaTOFP) < 2.0)
+        return true;
+    }
+    else {
+      if (TMath::Abs(nsigmaTPCP) < 3.0)
+        return true;
+    }
+  }
+
+  return false;
+}
+
+
+void AliFemtoMJTrackCut::SetPIDMethod(ReadPIDMethodType newMethod)
+{
+  fPIDMethod = newMethod;
+}
+
+
+void AliFemtoMJTrackCut::SetNsigmaTPCTOF(Bool_t nsigma)
+{
+  fNsigmaTPCTOF = nsigma;
+}
+
+void AliFemtoMJTrackCut::SetNsigmaTPConly(Bool_t nsigma)
+{
+  fNsigmaTPConly = nsigma;
+}
+
+void AliFemtoMJTrackCut::SetNsigma(Double_t nsigma)
+{
+  fNsigma = nsigma;
+}
+
+
+void AliFemtoMJTrackCut::SetClusterRequirementITS(AliESDtrackCuts::Detector det, AliESDtrackCuts::ITSClusterRequirement req)
+{
+  fCutClusterRequirementITS[det] = req;
+}
+
+Bool_t AliFemtoMJTrackCut::CheckITSClusterRequirement(AliESDtrackCuts::ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2)
+{
+  // checks if the cluster requirement is fullfilled (in this case: return kTRUE)
+
+  switch (req)
+    {
+    case AliESDtrackCuts::kOff:        return kTRUE;
+    case AliESDtrackCuts::kNone:       return !clusterL1 && !clusterL2;
+    case AliESDtrackCuts::kAny:        return clusterL1 || clusterL2;
+    case AliESDtrackCuts::kFirst:      return clusterL1;
+    case AliESDtrackCuts::kOnlyFirst:  return clusterL1 && !clusterL2;
+    case AliESDtrackCuts::kSecond:     return clusterL2;
+    case AliESDtrackCuts::kOnlySecond: return clusterL2 && !clusterL1;
+    case AliESDtrackCuts::kBoth:       return clusterL1 && clusterL2;
+  }
+
+  return kFALSE;
+}
+
+bool AliFemtoMJTrackCut::IsElectron(float nsigmaTPCE, float nsigmaTPCPi,float nsigmaTPCK, float nsigmaTPCP)
+{
+  if(TMath::Abs(nsigmaTPCE)<3 && TMath::Abs(nsigmaTPCPi)>3 && TMath::Abs(nsigmaTPCK)>3 && TMath::Abs(nsigmaTPCP)>3)
+      return false;
+   else
+     return true;
+}
diff --git a/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.h b/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.h
new file mode 100644 (file)
index 0000000..56832d2
--- /dev/null
@@ -0,0 +1,181 @@
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// AliFemtoMJTrackCut: A basic track cut that used information from     //
+// ALICE ESD to accept or reject the track.                             ////////////////////////////////////////////////
+#include "AliESDtrackCuts.h"
+
+#ifndef ALIFEMTOMJTRACKCUT_H
+#define ALIFEMTOMJTRACKCUT_H
+
+//#ifndef StMaker_H
+//#include "StMaker.h"
+//#endif
+
+#include "AliESDtrackCuts.h" //for enum with ITS layers
+#include "AliFemtoTrackCut.h"
+
+
+class AliFemtoMJTrackCut : public AliFemtoTrackCut
+{
+  public:
+
+  enum PIDMethodType {knSigma=0, kContour=1};
+  typedef enum PIDMethodType ReadPIDMethodType;
+
+  AliFemtoMJTrackCut();
+  virtual ~AliFemtoMJTrackCut();
+
+  virtual bool Pass(const AliFemtoTrack* aTrack);
+
+  virtual AliFemtoString Report();
+  virtual TList *ListSettings();
+  virtual AliFemtoParticleType Type(){return hbtTrack;}
+
+  void SetPt(const float& lo, const float& hi);
+  void SetRapidity(const float& lo, const float& hi);
+  void SetEta(const float& lo, const float& hi);
+  void SetCharge(const int& ch);
+  void SetPidProbElectron(const float& lo, const float& hi);
+  void SetPidProbPion(const float& lo, const float& hi);
+  void SetPidProbKaon(const float& lo, const float& hi);
+  void SetPidProbProton(const float& lo, const float& hi);
+  void SetPidProbMuon(const float& lo, const float& hi);
+  void SetLabel(const bool& flag);
+  void SetStatus(const long& w);
+  void SetminTPCclsF(const short& s);
+  void SetminTPCncls(const short& s);
+  void SetminITScls(const int& s);
+  void SetRemoveKinks(const bool& flag);
+  void SetRemoveITSFake(const bool& flag);
+  void SetMaxITSChiNdof(const float& maxchi);
+  void SetMaxTPCChiNdof(const float& maxchi);
+  void SetMaxSigmaToVertex(const float& maxsig);
+  void SetMaxImpactXY(const float& maximpxy);
+  void SetMinImpactXY(const float& minimpxy);
+  void SetMaxImpactZ(const float& maximpz);
+  void SetMaxImpactXYPtDep(const float& maxoff, const float& maxnrm, const float& maxpow);
+  void SetMostProbablePion();
+  void SetMostProbableKaon();
+  void SetMostProbableProton();
+  void SetLeastProbableProton();
+  void SetNoMostProbable();
+  void SetMostProbable(const int& num);
+  void SetPIDMethod(ReadPIDMethodType newMethod);
+  void SetNsigmaTPCTOF(Bool_t);
+  void SetNsigmaTPConly(Bool_t);
+  void SetNsigma(Double_t);
+  void SetClusterRequirementITS(AliESDtrackCuts::Detector det, AliESDtrackCuts::ITSClusterRequirement req = AliESDtrackCuts::kOff);
+
+  void SetMomRangeTOFpidIs(const float& minp, const float& maxp);
+  void SetMomRangeTPCpidIs(const float& minp, const float& maxp);
+  void SetMomRangeITSpidIs(const float& minp, const float& maxp);
+  void SetElectronRejection(Bool_t);
+
+ private:   // here are the quantities I want to cut on...
+
+  int               fCharge;             // particle charge
+  float             fPt[2];              // bounds for transverse momentum
+  float             fRapidity[2];        // bounds for rapidity
+  float             fEta[2];             // bounds for pseudorapidity
+  float             fPidProbElectron[2]; // bounds for electron probability
+  float             fPidProbPion[2];     // bounds for pion probability
+  float             fPidProbKaon[2];     // bounds for kaon probability
+  float             fPidProbProton[2];   // bounds for proton probability
+  float             fPidProbMuon[2];     // bounds for muon probability
+
+  AliESDtrackCuts::ITSClusterRequirement fCutClusterRequirementITS[3];  // detailed ITS cluster requirements for (SPD, SDD, SSD) - from AliESDtrackcuts!
+  bool              fLabel;              // if true label<0 will not pass throught
+  long              fStatus;             // staus flag
+  ReadPIDMethodType fPIDMethod;          // which PID mehod to use. 0 - nsgima, 1 - contour
+  Bool_t            fNsigmaTPCTOF;       // true if squared nsigma from TPC and TOF, false if separately from TPC and TOF
+  Bool_t            fNsigmaTPConly;       // true if nsigma from TPC only
+  Double_t            fNsigma;       // number of sigmas - 3 by default
+
+  short             fminTPCclsF;         // min number of findable clusters in the TPC
+  short             fminTPCncls;         // min number of clusters in the TPC
+  int               fminITScls;          // min number of clusters assigned in the ITS
+  float             fMaxITSchiNdof;      // maximum allowed chi2/ndof for ITS clusters
+  float             fMaxTPCchiNdof;      // maximum allowed chi2/ndof for TPC clusters
+  float             fMaxSigmaToVertex;   // maximum allowed sigma to primary vertex
+  long              fNTracksPassed;      // passed tracks count
+  long              fNTracksFailed;      // failed tracks count
+  bool              fRemoveKinks;        // if true particles with any kink label will not pass
+  bool              fRemoveITSFake;      // if true particles with ITS fake flag will not pass
+  int               fMostProbable;       // this particle type is required to be most probable
+
+  float             fMaxImpactXY;        // Max XY impact parameter
+  float             fMinImpactXY;        // Max XY impact parameter
+  float             fMaxImpactZ;         // Max Z impact parameter
+
+  float             fMaxImpactXYPtOff;   // Max XY DCA Pt dependent offset
+  float             fMaxImpactXYPtNrm;   // Max XY DCA Pt dependent normalization
+  float             fMaxImpactXYPtPow;   // Max XY DCA Pt dependent power
+
+  float             fMinPforTOFpid;  // momentum from which TOF PID is requested
+  float             fMaxPforTOFpid;  // momentum till which TOF PID is requested
+  float             fMinPforTPCpid;  // momentum from which TPC PID is requested
+  float             fMaxPforTPCpid;  // momentum till which TPC PID is requested
+  float             fMinPforITSpid;  // momentum from which ITS PID is requested
+  float             fMaxPforITSpid;  // momentum till which ITS PID is requested
+  bool fElectronRejection;
+
+  float PidFractionElectron(float mom) const;
+  float PidFractionPion(float mom) const;
+  float PidFractionKaon(float mom) const;
+  float PidFractionProton(float mom) const;
+
+  bool IsPionTPCdEdx(float mom, float dEdx);
+  bool IsKaonTPCdEdx(float mom, float dEdx);
+  bool IsProtonTPCdEdx(float mom, float dEdx);
+
+  bool IsPionTOFTime(float mom, float ttof);
+  bool IsKaonTOFTime(float mom, float ttof);
+  bool IsProtonTOFTime(float mom, float ttof);
+
+  bool IsKaonTPCdEdxNSigma(float mom, float nsigma);
+  bool IsKaonTOFNSigma(float mom, float nsigma);
+  bool IsKaonNSigma(float mom, float nsigmaTPC, float nsigmaTOF);
+  bool IsPionNSigma(float mom, float nsigmaTPC, float nsigmaTOF);
+  bool IsProtonNSigma(float mom, float nsigmaTPC, float nsigmaTOF);
+  bool IsElectron(float nsigmaTPCE, float nsigmaTPCPi,float nsigmaTPCK, float nsigmaTPCP);
+
+  Bool_t CheckITSClusterRequirement(AliESDtrackCuts::ITSClusterRequirement req, Bool_t clusterL1, Bool_t clusterL2); //the same as in AliESDtrackCuts
+
+
+#ifdef __ROOT__
+  ClassDef(AliFemtoMJTrackCut, 1)
+#endif
+    };
+
+
+inline void AliFemtoMJTrackCut::SetPt(const float& lo, const float& hi){fPt[0]=lo; fPt[1]=hi;}
+inline void AliFemtoMJTrackCut::SetRapidity(const float& lo,const float& hi){fRapidity[0]=lo; fRapidity[1]=hi;}
+inline void AliFemtoMJTrackCut::SetEta(const float& lo,const float& hi){fEta[0]=lo; fEta[1]=hi;}
+inline void AliFemtoMJTrackCut::SetCharge(const int& ch){fCharge = ch;}
+inline void AliFemtoMJTrackCut::SetPidProbElectron(const float& lo,const float& hi){fPidProbElectron[0]=lo; fPidProbElectron[1]=hi;}
+inline void AliFemtoMJTrackCut::SetPidProbPion(const float& lo,const float& hi){fPidProbPion[0]=lo; fPidProbPion[1]=hi;}
+inline void AliFemtoMJTrackCut::SetPidProbKaon(const float& lo,const float& hi){fPidProbKaon[0]=lo; fPidProbKaon[1]=hi;}
+inline void AliFemtoMJTrackCut::SetPidProbProton
+(const float& lo,const float& hi){fPidProbProton[0]=lo; fPidProbProton[1]=hi;}
+inline void AliFemtoMJTrackCut::SetPidProbMuon(const float& lo,const float& hi){fPidProbMuon[0]=lo; fPidProbMuon[1]=hi;}
+inline void AliFemtoMJTrackCut::SetLabel(const bool& flag){fLabel=flag;}
+inline void AliFemtoMJTrackCut::SetStatus(const long& status){fStatus=status;}
+inline void AliFemtoMJTrackCut::SetminTPCclsF(const short& minTPCclsF){fminTPCclsF=minTPCclsF;}
+inline void AliFemtoMJTrackCut::SetminTPCncls(const short& s){fminTPCncls=s;}
+inline void AliFemtoMJTrackCut::SetminITScls(const int& minITScls){fminITScls=minITScls;}
+inline void AliFemtoMJTrackCut::SetMostProbablePion() { fMostProbable = 2; }
+inline void AliFemtoMJTrackCut::SetMostProbableKaon() { fMostProbable = 3; }
+inline void AliFemtoMJTrackCut::SetMostProbableProton() { fMostProbable = 4; }
+inline void AliFemtoMJTrackCut::SetLeastProbableProton() { fMostProbable = 5; }
+inline void AliFemtoMJTrackCut::SetNoMostProbable() { fMostProbable = 0; }
+inline void AliFemtoMJTrackCut::SetMostProbable(const int& num) {  fMostProbable =  num; }
+inline void AliFemtoMJTrackCut::SetMaxITSChiNdof(const float& maxchi) { fMaxITSchiNdof = maxchi; }
+inline void AliFemtoMJTrackCut::SetMaxTPCChiNdof(const float& maxchi) { fMaxTPCchiNdof = maxchi; }
+inline void AliFemtoMJTrackCut::SetMaxSigmaToVertex(const float& maxsig) { fMaxSigmaToVertex = maxsig; }
+inline void AliFemtoMJTrackCut::SetMaxImpactXY(const float& maximpxy) { fMaxImpactXY = maximpxy; }
+inline void AliFemtoMJTrackCut::SetMinImpactXY(const float& minimpxy) { fMinImpactXY = minimpxy; }
+inline void AliFemtoMJTrackCut::SetMaxImpactXYPtDep(const float& maxoff, const float& maxnrm, const float& maxpow) { fMaxImpactXYPtOff = maxoff; fMaxImpactXYPtNrm = maxnrm; fMaxImpactXYPtPow = maxpow; }
+inline void AliFemtoMJTrackCut::SetMaxImpactZ(const float& maximpz) { fMaxImpactZ = maximpz; }
+inline void AliFemtoMJTrackCut::SetElectronRejection(Bool_t setE) { fElectronRejection = setE; }
+
+#endif
diff --git a/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/FB96_1DMCCorrExclusive/ConfigFemtoAnalysis.C b/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/FB96_1DMCCorrExclusive/ConfigFemtoAnalysis.C
new file mode 100644 (file)
index 0000000..5d907ea
--- /dev/null
@@ -0,0 +1,521 @@
+/*********************************************************************
+ *                                                                                                                                                                                      *
+ * 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 "AliFemtoMJTrackCut.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 = 5;
+
+       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;
+           parameter[14] = strtok(NULL, ",");
+           cout<<"Parameter [14]: (max pT kaons)"<<parameter[14]<<" "<<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
+    double maxPtKaons = atof(parameter[14]);  //4.0
+       printf("*** Connect to AliEn ***\n");
+       TGrid::Connect("alien://");
+
+       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, 0, 1, 1, 1};
+       const char *chrgs[numOfChTypes] = { "PP", "aPaP", "PaP", "KpKp", "KmKm", "KpKm", "PIpPIp", "PImPIm", "PIpPIm", "all", "plus", "minus", "mixed" };
+       
+       double ktrng[numOfkTbins+1] = {0.0, 0, 0, 0, 0, 0};
+       double ktrngAll[numOfkTbins+1] = {0.0, 1.0, 2.0, 3.0, 4.0, 100.0};
+       double ktrngPion[numOfkTbins+1] = {0.0, 0.8, 1.2, 1.4, 2.5, 100.0};
+       double ktrngKaon[numOfkTbins+1] = {0.0, 1.5, 2.5, 3.5, 100.0, 0};
+       double ktrngProton[numOfkTbins+1] = {0.0, 2.75, 100, 0, 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];
+       AliFemtoMJTrackCut                       *dtc1etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoMJTrackCut                       *dtc2etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoMJTrackCut                       *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 AliFemtoMJTrackCut();
+                                       dtc2etaphitpc[aniter] = new AliFemtoMJTrackCut();
+                                       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]->SetMostProbable(15);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(ProtonMass);         
+                                           dtc2etaphitpc[aniter]->SetMostProbable(15);//cut on Nsigma in pT not p
+                                          }
+
+                                       if (ichg == 3 ||ichg == 4 ||ichg == 5)//kaons 3-5
+                                          {
+                                            dtc1etaphitpc[aniter]->SetPt(0.3,maxPtKaons);
+                                            dtc2etaphitpc[aniter]->SetPt(0.3,maxPtKaons);
+                                           dtc1etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc1etaphitpc[aniter]->SetMostProbable(14);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc2etaphitpc[aniter]->SetMostProbable(14);//cut on Nsigma in pT not p
+
+                                          }
+                                        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]->SetMostProbable(13);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(PionMass);           
+                                           dtc2etaphitpc[aniter]->SetMostProbable(13);//cut on Nsigma in pT not p
+                                          }
+                                        if (ichg == 9)//all
+                                          {
+
+                                           dtc3etaphitpc[aniter] = new AliFemtoMJTrackCut();
+                                           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)
+                                         {
+                                           //FULL
+                                           if(ichg<2 || ichg==3||ichg==4 || ichg==6|| ichg==7||ichg==9||ichg==10||ichg==11){ 
+                                           //if(ichg==0 || ichg==3 || ichg==6 || ichg==10){ 
+                                             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);
+                                       cdedpetaphi[aniter]->SetDoFullAnalysis(kFALSE);
+                                       if(ichg==0 || ichg==1 || ichg==2)
+                                         cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kProton, AliFemtoCorrFctnDEtaDPhiCorrections::kProton/*,1,1,1,0*/);
+                                       //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kKaon, AliFemtoCorrFctnDEtaDPhiCorrections::kKaon/*,1,1,1,0*/);
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kPion/*,1,1,1,0*/);
+                                       
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kPion,1,1,1,1);    
+                                       
+                                       else
+                                         cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kAll, AliFemtoCorrFctnDEtaDPhiCorrections::kAll/*,1,1,1,0*/);
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kProton, 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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kPion);
+                                                       else
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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;
+}                                                                                               
diff --git a/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/FB96_1DMCCorrNoDoubleCounting/ConfigFemtoAnalysis.C b/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/FB96_1DMCCorrNoDoubleCounting/ConfigFemtoAnalysis.C
new file mode 100644 (file)
index 0000000..beca149
--- /dev/null
@@ -0,0 +1,521 @@
+/*********************************************************************
+ *                                                                                                                                                                                      *
+ * 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 "AliFemtoMJTrackCut.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 = 5;
+
+       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;
+           parameter[14] = strtok(NULL, ",");
+           cout<<"Parameter [14]: (max pT kaons)"<<parameter[14]<<" "<<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
+    double maxPtKaons = atof(parameter[14]);  //4.0
+       printf("*** Connect to AliEn ***\n");
+       TGrid::Connect("alien://");
+
+       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, 0, 1, 1, 1};
+       const char *chrgs[numOfChTypes] = { "PP", "aPaP", "PaP", "KpKp", "KmKm", "KpKm", "PIpPIp", "PImPIm", "PIpPIm", "all", "plus", "minus", "mixed" };
+       
+       double ktrng[numOfkTbins+1] = {0.0, 0, 0, 0, 0, 0};
+       double ktrngAll[numOfkTbins+1] = {0.0, 1.0, 2.0, 3.0, 4.0, 100.0};
+       double ktrngPion[numOfkTbins+1] = {0.0, 0.8, 1.2, 1.4, 2.5, 100.0};
+       double ktrngKaon[numOfkTbins+1] = {0.0, 1.5, 2.5, 3.5, 100.0, 0};
+       double ktrngProton[numOfkTbins+1] = {0.0, 2.75, 100, 0, 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];
+       AliFemtoMJTrackCut                       *dtc1etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoMJTrackCut                       *dtc2etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoMJTrackCut                       *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 AliFemtoMJTrackCut();
+                                       dtc2etaphitpc[aniter] = new AliFemtoMJTrackCut();
+                                       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]->SetMostProbable(18);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(ProtonMass);         
+                                           dtc2etaphitpc[aniter]->SetMostProbable(18);//cut on Nsigma in pT not p
+                                          }
+
+                                       if (ichg == 3 ||ichg == 4 ||ichg == 5)//kaons 3-5
+                                          {
+                                            dtc1etaphitpc[aniter]->SetPt(0.3,maxPtKaons);
+                                            dtc2etaphitpc[aniter]->SetPt(0.3,maxPtKaons);
+                                           dtc1etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc1etaphitpc[aniter]->SetMostProbable(17);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc2etaphitpc[aniter]->SetMostProbable(17);//cut on Nsigma in pT not p
+
+                                          }
+                                        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]->SetMostProbable(16);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(PionMass);           
+                                           dtc2etaphitpc[aniter]->SetMostProbable(16);//cut on Nsigma in pT not p
+                                          }
+                                        if (ichg == 9)//all
+                                          {
+
+                                           dtc3etaphitpc[aniter] = new AliFemtoMJTrackCut();
+                                           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)
+                                         {
+                                           //FULL
+                                           if(ichg<2 || ichg==3||ichg==4 || ichg==6|| ichg==7||ichg==9||ichg==10||ichg==11){ 
+                                           //if(ichg==0 || ichg==3 || ichg==6 || ichg==10){ 
+                                             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);
+                                       cdedpetaphi[aniter]->SetDoFullAnalysis(kFALSE);
+                                       if(ichg==0 || ichg==1 || ichg==2)
+                                         cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kProton, AliFemtoCorrFctnDEtaDPhiCorrections::kProton/*,1,1,1,0*/);
+                                       //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kKaon, AliFemtoCorrFctnDEtaDPhiCorrections::kKaon/*,1,1,1,0*/);
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kPion/*,1,1,1,0*/);
+                                       
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kPion,1,1,1,1);    
+                                       
+                                       else
+                                         cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kAll, AliFemtoCorrFctnDEtaDPhiCorrections::kAll/*,1,1,1,0*/);
+                                         //cdedpetaphi[aniter]->LoadCorrectionTabFromROOTFile("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kProton, 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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.root", AliFemtoCorrFctnDEtaDPhiCorrections::kPion, AliFemtoCorrFctnDEtaDPhiCorrections::kPion);
+                                                       else
+                                                         cdedpetaphiPt[ktm]->LoadCorrectionTabFromROOTFile1D("alien:///alice/cern.ch/user/m/majanik/2014/DEtaDPhi/Trains/Corrections/Train4Light/1Dmap_FB96_MCOnly.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;
+}                                                                                               
diff --git a/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/NoCorrectionsExclusive/ConfigFemtoAnalysis.C b/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/NoCorrectionsExclusive/ConfigFemtoAnalysis.C
new file mode 100644 (file)
index 0000000..de40598
--- /dev/null
@@ -0,0 +1,480 @@
+/*********************************************************************
+ *                                                                                                                                                                                      *
+ * 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 "AliFemtoMJTrackCut.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 "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 = 5;
+
+       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;
+           parameter[14] = strtok(NULL, ",");
+           cout<<"Parameter [14]: (max pT kaons)"<<parameter[14]<<" "<<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
+    double maxPtKaons = atof(parameter[14]);  //4.0
+       printf("*** Connect to AliEn ***\n");
+       TGrid::Connect("alien://");
+
+       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, 0, 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, 1.0, 2.0, 3.0, 4.0, 100.0};
+       double ktrngPion[numOfkTbins+1] = {0.0, 0.8, 1.2, 1.4, 2.5, 100.0};
+       double ktrngKaon[numOfkTbins+1] = {0.0, 1.5, 2.5, 3.5, 100.0, 0};
+       double ktrngProton[numOfkTbins+1] = {0.0, 2.75, 100, 0, 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];
+       AliFemtoMJTrackCut                       *dtc1etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoMJTrackCut                       *dtc2etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoMJTrackCut                       *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];
+       AliFemtoCorrFctnDEtaDPhi                        *cdedpetaphi[numOfMultBins*numOfChTypes];
+       AliFemtoCorrFctnDEtaDPhi                        *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 AliFemtoMJTrackCut();
+                                       dtc2etaphitpc[aniter] = new AliFemtoMJTrackCut();
+                                       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]->SetMostProbable(15);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(ProtonMass);         
+                                           dtc2etaphitpc[aniter]->SetMostProbable(15);//cut on Nsigma in pT not p
+                                          }
+
+                                       if (ichg == 3 ||ichg == 4 ||ichg == 5)//kaons 3-5
+                                          {
+                                            dtc1etaphitpc[aniter]->SetPt(0.3,maxPtKaons);
+                                            dtc2etaphitpc[aniter]->SetPt(0.3,maxPtKaons);
+                                           dtc1etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc1etaphitpc[aniter]->SetMostProbable(14);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc2etaphitpc[aniter]->SetMostProbable(14);//cut on Nsigma in pT not p
+
+                                          }
+                                        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]->SetMostProbable(13);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(PionMass);           
+                                           dtc2etaphitpc[aniter]->SetMostProbable(13);//cut on Nsigma in pT not p
+                                          }
+                                        if (ichg == 9)//all
+                                          {
+
+                                           dtc3etaphitpc[aniter] = new AliFemtoMJTrackCut();
+                                           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 AliFemtoCorrFctnDEtaDPhi(Form("cdedp%stpcM%i", chrgs[ichg], imult),35, 35);
+                                       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 AliFemtoCorrFctnDEtaDPhi(Form("cdedp%stpcM%ipT%i", chrgs[ichg], imult,ikt),35, 35);
+                                                       cdedpetaphiPt[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
+                                                       anetaphitpc[aniter]->AddCorrFctn(cdedpetaphiPt[ktm]);
+
+                                               }
+                                       }               
+                                       Manager->AddAnalysis(anetaphitpc[aniter]);      
+                               }
+                       }
+               }
+       }
+       return Manager;
+}                                                                                               
diff --git a/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/NoCorrectionsNoDoubleCounting/ConfigFemtoAnalysis.C b/PWGCF/FEMTOSCOPY/macros/Train/DEtaDPhi/2014/Train7Light/NoCorrectionsNoDoubleCounting/ConfigFemtoAnalysis.C
new file mode 100644 (file)
index 0000000..c4a89eb
--- /dev/null
@@ -0,0 +1,480 @@
+/*********************************************************************
+ *                                                                                                                                                                                      *
+ * 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 "AliFemtoMJTrackCut.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 "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 = 5;
+
+       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;
+           parameter[14] = strtok(NULL, ",");
+           cout<<"Parameter [14]: (max pT kaons)"<<parameter[14]<<" "<<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
+    double maxPtKaons = atof(parameter[14]);  //4.0
+       printf("*** Connect to AliEn ***\n");
+       TGrid::Connect("alien://");
+
+       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, 0, 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, 1.0, 2.0, 3.0, 4.0, 100.0};
+       double ktrngPion[numOfkTbins+1] = {0.0, 0.8, 1.2, 1.4, 2.5, 100.0};
+       double ktrngKaon[numOfkTbins+1] = {0.0, 1.5, 2.5, 3.5, 100.0, 0};
+       double ktrngProton[numOfkTbins+1] = {0.0, 2.75, 100, 0, 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];
+       AliFemtoMJTrackCut                       *dtc1etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoMJTrackCut                       *dtc2etaphitpc[numOfMultBins*numOfChTypes];
+       AliFemtoMJTrackCut                       *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];
+       AliFemtoCorrFctnDEtaDPhi                        *cdedpetaphi[numOfMultBins*numOfChTypes];
+       AliFemtoCorrFctnDEtaDPhi                        *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 AliFemtoMJTrackCut();
+                                       dtc2etaphitpc[aniter] = new AliFemtoMJTrackCut();
+                                       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]->SetMostProbable(18);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(ProtonMass);         
+                                           dtc2etaphitpc[aniter]->SetMostProbable(18);//cut on Nsigma in pT not p
+                                          }
+
+                                       if (ichg == 3 ||ichg == 4 ||ichg == 5)//kaons 3-5
+                                          {
+                                            dtc1etaphitpc[aniter]->SetPt(0.3,maxPtKaons);
+                                            dtc2etaphitpc[aniter]->SetPt(0.3,maxPtKaons);
+                                           dtc1etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc1etaphitpc[aniter]->SetMostProbable(17);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(KaonMass);
+                                           dtc2etaphitpc[aniter]->SetMostProbable(17);//cut on Nsigma in pT not p
+
+                                          }
+                                        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]->SetMostProbable(16);//cut on Nsigma in pT not p
+                                           dtc2etaphitpc[aniter]->SetMass(PionMass);           
+                                           dtc2etaphitpc[aniter]->SetMostProbable(16);//cut on Nsigma in pT not p
+                                          }
+                                        if (ichg == 9)//all
+                                          {
+
+                                           dtc3etaphitpc[aniter] = new AliFemtoMJTrackCut();
+                                           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 AliFemtoCorrFctnDEtaDPhi(Form("cdedp%stpcM%i", chrgs[ichg], imult),35, 35);
+                                       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 AliFemtoCorrFctnDEtaDPhi(Form("cdedp%stpcM%ipT%i", chrgs[ichg], imult,ikt),35, 35);
+                                                       cdedpetaphiPt[ktm]->SetPairSelectionCut(ktpcuts[ktm]);
+                                                       anetaphitpc[aniter]->AddCorrFctn(cdedpetaphiPt[ktm]);
+
+                                               }
+                                       }               
+                                       Manager->AddAnalysis(anetaphitpc[aniter]);      
+                               }
+                       }
+               }
+       }
+       return Manager;
+}                                                                                               
index 74d89d6..5c603cb 100644 (file)
@@ -8,6 +8,7 @@
 #pragma link C++ class AliFemtoPairCutRadialDistance;
 #pragma link C++ class AliFemtoESDTrackCut;
 #pragma link C++ class AliFemtoKKTrackCut;
+#pragma link C++ class AliFemtoMJTrackCut;
 #pragma link C++ class AliFemtoPairCutRadialDistanceKK;
 #pragma link C++ class AliFemtoShareQualityCorrFctn;
 #pragma link C++ class AliFemtoTPCInnerCorrFctn;