fListOfDoubleHitCorrection.Add(hCorrection);
}
//____________________________________________________________________
+TH1F* AliFMDAnaCalibBackgroundCorrection::GetSPDDeadCorrection(Int_t vtxbin) {
+
+ TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hSPDDeadCorrection_vtx%d",vtxbin));
+ return hCorrection;
+}
+
+//____________________________________________________________________
+void AliFMDAnaCalibBackgroundCorrection::SetSPDDeadCorrection(Int_t vtxbin,
+ TH1F* hCorrection) {
+ hCorrection->SetName(Form("hSPDDeadCorrection_vtx%d",vtxbin));
+ fListOfDoubleHitCorrection.Add(hCorrection);
+}
+//____________________________________________________________________
void AliFMDAnaCalibBackgroundCorrection::SetRefAxis(TAxis* axis) {
void AliFMDAnaCalibBackgroundCorrection::Init() {
fArray.SetOwner();
+
+ TObjArray* spdArray = new TObjArray();
+ spdArray->SetOwner();
+ fArray.AddAtAndExpand(spdArray,0);
+
for(Int_t det = 1; det<=3;det++) {
TObjArray* detArray = new TObjArray();
detArray->SetOwner();
TObjArray* AliFMDAnaCalibBackgroundCorrection::GetRingArray(Int_t det,
Char_t ring) {
+ if(det==0 || det == 4) {
+ TObjArray* spdArray = (TObjArray*)fArray.At(det);
+ return spdArray;
+ }
Int_t ringNumber = (ring == 'I' ? 0 : 1);
TObjArray* detArray = (TObjArray*)fArray.At(det);
TObjArray* ringArray = (TObjArray*)detArray->At(ringNumber);
void SetBgCorrection(Int_t det, Char_t ring, Int_t vtxbin, TH2F* hCorrection);
TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
void SetDoubleHitCorrection(Int_t det, Char_t ring, TH1F* hCorrection);
+ TH1F* GetSPDDeadCorrection(Int_t vtxbin);
+ void SetSPDDeadCorrection(Int_t vtxbin, TH1F* hCorrection);
void SetRefAxis(TAxis* axis);
Int_t GetNvtxBins();
Float_t GetVtxCutZ();
TAxis fAxis;
Bool_t fIsInit;
TList fListOfDoubleHitCorrection;
- ClassDef(AliFMDAnaCalibBackgroundCorrection,1);
+ ClassDef(AliFMDAnaCalibBackgroundCorrection,2);
};
#endif
return fBackground->GetDoubleHitCorrection(det,ring);
}
//_____________________________________________________________________
+TH1F* AliFMDAnaParameters::GetSPDDeadCorrection(Int_t vtxbin) {
+
+ //Get correction for several hits in strips for p+p
+ if(!fIsInit) {
+ AliWarning("Not initialized yet. Call Init() to remedy");
+ return 0;
+ }
+
+ return fBackground->GetSPDDeadCorrection(vtxbin);
+}
+//_____________________________________________________________________
Float_t AliFMDAnaParameters::GetEventSelectionEfficiency(Int_t vtxbin) {
//Get event selection efficiency object
if(!fIsInit) {
static const char* GetSharingEffID() { return fgkSharingEffID;}
TH2F* GetBackgroundCorrection(Int_t det, Char_t ring, Int_t vtxbin);
TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring);
+ TH1F* GetSPDDeadCorrection(Int_t vtxbin);
TH1F* GetSharingEfficiency(Int_t det, Char_t ring, Int_t vtxbin);
TH1F* GetSharingEfficiencyTrVtx(Int_t det, Char_t ring, Int_t vtxbin);
Bool_t IsEventTriggered(const AliESDEvent *esd) const;
Bool_t IsEventTriggered(const AliESDEvent *esd, Trigger trigger) ;
void SetEnergy(Energy energy) {fEnergy = energy;}
+ Energy GetEnergy() {return fEnergy;}
void SetMagField(MagField magfield) {fMagField = magfield;}
char* GetPath(const char* species);
void SetCollisionSystem(Species collsystem) {fSpecies = collsystem;}
#include "AliESDVertex.h"
#include "TMath.h"
#include "AliFMDAnaParameters.h"
+#include "AliESDInputHandler.h"
+#include "AliMultiplicity.h"
//#include "AliFMDGeometry.h"
ClassImp(AliFMDAnalysisTaskBackgroundCorrection)
TH2F* hMult = 0;
TH2F* hMultTrVtx = 0;
TH2F* hHits = 0;
+ TH2F* hSPDMult = 0;
+ TH2F* hSPDMultTrVtx = 0;
// TH2F* hHitsNoCuts = 0;
Int_t nVtxbins = pars->GetNvtxBins();
-
- for(Int_t det =1; det<=3;det++)
- {
- Int_t nRings = (det==1 ? 1 : 2);
- for(Int_t ring = 0;ring<nRings;ring++)
- {
- Char_t ringChar = (ring == 0 ? 'I' : 'O');
- Int_t nSec = (ring == 0 ? 20 : 40);
-
- for(Int_t i = 0; i< nVtxbins; i++) {
+ for(Int_t i = 0; i< nVtxbins; i++) {
+ for(Int_t det =1; det<=3;det++)
+ {
+ Int_t nRings = (det==1 ? 1 : 2);
+ for(Int_t ring = 0;ring<nRings;ring++)
+ {
+ Char_t ringChar = (ring == 0 ? 'I' : 'O');
+ Int_t nSec = (ring == 0 ? 20 : 40);
+
+
TH2F* hBg = pars->GetBackgroundCorrection(det, ringChar, i);
hMult = new TH2F(Form("mult_FMD%d%c_vtxbin%d",det,ringChar,i),Form("mult_FMD%d%c_vtxbin%d",det,ringChar,i),
hBg->GetNbinsX(),
*/
hHits->Sumw2();
fHitList->Add(hHits);
- //fOutputList->Add(hHits);
-
+
}
- }
- }
+ }
+ //HHD SPD hists
+ TH2F* hBg = pars->GetBackgroundCorrection(1, 'I', i);
+ hSPDMult = new TH2F(Form("mult_SPD_vtxbin%d",i),Form("mult_SPD_vtxbin%d",i),
+ hBg->GetNbinsX(),
+ hBg->GetXaxis()->GetXmin(),
+ hBg->GetXaxis()->GetXmax(),
+ 20, 0, 2*TMath::Pi());
+ hSPDMult->Sumw2();
+ fOutputList->Add(hSPDMult);
+ hSPDMultTrVtx = new TH2F(Form("multTrVtx_SPD_vtxbin%d",i),Form("multTrVtx_SPD_vtxbin%d",i),
+ hBg->GetNbinsX(),
+ hBg->GetXaxis()->GetXmin(),
+ hBg->GetXaxis()->GetXmax(),
+ 20, 0, 2*TMath::Pi());
+ hSPDMultTrVtx->Sumw2();
+ fOutputList->Add(hSPDMultTrVtx);
+
+ }
hMult->Reset();
TH2F* hMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_FMD%d%c_vtxbin%d",det,ringChar,vtxbin));
hMultTrVtx->Reset();
+
+ TH2F* hSPDMult = (TH2F*)fOutputList->FindObject(Form("mult_SPD_vtxbin%d",vtxbin));
+ hSPDMult->Reset();
+ TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin));
+ hSPDMult->Reset();
}
}
hMult->Scale(0);
}
- }
-
+ }
+
+ //HHD SPD code
+
+ TH2F* hSPDMult = (TH2F*)fOutputList->FindObject(Form("mult_SPD_vtxbin%d",vtxbin));
+ TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin));
+
+ AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+ AliESDEvent* esd = esdH->GetEvent();
+ const AliMultiplicity* spdmult = esd->GetMultiplicity();
+ for(Int_t j = 0; j< spdmult->GetNumberOfTracklets();j++) {
+ hSPDMult->Fill(spdmult->GetEta(j),spdmult->GetPhi(j));
+ hSPDMultTrVtx->Fill(spdmult->GetEta(j),spdmult->GetPhi(j));
+ }
+ for(Int_t j = 0; j< spdmult->GetNumberOfSingleClusters();j++) {
+ hSPDMult->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j));
+ hSPDMultTrVtx->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j));
+ }
+
+ TH2F* hBgSPD = pars->GetBackgroundCorrection(0, 'Q', vtxbin);
+ if(hBgSPD) {
+ TH1F* hDead = pars->GetSPDDeadCorrection(vtxbin);
+ for(Int_t i=1; i<=hSPDMult->GetNbinsX(); i++) {
+ for(Int_t j=1; j<=hSPDMult->GetNbinsY(); j++) {
+ Float_t mult = hSPDMult->GetBinContent(i,j);
+ Float_t correction = hBgSPD->GetBinContent(i,j);
+ Float_t correctedMult = 0;
+ Float_t correctedError = 0;
+ if(correction > 0 && mult > 0) {
+ correctedMult = mult/correction;
+ if(hDead->GetBinContent(i) > 0)
+ correctedMult = correctedMult/hDead->GetBinContent(i);
+ correctedError = correctedMult*TMath::Sqrt( TMath::Power(hSPDMult->GetBinError(i,j)/hSPDMult->GetBinContent(i,j),2) +
+ TMath::Power(hBgSPD->GetBinError(i,j)/hBgSPD->GetBinContent(i,j),2));
+
+ }
+
+ if(correctedMult != 0) {
+ hSPDMult->SetBinContent(i,j,correctedMult);
+ hSPDMultTrVtx->SetBinContent(i,j,correctedMult);
+ hSPDMult->SetBinError(i,j,correctedError);
+ hSPDMultTrVtx->SetBinError(i,j,correctedError);
+ }
+ }
+ }
+
+ if(pars->GetEventSelectionEfficiency(vtxbin) > 0)
+ hSPDMult->Scale(1/pars->GetEventSelectionEfficiency(vtxbin));
+ else
+ hSPDMult->Scale(0);
+
+ }
+ else
+ AliWarning("No SPD background map found");
+
+ //std::cout<<spdmult->GetNumberOfTracklets()<<" "<<spdmult->GetNumberOfITSClusters(0)<<" "<< spdmult->GetNumberOfSingleClusters()<<std::endl;
if(fStandalone) {
PostData(0, fOutputList);
}
hBgTmp->GetXaxis()->GetXmax());
hPrimVertexBin->Sumw2();
fOutputList->Add(hPrimVertexBin);
-
+ //SPD part
+ TH2F* hSPDMult = new TH2F(Form("dNdeta_SPD_vtxbin%d",i),Form("dNdeta_SPD_vtxbin%d",i),
+ hBgTmp->GetNbinsX(),
+ hBgTmp->GetXaxis()->GetXmin(),
+ hBgTmp->GetXaxis()->GetXmax(),
+ 20, 0, 2*TMath::Pi());
+ hSPDMult->Sumw2();
+ fOutputList->Add(hSPDMult);
+ TH2F* hSPDMultTrVtx = new TH2F(Form("dNdetaTrVtx_SPD_vtxbin%d",i),Form("dNdetaTrVtx_SPD_vtxbin%d",i),
+ hBgTmp->GetNbinsX(),
+ hBgTmp->GetXaxis()->GetXmin(),
+ hBgTmp->GetXaxis()->GetXmax(),
+ 20, 0, 2*TMath::Pi());
+ hSPDMultTrVtx->Sumw2();
+ fOutputList->Add(hSPDMultTrVtx);
}
fNevents.SetBins(nVtxbins,0,nVtxbins);
}
}
+ //SPD code
+ TH2F* hMultSPDTotal = (TH2F*)fOutputList->FindObject(Form("dNdeta_SPD_vtxbin%d",vtxbin));
+ TH2F* hMultSPDTotalTrVtx = (TH2F*)fOutputList->FindObject(Form("dNdetaTrVtx_SPD_vtxbin%d",vtxbin));
+ TH2F* hMultSPDInput = (TH2F*)fInputList->FindObject(Form("mult_SPD_vtxbin%d",vtxbin));
+ TH2F* hMultSPDInputTrVtx = (TH2F*)fInputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin));
+ hMultSPDTotal->Add(hMultSPDInput);
+ hMultSPDTotalTrVtx->Add(hMultSPDInputTrVtx);
+
+
if(pars->GetProcessPrimary())
ProcessPrimary();
//_____________________________________________________________________
void AliFMDAnalysisTaskDndeta::Terminate(Option_t */*option*/) {
-
AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
Int_t nVtxbins = pars->GetNvtxBins();
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);
+ //fOutputList->Add(hMultTrVtx);
fOutputList->Add(hMultProj);
fOutputList->Add(hMultProjTrVtx);
}
}
}
-
+
+ for(Int_t i =0; i<nVtxbins; i++) {
+
+ TH2F* hSPDMult = (TH2F*)fOutputList->FindObject(Form("dNdeta_SPD_vtxbin%d",i));
+ TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("dNdetaTrVtx_SPD_vtxbin%d",i));
+
+ TH1D* hMultProj = hSPDMult->ProjectionX(Form("dNdeta_SPD_vtxbin%d_proj",i),1,hSPDMult->GetNbinsY());
+ TH1D* hMultProjTrVtx = hSPDMultTrVtx->ProjectionX(Form("dNdetaTrVtx_SPD_vtxbin%d_proj",i),1,hSPDMultTrVtx->GetNbinsY());
+
+ fOutputList->Add(hMultProj);
+ fOutputList->Add(hMultProjTrVtx);
+
+ }
+
std::cout<<"FMD analysis accepted "<<fNevents.GetEntries()<<" events"<<std::endl;
}
//_____________________________________________________________________
//#include "AliFMDGeometry.h"
#include "TArray.h"
#include "AliGenEventHeader.h"
+#include "AliMultiplicity.h"
#include "AliHeader.h"
#include "AliFMDAnaCalibBackgroundCorrection.h"
#include "AliFMDAnaCalibEventSelectionEfficiency.h"
//
std::cout<<"Creating output objects"<<std::endl;
- for(Int_t iring = 0; iring<2;iring++) {
- Char_t ringChar = (iring == 0 ? 'I' : 'O');
- Int_t nSec = (iring == 1 ? 40 : 20);
- for(Int_t v=0; v<fNvtxBins;v++) {
-
+ for(Int_t v=0; v<fNvtxBins;v++) {
+
+ TH2F* hSPDhits = new TH2F(Form("hSPDhits_vtx%d",v),
+ Form("hSPDhits_vtx%d",v),
+ fNbinsEta, -6,6, 20, 0,2*TMath::Pi());
+ hSPDhits->Sumw2();
+ fListOfHits.Add(hSPDhits);
+
+ for(Int_t iring = 0; iring<2;iring++) {
+ Char_t ringChar = (iring == 0 ? 'I' : 'O');
+ Int_t nSec = (iring == 1 ? 40 : 20);
+
TH2F* hPrimary = new TH2F(Form("hPrimary_FMD_%c_vtx%d",ringChar,v),
Form("hPrimary_FMD_%c_vtx%d",ringChar,v),
fNbinsEta, -6,6, nSec, 0,2*TMath::Pi());
hPrimary->Sumw2();
fListOfPrimaries.Add(hPrimary);
+
+
}
}
+
for(Int_t det =1; det<=3;det++) {
}
}
+
+ //SPD part HHD
+ TH2F* hSPDMult = (TH2F*)fListOfHits.FindObject(Form("hSPDhits_vtx%d", vertexBin));
+
+ const AliMultiplicity* spdmult = esdevent->GetMultiplicity();
+ for(Int_t j = 0; j< spdmult->GetNumberOfTracklets();j++)
+ hSPDMult->Fill(spdmult->GetEta(j),spdmult->GetPhi(j));
+
+ for(Int_t j = 0; j< spdmult->GetNumberOfSingleClusters();j++)
+ hSPDMult->Fill(-TMath::Log(TMath::Tan(spdmult->GetThetaSingle(j)/2.)),spdmult->GetPhiSingle(j));
PostData(1, &fListOfHits);
}
}
+ for(Int_t vertexBin=0;vertexBin<fNvtxBins ;vertexBin++) {
+ TH2F* hPrimary = (TH2F*)fListOfPrimaries.FindObject( Form("hPrimary_FMD_%c_vtx%d",'I',vertexBin));
+ TH2F* hSPDMult = (TH2F*)fListOfHits.FindObject(Form("hSPDhits_vtx%d", vertexBin));
+ TH2F* hCorrection = (TH2F*)hSPDMult->Clone(Form("SPD_vtxbin_%d_correction",vertexBin));
+ hCorrection->SetTitle(hCorrection->GetName());
+ fListOfCorrection.Add(hCorrection);
+ hCorrection->Divide(hPrimary);
+ fBackground->SetBgCorrection(0,'Q',vertexBin,hCorrection);
+
+ TH1F* hAlive = new TH1F(Form("hAliveSPD_vtxbin%d",vertexBin),Form("hAliveSPD_vtxbin%d",vertexBin),hSPDMult->GetNbinsX(),hSPDMult->GetXaxis()->GetXmin(), hSPDMult->GetXaxis()->GetXmax());
+ TH1F* hPresent = new TH1F(Form("hPresentSPD_vtxbin%d",vertexBin),Form("hPresentSPD_vtxbin%d",vertexBin),hSPDMult->GetNbinsX(),hSPDMult->GetXaxis()->GetXmin(), hSPDMult->GetXaxis()->GetXmax());
+ for(Int_t xx = 1; xx <=hSPDMult->GetNbinsX(); xx++) {
+
+ if(TMath::Abs(hCorrection->GetXaxis()->GetBinCenter(xx)) > 2)
+ continue;
+ for(Int_t yy = 1; yy <=hSPDMult->GetNbinsY(); yy++) {
+ if(hCorrection->GetBinContent(xx,yy) > 0.1)
+ hAlive->Fill(hCorrection->GetXaxis()->GetBinCenter(xx));
+ hPresent->Fill(hCorrection->GetXaxis()->GetBinCenter(xx));
+
+ }
+ }
+ TH1F* hDeadCorrection = (TH1F*)hAlive->Clone(Form("hSPDDeadCorrection_vtxbin%d",vertexBin));
+ hDeadCorrection->Divide(hPresent);
+ fBackground->SetSPDDeadCorrection(vertexBin,hDeadCorrection);
+ fListOfCorrection.Add(hDeadCorrection);
+ }
+
+
TAxis refAxis(fNvtxBins,-1*fZvtxCut,fZvtxCut);
fBackground->SetRefAxis(&refAxis);
}
}
}
- for(Int_t iring = 0; iring<2;iring++) {
- Char_t ringChar = (iring == 0 ? 'I' : 'O');
- for(Int_t v=0; v<fNvtxBins;v++) {
+ for(Int_t v=0; v<fNvtxBins;v++) {
+ TH2F* hSPDHits = (TH2F*)listOfHits->FindObject(Form("hSPDhits_vtx%d", v));
+ fListOfHits.Add(hSPDHits);
+
+ for(Int_t iring = 0; iring<2;iring++) {
+ Char_t ringChar = (iring == 0 ? 'I' : 'O');
+
TH2F* hPrimary = (TH2F*)listOfPrim->FindObject( Form("hPrimary_FMD_%c_vtx%d",ringChar,v));
fListOfPrimaries.Add(hPrimary);