Changes to the sharing efficiency correction
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Oct 2009 13:11:16 +0000 (13:11 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 Oct 2009 13:11:16 +0000 (13:11 +0000)
FMD/analysis/AliFMDAnaParameters.cxx
FMD/analysis/AliFMDAnaParameters.h
FMD/analysis/AliFMDAnalysisTaskDensity.cxx
FMD/analysis/AliFMDAnalysisTaskDndeta.cxx

index 8786bba..16f88aa 100644 (file)
@@ -376,6 +376,16 @@ TH1F* AliFMDAnaParameters::GetSharingEfficiency(Int_t det, Char_t ring, Int_t vt
 
 }
 //_____________________________________________________________________
+TH1F* AliFMDAnaParameters::GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin) {
+  if(!fIsInit) {
+    AliWarning("Not initialized yet. Call Init() to remedy");
+    return 0;
+  }
+  
+  return fSharingEfficiency->GetSharingEffTrVtx(det,ring,vtxbin);
+
+}
+//_____________________________________________________________________
 Float_t AliFMDAnaParameters::GetMaxR(Char_t ring) const{
   Float_t radius = 0;
   if(ring == 'I')
index 22660af..3e9c911 100644 (file)
@@ -91,7 +91,7 @@ public:
   TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
   
   TH1F* GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin);
-  
+  TH1F* GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin);
   Float_t  GetEventSelectionEfficiency(Int_t vtxbin);
   Float_t  GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
   Float_t  GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
index 818db9d..966f82e 100644 (file)
@@ -220,12 +220,6 @@ void AliFMDAnalysisTaskDensity::Exec(Option_t */*option*/)
              correction = correction*hDoubleHitCorrection->GetBinContent(hDoubleHitCorrection->FindBin(eta));
            
          }
-         TH1F* hSharingEff = pars->GetSharingEfficiency(det,ring,vtxbin);
-           
-           if(hSharingEff->GetBinContent(hSharingEff->FindBin(eta)) != 0)
-             correction = correction*hSharingEff->GetBinContent(hSharingEff->FindBin(eta));
-         
-         
          
          if(correction) nParticles = nParticles / correction;
          if(nParticles > 0)
index 8e78354..312ed65 100644 (file)
@@ -194,11 +194,31 @@ void AliFMDAnalysisTaskDndeta::Terminate(Option_t */*option*/) {
       Char_t ringChar = (ir == 0 ? 'I' : 'O');
       for(Int_t i =0; i<nVtxbins; i++) {
        
+       TH1F* hSharingEff = pars->GetSharingEfficiency(det,ringChar,i);
+       TH1F* hSharingEffTrVtx = pars->GetSharingEfficiencyTrVtx(det,ringChar,i);       
        TH2F* hMultTotal = (TH2F*)fOutputList->FindObject(Form("dNdeta_FMD%d%c_vtxbin%d",det,ringChar,i));
        TH2F* hMultTrVtx = (TH2F*)hMultTotal->Clone(Form("dNdeta_FMD%d%c_TrVtx_vtxbin%d",det,ringChar,i));
        
+       for(Int_t nx=1; nx<hMultTotal->GetNbinsX(); nx++) {
+         Float_t correction = hSharingEff->GetBinContent(nx);
+         Float_t correctionTrVtx = hSharingEffTrVtx->GetBinContent(nx);
+         for(Int_t ny=1; ny<hMultTotal->GetNbinsY(); ny++) {
+           
+           if(correction != 0)
+             hMultTotal->SetBinContent(nx,ny,hMultTotal->GetBinContent(nx,ny)/correction);
+           if(correctionTrVtx != 0)
+             hMultTrVtx->SetBinContent(nx,ny,hMultTrVtx->GetBinContent(nx,ny)/correctionTrVtx);
+           
+         }
+         
+       }
+       
+       //hMultTotal->Divide(hSharingEff);
+       
        hMultTotal->Scale(1/pars->GetEventSelectionEfficiency(i));
-               
+       
+       //hMultTrVtx->Divide(hSharingEffTrVtx);
+       
        TH1D* hMultProj   = hMultTotal->ProjectionX(Form("dNdeta_FMD%d%c_vtxbin%d_proj",det,ringChar,i),1,hMultTotal->GetNbinsY());
        TH1D* hMultProjTrVtx   = hMultTrVtx->ProjectionX(Form("dNdeta_FMD%d%c_TrVtx_vtxbin%d_proj",det,ringChar,i),1,hMultTotal->GetNbinsY());
        fOutputList->Add(hMultTrVtx);