double counting for Nsigma
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliAnalysisTaskSpectraAllChAOD.cxx
index f8898b2..1db0f71 100644 (file)
@@ -61,7 +61,7 @@ AliAnalysisTaskSpectraAllChAOD::AliAnalysisTaskSpectraAllChAOD(const char *name)
   fVZEROside(0),\r
   fOutput(0x0),\r
   fnCentBins(20),\r
-  fnQvecBins(50)\r
+  fnQvecBins(40)\r
 {\r
   // Default constructor\r
   DefineInput(0, TChain::Class());\r
@@ -90,9 +90,9 @@ void AliAnalysisTaskSpectraAllChAOD::UserCreateOutputObjects()
   //dimensions of THnSparse for tracks\r
   const Int_t nvartrk=8;\r
   //                                             pt          cent        Q vec     IDrec     IDgen       isph           iswd      y\r
-  Int_t    binsHistRealTrk[nvartrk] = {      nptBins, fnCentBins,   fnQvecBins,        3,        3,         2,          2,       2};\r
-  Double_t xminHistRealTrk[nvartrk] = {         0.,          0.,            0.,     -0.5,      -0.5,      -0.5,        -0.5,   -0.5};\r
-  Double_t xmaxHistRealTrk[nvartrk] = {       10.,       100.,          10.,      2.5,      2.5,       1.5,         1.5,     0.5};    \r
+  Int_t    binsHistRealTrk[nvartrk] = {      nptBins, fnCentBins,   fnQvecBins,        4,        3,         2,          2,       2};\r
+  Double_t xminHistRealTrk[nvartrk] = {         0.,          0.,            0.,     -1.5,      -0.5,      -0.5,        -0.5,   -0.5};\r
+  Double_t xmaxHistRealTrk[nvartrk] = {       10.,       100.,            8.,      2.5,      2.5,       1.5,         1.5,     0.5};    \r
   THnSparseF* NSparseHistTrk = new THnSparseF("NSparseHistTrk","NSparseHistTrk",nvartrk,binsHistRealTrk,xminHistRealTrk,xmaxHistRealTrk);\r
   NSparseHistTrk->GetAxis(0)->SetTitle("#it{p}_{T,rec}");\r
   NSparseHistTrk->GetAxis(0)->SetName("pT_rec");\r
@@ -247,6 +247,22 @@ void AliAnalysisTaskSpectraAllChAOD::UserExec(Option_t *)
     varTrk[7]=y;\r
     ((THnSparseF*)fOutput->FindObject("NSparseHistTrk"))->Fill(varTrk);//track loop\r
     \r
+    //for nsigma PID fill double counting of ID\r
+    if(fHelperPID->GetPIDType()<kBayes){//only nsigma\r
+      Bool_t *HasDC;\r
+      HasDC=fHelperPID->GetDoubleCounting(track,kTRUE);//get the array with double counting\r
+      for(Int_t ipart=0;ipart<kNSpecies;ipart++){\r
+       if(HasDC[ipart]==kTRUE){\r
+         varTrk[3]=(Double_t)ipart;\r
+         ((THnSparseF*)fOutput->FindObject("NSparseHistTrk"))->Fill(varTrk);//track loop\r
+       }\r
+      }\r
+    }\r
+    \r
+    //fill all charged (-1)\r
+    varTrk[3]=-1.;\r
+    ((THnSparseF*)fOutput->FindObject("NSparseHistTrk"))->Fill(varTrk);//track loop\r
+    \r
     //Printf("a track");\r
     \r
   } // end loop on tracks\r