AliPhysics  648edd6 (648edd6)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Unfolder Struct Reference

Public Types

enum  {
  kColorMeasured = kOrange-2, kColorTruth = kBlue-3, kColorAccepted = kMagenta-3, kColorTrgVtx = kBlack,
  kColorUnfolded = kOrange+2, kColorCorrected = kRed+2, kColorError = kBlue-10, kColorALICE = kPink+1,
  kColorCMS = kGreen+2
}
 

Public Member Functions

 Unfolder ()
 
void Run (const TString &measuredFile, const TString &corrFile, const TString &method="Bayes", Double_t regParam=4)
 
void SaveInformation (TDirectory *dir, const TString &method, Int_t mId, Double_t regParam, UShort_t sys, UShort_t sNN, UInt_t trigger, Double_t minIpZ, Double_t maxIpZ, Bool_t self) const
 
void SaveSummarize ()
 
void ProcessType (TCollection *measured, TCollection *corrections, UInt_t method, Double_t regParam, TDirectory *out, UShort_t sys, UShort_t sNN)
 
THStack * ProcessBin (TCollection *measured, TCollection *corrections, UInt_t method, Double_t regParam, TDirectory *out)
 
void Bin2Stack (const THStack *bin, Int_t i, THStack *measured, THStack *truth, THStack *accepted, THStack *unfolded, THStack *corrected, TH1 *&result)
 
void Other2Stack (const TString &name, Int_t i, UShort_t sNN, TMultiGraph *allALICE, TMultiGraph *allCMS, TGraph *&alice, TGraph *&cms)
 
void Ratio2Stack (Int_t ib, TH1 *res, TGraph *alice, TGraph *cms, THStack *all)
 
TLegend * StackLegend (THStack *stack)
 
TGraphAsymmErrorsGetOther (UShort_t type, Double_t eta, UShort_t sNN, Int_t factor)
 

Static Public Member Functions

static TCollectionGetTop (const TString &fileName, Bool_t results=false)
 
static TObjectGetObject (TCollection *c, const TString &name, TClass *cl, Bool_t verbose=true)
 
static TCollectionGetCollection (TCollection *c, const TString &name, Bool_t verbose=-true)
 
static TH1GetH1 (TCollection *c, const TString &name, Bool_t verbose=true)
 
static TH2GetH2 (TCollection *c, const TString &name, Bool_t verbose=true)
 
static void GetParameter (TCollection *c, const TString &name, UShort_t &v)
 
static void GetParameter (TCollection *c, const TString &name, ULong_t &v)
 
static void GetParameter (TCollection *c, const TString &name, Double_t &v)
 
static UInt_t MethodId (TString &method)
 
static void AppendAnd (TString &trg, const TString &what)
 
static void BinAttributes (Int_t i, Int_t &open, Int_t &closed, Float_t &size, Double_t &factor)
 

Detailed Description

Class to do unfolding of raw histograms produced by AliForwardMultDists

Definition at line 33 of file UnfoldMultDists.C.

Member Enumeration Documentation

anonymous enum

Colours used

Enumerator
kColorMeasured 
kColorTruth 
kColorAccepted 
kColorTrgVtx 
kColorUnfolded 
kColorCorrected 
kColorError 
kColorALICE 
kColorCMS 

Definition at line 39 of file UnfoldMultDists.C.

Constructor & Destructor Documentation

Unfolder::Unfolder ( )
inline

Constructor

Definition at line 54 of file UnfoldMultDists.C.

Member Function Documentation

static void Unfolder::AppendAnd ( TString trg,
const TString what 
)
inlinestatic

Append an & to a string and the next term.

Parameters
trgOutput string
whatTerm

Definition at line 362 of file UnfoldMultDists.C.

Referenced by SaveInformation().

void Unfolder::Bin2Stack ( const THStack *  bin,
Int_t  i,
THStack *  measured,
THStack *  truth,
THStack *  accepted,
THStack *  unfolded,
THStack *  corrected,
TH1 *&  result 
)
inline

Add the bin histograms to our summary stacks

Parameters
binBin stack
iCurrent off-set in the stacks
measuredAll measured \( P(N_{ch})\)
truthAll MC truth \( P(N_{ch})\)
acceptedAll MC accepted \( P(N_{ch})\)
unfoldedAll unfolded \( P(N_{ch})\)
correctedAll corrected \( P(N_{ch})\)
resultThe result in this bin

Definition at line 790 of file UnfoldMultDists.C.

Referenced by ProcessType().

static void Unfolder::BinAttributes ( Int_t  i,
Int_t open,
Int_t closed,
Float_t size,
Double_t factor 
)
inlinestatic

Definition at line 760 of file UnfoldMultDists.C.

Referenced by Bin2Stack(), and Other2Stack().

static TCollection* Unfolder::GetCollection ( TCollection c,
const TString name,
Bool_t  verbose = -true 
)
inlinestatic

Get a collection

Parameters
cParent collection
nameName of object to findf
verboseBe verbose
Returns

Definition at line 115 of file UnfoldMultDists.C.

Referenced by ProcessType(), and Run().

static TH1* Unfolder::GetH1 ( TCollection c,
const TString name,
Bool_t  verbose = true 
)
inlinestatic

Get a 1D histogram from a collection

Parameters
cCollection
nameNanme of histogram
verboseBe verbose
Returns
Pointer to object or null

Definition at line 132 of file UnfoldMultDists.C.

Referenced by ProcessBin().

static TH2* Unfolder::GetH2 ( TCollection c,
const TString name,
Bool_t  verbose = true 
)
inlinestatic

Get a 2D histogram from a collection

Parameters
cCollection
nameNanme of histogram
verboseBe verbose
Returns
Pointer to object or null

Definition at line 145 of file UnfoldMultDists.C.

Referenced by ProcessBin().

static TObject* Unfolder::GetObject ( TCollection c,
const TString name,
TClass *  cl,
Bool_t  verbose = true 
)
inlinestatic

Get an object from a collection

Parameters
cCollection
nameName of object
clPossible class to check against
verboseBe verbose
Returns
Pointer to object or null

Definition at line 89 of file UnfoldMultDists.C.

Referenced by GetCollection(), GetH1(), GetH2(), and GetParameter().

TGraphAsymmErrors* Unfolder::GetOther ( UShort_t  type,
Double_t  eta,
UShort_t  sNN,
Int_t  factor 
)
inline

Definition at line 1021 of file UnfoldMultDists.C.

Referenced by Other2Stack().

static void Unfolder::GetParameter ( TCollection c,
const TString name,
UShort_t v 
)
inlinestatic

Get an unsigned short parameter from the collection

Parameters
cCollection
nameParameter name
vValue
Returns
Value

Definition at line 158 of file UnfoldMultDists.C.

Referenced by Run().

static void Unfolder::GetParameter ( TCollection c,
const TString name,
ULong_t v 
)
inlinestatic

Get an unsigned short parameter from the collection

Parameters
cCollection
nameParameter name
vValue
Returns
Value

Definition at line 172 of file UnfoldMultDists.C.

static void Unfolder::GetParameter ( TCollection c,
const TString name,
Double_t v 
)
inlinestatic

Get an unsigned short parameter from the collection

Parameters
cCollection
nameParameter name
vValue
Returns
Value

Definition at line 186 of file UnfoldMultDists.C.

static TCollection* Unfolder::GetTop ( const TString fileName,
Bool_t  results = false 
)
inlinestatic

Get a top collection from a file

Parameters
fileNameName of file
resultsWheter it's the results collection or not
Returns
Collection or null

Definition at line 63 of file UnfoldMultDists.C.

Referenced by Run().

static UInt_t Unfolder::MethodId ( TString method)
inlinestatic

Get the method identifier

Parameters
methodMethod
Returns
Method identifier

Definition at line 198 of file UnfoldMultDists.C.

Referenced by Run().

void Unfolder::Other2Stack ( const TString name,
Int_t  i,
UShort_t  sNN,
TMultiGraph *  allALICE,
TMultiGraph *  allCMS,
TGraph *&  alice,
TGraph *&  cms 
)
inline

Add distributions from other experiments to stacks

Parameters
nameName of current bin
iIndex of current bin
sNNCenter of mass energy
allALICEStack of ALICE data
allCMSStack of CMS data
alicePossible ALICE result on return
cmsPossible CMS result on return

Definition at line 865 of file UnfoldMultDists.C.

Referenced by ProcessType().

THStack* Unfolder::ProcessBin ( TCollection measured,
TCollection corrections,
UInt_t  method,
Double_t  regParam,
TDirectory *  out 
)
inline

Process a single eta bin

Parameters
measuredInput collection of measured data
correctionsInput collection of correction data
methodUnfolding method to use
regParamRegularisation parameter
outOutput directory.
Returns
Stack of histograms or null

Definition at line 604 of file UnfoldMultDists.C.

Referenced by ProcessType().

