From 1b418b6338dc9af421e9b2b4f10edf6ab107383b Mon Sep 17 00:00:00 2001 From: cholm Date: Mon, 1 Nov 2010 11:20:40 +0000 Subject: [PATCH] Minor fixes to analysis code --- .../AliFMDAnaCalibBackgroundCorrection.cxx | 190 ++++++++------ .../AliFMDAnaCalibBackgroundCorrection.h | 181 ++++++++++++-- .../AliFMDAnaCalibEnergyDistribution.cxx | 81 +++--- PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx | 38 +-- .../AliFMDAnalysisTaskBFCorrelation.cxx | 17 +- .../AliFMDAnalysisTaskBFCorrelation.h | 153 +++++++++--- ...AliFMDAnalysisTaskBackgroundCorrection.cxx | 6 +- .../analysis/AliFMDAnalysisTaskDndeta.cxx | 9 +- .../AliFMDAnalysisTaskGenerateCorrection.cxx | 3 + .../analysis/AliFMDAnalysisTaskSharing.cxx | 31 ++- .../analysis/AliFMDAnalysisTaskSharing.h | 235 ++++++++++++++---- PWG2/FORWARD/analysis/AliFMDDndeta.h | 142 ++++++++--- 12 files changed, 807 insertions(+), 279 deletions(-) diff --git a/PWG2/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.cxx b/PWG2/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.cxx index 52bc92e799b..e2c10ad5399 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.cxx @@ -1,4 +1,7 @@ - +// +// Calibration/Correction object that stores the secondary to primary +// correction used in the FMD analysis. +// #include "AliFMDAnaCalibBackgroundCorrection.h" #include #include @@ -10,22 +13,25 @@ ClassImp(AliFMDAnaCalibBackgroundCorrection) #endif //____________________________________________________________________ -AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection() : TObject(), - fArray(), - fAxis(), - fIsInit(kFALSE), - fListOfDoubleHitCorrection(), - fListOfNSDBgMaps() +AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection() + : TObject(), + fArray(), + fAxis(), + fIsInit(kFALSE), + fListOfDoubleHitCorrection(), + fListOfNSDBgMaps() { - - - } //____________________________________________________________________ AliFMDAnaCalibBackgroundCorrection::AliFMDAnaCalibBackgroundCorrection(const AliFMDAnaCalibBackgroundCorrection& o) - : TObject(o), fArray(o.fArray), fAxis(o.fAxis), fIsInit(o.fIsInit), fListOfDoubleHitCorrection(), fListOfNSDBgMaps() + : TObject(o), + fArray(o.fArray), + fAxis(o.fAxis), + fIsInit(o.fIsInit), + fListOfDoubleHitCorrection(), + fListOfNSDBgMaps() { // Copy ctor } @@ -41,97 +47,126 @@ AliFMDAnaCalibBackgroundCorrection::operator=(const AliFMDAnaCalibBackgroundCorr } //____________________________________________________________________ -TH2F* AliFMDAnaCalibBackgroundCorrection::GetBgCorrection(Int_t det, - Char_t ring, - Int_t vtxbin) { +void +AliFMDAnaCalibBackgroundCorrection::SetBgCorrection(Int_t det, + Char_t ring, + Int_t vtxbin, + TH2F* hCorrection) +{ + if(!fIsInit) Init(); + TObjArray* ringArray = GetRingArray(det,ring); - TH2F* hCorrection = (TH2F*)ringArray->At(vtxbin); + if (!ringArray) return; + + ringArray->AddAtAndExpand(hCorrection,vtxbin); + +} +//____________________________________________________________________ +TH2F* +AliFMDAnaCalibBackgroundCorrection::GetBgCorrection(Int_t det, + Char_t ring, + Int_t vtxbin) const +{ + TObjArray* ringArray = GetRingArray(det,ring); + if (!ringArray) return 0; + + TH2F* hCorrection = static_cast(ringArray->At(vtxbin)); return hCorrection; } //____________________________________________________________________ -void AliFMDAnaCalibBackgroundCorrection::SetNSDBgCorrection(Int_t det, - Char_t ring, - Int_t vtxbin, - TH2F* hCorrection) { - if(!fIsInit) - Init(); +void +AliFMDAnaCalibBackgroundCorrection::SetNSDBgCorrection(Int_t det, + Char_t ring, + Int_t vtxbin, + TH2F* hCorrection) +{ + if(!fIsInit) Init(); hCorrection->SetName(Form("FMDNSD%d%c_vtxbin_%d_correction",det,ring,vtxbin)); fListOfNSDBgMaps.Add(hCorrection); } //____________________________________________________________________ -TH2F* AliFMDAnaCalibBackgroundCorrection::GetNSDBgCorrection(Int_t det, - Char_t ring, - Int_t vtxbin) { - TH2F* hCorrection = (TH2F*)fListOfNSDBgMaps.FindObject(Form("FMDNSD%d%c_vtxbin_%d_correction",det,ring,vtxbin)); +TH2F* +AliFMDAnaCalibBackgroundCorrection::GetNSDBgCorrection(Int_t det, + Char_t ring, + Int_t vtxbin) const +{ + TH2F* hCorrection = + static_cast(fListOfNSDBgMaps + .FindObject(Form("FMDNSD%d%c_vtxbin_%d_correction", + det,ring,vtxbin))); return hCorrection; } //____________________________________________________________________ -void AliFMDAnaCalibBackgroundCorrection::SetBgCorrection(Int_t det, - Char_t ring, - Int_t vtxbin, - TH2F* hCorrection) { - if(!fIsInit) - Init(); - - TObjArray* ringArray = GetRingArray(det,ring); - ringArray->AddAtAndExpand(hCorrection,vtxbin); - -} -//____________________________________________________________________ -TH1F* AliFMDAnaCalibBackgroundCorrection::GetDoubleHitCorrection(Int_t det, - Char_t ring) { - - - TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hDoubleHitCorrection_FMD%d%c",det,ring)); +TH1F* +AliFMDAnaCalibBackgroundCorrection::GetDoubleHitCorrection(Int_t det, + Char_t ring) const +{ + TH1F* hCorrection = + static_cast(fListOfDoubleHitCorrection + .FindObject(Form("hDoubleHitCorrection_FMD%d%c", + det,ring))); return hCorrection; } //____________________________________________________________________ -void AliFMDAnaCalibBackgroundCorrection::SetDoubleHitCorrection(Int_t det, - Char_t ring, - TH1F* hCorrection) { +void +AliFMDAnaCalibBackgroundCorrection::SetDoubleHitCorrection(Int_t det, + Char_t ring, + TH1F* hCorrection) +{ hCorrection->SetName(Form("hDoubleHitCorrection_FMD%d%c",det,ring)); fListOfDoubleHitCorrection.Add(hCorrection); } //____________________________________________________________________ -TH1F* AliFMDAnaCalibBackgroundCorrection::GetSPDDeadCorrection(Int_t vtxbin) { - - TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hSPDDeadCorrection_vtx%d",vtxbin)); +TH1F* +AliFMDAnaCalibBackgroundCorrection::GetSPDDeadCorrection(Int_t vtxbin) const +{ + TH1F* hCorrection = + static_cast(fListOfDoubleHitCorrection + .FindObject(Form("hSPDDeadCorrection_vtx%d",vtxbin))); return hCorrection; } //____________________________________________________________________ -void AliFMDAnaCalibBackgroundCorrection::SetSPDDeadCorrection(Int_t vtxbin, - TH1F* hCorrection) { +void +AliFMDAnaCalibBackgroundCorrection::SetSPDDeadCorrection(Int_t vtxbin, + TH1F* hCorrection) +{ hCorrection->SetName(Form("hSPDDeadCorrection_vtx%d",vtxbin)); fListOfDoubleHitCorrection.Add(hCorrection); } //____________________________________________________________________ -TH1F* AliFMDAnaCalibBackgroundCorrection::GetFMDDeadCorrection(Int_t vtxbin) { - - TH1F* hCorrection = (TH1F*)fListOfDoubleHitCorrection.FindObject(Form("hFMDDeadCorrection_vtx%d",vtxbin)); +TH1F* +AliFMDAnaCalibBackgroundCorrection::GetFMDDeadCorrection(Int_t vtxbin) +{ + TH1F* hCorrection = + static_cast(fListOfDoubleHitCorrection + .FindObject(Form("hFMDDeadCorrection_vtx%d",vtxbin))); return hCorrection; } //____________________________________________________________________ -void AliFMDAnaCalibBackgroundCorrection::SetFMDDeadCorrection(Int_t vtxbin, - TH1F* hCorrection) { +void +AliFMDAnaCalibBackgroundCorrection::SetFMDDeadCorrection(Int_t vtxbin, + TH1F* hCorrection) +{ hCorrection->SetName(Form("hFMDDeadCorrection_vtx%d",vtxbin)); fListOfDoubleHitCorrection.Add(hCorrection); } //____________________________________________________________________ -void AliFMDAnaCalibBackgroundCorrection::SetRefAxis(TAxis* axis) { - - +void +AliFMDAnaCalibBackgroundCorrection::SetRefAxis(TAxis* axis) +{ + // Set the reference axis fAxis.Set(axis->GetNbins(),axis->GetXmin(),axis->GetXmax()); - } //____________________________________________________________________ -void AliFMDAnaCalibBackgroundCorrection::Init() { - +void AliFMDAnaCalibBackgroundCorrection::Init() +{ + // Initialize fArray.SetOwner(); TObjArray* spdArray = new TObjArray(); @@ -141,11 +176,16 @@ void AliFMDAnaCalibBackgroundCorrection::Init() { for(Int_t det = 1; det<=3;det++) { TObjArray* detArray = new TObjArray(); detArray->SetOwner(); + detArray->SetName(Form("FMD%d", det)); + // detArray->SetTitle(Form("Array of FMD%d corrections", det)); fArray.AddAtAndExpand(detArray,det); Int_t nRings = (det == 1 ? 1 : 2); for(Int_t ring = 0;ringSetOwner(); + ringArray->SetName(Form("FMD%d%c", det, r)); + // ringArray->SetTitle(Form("Array of FMD%d%c corrections", det, r)); detArray->AddAtAndExpand(ringArray,ring); } @@ -155,35 +195,29 @@ void AliFMDAnaCalibBackgroundCorrection::Init() { } //____________________________________________________________________ TObjArray* AliFMDAnaCalibBackgroundCorrection::GetRingArray(Int_t det, - Char_t ring) { - + Char_t ring) const +{ + // Find array corresponding to det, ring. + // Note, 0 and 4 refers to the SPD arrays 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); + + if (det < 0 || det >= fArray.GetEntriesFast()) return 0; + + Int_t ringNumber = (ring == 'I' ? 0 : 1); + TObjArray* detArray = static_cast(fArray.At(det)); + TObjArray* ringArray = static_cast(detArray->At(ringNumber)); return ringArray; } -//____________________________________________________________________ -Int_t AliFMDAnaCalibBackgroundCorrection::GetNvtxBins() { - - return fAxis.GetNbins(); - -} -//____________________________________________________________________ -Float_t AliFMDAnaCalibBackgroundCorrection::GetVtxCutZ() { - - return fAxis.GetXmax(); - -} //____________________________________________________________________ void AliFMDAnaCalibBackgroundCorrection::Browse(TBrowser* b) { + // Browse b->Add(&fAxis, "Vertex bins"); b->Add(&fArray, "Array of histograms w/BG corrections"); } diff --git a/PWG2/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.h b/PWG2/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.h index 34c0a65d316..27b7edb064c 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.h +++ b/PWG2/FORWARD/analysis/AliFMDAnaCalibBackgroundCorrection.h @@ -12,43 +12,184 @@ class TBrowser; /** * @ingroup FMD_ana - * @brief Do the background correction + * @brief Object to store secondary corrections. + * + * Objects of this class contains 1 2D histogram per detector,ring + * per vertex bin. The histogram is an (eta,phi) histogram of the ratio + * of total number of particles (seconary+primary) to the number of + * primary particles. + * + * Objects of this class are generated by + * @todo expand documentation * */ class AliFMDAnaCalibBackgroundCorrection : public TObject { - - public: - +public: + /** + * Constructor + */ AliFMDAnaCalibBackgroundCorrection(); + /** + * Copy constructor + * + * @param o Object to copy from + */ AliFMDAnaCalibBackgroundCorrection(const AliFMDAnaCalibBackgroundCorrection& o); + /** + * Assignment operator + * + * @param o Object to assign from + * + * @return Reference to this object + */ AliFMDAnaCalibBackgroundCorrection& operator=(const AliFMDAnaCalibBackgroundCorrection& o); - TH2F* GetBgCorrection(Int_t det, Char_t ring, Int_t vtxbin); - void SetBgCorrection(Int_t det, Char_t ring, Int_t vtxbin, TH2F* hCorrection); - TH2F* GetNSDBgCorrection(Int_t det, Char_t ring, Int_t vtxbin); - void SetNSDBgCorrection(Int_t det, Char_t ring, Int_t vtxbin, TH2F* hCorrection); + /** + * Get the background (secondary) correction + * + * @param det Detector + * @param ring Ring + * @param vtxbin Vertex bin + * + * @return 2D Histogram (eta,phi) secondary correction map + */ + TH2F* GetBgCorrection(Int_t det, Char_t ring, Int_t vtxbin) const; + /** + * Set the background correction + * + * @param det Detector + * @param ring Ring + * @param vtxbin Vertex bin + * @param hCorrection 2D Histogram (eta,phi) secondary correction map + */ + void SetBgCorrection(Int_t det, Char_t ring, Int_t vtxbin, + TH2F* hCorrection); + /** + * Get the Non-single-diffractive secondary correction map + * + * @param det Detector + * @param ring Ring + * @param vtxbin Vertex bin + * + * @return 2D Histogram (eta,phi) secondary correction map + */ + TH2F* GetNSDBgCorrection(Int_t det, Char_t ring, Int_t vtxbin) const; + /** + * Set the Non-single-diffractive secondary correction map + * + * @param det Detector + * @param ring Ring + * @param vtxbin Vertex bin + * @param hCorrection 2D Histogram (eta,phi) secondary correction map + */ + void SetNSDBgCorrection(Int_t det, Char_t ring, Int_t vtxbin, + TH2F* hCorrection); - TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring); + /** + * Get the double hit correction + * + * @param det Detector + * @param ring Ring + * + * @return 1D histogram (eta) of correction + */ + TH1F* GetDoubleHitCorrection(Int_t det, Char_t ring) const; + /** + * Set the double hit correction + * + * @param det Detector + * @param ring Ring + * @param hCorrection 1D histogram (eta) of correction + */ void SetDoubleHitCorrection(Int_t det, Char_t ring, TH1F* hCorrection); - TH1F* GetSPDDeadCorrection(Int_t vtxbin); + /** + * Get the SPD dead correction + * + * @param vtxbin Vertext bin + * + * @return 1D Histogram (eta) of SPD dead correction + */ + TH1F* GetSPDDeadCorrection(Int_t vtxbin) const; + /** + * Set the SPD dead correction + * + * @param vtxbin Vertex bin + * @param hCorrection 1D Histogram (eta) of SPD dead correction + */ void SetSPDDeadCorrection(Int_t vtxbin, TH1F* hCorrection); + /** + * Get the FMD dead correction + * + * @param vtxbin Vertext bin + * + * @return 1D Histogram (eta) of FMD dead correction + */ TH1F* GetFMDDeadCorrection(Int_t vtxbin); + /** + * Set the FMD dead correction + * + * @param vtxbin Vertex bin + * @param hCorrection 1D Histogram (eta) of FMD dead correction + */ void SetFMDDeadCorrection(Int_t vtxbin, TH1F* hCorrection); + /** + * Set the reference axis + * + * @param axis Axis of vertex bins + */ void SetRefAxis(TAxis* axis); - Int_t GetNvtxBins(); - Float_t GetVtxCutZ(); + /** + * Get the vertex axis + * + * @return Constant reference to vertex axis + */ + const TAxis& GetRefAxis() const { return fAxis; } + /** + * Get the number of vertex bins + * + * @return Number of vertex bins + */ + Int_t GetNvtxBins() const { return fAxis.GetNbins(); } + /** + * Get the maximum vertex cut (in cm) + * + * @return Maximum absolute value of the Z position of the vertex + */ + Float_t GetVtxCutZ() const { return fAxis.GetXmax(); } + /** + * Initialize + * + */ void Init(); + /** + * Nice browsing + * + * + * @return + */ Bool_t IsFolder() const { return kTRUE; } + /** + * Nice browsing + * + * @param b Browser + */ void Browse(TBrowser* b); - protected: - - TObjArray* GetRingArray(Int_t det, Char_t ring); - TObjArray fArray; - TAxis fAxis; - Bool_t fIsInit; - TList fListOfDoubleHitCorrection; - TList fListOfNSDBgMaps; +protected: + /** + * Get the ring array + * + * @param det Detector + * @param ring Ring + * + * @return + */ + TObjArray* GetRingArray(Int_t det, Char_t ring) const; + TObjArray fArray; // Array + TAxis fAxis; // Vertex axis + Bool_t fIsInit; // Whether this has been init + TList fListOfDoubleHitCorrection; // Double hit corrections + TList fListOfNSDBgMaps; // NSD bg maps ClassDef(AliFMDAnaCalibBackgroundCorrection,3); }; diff --git a/PWG2/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx b/PWG2/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx index 82529bae435..36c12d86f62 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnaCalibEnergyDistribution.cxx @@ -1,4 +1,6 @@ - +// +// Object to store energy distribution corrections as used in the FMD +// analysis. #include "AliFMDAnaCalibEnergyDistribution.h" #include "TAxis.h" #include @@ -6,8 +8,13 @@ #include "TH2F.h" #include "AliFMDAnaParameters.h" ClassImp(AliFMDAnaCalibEnergyDistribution) +#if 0 +; // This is for Emacs +#endif -AliFMDAnaCalibEnergyDistribution::AliFMDAnaCalibEnergyDistribution() : TObject(), +//____________________________________________________________________ +AliFMDAnaCalibEnergyDistribution::AliFMDAnaCalibEnergyDistribution() +: TObject(), fArray(), fEmptyArray(), fRingArray(), @@ -15,12 +22,12 @@ AliFMDAnaCalibEnergyDistribution::AliFMDAnaCalibEnergyDistribution() : TObject() fNetaBins(0), fEtaMax(0), fEtaMin(0){ - + } //____________________________________________________________________ -void AliFMDAnaCalibEnergyDistribution::Init() { - +void AliFMDAnaCalibEnergyDistribution::Init() +{ if(fNetaBins == 0) AliFatal("Set Eta bins before doing Init or anything else"); @@ -33,9 +40,7 @@ void AliFMDAnaCalibEnergyDistribution::Init() { for(Int_t det = 1; det<=3;det++) { TObjArray* detArray = new TObjArray(); etaArray->AddAtAndExpand(detArray,det); - } - } @@ -56,24 +61,29 @@ void AliFMDAnaCalibEnergyDistribution::Init() { //____________________________________________________________________ -TH1F* AliFMDAnaCalibEnergyDistribution::GetEnergyDistribution(Int_t det, Char_t ring, Float_t eta) { +TH1F* +AliFMDAnaCalibEnergyDistribution::GetEnergyDistribution(Int_t det, + Char_t ring, + Float_t eta) { //TAxis testaxis(fNetaBins,fEtaMin,fEtaMax); // Int_t binnumber = testaxis.FindBin(eta); AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); - Int_t binnumber = pars->GetEtaBin(eta); + Int_t binnumber = pars->GetEtaBin(eta); - Int_t ringNumber = (ring == 'I' ? 0 : 1); - TObjArray* etaArray = (TObjArray*)fArray.At(binnumber); - TObjArray* detArray = (TObjArray*)etaArray->At(det); - TH1F* hEdist = (TH1F*)detArray->At(ringNumber); + Int_t ringNumber = (ring == 'I' ? 0 : 1); + TObjArray* etaArray = (TObjArray*)fArray.At(binnumber); + TObjArray* detArray = (TObjArray*)etaArray->At(det); + TH1F* hEdist = (TH1F*)detArray->At(ringNumber); return hEdist; } //____________________________________________________________________ -TH1F* AliFMDAnaCalibEnergyDistribution::GetEmptyEnergyDistribution(Int_t det, Char_t ring) { - +TH1F* +AliFMDAnaCalibEnergyDistribution::GetEmptyEnergyDistribution(Int_t det, + Char_t ring) +{ Int_t ringNumber = (ring == 'I' ? 0 : 1); TObjArray* detArray = (TObjArray*)fEmptyArray.At(det); @@ -82,7 +92,9 @@ TH1F* AliFMDAnaCalibEnergyDistribution::GetEmptyEnergyDistribution(Int_t det, Ch return hEdist; } //____________________________________________________________________ -TH1F* AliFMDAnaCalibEnergyDistribution::GetRingEnergyDistribution(Int_t det, Char_t ring) { +TH1F* +AliFMDAnaCalibEnergyDistribution::GetRingEnergyDistribution(Int_t det, + Char_t ring) { Int_t ringNumber = (ring == 'I' ? 0 : 1); @@ -92,30 +104,39 @@ TH1F* AliFMDAnaCalibEnergyDistribution::GetRingEnergyDistribution(Int_t det, Cha return hEdist; } //____________________________________________________________________ -void AliFMDAnaCalibEnergyDistribution::SetEnergyDistributionUser(Int_t det, Char_t ring, Float_t eta, TH1F* edist) { +void +AliFMDAnaCalibEnergyDistribution::SetEnergyDistributionUser(Int_t det, + Char_t ring, + Float_t eta, + TH1F* edist) +{ AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); Int_t binnumber = pars->GetEtaBin(eta); //std::cout<At(det); detArray->AddAtAndExpand(edist,ringNumber); - - } //____________________________________________________________________ -void AliFMDAnaCalibEnergyDistribution::SetEmptyEnergyDistribution(Int_t det, Char_t ring, TH1F* edist ) { - +void +AliFMDAnaCalibEnergyDistribution::SetEmptyEnergyDistribution(Int_t det, + Char_t ring, + TH1F* edist) +{ if(!fIsInit) Init(); @@ -127,17 +148,17 @@ void AliFMDAnaCalibEnergyDistribution::SetEmptyEnergyDistribution(Int_t det, Cha } //____________________________________________________________________ -void AliFMDAnaCalibEnergyDistribution::SetRingEnergyDistribution(Int_t det, Char_t ring, TH1F* edist ) { +void AliFMDAnaCalibEnergyDistribution::SetRingEnergyDistribution(Int_t det, + Char_t ring, + TH1F* edist) +{ - if(!fIsInit) - Init(); + if(!fIsInit) Init(); Int_t ringNumber = (ring == 'I' ? 0 : 1); TObjArray* detArray = (TObjArray*)fRingArray.At(det); detArray->AddAtAndExpand(edist,ringNumber); - - } //____________________________________________________________________ // diff --git a/PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx b/PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx index bbc34137573..a3c6a6723bc 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx @@ -469,7 +469,9 @@ Float_t AliFMDAnaParameters::GetConstant(Int_t det, Char_t ring, Float_t eta) { return mpv; } //____________________________________________________________________ -Float_t AliFMDAnaParameters::Get2MIPWeight(Int_t det, Char_t ring, Float_t eta) { +Float_t +AliFMDAnaParameters::Get2MIPWeight(Int_t det, Char_t ring, Float_t eta) +{ //Get 2 MIP weights of convoluted Landau fits if(!fIsInit) { AliWarning("Not initialized yet. Call Init() to remedy"); @@ -489,7 +491,9 @@ Float_t AliFMDAnaParameters::Get2MIPWeight(Int_t det, Char_t ring, Float_t eta) return twoMIPweight; } //____________________________________________________________________ -Float_t AliFMDAnaParameters::Get3MIPWeight(Int_t det, Char_t ring, Float_t eta) { +Float_t +AliFMDAnaParameters::Get3MIPWeight(Int_t det, Char_t ring, Float_t eta) +{ //Get 3 MIP weights of convoluted Landau fits if(!fIsInit) { AliWarning("Not initialized yet. Call Init() to remedy"); @@ -512,29 +516,27 @@ Float_t AliFMDAnaParameters::Get3MIPWeight(Int_t det, Char_t ring, Float_t eta) return threeMIPweight; } //____________________________________________________________________ -Int_t AliFMDAnaParameters::GetNetaBins() { - return GetBackgroundCorrection(1,'I',5)->GetNbinsX(); - +Int_t AliFMDAnaParameters::GetNetaBins() +{ + return GetBackgroundCorrection(1,'I',5)->GetNbinsX(); } //____________________________________________________________________ -Float_t AliFMDAnaParameters::GetEtaMin() { - +Float_t AliFMDAnaParameters::GetEtaMin() +{ return GetBackgroundCorrection(1,'I',5)->GetXaxis()->GetXmin(); } //____________________________________________________________________ -Float_t AliFMDAnaParameters::GetEtaMax() { - -return GetBackgroundCorrection(1,'I',5)->GetXaxis()->GetXmax(); - +Float_t AliFMDAnaParameters::GetEtaMax() +{ + return GetBackgroundCorrection(1,'I',5)->GetXaxis()->GetXmax(); } //____________________________________________________________________ -Int_t AliFMDAnaParameters::GetEtaBin(Float_t eta) { - +Int_t AliFMDAnaParameters::GetEtaBin(Float_t eta) +{ TAxis testaxis(GetNetaBins(),GetEtaMin(),GetEtaMax()); Int_t binnumber = testaxis.FindBin(eta) ; return binnumber; - } //____________________________________________________________________ @@ -783,11 +785,11 @@ Float_t AliFMDAnaParameters::GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t Bool_t AliFMDAnaParameters::GetVertex(const AliESDEvent* esd, Double_t* vertexXYZ) { //Get the vertex from the ESD - const AliESDVertex* vertex = 0; - vertex = esd->GetPrimaryVertexSPD(); + const AliESDVertex* vertex = esd->GetPrimaryVertexSPD(); - if(vertex) - vertex->GetXYZ(vertexXYZ); + if (!vertex) return kFALSE; + + vertex->GetXYZ(vertexXYZ); //if(vertexXYZ[0] == 0 || vertexXYZ[1] == 0 ) // return kFALSE; diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.cxx b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.cxx index ec2a5b20839..4c32d2a13af 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.cxx @@ -452,16 +452,16 @@ void AliFMDAnalysisTaskBFCorrelation::ProjectAndMirror(TString sType) { // Retrieve the histograms to store the Singe Event information and reset - TH1D *hSEMult = dynamic_cast(fInternalList->FindObject(Form("%s%d", sMult.Data(), i))); + TH1D *hSEMult = static_cast(fInternalList->FindObject(Form("%s%d", sMult.Data(), i))); hSEMult->Reset(); - TH1D *hSEMultMirror = dynamic_cast(fInternalList->FindObject(Form("%s%d", sMultMirror.Data(), i))); + TH1D *hSEMultMirror = static_cast(fInternalList->FindObject(Form("%s%d", sMultMirror.Data(), i))); hSEMultMirror->Reset(); - TH1D *hSEMultW = dynamic_cast(fInternalList->FindObject(Form("%s%d", sMultW.Data(), i))); + TH1D *hSEMultW = static_cast(fInternalList->FindObject(Form("%s%d", sMultW.Data(), i))); hSEMultW->Reset(); - TH1D *hSEMultMirrorW = dynamic_cast(fInternalList->FindObject(Form("%s%d", sMultMirrorW.Data(), i))); + TH1D *hSEMultMirrorW = static_cast(fInternalList->FindObject(Form("%s%d", sMultMirrorW.Data(), i))); hSEMultMirrorW->Reset(); // Fill the histograms with the Single Event information @@ -666,10 +666,13 @@ void AliFMDAnalysisTaskBFCorrelation::Terminate(Option_t */*option*/) { //_____________________________________________________________________ void AliFMDAnalysisTaskBFCorrelation::ProcessPrimary() { - AliMCEventHandler* eventHandler = dynamic_cast (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); + AliMCEventHandler* eventHandler = + dynamic_cast (AliAnalysisManager::GetAnalysisManager() + ->GetMCtruthEventHandler()); + if (!eventHandler) return; + AliMCEvent* mcEvent = eventHandler->MCEvent(); - if(!mcEvent) - return; + if(!mcEvent) return; AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.h b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.h index 5f201aa547d..32589be3305 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.h +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBFCorrelation.h @@ -16,33 +16,72 @@ #include "TCanvas.h" /** + * Task to do the backward/forward correlation analysis + * + * Input: + * List of histograms from AliFMDAnaysisTaskBackground + * + * Output: + * List of histograms of ... + * + * Used correction objects: + * + * * @ingroup FMD_ana */ class AliFMDAnalysisTaskBFCorrelation : public AliAnalysisTask { - public: +public: + /** + * Constructor + * + * + */ AliFMDAnalysisTaskBFCorrelation(); + /** + * Constructor + * + * @param name Name of task + * @param SE Whether we're run from SE task + */ AliFMDAnalysisTaskBFCorrelation(const char* name, Bool_t SE = kTRUE); - virtual ~AliFMDAnalysisTaskBFCorrelation() {;} + /** + * Destructor + */ + virtual ~AliFMDAnalysisTaskBFCorrelation() {;} + /** + * Copy constructor + * + * @param o Object to copy from + */ AliFMDAnalysisTaskBFCorrelation(const AliFMDAnalysisTaskBFCorrelation& o) - : AliAnalysisTask(), - fDebug(o.fDebug), - fOutputList(0), - fInputList(0), - fInternalList(0), - fVertexString(o.fVertexString), - fStandalone(o.fStandalone), - fEvent(0), - fnBinsX(0), - fXmin(0), - fXmax(0), - fnBinsY(0), - fYmin(0), - fYmax(0) + : AliAnalysisTask(), + fDebug(o.fDebug), + fOutputList(0), + fInputList(0), + fInternalList(0), + fVertexString(o.fVertexString), + fStandalone(o.fStandalone), + fEvent(0), + fnBinsX(0), + fXmin(0), + fXmax(0), + fnBinsY(0), + fYmin(0), + fYmax(0) {} - - AliFMDAnalysisTaskBFCorrelation& operator=(const AliFMDAnalysisTaskBFCorrelation&) { return *this; } - // Implementation of interface methods + /** + * Assignment operator + * + * + * @return Reference to this. + */ + AliFMDAnalysisTaskBFCorrelation& + operator=(const AliFMDAnalysisTaskBFCorrelation&) { return *this; } + /** + * @{ + * @name Implementation of interface methods + */ virtual void ConnectInputData(Option_t *option = ""); virtual void CreateOutputObjects(); virtual void Init() {} @@ -50,36 +89,80 @@ class AliFMDAnalysisTaskBFCorrelation : public AliAnalysisTask virtual void Exec(Option_t *option); virtual void Terminate(Option_t *option); virtual void SetDebugLevel(Int_t level) {fDebug = level;} + /** + * @} + */ + /** + * Set the input list of histograms + * + * @param inputList Input list + */ void SetInputList(TList* inputList) {fInputList = inputList;} + /** + * Set the input vertex + * + * @param vtxString String + */ void SetInputVertex(TObjString* vtxString) {fVertexString = vtxString;} + /** + * Set the output list + * + * @param outputList Output list + */ void SetOutputList(TList* outputList) {fOutputList = outputList;} + /** + * Project the data, and mirror it. + * + * @param sType + */ void ProjectAndMirror(TString sType); + /** + * Calculate values + * + * @param sType + */ void CalculateValues(TString sType); // void ProjectAndMirror(TString type); // void CalculateParameters(TString type); + /** + * The multiplicity versus eta + * + * @param type + */ void MultiplicityVsEta(TString type); + /** + * Create the response matrix + * + */ void CreateResponseMatrix(); - + /** + * Process a primary hit + * + */ void ProcessPrimary(); - + /** + * Get the list out out objects + * + * + * @return + */ TList* GetOutputList() {return fOutputList;} - - private: +private: Int_t fDebug; // Debug flag - TList* fOutputList; - TList* fInputList; - TList* fInternalList; - TObjString* fVertexString; - Bool_t fStandalone; + TList* fOutputList; // output list + TList* fInputList; // Input list + TList* fInternalList; // Internal list + TObjString* fVertexString; // Vertex string + Bool_t fStandalone; // Running standalone? - Int_t fEvent; - Int_t fnBinsX; - Float_t fXmin; - Float_t fXmax; - Int_t fnBinsY; - Float_t fYmin; - Float_t fYmax; + Int_t fEvent; // Event number + Int_t fnBinsX; // Number of bins + Float_t fXmin; // Minimum + Float_t fXmax; // Maximum + Int_t fnBinsY; // Number of bins + Float_t fYmin; // Minumum + Float_t fYmax; // Maximum ClassDef(AliFMDAnalysisTaskBFCorrelation, 0); // Analysis task for FMD analysis }; diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx index 35b3528b5e5..ad2ef6c1b12 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskBackgroundCorrection.cxx @@ -303,7 +303,11 @@ void AliFMDAnalysisTaskBackgroundCorrection::Exec(Option_t */*option*/) TH2F* hSPDMultTrVtx = (TH2F*)fOutputList->FindObject(Form("multTrVtx_SPD_vtxbin%d",vtxbin)); TH2F* hSPDMultNSD = (TH2F*)fOutputList->FindObject(Form("multNSD_SPD_vtxbin%d",vtxbin)); - AliESDInputHandler* eventHandler = dynamic_cast (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); + AliESDInputHandler* eventHandler = + dynamic_cast (AliAnalysisManager::GetAnalysisManager() + ->GetInputEventHandler()); + if (!eventHandler) return; + AliESDEvent* esd = eventHandler->GetEvent(); const AliMultiplicity* spdmult = esd->GetMultiplicity(); diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx index e6cb5ff2cb7..ace54633f78 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskDndeta.cxx @@ -358,10 +358,13 @@ void AliFMDAnalysisTaskDndeta::Terminate(Option_t */*option*/) { //_____________________________________________________________________ void AliFMDAnalysisTaskDndeta::ProcessPrimary() { - AliMCEventHandler* eventHandler = dynamic_cast (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); + AliMCEventHandler* eventHandler = + dynamic_cast (AliAnalysisManager::GetAnalysisManager() + ->GetMCtruthEventHandler()); + if (!eventHandler) return; + AliMCEvent* mcEvent = eventHandler->MCEvent(); - if(!mcEvent) - return; + if(!mcEvent) return; fLastTrackByStrip.Reset(-1); diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx index bde27afb141..13328b3701f 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx @@ -27,6 +27,9 @@ #include "AliGenDPMjetEventHeader.h" ClassImp(AliFMDAnalysisTaskGenerateCorrection) +#if 0 +; // This is for emacs - do not delete +#endif //_____________________________________________________________________ AliFMDAnalysisTaskGenerateCorrection::AliFMDAnalysisTaskGenerateCorrection(): diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx index 3e67a6e72b0..77886e04198 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx @@ -63,7 +63,8 @@ AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing() DefineOutput(3, TList::Class()); } //_____________________________________________________________________ -AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name, Bool_t SE): +AliFMDAnalysisTaskSharing::AliFMDAnalysisTaskSharing(const char* name, + Bool_t SE): AliAnalysisTask(name, "AnalysisTaskFMD"), fDebug(0), fESD(0x0), @@ -93,18 +94,23 @@ Float_t AliFMDAnalysisTaskSharing::GetVtxEfficiencyFromData(){ TH1F* hEventsVtx = (TH1F*)fDiagList->FindObject("hEventsVtx"); TH1F* hEventsTr = (TH1F*)fDiagList->FindObject("hEventsTr"); - if(hEventsTr->GetEntries() != 0 && hEventsVtx->GetEntries() !=0 && hEventsTr->GetEntries() != hEventsVtx->GetEntries()) + if(hEventsTr->GetEntries() != 0 && + hEventsVtx->GetEntries() != 0 && + hEventsTr->GetEntries() != hEventsVtx->GetEntries()) return hEventsVtx->GetEntries() / hEventsTr->GetEntries(); else return -1; } //_____________________________________________________________________ -Float_t AliFMDAnalysisTaskSharing::GetNSDVtxEfficiencyFromData(){ +Float_t AliFMDAnalysisTaskSharing::GetNSDVtxEfficiencyFromData() +{ TH1F* hEventsNSDVtx = (TH1F*)fDiagList->FindObject("hEventsNSDVtx"); - TH1F* hEventsNSD = (TH1F*)fDiagList->FindObject("hEventsNSD"); + TH1F* hEventsNSD = (TH1F*)fDiagList->FindObject("hEventsNSD"); - if(hEventsNSD->GetEntries() != 0 && hEventsNSDVtx->GetEntries() !=0 && hEventsNSD->GetEntries() != hEventsNSDVtx->GetEntries()) + if(hEventsNSD->GetEntries() != 0 && + hEventsNSDVtx->GetEntries() != 0 && + hEventsNSD->GetEntries() != hEventsNSDVtx->GetEntries()) return hEventsNSDVtx->GetEntries() / hEventsNSD->GetEntries(); else return -1; @@ -127,11 +133,11 @@ void AliFMDAnalysisTaskSharing::CreateOutputObjects() fDiagList->SetName("Sharing diagnostics"); AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); - TH2F* hBg = pars->GetBackgroundCorrection(1, 'I', 0); - TH1F* hPrimary = new TH1F("hMultvsEtaNoCuts","hMultvsEtaNoCuts", - hBg->GetNbinsX(), - hBg->GetXaxis()->GetXmin(), - hBg->GetXaxis()->GetXmax()); + TH2F* hBg = pars->GetBackgroundCorrection(1, 'I', 0); + TH1F* hPrimary = new TH1F("hMultvsEtaNoCuts","hMultvsEtaNoCuts", + hBg->GetNbinsX(), + hBg->GetXaxis()->GetXmin(), + hBg->GetXaxis()->GetXmax()); hPrimary->Sumw2(); fDiagList->Add(hPrimary); @@ -144,7 +150,10 @@ void AliFMDAnalysisTaskSharing::CreateOutputObjects() TH1F* hXvtx = new TH1F("hXvtx","x vertex distribution",100,-2,2); TH1F* hYvtx = new TH1F("hYvtx","y vertex distribution",100,-2,2); - TH1F* hZvtx = new TH1F("hZvtx","z vertex distribution",4*pars->GetNvtxBins(),-4*pars->GetVtxCutZ(),4*pars->GetVtxCutZ()); + TH1F* hZvtx = new TH1F("hZvtx","z vertex distribution", + 4*pars->GetNvtxBins(), + -4*pars->GetVtxCutZ(), + +4*pars->GetVtxCutZ()); fDiagList->Add(hXvtx); fDiagList->Add(hYvtx); diff --git a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.h b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.h index 2b108513fbd..7468fffb168 100644 --- a/PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.h +++ b/PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.h @@ -17,17 +17,71 @@ class AliESDVertex; /** * Do the sharing correction. + * + * This is the task to do the FMD sharing or hit merging. + * It reads the input ESDFMD data and posts an ESDFMD object to + * the tasks that must be performed after this task ie. + * Density, BackgroundCorrection and Dndeta. + * + * Inputs: An AliESDFMD object + * + * Output: + * An AliESDFMD object, but with hits merged according to algorithm. + * + * Used correction objects: + * Energy distribution fits (MPV and width of 1st landau) + * Hard low cut on 'mult' of 0.3 + * + * Simplications: + * Remove all diagnostics histograms except a few. The histograms + * needed for subsequent use are the ones for the sharing correction - + * but only from MC data. + * + * Remove calculation vertex efficiency. This is best taken care of + * elsewhere. + * + * Open issues: + * The ESD signal is un-angle-corrected and the after merging, + * Re-angle-corrected. I think this is wrong and will cause a + * problem for the low-eta (low-theta) bins where the correction is + * largets. Essentially, a particle that traverses two strips at + * low theta will have a relatively large path through and will, + * all things equal, deposite more energy. The sharing filter may + * then not pick this hit as steming from the same particle, but + * but rather from 2 particles. This is especially true of the MPV + * and width of the 1st Landau is determined from a full + * detector/ring spectra. + * * @ingroup FMD_ana * * */ class AliFMDAnalysisTaskSharing : public AliAnalysisTask { - public: - AliFMDAnalysisTaskSharing(); - AliFMDAnalysisTaskSharing(const char* name, Bool_t SE = kTRUE); - virtual ~AliFMDAnalysisTaskSharing() {;} - AliFMDAnalysisTaskSharing(const AliFMDAnalysisTaskSharing& o) : AliAnalysisTask(), +public: + /** + * Constructor + */ + AliFMDAnalysisTaskSharing(); + /** + * Constrictor + * + * @param name Name of task + * @param SE Whether we're run from an SE task or not + */ + AliFMDAnalysisTaskSharing(const char* name, Bool_t SE = kTRUE); + /** + * Destructor + * + */ + virtual ~AliFMDAnalysisTaskSharing() {;} + /** + * Copy constructor + * + * @param o Object to copy from + */ + AliFMDAnalysisTaskSharing(const AliFMDAnalysisTaskSharing& o) + : AliAnalysisTask(), fDebug(o.fDebug), fESD(o.fESD), // fOutputESD(), @@ -40,50 +94,145 @@ class AliFMDAnalysisTaskSharing : public AliAnalysisTask fStatus(o.fStatus), fLastTrackByStrip(o.fLastTrackByStrip), fLastOrbit(o.fLastOrbit) {} - AliFMDAnalysisTaskSharing& operator=(const AliFMDAnalysisTaskSharing&) { return *this; } + /** + * Assignment operator + * + * @return Reference to this object + */ + AliFMDAnalysisTaskSharing& + operator=(const AliFMDAnalysisTaskSharing&) { return *this; } - // Implementation of interface methods - virtual void ConnectInputData(Option_t *option = ""); - virtual void CreateOutputObjects(); - virtual void Init() {} - virtual void LocalInit() {Init();} - virtual void Exec(Option_t */*option*/); - virtual void Terminate(Option_t* /* option*/); - virtual void SetDebugLevel(Int_t level) {fDebug = level;} - Float_t GetMultiplicityOfStrip(Float_t mult, Float_t eta, Float_t Eprev, Float_t Enext, UShort_t det, Char_t ring, UShort_t sec, UShort_t strip); - // void GetVertex(Double_t* vertexXYZ) ; - void SetFMDData(AliESDFMD* fmd) {foutputESDFMD = fmd;} - void SetOutputList(TList* outlist) {fDiagList = outlist;} - void SetVertex(AliESDVertex* vertex) {fEsdVertex = vertex;} - void SetInputESD(AliESDEvent* esd) {fESD = esd;} - Bool_t GetEventStatus() const {return fStatus;} - Float_t GetVtxEfficiencyFromData() ; - Float_t GetNSDVtxEfficiencyFromData() ; + /** + * @{ + * @name Implementation of interface methods + */ + virtual void ConnectInputData(Option_t *option = ""); + virtual void CreateOutputObjects(); + virtual void Init() {} + virtual void LocalInit() {Init();} + virtual void Exec(Option_t */*option*/); + virtual void Terminate(Option_t* /* option*/); + virtual void SetDebugLevel(Int_t level) {fDebug = level;} + /** + * @} + */ + /** + * Get the multiplicity of a strip + * + * @param mult Previous(?) multiplicty + * @param eta Pseudo rapidity of strip + * @param Eprev Previous energy deposition + * @param Enext Next energy deposition + * @param det Detector + * @param ring Ring + * @param sec Sector + * @param strip Strip + * + * @return + */ + Float_t GetMultiplicityOfStrip(Float_t mult, + Float_t eta, + Float_t Eprev, + Float_t Enext, + UShort_t det, + Char_t ring, + UShort_t sec, + UShort_t strip); + // void GetVertex(Double_t* vertexXYZ) ; + /** + * Set the Output data + * + * @param fmd Output data + */ + void SetFMDData(AliESDFMD* fmd) {foutputESDFMD = fmd;} + /** + * Set the output list + * + * @param outlist + */ + void SetOutputList(TList* outlist) {fDiagList = outlist;} + /** + * Set the vertex + * + * @param vertex + */ + void SetVertex(AliESDVertex* vertex) {fEsdVertex = vertex;} + /** + * Set the input data + * + * @param esd Input + */ + void SetInputESD(AliESDEvent* esd) {fESD = esd;} + /** + * Get status flag + * + * @return @c true on success + */ + Bool_t GetEventStatus() const {return fStatus;} + /** + * Get the vertex efficiency from data. This is calculated as + * + * @f[ + * e_{vtx} = \frac{# events with vertex}{# of events with trigger} + * @f] + * + * @return + */ + Float_t GetVtxEfficiencyFromData() ; + /** + * Get the vertex efficiency from the data for NSD triggers + * + * @return + */ + Float_t GetNSDVtxEfficiencyFromData() ; private: - Float_t Eta2Theta(Float_t eta) const ; - Double_t EtaFromStrip(UShort_t det, Char_t ring, UShort_t sector, UShort_t strip, Double_t zvtx); - void ProcessPrimary(); - - Int_t fDebug; // Debug flag - AliESDEvent* fESD; //! ESD - // AliESDEvent fOutputESD; - AliESDFMD* foutputESDFMD; // the output ESDFMD object - // Float_t fEnergy; - // Int_t fNstrips; - Bool_t fSharedThis; // was this strip shared? - Bool_t fSharedPrev; // was the previous strip shared? - TList* fDiagList; // list of diag histos - Bool_t fStandalone; // do we run standalone or in SE task - AliESDVertex* fEsdVertex; // vtx info from the ESD - Bool_t fStatus; // event status - AliFMDFloatMap fLastTrackByStrip; // the last track to hit this strip - UInt_t fLastOrbit; + /** + * Calculate eta from theta + * + * @param eta Input eta + * + * @return Theta corresponding to eta + */ + Float_t Eta2Theta(Float_t eta) const ; + /** + * Get the psuedo-rapidity of a strip + * + * @param det Detector + * @param ring Ring + * @param sector Sector + * @param strip Strip + * @param zvtx Vertex position along beam-axis + * + * @return Eta + */ + Double_t EtaFromStrip(UShort_t det, + Char_t ring, + UShort_t sector, + UShort_t strip, + Double_t zvtx); + /** + * Process a primary particle (MC only) + * + */ + void ProcessPrimary(); - ClassDef(AliFMDAnalysisTaskSharing, 0); // Analysis task for FMD analysis + Int_t fDebug; // Debug flag + AliESDEvent* fESD; //! ESD + AliESDFMD* foutputESDFMD; // the output ESDFMD object + Bool_t fSharedThis; // was this strip shared? + Bool_t fSharedPrev; // was the previous strip shared? + TList* fDiagList; // list of diag histos + Bool_t fStandalone; // do we run standalone or in SE task + AliESDVertex* fEsdVertex; // vtx info from the ESD + Bool_t fStatus; // event status + AliFMDFloatMap fLastTrackByStrip; // the last track to hit this strip + UInt_t fLastOrbit; + + ClassDef(AliFMDAnalysisTaskSharing, 0); // Analysis task for FMD analysis }; #endif // Local Variables: // mode: C++ -// End Variables; +// End Variables: diff --git a/PWG2/FORWARD/analysis/AliFMDDndeta.h b/PWG2/FORWARD/analysis/AliFMDDndeta.h index c27abac6d32..ba2f1dcec29 100644 --- a/PWG2/FORWARD/analysis/AliFMDDndeta.h +++ b/PWG2/FORWARD/analysis/AliFMDDndeta.h @@ -1,3 +1,4 @@ +// -*- mode: C++ -*- #ifndef ALIFMDDNDETA_H #define ALIFMDDNDETA_H @@ -9,57 +10,132 @@ class TH3F; class TProfile3D; class TProfile2D; class TH3D; -// -// This class creates dN/deta for the FMD from the analysis objects. -// The contents of this class should probably go into a task at some point -// - +/** + * This class creates dN/deta for the FMD from the analysis objects. + * The contents of this class should probably go into a task at some point + */ class AliFMDDndeta : public TObject { - public: + /** + * + * + */ AliFMDDndeta(); - AliFMDDndeta(const AliFMDDndeta& o) : - TObject(), - fList(0), - fMultList(), - fNbinsToCut(o.fNbinsToCut), - fVtxCut1(o.fVtxCut1), - fVtxCut2(o.fVtxCut2), - fIsInit(o.fIsInit), - fIsGenerated(), - fPrimEvents(o.fPrimEvents), - fEvents(o.fEvents), - fPrimdNdeta(fPrimdNdeta), - fDrawAll(kFALSE) - {} - + /** + * + * + * @param o + */ + AliFMDDndeta(const AliFMDDndeta& o) + : TObject(), + fList(0), + fMultList(), + fNbinsToCut(o.fNbinsToCut), + fVtxCut1(o.fVtxCut1), + fVtxCut2(o.fVtxCut2), + fIsInit(o.fIsInit), + fIsGenerated(), + fPrimEvents(o.fPrimEvents), + fEvents(o.fEvents), + fPrimdNdeta(fPrimdNdeta), + fDrawAll(kFALSE) + { + for (int i = 0; i < 5; i++) fAnalysisNames[i] = ""; + } + /** + * + * + * + * @return + */ AliFMDDndeta& operator=(const AliFMDDndeta& /*o*/) - { - // Assignment operator - - return (*this); - } - + { + // Assignment operator + return (*this); + } + /** + * Enumeration of analysis types + * + */ enum Analysis {kHits, kHitsTrVtx, kMult, kMultTrVtx, kMultNSD}; - - - + + /** + * Initialise + * + * @param filename + */ void Init(const Char_t* filename); + /** + * Initialise + * + * @param list + */ void Init(TList* list); + /** + * Generate the multiplicity for analysis type @a what + * + * @param what + */ void GenerateMult(Analysis what); - void DrawDndeta(Analysis what, Int_t rebin = 1, Bool_t realdata = kFALSE, TString filename = "none"); + /** + * Draw the result. + * + * @param what + * @param rebin + * @param realdata + * @param filename + */ + void DrawDndeta(Analysis what, + Int_t rebin = 1, + Bool_t realdata = kFALSE, + TString filename = "none"); + /** + * Set the number of bins to cut + * + * @param nbins + */ void SetNbinsToCut(Int_t nbins) {fNbinsToCut = nbins;} + /** + * Set the vertex cut + * + * @param vtxcut + */ void SetVtxCut1(Int_t vtxcut) {fVtxCut1 = vtxcut;} + /** + * Set the vertex cut + * + * @param vtxcut + */ void SetVtxCut2(Int_t vtxcut) {fVtxCut2 = vtxcut;} + /** + * Whether to draw all + * + * @param drawall + */ void SetDrawAll(Bool_t drawall) {fDrawAll = drawall;} + /** + * Create sharing efficiency from file + * + * @param filename + * @param store + */ void CreateSharingEfficiency(const Char_t* filename, Bool_t store = kFALSE); + /** + * Get the list of multiplicities for a given type of analysis. + * + * @param what + * + * @return + */ TList* GetMultList(Analysis what) {return fMultList[what];} private: void GenerateHits(Analysis what); void SetNames(Analysis what); - const char* GetAnalysisName(Analysis what, UShort_t det, Char_t ring, Int_t vtxbin); - const char* GetPrimName(Analysis what, UShort_t det, Char_t ring, Int_t vtxbin); + const char* GetAnalysisName(Analysis what, UShort_t det, + Char_t ring, Int_t vtxbin); + const char* GetPrimName(Analysis what, UShort_t det, + Char_t ring, Int_t vtxbin); void RebinHistogram(TH1F* hist, Int_t rebin); TList* fList; // A list of input histograms TList* fMultList[5]; // A list of mult histograms -- 2.43.0