From: hdalsgaa Date: Tue, 22 Jun 2010 22:12:33 +0000 (+0000) Subject: Change in the way event selection corrections are made X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=ab3e0abc729078fea5a2e5e8589d45e9e8f17bda;p=u%2Fmrichter%2FAliRoot.git Change in the way event selection corrections are made --- diff --git a/PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx b/PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx index a44b5d8b0b4..d7697de9890 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.cxx @@ -1,6 +1,6 @@ #include "AliFMDAnaCalibEventSelectionEfficiency.h" -#include + #include #include @@ -54,6 +54,23 @@ void AliFMDAnaCalibEventSelectionEfficiency::SetCorrection(TH1F* hCorrection) { } +//____________________________________________________________________ +void AliFMDAnaCalibEventSelectionEfficiency::SetCorrection(Int_t vtxbin, + Char_t ring, + TH2F* hCorrection) { + hCorrection->SetName(Form("correction_%c_%d",ring,vtxbin)); + fCorrectionList.Add(hCorrection); + +} +//____________________________________________________________________ +TH2F* AliFMDAnaCalibEventSelectionEfficiency::GetCorrection(Int_t vtxbin, + Char_t ring) { + + TH2F* hCorrection = (TH2F*)fCorrectionList.FindObject(Form("correction_%c_%d",ring,vtxbin)); + return hCorrection; + +} + //____________________________________________________________________ Float_t AliFMDAnaCalibEventSelectionEfficiency::GetCorrection(Int_t vtxbin) { diff --git a/PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h b/PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h index 49d9b3071bd..2cfb2cf6979 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h +++ b/PWG2/FORWARD/analysis/AliFMDAnaCalibEventSelectionEfficiency.h @@ -6,6 +6,7 @@ #include #include #include +#include class TBrowser; @@ -23,11 +24,15 @@ class AliFMDAnaCalibEventSelectionEfficiency : public TObject void Browse(TBrowser* b); void SetCorrection(TH1F* hCorrection); Float_t GetCorrection(Int_t vtxbin); + void SetCorrection(Int_t vtxbin, Char_t ring, TH2F* hCorrection); + TH2F* GetCorrection(Int_t vtxbin, Char_t ring); + protected: TH1F fCorrection; + TList fCorrectionList; Bool_t fIsInit; - ClassDef(AliFMDAnaCalibEventSelectionEfficiency,1); + ClassDef(AliFMDAnaCalibEventSelectionEfficiency,2); }; #endif diff --git a/PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx b/PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx index 0ec71b11d77..71e8fe475aa 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx @@ -520,6 +520,16 @@ Float_t AliFMDAnaParameters::GetEventSelectionEfficiency(Int_t vtxbin) { } return fEventSelectionEfficiency->GetCorrection(vtxbin); +} +//_____________________________________________________________________ +TH2F* AliFMDAnaParameters::GetEventSelectionEfficiency(Int_t vtxbin, Char_t ring) { + //Get event selection efficiency object + if(!fIsInit) { + AliWarning("Not initialized yet. Call Init() to remedy"); + return 0; + } + return fEventSelectionEfficiency->GetCorrection(vtxbin,ring); + } //_____________________________________________________________________ TH1F* AliFMDAnaParameters::GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin) { diff --git a/PWG2/FORWARD/analysis/AliFMDAnaParameters.h b/PWG2/FORWARD/analysis/AliFMDAnaParameters.h index cf20363b7e7..57e3163f5de 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnaParameters.h +++ b/PWG2/FORWARD/analysis/AliFMDAnaParameters.h @@ -102,6 +102,7 @@ public: 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); + TH2F* GetEventSelectionEfficiency(Int_t vtxbin, Char_t ring); 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; Float_t GetStripLength(Char_t ring, UShort_t strip) ; diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx index b494f597c62..ba6794c5a87 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx @@ -222,12 +222,13 @@ void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/) //sharing efficiency correction ? if(pars->SharingEffPresent()) { - TH1F* hSharingEff = pars->GetSharingEfficiency(det,ringChar,vtxbin); + TH1F* hSharingEff = pars->GetSharingEfficiencyTrVtx(det,ringChar,vtxbin); TH1F* hSharingEffTrVtx = pars->GetSharingEfficiencyTrVtx(det,ringChar,vtxbin); for(Int_t nx=1; nxGetNbinsX(); nx++) { Float_t correction = hSharingEff->GetBinContent(nx); Float_t correctionTrVtx = hSharingEffTrVtx->GetBinContent(nx); + for(Int_t ny=1; nyGetNbinsY(); ny++) { if(correction != 0){ @@ -244,10 +245,13 @@ void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/) } } - if(pars->GetEventSelectionEfficiency(vtxbin) > 0) - hMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin)); - else - hMult->Scale(0); + + //if(pars->GetEventSelectionEfficiency(vtxbin) > 0) + // hMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin)); + //else + //hMult->Scale(0); + hMult->Divide(pars->GetEventSelectionEfficiency(vtxbin,ringChar)); + } } @@ -296,11 +300,12 @@ void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/) } } } + hSPDMult->Divide(pars->GetEventSelectionEfficiency(vtxbin,'I')); - if(pars->GetEventSelectionEfficiency(vtxbin) > 0) - hSPDMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin)); - else - hSPDMult->Scale(0); + //if(pars->GetEventSelectionEfficiency(vtxbin) > 0) + // hSPDMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin)); + //else + // hSPDMult->Scale(0); } else diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx index fcc17c984b7..8a369ed693c 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx @@ -141,8 +141,27 @@ void AliFMDAnalysisTaskGenerateCorrection::UserCreateOutputObjects() fListOfHits.Add(hEventsSelectedTrigger); fListOfPrimaries.Add(hEventsAll); - // fListOfHits.Add(hTriggered); - // fListOfPrimaries.Add(hTriggeredAll); + for(Int_t v=0; vSumw2(); + fListOfPrimaries.Add(hAnalysed); + + TH2F* hInel = new TH2F(Form("Inel_FMD%c_vtx%d",ringChar,v), + Form("Inel_FMD%c_vtx%d",ringChar,v), + fNbinsEta, -6,6, nSec, 0,2*TMath::Pi()); + + hInel->Sumw2(); + fListOfPrimaries.Add(hInel); + + } + } fVertexBins.SetName("VertexBins"); fVertexBins.GetXaxis()->Set(fNvtxBins,-1*fZvtxCut,fZvtxCut); @@ -234,7 +253,21 @@ void AliFMDAnalysisTaskGenerateCorrection::UserExec(Option_t */*option*/) TH2F* hPrimaryInner = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",'I',vertexBin)); TH2F* hPrimaryOuter = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",'O',vertexBin)); hPrimaryInner->Fill(particle->Eta(),particle->Phi()); - hPrimaryOuter->Fill(particle->Eta(),particle->Phi()); + hPrimaryOuter->Fill(particle->Eta(),particle->Phi()); + TH2F* hAnalysedInner = (TH2F*)fListOfPrimaries.FindObject( Form("Analysed_FMD%c_vtx%d",'I',vertexBin)); + TH2F* hAnalysedOuter = (TH2F*)fListOfPrimaries.FindObject( Form("Analysed_FMD%c_vtx%d",'O',vertexBin)); + TH2F* hInelInner = (TH2F*)fListOfPrimaries.FindObject( Form("Inel_FMD%c_vtx%d",'I',vertexBin)); + TH2F* hInelOuter = (TH2F*)fListOfPrimaries.FindObject( Form("Inel_FMD%c_vtx%d",'O',vertexBin)); + + + if(vtxFound && isTriggered) { + hAnalysedInner->Fill(particle->Eta(),particle->Phi()); + hAnalysedOuter->Fill(particle->Eta(),particle->Phi()); + } + hInelInner->Fill(particle->Eta(),particle->Phi()); + hInelOuter->Fill(particle->Eta(),particle->Phi()); + + } for(Int_t j=0; jGetNumberOfTrackReferences();j++) { @@ -243,6 +276,7 @@ void AliFMDAnalysisTaskGenerateCorrection::UserExec(Option_t */*option*/) if(ref->DetectorId() != AliTrackReference::kFMD) continue; + AliFMDStripIndex::Unpack(ref->UserId(),det,ring,sec,strip); Float_t thisStripTrack = fLastTrackByStrip(det,ring,sec,strip); if(particle->Charge() != 0 && i != thisStripTrack ) { @@ -305,14 +339,30 @@ void AliFMDAnalysisTaskGenerateCorrection::GenerateCorrection() { fBackground = new AliFMDAnaCalibBackgroundCorrection(); fEventSelectionEff = new AliFMDAnaCalibEventSelectionEfficiency(); - //TH1F* hTriggered = (TH1F*)fListOfHits.FindObject("Triggered"); - //TH1F* hTriggeredAll = (TH1F*)fListOfPrimaries.FindObject("TriggeredAll"); - + //Event selection TH1F* hEventsSelected = (TH1F*)fListOfHits.FindObject("EventsSelected"); TH1F* hEventsSelectedVtx = (TH1F*)fListOfHits.FindObject("EventsSelectedVtx"); TH1F* hEventsSelectedTrigger = (TH1F*)fListOfHits.FindObject("EventsSelectedTrigger"); TH1F* hEventsAll = (TH1F*)fListOfPrimaries.FindObject("EventsAll"); + for(Int_t v=0;vScale((hEventsSelected->GetBinContent(v+1) == 0 ? 0 : 1/hEventsSelected->GetBinContent(v+1))); + hAnalysedOuter->Scale((hEventsSelected->GetBinContent(v+1) == 0 ? 0 : 1/hEventsSelected->GetBinContent(v+1))); + hInelInner->Scale((hEventsAll->GetBinContent(v+1) == 0 ? 0 : 1/hEventsAll->GetBinContent(v+1))); + hInelOuter->Scale((hEventsAll->GetBinContent(v+1) == 0 ? 0 : 1/hEventsAll->GetBinContent(v+1))); + hAnalysedInner->Divide(hInelInner); + hAnalysedOuter->Divide(hInelOuter); + fEventSelectionEff->SetCorrection(v,'I',hAnalysedInner); + fEventSelectionEff->SetCorrection(v,'O',hAnalysedOuter); + } + + + // hEventsAll->Divide(hEventsAll,hEventsSelected,1,1,"B"); hEventsSelectedVtx->Divide(hEventsAll); hEventsSelectedTrigger->Divide(hEventsAll); @@ -320,7 +370,8 @@ void AliFMDAnalysisTaskGenerateCorrection::GenerateCorrection() { for(Int_t i = 1; i<=hEventsSelected->GetNbinsX(); i++) { if(hEventsSelected->GetBinContent(i) == 0 ) continue; - Float_t b = hEventsSelected->GetBinContent(i); + Float_t b = hEventsSelected->GetBinContent(i); + // Float_t b = hEventsSelected->GetBinContent(i)*hEventsSelectedTrigger->GetBinContent(i); Float_t db = hEventsSelected->GetBinError(i); Float_t sum = hEventsAll->GetBinContent(i); Float_t dsum = hEventsAll->GetBinError(i); @@ -335,6 +386,10 @@ void AliFMDAnalysisTaskGenerateCorrection::GenerateCorrection() { } + //TH1F* hEventTest = (TH1F*)hEventsAll->Clone("hEventTest"); + + + fEventSelectionEff->SetCorrection(hEventsAll); for(Int_t det= 1; det <=3; det++) { @@ -353,16 +408,7 @@ void AliFMDAnalysisTaskGenerateCorrection::GenerateCorrection() { TH2F* hPrimary = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",ring,vertexBin)); TH2F* hCorrection = (TH2F*)hHits->Clone(Form("FMD%d%c_vtxbin_%d_correction",det,ring,vertexBin)); hCorrection->Divide(hPrimary); - /*for(Int_t i = 1; i<=hCorrection->GetNbinsX();i++) { - for(Int_t j=1; j<=hCorrection->GetNbinsY();j++) { - if(hCorrection()->GetBinContent(i,j) == 0) - continue; - Float_t a = h - - - } - } - */ + hCorrection->SetTitle(hCorrection->GetName()); fListOfCorrection.Add(hCorrection); @@ -404,6 +450,10 @@ void AliFMDAnalysisTaskGenerateCorrection::GenerateCorrection() { } + + + + TAxis refAxis(fNvtxBins,-1*fZvtxCut,fZvtxCut); fBackground->SetRefAxis(&refAxis); @@ -465,8 +515,12 @@ void AliFMDAnalysisTaskGenerateCorrection::ReadFromFile(const Char_t* filename, TH2F* hPrimary = (TH2F*)listOfPrim->FindObject( Form("hPrimary_FMD_%c_vtx%d",ringChar,v)); - fListOfPrimaries.Add(hPrimary); + TH2F* hAnalysed = (TH2F*)listOfPrim->FindObject(Form("Analysed_FMD%c_vtx%d",ringChar,v)); + TH2F* hInel = (TH2F*)listOfPrim->FindObject(Form("Inel_FMD%c_vtx%d",ringChar,v)); + fListOfPrimaries.Add(hPrimary); + fListOfPrimaries.Add(hAnalysed); + fListOfPrimaries.Add(hInel); } } GenerateCorrection();