AliPhysics  d565ceb (d565ceb)
FastAnalysis Struct Referenceabstract
Inheritance diagram for FastAnalysis:

Classes

struct  Factory
 
struct  Maker
 

Public Member Functions

 FastAnalysis (Bool_t verb=false, Int_t monitor=0)
 
virtual ~FastAnalysis ()
 
void SetTrigger (UInt_t mask)
 
void SetTrigger (UInt_t mask, Bool_t isAnd)
 
void SetTrigger (const char *what)
 
Bool_t CheckTrigger () const
 
void SetVerbose (Bool_t verb)
 
void SetupMonitor ()
 
Selector interface
Bool_t SetupBranches ()
 
virtual Bool_t SetupEstimator ()
 
void Init (TTree *tree)
 
virtual void Begin (TTree *)
 
Bool_t Notify ()
 
virtual Bool_t Process (Long64_t entry)
 
virtual void SlaveTerminate ()
 
Int_t Version () const
 
virtual void Print (Option_t *option="") const
 
Some service functions
Double_t GetCentrality () const
 
Long_t GetEventCount ()
 
TObjectGetOutputObject (const char *name, TClass *cls)
 
void CopyEgHistogram ()
 
overloadable behaviour
virtual TListGetMonitorObjects ()
 
virtual void Clear (Option_t *option="")
 
virtual void ProcessParticles ()
 
virtual Bool_t AcceptSecondaries () const
 
virtual Bool_t AcceptNeutrals () const
 
virtual Bool_t ProcessParticle (const TParticle *p)=0
 
virtual Bool_t ProcessHeader ()
 

Static Public Member Functions

Static interface for running
static Long_t ProofExec (const char *cmd=0)
 
static Bool_t ProofLoad (const char *file, const char *opt)
 
static Bool_t Str2KeyVal (const TString &in, TString &key, TString &val, const char sep='=')
 
static Bool_t SetupProof (TUrl &url, const char *opt, const char *extra)
 
static Bool_t Run (const char *url, const char *output, FastAnalysis *a, const char *script, Long64_t nev=-1, Long64_t offset=0, Int_t monitor=-1, Bool_t verbose=false, const char *opt="")
 
static Bool_t Run (const char *url, const char *output, const char *opt="g")
 

Public Attributes

TTreefTree
 
FastShortHeaderfHeader
 
TClonesArray * fParticles
 
Bool_t fVerbose
 
TStopwatch fTimer
 
TString fName
 
ULong64_t fEventMult
 
TString fCentMethod
 
TH1fCentHist
 
ULong_t fOK
 
Int_t fMonitor
 
Bool_t fCompatB
 
UInt_t fTrigMask
 

Detailed Description

Base class for processors

Definition at line 65 of file FastAnalysis.C.

Constructor & Destructor Documentation

FastAnalysis::FastAnalysis ( Bool_t  verb = false,
Int_t  monitor = 0 
)
inline

Constructor. Opens the file passed and sets internal pointers to tree, header, and particle list.

Parameters
verbWhether to be verbose
monitorEnable monitoring if non-zero

Definition at line 98 of file FastAnalysis.C.

virtual FastAnalysis::~FastAnalysis ( )
inlinevirtual

Destructor

Definition at line 115 of file FastAnalysis.C.

Member Function Documentation

virtual Bool_t FastAnalysis::AcceptNeutrals ( ) const
inlinevirtual

Whether to accept neutral particles. By default this returns false, meaning we do not process neutral particles. A derived class can overload this to return true in case one want to look at neutral particles.

If one need finer control, this can be overwritten to return true, and one can inspect bit 15 of the object bits to see if a particle is a secondary.

Returns
false

Definition at line 618 of file FastAnalysis.C.

Referenced by ProcessParticles().

virtual Bool_t FastAnalysis::AcceptSecondaries ( ) const
inlinevirtual

Whether to accept secondary particles. By default this returns false, meaning we do not process secondary particles. A derived class can overload this to return true in case one want to look at secondary particles.

If one need finer control, this can be overwritten to return true, and one can inspect bit 14 of the object bits to see if a particle is a secondary.

Returns
false

Definition at line 605 of file FastAnalysis.C.

Referenced by ProcessParticles().

virtual void FastAnalysis::Begin ( TTree )
inlinevirtual

At beginning of job

