]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGCF/Correlations/DPhi/FourierDecomposition/AliDhcTask.cxx
fix from Tim
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / FourierDecomposition / AliDhcTask.cxx
index 9344c4324400a71907af65944f921d20c76a7aa3..d2dcbe7c4e7af09b6d6774c94fac422b8674a280 100644 (file)
@@ -42,7 +42,7 @@ AliDhcTask::AliDhcTask()
   fCentMethod("V0M"), fNBdeta(20), fNBdphi(36), fTriggerMatch(kTRUE),
   fBPtT(0x0), fBPtA(0x0), fBCent(0x0), fBZvtx(0x0),
   fMixBCent(0x0), fMixBZvtx(0x0), fHEffT(0x0), fHEffA(0x0),
-  fESD(0x0), fAOD(0x0), fOutputList(0x0), fHEvt(0x0), fHTrk(0x0),
+  fESD(0x0), fAOD(0x0), fOutputList(0x0), fHEvt(0x0), fHTrk(0x0), fHPoolReady(0x0),
   fHPtAss(0x0), fHPtTrg(0x0), fHPtTrgEvt(0x0),
   fHPtTrgNorm1S(0x0), fHPtTrgNorm1M(0x0), fHPtTrgNorm2S(0x0), fHPtTrgNorm2M(0x0),
   fHCent(0x0), fHZvtx(0x0), fNbins(0), fHSs(0x0), fHMs(0x0), fHPts(0x0), fHSMass(0x0), fHMMass(0x0),
@@ -65,7 +65,7 @@ AliDhcTask::AliDhcTask(const char *name, Bool_t def)
   fCentMethod("V0M"), fNBdeta(20), fNBdphi(36), fTriggerMatch(kTRUE),
   fBPtT(0x0), fBPtA(0x0), fBCent(0x0), fBZvtx(0x0),
   fMixBCent(0x0), fMixBZvtx(0x0), fHEffT(0x0), fHEffA(0x0),
-  fESD(0x0), fAOD(0x0), fOutputList(0x0), fHEvt(0x0), fHTrk(0x0),
+  fESD(0x0), fAOD(0x0), fOutputList(0x0), fHEvt(0x0), fHTrk(0x0), fHPoolReady(0x0),
   fHPtAss(0x0), fHPtTrg(0x0), fHPtTrgEvt(0x0),
   fHPtTrgNorm1S(0x0), fHPtTrgNorm1M(0x0), fHPtTrgNorm2S(0x0), fHPtTrgNorm2M(0x0),
   fHCent(0x0), fHZvtx(0x0), fNbins(0), fHSs(0x0), fHMs(0x0), fHPts(0x0), fHSMass(0x0), fHMMass(0x0),
@@ -193,6 +193,23 @@ void AliDhcTask::BookHistos()
                    100, 0, TMath::TwoPi(), 100, -fEtaMax, +fEtaMax);
   fOutputList->Add(fHTrk);
   
+  // Centrality mixing axis
+  Int_t nCentBins=fMixBCent->GetNbins();
+  Double_t centBins[nCentBins+1];
+  centBins[0] = fMixBCent->GetBinLowEdge(1);
+  for (Int_t i=1; i<=nCentBins; i++) {
+    centBins[i] = fMixBCent->GetBinUpEdge(i);
+  }
+  // Z-vertex mixing axis
+  Int_t nZvtxBins=fMixBZvtx->GetNbins();
+  Double_t zvtxbin[nZvtxBins+1];
+  zvtxbin[0] = fMixBZvtx->GetBinLowEdge(1);
+  for (Int_t i=1; i<=nZvtxBins; i++) {
+    zvtxbin[i] = fMixBZvtx->GetBinUpEdge(i);
+  }
+  fHPoolReady = new TH2F("fHPoolReady","mixing started", nZvtxBins, zvtxbin, nCentBins, centBins);
+  fOutputList->Add(fHPoolReady);
+  
   fHPtAss = new TH1F("fHPtAss","PtAssoc;P_{T} (GeV/c) [GeV/c]",nPtAssc,pta);
   fOutputList->Add(fHPtAss);
   fHPtTrg = new TH1F("fHPtTrg","PtTrig;P_{T} (GeV/c) [GeV/c]",nPtTrig,ptt);
@@ -494,23 +511,27 @@ void AliDhcTask::UserExec(Option_t *)
     if (fDoFillSame) { // fill same event right away if requested
       Correlate(*sTracks, *sTracks, kSameEvt);  
     }
+    PostData(1, fOutputList);
     return;
   }
 
   if (pool->IsFirstReady()) {
+    fHPoolReady->Fill(fZVertex,fCentrality);
     // recover events missed before the pool is ready
     Int_t nEvs = pool->GetCurrentNEvents();
     if (nEvs>1) {
       for (Int_t i=0; i<nEvs; ++i) {
-       MiniEvent* evI = pool->GetEvent(i);
-       for (Int_t j=0; j<nEvs; ++j) {
-         MiniEvent* evJ = pool->GetEvent(j);
-         if ((i==j) && !fDoFillSame) {
-            Correlate(*evI, *evJ, kSameEvt);
-         } else {
-           Correlate(*evI, *evJ, kDiffEvt);
-         }
-       }
+        MiniEvent* evI = pool->GetEvent(i);
+        for (Int_t j=0; j<nEvs; ++j) {
+          MiniEvent* evJ = pool->GetEvent(j);
+          if (i==j) {
+            if (!fDoFillSame) { // do not fill the same events twice
+              Correlate(*evI, *evJ, kSameEvt);
+            }
+          } else {
+            Correlate(*evI, *evJ, kDiffEvt);
+          }
+        }
       }
     }
   } else { /* standard case: same event, then mix*/