]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes to the Poisson Calculator for displaced vertices and less memory consumption
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Jan 2012 12:19:53 +0000 (12:19 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 4 Jan 2012 12:19:53 +0000 (12:19 +0000)
PWG2/FORWARD/analysis2/AliFMDDensityCalculator.cxx
PWG2/FORWARD/analysis2/AliPoissonCalculator.cxx
PWG2/FORWARD/analysis2/AliPoissonCalculator.h

index c96cdb64ad69c162a77830bc390082d952ca1d66..0bdb9c11c391f670150e1714072867b4bd844e53 100644 (file)
@@ -220,8 +220,9 @@ AliFMDDensityCalculator::Init(const TAxis& axis)
   TIter    next(&fRingHistos);
   RingHistos* o = 0;
   while ((o = static_cast<RingHistos*>(next()))) {
-    o->Init(axis);
+    //o->Init(axis);
     o->fMultCut = fCuts.GetFixedCut(o->fDet, o->fRing);
+    o->fPoisson.Init(o->fDet,o->fRing,fEtaLumping, fPhiLumping);
   }
 }
 
@@ -591,17 +592,14 @@ AliFMDDensityCalculator::NParticles(Float_t  mult,
     AliWarning(Form("No good fits for FMD%d%c at eta=%f", d, r, eta));
     return 0;
   }
+  
   UShort_t n   = TMath::Min(fMaxParticles, UShort_t(m));
   Double_t ret = fit->EvaluateWeighted(mult, n);
-
+  
   if (fDebug > 10) {
     AliInfo(Form("FMD%d%c, eta=%7.4f, %8.5f -> %8.5f", d, r, eta, mult, ret));
   }
-  //HHD, CS test
-  //if(mult < fit->GetDelta()) {std::cout<<ret<<"   "<<1<<std::endl; ret = 1;} 
-  
-  //if(mult > 8) {std::cout<<ret<<"   "<<1<<std::endl; ret = 1;}
-  
+    
   fWeightedSum->Fill(ret);
   fSumOfWeights->Fill(ret);
   
@@ -834,9 +832,9 @@ AliFMDDensityCalculator::DefineOutput(TList* dir)
   while ((o = static_cast<RingHistos*>(next()))) {
     // o->fPoisson.SetEtaLumping(fEtaLumping);
     o->fPoisson.SetUseAverageOverEvents(fUseRunningAverage);
-    o->fPoisson.Init(o->fDet,o->fRing,fEtaLumping, fPhiLumping);
-    o->fPoisson.GetOccupancy()->SetFillColor(o->Color());
-    o->fPoisson.GetMean()->SetFillColor(o->Color());
+    //   o->fPoisson.Init(o->fDet,o->fRing,fEtaLumping, fPhiLumping);
+    // o->fPoisson.GetOccupancy()->SetFillColor(o->Color());
+    // o->fPoisson.GetMean()->SetFillColor(o->Color());
     // o->fPoisson.GetOccupancy()->SetFillColor(o->Color());
     o->Output(d);
   }
index aa7712af5bdc5022585098be0e2bfb128011862e..d78ac9480132adfc9b7a1a3bc87272ab5a8d013c 100644 (file)
@@ -1,4 +1,5 @@
 #include "AliPoissonCalculator.h"
+#include "AliForwardCorrectionManager.h"
 #include <TH2D.h>
 #include <TBrowser.h>
 #include <TROOT.h>