Definition at line 338 of file FastAnalysis.C.

Bool_t FastAnalysis::CheckTrigger ( ) const
inline

Check trigger bits

Returns
true if the appropriate bits are set

Definition at line 173 of file FastAnalysis.C.

Referenced by dNdy::V0AND::ProcessHeader(), dNdeta::V0AND::ProcessHeader(), dNdeta::Cent::ProcessHeader(), spectra::V0AND::ProcessHeader(), spectra::Cent::ProcessHeader(), and ProcessHeader().

virtual void FastAnalysis::Clear ( Option_t option = "")
inlinevirtual

Clear internal caches. Called at start of each event. Can be overloaded to do some more stuff if needed.

Reimplemented in spectra::Cent, dNdeta::Cent, dNdy::Cent, and MidNch::Base.

Definition at line 546 of file FastAnalysis.C.

Referenced by MidNch::Base::Clear(), dNdy::Cent::Clear(), dNdeta::Cent::Clear(), spectra::Cent::Clear(), and Process().

void FastAnalysis::CopyEgHistogram ( )
inline

Definition at line 505 of file FastAnalysis.C.

Referenced by Notify().

Double_t FastAnalysis::GetCentrality ( ) const
inline

Get the event centrality.

If the centrality estimator is not set, we use the centrality stored in the header.

Otherwise, we find the bin corresponding to the event multiplicity (as stored in the selected branch), of the estimator histogram, and return the corresponding centrality (bin content).

If the event multiplcity is below the range given by the estimator, we return -1. If the event multiplicity is above the range defined by the estimator, we return 1000.

Returns
The event centrality.

Definition at line 442 of file FastAnalysis.C.

Referenced by MidNch::Base::ProcessHeader(), dNdy::Cent::ProcessHeader(), dNdeta::Cent::ProcessHeader(), and spectra::Cent::ProcessHeader().

Long_t FastAnalysis::GetEventCount ( )
inline

Get the event count from internal counter, or if that is 0 or smaller, from the output

Returns
Event count

Definition at line 472 of file FastAnalysis.C.

Referenced by dNdy::Base::Terminate(), dNdeta::Base::Terminate(), MidNch::Base::Terminate(), dNdy::Cent::Terminate(), dNdeta::Cent::Terminate(), spectra::Base::Terminate(), and spectra::Cent::Terminate().

virtual TList* FastAnalysis::GetMonitorObjects ( )
inlinevirtual

Get the list of monitor objects. Sub-classes should overload this to return a TList of TNamed objects. The name of each entry must corresponding to the path of an object in the output list. The title encodes the draw option used for the object, and the unique id sets pad options, such as log scale, and scaling to number of events. If scaling to number of events is requested, then the number of events is assumed to be encode in the underflow bin.

Returns
A TList of monitor object identifiers, or null

Reimplemented in spectra::Cent, dNdy::Cent, spectra::Base, dNdeta::Cent, MidNch::Base, dNdeta::Base, and dNdy::Base.

Definition at line 541 of file FastAnalysis.C.

Referenced by SetupMonitor().

TObject* FastAnalysis::GetOutputObject ( const char *  name,
TClass *  cls 
)
inline

Get an object from the output list, possibly checking the type

Parameters
nameName of object
clsPossible class pointer
Returns
Found object, or null

Definition at line 490 of file FastAnalysis.C.

Referenced by GetEventCount(), dNdy::Base::Terminate(), dNdeta::Base::Terminate(), and MidNch::Base::Terminate().

void FastAnalysis::Init ( TTree tree)
inline

Called on initialization

Parameters
treeTree to analyse

Definition at line 318 of file FastAnalysis.C.

Bool_t FastAnalysis::Notify ( )
inline

Called when the file changes

Returns
true on success, false otherwise

Definition at line 347 of file FastAnalysis.C.

virtual void FastAnalysis::Print ( Option_t option = "") const
inlinevirtual

Reimplemented in spectra::Cent, spectra::Base, and dNdeta::Cent.

Definition at line 403 of file FastAnalysis.C.

Referenced by dNdeta::Cent::Print(), spectra::Base::Print(), and Run().

virtual Bool_t FastAnalysis::Process ( Long64_t  entry)
inlinevirtual

Called on each event

Parameters
entryEntry in chain
Returns
true on success, false otherwise

