+//
+// Class that contains the forward multiplicity data per event
+//
+// This class contains a histogram of
+// @f[
+// \frac{d^2N_{ch}}{d\eta d\phi}\quad,
+// @f]
+// as well as a trigger mask for each analysed event.
+//
+// The eta acceptance of the event is stored in the underflow bins of
+// the histogram. So to build the final histogram, one needs to
+// correct for this acceptance (properly weighted by the events), and
+// the vertex efficiency. This simply boils down to defining a 2D
+// histogram and summing the event histograms in that histogram. One
+// should of course also do proper book-keeping of the accepted event.
+//
#include "AliAODForwardMult.h"
#include <TBrowser.h>
#include <iostream>
//____________________________________________________________________
AliAODForwardMult::AliAODForwardMult()
- : fHist(),
+ : fIsMC(false),
+ fHist(),
fTriggers(0),
fIpZ(fgkInvalidIpZ)
-{}
+{
+ //
+ // Constructor
+ //
+}
//____________________________________________________________________
-AliAODForwardMult::AliAODForwardMult(Bool_t)
- : fHist("forwardMult", "d^{2}N_{ch}/d#etad#varphi in the forward regions",
+AliAODForwardMult::AliAODForwardMult(Bool_t isMC)
+ : fIsMC(isMC),
+ fHist("forwardMult", "d^{2}N_{ch}/d#etad#varphi in the forward regions",
200, -4, 6, 20, 0, 2*TMath::Pi()),
fTriggers(0),
fIpZ(fgkInvalidIpZ)
{
+ //
+ // Constructor
+ //
+ // Parameters:
+ // isMC If set to true this is for MC data (effects branch name)
+ //
fHist.SetXTitle("#eta");
fHist.SetYTitle("#varphi [radians]");
fHist.SetZTitle("#frac{d^{2}N_{ch}}{d#etad#varphi}");
+ fHist.SetDirectory(0);
fHist.Sumw2();
}
void
AliAODForwardMult::Init(const TAxis& etaAxis)
{
+ // Initialize the histogram with an eta axis
+ //
+ // Parameters:
+ // etaAxis Eta axis to use
+ //
fHist.SetBins(etaAxis.GetNbins(), etaAxis.GetXmin(), etaAxis.GetXmax(),
20, 0, 2*TMath::Pi());
}
void
AliAODForwardMult::Clear(Option_t* option)
{
+ // Clear (or reset) internal values
+ //
+ // Parameters:
+ // option Passed to TH1::Reset
+ //
fHist.Reset(option);
fTriggers = 0;
fIpZ = fgkInvalidIpZ;
Bool_t
AliAODForwardMult::HasIpZ() const
{
+ // Check if we have valid z coordinate of the interaction point
+ //
+ // Return:
+ // true if the z coordinate of the interaction point is valid
+ //
return TMath::Abs(fIpZ - fgkInvalidIpZ) > 1;
}
void
AliAODForwardMult::Browse(TBrowser* b)
{
+ // Browse this object
+ //
+ // Parameters:
+ // b Browser to use
static TObjString ipz;
static TObjString trg;
ipz = Form("ip_z=%fcm", fIpZ);
const Char_t*
AliAODForwardMult::GetTriggerString(UInt_t mask)
{
+ // Get a string that describes the triggers
+ //
+ // Parameters:
+ // mask Bit pattern of triggers
+ // Return:
+ // Character string representation of mask
static TString trg;
trg = "";
if ((mask & kInel) != 0x0) trg.Append("INEL ");
void
AliAODForwardMult::Print(Option_t* option) const
{
+ // Print this object
+ //
+ // Parameters:
+ // option Passed to TH1::Print
fHist.Print(option);
std::cout << "Ipz: " << fIpZ << "cm " << (HasIpZ() ? "" : "in")
<< "valid\n"
-#ifndef ALIROOT_PWG2_FORWARD_ANALYSIS_ALIAODFORWARDMULT_H
-#define ALIROOT_PWG2_FORWARD_ANALYSIS_ALIAODFORWARDMULT_H
+//
+// See implementation or Doxygen comments for more information
+//
+#ifndef ALIAODFORWARDMULT_H
+#define ALIAODFORWARDMULT_H
#include <TObject.h>
#include <TH2D.h>
class TBrowser;
/**
* Constructor
*
+ * @param isMC Whether this was from MC or not
*/
- AliAODForwardMult(Bool_t);
+ AliAODForwardMult(Bool_t isMC);
/**
* Destructor
*/
- ~AliAODForwardMult() {}
+ virtual ~AliAODForwardMult() {} // Destructor
/**
* Initialize
*
*
* @return @f$ d^2N_{ch}/d\eta d\phi@f$ histogram,
*/
- const TH2D& GetHistogram() const { return fHist; }
+ const TH2D& GetHistogram() const { return fHist; } // Get histogram
/**
* Get the @f$ d^2N_{ch}/d\eta d\phi@f$ histogram,
*
* @return @f$ d^2N_{ch}/d\eta d\phi@f$ histogram,
*/
- TH2D& GetHistogram() { return fHist; }
+ TH2D& GetHistogram() { return fHist; } // Get histogram
/**
* Get the trigger mask
*
* @return Trigger mask
*/
- UInt_t GetTriggerMask() const { return fTriggers; }
+ UInt_t GetTriggerMask() const { return fTriggers; } // Get triggers
/**
* Set the trigger mask
*
* @param trg Trigger mask
*/
- void SetTriggerMask(UInt_t trg) { fTriggers = trg; }
+ void SetTriggerMask(UInt_t trg) { fTriggers = trg; } // Set triggers
/**
* Set bit(s) in trigger mask
*
* @param bits bit(s) to set
*/
- void SetTriggerBits(UInt_t bits) { fTriggers |= bits; }
+ void SetTriggerBits(UInt_t bits) { fTriggers |= bits; } // Set trigger bits
/**
* Check if bit(s) are set in the trigger mask
*
/**
* Whether we have any trigger bits
*/
- Bool_t HasTrigger() const { return fTriggers != 0; }
+ Bool_t HasTrigger() const { return fTriggers != 0; } // Check for triggers
/**
* Clear all data
*
*
* @return Always true
*/
- Bool_t IsFolder() const { return kTRUE; }
+ Bool_t IsFolder() const { return kTRUE; } // Always true
/**
* Print content
*
*
* @param ipZ Interaction point z coordinate
*/
- void SetIpZ(Float_t ipZ) { fIpZ = ipZ; }
+ void SetIpZ(Float_t ipZ) { fIpZ = ipZ; } // Set Ip's Z coordinate
/**
* Set the z coordinate of the interaction point
*
* @return Interaction point z coordinate
*/
- Float_t GetIpZ() const { return fIpZ; }
+ Float_t GetIpZ() const { return fIpZ; } // Get Ip's Z coordinate
/**
* Check if we have a valid z coordinate of the interaction point
*
*
* @return Name of object
*/
- const Char_t* GetName() const { return "Forward"; }
+ const Char_t* GetName() const { return (fIsMC ? "ForwardMC" : "Forward"); }
/**
* Get a string correspondig to the trigger mask
*
*/
static const Char_t* GetTriggerString(UInt_t mask);
protected:
+ Bool_t fIsMC; // Whether this is from MC
TH2D fHist; // Histogram of d^2N_{ch}/(deta dphi) for this event
UInt_t fTriggers; // Trigger bit mask
Float_t fIpZ; // Z coordinate of the interaction point
{
return HasTrigger() && ((fTriggers & bits) != 0);
}
-
#endif
// Local Variables: