MC closure test
authorlmilano <lmilano@cern.ch>
Sun, 5 Oct 2014 07:56:06 +0000 (09:56 +0200)
committerlmilano <lmilano@cern.ch>
Sun, 5 Oct 2014 07:56:06 +0000 (09:56 +0200)
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskV2AllChAOD.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskV2AllChAOD.h

index e8a1cff..1ebd775 100644 (file)
@@ -64,18 +64,18 @@ AliAnalysisTaskV2AllChAOD::AliAnalysisTaskV2AllChAOD(const char *name) : AliAnal
   fOutput_sq(0x0),
   fnCentBins(20),
   fnQvecBins(100),
-  fIsQvecCalibMode(0),
   fQvecUpperLim(100),
   fCutLargeQperc(90.),
   fCutSmallQperc(10.),
   fEtaGapMin(-0.5),
   fEtaGapMax(0.5),
-  fTrkBit(272),
+  fTrkBit(128),
   fEtaCut(0.8),
   fMinPt(0),
   fMaxPt(20.0),
   fMinTPCNcls(70),
   fFillTHn(kFALSE),
+  fCentrality(0),
   fResSP(0),
   fResSP_vs_Cent(0),
   f2partCumQA_vs_Cent(0),
@@ -91,14 +91,23 @@ AliAnalysisTaskV2AllChAOD::AliAnalysisTaskV2AllChAOD(const char *name) : AliAnal
   fResSP_vs_Cent_sq(0),
   f2partCumQA_vs_Cent_sq(0),
   f2partCumQB_vs_Cent_sq(0),
-  fv2SPGap1A_mb(0),
-  fv2SPGap1B_mb(0),
-  fResSP_mb(0),
-  fv2SPGap1Amc(0),
-  fv2SPGap1Bmc(0),
-  fResSPmc(0),
+  fResSP_inclusive(0),
+  fv2SPGap1A_inclusive_mb(0),
+  fv2SPGap1B_inclusive_mb(0),
+  fv2SPGap1A_inclusive_lq(0),
+  fv2SPGap1B_inclusive_lq(0),
+  fv2SPGap1A_inclusive_sq(0),
+  fv2SPGap1B_inclusive_sq(0),
+  fResSPmc_inclusive(0),
+  fv2SPGap1Amc_inclusive_mb(0),
+  fv2SPGap1Bmc_inclusive_mb(0),
+  fv2SPGap1Amc_inclusive_lq(0),
+  fv2SPGap1Bmc_inclusive_lq(0),
+  fv2SPGap1Amc_inclusive_sq(0),
+  fv2SPGap1Bmc_inclusive_sq(0),
   fIsRecoEff(0),