@@ -161,24 +162,51 @@ AliPoissonCalculator::Init(UShort_t d, Char_t r, Int_t etaLumping, Int_t phiLump
     fBasic->SetYTitle("#varphi [radians]");
     fBasic->Sumw2();
     
-    for(Int_t v = 1 ; v < 11; v++)  { //CHC bins
-      for(Int_t centbin = 0 ; centbin < 13; centbin++) {
-       
-       TH2D* hTotal = new TH2D(Form("totalFMD%d%c_vertex%d_cent%d",d,r,v,centbin),"Total number of bins/region",
-                             nEta, etaMin, etaMax, nPhi, phiMin, phiMax);
-       TH2D* hEmpty = new TH2D(Form("emptyFMD%d%c_vertex%d_cent%d",d,r,v,centbin), "Empty number of bins/region",
-                               nEta, etaMin, etaMax, nPhi, phiMin, phiMax);
-       hEmpty->Sumw2();
-       hTotal->Sumw2();
-       fEmptyList.Add(hEmpty);
-       fTotalList.Add(hTotal);
-       
+    if(fRunningAverage) {
+      AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
+      const TAxis* pv = fcm.GetVertexAxis();
+      Int_t nVtxBins = pv->GetNbins();
+      
+      for(Int_t v = 1 ; v < nVtxBins+1; v++)  { //CHC bins
+       for(Int_t centbin = 0 ; centbin < 13; centbin++) {
+         
+         TH2D* hTotal = new TH2D(Form("totalFMD%d%c_vertex%d_cent%d",d,r,v,centbin),"Total number of bins/region",
+                                 nEta, etaMin, etaMax, nPhi, phiMin, phiMax);
+         TH2D* hEmpty = new TH2D(Form("emptyFMD%d%c_vertex%d_cent%d",d,r,v,centbin), "Empty number of bins/region",
+                                 nEta, etaMin, etaMax, nPhi, phiMin, phiMax);
+         hEmpty->Sumw2();
+         hTotal->Sumw2();
+         fEmptyList.Add(hEmpty);
+         fTotalList.Add(hTotal);
+         
+       }
       }
     }
+    else {
+      fTotal = new TH2D("total", "Total number of hits",
+                       nEta, etaMin, etaMax, nPhi, phiMin, phiMax);
+      fTotal->SetXTitle("#eta");
+      fTotal->SetYTitle("#varphi [radians]");
+      fTotal->Sumw2();
+      fEmpty = new TH2D("empty", "Number of empties",
+                       nEta, etaMin, etaMax, nPhi, phiMin, phiMax);
+      fEmpty->SetXTitle("#eta");
+      fEmpty->SetYTitle("#varphi [radians]");
+      fEmpty->Sumw2();
+      
+      
+    }
   }
   //Create diagnostics if void
   if (fEmptyVsTotal) return;
   
+  MakeOutput();
+  
+  
+}
+ //____________________________________________________________________
+void AliPoissonCalculator::MakeOutput() {
+
   Int_t n = fEtaLumping * fPhiLumping + 1;
   fEmptyVsTotal = new TH2D("emptyVsTotal", 
                           "# of empty # bins vs total # bins", 
@@ -216,11 +244,13 @@ AliPoissonCalculator::Init(UShort_t d, Char_t r, Int_t etaLumping, Int_t phiLump
   fCorr->SetOption("colz");
   fCorr->SetDirectory(0);
   
-  
 }
 //____________________________________________________________________
 void AliPoissonCalculator::SetObject(UShort_t d, Char_t r, UShort_t v, Double_t cent) {
   
+  if(!fRunningAverage) return;
+  
   Int_t centbin = 0;
   if(cent > 0) {
     if(cent > 0 && cent <5) centbin = 1;
@@ -239,7 +269,7 @@ void
 AliPoissonCalculator::Output(TList* d)
 {
   if (!d) return;
-  if (!fEmptyVsTotal) Init();
+  if (!fEmptyVsTotal) MakeOutput();
   d->Add(fEmptyVsTotal);
   d->Add(fMean);
   d->Add(fOcc);
@@ -253,6 +283,7 @@ AliPoissonCalculator::Reset(const TH2D* base)
   // 
   // Reset histogram 
   // 
+  
   if (!base) return;
   if (fBasic /* && fTotal && fEmpty*/) {
     fBasic->Reset();
index cf71140c3732dbf328c0b37dac2f8d49cd0aff7f..4c137f35f56b2a5a37286b59aaf0fe1852a925a6 100644 (file)
@@ -89,7 +89,13 @@ public:
    * @param etaLumping If larger than 0, set the eta lumping to this
    * @param phiLumping If larger than 0, set the phi lumping to this
    */
-  void Init(UShort_t d=-1, Char_t r='I',Int_t etaLumping=-1, Int_t phiLumping=-1);
+  void Init(UShort_t d=-1, Char_t r='I', Int_t etaLumping=-1, Int_t phiLumping=-1);
+  /** 
+   * Make output stuff for the passed list
+   * 
+   * @param none
+   */
+  void MakeOutput();
   /** 
    * Output stuff to the passed list
    *