AliPhysics  ad6828d (ad6828d)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 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
 
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 ()=0
 

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
 

Static interface for running

 ClassDef (FastAnalysis, 1)
 
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")
 

Detailed Description

Base class for processors

Definition at line 62 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 94 of file FastAnalysis.C.

virtual FastAnalysis::~FastAnalysis ( )
inlinevirtual

Destructor

Definition at line 110 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 532 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 519 of file FastAnalysis.C.

Referenced by ProcessParticles().

virtual void FastAnalysis::Begin ( TTree )
inlinevirtual

At beginning of job

Definition at line 269 of file FastAnalysis.C.

FastAnalysis::ClassDef ( FastAnalysis  ,
 
)
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 dNdeta::Cent, and dNdy::Cent.

Definition at line 460 of file FastAnalysis.C.

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

void FastAnalysis::CopyEgHistogram ( )
inline

Definition at line 419 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 356 of file FastAnalysis.C.

Referenced by dNdy::Cent::ProcessHeader(), and dNdeta::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 386 of file FastAnalysis.C.

Referenced by dNdy::Base::Terminate(), dNdeta::Base::Terminate(), spectraAnalysis::Terminate(), dNdy::Cent::Terminate(), and dNdeta::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 dNdeta::Cent, dNdy::Cent, dNdeta::Base, and dNdy::Base.

Definition at line 455 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 404 of file FastAnalysis.C.

Referenced by GetEventCount(), spectraAnalysis::Ratio(), spectraAnalysis::Scale(), dNdy::Base::Terminate(), and dNdeta::Base::Terminate().

void FastAnalysis::Init ( TTree tree)
inline

Called on initialization

Parameters
treeTree to analyse

Definition at line 249 of file FastAnalysis.C.

Bool_t FastAnalysis::Notify ( )
inline

Called when the file changes

Returns
true on success, false otherwise

Definition at line 278 of file FastAnalysis.C.

virtual Bool_t FastAnalysis::Process ( Long64_t  entry)
inlinevirtual

Called on each event

Parameters
entryEntry in chain
Returns
true on success, false otherwise

Definition at line 302 of file FastAnalysis.C.

virtual Bool_t FastAnalysis::ProcessHeader ( )
pure virtual

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.

Implemented in dNdeta::Cent, dNdy::Cent, dNdeta::INELGt0, dNdy::INELGt0, dNdeta::INEL, dNdy::INEL, dNdeta::NSD, dNdy::NSD, and spectraAnalysis.

Referenced by Process().

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 spectraAnalysis, dNdy::Base, and dNdeta::Base.

Referenced by 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 dNdeta::Cent, dNdy::Cent, and spectraAnalysis.

Definition at line 475 of file FastAnalysis.C.

Referenced by Process(), spectraAnalysis::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 567 of file FastAnalysis.C.

Referenced by ProofLoad(), and SetupProof().

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

Definition at line 575 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 800 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 889 of file FastAnalysis.C.

Bool_t FastAnalysis::SetupBranches ( )
inline

Set-up our branches

Returns
true on success, false otherwise

Definition at line 161 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 dNdeta::Cent, and dNdy::Cent.

Definition at line 181 of file FastAnalysis.C.

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

void FastAnalysis::SetupMonitor ( )
inline

Set up a monitor

Definition at line 124 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 622 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 120 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 326 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 605 of file FastAnalysis.C.

Referenced by Run().

Int_t FastAnalysis::Version ( ) const
inline

Definition at line 333 of file FastAnalysis.C.

Member Data Documentation

TH1* FastAnalysis::fCentHist

The centrality histogram to use - if any

Definition at line 81 of file FastAnalysis.C.

Referenced by GetCentrality(), SetupEstimator(), dNdy::Cent::SetupEstimator(), and dNdeta::Cent::SetupEstimator().

TString FastAnalysis::fCentMethod

The centrality method to use

Definition at line 79 of file FastAnalysis.C.

Referenced by dNdy::Cent::Cent(), dNdeta::Cent::Cent(), GetCentrality(), SetupBranches(), and SetupEstimator().

Bool_t FastAnalysis::fCompatB

Definition at line 86 of file FastAnalysis.C.

Referenced by SetupBranches(), and SetupEstimator().

ULong64_t FastAnalysis::fEventMult

Cache of event discriminator

Definition at line 77 of file FastAnalysis.C.

Referenced by Clear(), GetCentrality(), dNdy::Cent::ProcessHeader(), dNdeta::Cent::ProcessHeader(), SetupBranches(), and SetupEstimator().

Int_t FastAnalysis::fMonitor

Monitor frequency in seconds

Definition at line 85 of file FastAnalysis.C.

Referenced by SetupMonitor().

TString FastAnalysis::fName

Name

Definition at line 75 of file FastAnalysis.C.

TClonesArray* FastAnalysis::fParticles

List of particles

Definition at line 69 of file FastAnalysis.C.

Referenced by Clear(), ProcessParticles(), SetupBranches(), and ~FastAnalysis().

TStopwatch FastAnalysis::fTimer

A simple timer

Definition at line 73 of file FastAnalysis.C.

TTree* FastAnalysis::fTree

Pointer to tree being analysed

Definition at line 65 of file FastAnalysis.C.

Referenced by CopyEgHistogram(), Init(), Notify(), Process(), SetupBranches(), and SetupEstimator().

Bool_t FastAnalysis::fVerbose

Whether to be verbose

Definition at line 71 of file FastAnalysis.C.

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


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