]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGCF/FEMTOSCOPY/K0Analysis/AliFemtoK0Analysis.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / K0Analysis / AliFemtoK0Analysis.cxx
index 6f847980f5c6183a2608663ca037422f5d1581df..81dfac277d7a7c6aaa9d7d76cb40768c37d7324c 100644 (file)
@@ -50,6 +50,7 @@
 //     - added Case3D to switch off all 3D objects (11/27/13)
 //     - added centrality flattening routine (and switch) (12/04/13)
 //     - added event plane stuff (12/11/13)
+//     - added NPsiBins argument (1/8/14)
 ////////////////////////////////////////////////////////////////////////////////
 
 
@@ -99,11 +100,13 @@ AliAnalysisTaskSE(),
   fOnlineCase(kTRUE),
   fMeritCase(kTRUE),
   fCase3D(kFALSE),
+  fCutCheck(kFALSE),
   fMinDecayLength(0.0),
   fMeritCutChoice(0),
   fMinSep(0.0),
   fFlatCent(kFALSE),
   fPsiBinning(kFALSE),
+  fNPsiBins(0),
   fEventCount(0),
   fEC(0x0),
   fEvt(0X0),
@@ -115,18 +118,20 @@ AliAnalysisTaskSE(),
 {
 }
 //________________________________________________________________________
