+//
+// This class contains the secondary correction and the double hit
+// correction used in low-flux events.
+//
+//
#include "AliFMDCorrDoubleHit.h"
#include <TBrowser.h>
#include <TH1D.h>
AliFMDCorrDoubleHit::AliFMDCorrDoubleHit()
: fCorrections()
{
+ // Constructor
+ //
+ //
fCorrections.SetOwner(kTRUE);
fCorrections.SetName("doubleHit");
}
: TObject(o),
fCorrections(o.fCorrections)
{
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
}
//____________________________________________________________________
AliFMDCorrDoubleHit::~AliFMDCorrDoubleHit()
{
+ //
+ // Destructor
+ //
fCorrections.Clear();
}
//____________________________________________________________________
AliFMDCorrDoubleHit&
AliFMDCorrDoubleHit::operator=(const AliFMDCorrDoubleHit& o)
{
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
fCorrections = o.fCorrections;
return *this;
TH1D*
AliFMDCorrDoubleHit::GetCorrection(UShort_t d, Char_t r) const
{
+ //
+ // Get the double hit correction @f$ h_{r}(\eta)@f$
+ //
+ // Parameters:
+ // d Detector number
+ // r Ring identifier
+ //
+ // Return:
+ // @f$ h_{r}(\eta)@f$
+ //
Int_t idx = GetRingIndex(d, r);
if (idx < 0) return 0;
Int_t
AliFMDCorrDoubleHit::GetRingIndex(UShort_t d, Char_t r) const
{
+ //
+ // Get the index corresponding to the given ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Index (0 based) or negative in case of errors
+ //
+
switch (d) {
case 1: return 0;
case 2: return (r == 'I' || r == 'i' ? 1 : 2); break;
Bool_t
AliFMDCorrDoubleHit::SetCorrection(UShort_t d, Char_t r, TH1D* h)
{
+ //
+ // Set the double hit correction @f$ h_{r}(\eta)@f$. Note, that the
+ // object takes ownership of the passed pointer.
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // h @f$ h_{r}(\eta)@f$
+ //
+ // Return:
+ // true if operation succeeded
+ //
Int_t idx = GetRingIndex(d, r);
if (idx < 0) return kFALSE;
void
AliFMDCorrDoubleHit::Browse(TBrowser* b)
{
+ // BRowse this object
+ //
+ // Parameters:
+ // b Browser to use
b->Add(&fCorrections);
}
//____________________________________________________________________
void
AliFMDCorrDoubleHit::Print(Option_t* option) const
{
+ // Print this object
+ //
+ // Parameters:
+ // option Passed to TH2D::Print
std::cout << "Double hit correction" << std::endl;
fCorrections.Print(option);
}
// This class contains the secondary correction and the double hit
// correction used in low-flux events.
//
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRDOUBLEHIT_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRDOUBLEHIT_H
+#ifndef ALIFMDCORRDOUBLEHIT_H
+#define ALIFMDCORRDOUBLEHIT_H
#include <TObject.h>
#include <TObjArray.h>
class TH1D;
+// Object holding the Energy loss fit 'correction'
+//
+// These are generated from Monte-Carlo or real ESDs.
#include "AliFMDCorrELossFit.h"
#include "AliForwardUtil.h"
#include <TF1.h>
fDet(0),
fRing('\0'),
fBin(0)
-{}
+{
+ //
+ // Default constructor
+ //
+ //
+}
//____________________________________________________________________
AliFMDCorrELossFit::ELossFit::ELossFit(Int_t quality, const TF1& f)
: fN(f.GetNpar() > AliForwardUtil::ELossFitter::kN ?
fRing('\0'),
fBin(0)
{
+ //
+ // Construct from a function
+ //
+ // Parameters:
+ // quality Quality flag
+ // f Function
+ //
if (fN <= 0) return;
fA = new Double_t[fN];
fEA = new Double_t[fN];
fRing('\0'),
fBin(0)
{
+ //
+ // Constructor with full parameter set
+ //
+ // Parameters:
+ // quality Quality flag
+ // n @f$ N@f$ - Number of fitted peaks
+ // chi2 @f$ \chi^2 @f$
+ // nu @f$ \nu @f$ - number degrees of freedom
+ // c @f$ C@f$ - scale constant
+ // ec @f$ \delta C@f$ - error on @f$ C@f$
+ // delta @f$ \Delta@f$ - Most probable value
+ // edelta @f$ \delta\Delta@f$ - error on @f$\Delta@f$
+ // xi @f$ \xi@f$ - width
+ // exi @f$ \delta\xi@f$ - error on @f$\xi@f$
+ // sigma @f$ \sigma@f$ - Width of Gaussian
+ // esigma @f$ \delta\sigma@f$ - error on @f$\sigma@f$
+ // sigman @f$ \sigma_n@f$ - Noise width
+ // esigman @f$ \delta\sigma_n@f$ - error on @f$\sigma_n@f$
+ // a Array of @f$ N-1@f$ weights @f$ a_i@f$ for
+ // @f$ i=2,\ldots@f$
+ // ea Array of @f$ N-1@f$ error on the weights @f$ a_i@f$ for
+ // @f$ i=2,\ldots@f$
+ //
if (fN <= 0) return;
fA = new Double_t[fN];
fEA = new Double_t[fN];
fRing(o.fRing),
fBin(o.fBin)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
if (fN <= 0) return;
fA = new Double_t[fN];
fEA = new Double_t[fN];
AliFMDCorrELossFit::ELossFit&
AliFMDCorrELossFit::ELossFit::operator=(const ELossFit& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
fN = o.fN;
fNu = o.fNu;
fChi2 = o.fChi2;
Double_t leastWeight,
UShort_t maxN) const
{
+ //
+ // Find the maximum weight to use. The maximum weight is the
+ // largest i for which
+ //
+ // - @f$ i \leq \max{N}@f$
+ // - @f$ a_i > \min{a}@f$
+ // - @f$ \delta a_i/a_i > \delta_{max}@f$
+ //
+ // Parameters:
+ // maxRelError @f$ \min{a}@f$
+ // leastWeight @f$ \delta_{max}@f$
+ // maxN @f$ \max{N}@f$
+ //
+ // Return:
+ // The largest index @f$ i@f$ for which the above
+ // conditions hold. Will never return less than 1.
+ //
Int_t n = TMath::Min(maxN, UShort_t(fN-1));
Int_t m = 1;
// fN is one larger than we have data
AliFMDCorrELossFit::ELossFit::Evaluate(Double_t x,
UShort_t maxN) const
{
+ //
+ // Evaluate
+ // @f[
+ // f_N(x;\Delta,\xi,\sigma') =
+ // \sum_{i=1}^{n} a_i f(x;\Delta_i,\xi_i,\sigma_i')
+ // @f]
+ //
+ // (see AliForwardUtil::NLandauGaus) for the maximum @f$ N @f$
+ // that fulfills the requirements
+ //
+ // Parameters:
+ // x Where to evaluate
+ // maxN @f$ \max{N}@f$
+ //
+ // Return:
+ // @f$ f_N(x;\Delta,\xi,\sigma')@f$
+ //
return AliForwardUtil::NLandauGaus(x, fDelta, fXi, fSigma, fSigmaN,
TMath::Min(maxN, UShort_t(fN)), fA);
}
AliFMDCorrELossFit::ELossFit::EvaluateWeighted(Double_t x,
UShort_t maxN) const
{
+ //
+ // Evaluate
+ // @f[
+ // f_W(x;\Delta,\xi,\sigma') =
+ // \frac{\sum_{i=1}^{n} i a_i f_i(x;\Delta,\xi,\sigma')}{
+ // f_N(x;\Delta,\xi,\sigma')} =
+ // \frac{\sum_{i=1}^{n} i a_i f(x;\Delta_i,\xi_i,\sigma_i')}{
+ // \sum_{i=1}^{n} a_i f(x;\Delta_i,\xi_i,\sigma_i')}
+ // @f]
+ // where @f$ n@f$ fulfills the requirements (see FindMaxWeight).
+ //
+ // If the denominator is zero, then 1 is returned.
+ //
+ // See also AliForwardUtil::ILandauGaus and AliForwardUtil::NLandauGaus
+ // for more information on the evaluated functions.
+ //
+ // Parameters:
+ // x Where to evaluate
+ // maxN @f$ \max{N}@f$
+ //
+ // Return:
+ // @f$ f_W(x;\Delta,\xi,\sigma')@f$.
+ //
UShort_t n = TMath::Min(maxN, UShort_t(fN-1));
Double_t num = 0;
Double_t den = 0;
Int_t
AliFMDCorrELossFit::ELossFit::Compare(const TObject* o) const
{
+ //
+ // Compare to another ELossFit object.
+ //
+ // - +1, if this quality is better (larger) than other objects quality
+ // - -1, if this quality is worse (smaller) than other objects quality
+ // - +1, if this @f$|\chi^2/\nu-1|@f$ is smaller than the same for other
+ // - -1, if this @f$|\chi^2/\nu-1|@f$ is larger than the same for other
+ // - 0 otherwise
+ //
+ // Parameters:
+ // o Other object to compare to
+ //
const ELossFit* other = static_cast<const ELossFit*>(o);
if (this->fQuality < other->fQuality) return -1;
if (this->fQuality > other->fQuality) return +1;
void
AliFMDCorrELossFit::ELossFit::Print(Option_t*) const
{
+ //
+ // Information to standard output
+ //
+ // Parameters:
+ // option Not used
+ //
std::cout << GetName() << ":\n"
<< " chi^2/nu = " << fChi2 << "/" << fNu << " = "
<< (fNu == 0 ? 999 : fChi2 / fNu) << "\n"
const Char_t*
AliFMDCorrELossFit::ELossFit::GetName() const
{
+ //
+ // Get the name of this object
+ //
+ //
+ // Return:
+ //
+ //
return Form("FMD%d%c_etabin%03d", fDet, fRing, fBin);
}
void
AliFMDCorrELossFit::ELossFit::Browse(TBrowser* b)
{
- // Draw this one
+ //
+ // Browse this object
+ //
+ // Parameters:
+ // b Browser
+ //
Draw(b ? b->GetDrawOption() : "comp");
gPad->SetLogy();
gPad->Update();
void
AliFMDCorrELossFit::ELossFit::Draw(Option_t* option)
{
+ //
+ // Draw this fit
+ //
+ // Parameters:
+ // option Options
+ // - COMP Draw components too
+ //
TString opt(option);
opt.ToUpper();
bool comp = false;
Double_t maxRelError,
Double_t leastWeight)
{
+ //
+ // Calculate the quality
+ //
Int_t qual = 0;
if (fNu > 0 && fChi2 / fNu < maxChi2nu) qual += 4;;
if (CHECKPAR(fDelta, fEDelta, maxRelError)) qual++;
fEtaAxis(0,0,0),
fLowCut(0)
{
+ //
+ // Default constructor
+ //
fRings.SetOwner(kTRUE);
fEtaAxis.SetTitle("#eta");
fEtaAxis.SetName("etaAxis");
fEtaAxis(o.fEtaAxis.GetNbins(),o.fEtaAxis.GetXmin(),o.fEtaAxis.GetXmax()),
fLowCut(0)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
fEtaAxis.SetTitle("#eta");
fEtaAxis.SetName("etaAxis");
}
//____________________________________________________________________
AliFMDCorrELossFit::~AliFMDCorrELossFit()
{
+ //
+ // Destructor
+ //
fRings.Clear();
}
AliFMDCorrELossFit&
AliFMDCorrELossFit::operator=(const AliFMDCorrELossFit& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
fRings = o.fRings;
fLowCut = o.fLowCut;
SetEtaAxis(o.fEtaAxis.GetNbins(), o.fEtaAxis.GetXmin(), o.fEtaAxis.GetXmax());
Int_t
AliFMDCorrELossFit::FindEtaBin(Double_t eta) const
{
+ //
+ // Find the eta bin corresponding to the given eta
+ //
+ // Parameters:
+ // eta Eta value
+ //
+ // Return:
+ // Bin (in @f$[1,N_{bins}]@f$) corresponding to the given
+ // eta, or 0 if out of range.
+ //
if (fEtaAxis.GetXmin() == fEtaAxis.GetXmax() || fEtaAxis.GetNbins() == 0) {
AliWarning("No eta axis defined");
return -1;
Bool_t
AliFMDCorrELossFit::SetFit(UShort_t d, Char_t r, Int_t etaBin, ELossFit* fit)
{
+ //
+ // Set the fit parameters from a function
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // etaBin Eta (bin number, 1->nBins)
+ // f ELoss fit result - note, the object will take ownership
+ //
TObjArray* ringArray = GetOrMakeRingArray(d, r);
if (!ringArray) {
AliError(Form("Failed to make ring array for FMD%d%c", d, r));
Bool_t
AliFMDCorrELossFit::SetFit(UShort_t d, Char_t r, Double_t eta, ELossFit* fit)
{
+ //
+ // Set the fit parameters from a function
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // eta Eta
+ // f ELoss fit result - note, the object will take ownership
+ //
Int_t bin = FindEtaBin(eta);
if (bin <= 0) {
AliError(Form("eta=%f is out of range [%f,%f]",
Double_t sigman, Double_t esigman,
Double_t* a, Double_t* ea)
{
+ //
+ // Set the fit parameters from a function
+ //
+ // Parameters:
+ // d Detector number
+ // r Ring identifier
+ // eta Eta value
+ // quality Quality flag
+ // n @f$ N@f$ - Number of fitted peaks
+ // chi2 @f$ \chi^2 @f$
+ // nu @f$ \nu @f$ - number degrees of freedom
+ // c @f$ C@f$ - scale constant
+ // ec @f$ \delta C@f$ - error on @f$ C@f$
+ // delta @f$ \Delta@f$ - most probable value
+ // edelta @f$ \delta\Delta@f$ - error on @f$\Delta@f$
+ // xi @f$ \xi@f$ - Landau width
+ // exi @f$ \delta\xi@f$ - error on @f$\xi@f$
+ // sigma @f$ \sigma@f$ - Gaussian width
+ // esigma @f$ \delta\sigma@f$ - error on @f$\sigma@f$
+ // sigman @f$ \sigma_n@f$ - Noise width
+ // esigman @f$ \delta\sigma_n@f$ - error on @f$\sigma_n@f$
+ // a Array of @f$ N-1@f$ weights @f$ a_i@f$ for
+ // @f$ i=2,\ldots@f$
+ // ea Array of @f$ N-1@f$ errors on weights @f$ a_i@f$ for
+ // @f$ i=2,\ldots@f$
+ //
ELossFit* e = new ELossFit(quality, n,
chi2, nu,
c, ec,
AliFMDCorrELossFit::SetFit(UShort_t d, Char_t r, Double_t eta,
Int_t quality, const TF1& f)
{
+ //
+ // Set the fit parameters from a function
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // eta Eta
+ // quality Quality flag
+ // f Function from fit
+ //
ELossFit* e = new ELossFit(quality, f);
if (!SetFit(d, r, eta, e)) {
delete e;
AliFMDCorrELossFit::ELossFit*
AliFMDCorrELossFit::FindFit(UShort_t d, Char_t r, Int_t etabin) const
{
+ //
+ // Find the fit corresponding to the specified parameters
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // etabin Eta bin (1 based)
+ //
+ // Return:
+ // Fit parameters or null in case of problems
+ //
TObjArray* ringArray = GetRingArray(d, r);
if (!ringArray) {
AliError(Form("Failed to make ring array for FMD%d%c", d, r));
AliFMDCorrELossFit::ELossFit*
AliFMDCorrELossFit::FindFit(UShort_t d, Char_t r, Double_t eta) const
{
+ //
+ // Find the fit corresponding to the specified parameters
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // eta Eta value
+ //
+ // Return:
+ // Fit parameters or null in case of problems
+ //
Int_t etabin = FindEtaBin(eta);
return FindFit(d, r, etabin);
}
TObjArray*
AliFMDCorrELossFit::GetRingArray(UShort_t d, Char_t r) const
{
+ //
+ // Get the ring array corresponding to the specified ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Pointer to ring array, or null in case of problems
+ //
Int_t idx = -1;
switch (d) {
case 1: idx = 0; break;
TObjArray*
AliFMDCorrELossFit::GetOrMakeRingArray(UShort_t d, Char_t r)
{
+ //
+ // Get the ring array corresponding to the specified ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Pointer to ring array, or newly created container
+ //
Int_t idx = -1;
switch (d) {
case 1: idx = 0; break;
void
AliFMDCorrELossFit::Draw(Option_t* option)
{
+ //
+ // Draw this object
+ //
+ // Parameters:
+ // option Options. Possible values are
+ // - err Plot error bars
+ //
TString opt(Form("nostack %s", option));
opt.ToLower();
Bool_t rel = (opt.Contains("rel"));
void
AliFMDCorrELossFit::Browse(TBrowser* b)
{
+ //
+ // Browse this object
+ //
+ // Parameters:
+ // b
+ //
b->Add(&fRings);
b->Add(&fEtaAxis);
}
-#ifndef ALIROOT_PWG2_FORWARD_ALIFMDCORRELOSSFIT_H
-#define ALIROOT_PWG2_FORWARD_ALIFMDCORRELOSSFIT_H
+// Object holding the Energy loss fit 'correction'
+//
+// These are generated from Monte-Carlo or real ESDs.
+#ifndef ALIFMDCORRELOSSFIT_H
+#define ALIFMDCORRELOSSFIT_H
#include <TObject.h>
#include <TAxis.h>
#include <TObjArray.h>
+//
+// This class contains the secondary correction and the double hit
+// correction used in low-flux events.
+//
#include "AliFMDCorrMergingEfficiency.h"
#include <TBrowser.h>
#include <TH1D.h>
: fRingArray(),
fVertexAxis(0,0,0)
{
+ //
+ // Default constructor
+ //
fRingArray.SetOwner(kTRUE);
fRingArray.SetName("rings");
fVertexAxis.SetName("vtxAxis");
fVertexAxis(o.fVertexAxis.GetNbins(), o.fVertexAxis.GetXmin(),
o.fVertexAxis.GetXmax())
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
fVertexAxis.SetName("vtxAxis");
fVertexAxis.SetTitle("v_{z} [cm]");
}
//____________________________________________________________________
AliFMDCorrMergingEfficiency::~AliFMDCorrMergingEfficiency()
{
+ //
+ // Destructor
+ //
+ //
fRingArray.Clear();
}
//____________________________________________________________________
AliFMDCorrMergingEfficiency&
AliFMDCorrMergingEfficiency::operator=(const AliFMDCorrMergingEfficiency& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
fRingArray = o.fRingArray;
SetVertexAxis(o.fVertexAxis);
TH1D*
AliFMDCorrMergingEfficiency::GetCorrection(UShort_t d, Char_t r, Double_t v) const
{
+ //
+ // Get the secondary correction @f$ c_{r,v}@f$
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // v Primary interaction point @f$z@f$ coordinate
+ //
+ // Return:
+ // The correction @f$ c_{r,v}@f$
+ //
Int_t b = FindVertexBin(v);
if (b <= 0) return 0;
return GetCorrection(d, r, UShort_t(b));
TH1D*
AliFMDCorrMergingEfficiency::GetCorrection(UShort_t d, Char_t r, UShort_t b) const
{
+ //
+ // Get the secondary correction @f$ c_{r,v}@f$
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // b Bin corresponding to the primary interaction point
+ // @f$z@f$ coordinate (1 based)
+ //
+ // Return:
+ // The correction @f$ c_{r,v}@f$
+ //
TObjArray* ringArray = GetRingArray(d, r);
if (!ringArray) return 0;
Int_t
AliFMDCorrMergingEfficiency::FindVertexBin(Double_t v) const
{
+ //
+ // Find the vertex bin that corresponds to the passed vertex
+ //
+ // Parameters:
+ // vertex The interaction points @f$z@f$-coordinate
+ //
+ // Return:
+ // Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
+ // out of range
+ //
if (fVertexAxis.GetNbins() <= 0) {
AliWarning("No vertex array defined");
return 0;
Int_t
AliFMDCorrMergingEfficiency::GetRingIndex(UShort_t d, Char_t r) const
{
+ //
+ // Get the index corresponding to the given ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Index (0 based) or negative in case of errors
+ //
switch (d) {
case 1: return 0;
case 2: return (r == 'I' || r == 'i' ? 1 : 2); break;
TObjArray*
AliFMDCorrMergingEfficiency::GetRingArray(UShort_t d, Char_t r) const
{
+ //
+ // Get the ring array corresponding to the specified ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Pointer to ring array, or null in case of problems
+ //
Int_t idx = GetRingIndex(d,r);
if (idx < 0) return 0;
TObjArray*
AliFMDCorrMergingEfficiency::GetOrMakeRingArray(UShort_t d, Char_t r)
{
+ //
+ // Get the ring array corresponding to the specified ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Pointer to ring array, or newly created container
+ //
Int_t idx = GetRingIndex(d,r);
if (idx < 0) return 0;
AliFMDCorrMergingEfficiency::SetCorrection(UShort_t d, Char_t r,
UShort_t b, TH1D* h)
{
+ //
+ // Set the secondary map correction @f$ m_{r,v}(\eta)@f$
+ // Note, that the object takes ownership of the passed pointer.
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // b Bin corresponding to the primary interaction point
+ // @f$z@f$ coordinate (1 based)
+ // h @f$ m_{r,v}(\eta)@f$
+ //
+ // Return:
+ // true if operation succeeded
+ //
TObjArray* ringArray = GetOrMakeRingArray(d, r);
if (!ringArray) return false;
AliFMDCorrMergingEfficiency::SetCorrection(UShort_t d, Char_t r,
Double_t v, TH1D* h)
{
+ //
+ // Set the secondary map correction @f$ m_{r,v}(\eta)@f$.
+ // Note, that the object takes ownership of the passed pointer.
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // v Primary interaction point @f$z@f$ coordinate
+ // h @f$ m_{r,v}(\eta)@f$
+ //
+ // Return:
+ // true if operation succeeded
+ //
Int_t b = FindVertexBin(v);
if (b <= 0 || b > fVertexAxis.GetNbins()) {
AliWarning(Form("Vertex %+8.4f out of range [%+8.4f,%+8.4f]",
void
AliFMDCorrMergingEfficiency::Browse(TBrowser* b)
{
+ //
+ // Browse this object in the browser
+ //
+ // Parameters:
+ // b
+ //
b->Add(&fRingArray);
b->Add(&fVertexAxis);
}
void
AliFMDCorrMergingEfficiency::Print(Option_t* option) const
{
+ //
+ // Print this object
+ //
+ // Parameters:
+ // option
+ //
std::cout << "Merging efficiency correction" << std::endl;
fRingArray.Print(option);
fVertexAxis.Print(option);
// This class contains the secondary correction and the double hit
// correction used in low-flux events.
//
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRMERGINGEFFICIENCY_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRMERGINGEFFICIENCY_H
+#ifndef ALIFMDCORRMERGINGEFFICIENCY_H
+#define ALIFMDCORRMERGINGEFFICIENCY_H
#include <TObject.h>
#include <TObjArray.h>
#include <TAxis.h>
+//
+// This class contains the secondary correction and the double hit
+// correction used in low-flux events.
+//
#include "AliFMDCorrSecondaryMap.h"
#include <TBrowser.h>
#include <TH2D.h>
fVertexAxis(0,0,0),
fEtaAxis(0,0,0)
{
+ //
+ // Default constructor
+ //
fRingArray.SetOwner(kTRUE);
fRingArray.SetName("rings");
fVertexAxis.SetName("vertexAxis");
fEtaAxis(o.fEtaAxis.GetNbins(), o.fEtaAxis.GetXmin(),
o.fEtaAxis.GetXmax())
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
fVertexAxis.SetName("vertexAxis");
fVertexAxis.SetTitle("v_{z} [cm]");
fEtaAxis.SetName("etaAxis");
//____________________________________________________________________
AliFMDCorrSecondaryMap::~AliFMDCorrSecondaryMap()
{
+ //
+ // Destructor
+ //
+ //
fRingArray.Clear();
}
//____________________________________________________________________
AliFMDCorrSecondaryMap&
AliFMDCorrSecondaryMap::operator=(const AliFMDCorrSecondaryMap& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
fRingArray = o.fRingArray;
SetVertexAxis(o.fVertexAxis);
SetEtaAxis(o.fEtaAxis);
TH2D*
AliFMDCorrSecondaryMap::GetCorrection(UShort_t d, Char_t r, Double_t v) const
{
+ //
+ // Get the secondary correction @f$ c_{r,v}@f$
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // v Primary interaction point @f$z@f$ coordinate
+ //
+ // Return:
+ // The correction @f$ c_{r,v}@f$
+ //
Int_t b = FindVertexBin(v);
if (b <= 0) return 0;
return GetCorrection(d, r, UShort_t(b));
TH2D*
AliFMDCorrSecondaryMap::GetCorrection(UShort_t d, Char_t r, UShort_t b) const
{
+ //
+ // Get the secondary correction @f$ c_{r,v}@f$
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // b Bin corresponding to the primary interaction point
+ // @f$z@f$ coordinate (1 based)
+ //
+ // Return:
+ // The correction @f$ c_{r,v}@f$
+ //
TObjArray* ringArray = GetRingArray(d, r);
if (!ringArray) return 0;
Int_t
AliFMDCorrSecondaryMap::FindVertexBin(Double_t v) const
{
+ //
+ // Find the vertex bin that corresponds to the passed vertex
+ //
+ // Parameters:
+ // vertex The interaction points @f$z@f$-coordinate
+ //
+ // Return:
+ // Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
+ // out of range
+ //
if (fVertexAxis.GetNbins() <= 0) {
AliWarning("No vertex array defined");
return 0;
Int_t
AliFMDCorrSecondaryMap::GetRingIndex(UShort_t d, Char_t r) const
{
+ //
+ // Get the index corresponding to the given ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Index (0 based) or negative in case of errors
+ //
switch (d) {
case 1: return 0;
case 2: return (r == 'I' || r == 'i' ? 1 : 2); break;
TObjArray*
AliFMDCorrSecondaryMap::GetRingArray(UShort_t d, Char_t r) const
{
+ //
+ // Get the ring array corresponding to the specified ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Pointer to ring array, or null in case of problems
+ //
Int_t idx = GetRingIndex(d,r);
if (idx < 0) return 0;
TObjArray*
AliFMDCorrSecondaryMap::GetOrMakeRingArray(UShort_t d, Char_t r)
{
+ //
+ // Get the ring array corresponding to the specified ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Pointer to ring array, or newly created container
+ //
Int_t idx = GetRingIndex(d,r);
if (idx < 0) return 0;
AliFMDCorrSecondaryMap::SetCorrection(UShort_t d, Char_t r,
UShort_t b, TH2D* h)
{
+ //
+ // Set the secondary map correction @f$ c_{r,v}(\eta,\varphi)@f$
+ // Note, that the object takes ownership of the passed pointer.
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // b Bin corresponding to the primary interaction point
+ // @f$z@f$ coordinate (1 based)
+ // h @f$ c_{r,v}(\eta,\varphi)@f$
+ //
+ // Return:
+ // true if operation succeeded
+ //
TObjArray* ringArray = GetOrMakeRingArray(d, r);
if (!ringArray) return false;
AliFMDCorrSecondaryMap::SetCorrection(UShort_t d, Char_t r,
Double_t v, TH2D* h)
{
+ //
+ // Set the secondary map correction @f$ c_{r,v}(\eta,\varphi)@f$.
+ // Note, that the object takes ownership of the passed pointer.
+ //
+ // Parameters:
+ // d Detector number (1-3)
+ // r Ring identifier (I or O)
+ // v Primary interaction point @f$z@f$ coordinate
+ // h @f$ c_{r,v}(\eta,\varphi)@f$
+ //
+ // Return:
+ // true if operation succeeded
+ //
Int_t b = FindVertexBin(v);
if (b <= 0 || b > fVertexAxis.GetNbins()) {
AliWarning(Form("Vertex %+8.4f out of range [%+8.4f,%+8.4f]",
void
AliFMDCorrSecondaryMap::Browse(TBrowser* b)
{
+ //
+ // Browse this object in the browser
+ //
+ // Parameters:
+ // b
+ //
b->Add(&fRingArray);
b->Add(&fVertexAxis);
b->Add(&fEtaAxis);
void
AliFMDCorrSecondaryMap::Print(Option_t* option) const
{
+ //
+ // Print this object
+ //
+ // Parameters:
+ // option
+ //
std::cout << "Secondary correction map" << std::endl;
fRingArray.Print(option);
fVertexAxis.Print(option);
// This class contains the secondary correction and the double hit
// correction used in low-flux events.
//
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRSECONDARYMAP_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRSECONDARYMAP_H
+#ifndef ALIFMDCORRSECONDARYMAP_H
+#define ALIFMDCORRSECONDARYMAP_H
#include <TObject.h>
#include <TObjArray.h>
#include <TAxis.h>
+//
+// This class contains the secondary correction and the double hit
+// correction used in low-flux events.
+//
#include "AliFMDCorrVertexBias.h"
#include <TBrowser.h>
#include <TH2D.h>
: fVertexArray(),
fVertexAxis(0,0,0)
{
+ //
+ // Default constructor
+ //
fVertexArray.SetOwner(kTRUE);
fVertexArray.SetName("rings");
fVertexAxis.SetName("vtxAxis");
fVertexAxis(o.fVertexAxis.GetNbins(), o.fVertexAxis.GetXmin(),
o.fVertexAxis.GetXmax())
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
fVertexAxis.SetName("vtxAxis");
fVertexAxis.SetTitle("v_{z} [cm]");
}
//____________________________________________________________________
AliFMDCorrVertexBias::~AliFMDCorrVertexBias()
{
+ //
+ // Destructor
+ //
+ //
fVertexArray.Clear();
}
//____________________________________________________________________
AliFMDCorrVertexBias&
AliFMDCorrVertexBias::operator=(const AliFMDCorrVertexBias& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
fVertexArray = o.fVertexArray;
SetVertexAxis(o.fVertexAxis);
TH2D*
AliFMDCorrVertexBias::GetCorrection(Char_t r, Double_t v) const
{
+ //
+ // Get the vertex bias correction @f$ b_{v}@f$
+ //
+ // Parameters:
+ // r Ring type (I or O)
+ // v Primary interaction point @f$z@f$ coordinate
+ //
+ // Return:
+ // The correction @f$ b_{v}@f$
+ //
Int_t b = FindVertexBin(v);
if (b <= 0) return 0;
return GetCorrection(r, UShort_t(b));
TH2D*
AliFMDCorrVertexBias::GetCorrection(Char_t r, UShort_t b) const
{
+ //
+ // Get the vertex bias correction @f$ b_{v}@f$
+ //
+ // Parameters:
+ // r Ring type (I or O)
+ // b Bin corresponding to the primary interaction point
+ // @f$z@f$ coordinate (1 based)
+ //
+ // Return:
+ // The correction @f$ b_{v}@f$
+ //
TObjArray* vertexarray = GetVertexArray(b);
if (!vertexarray) return 0;
Int_t
AliFMDCorrVertexBias::FindVertexBin(Double_t v) const
{
+ //
+ // Find the vertex bin that corresponds to the passed vertex
+ //
+ // Parameters:
+ // vertex The interaction points @f$z@f$-coordinate
+ //
+ // Return:
+ // Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
+ // out of range
+ //
if (fVertexAxis.GetNbins() <= 0) {
AliWarning("No vertex array defined");
return 0;
TObjArray*
AliFMDCorrVertexBias::GetVertexArray(UShort_t v) const
{
+ //
+ // Get the vertex array corresponding to the specified ring
+ //
+ // Parameters:
+ // v vertex bin (1 based)
+ //
+ // Return:
+ // Pointer to vertex array, or null in case of problems
+ //
if (v <= 0 || v > fVertexAxis.GetNbins()) {
AliWarning(Form("vertex bin %d out of range [1,%d]",
v, fVertexAxis.GetNbins()));
TObjArray*
AliFMDCorrVertexBias::GetOrMakeVertexArray(UShort_t v)
{
+ //
+ // Get the vertex array corresponding to the specified ring
+ //
+ // Parameters:
+ // v vertex bin (1 based)
+ //
+ // Return:
+ // Pointer to vertex array, or newly created container
+ //
if (v <= 0 || v > fVertexAxis.GetNbins()) {
AliWarning(Form("vertex bin %d out of range [1,%d]",
v, fVertexAxis.GetNbins()));
Bool_t
AliFMDCorrVertexBias::SetCorrection(Char_t r, UShort_t b, TH2D* h)
{
+ //
+ // Set the vertex bias correction @f$ b_{v}(\eta,\varphi)@f$
+ // Note, that the object takes ownership of the passed pointer.
+ //
+ // Parameters:
+ // r Ring type (I or O)
+ // b Bin corresponding to the primary interaction point
+ // @f$z@f$ coordinate (1 based)
+ // h @f$ b_{v}(\eta,\varphi)@f$
+ //
+ // Return:
+ // true if operation succeeded
+ //
TObjArray* vertexarray = GetOrMakeVertexArray(b);
if (!vertexarray) return false;
Bool_t
AliFMDCorrVertexBias::SetCorrection(Char_t r, Double_t v, TH2D* h)
{
+ //
+ // Set the vertex bias correction @f$ b_{v}(\eta,\varphi)@f$.
+ // Note, that the object takes ownership of the passed pointer.
+ //
+ // Parameters:
+ // r Ring type (I or O)
+ // v Primary interaction point @f$z@f$ coordinate
+ // h @f$ b_{v}(\eta,\varphi)@f$
+ //
+ // Return:
+ // true if operation succeeded
+ //
Int_t b = FindVertexBin(v);
if (b <= 0 || b > fVertexAxis.GetNbins()) {
AliWarning(Form("Vertex %+8.4f out of range [%+8.4f,%+8.4f]",
void
AliFMDCorrVertexBias::Browse(TBrowser* b)
{
+ //
+ // Browse this object in the browser
+ //
+ // Parameters:
+ // b
+ //
b->Add(&fVertexArray);
b->Add(&fVertexAxis);
}
void
AliFMDCorrVertexBias::Print(Option_t* option) const
{
+ //
+ // Print this object
+ //
+ // Parameters:
+ // option
+ //
std::cout << "Vertex bias correction" << std::endl;
fVertexArray.Print(option);
fVertexAxis.Print(option);
// This class contains the secondary correction and the double hit
// correction used in low-flux events.
//
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRVERTEXBIAS_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS_ALIFMDCORRVERTEXBIAS_H
+#ifndef ALIFMDCORRVERTEXBIAS_H
+#define ALIFMDCORRVERTEXBIAS_H
#include <TObject.h>
#include <TObjArray.h>
#include <TAxis.h>
+//
+// This class calculates the exclusive charged particle density
+// in each for the 5 FMD rings.
+//
#include "AliFMDCorrections.h"
#include <AliESDFMD.h>
#include <TAxis.h>
: TNamed(),
fRingHistos(),
fDebug(0)
-{}
+{
+ // Constructor
+}
//____________________________________________________________________
AliFMDCorrections::AliFMDCorrections(const char* title)
fRingHistos(),
fDebug(0)
{
+ // Constructor
+ //
+ // Parameters:
+ // title Title
fRingHistos.SetName(GetName());
fRingHistos.Add(new RingHistos(1, 'I'));
fRingHistos.Add(new RingHistos(2, 'I'));
fRingHistos(),
fDebug(o.fDebug)
{
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
TIter next(&o.fRingHistos);
TObject* obj = 0;
while ((obj = next())) fRingHistos.Add(obj);
//____________________________________________________________________
AliFMDCorrections::~AliFMDCorrections()
{
+ // Destructor
+ //
+ //
fRingHistos.Delete();
}
AliFMDCorrections&
AliFMDCorrections::operator=(const AliFMDCorrections& o)
{
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
TNamed::operator=(o);
fDebug = o.fDebug;
AliFMDCorrections::RingHistos*
AliFMDCorrections::GetRingHistos(UShort_t d, Char_t r) const
{
+ //
+ // Get the ring histogram container
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Ring histogram container
+ //
Int_t idx = -1;
switch (d) {
case 1: idx = 0; break;
AliFMDCorrections::Correct(AliForwardUtil::Histos& hists,
UShort_t vtxbin)
{
+ //
+ // Do the calculations
+ // Parameters:
+ // hists Cache of histograms
+ // vtxBin Vertex bin
+ //
+ // Return:
+ // true on successs
+ //
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
UShort_t uvb = vtxbin;
void
AliFMDCorrections::ScaleHistograms(TList* dir, Int_t nEvents)
{
+ //
+ // Scale the histograms to the total number of events
+ // Parameters:
+ // dir Where the output is stored
+ // nEvents Number of events
+ //
if (nEvents <= 0) return;
TList* d = static_cast<TList*>(dir->FindObject(GetName()));
if (!d) return;
void
AliFMDCorrections::Print(Option_t* /* option */) const
{
+ //
+ // Print information
+ // Parameters:
+ // option Not used
+ //
char ind[gROOT->GetDirLevel()+1];
for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
ind[gROOT->GetDirLevel()] = '\0';
AliFMDCorrections::RingHistos::RingHistos()
: AliForwardUtil::RingHistos(),
fDensity(0)
-{}
+{
+ // Constructor
+ //
+ //
+}
//____________________________________________________________________
AliFMDCorrections::RingHistos::RingHistos(UShort_t d, Char_t r)
: AliForwardUtil::RingHistos(d,r),
fDensity(0)
{
+ //
+ // Constructor
+ // Parameters:
+ // d detector
+ // r ring
+ //
fDensity = new TH2D(Form("FMD%d%c_Primary_Density", d, r),
Form("in FMD%d%c", d, r),
200, -4, 6, (r == 'I' || r == 'i' ? 20 : 40),
AliFMDCorrections::RingHistos::RingHistos(const RingHistos& o)
: AliForwardUtil::RingHistos(o),
fDensity(o.fDensity)
-{}
+{
+ //
+ // Copy constructor
+ // Parameters:
+ // o Object to copy from
+ //
+}
//____________________________________________________________________
AliFMDCorrections::RingHistos&
AliFMDCorrections::RingHistos::operator=(const RingHistos& o)
{
+ //
+ // Assignment operator
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this
+ //
AliForwardUtil::RingHistos::operator=(o);
if (fDensity) delete fDensity;
//____________________________________________________________________
AliFMDCorrections::RingHistos::~RingHistos()
{
+ //
+ // Destructor
+ //
if (fDensity) delete fDensity;
}
void
AliFMDCorrections::RingHistos::Output(TList* dir)
{
+ //
+ // Make output
+ // Parameters:
+ // dir Where to put it
+ //
TList* d = DefineOutputList(dir);
d->Add(fDensity);
}
void
AliFMDCorrections::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents)
{
+ //
+ // Scale the histograms to the total number of events
+ // Parameters:
+ // dir where the output is stored
+ // nEvents Number of events
+ //
TList* l = GetOutputList(dir);
if (!l) return;
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDCORRECTIONS_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDCORRECTIONS_H
+// This class calculates the exclusive charged particle density
+// in each for the 5 FMD rings.
+//
+#ifndef ALIFMDCORRECTIONS_H
+#define ALIFMDCORRECTIONS_H
#include <TNamed.h>
#include <TList.h>
#include "AliForwardUtil.h"
+// This class calculates the inclusive charged particle density
+// in each for the 5 FMD rings.
+//
#include "AliFMDDensityCalculator.h"
#include <AliESDFMD.h>
#include <TAxis.h>
#include <TList.h>
#include <TMath.h>
#include "AliForwardCorrectionManager.h"
-// #include "AliFMDAnaParameters.h"
#include "AliLog.h"
#include <TH2D.h>
#include <TProfile.h>
fAccI(0),
fAccO(0),
fDebug(0)
-{}
+{
+ //
+ // Constructor
+ //
+}
//____________________________________________________________________
AliFMDDensityCalculator::AliFMDDensityCalculator(const char* title)
fAccO(0),
fDebug(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // name Name of object
+ //
fRingHistos.SetName(GetName());
fRingHistos.Add(new RingHistos(1, 'I'));
fRingHistos.Add(new RingHistos(2, 'I'));
fAccO(o.fAccO),
fDebug(o.fDebug)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
TIter next(&o.fRingHistos);
TObject* obj = 0;
while ((obj = next())) fRingHistos.Add(obj);
//____________________________________________________________________
AliFMDDensityCalculator::~AliFMDDensityCalculator()
{
+ //
+ // Destructor
+ //
fRingHistos.Delete();
}
AliFMDDensityCalculator&
AliFMDDensityCalculator::operator=(const AliFMDDensityCalculator& o)
{
+ //
+ // Assignement operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
TNamed::operator=(o);
fMultCut = o.fMultCut;
AliFMDDensityCalculator::RingHistos*
AliFMDDensityCalculator::GetRingHistos(UShort_t d, Char_t r) const
{
+ //
+ // Get the ring histogram container
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Ring histogram container
+ //
Int_t idx = -1;
switch (d) {
case 1: idx = 0; break;
Double_t
AliFMDDensityCalculator::GetMultCut() const
{
+ //
+ // Get the multiplicity cut. If the user has set fMultCut (via
+ // SetMultCut) then that value is used. If not, then the lower
+ // value of the fit range for the enery loss fits is returned.
+ //
+ // Return:
+ // Lower cut on multiplicity
+ //
if (fMultCut > 0) return fMultCut;
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
UShort_t vtxbin,
Bool_t lowFlux)
{
+ //
+ // Do the calculations
+ //
+ // Parameters:
+ // fmd AliESDFMD object (possibly) corrected for sharing
+ // hists Histogram cache
+ // vtxBin Vertex bin
+ // lowFlux Low flux flag.
+ //
+ // Return:
+ // true on successs
+ //
for (UShort_t d=1; d<=3; d++) {
UShort_t nr = (d == 1 ? 1 : 2);
for (UShort_t q=0; q<nr; q++) {
Float_t eta,
Bool_t lowFlux) const
{
+ //
+ // Get the number of particles corresponding to the signal mult
+ //
+ // Parameters:
+ // mult Signal
+ // d Detector
+ // r Ring
+ // s Sector
+ // t Strip (not used)
+ // v Vertex bin
+ // eta Pseudo-rapidity
+ // lowFlux Low-flux flag
+ //
+ // Return:
+ // The number of particles
+ //
if (mult <= GetMultCut()) return 0;
if (lowFlux) return 1;
- // AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
AliFMDCorrELossFit::ELossFit* fit = fcm.GetELossFit()->FindFit(d,r,eta);
if (!fit) {
Float_t eta,
Bool_t lowFlux) const
{
- // AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+ //
+ // Get the inverse correction factor. This consist of
+ //
+ // - acceptance correction (corners of sensors)
+ // - double hit correction (for low-flux events)
+ // - dead strip correction
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // s Sector
+ // t Strip (not used)
+ // v Vertex bin
+ // eta Pseudo-rapidity
+ // lowFlux Low-flux flag
+ //
+ // Return:
+ //
+ //
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
Float_t correction = AcceptanceCorrection(r,t);
if (lowFlux) {
- // TH1F* dblHitCor = pars->GetDoubleHitCorrection(d,r);
TH1D* dblHitCor = 0;
if (fcm.GetDoubleHit())
dblHitCor = fcm.GetDoubleHit()->GetCorrection(d,r);
TH1D*
AliFMDDensityCalculator::GenerateAcceptanceCorrection(Char_t r) const
{
+ //
+ // Generate the acceptance corrections
+ //
+ // Parameters:
+ // r Ring to generate for
+ //
+ // Return:
+ // Newly allocated histogram of acceptance corrections
+ //
const Double_t ic1[] = { 4.9895, 15.3560 };
const Double_t ic2[] = { 1.8007, 17.2000 };
const Double_t oc1[] = { 4.2231, 26.6638 };
Float_t
AliFMDDensityCalculator::AcceptanceCorrection(Char_t r, UShort_t t) const
{
+ //
+ // Get the acceptance correction for strip @a t in an ring of type @a r
+ //
+ // Parameters:
+ // r Ring type ('I' or 'O')
+ // t Strip number
+ //
+ // Return:
+ // Inverse acceptance correction
+ //
TH1D* acc = (r == 'I' || r == 'i' ? fAccI : fAccO);
return acc->GetBinContent(t+1);
void
AliFMDDensityCalculator::ScaleHistograms(TList* dir, Int_t nEvents)
{
+ //
+ // Scale the histograms to the total number of events
+ //
+ // Parameters:
+ // dir where to put the output
+ // nEvents Number of events
+ //
if (nEvents <= 0) return;
TList* d = static_cast<TList*>(dir->FindObject(GetName()));
if (!d) return;
void
AliFMDDensityCalculator::DefineOutput(TList* dir)
{
+ //
+ // Output diagnostic histograms to directory
+ //
+ // Parameters:
+ // dir List to write in
+ //
TList* d = new TList;
d->SetName(GetName());
dir->Add(d);
void
AliFMDDensityCalculator::Print(Option_t*) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
char ind[gROOT->GetDirLevel()+1];
for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
ind[gROOT->GetDirLevel()] = '\0';
fEtaVsM(0),
fCorr(0),
fDensity(0)
-{}
+{
+ //
+ // Default CTOR
+ //
+}
//____________________________________________________________________
AliFMDDensityCalculator::RingHistos::RingHistos(UShort_t d, Char_t r)
fCorr(0),
fDensity(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // d detector
+ // r ring
+ //
fEvsN = new TH2D(Form("%s_Eloss_N_nocorr", fName.Data()),
Form("#Delta E/#Delta E_{mip} vs uncorrected inclusive "
"N_{ch} in %s", fName.Data()),
fEtaVsM(o.fEtaVsM),
fCorr(o.fCorr),
fDensity(o.fDensity)
-{}
+{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
+}
//____________________________________________________________________
AliFMDDensityCalculator::RingHistos&
AliFMDDensityCalculator::RingHistos::operator=(const RingHistos& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this
+ //
AliForwardUtil::RingHistos::operator=(o);
if (fEvsN) delete fEvsN;
//____________________________________________________________________
AliFMDDensityCalculator::RingHistos::~RingHistos()
{
+ //
+ // Destructor
+ //
if (fEvsN) delete fEvsN;
if (fEvsM) delete fEvsM;
if (fEtaVsN) delete fEtaVsN;
void
AliFMDDensityCalculator::RingHistos::Output(TList* dir)
{
+ //
+ // Make output
+ //
+ // Parameters:
+ // dir Where to put it
+ //
TList* d = DefineOutputList(dir);
d->Add(fEvsN);
d->Add(fEvsM);
void
AliFMDDensityCalculator::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents)
{
+ //
+ // Scale the histograms to the total number of events
+ //
+ // Parameters:
+ // dir Where the output is
+ // nEvents Number of events
+ //
TList* l = GetOutputList(dir);
if (!l) return;
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDDENSITYCALCULATOR_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDDENSITYCALCULATOR_H
+// This class calculates the inclusive charged particle density
+// in each for the 5 FMD rings.
+//
+#ifndef ALIFMDDENSITYCALCULATOR_H
+#define ALIFMDDENSITYCALCULATOR_H
#include <TNamed.h>
#include <TList.h>
#include "AliForwardUtil.h"
fMaxChi2PerNDF(20),
fMinWeight(1e-7),
fDebug(0)
-{}
+{
+ //
+ // Default Constructor - do not use
+ //
+}
//____________________________________________________________________
AliFMDEnergyFitter::AliFMDEnergyFitter(const char* title)
fMinWeight(1e-7),
fDebug(3)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // title Title of object - not significant
+ //
fEtaAxis.SetName("etaAxis");
fEtaAxis.SetTitle("#eta");
fRingHistos.Add(new RingHistos(1, 'I'));
fMinWeight(o.fMinWeight),
fDebug(o.fDebug)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
TIter next(&o.fRingHistos);
TObject* obj = 0;
while ((obj = next())) fRingHistos.Add(obj);
//____________________________________________________________________
AliFMDEnergyFitter::~AliFMDEnergyFitter()
{
+ //
+ // Destructor
+ //
fRingHistos.Delete();
}
AliFMDEnergyFitter&
AliFMDEnergyFitter::operator=(const AliFMDEnergyFitter& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this
+ //
TNamed::operator=(o);
fLowCut = o.fLowCut;
AliFMDEnergyFitter::RingHistos*
AliFMDEnergyFitter::GetRingHistos(UShort_t d, Char_t r) const
{
+ //
+ // Get the ring histogram container
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Ring histogram container
+ //
Int_t idx = -1;
switch (d) {
case 1: idx = 0; break;
void
AliFMDEnergyFitter::Init(const TAxis& eAxis)
{
+ //
+ // Initialise the task
+ //
+ // Parameters:
+ // etaAxis The eta axis to use. Note, that if the eta axis
+ // has already been set (using SetEtaAxis), then this parameter will be
+ // ignored
+ //
if (fEtaAxis.GetNbins() == 0 ||
TMath::Abs(fEtaAxis.GetXmax() - fEtaAxis.GetXmin()) < 1e-7)
SetEtaAxis(eAxis);
void
AliFMDEnergyFitter::SetEtaAxis(const TAxis& eAxis)
{
+ //
+ // Set the eta axis to use. This will force the code to use this
+ // eta axis definition - irrespective of whatever axis is passed to
+ // the Init member function. Therefore, this member function can be
+ // used to force another eta axis than one found in the correction
+ // objects.
+ //
+ // Parameters:
+ // etaAxis Eta axis to use
+ //
SetEtaAxis(eAxis.GetNbins(),eAxis.GetXmin(),eAxis.GetXmax());
}
//____________________________________________________________________
void
AliFMDEnergyFitter::SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax)
{
+ //
+ // Set the eta axis to use. This will force the code to use this
+ // eta axis definition - irrespective of whatever axis is passed to
+ // the Init member function. Therefore, this member function can be
+ // used to force another eta axis than one found in the correction
+ // objects.
+ //
+ // Parameters:
+ // nBins Number of bins
+ // etaMin Minimum of the eta axis
+ // etaMax Maximum of the eta axis
+ //
fEtaAxis.Set(nBins,etaMin,etaMax);
}
AliFMDEnergyFitter::Accumulate(const AliESDFMD& input,
Bool_t empty)
{
+ //
+ // Fitter the input AliESDFMD object
+ //
+ // Parameters:
+ // input Input
+ // empty Whether the event is 'empty'
+ //
+ // Return:
+ // True on success, false otherwise
+ //
for(UShort_t d = 1; d <= 3; d++) {
Int_t nRings = (d == 1 ? 1 : 2);
for (UShort_t q = 0; q < nRings; q++) {
void
AliFMDEnergyFitter::Fit(const TList* dir)
{
+ //
+ // Scale the histograms to the total number of events
+ //
+ // Parameters:
+ // dir Where the histograms are
+ //
if (!fDoFits) return;
TList* d = static_cast<TList*>(dir->FindObject(GetName()));
void
AliFMDEnergyFitter::MakeCorrectionsObject(TList* d)
{
+ //
+ // Generate the corrections object
+ //
+ // Parameters:
+ // dir List to analyse
+ //
AliForwardCorrectionManager& mgr = AliForwardCorrectionManager::Instance();
AliFMDCorrELossFit* obj = new AliFMDCorrELossFit;
void
AliFMDEnergyFitter::DefineOutput(TList* dir)
{
+ //
+ // Define the output histograms. These are put in a sub list of the
+ // passed list. The histograms are merged before the parent task calls
+ // AliAnalysisTaskSE::Terminate
+ //
+ // Parameters:
+ // dir Directory to add to
+ //
TList* d = new TList;
d->SetName(GetName());
dir->Add(d);
void
AliFMDEnergyFitter::SetDebug(Int_t dbg)
{
+ //
+ // Set the debug level. The higher the value the more output
+ //
+ // Parameters:
+ // dbg Debug level
+ //
fDebug = dbg;
TIter next(&fRingHistos);
RingHistos* o = 0;
void
AliFMDEnergyFitter::Print(Option_t*) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
char ind[gROOT->GetDirLevel()+1];
for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
ind[gROOT->GetDirLevel()] = '\0';
fList(0),
fFits("AliFMDCorrELossFit::ELossFit"),
fDebug(0)
-{}
+{
+ //
+ // Default CTOR
+ //
+}
//____________________________________________________________________
AliFMDEnergyFitter::RingHistos::RingHistos(UShort_t d, Char_t r)
fFits("AliFMDCorrELossFit::ELossFit"),
fDebug(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // d detector
+ // r ring
+ //
fEtaEDists.SetName("EDists");
}
//____________________________________________________________________
fFits("AliFMDCorrELossFit::ELossFit"),
fDebug(0)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
fFits.Clear();
TIter next(&o.fEtaEDists);
TObject* obj = 0;
AliFMDEnergyFitter::RingHistos&
AliFMDEnergyFitter::RingHistos::operator=(const RingHistos& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this
+ //
AliForwardUtil::RingHistos::operator=(o);
if (fEDist) delete fEDist;
//____________________________________________________________________
AliFMDEnergyFitter::RingHistos::~RingHistos()
{
+ //
+ // Destructor
+ //
if (fEDist) delete fEDist;
fEtaEDists.Delete();
}
void
AliFMDEnergyFitter::RingHistos::Fill(Bool_t empty, Int_t ieta, Double_t mult)
{
+ //
+ // Fill histogram
+ //
+ // Parameters:
+ // empty True if event is empty
+ // ieta Eta bin
+ // mult Signal
+ //
if (empty) {
fEmpty->Fill(mult);
return;
AliFMDEnergyFitter::RingHistos::MakeIncreasingAxis(Int_t n, Double_t min,
Double_t max) const
{
- // Service function to define a logarithmic axis.
- // Parameters:
- // n Number of bins
- // min Minimum of axis
- // max Maximum of axis
+ //
+ // Make an axis with increasing bins
+ //
+ // Parameters:
+ // n Number of bins
+ // min Minimum
+ // max Maximum
+ //
+ // Return:
+ // An axis with quadratically increasing bin size
+ //
+
TArrayD bins(n+1);
Double_t dx = (max-min) / n;
bins[0] = min;
Int_t nDeBins,
Bool_t incr)
{
+ //
+ // Make E/E_mip histogram
+ //
+ // Parameters:
+ // ieta Eta bin
+ // eMin Least signal
+ // eMax Largest signal
+ // deMax Maximum energy loss
+ // nDeBins Number energy loss bins
+ // incr Whether to make bins of increasing size
+ //
TH1D* h = 0;
TString name = Form(fgkEDistFormat, fName.Data(), ieta);
TString title = Form("#DeltaE/#DeltaE_{mip} for %s %+5.3f#leq#eta<%+5.3f "
const char* title,
const TAxis& eta) const
{
+ //
+ // Make a parameter histogram
+ //
+ // Parameters:
+ // name Name of histogram.
+ // title Title of histogram.
+ // eta Eta axis
+ //
+ // Return:
+ //
+ //
TH1D* h = new TH1D(Form("%s_%s", fName.Data(), name),
Form("%s for %s", title, fName.Data()),
eta.GetNbins(), eta.GetXmin(), eta.GetXmax());
Double_t val,
Double_t err) const
{
+ //
+ // Make a histogram that contains the results of the fit over the full ring
+ //
+ // Parameters:
+ // name Name
+ // title Title
+ // eta Eta axis
+ // low Least bin
+ // high Largest bin
+ // val Value of parameter
+ // err Error on parameter
+ //
+ // Return:
+ // The newly allocated histogram
+ //
Double_t xlow = eta.GetBinLowEdge(low);
Double_t xhigh = eta.GetBinUpEdge(high);
TH1D* h = new TH1D(Form("%s_%s", fName.Data(), name),
Double_t maxDE, Int_t nDEbins,
Bool_t useIncrBin)
{
+ //
+ // Initialise object
+ //
+ // Parameters:
+ // eAxis Eta axis
+ // maxDE Max energy loss to consider
+ // nDEbins Number of bins
+ // useIncrBin Whether to use an increasing bin size
+ //
fEDist = new TH1D(Form("%s_edist", fName.Data()),
Form("#DeltaE/#DeltaE_{mip} for %s", fName.Data()),
200, 0, 6);
Double_t relErrorCut,
Double_t chi2nuCut) const
{
+ //
+ // Fit each histogram to up to @a nParticles particle responses.
+ //
+ // Parameters:
+ // dir Output list
+ // eta Eta axis
+ // lowCut Lower cut
+ // nParticles Max number of convolved landaus to fit
+ // minEntries Minimum number of entries
+ // minusBins Number of bins from peak to subtract to
+ // get the fit range
+ // relErrorCut Cut applied to relative error of parameter.
+ // Note, for multi-particle weights, the cut
+ // is loosend by a factor of 2
+ // chi2nuCut Cut on @f$ \chi^2/\nu@f$ -
+ // the reduced @f$\chi^2@f$
+ //
+
// Get our ring list from the output container
TList* l = GetOutputList(dir);
if (!l) return 0;
Double_t relErrorCut,
Double_t chi2nuCut) const
{
+ //
+ // Fit a signal histogram. First, the bin @f$ b_{min}@f$ with
+ // maximum bin content in the range @f$ [E_{min},\infty]@f$ is
+ // found. Then the fit range is set to the bin range
+ // @f$ [b_{min}-\Delta b,b_{min}+2\Delta b]@f$, and a 1
+ // particle signal is fitted to that. The parameters of that fit
+ // is then used as seeds for a fit of the @f$ N@f$ particle response
+ // to the data in the range
+ // @f$ [b_{min}-\Delta b,N(\Delta_1+\xi_1\log(N))+2N\xi@f$
+ //
+ // Parameters:
+ // dist Histogram to fit
+ // lowCut Lower cut @f$ E_{min}@f$ on signal
+ // nParticles Max number @f$ N@f$ of convolved landaus to fit
+ // minusBins Number of bins @f$ \Delta b@f$ from peak to
+ // subtract to get the fit range
+ // relErrorCut Cut applied to relative error of parameter.
+ // Note, for multi-particle weights, the cut
+ // is loosend by a factor of 2
+ // chi2nuCut Cut on @f$ \chi^2/\nu@f$ -
+ // the reduced @f$\chi^2@f$
+ //
+ // Return:
+ // The best fit function
+ //
Double_t maxRange = 10;
// Create a fitter object
Double_t relErrorCut,
Double_t chi2nuCut) const
{
+ //
+ // Check the result of the fit. Returns true if
+ // - @f$ \chi^2/\nu < \max{\chi^2/\nu}@f$
+ // - @f$ \Delta p_i/p_i < \delta_e@f$ for all parameters. Note,
+ // for multi-particle fits, this requirement is relaxed by a
+ // factor of 2
+ // - @f$ a_{n} > 10^{-7}@f$ when fitting to an @f$ n@f$
+ // particle response
+ //
+ // Parameters:
+ // r Result to check
+ // relErrorCut Cut @f$ \delta_e@f$ applied to relative error
+ // of parameter.
+ // chi2nuCut Cut @f$ \max{\chi^2/\nu}@f$
+ //
+ // Return:
+ // true if fit is good.
+ //
if (fDebug > 10) r->Print();
TString n = r->GetName();
n.ReplaceAll("TFitResult-", "");
Double_t chi2nuCut,
Double_t minWeightCut)
{
+ //
+ // Find the best fits
+ //
+ // Parameters:
+ // d Parent list
+ // obj Object to add fits to
+ // eta Eta axis
+ // relErrorCut Cut applied to relative error of parameter.
+ // Note, for multi-particle weights, the cut
+ // is loosend by a factor of 2
+ // chi2nuCut Cut on @f$ \chi^2/\nu@f$ -
+ // the reduced @f$\chi^2@f$
+ // minWeightCut Least valid @f$ a_i@f$
+ //
+
// Get our ring list from the output container
TList* l = GetOutputList(d);
if (!l) return;
Double_t chi2nuCut,
Double_t minWeightCut)
{
+ //
+ // Find the best fit
+ //
+ // Parameters:
+ // dist Histogram
+ // relErrorCut Cut applied to relative error of parameter.
+ // Note, for multi-particle weights, the cut
+ // is loosend by a factor of 2
+ // chi2nuCut Cut on @f$ \chi^2/\nu@f$ -
+ // the reduced @f$\chi^2@f$
+ // minWeightCut Least valid @f$ a_i@f$
+ //
+ // Return:
+ // Best fit
+ //
TList* funcs = dist->GetListOfFunctions();
TIter next(funcs);
TF1* func = 0;
void
AliFMDEnergyFitter::RingHistos::Output(TList* dir)
{
+ //
+ // Define outputs
+ //
+ // Parameters:
+ // dir
+ //
fList = DefineOutputList(dir);
}
+//
+// Class to fit the energy distribution.
+//
#ifndef ALIFMDENERGYFITTER_H
#define ALIFMDENERGYFITTER_H
#include <TNamed.h>
+//
+// Histogram and fit the energy loss distributions for the FMD
+//
+// Inputs:
+// - AliESDEvent
+//
+// Outputs:
+// - None
+//
+// Histograms:
+//
+// Corrections used:
+// - None
+//
+//
+//
#include "AliFMDEnergyFitterTask.h"
#include "AliLog.h"
-// #include "AliFMDAnaParameters.h"
#include "AliESDEvent.h"
#include "AliAODForwardMult.h"
#include "AliForwardCorrectionManager.h"
fEnergyFitter(),
fList(0)
{
+ //
+ // Constructor
+ //
}
//____________________________________________________________________
fEnergyFitter("energy"),
fList(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // name Name of task
+ //
DefineOutput(1, TList::Class());
}
fEnergyFitter(o.fEnergyFitter),
fList(o.fList)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
DefineOutput(1, TList::Class());
}
AliFMDEnergyFitterTask&
AliFMDEnergyFitterTask::operator=(const AliFMDEnergyFitterTask& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
AliAnalysisTaskSE::operator=(o);
fFirstEvent = o.fFirstEvent;
void
AliFMDEnergyFitterTask::SetDebug(Int_t dbg)
{
+ //
+ // Set the debug level
+ //
+ // Parameters:
+ // dbg Debug level
+ //
fEventInspector.SetDebug(dbg);
fEnergyFitter.SetDebug(dbg);
}
void
AliFMDEnergyFitterTask::Init()
{
+ //
+ // Initialize the task
+ //
+ //
fFirstEvent = true;
}
void
AliFMDEnergyFitterTask::InitializeSubs()
{
-
- // AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
- // pars->Init(kTRUE);
-
+ //
+ // Initialise the sub objects and stuff. Called on first event
+ //
+ //
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
fcm.Init(fEventInspector.GetCollisionSystem(),
fEventInspector.GetEnergy(),
void
AliFMDEnergyFitterTask::UserCreateOutputObjects()
{
+ //
+ // Create output objects
+ //
+ //
fList = new TList;
fEventInspector.DefineOutput(fList);
void
AliFMDEnergyFitterTask::UserExec(Option_t*)
{
+ //
+ // Process each event
+ //
+ // Parameters:
+ // option Not used
+ //
+
// static Int_t cnt = 0;
// cnt++;
// Get the input data
void
AliFMDEnergyFitterTask::Terminate(Option_t*)
{
+ //
+ // End of job
+ //
+ // Parameters:
+ // option Not used
+ //
TList* list = dynamic_cast<TList*>(GetOutputData(1));
if (!list) {
AliError(Form("No output list defined (%p)", GetOutputData(1)));
void
AliFMDEnergyFitterTask::Print(Option_t*) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
}
//
-#ifndef ALIROOT_PWG2_FORWARD_ALIFMDENERGYFITTERTASK_H
-#define ALIROOT_PWG2_FORWARD_ALIFMDENERGYFITTERTASK_H
+// Histogram and fit the energy loss distributions for the FMD
+//
+// Wraps AliFMDEnergyFitter
+#ifndef ALIFMDENERGYFITTERTASK_H
+#define ALIFMDENERGYFITTERTASK_H
#include <AliAnalysisTaskSE.h>
#include "AliForwardUtil.h"
#include "AliFMDEventInspector.h"
/**
* @}
*/
+ /**
+ * Set the debug level
+ *
+ * @param dbg Debug level
+ */
void SetDebug(Int_t dbg);
protected:
/**
+//
+// This class inspects the event
+//
+// Input:
+// - AliESDFMD object possibly corrected for sharing
+//
+// Output:
+// - A histogram of v_z of events with triggers.
+// - A histogram of v_z of events with vertex and triggers
+// - A histogram of trigger counters
+//
+// Note, that these are added to the master output list
+//
+// Corrections used:
+// - None
+//
#include "AliFMDEventInspector.h"
#include "AliLog.h"
#include "AliESDEvent.h"
fCollisionSystem(kUnknown),
fDebug(0)
{
+ //
+ // Constructor
+ //
}
//____________________________________________________________________
fCollisionSystem(kUnknown),
fDebug(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // name Name of object
+ //
}
//____________________________________________________________________
fCollisionSystem(o.fCollisionSystem),
fDebug(0)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
}
//____________________________________________________________________
AliFMDEventInspector::~AliFMDEventInspector()
{
+ //
+ // Destructor
+ //
if (fHEventsTr) delete fHEventsTr;
if (fHEventsTrVtx) delete fHEventsTrVtx;
if (fHTriggers) delete fHTriggers;
AliFMDEventInspector&
AliFMDEventInspector::operator=(const AliFMDEventInspector& o)
{
+ //
+ // Assignement operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
TNamed::operator=(o);
fHEventsTr = o.fHEventsTr;
fHEventsTrVtx = o.fHEventsTrVtx;
TH1I*& hEventsTrVtx,
TH1I*& hTriggers) const
{
+ //
+ // Fetch our histograms from the passed list
+ //
+ // Parameters:
+ // d Input
+ // hEventsTr On return, pointer to histogram, or null
+ // hEventsTrVtx On return, pointer to histogram, or null
+ // hTriggers On return, pointer to histogram, or null
+ //
+ // Return:
+ // true on success, false otherwise
+ //
hEventsTr = 0;
hEventsTrVtx = 0;
hTriggers = 0;
void
AliFMDEventInspector::Init(const TAxis& vtxAxis)
{
+ //
+ // Initialize the object
+ //
+ // Parameters:
+ // vtxAxis Vertex axis in use
+ //
fHEventsTr = new TH1I("nEventsTr", "Number of events w/trigger",
vtxAxis.GetNbins(),
vtxAxis.GetXmin(),
void
AliFMDEventInspector::DefineOutput(TList* dir)
{
+ //
+ // Define the output histograms. These are put in a sub list of the
+ // passed list. The histograms are merged before the parent task calls
+ // AliAnalysisTaskSE::Terminate
+ //
+ // dir Directory to add to
+ //
fList = new TList;
fList->SetName(GetName());
dir->Add(fList);
UShort_t& ivz,
Double_t& vz)
{
+ //
+ // Process the event
+ //
+ // Parameters:
+ // event Input event
+ // triggers On return, the triggers fired
+ // lowFlux On return, true if the event is considered a low-flux
+ // event (according to the setting of fLowFluxCut)
+ // ivz On return, the found vertex bin (1-based). A zero
+ // means outside of the defined vertex range
+ // vz On return, the z position of the interaction
+ //
+ // Return:
+ // 0 (or kOk) on success, otherwise a bit mask of error codes
+ //
+
// Check that we have an event
if (!event) {
AliWarning("No ESD event found for input event");
Bool_t
AliFMDEventInspector::ReadTriggers(const AliESDEvent* esd, UInt_t& triggers)
{
+ //
+ // Read the trigger information from the ESD event
+ //
+ // Parameters:
+ // esd ESD event
+ // triggers On return, contains the trigger bits
+ //
+ // Return:
+ // @c true on success, @c false otherwise
+ //
triggers = 0;
// Get the analysis manager - should always be there
Bool_t
AliFMDEventInspector::ReadVertex(const AliESDEvent* esd, Double_t& vz)
{
+ //
+ // Read the vertex information from the ESD event
+ //
+ // Parameters:
+ // esd ESD event
+ // vz On return, the vertex Z position
+ //
+ // Return:
+ // @c true on success, @c false otherwise
+ //
vz = 0;
// Get the vertex
const AliESDVertex* vertex = esd->GetPrimaryVertexSPD();
Bool_t
AliFMDEventInspector::ReadRunDetails(const AliESDEvent* esd)
{
+ //
+ // Read the collision system, collision energy, and L3 field setting
+ // from the ESD
+ //
+ // Parameters:
+ // esd ESD to get information from
+ //
+ // Return:
+ // true on success, false
+ //
fCollisionSystem =
AliForwardUtil::ParseCollisionSystem(esd->GetBeamType());
fEnergy =
void
AliFMDEventInspector::Print(Option_t*) const
{
+ //
+ // Print information
+ //
+ // option Not used
+ //
char ind[gROOT->GetDirLevel()+1];
for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
ind[gROOT->GetDirLevel()] = '\0';
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDEVENTINSPECTOR_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDEVENTINSPECTOR_H
+//
+// This class inspects the event
+//
+#ifndef ALIFMDEVENTINSPECTOR_H
+#define ALIFMDEVENTINSPECTOR_H
#include <TNamed.h>
class AliESDEvent;
class TH2D;
-// Calculate the total energy loss
+//
+// This class collects the event histograms into single histograms,
+// one for each ring in each vertex bin.
+//
+// Input:
+// - AliESDFMD object possibly corrected for sharing
+//
+// Output:
+// - 5 RingHistos objects - each with a number of vertex dependent
+// 2D histograms of the inclusive charge particle density
+//
+// HistCollector used:
+// - AliFMDCorrSecondaryMap
+//
#include "AliFMDHistCollector.h"
#include <AliESDFMD.h>
#include <TAxis.h>
#include <TList.h>
#include <TMath.h>
-// #include "AliFMDAnaParameters.h"
#include "AliForwardCorrectionManager.h"
#include "AliLog.h"
#include <TH2D.h>
AliFMDHistCollector&
AliFMDHistCollector::operator=(const AliFMDHistCollector& o)
{
+ //
+ // Assignement operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
TNamed::operator=(o);
fNCutBins = o.fNCutBins;
void
AliFMDHistCollector::Init(const TAxis& vtxAxis)
{
- // AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+ //
+ // Intialise
+ //
+ // Parameters:
+ // vtxAxis Vertex axis
+ //
+
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
UShort_t nVz = vtxAxis.GetNbins();
Int_t
AliFMDHistCollector::GetIdx(UShort_t d, Char_t r) const
{
+ //
+ // Get the ring index from detector number and ring identifier
+ //
+ // Parameters:
+ // d Detector
+ // r Ring identifier
+ //
+ // Return:
+ // ring index or -1 in case of problems
+ //
Int_t idx = -1;
switch (d) {
case 1: idx = 0; break;
void
AliFMDHistCollector::GetDetRing(Int_t idx, UShort_t& d, Char_t& r) const
{
+ //
+ // Get the detector and ring from the ring index
+ //
+ // Parameters:
+ // idx Ring index
+ // d On return, the detector or 0 in case of errors
+ // r On return, the ring id or '0' in case of errors
+ //
d = 0;
r = '\0';
switch (idx) {
AliFMDHistCollector::GetFirstAndLast(Int_t idx, UShort_t vtxbin,
Int_t& first, Int_t& last) const
{
+ //
+ // Get the first and last eta bin to use for a given ring and vertex
+ //
+ // Parameters:
+ // idx Ring index as given by GetIdx
+ // vtxBin Vertex bin (1 based)
+ // first On return, the first eta bin to use
+ // last On return, the last eta bin to use
+ //
first = 0;
last = 0;
Int_t
AliFMDHistCollector::GetFirst(Int_t idx, UShort_t v) const
{
+ //
+ // Get the first eta bin to use for a given ring and vertex
+ //
+ // Parameters:
+ // idx Ring index as given by GetIdx
+ // v vertex bin (1 based)
+ //
+ // Return:
+ // First eta bin to use, or -1 in case of problems
+ //
Int_t f, l;
GetFirstAndLast(idx,v,f,l);
return f;
Int_t
AliFMDHistCollector::GetLast(Int_t idx, UShort_t v) const
{
+ //
+ // Get the last eta bin to use for a given ring and vertex
+ //
+ // Parameters:
+ // idx Ring index as given by GetIdx
+ // v vertex bin (1 based)
+ //
+ // Return:
+ // Last eta bin to use, or -1 in case of problems
+ //
Int_t f, l;
GetFirstAndLast(idx,v,f,l);
return l;
AliFMDHistCollector::GetOverlap(UShort_t d, Char_t r,
Int_t bin, UShort_t vtxbin) const
{
- // Get the possibly overlapping histogram
+ //
+ // Get the possibly overlapping histogram of eta bin @a e in
+ // detector and ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // e Eta bin
+ // v Vertex bin (1 based)
+ //
+ // Return:
+ // Overlapping histogram index or -1
+ //
+
Int_t other = -1;
if (d == 1) {
if (bin <= GetLast(2,'I',vtxbin)) other = GetIdx(2,'I');
Int_t
AliFMDHistCollector::GetOverlap(Int_t idx, Int_t bin, UShort_t vtxbin) const
{
+ //
+ // Get the possibly overlapping histogram of eta bin @a e in
+ // detector and ring
+ //
+ // Parameters:
+ // i Ring index
+ // e Eta bin
+ // v Vertex bin (1 based)
+ //
+ // Return:
+ // Overlapping histogram index or -1
+ //
UShort_t d = 0;
Char_t r = '\0';
GetDetRing(idx, d, r);
UShort_t vtxbin,
TH2D& out)
{
+ //
+ // Do the calculations
+ //
+ // Parameters:
+ // hists Cache of histograms
+ // vtxBin Vertex bin (1 based)
+ // out Output histogram
+ //
+ // Return:
+ // true on successs
+ //
for (UShort_t d=1; d<=3; d++) {
UShort_t nr = (d == 1 ? 1 : 2);
for (UShort_t q=0; q<nr; q++) {
void
AliFMDHistCollector::Print(Option_t* /* option */) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
char ind[gROOT->GetDirLevel()+1];
for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
ind[gROOT->GetDirLevel()] = '\0';
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDHISTCOLLECTOR_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDHISTCOLLECTOR_H
+//
+// This class collects the event histograms into single histograms,
+// one for each ring in each vertex bin.
+//
+#ifndef ALIFMDHISTCOLLECTOR_H
+#define ALIFMDHISTCOLLECTOR_H
#include <TNamed.h>
#include <TList.h>
#include <TArrayI.h>
/**
* Assignement operator
*
+ * @param o Object to assign from
+ *
* @return Reference to this object
*/
AliFMDHistCollector& operator=(const AliFMDHistCollector&);
+//
+// This class calculates the exclusive charged particle density
+// in each for the 5 FMD rings.
+//
+// Input:
+// - 5 RingHistos objects - each with a number of vertex dependent
+// 2D histograms of the inclusive charge particle density
+//
+// Output:
+// - 5 RingHistos objects - each with a number of vertex dependent
+// 2D histograms of the exclusive charge particle density
+//
+// Corrections used:
+// - AliFMDCorrSecondaryMap;
+// - AliFMDCorrVertexBias
+// - AliFMDCorrMergingEfficiency
+//
#include "AliFMDMCCorrections.h"
#include <AliESDFMD.h>
#include <TAxis.h>
#include <TList.h>
#include <TMath.h>
#include "AliForwardCorrectionManager.h"
-// #include "AliFMDAnaParameters.h"
#include "AliLog.h"
#include <TH2D.h>
#include <TROOT.h>
//____________________________________________________________________
AliFMDMCCorrections::~AliFMDMCCorrections()
{
+ //
+ // Destructor
+ //
if (fComps) fComps->Clear();
if (fFMD1i) delete fFMD1i;
if (fFMD2i) delete fFMD2i;
AliFMDMCCorrections&
AliFMDMCCorrections::operator=(const AliFMDMCCorrections& o)
{
+ //
+ // Assignement operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
AliFMDCorrections::operator=(o);
return *this;
AliFMDMCCorrections::CorrectMC(AliForwardUtil::Histos& hists,
UShort_t vtxbin)
{
+ //
+ // Do the calculations
+ //
+ // Parameters:
+ // hists Cache of histograms
+ // vtxBin Vertex bin
+ //
+ // Return:
+ // true on successs
+ //
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
UShort_t uvb = vtxbin;
void
AliFMDMCCorrections::Init(const TAxis& eAxis)
{
+ //
+ // Initialize this object
+ //
+ // Parameters:
+ // etaAxis Eta axis to use
+ //
fFMD1i = Make(1,'I',eAxis);
fFMD2i = Make(2,'I',eAxis);
fFMD2o = Make(2,'O',eAxis);
AliFMDMCCorrections::Make(UShort_t d, Char_t r,
const TAxis& axis) const
{
+ //
+ // MAke comparison profiles
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // axis Eta axis
+ //
+ // Return:
+ // Newly allocated profile object
+ //
TProfile2D* ret = new TProfile2D(Form("FMD%d%c_esd_vs_mc", d, r),
Form("ESD/MC signal for FMD%d%c", d, r),
axis.GetNbins(),
void
AliFMDMCCorrections::Fill(UShort_t d, Char_t r, TH2* esd, TH2* mc)
{
+ //
+ // Fill comparison profiles
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // esd ESD histogram
+ // mc MC histogram
+ //
if (!esd || !mc) return;
TProfile2D* p = 0;
switch (d) {
AliFMDMCCorrections::CompareResults(AliForwardUtil::Histos& esd,
AliForwardUtil::Histos& mc)
{
+ //
+ // Compare the result of analysing the ESD for
+ // the inclusive charged particle density to analysing
+ // MC truth
+ //
+ // Parameters:
+ // esd
+ // mc
+ //
+ // Return:
+ // true
+ //
Fill(1, 'I', esd.Get(1,'I'), mc.Get(1,'I'));
Fill(2, 'I', esd.Get(2,'I'), mc.Get(2,'I'));
Fill(2, 'O', esd.Get(2,'O'), mc.Get(2,'O'));
void
AliFMDMCCorrections::DefineOutput(TList* dir)
{
+ //
+ // Output diagnostic histograms to directory
+ //
+ // Parameters:
+ // dir List to write in
+ //
AliFMDCorrections::DefineOutput(dir);
TList* d = static_cast<TList*>(dir->FindObject(GetName()));
+//
+// This class calculates the exclusive charged particle density
+// in each for the 5 FMD rings.
+//
#ifndef ALIFMDMCCORRECTIONS_H
#define ALIFMDMCCORRECTIONS_H
#include "AliFMDCorrections.h"
+//
+// This class calculates the inclusive charged particle density
+// in each for the 5 FMD rings based on the MC truth.
+//
+// Input:
+// - AliMCEvent MC truth event infromation
+//
+// Output:
+// - None
+//
+// Corrections used:
+// - None
+//
+//
#include "AliFMDMCDensityCalculator.h"
#include <TMath.h>
#include "AliForwardCorrectionManager.h"
#include "AliFMDStripIndex.h"
#include "AliMCEvent.h"
-// #include "AliFMDAnaParameters.h"
#include "AliESDFMD.h"
#include "AliLog.h"
#include <TH2D.h>
//____________________________________________________________________
AliFMDMCDensityCalculator::~AliFMDMCDensityCalculator()
{
+ //
+ // Destructor
+ //
if (fComps) fComps->Clear();
if (fFMD1i) delete fFMD1i;
if (fFMD2i) delete fFMD2i;
AliFMDMCDensityCalculator&
AliFMDMCDensityCalculator::operator=(const AliFMDMCDensityCalculator& o)
{
+ //
+ // Assignement operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
AliFMDDensityCalculator::operator=(o);
return *this;
}
+
+//____________________________________________________________________
+void
+AliFMDMCDensityCalculator::Init(const TAxis& eAxis)
+{
+ //
+ // Initialize this object
+ //
+ // Parameters:
+ // etaAxis Eta axis to use
+ //
+ fFMD1i = Make(1,'I',eAxis);
+ fFMD2i = Make(2,'I',eAxis);
+ fFMD2o = Make(2,'O',eAxis);
+ fFMD3i = Make(3,'I',eAxis);
+ fFMD3o = Make(3,'O',eAxis);
+ fFMD1iC = Make(1,'I');
+ fFMD2iC = Make(2,'I');
+ fFMD2oC = Make(2,'O');
+ fFMD3iC = Make(3,'I');
+ fFMD3oC = Make(3,'O');
+
+ fComps->Add(fFMD1i);
+ fComps->Add(fFMD2i);
+ fComps->Add(fFMD2o);
+ fComps->Add(fFMD3i);
+ fComps->Add(fFMD3o);
+ fComps->Add(fFMD1iC);
+ fComps->Add(fFMD2iC);
+ fComps->Add(fFMD2oC);
+ fComps->Add(fFMD3iC);
+ fComps->Add(fFMD3oC);
+}
//____________________________________________________________________
AliFMDMCDensityCalculator::CalculateMC(const AliESDFMD& fmd,
AliForwardUtil::Histos& hists)
{
+ //
+ // Calculate the charged particle density from the MC track references.
+ //
+ // Parameters:
+ // event MC event
+ // hists Histograms to fill
+ // vz Interaction z coordinate @f$ v_z@f$
+ // vtxBin bin corresponding to @f$ v_z@f$
+ //
+ // Return:
+ // true on success
+ //
for (UShort_t d=1; d<=3; d++) {
UShort_t nr = (d == 1 ? 1 : 2);
for (UShort_t q=0; q<nr; q++) {
return kTRUE;
}
-//____________________________________________________________________
-void
-AliFMDMCDensityCalculator::Init(const TAxis& eAxis)
-{
- fFMD1i = Make(1,'I',eAxis);
- fFMD2i = Make(2,'I',eAxis);
- fFMD2o = Make(2,'O',eAxis);
- fFMD3i = Make(3,'I',eAxis);
- fFMD3o = Make(3,'O',eAxis);
- fFMD1iC = Make(1,'I');
- fFMD2iC = Make(2,'I');
- fFMD2oC = Make(2,'O');
- fFMD3iC = Make(3,'I');
- fFMD3oC = Make(3,'O');
-
- fComps->Add(fFMD1i);
- fComps->Add(fFMD2i);
- fComps->Add(fFMD2o);
- fComps->Add(fFMD3i);
- fComps->Add(fFMD3o);
- fComps->Add(fFMD1iC);
- fComps->Add(fFMD2iC);
- fComps->Add(fFMD2oC);
- fComps->Add(fFMD3iC);
- fComps->Add(fFMD3oC);
-}
-
//____________________________________________________________________
TProfile2D*
AliFMDMCDensityCalculator::Make(UShort_t d, Char_t r,
const TAxis& axis) const
{
+ //
+ // MAke comparison profiles
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // axis Eta axis
+ //
+ // Return:
+ // Newly allocated profile object
+ //
TProfile2D* ret = new TProfile2D(Form("FMD%d%c_esd_vs_mc", d, r),
Form("ESD/MC signal for FMD%d%c", d, r),
axis.GetNbins(),
TH2D*
AliFMDMCDensityCalculator::Make(UShort_t d, Char_t r) const
{
+ //
+ // MAke comparison profiles
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Newly allocated profile object
+ //
TH2D* ret = new TH2D(Form("FMD%d%c_corr_mc_esd", d, r),
Form("ESD-MC correlation for FMD%d%c", d, r),
200, 0, 20, 200, 0, 20);
void
AliFMDMCDensityCalculator::Fill(UShort_t d, Char_t r, TH2* esd, TH2* mc)
{
+ //
+ // Fill comparison profiles
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // esd ESD histogram
+ // mc MC histogram
+ //
if (!esd || !mc) return;
TProfile2D* p = 0;
TH2D* h = 0;
AliFMDMCDensityCalculator::CompareResults(AliForwardUtil::Histos& esd,
AliForwardUtil::Histos& mc)
{
+ //
+ // Compare the result of analysing the ESD for
+ // the inclusive charged particle density to analysing
+ // MC truth
+ //
+ // Parameters:
+ // esd
+ // mc
+ //
+ // Return:
+ // true
+ //
Fill(1, 'I', esd.Get(1,'I'), mc.Get(1,'I'));
Fill(2, 'I', esd.Get(2,'I'), mc.Get(2,'I'));
Fill(2, 'O', esd.Get(2,'O'), mc.Get(2,'O'));
void
AliFMDMCDensityCalculator::DefineOutput(TList* dir)
{
+ //
+ // Output diagnostic histograms to directory
+ //
+ // Parameters:
+ // dir List to write in
+ //
AliFMDDensityCalculator::DefineOutput(dir);
TList* d = static_cast<TList*>(dir->FindObject(GetName()));
+//
+// This class calculates the inclusive charged particle density
+// in each for the 5 FMD rings based on the MC truth.
+//
#ifndef ALIFMDMCDENSITYCALCULATOR_H
#define ALIFMDMCDENSITYCALCULATOR_H
#include "AliFMDDensityCalculator.h"
//
-// Class to do the sharing correction of FMD ESD data
+// Class to do the sharing correction for MC data.
//
+// Input:
+// - AliESDFMD object - from reconstruction
+// - Kinematics
+// - Track-References
+//
+// Output:
+// - AliESDFMD object - copy of input, but with signals merged
+//
+// Corrections used:
+// - None
+//
+// Histograms:
+// - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of
+// signals before and after the filter.
+// - For each ring (see above), an array of distributions of number of
+// hit strips for each vertex bin (if enabled - see Init method)
+//
#include "AliFMDMCSharingFilter.h"
#include <AliESDFMD.h>
#include <AliMCEvent.h>
#include <TList.h>
#include <TH1.h>
#include <TMath.h>
-#include "AliForwardCorrectionManager.h"
-// #include "AliFMDAnaParameters.h"
#include "AliFMDStripIndex.h"
#include <AliLog.h>
#include <TROOT.h>
#endif
-//____________________________________________________________________
-AliFMDMCSharingFilter::AliFMDMCSharingFilter()
- : AliFMDSharingFilter(),
- fFMD1i(0),
- fFMD2i(0),
- fFMD2o(0),
- fFMD3i(0),
- fFMD3o(0),
- fSumEta(0)
-{}
-
//____________________________________________________________________
AliFMDMCSharingFilter::AliFMDMCSharingFilter(const char* title)
: AliFMDSharingFilter(title),
fFMD3o(0),
fSumEta(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // title Title of object - not significant
+ //
fFMD1i = new TH2D("FMD1i_corr", "Merged vs MC", 21, -.5, 20.5, 100, 0, 20);
fFMD2i = new TH2D("FMD2i_corr", "Merged vs MC", 21, -.5, 20.5, 100, 0, 20);
fFMD2o = new TH2D("FMD2o_corr", "Merged vs MC", 21, -.5, 20.5, 100, 0, 20);
fFMD3o(o.fFMD3o),
fSumEta(o.fSumEta)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
}
//____________________________________________________________________
AliFMDMCSharingFilter::~AliFMDMCSharingFilter()
{
+ //
+ // Destructor
+ //
if (fFMD1i) delete fFMD1i;
if (fFMD2i) delete fFMD2i;
if (fFMD2o) delete fFMD2o;
AliFMDMCSharingFilter&
AliFMDMCSharingFilter::operator=(const AliFMDMCSharingFilter& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this
+ //
AliFMDSharingFilter::operator=(o);
return *this;
}
UShort_t t,
AliESDFMD& output) const
{
+ //
+ // Store a particle hit in FMD<i>dr</i>[<i>s,t</i>] in @a output
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // s Sector
+ // t Strip
+ // output Output ESD object
+ //
Double_t old = output.Multiplicity(d,r,s,t);
if (old == AliESDFMD::kInvalidMult) old = 0;
output.SetMultiplicity(d,r,s,t,old+1);
Double_t vz,
AliESDFMD& output)
{
+ //
+ // Filter the input AliESDFMD object
+ //
+ // Parameters:
+ // input Input (from ESD) - used for eta
+ // lowFlux If this is a low-flux event
+ // output Output AliESDFMD object
+ //
+ // Return:
+ // True on success, false otherwise
+ //
output.Clear();
// Copy eta values to output
AliFMDMCSharingFilter::CompareResults(const AliESDFMD& esd,
const AliESDFMD& mc)
{
+ //
+ // Compare the result of merging to the monte-carlo truth. This
+ // fills the correlation histograms
+ //
+ // Parameters:
+ // esd ESD after sharing correction
+ // mc MC ESD
+ //
+
// Copy eta values to output
for (UShort_t d = 1; d <= 3; d++) {
UShort_t nq = (d == 1 ? 1 : 2);
void
AliFMDMCSharingFilter::DefineOutput(TList* dir)
{
+ //
+ // Define the output histograms. These are put in a sub list of the
+ // passed list. The histograms are merged before the parent task calls
+ // AliAnalysisTaskSE::Terminate
+ //
+ // Parameters:
+ // dir Directory to add to
+ //
AliFMDSharingFilter::DefineOutput(dir);
TList* d = static_cast<TList*>(dir->FindObject(GetName()));
TList* cd = new TList;
void
AliFMDMCSharingFilter::ScaleHistograms(TList* dir, Int_t nEvents)
{
+ //
+ // Scale the histograms to the total number of events
+ //
+ // Parameters:
+ // dir Where the output is
+ // nEvents Number of events
+ //
AliFMDSharingFilter::ScaleHistograms(dir, nEvents);
TH1D* sumEta = static_cast<TH1D*>(dir->FindObject("mcSumEta"));
if (!sumEta) {
void
AliFMDMCSharingFilter::Print(Option_t* option) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
char ind[gROOT->GetDirLevel()+1];
for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
ind[gROOT->GetDirLevel()] = '\0';
+//
+// Class to do the sharing correction for MC data.
+//
#ifndef ALIFMDMCSHARINGFILTER_H
#define ALIFMDMCSHARINGFILTER_H
#include "AliFMDSharingFilter.h"
*
* @par Input:
* - AliESDFMD object - from reconstruction
+ * - Kinematics
+ * - Track-References
*
* @par Output:
* - AliESDFMD object - copy of input, but with signals merged
*
* @par Corrections used:
- * - AliCorrELossFit
+ * - None
*
* @par Histograms:
* - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of
/**
* Default Constructor - do not use
*/
- AliFMDMCSharingFilter();
+ AliFMDMCSharingFilter()
+ : AliFMDSharingFilter(),
+ fFMD1i(0),
+ fFMD2i(0),
+ fFMD2o(0),
+ fFMD3i(0),
+ fFMD3o(0),
+ fSumEta(0)
+ {}
/**
* Constructor
*
*/
void Print(Option_t* option="") const;
protected:
+ /**
+ * Store a particle hit in FMD<i>dr</i>[<i>s,t</i>] in @a output
+ *
+ * @param d Detector
+ * @param r Ring
+ * @param s Sector
+ * @param t Strip
+ * @param output Output ESD object
+ */
void StoreParticle(UShort_t d, Char_t r, UShort_t s, UShort_t t,
AliESDFMD& output) const;
TH2D* fFMD1i; // ESD-MC correlation
//
-// Class to do the sharing correction of FMD ESD data
+// Class to do the sharing correction. That is, a filter that merges
+// adjacent strip signals presumably originating from a single particle
+// that impinges on the detector in such a way that it deposite energy
+// into two or more strips.
+//
+// Input:
+// - AliESDFMD object - from reconstruction
+//
+// Output:
+// - AliESDFMD object - copy of input, but with signals merged
+//
+// Corrections used:
+// - AliFMDCorrELossFit
+//
+// Histograms:
+// - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of
+// signals before and after the filter.
+// - For each ring (see above), an array of distributions of number of
+// hit strips for each vertex bin (if enabled - see Init method)
+//
+//
//
#include "AliFMDSharingFilter.h"
#include <AliESDFMD.h>
#include <TH1.h>
#include <TMath.h>
#include "AliForwardCorrectionManager.h"
-// #include "AliFMDAnaParameters.h"
#include <AliLog.h>
#include <TROOT.h>
#include <iostream>
fCorrectAngles(kFALSE),
fNXi(1),
fDebug(0)
-{}
+{
+ //
+ // Default Constructor - do not use
+ //
+}
//____________________________________________________________________
AliFMDSharingFilter::AliFMDSharingFilter(const char* title)
fNXi(1),
fDebug(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // title Title of object - not significant
+ //
fRingHistos.Add(new RingHistos(1, 'I'));
fRingHistos.Add(new RingHistos(2, 'I'));
fRingHistos.Add(new RingHistos(2, 'O'));
fNXi(o.fNXi),
fDebug(o.fDebug)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
TIter next(&o.fRingHistos);
TObject* obj = 0;
while ((obj = next())) fRingHistos.Add(obj);
//____________________________________________________________________
AliFMDSharingFilter::~AliFMDSharingFilter()
{
+ //
+ // Destructor
+ //
fRingHistos.Delete();
}
AliFMDSharingFilter&
AliFMDSharingFilter::operator=(const AliFMDSharingFilter& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this
+ //
TNamed::operator=(o);
fLowCut = o.fLowCut;
AliFMDSharingFilter::RingHistos*
AliFMDSharingFilter::GetRingHistos(UShort_t d, Char_t r) const
{
+ //
+ // Get the ring histogram container
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Ring histogram container
+ //
Int_t idx = -1;
switch (d) {
case 1: idx = 0; break;
Bool_t lowFlux,
AliESDFMD& output)
{
+ //
+ // Filter the input AliESDFMD object
+ //
+ // Parameters:
+ // input Input
+ // lowFlux If this is a low-flux event
+ // output Output AliESDFMD object
+ //
+ // Return:
+ // True on success, false otherwise
+ //
output.Clear();
TIter next(&fRingHistos);
RingHistos* o = 0;
UShort_t s,
UShort_t t) const
{
+ //
+ // Get the signal in a strip
+ //
+ // Parameters:
+ // fmd ESD object
+ // d Detector
+ // r Ring
+ // s Sector
+ // t Strip
+ //
+ // Return:
+ // The energy signal
+ //
Double_t mult = input.Multiplicity(d,r,s,t);
if (mult == AliESDFMD::kInvalidMult || mult == 0) return mult;
Double_t
AliFMDSharingFilter::GetLowCut() const
{
+ //
+ // Get the low cut. Normally, the low cut is taken to be the lower
+ // value of the fit range used when generating the energy loss fits.
+ // However, if fLowCut is set (using SetLowCit) to a value greater
+ // than 0, then that value is used.
+ //
if (fLowCut > 0) return fLowCut;
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
AliFMDCorrELossFit* fits = fcm.GetELossFit();
Double_t
AliFMDSharingFilter::GetHighCut(UShort_t d, Char_t r, Double_t eta) const
{
+ //
+ // Get the high cut. The high cut is defined as the
+ // most-probably-value peak found from the energy distributions, minus
+ // 2 times the width of the corresponding Landau.
+ //
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
Bool_t& usedPrev,
Bool_t& usedThis)
{
+ //
+ // The actual algorithm
+ //
+ // Parameters:
+ // mult The unfiltered signal in the strip
+ // eta Psuedo rapidity
+ // prevE Previous strip signal (or 0)
+ // nextE Next strip signal (or 0)
+ // lowFlux Whether this is a low flux event
+ // d Detector
+ // r Ring
+ // s Sector
+ // t Strip
+ // usedPrev Whether the previous strip was used in sharing or not
+ // usedThis Wether this strip was used in sharing or not.
+ //
+ // Return:
+ // The filtered signal in the strip
+ //
+
// IF the multiplicity is very large, or below the cut, reject it, and
// flag it as candidate for sharing
Double_t lowCut = GetLowCut();
Double_t
AliFMDSharingFilter::AngleCorrect(Double_t mult, Double_t eta) const
{
+ //
+ // Angle correct the signal
+ //
+ // Parameters:
+ // mult Angle Un-corrected Signal
+ // eta Pseudo-rapidity
+ //
+ // Return:
+ // Angle corrected signal
+ //
Double_t theta = 2 * TMath::ATan(TMath::Exp(-eta));
if (eta < 0) theta -= TMath::Pi();
return mult * TMath::Cos(theta);
Double_t
AliFMDSharingFilter::DeAngleCorrect(Double_t mult, Double_t eta) const
{
+ //
+ // Angle de-correct the signal
+ //
+ // Parameters:
+ // mult Angle corrected Signal
+ // eta Pseudo-rapidity
+ //
+ // Return:
+ // Angle un-corrected signal
+ //
Double_t theta = 2 * TMath::ATan(TMath::Exp(-eta));
if (eta < 0) theta -= TMath::Pi();
return mult / TMath::Cos(theta);
void
AliFMDSharingFilter::ScaleHistograms(TList* dir, Int_t nEvents)
{
+ //
+ // Scale the histograms to the total number of events
+ //
+ // Parameters:
+ // dir Where the output is
+ // nEvents Number of events
+ //
if (nEvents <= 0) return;
TList* d = static_cast<TList*>(dir->FindObject(GetName()));
if (!d) return;
void
AliFMDSharingFilter::DefineOutput(TList* dir)
{
+ //
+ // Define the output histograms. These are put in a sub list of the
+ // passed list. The histograms are merged before the parent task calls
+ // AliAnalysisTaskSE::Terminate
+ //
+ // Parameters:
+ // dir Directory to add to
+ //
TList* d = new TList;
d->SetName(GetName());
dir->Add(d);
void
AliFMDSharingFilter::Print(Option_t* /*option*/) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
char ind[gROOT->GetDirLevel()+1];
for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
ind[gROOT->GetDirLevel()] = '\0';
fAfter(0),
fHits(0),
fNHits(0)
-{}
+{
+ //
+ // Default CTOR
+ //
+
+}
//____________________________________________________________________
AliFMDSharingFilter::RingHistos::RingHistos(UShort_t d, Char_t r)
fHits(0),
fNHits(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // d detector
+ // r ring
+ //
fBefore = new TH1D(Form("%s_ESD_Eloss", fName.Data()),
Form("Energy loss in %s (reconstruction)", fName.Data()),
1000, 0, 25);
fAfter(o.fAfter),
fHits(o.fHits),
fNHits(o.fNHits)
-{}
+{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
+}
//____________________________________________________________________
AliFMDSharingFilter::RingHistos&
AliFMDSharingFilter::RingHistos::operator=(const RingHistos& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this
+ //
AliForwardUtil::RingHistos::operator=(o);
fDet = o.fDet;
fRing = o.fRing;
//____________________________________________________________________
AliFMDSharingFilter::RingHistos::~RingHistos()
{
+ //
+ // Destructor
+ //
if (fBefore) delete fBefore;
if (fAfter) delete fAfter;
if (fHits) delete fHits;
void
AliFMDSharingFilter::RingHistos::Finish()
{
+ //
+ // Finish off
+ //
+ //
fHits->Fill(fNHits);
}
void
AliFMDSharingFilter::RingHistos::ScaleHistograms(TList* dir, Int_t nEvents)
{
+ //
+ // Scale the histograms to the total number of events
+ //
+ // Parameters:
+ // nEvents Number of events
+ // dir Where the output is
+ //
TList* l = GetOutputList(dir);
if (!l) return;
void
AliFMDSharingFilter::RingHistos::Output(TList* dir)
{
+ //
+ // Make output
+ //
+ // Parameters:
+ // dir where to store
+ //
TList* d = DefineOutputList(dir);
d->Add(fBefore);
d->Add(fAfter);
-#ifndef ALIROOT_PWG2_FORWARD_ALIFMDSHARINGFILTER_H
-#define ALIROOT_PWG2_FORWARD_ALIFMDSHARINGFILTER_H
+//
+// Class to do the sharing correction. That is, a filter that merges
+// adjacent strip signals presumably originating from a single particle
+// that impinges on the detector in such a way that it deposite energy
+// into two or more strips.
+//
+#ifndef ALIFMDSHARINGFILTER_H
+#define ALIFMDSHARINGFILTER_H
#include <TNamed.h>
#include <TH2.h>
#include <TList.h>
+//
+// Manager (singleton) of corrections
+//
#include "AliForwardCorrectionManager.h"
#include "AliForwardUtil.h"
#include <TString.h>
//____________________________________________________________________
AliForwardCorrectionManager& AliForwardCorrectionManager::Instance()
{
+ //
+ // Access to the singleton object
+ //
+ // Return:
+ // Reference to the singleton object
+ //
if (!fgInstance) fgInstance= new AliForwardCorrectionManager;
return *fgInstance;
}
fVertexBias(0),
fMergingEfficiency(0)
{
+ //
+ // Default constructor
+ //
}
//____________________________________________________________________
AliForwardCorrectionManager::AliForwardCorrectionManager(const AliForwardCorrectionManager& o)
fMergingEfficiency(o.fMergingEfficiency)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
}
//____________________________________________________________________
AliForwardCorrectionManager&
AliForwardCorrectionManager::operator=(const AliForwardCorrectionManager& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
fInit = o.fInit;
fSys = o.fSys;
fSNN = o.fSNN;
UInt_t what,
Bool_t force)
{
+ //
+ // Read in correction based on passed parameters
+ //
+ // Parameters:
+ // collisionSystem Collision system string
+ // cmsNN Center of mass energy per nucleon pair [GeV]
+ // field Magnetic field [kG]
+ // mc Monte-carlo switch
+ // what What to read in
+ // force Force (re-)reading of specified things
+ //
+ // Return:
+ // true on success
+ //
UShort_t col = AliForwardUtil::ParseCollisionSystem(cms);
return Init(col,
AliForwardUtil::ParseCenterOfMassEnergy(col, sNN),
UInt_t what,
Bool_t force)
{
+ //
+ // Read in corrections based on the parameters given
+ //
+ // Parameters:
+ // collisionSystem Collision system
+ // cmsNN Center of mass energy per nuclean pair [GeV]
+ // field Magnetic field setting [kG]
+ // mc Monte-carlo switch
+ // what What to read in.
+ // force Force (re-)reading of specified things
+ //
+ // Return:
+ //
+ //
if (force) fInit = kFALSE;
if (fInit) return kTRUE;
Short_t field,
Bool_t mc) const
{
+ //
+ // Get the path to the specified object
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ // mc Whether the correction objects should be valid for MC
+ //
+ // Return:
+ // The full path or null
+ //
TString fname = "";
fname = GetObjectName(what);
fname.Append(Form("_%s_%04dGeV_%c%1dkG_%s.root",
TString
AliForwardCorrectionManager::GetFileName(ECorrection what) const
{
+ //
+ // Get the file name of the specified object
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ //
+ // Return:
+ // The full path or null
+ //
if (!fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return "";
const Char_t*
AliForwardCorrectionManager::GetFileDir(ECorrection what) const
{
+ //
+ // Get the path to the specified object
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ //
+ // Return:
+ // The full path or null
+ //
if (what & kSecondaryMap) return fSecondaryMapPath;
else if (what & kDoubleHit) return fDoubleHitPath;
else if (what & kELossFits) return fELossFitsPath;
Short_t field,
Bool_t mc) const
{
+ //
+ // Get the path to the specified object
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ // mc Whether the correction objects should be valid for MC
+ //
+ // Return:
+ // The full path or null
+ //
TString path = "";
const Char_t* dir = GetFileDir(what);
if (!dir) return path;
TString
AliForwardCorrectionManager::GetFilePath(ECorrection what) const
{
+ //
+ // Get the full path to the object. Note, the manager must be
+ // initialised for this to work
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ //
+ // Return:
+ // The full path or null
+ //
if (!fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return "";
Bool_t rw,
Bool_t newfile) const
{
+ //
+ // Open the file that contains the correction object specified
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ // mc Whether the correction objects should be valid for MC
+ // rw Whether to open the file in read/write
+ // newfile Wheter to make the file if it doesn't exist
+ //
+ // Return:
+ // The file that contains the correction object or null
+ //
TString path = GetFilePath(what, sys, sNN, field, mc);
if (path.IsNull()) return 0;
TFile*
AliForwardCorrectionManager::GetFile(ECorrection what) const
{
+ //
+ // Get the file that contains the object specifed. Note, the manager
+ // must be initialised for this to work.
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ //
+ // Return:
+ // The file that contains the correction object or null
+ //
if (!fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return 0;
const Char_t*
AliForwardCorrectionManager::GetObjectName(ECorrection what) const
{
+ //
+ // Get the object name corresponding to correction type
+ //
+ // Parameters:
+ // what Correction
+ //
+ // Return:
+ // Object name or null
+ //
if (what & kSecondaryMap) return fgkSecondaryMapSkel;
else if (what & kDoubleHit) return fgkDoubleHitSkel;
else if (what & kELossFits) return fgkELossFitsSkel;
TObject*
AliForwardCorrectionManager::CheckObject(TFile* file, ECorrection what) const
{
+ //
+ // Check if the specified objet exists in the file, and return it
+ //
+ // Parameters:
+ // file File to query
+ // what Correction type
+ //
+ // Return:
+ // Object found, or null
+ //
TObject* o = file->Get(GetObjectName(what));
if (!o) {
AliWarning(Form("Object %s not found in %s",
Short_t field,
Bool_t mc) const
{
+ //
+ // Get the path to the specified object
+ //
+ // Parameters:
+ // what Which stuff to get the path for
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ // mc Whether the correction objects should be valid for MC
+ //
+ // Return:
+ // The full path or null
+ //
TFile* file = GetFile(what, sys, sNN, field, mc, false, false);
if (!file) return 0;
TObject*
AliForwardCorrectionManager::GetObject(ECorrection what) const
{
+ //
+ // Get the object that contaisn the specified correction
+ //
+ // Parameters:
+ // what Which object to get
+ //
+ // Return:
+ // The object or null
+ //
if (!fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return 0;
AliForwardCorrectionManager::ReadSecondaryMap(UShort_t sys, UShort_t sNN,
Short_t field)
{
+ //
+ // Read in the secondary map
+ //
+ // Parameters:
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ //
+ // Return:
+ // True on success, false otherwise
+ //
if (fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return kFALSE;
AliForwardCorrectionManager::ReadDoubleHit(UShort_t sys, UShort_t sNN,
Short_t field)
{
+ //
+ // Read in the double hit correction
+ //
+ // Parameters:
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ //
+ // Return:
+ // True on success, false otherwise
+ //
if (fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return kFALSE;
AliForwardCorrectionManager::ReadELossFits(UShort_t sys, UShort_t sNN,
Short_t field, Bool_t mc)
{
+ //
+ // Read in the energy loss fits
+ //
+ // Parameters:
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ // mc Whether the correction objects should be valid for MC
+ //
+ // Return:
+ // True on success, false otherwise
+ //
if (fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return kFALSE;
UShort_t sNN,
Short_t field)
{
+ //
+ // Read in the event selection efficiency
+ //
+ // Parameters:
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ //
+ // Return:
+ // True on success, false otherwise
+ //
if (fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return kFALSE;
UShort_t sNN,
Short_t field)
{
+ //
+ // Read in the merging efficiency
+ //
+ // Parameters:
+ // sys Collision system
+ // sNN Center of mass energy [GeV]
+ // field Magnetic field in the L3 magnet [kG]
+ //
+ // Return:
+ // True on success, false otherwise
+ //
if (fInit) {
AliWarning("Corrections manager initialised, do a forced Init(...)");
return kFALSE;
-#ifndef ALIROOT_PWG2_FORWARD_ALIFORWARDCORRECTIONMANAGER_H
-#define ALIROOT_PWG2_FORWARD_ALIFORWARDCORRECTIONMANAGER_H
+//
+// Manager (singleton) of corrections
+//
+#ifndef ALIFORWARDCORRECTIONMANAGER_H
+#define ALIFORWARDCORRECTIONMANAGER_H
#include <TObject.h>
#include "AliFMDCorrELossFit.h"
#include "AliFMDCorrSecondaryMap.h"
Bool_t mc=false,
UInt_t what=kAll,
Bool_t force=false);
+ /**
+ * Read in correction based on passed parameters
+ *
+ * @param collisionSystem Collision system string
+ * @param cmsNN Center of mass energy per nucleon pair [GeV]
+ * @param field Magnetic field [kG]
+ * @param mc Monte-carlo switch
+ * @param what What to read in
+ * @param force Force (re-)reading of specified things
+ *
+ * @return true on success
+ */
Bool_t Init(const char* collisionSystem,
Float_t cmsNN,
Float_t field,
UShort_t sNN,
Short_t field,
Bool_t mc) const;
+ /**
+ * Get the file name of the specified object
+ *
+ * @param what Which stuff to get the path for
+ *
+ * @return The full path or null
+ */
TString GetFileName(ECorrection what) const;
/**
* Get the path to the specified object
UShort_t sNN,
Short_t field,
Bool_t mc) const;
+ /**
+ * Get the full path to the object. Note, the manager must be
+ * initialised for this to work
+ *
+ * @param what Which stuff to get the path for
+ *
+ * @return The full path or null
+ */
TString GetFilePath(ECorrection what) const;
/**
* Open the file that contains the correction object specified
Bool_t mc=false,
Bool_t rw=false,
Bool_t newfile=false) const;
+ /**
+ * Get the file that contains the object specifed. Note, the manager
+ * must be initialised for this to work.
+ *
+ * @param what Which stuff to get the path for
+ *
+ * @return The file that contains the correction object or null
+ */
TFile* GetFile(ECorrection what) const;
/**
* Get the object name corresponding to correction type
UShort_t sNN,
Short_t field,
Bool_t mc) const;
+ /**
+ * Get the object that contaisn the specified correction
+ *
+ * @param what Which object to get
+ *
+ * @return The object or null
+ */
TObject* GetObject(ECorrection what) const;
/*
* @}
+//
+// Calculate the corrections in the forward regions
+//
+// Inputs:
+// - AliESDEvent
+//
+// Outputs:
+// - AliAODForwardMult
+//
+// Histograms
+//
+// Corrections used
+//
#include "AliForwardMCCorrectionsTask.h"
#include "AliTriggerAnalysis.h"
#include "AliPhysicsSelection.h"
#include "AliLog.h"
-// #include "AliFMDAnaParameters.h"
#include "AliHeader.h"
#include "AliGenEventHeader.h"
#include "AliESDEvent.h"
fEtaAxis(),
fList()
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // name Name of task
+ //
}
//____________________________________________________________________
fEtaAxis(200,-4,6),
fList()
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // name Name of task
+ //
DefineOutput(1, TList::Class());
}
fEtaAxis(o.fEtaAxis.GetNbins(), o.fEtaAxis.GetXmin(), o.fEtaAxis.GetXmax()),
fList(o.fList)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
}
//____________________________________________________________________
AliForwardMCCorrectionsTask&
AliForwardMCCorrectionsTask::operator=(const AliForwardMCCorrectionsTask& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
fHEventsTr = o.fHEventsTr;
fHEventsTrVtx = o.fHEventsTrVtx;
fHTriggers = o.fHTriggers;
void
AliForwardMCCorrectionsTask::Init()
{
+ //
+ // Initialize the task
+ //
+ //
}
//____________________________________________________________________
AliForwardMCCorrectionsTask::SetVertexAxis(Int_t nBin, Double_t min,
Double_t max)
{
+ //
+ // Set the vertex axis to use
+ //
+ // Parameters:
+ // nBins Number of bins
+ // vzMin Least @f$z@f$ coordinate of interation point
+ // vzMax Largest @f$z@f$ coordinate of interation point
+ //
if (max < min) max = -min;
if (min < max) {
Double_t tmp = min;
void
AliForwardMCCorrectionsTask::SetVertexAxis(const TAxis& axis)
{
+ //
+ // Set the vertex axis to use
+ //
+ // Parameters:
+ // axis Axis
+ //
SetVertexAxis(axis.GetNbins(),axis.GetXmin(),axis.GetXmax());
}
void
AliForwardMCCorrectionsTask::SetEtaAxis(Int_t nBin, Double_t min, Double_t max)
{
+ //
+ // Set the eta axis to use
+ //
+ // Parameters:
+ // nBins Number of bins
+ // vzMin Least @f$\eta@f$
+ // vzMax Largest @f$\eta@f$
+ //
if (max < min) max = -min;
if (min < max) {
Double_t tmp = min;
void
AliForwardMCCorrectionsTask::SetEtaAxis(const TAxis& axis)
{
+ //
+ // Set the eta axis to use
+ //
+ // Parameters:
+ // axis Axis
+ //
SetEtaAxis(axis.GetNbins(),axis.GetXmin(),axis.GetXmax());
}
AliForwardMCCorrectionsTask::Make3D(const char* name, const char* title,
Int_t nPhi) const
{
+ //
+ // Make a 3D histogram
+ //
+ // Parameters:
+ // name Name
+ // title Title
+ // nPhi Number of phi bins
+ //
+ // Return:
+ // Histogram
+ //
TH3D* ret = new TH3D(name, title,
fVtxAxis.GetNbins(),
fVtxAxis.GetXmin(),
TH1D*
AliForwardMCCorrectionsTask::Make1D(const char* name, const char* title) const
{
+ //
+ // Make 1D histogram
+ //
+ // Parameters:
+ // name Name
+ // title Title
+ //
+ // Return:
+ // Histogram
+ //
TH1D* ret = new TH1D(name, title,
fEtaAxis.GetNbins(),
fEtaAxis.GetXmin(),
void
AliForwardMCCorrectionsTask::UserCreateOutputObjects()
{
+ //
+ // Create output objects
+ //
+ //
fList = new TList;
fList->SetName(GetName());
void
AliForwardMCCorrectionsTask::UserExec(Option_t*)
{
+ //
+ // Process each event
+ //
+ // Parameters:
+ // option Not used
+ //
+
// Get the input data - MC event
AliMCEvent* mcEvent = MCEvent();
if (mcEvent) {
AliForwardMCCorrectionsTask::FillPrimary(Bool_t gotInel, Bool_t gotVtx,
Double_t vz, Double_t eta, Double_t phi)
{
+ //
+ // Fill in primary information
+ //
+ // Parameters:
+ // gotInel Got INEL trigger from ESD
+ // gotVtx Got vertex Z from ESD
+ // vz @f$z@f$ coordinate of interation point
+ // eta Pseudo rapidity
+ // phi Azimuthal angle
+ //
if (gotInel && gotVtx) {
// This takes the place of hPrimary_FMD_<r>_vtx<v> and
// Analysed_FMD<r>_vtx<v>
Double_t vz, Double_t eta, Double_t phi,
Bool_t first)
{
+ //
+ // Fill in per-strip information
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // vz @f$z@f$ coordinate of interation point
+ // eta Pseudo rapidity
+ // phi Azimuthal angle
+ // first First fill in this event
+ //
+
// Number of hit strips per eta bin
TH1D* strips = 0;
// All hits per ring, vertex in eta,phi bins. This takes the place
TH2D*
AliForwardMCCorrectionsTask::GetVertexProj(Int_t v, TH3D* src) const
{
+ //
+ // Get vertex project
+ //
+ // Parameters:
+ // v Vertex bin
+ // src Source 3D histogram
+ //
+ // Return:
+ // 2D projection of the V'th bin
+ //
Int_t nX = src->GetNbinsX();
if (v > nX || v < 1) return 0;
void
AliForwardMCCorrectionsTask::Terminate(Option_t*)
{
+ //
+ // End of job
+ //
+ // Parameters:
+ // option Not used
+ //
+
TList* list = dynamic_cast<TList*>(GetOutputData(1));
if (!list) {
AliError("No output list defined");
-#ifndef ALIROOT_PWG2_FORWARD_ALIFORWARDCORRECTIONS_H
-#define ALIROOT_PWG2_FORWARD_ALIFORWARDCORRECTIONS_H
+//
+// Calculate the corrections in the forward regions
+//
+#ifndef ALIFORWARDCORRECTIONS_H
+#define ALIFORWARDCORRECTIONS_H
#include <AliAnalysisTaskSE.h>
#include "AliForwardUtil.h"
#include "AliFMDSharingFilter.h"
/**
* @}
*/
+ /**
+ * Print this object
+ *
+ * @param option Not used
+ */
void Print(Option_t* option="") const;
+ /**
+ * Set the vertex axis to use
+ *
+ * @param nBins Number of bins
+ * @param vzMin Least @f$z@f$ coordinate of interation point
+ * @param vzMax Largest @f$z@f$ coordinate of interation point
+ */
void SetVertexAxis(Int_t nBins, Double_t vzMin, Double_t vzMax=-1000000);
+ /**
+ * Set the vertex axis to use
+ *
+ * @param axis Axis
+ */
void SetVertexAxis(const TAxis& axis);
+ /**
+ * Set the eta axis to use
+ *
+ * @param nBins Number of bins
+ * @param vzMin Least @f$\eta@f$
+ * @param vzMax Largest @f$\eta@f$
+ */
void SetEtaAxis(Int_t nBins, Double_t etaMin, Double_t etaMax=-1000000);
+ /**
+ * Set the eta axis to use
+ *
+ * @param axis Axis
+ */
void SetEtaAxis(const TAxis& axis);
protected:
+ /**
+ * Get vertex project
+ *
+ * @param v Vertex bin
+ * @param src Source 3D histogram
+ *
+ * @return 2D projection of the V'th bin
+ */
TH2D* GetVertexProj(Int_t v, TH3D* src) const;
+ /**
+ * Make a 3D histogram
+ *
+ * @param name Name
+ * @param title Title
+ * @param nPhi Number of phi bins
+ *
+ * @return Histogram
+ */
TH3D* Make3D(const char* name, const char* title, Int_t nPhi) const;
+ /**
+ * Make 1D histogram
+ *
+ * @param name Name
+ * @param title Title
+ *
+ * @return Histogram
+ */
TH1D* Make1D(const char* name, const char* title) const;
+ /**
+ * Fill in primary information
+ *
+ * @param gotInel Got INEL trigger from ESD
+ * @param gotVtx Got vertex Z from ESD
+ * @param vz @f$z@f$ coordinate of interation point
+ * @param eta Pseudo rapidity
+ * @param phi Azimuthal angle
+ */
void FillPrimary(Bool_t gotInel, Bool_t gotVtx,
Double_t vz, Double_t eta, Double_t phi);
+ /**
+ * Fill in per-strip information
+ *
+ * @param d Detector
+ * @param r Ring
+ * @param vz @f$z@f$ coordinate of interation point
+ * @param eta Pseudo rapidity
+ * @param phi Azimuthal angle
+ * @param first First fill in this event
+ */
void FillStrip(UShort_t d, Char_t r,
Double_t vz, Double_t eta, Double_t phi,
Bool_t first);
+//
+// Calculate the multiplicity in the forward regions event-by-event
+//
+// Inputs:
+// - AliESDEvent
+// - Kinematics
+// - Track references
+//
+// Outputs:
+// - AliAODForwardMult
+//
+// Histograms
+//
+// Corrections used
+//
#include "AliForwardMCMultiplicityTask.h"
#include "AliTriggerAnalysis.h"
#include "AliPhysicsSelection.h"
#include "AliLog.h"
-// #include "AliFMDAnaParameters.h"
#include "AliESDEvent.h"
#include "AliAODHandler.h"
#include "AliMultiplicity.h"
fHistCollector(),
fList(0)
{
+ //
+ // Constructor
+ //
}
//____________________________________________________________________
fHistCollector("collector"),
fList(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // name Name of task
+ //
DefineOutput(1, TList::Class());
}
fHistCollector(o.fHistCollector),
fList(o.fList)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
DefineOutput(1, TList::Class());
}
AliForwardMCMultiplicityTask&
AliForwardMCMultiplicityTask::operator=(const AliForwardMCMultiplicityTask& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
AliForwardMultiplicityBase::operator=(o);
fHData = o.fHData;
void
AliForwardMCMultiplicityTask::SetDebug(Int_t dbg)
{
+ //
+ // Set debug level
+ //
+ // Parameters:
+ // dbg debug level
+ //
fEventInspector.SetDebug(dbg);
fEnergyFitter.SetDebug(dbg);
fSharingFilter.SetDebug(dbg);
void
AliForwardMCMultiplicityTask::InitializeSubs()
{
+ //
+ // Initialise the sub objects and stuff. Called on first event
+ //
+ //
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
fcm.Init(fEventInspector.GetCollisionSystem(),
fEventInspector.GetEnergy(),
void
AliForwardMCMultiplicityTask::UserCreateOutputObjects()
{
+ //
+ // Create output objects
+ //
+ //
fList = new TList;
AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
void
AliForwardMCMultiplicityTask::UserExec(Option_t*)
{
+ //
+ // Process each event
+ //
+ // Parameters:
+ // option Not used
+ //
+
// Get the input data
AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
if (!esd) {
void
AliForwardMCMultiplicityTask::Terminate(Option_t*)
{
+ //
+ // End of job
+ //
+ // Parameters:
+ // option Not used
+ //
TList* list = dynamic_cast<TList*>(GetOutputData(1));
if (!list) {
AliError(Form("No output list defined (%p)", GetOutputData(1)));
void
AliForwardMCMultiplicityTask::Print(Option_t* option) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
AliForwardMultiplicityBase::Print(option);
gROOT->IncreaseDirLevel();
fEventInspector .Print(option);
+//
+// Calculate the multiplicity in the forward regions event-by-event
+//
#ifndef ALIFORWARDMCMULTIPLICITYTASK_H
#define ALIFORWARDMCMULTIPLICITYTASK_H
#include "AliForwardMultiplicityBase.h"
*
* @par Inputs:
* - AliESDEvent
+ * - Kinematics
+ * - Track references
*
* @par Outputs:
* - AliAODForwardMult
/**
* @}
*/
+ /**
+ * Set debug level
+ *
+ * @param dbg debug level
+ */
void SetDebug(Int_t dbg);
protected:
/**
//====================================================================
-/**
- * @file
- *
- * @ingroup pwg2_forward_tasks
- */
+//
+// Base class for classes that calculate the multiplicity in the
+// forward regions event-by-event
+//
+// Inputs:
+// - AliESDEvent
+//
+// Outputs:
+// - AliAODForwardMult
+//
+// Histograms
+//
+// Corrections used
#include "AliForwardMultiplicityBase.h"
#include "AliLog.h"
#include "AliAODHandler.h"
void
AliForwardMultiplicityBase::Print(Option_t* option) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
std::cout << "AliForwardMultiplicityBase: " << GetName() << "\n"
<< " Enable low flux code: " << (fEnableLowFlux ? "yes" : "no")
<< std::endl;
+//
+// Base class for classes that calculate the multiplicity in the
+// forward regions event-by-event
+//
#ifndef ALIFORWARDMULTIPLICITYBASE_H
#define ALIFORWARDMULTIPLICITYBASE_H
#include <AliAnalysisTaskSE.h>
#include "AliForwardUtil.h"
-// #include "AliFMDEventInspector.h"
-// #include "AliFMDEnergyFitter.h"
-// #include "AliFMDSharingFilter.h"
-// #include "AliFMDDensityCalculator.h"
-// #include "AliFMDCorrections.h"
-// #include "AliFMDHistCollector.h"
-// #include "AliAODForwardMult.h"
-// #include "AliFMDEnergyFitter.h"
-// #include <AliESDFMD.h>
-// #include <TH1I.h>
class AliFMDEventInspector;
class AliFMDEnergyFitter;
class AliFMDSharingFilter;
* @ingroup pwg2_forward
*/
/**
- * Calculate the multiplicity in the forward regions event-by-event
+ * Base class for classes that calculate the multiplicity in the
+ * forward regions event-by-event
*
* @par Inputs:
* - AliESDEvent
+//
+// Calculate the multiplicity in the forward regions event-by-event
+//
+// Inputs:
+// - AliESDEvent
+//
+// Outputs:
+// - AliAODForwardMult
+//
+// Histograms
+//
+// Corrections used
+//
#include "AliForwardMultiplicityTask.h"
#include "AliTriggerAnalysis.h"
#include "AliPhysicsSelection.h"
#include "AliLog.h"
-// #include "AliFMDAnaParameters.h"
#include "AliESDEvent.h"
#include "AliAODHandler.h"
#include "AliMultiplicity.h"
fHistCollector(),
fList(0)
{
+ //
+ // Constructor
+ //
}
//____________________________________________________________________
fHistCollector("collector"),
fList(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // name Name of task
+ //
DefineOutput(1, TList::Class());
}
fHistCollector(o.fHistCollector),
fList(o.fList)
{
+ //
+ // Copy constructor
+ //
+ // Parameters:
+ // o Object to copy from
+ //
DefineOutput(1, TList::Class());
}
AliForwardMultiplicityTask&
AliForwardMultiplicityTask::operator=(const AliForwardMultiplicityTask& o)
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // o Object to assign from
+ //
+ // Return:
+ // Reference to this object
+ //
AliForwardMultiplicityBase::operator=(o);
fHData = o.fHData;
void
AliForwardMultiplicityTask::SetDebug(Int_t dbg)
{
+ //
+ // Set debug level
+ //
+ // Parameters:
+ // dbg Debug level
+ //
fEventInspector.SetDebug(dbg);
fEnergyFitter.SetDebug(dbg);
fSharingFilter.SetDebug(dbg);
void
AliForwardMultiplicityTask::InitializeSubs()
{
+ //
+ // Initialise the sub objects and stuff. Called on first event
+ //
+ //
AliForwardCorrectionManager& fcm = AliForwardCorrectionManager::Instance();
fcm.Init(fEventInspector.GetCollisionSystem(),
fEventInspector.GetEnergy(),
void
AliForwardMultiplicityTask::UserCreateOutputObjects()
{
+ //
+ // Create output objects
+ //
+ //
fList = new TList;
AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
void
AliForwardMultiplicityTask::UserExec(Option_t*)
{
+ //
+ // Process each event
+ //
+ // Parameters:
+ // option Not used
+ //
+
// static Int_t cnt = 0;
// cnt++;
// Get the input data
void
AliForwardMultiplicityTask::Terminate(Option_t*)
{
+ //
+ // End of job
+ //
+ // Parameters:
+ // option Not used
+ //
+
TList* list = dynamic_cast<TList*>(GetOutputData(1));
if (!list) {
AliError(Form("No output list defined (%p)", GetOutputData(1)));
void
AliForwardMultiplicityTask::Print(Option_t* option) const
{
+ //
+ // Print information
+ //
+ // Parameters:
+ // option Not used
+ //
AliForwardMultiplicityBase::Print(option);
gROOT->IncreaseDirLevel();
fEventInspector .Print(option);
+//
+// Calculate the multiplicity in the forward regions event-by-event
+//
#ifndef ALIFORWARDMULTIPLICITYTASK_H
#define ALIFORWARDMULTIPLICITYTASK_H
#include "AliForwardMultiplicityBase.h"
/**
* @}
*/
+ /**
+ * Set debug level
+ *
+ * @param dbg Debug level
+ */
void SetDebug(Int_t dbg);
protected:
/**
+//
+// Utilities used in the forward multiplcity analysis
+//
+//
#include "AliForwardUtil.h"
#include <AliAnalysisManager.h>
#include "AliAODForwardMult.h"
UShort_t
AliForwardUtil::ParseCollisionSystem(const char* sys)
{
+ //
+ // Parse a collision system spec given in a string. Known values are
+ //
+ // - "pp", "p-p" which returns kPP
+ // - "PbPb", "Pb-Pb", "A-A", which returns kPbPb
+ // - Everything else gives kUnknown
+ //
+ // Parameters:
+ // sys Collision system spec
+ //
+ // Return:
+ // Collision system id
+ //
TString s(sys);
s.ToLower();
if (s.Contains("p-p") || s.Contains("pp")) return AliForwardUtil::kPP;
const char*
AliForwardUtil::CollisionSystemString(UShort_t sys)
{
+ //
+ // Get a string representation of the collision system
+ //
+ // Parameters:
+ // sys Collision system
+ // - kPP -> "pp"
+ // - kPbPb -> "PbPb"
+ // - anything else gives "unknown"
+ //
+ // Return:
+ // String representation of the collision system
+ //
switch (sys) {
case AliForwardUtil::kPP: return "pp";
case AliForwardUtil::kPbPb: return "PbPb";
UShort_t
AliForwardUtil::ParseCenterOfMassEnergy(UShort_t sys, Float_t v)
{
+ //
+ // Parse the center of mass energy given as a float and return known
+ // values as a unsigned integer
+ //
+ // Parameters:
+ // sys Collision system (needed for AA)
+ // cms Center of mass energy * total charge
+ //
+ // Return:
+ // Center of mass energy per nucleon
+ //
Float_t energy = v;
if (sys != AliForwardUtil::kPP) energy = energy / 208 * 82;
if (TMath::Abs(energy - 900.) < 10) return 900;
const char*
AliForwardUtil::CenterOfMassEnergyString(UShort_t cms)
{
+ //
+ // Get a string representation of the center of mass energy per nuclean
+ //
+ // Parameters:
+ // cms Center of mass energy per nucleon
+ //
+ // Return:
+ // String representation of the center of mass energy per nuclean
+ //
return Form("%04dGeV", cms);
}
//____________________________________________________________________
Short_t
AliForwardUtil::ParseMagneticField(Float_t v)
{
+ //
+ // Parse the magnetic field (in kG) as given by a floating point number
+ //
+ // Parameters:
+ // field Magnetic field in kG
+ //
+ // Return:
+ // Short integer value of magnetic field in kG
+ //
if (TMath::Abs(v - 5.) < 1 ) return +5;
if (TMath::Abs(v + 5.) < 1 ) return -5;
if (TMath::Abs(v) < 1) return 0;
const char*
AliForwardUtil::MagneticFieldString(Short_t f)
{
+ //
+ // Get a string representation of the magnetic field
+ //
+ // Parameters:
+ // field Magnetic field in kG
+ //
+ // Return:
+ // String representation of the magnetic field
+ //
return Form("%01dkG", f);
}
Int_t AliForwardUtil::fgConvolutionSteps = 100;
Double_t AliForwardUtil::fgConvolutionNSigma = 5;
namespace {
- /**
- * The shift of the most probable value for the ROOT function TMath::Landau
- */
+ //
+ // The shift of the most probable value for the ROOT function TMath::Landau
+ //
const Double_t mpshift = -0.22278298;
- /**
- * Integration normalisation
- */
+ //
+ // Integration normalisation
+ //
const Double_t invSq2pi = 1. / TMath::Sqrt(2*TMath::Pi());
- /**
- * Utility function to use in TF1 defintition
- */
+ //
+ // Utility function to use in TF1 defintition
+ //
Double_t landauGaus1(Double_t* xp, Double_t* pp)
{
Double_t x = xp[0];
return constant * AliForwardUtil::LandauGaus(x, delta, xi, sigma, sigma_n);
}
- /**
- * Utility function to use in TF1 defintition
- */
+ //
+ // Utility function to use in TF1 defintition
+ //
Double_t landauGausN(Double_t* xp, Double_t* pp)
{
Double_t x = xp[0];
return constant * AliForwardUtil::NLandauGaus(x, delta, xi, sigma, sigma_n,
n, a);
}
- /**
- * Utility function to use in TF1 defintition
- */
+ //
+ // Utility function to use in TF1 defintition
+ //
Double_t landauGausI(Double_t* xp, Double_t* pp)
{
Double_t x = xp[0];
Double_t
AliForwardUtil::Landau(Double_t x, Double_t delta, Double_t xi)
{
+ //
+ // Calculate the shifted Landau
+ // @f[
+ // f'_{L}(x;\Delta,\xi) = f_L(x;\Delta+0.22278298\xi)
+ // @f]
+ //
+ // where @f$ f_{L}@f$ is the ROOT implementation of the Landau
+ // distribution (known to have @f$ \Delta_{p}=-0.22278298@f$ for
+ // @f$\Delta=0,\xi=1@f$.
+ //
+ // Parameters:
+ // x Where to evaluate @f$ f'_{L}@f$
+ // delta Most probable value
+ // xi The 'width' of the distribution
+ //
+ // Return:
+ // @f$ f'_{L}(x;\Delta,\xi) @f$
+ //
return TMath::Landau(x, delta - xi * mpshift, xi);
}
//____________________________________________________________________
AliForwardUtil::LandauGaus(Double_t x, Double_t delta, Double_t xi,
Double_t sigma, Double_t sigma_n)
{
+ //
+ // Calculate the value of a Landau convolved with a Gaussian
+ //
+ // @f[
+ // f(x;\Delta,\xi,\sigma') = \frac{1}{\sigma' \sqrt{2 \pi}}
+ // \int_{-\infty}^{+\infty} d\Delta' f'_{L}(x;\Delta',\xi)
+ // \exp{-\frac{(\Delta-\Delta')^2}{2\sigma'^2}}
+ // @f]
+ //
+ // where @f$ f'_{L}@f$ is the Landau distribution, @f$ \Delta@f$ the
+ // energy loss, @f$ \xi@f$ the width of the Landau, and
+ // @f$ \sigma'^2=\sigma^2-\sigma_n^2 @f$. Here, @f$\sigma@f$ is the
+ // variance of the Gaussian, and @f$\sigma_n@f$ is a parameter modelling
+ // noise in the detector.
+ //
+ // Note that this function uses the constants fgConvolutionSteps and
+ // fgConvolutionNSigma
+ //
+ // References:
+ // - <a href="http://dx.doi.org/10.1016/0168-583X(84)90472-5">Nucl.Instrum.Meth.B1:16</a>
+ // - <a href="http://dx.doi.org/10.1103/PhysRevA.28.615">Phys.Rev.A28:615</a>
+ // - <a href="http://root.cern.ch/root/htmldoc/tutorials/fit/langaus.C.html">ROOT implementation</a>
+ //
+ // Parameters:
+ // x where to evaluate @f$ f@f$
+ // delta @f$ \Delta@f$ of @f$ f(x;\Delta,\xi,\sigma')@f$
+ // xi @f$ \xi@f$ of @f$ f(x;\Delta,\xi,\sigma')@f$
+ // sigma @f$ \sigma@f$ of @f$\sigma'^2=\sigma^2-\sigma_n^2 @f$
+ // sigma_n @f$ \sigma_n@f$ of @f$\sigma'^2=\sigma^2-\sigma_n^2 @f$
+ //
+ // Return:
+ // @f$ f@f$ evaluated at @f$ x@f$.
+ //
Double_t deltap = delta - xi * mpshift;
Double_t sigma2 = sigma_n*sigma_n + sigma*sigma;
Double_t sigma1 = sigma_n == 0 ? sigma : TMath::Sqrt(sigma2);
AliForwardUtil::ILandauGaus(Double_t x, Double_t delta, Double_t xi,
Double_t sigma, Double_t sigma_n, Int_t i)
{
+ //
+ // Evaluate
+ // @f[
+ // f_i(x;\Delta,\xi,\sigma') = f(x;\Delta_i,\xi_i,\sigma_i')
+ // @f]
+ // corresponding to @f$ i@f$ particles i.e., with the substitutions
+ // @f{eqnarray*}{
+ // \Delta \rightarrow \Delta_i &=& i(\Delta + \xi\log(i))
+ // \xi \rightarrow \xi_i &=& i \xi
+ // \sigma \rightarrow \sigma_i &=& \sqrt{i}\sigma
+ // \sigma'^2 \rightarrow \sigma_i'^2 &=& \sigma_n^2 + \sigma_i^2
+ // @f}
+ //
+ // Parameters:
+ // x Where to evaluate
+ // delta @f$ \Delta@f$
+ // xi @f$ \xi@f$
+ // sigma @f$ \sigma@f$
+ // sigma_n @f$ \sigma_n@f$
+ // i @f$ i @f$
+ //
+ // Return:
+ // @f$ f_i @f$ evaluated
+ //
Double_t delta_i = (i == 1 ? delta : i * (delta + xi * TMath::Log(i)));
Double_t xi_i = i * xi;
Double_t sigma_i = (i == 1 ? sigma : TMath::Sqrt(Double_t(i))*sigma);
Double_t sigma, Double_t sigma_n,
Int_t i)
{
+ //
+ // Numerically evaluate
+ // @f[
+ // \left.\frac{\partial f_i}{\partial p_i}\right|_{x}
+ // @f]
+ // where @f$ p_i@f$ is the @f$ i^{\mbox{th}}@f$ parameter. The mapping
+ // of the parameters is given by
+ //
+ // - 0: @f$\Delta@f$
+ // - 1: @f$\xi@f$
+ // - 2: @f$\sigma@f$
+ // - 3: @f$\sigma_n@f$
+ //
+ // This is the partial derivative with respect to the parameter of
+ // the response function corresponding to @f$ i@f$ particles i.e.,
+ // with the substitutions
+ // @f[
+ // \Delta \rightarrow \Delta_i = i(\Delta + \xi\log(i))
+ // \xi \rightarrow \xi_i = i \xi
+ // \sigma \rightarrow \sigma_i = \sqrt{i}\sigma
+ // \sigma'^2 \rightarrow \sigma_i'^2 = \sigma_n^2 + \sigma_i^2
+ // @f]
+ //
+ // Parameters:
+ // x Where to evaluate
+ // ipar Parameter number
+ // dp @f$ \epsilon\delta p_i@f$ for some value of @f$\epsilon@f$
+ // delta @f$ \Delta@f$
+ // xi @f$ \xi@f$
+ // sigma @f$ \sigma@f$
+ // sigma_n @f$ \sigma_n@f$
+ // i @f$ i@f$
+ //
+ // Return:
+ // @f$ f_i@f$ evaluated
+ //
if (dPar == 0) return 0;
Double_t dp = dPar;
Double_t d2 = dPar / 2;
Double_t sigma, Double_t sigma_n, Int_t n,
Double_t* a)
{
+ //
+ // Evaluate
+ // @f[
+ // f_N(x;\Delta,\xi,\sigma') = \sum_{i=1}^N a_i f_i(x;\Delta,\xi,\sigma'a)
+ // @f]
+ //
+ // where @f$ f(x;\Delta,\xi,\sigma')@f$ is the convolution of a
+ // Landau with a Gaussian (see LandauGaus). Note that
+ // @f$ a_1 = 1@f$, @f$\Delta_i = i(\Delta_1 + \xi\log(i))@f$,
+ // @f$\xi_i=i\xi_1@f$, and @f$\sigma_i'^2 = \sigma_n^2 + i\sigma_1^2@f$.
+ //
+ // References:
+ // - <a href="http://dx.doi.org/10.1016/0168-583X(84)90472-5">Nucl.Instrum.Meth.B1:16</a>
+ // - <a href="http://dx.doi.org/10.1103/PhysRevA.28.615">Phys.Rev.A28:615</a>
+ // - <a href="http://root.cern.ch/root/htmldoc/tutorials/fit/langaus.C.html">ROOT implementation</a>
+ //
+ // Parameters:
+ // x Where to evaluate @f$ f_N@f$
+ // delta @f$ \Delta_1@f$
+ // xi @f$ \xi_1@f$
+ // sigma @f$ \sigma_1@f$
+ // sigma_n @f$ \sigma_n@f$
+ // n @f$ N@f$ in the sum above.
+ // a Array of size @f$ N-1@f$ of the weights @f$ a_i@f$ for
+ // @f$ i > 1@f$
+ //
+ // Return:
+ // @f$ f_N(x;\Delta,\xi,\sigma')@f$
+ //
Double_t result = ILandauGaus(x, delta, xi, sigma, sigma_n, 1);
for (Int_t i = 2; i <= n; i++)
result += a[i-2] * AliForwardUtil::ILandauGaus(x,delta,xi,sigma,sigma_n,i);
Double_t* a,
Double_t xmin, Double_t xmax)
{
+ //
+ // Generate a TF1 object of @f$ f_N@f$
+ //
+ // Parameters:
+ // c Constant
+ // delta @f$ \Delta@f$
+ // xi @f$ \xi_1@f$
+ // sigma @f$ \sigma_1@f$
+ // sigma_n @f$ \sigma_n@f$
+ // n @f$ N@f$ - how many particles to sum to
+ // a Array of size @f$ N-1@f$ of the weights @f$ a_i@f$ for
+ // @f$ i > 1@f$
+ // xmin Least value of range
+ // xmax Largest value of range
+ //
+ // Return:
+ // Newly allocated TF1 object
+ //
Int_t npar = AliForwardUtil::ELossFitter::kN+n;
TF1* landaun = new TF1(Form("nlandau%d", n), &landauGausN,xmin,xmax,npar);
// landaun->SetLineStyle(((n-2) % 10)+2); // start at dashed
Double_t sigma, Double_t sigma_n, Int_t i,
Double_t xmin, Double_t xmax)
{
+ //
+ // Generate a TF1 object of @f$ f_I@f$
+ //
+ // Parameters:
+ // c Constant
+ // delta @f$ \Delta@f$
+ // xi @f$ \xi_1@f$
+ // sigma @f$ \sigma_1@f$
+ // sigma_n @f$ \sigma_n@f$
+ // i @f$ i@f$ - the number of particles
+ // xmin Least value of range
+ // xmax Largest value of range
+ //
+ // Return:
+ // Newly allocated TF1 object
+ //
Int_t npar = AliForwardUtil::ELossFitter::kN+1;
TF1* landaui = new TF1(Form("ilandau%d", i), &landauGausI,xmin,xmax,npar);
// landaui->SetLineStyle(((i-2) % 10)+2); // start at dashed
: fLowCut(lowCut), fMaxRange(maxRange), fMinusBins(minusBins),
fFitResults(0), fFunctions(0)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // lowCut Lower cut of spectrum - data below this cuts is ignored
+ // maxRange Maximum range to fit to
+ // minusBins The number of bins below maximum to use
+ //
fFitResults.SetOwner();
fFunctions.SetOwner();
}
//____________________________________________________________________
AliForwardUtil::ELossFitter::~ELossFitter()
{
+ //
+ // Destructor
+ //
+ //
fFitResults.Delete();
fFunctions.Delete();
}
void
AliForwardUtil::ELossFitter::Clear()
{
+ //
+ // Clear internal arrays
+ //
+ //
fFitResults.Clear();
fFunctions.Clear();
}
TF1*
AliForwardUtil::ELossFitter::Fit1Particle(TH1* dist, Double_t sigman)
{
+ //
+ // Fit a 1-particle signal to the passed energy loss distribution
+ //
+ // Note that this function clears the internal arrays first
+ //
+ // Parameters:
+ // dist Data to fit the function to
+ // sigman If larger than zero, the initial guess of the
+ // detector induced noise. If zero or less, then this
+ // parameter is ignored in the fit (fixed at 0)
+ //
+ // Return:
+ // The function fitted to the data
+ //
+
// Clear the cache
Clear();
AliForwardUtil::ELossFitter::FitNParticle(TH1* dist, UShort_t n,
Double_t sigman)
{
+ //
+ // Fit a N-particle signal to the passed energy loss distribution
+ //
+ // If there's no 1-particle fit present, it does that first
+ //
+ // Parameters:
+ // dist Data to fit the function to
+ // n Number of particle signals to fit
+ // sigman If larger than zero, the initial guess of the
+ // detector induced noise. If zero or less, then this
+ // parameter is ignored in the fit (fixed at 0)
+ //
+ // Return:
+ // The function fitted to the data
+ //
+
// Get the seed fit result
TFitResult* r = static_cast<TFitResult*>(fFitResults.At(0));
TF1* f = static_cast<TF1*>(fFunctions.At(0));
//====================================================================
AliForwardUtil::Histos::~Histos()
{
+ //
+ // Destructor
+ //
if (fFMD1i) delete fFMD1i;
if (fFMD2i) delete fFMD2i;
if (fFMD2o) delete fFMD2o;
AliForwardUtil::Histos::Make(UShort_t d, Char_t r,
const TAxis& etaAxis) const
{
+ //
+ // Make a histogram
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // etaAxis Eta axis to use
+ //
+ // Return:
+ // Newly allocated histogram
+ //
Int_t ns = (r == 'I' || r == 'i') ? 20 : 40;
TH2D* hist = new TH2D(Form("FMD%d%c_cache", d, r),
Form("FMD%d%c cache", d, r),
void
AliForwardUtil::Histos::Init(const TAxis& etaAxis)
{
+ //
+ // Initialize the object
+ //
+ // Parameters:
+ // etaAxis Eta axis to use
+ //
fFMD1i = Make(1, 'I', etaAxis);
fFMD2i = Make(2, 'I', etaAxis);
fFMD2o = Make(2, 'O', etaAxis);
void
AliForwardUtil::Histos::Clear(Option_t* option)
{
+ //
+ // Clear data
+ //
+ // Parameters:
+ // option Not used
+ //
fFMD1i->Reset(option);
fFMD2i->Reset(option);
fFMD2o->Reset(option);
TH2D*
AliForwardUtil::Histos::Get(UShort_t d, Char_t r) const
{
+ //
+ // Get the histogram for a particular detector,ring
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ //
+ // Return:
+ // Histogram for detector,ring or nul
+ //
switch (d) {
case 1: return fFMD1i;
case 2: return (r == 'I' || r == 'i' ? fFMD2i : fFMD2o);
TList*
AliForwardUtil::RingHistos::DefineOutputList(TList* d) const
{
+ //
+ // Define the outout list in @a d
+ //
+ // Parameters:
+ // d Where to put the output list
+ //
+ // Return:
+ // Newly allocated TList object or null
+ //
if (!d) return 0;
TList* list = new TList;
list->SetName(fName.Data());
TList*
AliForwardUtil::RingHistos::GetOutputList(TList* d) const
{
+ //
+ // Get our output list from the container @a d
+ //
+ // Parameters:
+ // d where to get the output list from
+ //
+ // Return:
+ // The found TList or null
+ //
if (!d) return 0;
TList* list = static_cast<TList*>(d->FindObject(fName.Data()));
return list;
TH1*
AliForwardUtil::RingHistos::GetOutputHist(TList* d, const char* name) const
{
+ //
+ // Find a specific histogram in the source list @a d
+ //
+ // Parameters:
+ // d (top)-container
+ // name Name of histogram
+ //
+ // Return:
+ // Found histogram or null
+ //
return static_cast<TH1*>(d->FindObject(name));
}
-#ifndef ALIROOT_PWG2_FORWARD_ALIFORWARDUTIL_H
-#define ALIROOT_PWG2_FORWARD_ALIFORWARDUTIL_H
+//
+// Utilities used in the forward multiplcity analysis
+//
+//
+#ifndef ALIFORWARDUTIL_H
+#define ALIFORWARDUTIL_H
#include <TObject.h>
#include <TString.h>
#include <TObjArray.h>
* @param minusBins The number of bins below maximum to use
*/
ELossFitter(Double_t lowCut, Double_t maxRange, UShort_t minusBins);
+ /**
+ * Destructor
+ *
+ */
virtual ~ELossFitter();
/**
* Clear internal arrays
return *this;
}
/**
+ * Define the outout list in @a d
*
+ * @param d Where to put the output list
*
- * @param d
- *
- * @return
+ * @return Newly allocated TList object or null
*/
TList* DefineOutputList(TList* d) const;
/**
+ * Get our output list from the container @a d
*
+ * @param d where to get the output list from
*
- * @param d
- *
- * @return
+ * @return The found TList or null
*/
TList* GetOutputList(TList* d) const;
/**
+ * Find a specific histogram in the source list @a d
*
+ * @param d (top)-container
+ * @param name Name of histogram
*
- * @param d
- * @param name
- *
- * @return
+ * @return Found histogram or null
*/
TH1* GetOutputHist(TList* d, const char* name) const;
/**