KaliVeda
Toolkit for HIC analysis
KVEventSelector Class Reference

Detailed Description

General purpose analysis base class for TTree containing KVEvent objects.

This is a specialised version of the ROOT TSelector class. Classes derived from this one can be used to analyse KVEvent data in TTree branches. Analyses can be performed sequentially or in parallel using the PROOFLite facility. The user needs only to implement/override the following methods in their analysis class:

void InitAnalysis() { // called once at beginning of analysis }
void InitRun() { // called once at beginning of each file/run to analyse }
bool Analysis() { // called for each event in turn }
void EndRun() { // called at the end of each file/run }
void EndAnalysis() { // called at the end of the analysis }
virtual void InitAnalysis()
virtual void EndRun()
virtual Bool_t Analysis()
virtual void EndAnalysis()
virtual void InitRun()

In most cases, it is sufficient to implement only the InitAnalysis() and Analysis() methods.

The analysis can be performed like for TSelector with a TChain or TTree my_tree:

my_tree->Process("MySelector.cpp+", "[options]");

where [options] is a list of options in the form BranchName=toto, ....

The following options MUST be given:

BranchName: name of branch containing the events
char name[80]

The following are optional options:

EventsReadInterval: print info on analysis every N events instead of default value
AuxFiles: list of files containing "friend" TTrees to be made available during analysis. Separate filenames with '|'.
AuxDir: directory in which to find AuxFiles
AuxTreeName: name of tree in AuxFiles containing KVEvent objects
AuxBranchName: name of branch in AuxFiles containing KVEvent objects
#define N
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Abstract base class container for multi-particle events.
Definition: KVEvent.h:67

When AuxFiles is used, the user can access the events in these files in her Analysis() method by doing the following:

GetFriendTreeEntry(entry_number);
auto friend_event = GetFriendEvent();
Int_t GetFriendTreeEntry(Long64_t entry, Int_t getall=0)
KVEvent * GetFriendEvent() const

Any other options can be defined by the user and parsed in her analysis class with methods IsOptGiven() and GetOpt()

Usage

The 5 methods listed above will be called in the following order during a typical analysis:

InitAnalysis() // beginning of analysis
InitRun() // open 1st file in TChain
Analysis() // 1st event
Analysis() // 2nd event
Analysis() // 3rd event...
...
EndRun() // end of 1st file
InitRun() // open 2nd file in TChain
Analysis() // 1st event
Analysis() // etc.
...
EndRun() // end of 2nd file
...
InitRun() // Nth file in TChain...
...
EndRun() // end of Nth file

Creating output TTrees and histograms

User's histograms and/or TTrees are initialised in InitAnalysis().

  • declare any histograms with method AddHisto<T> e.g. in InitAnalysis() do:
void MySelector::InitAnalysis()
{
AddHisto<TH2F>("toto", "tata", 100, 0, 0, 500, 0, 0);
AddHisto<TH1F>("titi", "tutu", 100, -5, 5);
}

(see KVDataAnalysisTreeHistoHandler::AddHisto()).

Histograms can also be declared 'on the fly' in the Analysis() method in the same way;

void MySelector::InitAnalysis()
{
auto aTree = AddTree("t1", "Some Tree title");
aTree->Branch(...) etc.
}
TTree * AddTree(const TString &name, const TString &title="")

Call method SetJobOutputFileName() with the required filename at the end of your InitAnalysis() method.

Using STL vectors in TTree branches

To add an STL vector to a TTree branch, use the helper methods (defined in KVTreeVectorBranchHandler):

auto aTree = AddTree("t1", "Some Tree title");
AddVectorBranch<int>(aTree, "Z");
AddVectorBranch<double>(aTree, "E");

Only int, float and double are supported for the moment.

Then in your Analysis() method, do the following:

ClearVectorBranches(); // VERY important - do not forget!
for(auto& nuc : EventOKIterator(GetEvent()))
{
FillVectorBranch("Z", nuc.GetZ());
FillVectorBranch("E", nuc.GetE());
}
Class for iterating over "OK" nuclei in events accessed through base pointer/reference.
KVEvent * GetEvent() const
void FillVectorBranch(const std::string &var, VarType val)

Global Variables

Global variables for the analysis should be declared in InitAnalysis() using method AddGV(). These variables are calculated automatically for each event before user's Analysis() method is called. See the Users Guide chapter Global Variables for more details.

If the user needs to define new reference frames for the data which must exist before global variables are automatically calculated in the analysis loop, she can do so by overriding the method SetAnalysisFrame(), like so:

MyAnalysis::SetAnalysisFrame()
{
static TVector3 cmvelocity(0,0,3.0);
GetEvent()->SetFrame("CM", cmvelocity);
}
virtual void SetFrame(const Char_t *, const KVFrameTransform &)=0

Note that the global variables are only calculated using particles which have their "OK" status set, for example because they correspond to the global particle selection criteria given to SetParticleConditions(). Any further particle selections applied to individual global variables will then select from among these "OK" particles.

If one or more global variables have event selection conditions defined (i.e. cuts on the values of the global variables) - see KVVarGlob::SetEventSelection() and KVGVList - then for each event which does not satisfy all conditions the Analysis() method will not be called.

Generating & saving profiles, divided histograms, etc.

If, at the end of processing, you want to generate a histogram from one or more histograms filled in your analysis, for example generate a TProfile from a 2D histogram, or store the result of dividing one histogram by the other, you need to do the following:

  • do the processing in the EndRun() method, not in EndAnalysis() - by the time EndAnalysis() is called it is too late, the output file has been closed and written to disk
  • add the resulting histogram to the output list like so:
MyEventSelector::EndRun()
{
TProfile* my_profile = ((TH2*)GetHisto("my_histo_2D"))->ProfileX("name_of_my_profile");
GetOutputList()->Add(my_profile);
}
TList * GetOutputList() const override
void Add(TObject *obj) override
Examples
ExampleFilteredSimDataAnalysis.cpp, and ExampleSimDataAnalysis.cpp.

Definition at line 202 of file KVEventSelector.h.

#include <KVEventSelector.h>

Inheritance diagram for KVEventSelector:

Public Member Functions

 KVEventSelector (TTree *=0)
 
KVVarGlobAddGV (const Char_t *class_name, const Char_t *name)
 
void AddGV (KVVarGlob *vg)
 
KVGVListAddGVList (const KVString &list_name, const KVParticleCondition &selection=KVParticleCondition())
 
virtual Bool_t Analysis ()
 
void Begin (TTree *tree) override
 
virtual void EndAnalysis ()
 
virtual void EndRun ()
 
const Char_tGetBranchName () const
 
Int_t GetEntry (Long64_t entry, Int_t getall=0) override
 
KVEventGetEvent () const
 
Int_t GetEventNumber () const
 
KVEventGetFriendEvent () const
 
Int_t GetFriendTreeEntry (Long64_t entry, Int_t getall=0)
 
KVVarGlobGetGV (const Char_t *name) const
 
KVGVListGetGVList (const KVString &list_name="default")
 
const KVGVListGetGVList (const KVString &list_name="default") const
 
TString GetOpt (const Char_t *option) const
 
TListGetOutputList () const override
 
void Init (TTree *tree) override
 
virtual void InitAnalysis ()
 
virtual void InitRun ()
 
Bool_t IsOptGiven (const Char_t *option)
 
Bool_t Notify () override
 
Bool_t Process (Long64_t entry) override
 
virtual void SaveHistos (const Char_t *="", Option_t *="recreate", Bool_t=kFALSE)
 
virtual void SetAdditionalBranchAddress ()
 
void SetBranchName (const Char_t *n)
 
virtual void SetCurrentRun (KVDBRun *)
 
void SetEventsReadInterval (Long64_t N)
 
void SetInputList (TList *input) override
 
void SetJobOutputFileName (const TString &filename)
 
void SetObject (TObject *obj) override
 
void SetOpt (const Char_t *option, const Char_t *value)
 
void SetParticleConditions (const KVParticleCondition &cond)
 
void SetTriggerConditionsForRun (int run)
 
void SlaveBegin (TTree *tree) override
 
void SlaveTerminate () override
 
void Terminate () override
 
void UnsetOpt (const Char_t *opt)
 
Int_t Version () const override
 
- Public Member Functions inherited from TSelector
 TSelector ()
 
 ~TSelector () override
 
virtual void Abort (const char *why, EAbort what=kAbortProcess)
 
virtual EAbort GetAbort () const
 
virtual TListGetInputList () const
 
const char * GetOption () const override
 
virtual Long64_t GetStatus () const
 
virtual void ImportOutput (TList *output)
 
TClassIsA () const override
 
virtual Bool_t ProcessCut (Long64_t)
 
virtual void ProcessFill (Long64_t)
 
virtual void ResetAbort ()
 
virtual void SetOption (const char *option)
 
virtual void SetStatus (Long64_t status)
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 
virtual ~TObject ()
 
void AbstractMethod (const char *method) const
 
virtual void AppendPad (Option_t *option="")
 
virtual void Browse (TBrowser *b)
 
ULong_t CheckedHash ()
 
virtual const char * ClassName () const
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 
virtual Int_t Compare (const TObject *obj) const
 
virtual void Copy (TObject &object) const
 
virtual void Delete (Option_t *option="")
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 
virtual void Draw (Option_t *option="")
 
virtual void DrawClass () const
 
virtual TObjectDrawClone (Option_t *option="") const
 
virtual void Dump () const
 
virtual void Error (const char *method, const char *msgfmt,...) const
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual TObjectFindObject (const char *name) const
 
virtual TObjectFindObject (const TObject *obj) const
 
virtual Option_tGetDrawOption () const
 
virtual const char * GetIconName () const
 
virtual const char * GetName () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual const char * GetTitle () const
 
virtual UInt_t GetUniqueID () const
 
virtual Bool_t HandleTimer (TTimer *timer)
 
virtual ULong_t Hash () const
 
Bool_t HasInconsistentHash () const
 
virtual void Info (const char *method, const char *msgfmt,...) const
 
virtual Bool_t InheritsFrom (const char *classname) const
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 
virtual void Inspect () const
 
void InvertBit (UInt_t f)
 
Bool_t IsDestructed () const
 
virtual Bool_t IsEqual (const TObject *obj) const
 
virtual Bool_t IsFolder () const
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 
void MayNotUse (const char *method) const
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *vp)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, void *vp)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 
virtual void Paint (Option_t *option="")
 
virtual void Pop ()
 
virtual void Print (Option_t *option="") const
 
virtual Int_t Read (const char *name)
 
virtual void RecursiveRemove (TObject *obj)
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 
virtual void SetDrawOption (Option_t *option="")
 
virtual void SetUniqueID (UInt_t uid)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 
- Public Member Functions inherited from KVDataAnalysisTreeHistoHandler< KVEventSelector >
HistoType * AddHisto (Args &&... args)
 
TTreeAddTree (const TString &name, const TString &title="")
 
void FillHisto (const Char_t *histo_name, const Char_t *label, Double_t weight=1)
 Fill histogram with given name according to label bin and weight. More...
 
void FillHisto (const Char_t *histo_name, Double_t x, Double_t y=1, Double_t z=1, Double_t w=1)
 Fill previously-declared histogram with given name and required arguments. More...
 
void FillTree (std::optional< TString > tree_name={})
 
TH1GetHisto (const Char_t *name) const
 
const KVHashListGetHistoList () const
 
TTreeGetTree (const Char_t *name) const
 
const KVHashListGetTreeList () const
 GetTreeList. More...
 

Friends

class KVDataAnalysisTreeHistoHandler< KVEventSelector >
 

Additional Inherited Members

- Public Types inherited from TSelector
enum  EAbort
 
- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 
- Static Public Member Functions inherited from TSelector
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static TSelectorGetSelector (const char *filename)
 
static Bool_t IsStandardDraw (const char *selec)
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 
- Static Public Member Functions inherited from KVDataAnalysisTreeHistoHandler< KVEventSelector >
static const Char_tClass_Name ()
 
- Public Attributes inherited from TSelector
 kAbortFile
 
 kAbortProcess
 
 kContinue
 
- Public Attributes inherited from TObject
 kBitMask
 
 kCanDelete
 
 kCannotPick
 
 kHasUUID
 
 kInconsistent
 
 kInvalidObject
 
 kIsOnHeap
 
 kIsReferenced
 
 kMustCleanup
 
 kNoContextMenu
 
 kNotDeleted
 
 kObjInCanvas
 
 kOverwrite
 
 kSingleKey
 
 kWriteDelete
 
 kZombie
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 
void MakeZombie ()
 
- Protected Attributes inherited from TSelector
EAbort fAbort
 
TListfInput
 
TObjectfObject
 
TString fOption
 
TSelectorListfOutput
 
Long64_t fStatus
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 

Constructor & Destructor Documentation

◆ KVEventSelector()

KVEventSelector::KVEventSelector ( TTree = 0)
inline

Definition at line 294 of file KVEventSelector.h.

Member Function Documentation

◆ AddGV() [1/2]

KVVarGlob* KVEventSelector::AddGV ( const Char_t class_name,
const Char_t name 
)
inline

Create and return a pointer to a new global variable with given name and class. The variable will be added to the default global variable list (see GetGVList())

Parameters
class_nameglobal variable class to use (see list here: Global Variables )
namename of new global variable
Returns
pointer to new global variable object

Definition at line 553 of file KVEventSelector.h.

◆ AddGV() [2/2]

void KVEventSelector::AddGV ( KVVarGlob vg)
inline

Add the global variable to the default list (see GetGVList()).

Equivalent to GetGVList()->AddGV(vg)

Parameters
vgpointer to a heap-allocated KVVarGlob object

Definition at line 538 of file KVEventSelector.h.

◆ AddGVList()

KVGVList* KVEventSelector::AddGVList ( const KVString list_name,
const KVParticleCondition selection = KVParticleCondition() 
)
inline

Create a new list of global variables with given name and an optional particle selection.

Parameters
[in]list_namename of new list, can be used to retrieve list with GetGVList()
[in]selection[optional] selection criteria for particles to be used by global variables, default is no selection
Returns
pointer to new global variable list

Definition at line 481 of file KVEventSelector.h.

◆ Analysis()

virtual Bool_t KVEventSelector::Analysis ( void  )
inlinevirtual

The Analysis() method is called for each accepted event in the TTree or TChain. Events may be rejected for two reasons:

A pointer to the current event can be obtained with the GetEvent() method. The user can then iterate over the nuclei in each event using any of the methods detailed in Iterating over nuclei in the Users Guide:

for(auto& n : EventIterator(GetEvent()) )
{
FillHisto("Zdist", n.GetZ());
}
Class for iterating over nuclei in events accessed through base pointer/reference.
void FillHisto(const Char_t *histo_name, Double_t x, Double_t y=1, Double_t z=1, Double_t w=1)
Fill previously-declared histogram with given name and required arguments.
const Int_t n

The definition of which nuclei are OK or not is carried out before this method is called (see InitRun()). This will affect iterations such as:

for(auto& n : ReconEventOKIterator(GetEvent())) { ... }
Wrapper class for iterating over "OK" nuclei in KVReconstructedEvent accessed through base pointer or...

as well as any global variables which are defined using the default global variable list (see GetGVList()).

When analysing experimental or filtered data the "cm" frame corresponding to the centre of mass of the reaction being studied is defined for each nucleus in the event before this method is called.

Reimplemented in KVEventFiltering, and KVDataQualityAuditSelector.

Examples
CompleteEvents.cpp, CompleteEventsFW.cpp, ExampleAnalysis_KVEventMixerN_2Body.cpp, ExampleAnalysis_KVEventMixerN_3Body.cpp, ExampleCorrelationAnalysis.cpp, ExampleFilteredSimDataAnalysis.cpp, ExampleReconAnalysis.cpp, and ExampleSimDataAnalysis.cpp.

Definition at line 461 of file KVEventSelector.h.

◆ Begin()

void KVEventSelector::Begin ( TTree tree)
overridevirtual

Reimplemented from TSelector.

Definition at line 23 of file KVEventSelector.cpp.

◆ EndAnalysis()

◆ EndRun()

◆ GetBranchName()

const Char_t* KVEventSelector::GetBranchName ( ) const
inline

Definition at line 344 of file KVEventSelector.h.

◆ GetEntry()

Int_t KVEventSelector::GetEntry ( Long64_t  entry,
Int_t  getall = 0 
)
inlineoverridevirtual

Reimplemented from TSelector.

Reimplemented in KVFAZIASelector.

Definition at line 313 of file KVEventSelector.h.

◆ GetEvent()

KVEvent* KVEventSelector::GetEvent ( ) const
inline

Access current event when called from Analysis() method

Returns
pointer to current event

Definition at line 355 of file KVEventSelector.h.

◆ GetEventNumber()

Int_t KVEventSelector::GetEventNumber ( ) const
inline
Returns
number of current event

Definition at line 362 of file KVEventSelector.h.

◆ GetFriendEvent()

KVEvent* KVEventSelector::GetFriendEvent ( ) const
inline

Definition at line 321 of file KVEventSelector.h.

◆ GetFriendTreeEntry()

Int_t KVEventSelector::GetFriendTreeEntry ( Long64_t  entry,
Int_t  getall = 0 
)
inline

Definition at line 317 of file KVEventSelector.h.

◆ GetGV()

KVVarGlob* KVEventSelector::GetGV ( const Char_t name) const
inline

Access global variable in the default list of global variables for the analysis (see GetGVList())

This is equivalent to GetGVList()->GetGV( name ).

Parameters
namename of global variable to retrieve
Returns
pointer to variable if found

Definition at line 566 of file KVEventSelector.h.

◆ GetGVList() [1/2]

KVGVList* KVEventSelector::GetGVList ( const KVString list_name = "default")
inline
Parameters
list_namename of global variable list (default value: "default")
Returns
pointer to the named list of global variables

If no name is given i.e. the list_name = "default" and no such global variable lists has been defined, this will automatically create the "default" list, for which the default particle selection is to only include 'OK' particles (this is for backwards compatibility with existing analysis classes and will change in future to default selection = no selection)

If the list_name = "__internal__" and no such list exists, a list is created with no defined selection and added to the beginning of the list of global variable lists. This is used internally to implement e.g. event selection depending on various trigger criteria etc

For all other cases, global variable lists which were created with AddGVList() can be retrieved with this method

Definition at line 507 of file KVEventSelector.h.

◆ GetGVList() [2/2]

const KVGVList* KVEventSelector::GetGVList ( const KVString list_name = "default") const
inline
Parameters
list_namename of global variable list to access
Returns
read-only pointer to global variable list with given name

Definition at line 527 of file KVEventSelector.h.

◆ GetOpt()

TString KVEventSelector::GetOpt ( const Char_t option) const
inline

Definition at line 601 of file KVEventSelector.h.

◆ GetOutputList()

TList* KVEventSelector::GetOutputList ( ) const
inlineoverridevirtual

Reimplemented from TSelector.

Definition at line 333 of file KVEventSelector.h.

◆ Init()

void KVEventSelector::Init ( TTree tree)
overridevirtual

Reimplemented from TSelector.

Reimplemented in KVINDRAEventSelector, KVFAZIASelector, and KVReconEventSelector.

Definition at line 418 of file KVEventSelector.cpp.

◆ InitAnalysis()

virtual void KVEventSelector::InitAnalysis ( void  )
inlinevirtual

This is the 1st method called when a new analysis is started. It is the place to define any histograms and/or TTrees to be filled during the analysis, using AddHisto() and AddTree(), plus optionally the name of the output ROOT file containing them:

AddHisto<TH1F>("h1", "Z distribution", 50, .5, 50.5);
AddHisto<TProfile>("h2", "<pT> vs. rapidity", 200, -1., 1.);
auto t = AddTree("my_tree", "Some interesting results here");
t->AddVectorBranch<int>(t, "Z");
SetJobOutputFileName("MyAmazingResults.root");
void SetJobOutputFileName(const TString &filename)

(for easy use of std::vector branches in the TTree, see KVTreeVectorBranchHandler::AddVectorBranch()).

Note that by using these methods as shown here

  • the histograms and TTrees will automatically be written to file at the end of the analysis
  • the analysis can function in parallel with PROOFLite without any change to the code

This is also the place to define any global variables which the user wants to use for her analysis (see Global Variables in the Users Guide). Each analysis class can use 1 or more lists of global variables, each with an associated selection of the particles of each event to be included in the calculation of each variable (see AddGVList(), GetGVList(), AddGV() and GetGV() methods).

The user can automatically add branches to be filled with a global variable list to any TTree created here like so:

auto t = AddTree("my_tree", "Some interesting results here");
GetGVList("my_variables")->MakeBranches(t);
KVGVList * GetGVList(const KVString &list_name="default")
void MakeBranches(TTree *)
Definition: KVGVList.cpp:418

See KVGVList::MakeBranches() and Automatic TTree branch creation and filling.

Reimplemented in KVEventFiltering, and KVDataQualityAuditSelector.

Examples
CompleteEvents.cpp, CompleteEventsFW.cpp, ExampleAnalysis_KVEventMixerN_2Body.cpp, ExampleAnalysis_KVEventMixerN_3Body.cpp, ExampleCorrelationAnalysis.cpp, ExampleFilteredSimDataAnalysis.cpp, ExampleReconAnalysis.cpp, and ExampleSimDataAnalysis.cpp.

Definition at line 405 of file KVEventSelector.h.

◆ InitRun()

virtual void KVEventSelector::InitRun ( )
inlinevirtual

This method is called every time a new file in the TChain is opened (for experimental data, each file represents a new 'run')

When analysing experimental or filtered data, this is the first time in the analysis where

This is the last place where the user can modify the definition of 'OK' particles (used by the default global variable list: see GetGVList()) when analysing experimental or filtered data:

Note
When a particle has been declared 'not OK', there is no way to reverse this using e.g. SetParticleConditions() which only applies to particles which are 'OK'.

Reimplemented in KVDataQualityAuditSelector_E789, KVEventFiltering, KVDataQualityAuditSelector, and KVDataQualityAuditSelector_E818.

Examples
CompleteEvents.cpp, CompleteEventsFW.cpp, ExampleAnalysis_KVEventMixerN_2Body.cpp, ExampleAnalysis_KVEventMixerN_3Body.cpp, ExampleCorrelationAnalysis.cpp, ExampleFilteredSimDataAnalysis.cpp, ExampleReconAnalysis.cpp, and ExampleSimDataAnalysis.cpp.

Definition at line 426 of file KVEventSelector.h.

◆ IsOptGiven()

Bool_t KVEventSelector::IsOptGiven ( const Char_t option)
inline

Definition at line 597 of file KVEventSelector.h.

◆ Notify()

Bool_t KVEventSelector::Notify ( )
overridevirtual

Reimplemented from TSelector.

Reimplemented in KVFAZIASelector.

Definition at line 491 of file KVEventSelector.cpp.

◆ Process()

Bool_t KVEventSelector::Process ( Long64_t  entry)
overridevirtual

Reimplemented from TSelector.

Definition at line 128 of file KVEventSelector.cpp.

◆ SaveHistos()

virtual void KVEventSelector::SaveHistos ( const Char_t = "",
Option_t = "recreate",
Bool_t  = kFALSE 
)
inlinevirtual

Definition at line 588 of file KVEventSelector.h.

◆ SetAdditionalBranchAddress()

virtual void KVEventSelector::SetAdditionalBranchAddress ( )
inlinevirtual

To implement in child classes if user needs to initialize other branches in the analysed TTree/TChain in addition to the one containing the KVEvent objects

Access the analysed TTree/TChain through member variable fChain

Definition at line 616 of file KVEventSelector.h.

◆ SetBranchName()

void KVEventSelector::SetBranchName ( const Char_t n)
inline

Definition at line 340 of file KVEventSelector.h.

◆ SetCurrentRun()

virtual void KVEventSelector::SetCurrentRun ( KVDBRun )
inlinevirtual

Reimplemented in KVINDRAEventSelector, and KVReconEventSelector.

Definition at line 348 of file KVEventSelector.h.

◆ SetEventsReadInterval()

void KVEventSelector::SetEventsReadInterval ( Long64_t  N)
inline

Definition at line 299 of file KVEventSelector.h.

◆ SetInputList()

void KVEventSelector::SetInputList ( TList input)
inlineoverridevirtual

Reimplemented from TSelector.

Definition at line 329 of file KVEventSelector.h.

◆ SetJobOutputFileName()

void KVEventSelector::SetJobOutputFileName ( const TString filename)
inline

Call in InitAnalysis() to set the name of the output file containing all histograms and TTrees produced by analysis.

For interactive jobs or jobs using PROOF, filename will be used for the ROOT file.

For jobs using a batch system to execute many jobs in parallel, this will be replaced by the job name plus the '.root' extension.

Parameters
filenamename to use for ROOT file

Definition at line 629 of file KVEventSelector.h.

◆ SetObject()

void KVEventSelector::SetObject ( TObject obj)
inlineoverridevirtual

Reimplemented from TSelector.

Definition at line 325 of file KVEventSelector.h.

◆ SetOpt()

void KVEventSelector::SetOpt ( const Char_t option,
const Char_t value 
)
inline

Definition at line 593 of file KVEventSelector.h.

◆ SetParticleConditions()

void KVEventSelector::SetParticleConditions ( const KVParticleCondition cond)
inline

Use this method to set further criteria for selecting "OK" particles in each event (in addition to any which may be set by default: see InitRun()).

This method must be called in the user's InitAnalysis() or InitRun() method.

Parameters
condparticle selection criteria (see KVParticleCondition)

Definition at line 583 of file KVEventSelector.h.

◆ SetTriggerConditionsForRun()

void KVEventSelector::SetTriggerConditionsForRun ( int  run)
inline

Call this method in your InitRun() method with the current run number in order to automatically reject events which are not consistent with the acquisition trigger

Parameters
runcurrent run number

Definition at line 643 of file KVEventSelector.h.

◆ SlaveBegin()

void KVEventSelector::SlaveBegin ( TTree tree)
overridevirtual

Reimplemented from TSelector.

Reimplemented in KVFAZIASelector.

Definition at line 65 of file KVEventSelector.cpp.

◆ SlaveTerminate()

void KVEventSelector::SlaveTerminate ( )
overridevirtual

Reimplemented from TSelector.

Definition at line 192 of file KVEventSelector.cpp.

◆ Terminate()

void KVEventSelector::Terminate ( )
overridevirtual

Reimplemented from TSelector.

Definition at line 219 of file KVEventSelector.cpp.

◆ UnsetOpt()

void KVEventSelector::UnsetOpt ( const Char_t opt)
inline

Definition at line 605 of file KVEventSelector.h.

◆ Version()

Int_t KVEventSelector::Version ( ) const
inlineoverridevirtual

Reimplemented from TSelector.

Definition at line 303 of file KVEventSelector.h.

Friends And Related Function Documentation

◆ KVDataAnalysisTreeHistoHandler< KVEventSelector >

Definition at line 1 of file KVEventSelector.h.