-AliFemtoK0Analysis::AliFemtoK0Analysis(const char *name, bool SignDep, bool FieldPositive, bool OnlineCase, bool MeritCase, bool Case3D, float MinDL, int MeritCutChoice, float MinSep, bool FlatCent, bool PsiBinning
+AliFemtoK0Analysis::AliFemtoK0Analysis(const char *name, bool SignDep, bool FieldPositive, bool OnlineCase, bool MeritCase, bool Case3D, bool CutCheck, float MinDL, int MeritCutChoice, float MinSep, bool FlatCent, bool PsiBinning, int NPsiBins
 : AliAnalysisTaskSE(name),
   fSignDep(SignDep),
   fFieldPos(FieldPositive),
   fOnlineCase(OnlineCase),
   fMeritCase(MeritCase),
   fCase3D(Case3D),
+  fCutCheck(CutCheck),
   fMinDecayLength(MinDL),
   fMeritCutChoice(MeritCutChoice),
   fMinSep(MinSep),
   fFlatCent(FlatCent),
   fPsiBinning(PsiBinning),
+  fNPsiBins(0),
   fEventCount(0),
   fEC(0x0),
   fEvt(0X0),
@@ -142,11 +147,13 @@ AliFemtoK0Analysis::AliFemtoK0Analysis(const char *name, bool SignDep, bool Fiel
   fOnlineCase  = OnlineCase;
   fMeritCase   = MeritCase;
   fCase3D              = Case3D;
+  fCutCheck            = CutCheck;
   fMinDecayLength = MinDL;
   fMeritCutChoice = MeritCutChoice;
   fMinSep              = MinSep;
   fFlatCent            = FlatCent;
   fPsiBinning  = PsiBinning;
+  fNPsiBins            = NPsiBins;
 
   // Define output slots here 
   // Output slot #1
@@ -161,11 +168,13 @@ AliFemtoK0Analysis::AliFemtoK0Analysis(const AliFemtoK0Analysis &obj)
   fOnlineCase(obj.fOnlineCase),
   fMeritCase(obj.fMeritCase),
   fCase3D(obj.fCase3D),
+  fCutCheck(obj.fCutCheck),
   fMinDecayLength(obj.fMinDecayLength),
   fMeritCutChoice(obj.fMeritCutChoice),
   fMinSep(obj.fMinSep),
   fFlatCent(obj.fFlatCent),
   fPsiBinning(obj.fPsiBinning),
+  fNPsiBins(obj.fNPsiBins),
   fEventCount(obj.fEventCount),
   fEC(obj.fEC),
   fEvt(obj.fEvt),
@@ -187,11 +196,13 @@ AliFemtoK0Analysis &AliFemtoK0Analysis::operator=(const AliFemtoK0Analysis &obj)
  fOnlineCase   = obj.fOnlineCase;
  fMeritCase    = obj.fMeritCase;
  fCase3D               = obj.fCase3D;
+ fCutCheck             = obj.fCutCheck;
  fMinDecayLength= obj.fMinDecayLength;
  fMeritCutChoice= obj.fMeritCutChoice;
  fMinSep               = obj.fMinSep;
  fFlatCent             = obj.fFlatCent;
  fPsiBinning   = obj.fPsiBinning;
+ fNPsiBins             = obj.fNPsiBins;
  fEventCount   = obj.fEventCount;
  fEC           = obj.fEC;
  fEvt          = obj.fEvt;
@@ -211,7 +222,7 @@ AliFemtoK0Analysis::~AliFemtoK0Analysis()
   {
     for(unsigned short j=0; j<kCentBins; j++)
     {
-         for(unsigned short k=0; k<kPsiBins; k++)
+         for(unsigned short k=0; k<fNPsiBins; k++)
          {
         fEC[i][j][k]->~AliFemtoK0EventCollection();
         fEC[i][j][k] = NULL;
@@ -242,9 +253,9 @@ void AliFemtoK0Analysis::MyInit()
     
     for(unsigned short j=0; j<kCentBins; j++)
     {
-      fEC[i][j] = new AliFemtoK0EventCollection *[kPsiBins];
+      fEC[i][j] = new AliFemtoK0EventCollection *[fNPsiBins];
 
-      for(unsigned short k=0; k<kPsiBins; k++)
+      for(unsigned short k=0; k<fNPsiBins; k++)
          {
            fEC[i][j][k] = new AliFemtoK0EventCollection(kEventsToMix+1, kMultLimit);
       }
@@ -331,6 +342,19 @@ void AliFemtoK0Analysis::UserCreateOutputObjects()
   //invariant mass distributions
   TH3F* fHistMass = new TH3F("fHistMass","",kCentBins,.5,kCentBins+.5,50,0.,5.,400,.3,.7);
   fOutputList->Add(fHistMass);
+  
+  //TH1F *fHistMassCuts[4][5];
+  //if(fCutCheck){
+  // for(int iCut=0;iCut<4;iCut++){
+  //  for(int jCut=0;jCut<5;jCut++){
+  //   TString *histname = new TString("fHistMassCuts");
+  //   *histname += iCut;
+  //   *histname += jCut;
+  //   fHistMassCuts[iCut][jCut] = new TH1F(histname->Data(),"",400,.3,.7);
+  //   fOutputList->Add(fHistMassCuts[iCut][jCut]);
+  //  }
+  // }
+  //}
   //TH3F* fHistMassPtCFK0 = new TH3F("fHistMassPtCFK0","",kCentBins,.5,kCentBins+.5,50,0.,5.,200,.4,.6);
   //fOutputList->Add(fHistMassPtCFK0);
   //TH3F* fHistMassPtCFBkgK0 = new TH3F("fHistMassPtCFBkgK0","",kCentBins,.5,kCentBins+.5,50,0.,5.,200,.4,.6);
@@ -368,8 +392,20 @@ void AliFemtoK0Analysis::UserCreateOutputObjects()
 
   TH1F *fHistPsi = new TH1F("fHistPsi","",90,-PI/2,PI/2);
   fOutputList->Add(fHistPsi);
+  TH2F *fHistPhi = new TH2F("fHistPhi","",kCentBins,.5,kCentBins+.5,180,0,2*PI);
+  fOutputList->Add(fHistPhi);
   TH2F *fHistPhiPsi = new TH2F("fHistPhiPsi","",kCentBins,.5,kCentBins+.5,180,0,2*PI);
   fOutputList->Add(fHistPhiPsi);
+  
+
+  TH3F *fHistDPhi = new TH3F("fHistDPhi","",kCentBins,.5,kCentBins+.5,200,0.,2.,90,0,PI);
+  TH3F *fHistDPhiBkg = new TH3F("fHistDPhiBkg","",kCentBins,.5,kCentBins+.5,200,0.,2.,90,0,PI);
+  TH3F *fHistDPhiPsi = new TH3F("fHistDPhiPsi","",kCentBins,.5,kCentBins+.5,200,0.,2.,90,0,PI);
+  TH3F *fHistDPhiPsiBkg = new TH3F("fHistDPhiPsiBkg","",kCentBins,.5,kCentBins+.5,200,0.,2.,90,0,PI);
+  fOutputList->Add(fHistDPhi);
+  fOutputList->Add(fHistDPhiBkg);
+  fOutputList->Add(fHistDPhiPsi);
+  fOutputList->Add(fHistDPhiPsiBkg);
 
 /////////Pair Distributions///////////////////
 
@@ -423,6 +459,28 @@ void AliFemtoK0Analysis::UserCreateOutputObjects()
    }
   }
 
+  TH3F *fHist3DOSLCutsSignal[3][5][3]; //3 cent bins, 5 parameters, 3 cut values
+  TH3F *fHist3DOSLCutsBkg[3][5][3];
+  if(fCutCheck){
+   for(int i3D=0;i3D<3;i3D++){
+    for(int j3D=0;j3D<5;j3D++){
+     for(int k3D=0;k3D<3;k3D++){
+      TString *histname = new TString("fHist3DOSLCuts");
+      *histname += i3D;
+      *histname += j3D;
+      *histname += k3D;
+      histname->Append("Signal");
+      fHist3DOSLCutsSignal[i3D][j3D][k3D] = new TH3F(histname->Data(),"",100,-.5,.5,100,-.5,.5,100,-.5,.5);
+      fOutputList->Add(fHist3DOSLCutsSignal[i3D][j3D][k3D]);
+      histname->Replace(17,6,"Bkg");
+      cout << histname->Data() << endl;
+      fHist3DOSLCutsBkg[i3D][j3D][k3D] = new TH3F(histname->Data(),"",100,-.5,.5,100,-.5,.5,100,-.5,.5);
+      fOutputList->Add(fHist3DOSLCutsBkg[i3D][j3D][k3D]);
+     }
+    }
+   }
+  }
+
   //3D Spherical Harmonics
   //TH3F* fHistSHCentLowKt = new TH3F("fHistSHCentLowKt","",50,0,.5,ncthetabins,-1,1,nphibins,0,2*PI);
   //TH3F* fHistSHCentHighKt = new TH3F("fHistSHCentHighKt","",50,0,.5,ncthetabins,-1,1,nphibins,0,2*PI);
@@ -498,12 +556,8 @@ void AliFemtoK0Analysis::Exec(Option_t *)
   }
 
   
-  int zBin=0;
-  double zStep=2*10/double(kZVertexBins), zstart=-10.;
-
   /////////////////////////////////////////////////
 
-
   //Centrality selection
 
   AliCentrality *centrality = fAOD->GetCentrality();
@@ -544,6 +598,7 @@ void AliFemtoK0Analysis::Exec(Option_t *)
    return;
   }
   if(percent > 10 && isCentral) return;
+  if(fCutCheck && percent > 50) return;        //only looking at 0-50% for Cut Check
   ((TH1F*)fOutputList->FindObject("fHistCent"))->Fill(percent);
   
   //flatten centrality dist.
@@ -564,13 +619,15 @@ void AliFemtoK0Analysis::Exec(Option_t *)
   if(vertex[0]<10e-5 && vertex[1]<10e-5 &&  vertex[2]<10e-5) return;
   if(fabs(vertex[2]) > 10) return; // Z-vertex Cut
 
+  int zBin=0;
+  double zStep=2*10/double(kZVertexBins), zStart=-10.;
   for(int i=0; i<kZVertexBins; i++)
   {
-    if((vertex[2] > zstart+i*zStep) && (vertex[2] < zstart+(i+1)*zStep))
-    {
-      zBin=i;
-      break;
-    }
+   if((vertex[2] > zStart+i*zStep) && (vertex[2] < zStart+(i+1)*zStep))
+   {
+    zBin=i;
+    break;
+   }
   }
   
   //Event plane
@@ -578,13 +635,20 @@ void AliFemtoK0Analysis::Exec(Option_t *)
   AliEventplane *eventplane = fAOD->GetEventplane();
   if(fPsiBinning && !eventplane) return;
   double psiEP = eventplane->GetEventplane("V0",fAOD,2); //[-PI/2,PI/2]
-  if(psiEP < -0.25*PI) psiBin = 0;
-  else if(psiEP < 0.0) psiBin = 1;
-  else if(psiEP < 0.25*PI) psiBin = 2;
-  else psiBin = 3;
-  if(!fPsiBinning) psiBin = 0;
   ((TH1F*)fOutputList->FindObject("fHistPsi"))->Fill(psiEP);
 
+  double psiStep = PI/double(fNPsiBins);
+  double psiStart = -0.5*PI;
+  for(int i=0; i<fNPsiBins; i++)
+  {
+   if((psiEP > psiStart+i*psiStep) && (psiEP < psiStart+(i+1)*psiStep))
+   {
+    psiBin = i;
+    break;
+   }
+  }
+  if(!fPsiBinning) psiBin = 0;
+
 ////////////////////////////////////////////////////////////////
 //Cut Values and constants
 
@@ -607,6 +671,14 @@ void AliFemtoK0Analysis::Exec(Option_t *)
   //const float kMassPion = .13957;
   const float kMassK0Short = .497614;       //true PDG masses
 
+  //for cut checks
+  double kCheckMassLow [3] = {0.49,0.48,0.45};
+  double kCheckMassHigh        [3] = {0.505,0.515,0.550};
+  double kCheckDCAK0   [3] = {0.1,0.3,1.0};
+  double kCheckDCAPi   [3] = {1.0,0.4,0.1};
+  double kCheckDCAPiPi [3] = {0.1,0.3,1.0};
+  double kCheckAvgSep  [3] = {10.0,5.0,0.0};
+
 ////////////////////////////////////////////////////////////////  
   //v0 tester
 ////////////////////////////////////////////////////////////////
@@ -708,18 +780,27 @@ void AliFemtoK0Analysis::Exec(Option_t *)
     }
     
     //K0 cuts
+    if(!goodPiMinus || !goodPiPlus)                            continue; 
     if(v0->Eta() > kEtaCut)                                    continue;    
     if(v0->CosPointingAngle(primaryVertex) < kMinCosAngle)     continue;
     if(v0->MassK0Short() < .2 || v0->MassK0Short() > .8)       continue;
-    if(v0->DcaNegToPrimVertex() < kMinDCAPrimaryPion)          continue;
-    if(v0->DcaPosToPrimVertex() < kMinDCAPrimaryPion)          continue;  
     if(v0->DecayLength(primaryVertex) > kMaxDLK0)              continue;
     if(v0->DecayLength(primaryVertex) < kMinDLK0)                      continue;
-    if(v0->DcaV0Daughters() > kMaxDCADaughtersK0)              continue;
-    double v0Dca = v0->DcaV0ToPrimVertex();
-    if(v0Dca > kMaxDCAK0)                                                      continue;        
-    if(!goodPiMinus || !goodPiPlus)                            continue; 
     
+    double v0Dca = v0->DcaV0ToPrimVertex();
+    if(!fCutCheck){
+     if(v0->DcaNegToPrimVertex() < kMinDCAPrimaryPion)      continue;
+     if(v0->DcaPosToPrimVertex() < kMinDCAPrimaryPion)      continue;  
+     if(v0->DcaV0Daughters() > kMaxDCADaughtersK0)          continue;
+     if(v0Dca > kMaxDCAK0)                                                     continue;        
+    }
+    else{
+     if(v0->DcaNegToPrimVertex() < kCheckDCAPi[2])                 continue;
+     if(v0->DcaPosToPrimVertex() < kCheckDCAPi[2])             continue;  
+     if(v0->DcaV0Daughters() > kCheckDCAPiPi[2])               continue;
+     if(v0Dca > kCheckDCAK0[2])                                        continue;
+    }
+
     //EVERYTHING BELOW HERE PASSES SINGLE PARTICLE CUTS, PION PID, and LOOSE MASS CUT
 
     //for MC
@@ -739,9 +820,13 @@ void AliFemtoK0Analysis::Exec(Option_t *)
     //}
     //}// if kMCCase
     
-    if(v0->MassK0Short() > .48 && v0->MassK0Short() < .515) goodK0 = kTRUE;
-    //else continue; //removed, Apr 18
-     
+    if(!fCutCheck){
+     if(v0->MassK0Short() > .48 && v0->MassK0Short() < .515) goodK0 = kTRUE;
+    }
+    else{
+     if(v0->MassK0Short() > kCheckMassLow[2] && v0->MassK0Short() < kCheckMassHigh[2]) goodK0 = kTRUE;
+    }
+
     //Check for shared daughters, using v0 DCA to judge
     bool v0JudgeNew; //true if new v0 beats old
     tempK0[v0Count].fSkipShared = kFALSE;
@@ -770,8 +855,25 @@ void AliFemtoK0Analysis::Exec(Option_t *)
       }
      }
      if(tempK0[v0Count].fSkipShared) continue;         //if new K0 is skipped, don't load; go to next v0
-    }//if MeritCase                    
-       
+    }//if MeritCase            
+
+    //for cut check
+    if(fCutCheck){
+     for(int iSet=0;iSet<4;iSet++){ //number of cut pars (not counting AvgSep)
+      for(int jSet=0;jSet<3;jSet++){ //number of cut values
+       tempK0[v0Count].fCutPass[iSet][jSet] = kFALSE;
+      }
+     }
+     for(int jCut = 0;jCut<3;jCut++){
+      if(v0->MassK0Short() > kCheckMassLow[jCut] && v0->MassK0Short() < kCheckMassHigh[jCut])
+                tempK0[v0Count].fCutPass[0][jCut] = kTRUE;
+      if(v0Dca < kCheckDCAK0[jCut]) tempK0[v0Count].fCutPass[1][jCut] = kTRUE;
+      if(v0->DcaPosToPrimVertex() > kCheckDCAPi[jCut] && v0->DcaNegToPrimVertex() > kCheckDCAPi[jCut])
+         tempK0[v0Count].fCutPass[2][jCut] = kTRUE;
+      if(v0->DcaV0Daughters() < kCheckDCAPiPi[jCut]) tempK0[v0Count].fCutPass[3][jCut] = kTRUE;
+     }
+       }
     //load parameters into temporary class instance
     if(v0Count < kMaxNumK0)
     {
@@ -818,6 +920,7 @@ void AliFemtoK0Analysis::Exec(Option_t *)
         if(v0PhiPsi < 0) v0PhiPsi += 2.*PI;
         else if (v0PhiPsi > 2.*PI) v0PhiPsi -= 2.*PI;
                else{};
+        tempK0[v0Count].fPhi   = v0Phi;
         tempK0[v0Count].fPhiPsi = v0PhiPsi; 
         
         //for separation
@@ -838,7 +941,6 @@ void AliFemtoK0Analysis::Exec(Option_t *)
     }
 
   }//v0
-   
   if(k0Count<2) return;  //only keep events with more than 1 good K0
 
   //Add Event to buffer - this is for event mixing
@@ -851,6 +953,18 @@ void AliFemtoK0Analysis::Exec(Option_t *)
    if(!tempK0[i].fSkipShared)                          //don't include skipped v0s (from shared daughters)
    {
     ((TH3F*)fOutputList->FindObject("fHistMass"))->Fill(centBin+1,tempK0[i].fPt,tempK0[i].fMass);
+    
+    //if(fCutCheck){
+    // for(int iCut=1;iCut<4;iCut++){
+    //  for(int jCut=0;jCut<5;jCut++){
+    //   TString *histname = new TString("fHistMassCuts");
+    //   *histname += iCut;
+    //   *histname += jCut;
+    //   if(tempK0[i].fCutPass[iCut][jCut]) ((TH1F*)fOutputList->FindObject(histname->Data()))->Fill(tempK0[i].fMass);
+    //  }
+    // }
+    //}
+    
     if(tempK0[i].fK0)                                  //make sure particle is good (mass)
     {
      (fEvt)->fK0Particle[unskippedCount] = tempK0[i];  //load good, unskipped K0s
@@ -906,6 +1020,7 @@ void AliFemtoK0Analysis::Exec(Option_t *)
     ((TH1F*)fOutputList->FindObject("fHistPy"))                ->Fill((fEvt)->fK0Particle[i].fMomentum[1]);
     ((TH1F*)fOutputList->FindObject("fHistPz"))                ->Fill((fEvt)->fK0Particle[i].fMomentum[2]);
 
+    ((TH2F*)fOutputList->FindObject("fHistPhi"))       ->Fill(centBin+1,(fEvt)->fK0Particle[i].fPhi);
     ((TH2F*)fOutputList->FindObject("fHistPhiPsi"))    ->Fill(centBin+1,(fEvt)->fK0Particle[i].fPhiPsi);
 
     for(int evnum=0; evnum<kEventsToMix+1; evnum++)// Event buffer loop: evnum=0 is the current event, all other evnum's are past events
@@ -1095,7 +1210,17 @@ void AliFemtoK0Analysis::Exec(Option_t *)
         if(evnum==0)((TH2F*)fOutputList->FindObject("fHistSepDPC"))->Fill(dpc,pMean);
         else ((TH2F*)fOutputList->FindObject("fHistSepDPCBkg"))->Fill(dpc,pMean);
        
-        if(pMean < kMinSeparation || nMean < kMinSeparation) continue; //using the "new" method (ala Hans)
+        bool SepPass[3] = {0};
+        if(!fCutCheck){
+         if(pMean < kMinSeparation || nMean < kMinSeparation) continue; //using the "new" method (ala Hans)
+        }
+        else{
+         if(pMean < kCheckAvgSep[2] || nMean < kCheckAvgSep[2]) continue;
+         for(int jCut=0;jCut<3;jCut++){
+          if(pMean > kCheckAvgSep[jCut] && nMean > kCheckAvgSep[jCut]) SepPass[jCut] = kTRUE;
+         }
+        }
+
         //end separation studies
 
         //Fill Histograms
@@ -1132,8 +1257,18 @@ void AliFemtoK0Analysis::Exec(Option_t *)
         if(phipsi2 > PI) phipsi2 = phipsi2-PI;
         if(phipsi1 < 0.25*PI || phipsi1 > 0.75*PI) inPlane1 = kTRUE;
         if(phipsi2 < 0.25*PI || phipsi2 > 0.75*PI) inPlane2 = kTRUE;
-       
 
+               //for dphi, dphipsi
+               float dPhi = fabs((fEvt)->fK0Particle[i].fPhi - (fEvt+evnum)->fK0Particle[j].fPhi);
+        if(dPhi > PI) dPhi = 2*PI-dPhi;
+        float dPhiPsi = fabs((fEvt)->fK0Particle[i].fPhiPsi - (fEvt+evnum)->fK0Particle[j].fPhiPsi);
+        if(dPhiPsi > PI) dPhiPsi = 2*PI-dPhiPsi;
+
+        int CutCentBin; //for cut check
+        if(centBin > 13) CutCentBin = 0;
+        else if(centBin > 9) CutCentBin = 1;
+        else if(centBin > 5) CutCentBin = 2;
+        else{};
         if(evnum==0) //Same Event
         {     
           //((TH3F*)fOutputList->FindObject("fHistMassQKt"))->Fill(qinv, pairKt, (fEvt)->fK0Particle[i].fMass);
@@ -1154,6 +1289,11 @@ void AliFemtoK0Analysis::Exec(Option_t *)
              ((TH3F*)fOutputList->FindObject("fHistQinvSignalEPIn"))->Fill(centBin+1, pairKt, qinv);
            else if(!inPlane1 && !inPlane2)
              ((TH3F*)fOutputList->FindObject("fHistQinvSignalEPOut"))->Fill(centBin+1, pairKt, qinv);
+
+           //dPhi,dPhiPsi
+                  ((TH3F*)fOutputList->FindObject("fHistDPhi"))->Fill(centBin+1,pairKt,dPhi);
+                  ((TH3F*)fOutputList->FindObject("fHistDPhiPsi"))->Fill(centBin+1,pairKt,dPhiPsi);
+
            
            //for mass bin study
            //if(CL1 && CL2) ((TH3F*)fOutputList->FindObject("fHistCLCLSignal"))->Fill(centBin+1, pairKt, qinv);           
@@ -1166,7 +1306,47 @@ void AliFemtoK0Analysis::Exec(Option_t *)
                     histname3D->Append("Signal");
                         ((TH3F*)fOutputList->FindObject(histname3D->Data()))->Fill(qOutPRF,qSide,qLong);
                    }
-           }  
+           }
+
+           //for cut check (3D, but fCase3D set to false)
+           if(fCutCheck){
+            for(int iCut=0;iCut<4;iCut++){//different cuts (4 + AvgSep)
+             bool Skip = kFALSE;
+             for(int iCut2=0;iCut2<4;iCut2++){//for setting other cuts to usual value
+              if(iCut2 != iCut){
+               if(!(fEvt)->fK0Particle[i].fCutPass[iCut2][1] || !(fEvt+evnum)->fK0Particle[j].fCutPass[iCut2][1]) Skip = kTRUE;
+              }
+             }              
+             if(!SepPass[1]) Skip = kTRUE; //set avg sep cut to usual value
+             if(Skip) continue;
+             for(int jCut=0;jCut<3;jCut++){//different cut values
+              TString *histname = new TString("fHist3DOSLCuts");
+              *histname += CutCentBin;
+              *histname += iCut;
+              *histname += jCut;
+              histname->Append("Signal");
+              if((fEvt)->fK0Particle[i].fCutPass[iCut][jCut] && (fEvt+evnum)->fK0Particle[j].fCutPass[iCut][jCut])
+               ((TH3F*)fOutputList->FindObject(histname->Data()))->Fill(qOutPRF,qSide,qLong);
+             }//jcut
+            }//icut
+            
+            //for avg sep cutcheck
+            bool asSkip = kFALSE;
+            for(int iCut=0;iCut<4;iCut++){ //other parameters
+             if(!(fEvt)->fK0Particle[i].fCutPass[iCut][1] || !(fEvt+evnum)->fK0Particle[j].fCutPass[iCut][1]) asSkip=kTRUE; //set other cuts to usual values
+            }
+            if(asSkip) continue;
+            for(int jCut=0;jCut<3;jCut++){
+             TString *histname = new TString("fHist3DOSLCuts");
+             *histname += CutCentBin;
+             *histname += 4; //4 for AvgSep
+             *histname += jCut;
+             histname->Append("Signal");
+             if(SepPass[jCut]) ((TH3F*)fOutputList->FindObject(histname->Data()))->Fill(qOutPRF,qSide,qLong);
+            }
+           }//cutCheck   
+                    
+  
            /*if(pairKt < 1.0){
             if(centBin > 13){
              ((TH3F*)fOutputList->FindObject("fHistOSLCentLowKt"))->Fill(qOutPRF,qSide,qLong);
@@ -1211,6 +1391,9 @@ void AliFemtoK0Analysis::Exec(Option_t *)
            else if(!inPlane1 && !inPlane2)
              ((TH3F*)fOutputList->FindObject("fHistQinvBkgEPOut"))->Fill(centBin+1, pairKt, qinv);
 
+                  ((TH3F*)fOutputList->FindObject("fHistDPhiBkg"))->Fill(centBin+1,pairKt,dPhi);
+                  ((TH3F*)fOutputList->FindObject("fHistDPhiPsiBkg"))->Fill(centBin+1,pairKt,dPhiPsi);
+
            //for mass bin study
            //if(CL1 && CL2) ((TH3F*)fOutputList->FindObject("fHistCLCLBkg"))->Fill(centBin+1, pairKt, qinv);      
            //else if ((CL1 && CR2) || (CR1 && CL2)) ((TH3F*)fOutputList->FindObject("fHistCLCRBkg"))->Fill(centBin+1, pairKt, qinv);
@@ -1223,6 +1406,46 @@ void AliFemtoK0Analysis::Exec(Option_t *)
                         ((TH3F*)fOutputList->FindObject(histname3D->Data()))->Fill(qOutPRF,qSide,qLong);
                    }
            }
+
+            //for cut check (3D, but fCase3D set to false)
+           if(fCutCheck){
+            for(int iCut=0;iCut<4;iCut++){//different cuts (4 + AvgSep)
+             bool Skip = kFALSE;
+             for(int iCut2=0;iCut2<4;iCut2++){//for setting other cuts to usual value
+              if(iCut2 != iCut){
+               if(!(fEvt)->fK0Particle[i].fCutPass[iCut2][1] || !(fEvt+evnum)->fK0Particle[j].fCutPass[iCut2][1]) Skip = kTRUE;
+              }
+             }              
+             if(!SepPass[1]) Skip = kTRUE; //set avg sep cut to usual value
+             if(Skip) continue;
+             for(int jCut=0;jCut<3;jCut++){//different cut values
+              TString *histname = new TString("fHist3DOSLCuts");
+              *histname += CutCentBin;
+              *histname += iCut;
+              *histname += jCut;
+              histname->Append("Bkg");
+              if((fEvt)->fK0Particle[i].fCutPass[iCut][jCut] && (fEvt+evnum)->fK0Particle[j].fCutPass[iCut][jCut])
+               ((TH3F*)fOutputList->FindObject(histname->Data()))->Fill(qOutPRF,qSide,qLong);
+             }//jcut
+            }//icut
+            
+            //for avg sep cutcheck
+            bool asSkip = kFALSE;
+            for(int iCut=0;iCut<4;iCut++){ //other parameters
+             if(!(fEvt)->fK0Particle[i].fCutPass[iCut][1] || !(fEvt+evnum)->fK0Particle[j].fCutPass[iCut][1]) asSkip=kTRUE; //set other cuts to usual values
+            }
+            if(asSkip) continue;
+            for(int jCut=0;jCut<3;jCut++){
+             TString *histname = new TString("fHist3DOSLCuts");
+             *histname += CutCentBin;
+             *histname += 4; //4 for AvgSep
+             *histname += jCut;
+             histname->Append("Bkg");
+             if(SepPass[jCut]) ((TH3F*)fOutputList->FindObject(histname->Data()))->Fill(qOutPRF,qSide,qLong);
+            }
+           }//cutCheck   
+
+
            /*if(pairKt < 1.0){
             if(centBin > 13){
              ((TH3F*)fOutputList->FindObject("fHistOSLCentLowKtBkg"))->Fill(qOutPRF,qSide,qLong);