1#ifndef KVEventSelector_h
2#define KVEventSelector_h
11#include "KVParticleCondition.h"
12#include "KVHashList.h"
16#include "KVUserAnalysisOptionList.h"
18#include "KVDataAnalyser.h"
359 Error(
"GetEventNumber",
"No event defined!!!");
476 Error(
"AddGVList",
"You tried to add a list with the same name '%s' as an existing list: no list created",
533 Error(
"AddGV(KVVarGlob*)",
"KVVarGlob pointer is null");
562 Error(
"GetGV(const Char_t* name)",
"Request for undefined global variable name=%s",
name);
582 Deprecate(
Form(
"You should use e.g. 'auto h = AddHisto<%s>(\"%s\",\"%s\",%d,...);' to add histograms to your analysis.",
602 template<
typename HistoType,
typename... Args>
612 Deprecate(
Form(
"You should use e.g. 'auto t = AddTree(\"%s\", \"%s\");' to add a TTree to your analysis",
613 tree->GetName(),
tree->GetTitle()));
670 if (!t)
Fatal(
"GetTree",
"Tree %s not found: is this the right name?",
name);
676 Error(
"SaveHistos",
"Method no longer implemented. Does nothing.");
740#define AddVar(var,type) Branch(dadastr(var), &var, didixstr(duduvartype(var,type)))
741#define AddVarBranch(var,branch,type) Branch(dadastr(branch), &var, didixstr(duduvartype(branch,type)))
742#define duduvartype(var,type) var/type
743#define didixstr(s) dadastr(s)
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char * Form(const char *fmt,...)
TVector3 GetCMVelocity() const
Return vector velocity of centre of mass of reaction (units: cm/ns)
virtual const Char_t * GetJobName() const
Description of an experimental run in database ,,.
virtual void SetTriggerConditionsForRun(int)
virtual const KV2Body * GetKinematics() const
virtual const KVBatchSystem * GetBatchSystem()
EProofMode GetProofMode() const
static Bool_t IsRunningBatchAnalysis()
General purpose analysis base class for TTree containing KVEvent objects.
virtual void SetInputList(TList *input)
void FillTProfile2D(TProfile2D *h2, Double_t one, Double_t two, Double_t three, Double_t four)
virtual Int_t Version() const
virtual void SaveHistos(const Char_t *="", Option_t *="recreate", Bool_t=kFALSE)
void AddGV(KVVarGlob *vg)
const KVHashList * GetTreeList() const
GetTreeList.
Bool_t fDisableCreateTreeFile
used with PROOF
KVEventSelector(TTree *=0)
void SetUpAuxEventChain()
Bool_t fFirstEvent
set to kFALSE after first event is read
Int_t GetFriendTreeEntry(Long64_t entry, Int_t getall=0)
TH1 * GetHisto(const Char_t *name) const
TProofOutputFile * mergeFile
output file for trees and histos
KVHashList lhisto
list of histograms added with AddHisto
virtual void InitAnalysis()
KVHashList ltree
list of trees added with AddTree
KVVarGlob * AddGV(const Char_t *class_name, const Char_t *name)
void InitFriendTree(TTree *tree, const TString &branchname)
void SetParticleConditions(const KVParticleCondition &cond)
void SetOpt(const Char_t *option, const Char_t *value)
TTree * fAuxChain
[optional] pointer to another TTree or TChain which may be used during analysis
const KVHashList * GetHistoList() const
void SetCombinedOutputFile(const TString &filename)
virtual Bool_t Analysis()
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
KVEvent * Event
Declaration of leaf types.
TTree * GetTree(const Char_t *name) const
Long64_t fEventsRead
number of events read
virtual void CheckEndOfRun()
void FillTH2(TH2 *h2, Double_t one, Double_t two, Double_t three)
KVEvent * GetEvent() const
virtual void Begin(TTree *tree)
Long64_t fTreeEntry
current tree entry number
virtual TList * GetOutputList() const
TTree * fChain
pointer to the analyzed TTree or TChain
void create_output_file()
KVVarGlob * GetGV(const Char_t *name) const
Bool_t CreateTreeFile(const Char_t *filename="")
KVString fCombinedOutputFile
name for ROOT file containing histos and/or trees produced by analysis
void AddTree(TTree *tree)
KVString fBranchName
name of branch which contains events to analyse
virtual void SlaveBegin(TTree *tree)
virtual void SlaveTerminate()
void SetEventsReadInterval(Long64_t N)
void SetJobOutputFileName(const TString &filename)
void add_histo(TH1 *histo)
for merging with PROOF
void AddHisto(TH1 *histo)
void FillHisto(const Char_t *sname, Double_t one, Double_t two=1, Double_t three=1, Double_t four=1)
KVUniqueNameList fGlobalVariables
Lists of global variables with different selection criteria.
TBranch * b_Event
List of branches.
void SetBranchName(const Char_t *n)
virtual void SetAdditionalBranchAddress()
Bool_t IsOptGiven(const Char_t *option)
void FillTProfile(TProfile *h1, Double_t one, Double_t two, Double_t three)
virtual void SetCurrentRun(KVDBRun *)
KVParticleCondition fPartCond
(optional) conditions for selecting particles
void FillTH1(TH1 *h1, Double_t one, Double_t two)
virtual void SetObject(TObject *obj)
void add_tree(TTree *tree)
void RecalculateGlobalVariables()
void SetTriggerConditionsForRun(int run)
const KVGVList * GetGVList(const KVString &list_name="default") const
virtual Bool_t Process(Long64_t entry)
Bool_t fNotifyCalled
avoid multiple calls to Notify/InitRun
TString GetOpt(const Char_t *option) const
const Char_t * GetBranchName() const
virtual void EndAnalysis()
virtual void ParseOptions()
void SetEvent(KVEvent *e)
Bool_t fGlobalVariableAbortEventAnalysis
KVEvent * AuxEvent
[optional] events in fAuxChain
KVGVList * AddGVList(const KVString &list_name, const KVParticleCondition &selection=KVParticleCondition())
Long64_t fEventsReadInterval
interval at which to print number of events read
KVGVList * GetGVList(const KVString &list_name="default")
Int_t GetEventNumber() const
void FillTH3(TH3 *h3, Double_t one, Double_t two, Double_t three, Double_t four)
void FillTree(const Char_t *tree_name="")
KVEvent * GetFriendEvent() const
void UnsetOpt(const Char_t *opt)
HistoType * AddHisto(Args &&... args)
KVUserAnalysisOptionList fOptionList
parsed list of options given to TTree::Process
Abstract base class container for multi-particle events.
virtual void SetFrame(const Char_t *, const KVFrameTransform &)=0
#define KVGVLIST_OPTIMIZE_GVLIST
KVVarGlob * AddGV(const Char_t *class_name, const Char_t *name)
virtual void Add(TObject *obj)
KVVarGlob * GetGV(const Char_t *nom) const
Return pointer to global variable in list with name 'nom'.
Extended version of ROOT THashList.
virtual TObject * FindObject(const char *name) const
virtual void SetOwner(Bool_t enable=kTRUE)
T * get_object(const TString &name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Optimised list in which named objects can only be placed once.
virtual void Add(TObject *obj)
virtual void AddFirst(TObject *obj)
Handle list of options and input parameters for user analyis .
void SetOpt(const Char_t *option, const Char_t *value)
TString GetOpt(const Char_t *opt) const
Bool_t IsOptGiven(const Char_t *opt)
void UnsetOpt(const Char_t *opt)
Base class for all global variable implementations.
virtual Int_t GetNbinsX() const
const char * GetName() const override
const char * GetTitle() const override
void AbstractMethod(const char *method) const
virtual const char * ClassName() const
virtual void Error(const char *method, const char *msgfmt,...) const
virtual void Fatal(const char *method, const char *msgfmt,...) const
const char * Data() const
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual Long64_t GetEntries() const
virtual TTree * GetTree() const