Reimplemented in MidNch::Base.

Definition at line 371 of file FastAnalysis.C.

Referenced by MidNch::Base::Process().

virtual Bool_t FastAnalysis::ProcessHeader ( )
inlinevirtual

Process the header. Shall return true if the event is accepted, false otherwise. Must be overloaded by derived class.

Returns
True if the event is to be taken.

Reimplemented in spectra::Cent, spectra::V0AND, dNdeta::Cent, dNdy::Cent, dNdeta::V0AND, dNdy::V0AND, dNdeta::INELGt0, spectra::Base, dNdy::INELGt0, dNdeta::INEL, dNdy::INEL, MidNch::Base, dNdeta::NSD, and dNdy::NSD.

Definition at line 638 of file FastAnalysis.C.

Referenced by Process(), and MidNch::Base::ProcessHeader().

virtual Bool_t FastAnalysis::ProcessParticle ( const TParticle *  p)
pure virtual

Process a single particle.

In a derived class one can inspect bit 14 (15) to test of the particle is a secondary (neutral) particle. By default secondary (netrual) particles are not processes, unless the derived class overwrites AcceptSecondaries (AcceptNeutrals) to return true.

Parameters
pPointer to TParticle object
Returns
true if the particle was accepted.

Implemented in spectra::Base, MidNch::Base, dNdy::Base, and dNdeta::Base.

Referenced by AcceptNeutrals(), and ProcessParticles().

virtual void FastAnalysis::ProcessParticles ( )
inlinevirtual

Process the particles. Called once for each event.

This in turn calls ProcessParticle for each particle.

By default secondaries and neutral particles are not processed. If a derived class need to look at these, that class should overwrite AcceptSecondaries and/or AcceptNeutrals to return true.

Reimplemented in spectra::Cent, dNdeta::Cent, dNdy::Cent, and spectra::Base.

Definition at line 561 of file FastAnalysis.C.

Referenced by Process(), spectra::Base::ProcessParticles(), dNdy::Cent::ProcessParticles(), and dNdeta::Cent::ProcessParticles().

static Long_t FastAnalysis::ProofExec ( const char *  cmd = 0)
inlinestatic

Execute a PROOF command. Short hand convinience

Parameters
cmdCommand, or empty string.
Returns
If cmd is empty, test if gProof is defined, other wise result of command.

Definition at line 653 of file FastAnalysis.C.

Referenced by ProofLoad(), and SetupProof().

static Bool_t FastAnalysis::ProofLoad ( const char *  file,
const char *  opt 
)
inlinestatic

Definition at line 661 of file FastAnalysis.C.

Referenced by SetupProof().

static Bool_t FastAnalysis::Run ( const char *  url,
const char *  output,
FastAnalysis a,
const char *  script,
Long64_t  nev = -1,
Long64_t  offset = 0,
Int_t  monitor = -1,
Bool_t  verbose = false,
const char *  opt = "" 
)
inlinestatic

Run an analysis. Argument URL has format of

protocol://[[user@[password:]]host]/file?[options]#treeName

where

  • protocol can be local, lite, or proof
  • user:host gives Proof credentials and master
  • file is either a data file, or contains a list of file names
  • options are options for the execution environment
  • treeName is the input tree name
Parameters
urlProcessing and input URL
outputOutput file name
aAnalyser
scriptScript that defines analysis
nevMax number of events
offsetOffset in events
monitorMonitor period in seconds (<0 disables)
verboseWhether to be verbose
optOptimization used
Returns
true on success

Definition at line 886 of file FastAnalysis.C.

Referenced by ProcessFast(), and Run().

static Bool_t FastAnalysis::Run ( const char *  url,
const char *  output,
const char *  opt = "g" 
)
inlinestatic

Run this.

Parameters
urlUrl to process
outputOutput file
optCompilation options
Returns
true on success

Definition at line 976 of file FastAnalysis.C.

void FastAnalysis::SetTrigger ( UInt_t  mask)
inline
void FastAnalysis::SetTrigger ( UInt_t  mask,
Bool_t  isAnd 
)
inline

Set the trigger mask

Parameters
maskThe mask
isAndIf true, mark mask as and mask (otherwise or)

Definition at line 132 of file FastAnalysis.C.

void FastAnalysis::SetTrigger ( const char *  what)
inline

Set the trigger mask from a string. Valid options are

  • INEL,MBOR: V0A||V0C||ADA||ADC||ETA1
  • INEL>0,INELGT0: ETA1
  • V0AND,MBAND: V0A&&V0C
Parameters
whattrigger string

Definition at line 148 of file FastAnalysis.C.

Bool_t FastAnalysis::SetupBranches ( )
inline

Set-up our branches

Returns
true on success, false otherwise

Definition at line 230 of file FastAnalysis.C.

Referenced by Init(), and Notify().

virtual Bool_t FastAnalysis::SetupEstimator ( )
inlinevirtual

Set-up the estimator is one is chosen. We get a pointer to the current file, and retrieve the relevant histogram from that.

Returns
true on success, false otherwise

Reimplemented in spectra::Cent, dNdeta::Cent, dNdy::Cent, and MidNch::Base.

Definition at line 250 of file FastAnalysis.C.

Referenced by Notify(), MidNch::Base::SetupEstimator(), dNdy::Cent::SetupEstimator(), dNdeta::Cent::SetupEstimator(), and spectra::Cent::SetupEstimator().

void FastAnalysis::SetupMonitor ( )
inline

Set up a monitor

Definition at line 191 of file FastAnalysis.C.

Referenced by Begin().

static Bool_t FastAnalysis::SetupProof ( TUrl url,
const char *  opt,
const char *  extra 
)
inlinestatic

Set-up PROOF

Returns
true on success, false otherwise

Definition at line 708 of file FastAnalysis.C.

Referenced by Run().

void FastAnalysis::SetVerbose ( Bool_t  verb)
inline

Set the verbosity flag

Parameters
verbIf true, be verbose

Definition at line 187 of file FastAnalysis.C.

virtual void FastAnalysis::SlaveTerminate ( )
inlinevirtual

Called at the end of the slave processing. Puts the event count into a parameter that is stored in the output list. Users can overload this to do more stuff should it be needed.

Definition at line 395 of file FastAnalysis.C.

static Bool_t FastAnalysis::Str2KeyVal ( const TString in,
TString key,
TString val,
const char  sep = '=' 
)
inlinestatic

Extract key value pair from string

Parameters
inInput string
keyOn return, the key
valOn return, the value
sepSeparator between key an value
Returns
false of separator isn't found in input

Definition at line 691 of file FastAnalysis.C.

Referenced by Run().

Int_t FastAnalysis::Version ( ) const
inline

Definition at line 402 of file FastAnalysis.C.

Member Data Documentation

TH1* FastAnalysis::fCentHist

The centrality histogram to use - if any

Definition at line 84 of file FastAnalysis.C.

Referenced by MidNch::Base::SetupEstimator(), dNdy::Cent::SetupEstimator(), dNdeta::Cent::SetupEstimator(), and spectra::Cent::SetupEstimator().

TString FastAnalysis::fCentMethod

The centrality method to use

Definition at line 82 of file FastAnalysis.C.

Referenced by MidNch::Base::Base(), dNdy::Cent::Cent(), dNdeta::Cent::Cent(), and spectra::Cent::Cent().

Bool_t FastAnalysis::fCompatB

Definition at line 89 of file FastAnalysis.C.

ULong64_t FastAnalysis::fEventMult
Int_t FastAnalysis::fMonitor

Monitor frequency in seconds

Definition at line 88 of file FastAnalysis.C.

TString FastAnalysis::fName

Name

Definition at line 78 of file FastAnalysis.C.

TClonesArray* FastAnalysis::fParticles

List of particles

Definition at line 72 of file FastAnalysis.C.

Referenced by ~FastAnalysis().

TStopwatch FastAnalysis::fTimer

A simple timer

Definition at line 76 of file FastAnalysis.C.

TTree* FastAnalysis::fTree

Pointer to tree being analysed

Definition at line 68 of file FastAnalysis.C.

UInt_t FastAnalysis::fTrigMask

Definition at line 90 of file FastAnalysis.C.

Referenced by dNdeta::Cent::Cent(), spectra::Cent::Cent(), and MidNch::XeXe::XeXe().

Bool_t FastAnalysis::fVerbose

Whether to be verbose

Definition at line 74 of file FastAnalysis.C.

Referenced by dNdy::Cent::ProcessParticles(), and dNdeta::Cent::ProcessParticles().


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