-  fRecoEffList(0)
+  fRecoEffList(0),
+  fQvecGen(0)
 {
   
   for (Int_t i = 0; i< 9; i++){
@@ -201,6 +210,9 @@ void AliAnalysisTaskV2AllChAOD::UserCreateOutputObjects()
     fOutput->Add(NSparseHistEv);
   }
   
+  fCentrality = new TH1D("fCentrality", "centrality distribution; centrality", 200, 0., 100);
+  fOutput->Add(fCentrality);
+  
   // binning common to all the THn
   //change it according to your needs + move it to global variables -> setter/getter
 //   Double_t ptBins[] = {0., 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.4, 2.8, 3.2, 3.6, 4.0, 4.5, 5.0, 5.5, 6.0, 7.0, 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 20.0};
@@ -229,16 +241,18 @@ void AliAnalysisTaskV2AllChAOD::UserCreateOutputObjects()
   fEta_vs_PhiB = new TH2D("fEta_vs_PhiB","eta vs phi distribution;#eta;#phi",200.,-1.,1.,175.,0.,7.);
   fOutput->Add(fEta_vs_PhiB);
   
-  fResSP_mb = new TProfile("fResSP_mb", "Resolution; ese; Resolution", 3, 0., 3.);
-  fOutput->Add(fResSP_mb);
-
-  fv2SPGap1A_mb = new TProfile("fv2SPGap1A_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
-  fOutput->Add(fv2SPGap1A_mb);
-
-  fv2SPGap1B_mb = new TProfile("fv2SPGap1B_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
-  fOutput->Add(fv2SPGap1B_mb);
+    // MC closure test
+    fResSP_inclusive = new TProfile("fResSP_inclusive", "Resolution; ese; Resolution", 3, 0., 3.);
+    fOutput->Add(fResSP_inclusive);
   
-  //large q resolution
+    fv2SPGap1A_inclusive_mb = new TProfile("fv2SPGap1A_inclusive_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput->Add(fv2SPGap1A_inclusive_mb);
+
+    fv2SPGap1B_inclusive_mb = new TProfile("fv2SPGap1B_inclusive_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput->Add(fv2SPGap1B_inclusive_mb);
+    
+    
+  //large q
   fResSP_lq = new TProfile("fResSP_lq", "Resolution; centrality; Resolution", 9, -0.5, 8.5);
   fOutput_lq->Add(fResSP_lq);
   
@@ -250,6 +264,13 @@ void AliAnalysisTaskV2AllChAOD::UserCreateOutputObjects()
   
   f2partCumQB_vs_Cent_lq = new TProfile("f2partCumQB_vs_Cent_lq", "Resolution; centrality; Resolution", 100., 0., 100.);
   fOutput_lq->Add(f2partCumQB_vs_Cent_lq);
+        
+    // MC closure test
+    fv2SPGap1A_inclusive_lq = new TProfile("fv2SPGap1A_inclusive_lq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput_lq->Add(fv2SPGap1A_inclusive_lq);
+
+    fv2SPGap1B_inclusive_lq = new TProfile("fv2SPGap1B_inclusive_lq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput_lq->Add(fv2SPGap1B_inclusive_lq);
   
   //small q resolution
   fResSP_sq = new TProfile("fResSP_sq", "Resolution; centrality; Resolution", 9, -0.5, 8.5);
@@ -263,6 +284,13 @@ void AliAnalysisTaskV2AllChAOD::UserCreateOutputObjects()
   
   f2partCumQB_vs_Cent_sq = new TProfile("f2partCumQB_vs_Cent_sq", "Resolution; centrality; Resolution", 100., 0., 100.);
   fOutput_sq->Add(f2partCumQB_vs_Cent_sq);
+        
+    // MC closure test
+    fv2SPGap1A_inclusive_sq = new TProfile("fv2SPGap1A_inclusive_sq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput_sq->Add(fv2SPGap1A_inclusive_sq);
+
+    fv2SPGap1B_inclusive_sq = new TProfile("fv2SPGap1B_inclusive_sq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput_sq->Add(fv2SPGap1B_inclusive_sq);
   
   for (Int_t iC = 0; iC < 9; iC++){
     
@@ -362,15 +390,29 @@ void AliAnalysisTaskV2AllChAOD::UserCreateOutputObjects()
     fOutput_sq->Add(fCosGap1B_sq[iC]);
   };
   
-  if(!fIsMC){
-    fResSPmc = new TProfile("fResSPmc", "Resolution; ese; Resolution", 3, 0., 3.);
-    fOutput->Add(fResSPmc);
+  if(fIsMC){
+    fResSPmc_inclusive = new TProfile("fResSPmc_inclusive", "Resolution; ese; Resolution", 3, 0., 3.);
+    fOutput->Add(fResSPmc_inclusive);
+
+    fv2SPGap1Amc_inclusive_mb = new TProfile("fv2SPGap1Amc_inclusive_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput->Add(fv2SPGap1Amc_inclusive_mb);
 
-    fv2SPGap1Amc = new TProfile("fv2SPGap1Amc", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
-    fOutput->Add(fv2SPGap1Amc);
+    fv2SPGap1Bmc_inclusive_mb = new TProfile("fv2SPGap1Bmc_inclusive_mb", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput->Add(fv2SPGap1Bmc_inclusive_mb);
+    
+    //large-q
+    fv2SPGap1Amc_inclusive_lq = new TProfile("fv2SPGap1Amc_inclusive_lq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput_lq->Add(fv2SPGap1Amc_inclusive_lq);
+
+    fv2SPGap1Bmc_inclusive_lq = new TProfile("fv2SPGap1Bmc_inclusive_lq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput_lq->Add(fv2SPGap1Bmc_inclusive_lq);
+    
+    //small-q
+    fv2SPGap1Amc_inclusive_sq = new TProfile("fv2SPGap1Amc_inclusive_sq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput_sq->Add(fv2SPGap1Amc_inclusive_sq);
 
-    fv2SPGap1Bmc = new TProfile("fv2SPGap1Bmc", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
-    fOutput->Add(fv2SPGap1Bmc);
+    fv2SPGap1Bmc_inclusive_sq = new TProfile("fv2SPGap1Bmc_inclusive_sq", "v_{2}{2} vs p_{T}; p_{T} (GeV/c); v_{2}{2}", nptBins, ptBins);
+    fOutput_sq->Add(fv2SPGap1Bmc_inclusive_sq);
   }
 
   
@@ -399,17 +441,18 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
     }
   
   if(!fEventCuts->IsSelected(fAOD,fTrackCuts))return;//event selection
-
-  Double_t Qvec=0.;//in case of MC we save space in the memory
-  if(!fIsMC){
-    if(fIsQvecCalibMode){
-      if(fVZEROside==0)Qvec=fEventCuts->GetqV0A();
-      else if (fVZEROside==1)Qvec=fEventCuts->GetqV0C();
-    }
-    else Qvec=fEventCuts->GetQvecPercentile(fVZEROside);
-  }
   
+  //Get q-vector percentile.
+  Double_t QvecVZERO=fEventCuts->GetQvecPercentile(fVZEROside);
+  
+  Double_t QvecMC = fEventCuts->GetQvecPercentileMC(fVZEROside);
+
+  Double_t Qvec=0.;
+  if(fIsMC && fQvecGen) Qvec = QvecMC;
+  else Qvec = QvecVZERO;
+
   Double_t Cent=fEventCuts->GetCent();
+  fCentrality->Fill(Cent);
   
   Int_t centV0 = -1;
   if ((Cent > 0) && (Cent <= 5.0))
@@ -431,7 +474,7 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
     else if ((Cent > 70.0) && (Cent <= 80.0))
       centV0 = 8; 
     
-  if(fIsMC) MCclosure(); // fill mc histograms for montecarlo closure
+  if(fIsMC) MCclosure(Qvec); // fill mc histograms for montecarlo closure
 
   Double_t QxGap1A = 0., QyGap1A = 0.;
   Double_t QxGap1B = 0., QyGap1B = 0.;
@@ -522,7 +565,8 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
         if (track->Eta() < fEtaGapMin && multGap1A > 0){
           Double_t v2SPGap1A = (TMath::Cos(2.*track->Phi())*QxGap1A + TMath::Sin(2.*track->Phi())*QyGap1A)/(Double_t)multGap1A;
           fv2SPGap1A[centV0]->Fill(track->Pt(), v2SPGap1A);
-          fv2SPGap1A_mb->Fill(track->Pt(), v2SPGap1A); //mb v2 for mc closure
+          
+         fv2SPGap1A_inclusive_mb->Fill(track->Pt(), v2SPGap1A); //mb v2 for mc closure
 
          fSinGap1A[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
           fCosGap1A[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
@@ -531,12 +575,16 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
            fv2SPGap1A_lq[centV0]->Fill(track->Pt(), v2SPGap1A);
            fSinGap1A_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
            fCosGap1A_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
+           
+           fv2SPGap1A_inclusive_lq->Fill(track->Pt(), v2SPGap1A); //lq v2 for mc closure
          }
       
           if (Qvec > 0. && Qvec < fCutSmallQperc){
            fv2SPGap1A_sq[centV0]->Fill(track->Pt(), v2SPGap1A);
            fSinGap1A_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
            fCosGap1A_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
+           
+           fv2SPGap1A_inclusive_sq->Fill(track->Pt(), v2SPGap1A); //sq v2 for mc closure
          }
 
         }
@@ -544,7 +592,8 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
         if (track->Eta() > fEtaGapMax && multGap1B > 0){
           Double_t v2SPGap1B = (TMath::Cos(2.*track->Phi())*QxGap1B + TMath::Sin(2.*track->Phi())*QyGap1B)/(Double_t)multGap1B;
           fv2SPGap1B[centV0]->Fill(track->Pt(), v2SPGap1B);
-          fv2SPGap1B_mb->Fill(track->Pt(), v2SPGap1B); //mb v2
+          
+         fv2SPGap1B_inclusive_mb->Fill(track->Pt(), v2SPGap1B); //mb v2 for mc closure
          
           fCosGap1B[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
           fSinGap1B[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
@@ -553,12 +602,16 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
            fv2SPGap1B_lq[centV0]->Fill(track->Pt(), v2SPGap1B);
            fSinGap1B_lq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
            fCosGap1B_lq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
+           
+           fv2SPGap1B_inclusive_lq->Fill(track->Pt(), v2SPGap1B); //lq v2 for mc closure
          }
       
           if (Qvec > 0. && Qvec < fCutSmallQperc){
            fv2SPGap1B_sq[centV0]->Fill(track->Pt(), v2SPGap1B);
            fSinGap1B_sq[centV0]->Fill(track->Pt(), TMath::Sin(2.*track->Phi()));
            fCosGap1B_sq[centV0]->Fill(track->Pt(), TMath::Cos(2.*track->Phi()));
+           
+           fv2SPGap1B_inclusive_sq->Fill(track->Pt(), v2SPGap1B); //sq v2 for mc closure
          }
          
         }
@@ -570,7 +623,8 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
   if (multGap1A > 0 && multGap1B > 0){
     Double_t res = (QxGap1A*QxGap1B + QyGap1A*QyGap1B)/(Double_t)multGap1A/(Double_t)multGap1B;
     fResSP->Fill((Double_t)centV0, res);
-    fResSP_mb->Fill(0., res);
+    
+    fResSP_inclusive->Fill(0., res); //mb v2 for mc closure
     fResSP_vs_Cent->Fill(Cent, res);
     fResSP_vs_Qvec[centV0]->Fill(Qvec,res);
     
@@ -589,6 +643,8 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
       fResSP_vs_Cent_lq->Fill(Cent, res);
       if(f2partCumQA>0)f2partCumQA_vs_Cent_lq->Fill((Double_t)Cent,f2partCumQA);
       if(f2partCumQB>0)f2partCumQB_vs_Cent_lq->Fill((Double_t)Cent,f2partCumQB);
+      
+      fResSP_inclusive->Fill(1., res); //lq v2 for mc closure
     }
     
     if (Qvec > 0. && Qvec < fCutSmallQperc){
@@ -596,6 +652,8 @@ void AliAnalysisTaskV2AllChAOD::UserExec(Option_t *)
       fResSP_vs_Cent_sq->Fill(Cent, res);
       if(f2partCumQA>0)f2partCumQA_vs_Cent_sq->Fill((Double_t)Cent,f2partCumQA);
       if(f2partCumQB>0)f2partCumQB_vs_Cent_sq->Fill((Double_t)Cent,f2partCumQB);
+      
+      fResSP_inclusive->Fill(2., res); //sq v2 for mc closure
     }
 
     
@@ -643,7 +701,7 @@ Bool_t  AliAnalysisTaskV2AllChAOD::GetDCA(const AliAODTrack* trk, Double_t * p){
 }
 
 //_________________________________________________________________
-void  AliAnalysisTaskV2AllChAOD::MCclosure(){
+void  AliAnalysisTaskV2AllChAOD::MCclosure(Double_t qvec){
   // First do MC to fill up the MC particle array
   
   TClonesArray *arrayMC = 0;
@@ -698,12 +756,30 @@ void  AliAnalysisTaskV2AllChAOD::MCclosure(){
            //eval v2 scalar product
            if (partMC->Eta() < fEtaGapMin && multGap1Amc > 0){
              Double_t v2SPGap1Amc = (TMath::Cos(2.*partMC->Phi())*QxGap1Amc + TMath::Sin(2.*partMC->Phi())*QyGap1Amc)/(Double_t)multGap1Amc;
-              fv2SPGap1Amc->Fill(partMC->Pt(), v2SPGap1Amc);
+              fv2SPGap1Amc_inclusive_mb->Fill(partMC->Pt(), v2SPGap1Amc);
+      
+              if (qvec > fCutLargeQperc && qvec < 100.){
+               fv2SPGap1Amc_inclusive_lq->Fill(partMC->Pt(), v2SPGap1Amc);
+             }
+             
+             if (qvec > 0. && qvec < fCutSmallQperc){
+               fv2SPGap1Amc_inclusive_sq->Fill(partMC->Pt(), v2SPGap1Amc);
+             }
+             
            }
            
            if (partMC->Eta() > fEtaGapMax && multGap1Bmc > 0){
              Double_t v2SPGap1Bmc = (TMath::Cos(2.*partMC->Phi())*QxGap1Bmc + TMath::Sin(2.*partMC->Phi())*QyGap1Bmc)/(Double_t)multGap1Bmc;
-              fv2SPGap1Bmc->Fill(partMC->Pt(), v2SPGap1Bmc);
+              fv2SPGap1Bmc_inclusive_mb->Fill(partMC->Pt(), v2SPGap1Bmc);
+      
+              if (qvec > fCutLargeQperc && qvec < 100.){
+               fv2SPGap1Bmc_inclusive_lq->Fill(partMC->Pt(), v2SPGap1Bmc);
+             }
+             
+             if (qvec > 0. && qvec < fCutSmallQperc){
+               fv2SPGap1Bmc_inclusive_sq->Fill(partMC->Pt(), v2SPGap1Bmc);
+             }
+             
            }
       
            
@@ -713,7 +789,16 @@ void  AliAnalysisTaskV2AllChAOD::MCclosure(){
       
       if (multGap1Amc > 0 && multGap1Bmc > 0){
        Double_t resmc = (QxGap1Amc*QxGap1Bmc + QyGap1Amc*QyGap1Bmc)/(Double_t)multGap1Amc/(Double_t)multGap1Bmc;
-       fResSPmc->Fill(0.,resmc);
+       fResSPmc_inclusive->Fill(0.,resmc);
+       
+       if (qvec > fCutLargeQperc && qvec < 100.){
+         fResSPmc_inclusive->Fill(1.,resmc);
+       }
+       
+       if (qvec > 0. && qvec < fCutSmallQperc){
+         fResSPmc_inclusive->Fill(2.,resmc);
+       }
+       
       }
        
       }// end if MC
index dc2606e..cf7db76 100644 (file)
@@ -37,18 +37,18 @@ class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
     fOutput_sq(0x0),
     fnCentBins(20),
     fnQvecBins(40),
-    fIsQvecCalibMode(0),
     fQvecUpperLim(100),
     fCutLargeQperc(9.),
     fCutSmallQperc(10.),
     fEtaGapMin(-0.5),
     fEtaGapMax(0.5),
-    fTrkBit(272),
+    fTrkBit(128),
     fEtaCut(0.8),
     fMinPt(0),
     fMaxPt(20.0),
     fMinTPCNcls(70),
     fFillTHn(kTRUE),
+    fCentrality(0),
     fResSP(0),
     fResSP_vs_Cent(0),
     f2partCumQA_vs_Cent(0),
@@ -64,14 +64,23 @@ class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
     fResSP_vs_Cent_sq(0),
     f2partCumQA_vs_Cent_sq(0),
     f2partCumQB_vs_Cent_sq(0),
-    fv2SPGap1A_mb(0),
-    fv2SPGap1B_mb(0),
-    fResSP_mb(0),
-    fv2SPGap1Amc(0),
-    fv2SPGap1Bmc(0),
-    fResSPmc(0),
+    fResSP_inclusive(0),
+    fv2SPGap1A_inclusive_mb(0),
+    fv2SPGap1B_inclusive_mb(0),
+    fv2SPGap1A_inclusive_lq(0),
+    fv2SPGap1B_inclusive_lq(0),
+    fv2SPGap1A_inclusive_sq(0),
+    fv2SPGap1B_inclusive_sq(0),
+    fResSPmc_inclusive(0),
+    fv2SPGap1Amc_inclusive_mb(0),
+    fv2SPGap1Bmc_inclusive_mb(0),
+    fv2SPGap1Amc_inclusive_lq(0),
+    fv2SPGap1Bmc_inclusive_lq(0),
+    fv2SPGap1Amc_inclusive_sq(0),
+    fv2SPGap1Bmc_inclusive_sq(0),
     fIsRecoEff(0),
-    fRecoEffList(0)
+    fRecoEffList(0),
+    fQvecGen(0)
       {}
   AliAnalysisTaskV2AllChAOD(const char *name);
   virtual ~AliAnalysisTaskV2AllChAOD() {
@@ -99,7 +108,6 @@ class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
   void SetEventCuts(AliSpectraAODEventCuts * vc)       { fEventCuts = vc; }
   void SetnCentBins(Int_t val)                             { fnCentBins = val; }
   void SetnQvecBins(Int_t val)                             { fnQvecBins = val; }
-  void SetQvecCalibMode(Bool_t mode)                  { fIsQvecCalibMode = mode; }
   void SetQvecUpperLimit(Double_t val)                { fQvecUpperLim = val; }
   
   void SetTrackBits(UInt_t TrackBits) {fTrkBit=TrackBits;}
@@ -109,7 +117,7 @@ class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
   void SetMinTPCNcls(Double_t val) {fMinTPCNcls=val;}
   
   Bool_t GetDCA(const AliAODTrack* trk, Double_t * p);
-  void MCclosure();
+  void MCclosure(Double_t qvec);
   
   void EnableRecoEff (Bool_t val) { fIsRecoEff = val; }
   Double_t GetRecoEff(Double_t pt, Int_t iC);
@@ -127,6 +135,8 @@ class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
   void     SetQvecCut(Float_t qmin,Float_t qmax)      { fCutSmallQperc = qmin; fCutLargeQperc = qmax; }
   void     SetFillTHn (Bool_t val) { fFillTHn = val; }
   
+  void GetQvecGen(Bool_t val) { fQvecGen = val; } //enable Qvec from generated
+  
  private:
   
   AliAODEvent                   * fAOD;                         //! AOD object
@@ -140,7 +150,6 @@ class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
   TList                          * fOutput_sq;                  // output list small Q
   Int_t                            fnCentBins;                  // number of bins for the centrality axis
   Int_t                            fnQvecBins;                 // number of bins for the q vector axis
-  Bool_t                           fIsQvecCalibMode;          //calib mode for Qvector percentile
   Double_t                         fQvecUpperLim;             //Upper limit for Qvector
   
   Int_t                            fCutLargeQperc; // cut on 10% large Q-vec events
@@ -157,6 +166,8 @@ class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
   
   Bool_t fFillTHn;
   
+  TH1D * fCentrality;
+  
   //output object
   TProfile*     fResSP;             //! resolution
   TProfile*     fResSP_vs_Cent;
@@ -211,21 +222,33 @@ class AliAnalysisTaskV2AllChAOD : public AliAnalysisTaskSE
   TProfile*     fSinGap1B_sq[9];      //! <sin> vs pT gap 1
   TProfile*     fCosGap1B_sq[9];      //! <cos> vs pT gap 1
   
-  TProfile*    fv2SPGap1A_mb;
-  TProfile* fv2SPGap1B_mb;
-  TProfile* fResSP_mb;
-  TProfile* fv2SPGap1Amc;
-  TProfile* fv2SPGap1Bmc;
-  TProfile* fResSPmc;
+  // MC closure test
+  
+  TProfile* fResSP_inclusive;
+  TProfile* fv2SPGap1A_inclusive_mb;
+  TProfile* fv2SPGap1B_inclusive_mb;
+  TProfile* fv2SPGap1A_inclusive_lq;
+  TProfile* fv2SPGap1B_inclusive_lq;
+  TProfile* fv2SPGap1A_inclusive_sq;
+  TProfile* fv2SPGap1B_inclusive_sq;
+  
+  TProfile* fResSPmc_inclusive;
+  TProfile* fv2SPGap1Amc_inclusive_mb;
+  TProfile* fv2SPGap1Bmc_inclusive_mb;
+  TProfile* fv2SPGap1Amc_inclusive_lq;
+  TProfile* fv2SPGap1Bmc_inclusive_lq;
+  TProfile* fv2SPGap1Amc_inclusive_sq;
+  TProfile* fv2SPGap1Bmc_inclusive_sq;
   
   Bool_t fIsRecoEff;
   TList * fRecoEffList; // reconstruction efficiency file
-
+  
+  Bool_t fQvecGen; //enable Qvec from generated
   
   AliAnalysisTaskV2AllChAOD(const AliAnalysisTaskV2AllChAOD&);
   AliAnalysisTaskV2AllChAOD& operator=(const AliAnalysisTaskV2AllChAOD&);
   
-  ClassDef(AliAnalysisTaskV2AllChAOD, 9);
+  ClassDef(AliAnalysisTaskV2AllChAOD, 10);
 };
 
 #endif