void Unfolder::ProcessType ( TCollection measured,
TCollection corrections,
UInt_t  method,
Double_t  regParam,
TDirectory *  out,
UShort_t  sys,
UShort_t  sNN 
)
inline

Process a single type - i.e., one of symmetric, positive, negative, or other - by looping over all contained objects and call ProcessBin for each found bin.

Parameters
measuredInput collection of measured data
correctionsInput collection of correction data
methodUnfolding method to use
regParamRegularisation parameter
outOutput directory.
sysCollision system
sNNCollision energy

Definition at line 503 of file UnfoldMultDists.C.

Referenced by Run().

void Unfolder::Ratio2Stack ( Int_t  ib,
TH1 res,
TGraph alice,
TGraph cms,
THStack *  all 
)
inline

Create ratios to other data

Parameters
ibBin number
resResult
aliceALICE result if any
cmsCMS result if any
allStack to add ratio to

Definition at line 929 of file UnfoldMultDists.C.

Referenced by ProcessType().

void Unfolder::Run ( const TString measuredFile,
const TString corrFile,
const TString method = "Bayes",
Double_t  regParam = 4 
)
inline

Run the unfolding and correction task.

The measuredFile is assumed to have the structure

*     /- ForwardMultSums         (TCollection)
*          |- [type]             (TCollection)
*          |    |- [bin]         (TCollection) 
*          |    |    `- rawDist  (TH1)
*          |    |- [bin]
*          |    ...
*          |- [type]
*          ...
* 

and corrFile is assumed to have the structure

*     /- ForwardMultResults            (TCollection)
*          |- [type]                   (TCollection)
*          |    |- [bin]               (TCollection) 
*          |    |    |- truth          (TH1)
*          |    |    |- truthAccepted  (TH1)
*          |    |    |- triggerVertex  (TH1)
*          |    |    `- response       (TH2)
*          |    |- [bin]
*          |    ...
*          |- [type]
*          ...
* 

where [type] is one of symmetric, positive, negative, or other, and [bin] is the \( \eta\) bin named like

*   [bin]          := [eta_spec] _ [eta_spec]
*   [eta_spec]     := [sign_char] [integer_part] d [decimal_part]
*   [sign_part]    := p          positive eta 
*                  |  m          negative eta 
*   [integer_part] := [number]
*   [decimal_part] := [number] [number]
*   [number]       := 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 
* 

That is, the bin \( -3\le\eta\ge3\) is labeled m3d00_p3d00, \( 0\le\eta\ge2.5\) is p0d00_p2d50

measuredFile and corrFile can point to the same file. If corrFile is not specified, it is assumed that measuredFile has the expected corrFile in addition to the expected content of that file.

Parameters
measuredFileName of file containing measured data
corrFileName of file containing correction data
methodUnfolding method to use
regParamRegularization parameter

Definition at line 285 of file UnfoldMultDists.C.

Referenced by UnfoldMultDists().

void Unfolder::SaveInformation ( TDirectory *  dir,
const TString method,
Int_t  mId,
Double_t  regParam,
UShort_t  sys,
UShort_t  sNN,
UInt_t  trigger,
Double_t  minIpZ,
Double_t  maxIpZ,
Bool_t  self 
) const
inline

Store some information on the output

Parameters
dirWhere to store
methodMethod used
mIdMethod identifier
regParamRegularization parameter
sysCollision system
sNNCenter of mass energy
triggerTrigger mask
minIpZLeast z coordinate of interaction point
maxIpZLargest z coordinate of interaction point
selfSelf-consistency check

Bits of the trigger pattern

In-elastic collision

In-elastic collision with at least one SPD tracklet

Non-single diffractive collision

Empty bunch crossing

A-side trigger

B(arrel) trigger

C-side trigger

Empty trigger

pileup from SPD

true NSD from MC

Offline MB triggered

At least one SPD cluster

V0-AND trigger

Satellite event

Definition at line 381 of file UnfoldMultDists.C.

Referenced by Run().

void Unfolder::SaveSummarize ( )
inline

Save a script to do a summary of this step

Definition at line 477 of file UnfoldMultDists.C.

Referenced by Run().

TLegend* Unfolder::StackLegend ( THStack *  stack)
inline

Get or create a stack legend. This is done by adding a TLegend object to the list of functions for the first histogram in the stack.

Parameters
stackStack to get the legend from/modify
Returns
The legend object or null

Definition at line 993 of file UnfoldMultDists.C.

Referenced by Bin2Stack(), ProcessBin(), and Ratio2Stack().


The documentation for this struct was generated from the following file: