]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
final version of flow tasks for qm. (hopefully)
authorhansena <hansena@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Jul 2012 06:56:13 +0000 (06:56 +0000)
committerhansena <hansena@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Jul 2012 06:56:13 +0000 (06:56 +0000)
PWGLF/FORWARD/analysis2/AliForwardFlowTaskQC.cxx
PWGLF/FORWARD/analysis2/AliForwardMCFlowTaskQC.cxx

index 267dbf284224dcfebd11992bf62d7a353c8c806a..e3af31e6b133aed0f4f1e7933a1d0e8d06dfa250 100644 (file)
@@ -153,7 +153,8 @@ void AliForwardFlowTaskQC::InitVertexBins()
       Int_t vL = Int_t(fVtxAxis->GetBinLowEdge(v));
       Int_t vH = Int_t(fVtxAxis->GetBinUpEdge(v));
       fBinsFMD.Add(new VertexBin(vL, vH, n, "FMD", (fgDispVtx ? kFALSE : kTRUE), fFMDCut));
-      fBinsSPD.Add(new VertexBin(vL, vH, n, "SPD", kFALSE, fSPDCut));
+//      fBinsSPD.Add(new VertexBin(vL, vH, n, "SPD", kFALSE, fSPDCut));
+      fBinsSPD.Add(new VertexBin(vL, vH, n, "SPD", kTRUE, fSPDCut));
     }
   }
 
@@ -261,7 +262,7 @@ Bool_t AliForwardFlowTaskQC::FillVtxBinList(const TList& list, const TH2D& h, In
   Int_t nVtxBins = fVtxAxis->GetNbins();
 
   while ((bin = static_cast<VertexBin*>(list.At(vtx+(nVtxBins*i))))) {
-    if (!bin->FillHists(h, fCent)) return kFALSE; 
+    if (!bin->FillHists(h, fCent)) return kFALSE;
     bin->CumulantsAccumulate(fCent);
     i++;
   }
@@ -587,8 +588,9 @@ void AliForwardFlowTaskQC::VertexBin::AddOutput(TList* outputlist)
   fCumuRef = new TH2D(Form("%s_v%d_%d_%d_ref", fType.Data(), fMoment, fVzMin, fVzMax),
                         Form("%s_v%d_%d_%d_ref", fType.Data(), fMoment, fVzMin, fVzMax),
                         48, -6., 6., 5, 0.5, 5.5);
-  TFile acc("$ALICE_ROOT/PWGLF/FORWARD/corrections/FlowCorrections/FlowAccMap.root", "READ");
-  TH1D* accMap = (TH1D*)acc.Get(Form("%saccVertex_%d_%d", fType.Data(), fVzMin, fVzMax));
+/*  TFile* acc = TFile::Open("$ALICE_ROOT/PWGLF/FORWARD/corrections/FlowCorrections/FlowAccMap.root", "READ");
+  TH1D* accMap = 0;
+  if (acc) accMap = (TH1D*)acc->Get(Form("%saccVertex_%d_%d", fType.Data(), fVzMin, fVzMax));
   if (accMap && !fType.EqualTo("FMD")) {
     Int_t nBins = accMap->GetNbinsX();
     Double_t eta[48] = { 0. };
@@ -607,11 +609,12 @@ void AliForwardFlowTaskQC::VertexBin::AddOutput(TList* outputlist)
     }
     eta[n] = 6.;
     fCumuRef->GetXaxis()->Set(n, eta);
-  } else {
+  } else {*/
     fCumuRef->RebinX(24);
-  }
-  acc.Close();
+ /* }
+  acc->Close();
+  delete acc;
+ */
 
   fCumuRef->Sumw2();
   //list->Add(fCumuRef);
@@ -697,8 +700,8 @@ Bool_t AliForwardFlowTaskQC::VertexBin::FillHists(const TH2D& dNdetadphi, Double
     nCurRefBin = fCumuRef->GetXaxis()->FindBin(eta);
     // If we have moved to a new bin in the flow hist, and less than half the eta
     // region has been covered by it we cut it away.
-    if (!nPrevBin) nPrevBin = nCurBin;
-    if (!nPrevRefBin) nPrevRefBin = nCurRefBin;
+    if (!nPrevBin == 0) nPrevBin = nCurBin;
+    if (!nPrevRefBin == 0) nPrevRefBin = nCurRefBin;
     if (nCurBin != nPrevBin) {
       if (nCurRefBin != nPrevRefBin) {
        if (nInBin <= nBins/2) {
@@ -723,7 +726,6 @@ Bool_t AliForwardFlowTaskQC::VertexBin::FillHists(const TH2D& dNdetadphi, Double
        else data = kTRUE;
        continue;
       }
-      if (!data) continue;
       if (!AliForwardFlowTaskQC::fgDispVtx && (nCurBin == 34 || nCurBin == 35) && (phiBin == 17 || phiBin == 18)) continue;
       if ( AliForwardFlowTaskQC::fgDispVtx && eta < 0 && (phiBin == 17 || phiBin == 18)) continue;
       phi = dNdetadphi.GetYaxis()->GetBinCenter(phiBin);
index efde857d3bd902a63ddb0c16bab9c088f1ae7a08..17c903dfd155e2dd2600f7e3c4b6ae033c7a6b91 100644 (file)
@@ -125,7 +125,7 @@ void AliForwardMCFlowTaskQC::InitVertexBins()
       Int_t vH = Int_t(fVtxAxis->GetBinUpEdge(v));
       fBinsFMDTR.Add(new VertexBin(vL, vH, n, "FMDTR", (fgDispVtx ? kFALSE : kTRUE), fFMDCut));
       fBinsSPDTR.Add(new VertexBin(vL, vH, n, "SPDTR", kTRUE, fSPDCut));
-      fBinsMC.Add(new VertexBin(vL, vH, n, "MC"));
+      fBinsMC.Add(new VertexBin(vL, vH, n, "MC", kTRUE));
     }
   }
 }
@@ -270,6 +270,8 @@ Bool_t AliForwardMCFlowTaskQC::LoopAODMC()
     if (fAddFlow.Contains("eta"))  flowFlags |= AliForwardFlowWeights::kEta;
     if (fAddFlow.Contains("cent")) flowFlags |= AliForwardFlowWeights::kCent;
   }
+  Double_t b = -1.;
+  b = header->GetImpactParameter();
 
   // Track loop: chek how many particles will be accepted
   Double_t weight = 0;
@@ -288,10 +290,14 @@ Bool_t AliForwardMCFlowTaskQC::LoopAODMC()
     if (eta > -4. && eta < 5.) {
       // Add flow if it is in the argument
       if (flowFlags != 0) 
-       weight = fWeights.CalcWeight(eta, pT, phi, particle->PdgCode(), 
+/*     weight = fWeights.CalcWeight(eta, pT, phi, particle->PdgCode(), 
                                     rp, fCent, fAddType, fAddOrder, 
-                                    flowFlags) + 1;
-      fdNdedpMC.Fill(eta, phi, weight);
+                                    flowFlags) + 1;*/
+        weight = fWeights.CalcWeight(eta, pT, phi, particle->PdgCode(),
+                                    rp, b); 
+
+//        Printf("%f", weight);
+        fdNdedpMC.Fill(eta, phi, weight);
     }
   }
   Int_t sBin = fdNdedpMC.GetXaxis()->FindBin(-4.);