1 #ifndef KVEventSelector_h
2 #define KVEventSelector_h
307 Error(
"GetEventNumber",
"No event defined!!!");
343 auto gvl =
new KVGVList(list_name, selection);
373 Error(
"AddGV(KVVarGlob*)",
"KVVarGlob pointer is null");
386 Error(
"GetGV(const Char_t* name)",
"Request for undefined global variable name=%s", name);
405 Deprecate(
Form(
"You should use e.g. 'auto h = AddHisto<%s>(\"%s\",\"%s\",%d,...);' to add histograms to your analysis.",
410 template<
typename HistoType,
typename... Args>
426 auto h =
new HistoType(std::forward<Args>(args)...);
433 Deprecate(
Form(
"You should use e.g. 'auto t = AddTree(\"%s\", \"%s\");' to add a TTree to your analysis",
434 tree->GetName(),
tree->GetTitle()));
451 Error(
"SaveHistos",
"Method no longer implemented. Does nothing.");
498 #define AddVar(var,type) Branch(dadastr(var), &var, didixstr(duduvartype(var,type)))
499 #define AddVarBranch(var,branch,type) Branch(dadastr(branch), &var, didixstr(duduvartype(branch,type)))
500 #define duduvartype(var,type) var/type
501 #define didixstr(s) dadastr(s)
502 #define dadastr(s) #s
KVDataAnalyser * gDataAnalyser
KVTemplateParticleCondition< KVNucleus > KVParticleCondition
#define ClassDef(name, id)
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 const KVBatchSystem * GetBatchSystem()
virtual const KV2Body * GetKinematics() const
EProofMode GetProofMode() const
static Bool_t IsRunningBatchAnalysis()
General purpose analysis 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
return the list of created trees
KVVarGlob * GetGV(const Char_t *name) const
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
void SetParticleConditions(const KVParticleCondition &, const KVString &="")
const Char_t * GetBranchName() const
void FillTree(const Char_t *sname="")
virtual void InitAnalysis()
KVHashList ltree
list of trees added with AddTree
void InitFriendTree(TTree *tree, const TString &branchname)
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
return the list of created trees
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.
virtual void SetAnalysisFrame()
TTree * GetTree(const Char_t *name) const
return the tree named tree_name
Long64_t fEventsRead
number of events read
virtual void CheckEndOfRun()
Testing whether EndRun() should be called.
void FillTH2(TH2 *h2, Double_t one, Double_t two, Double_t three)
virtual void Begin(TTree *tree)
Long64_t fTreeEntry
current tree entry number
TTree * fChain
pointer to the analyzed TTree or TChain
void create_output_file()
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)
const KVGVList * GetGVList(const KVString &list_name="default") const
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)
KVGVList * GetGVList(const KVString &list_name="default")
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 *)
KVEvent * GetFriendEvent() const
KVParticleCondition fPartCond
(optional) conditions for selecting particles
KVEvent * GetEvent() const
void SetTriggerConditionsForRun(int)
void FillTH1(TH1 *h1, Double_t one, Double_t two)
virtual void SetObject(TObject *obj)
virtual void Init(TTree *tree)
void SetParticleConditionsParticleClassName(const KVString &t)
void add_tree(TTree *tree)
virtual void RecalculateGlobalVariables()
KVGVList * AddGVList(const KVString &list_name, const KVParticleCondition &selection=KVParticleCondition())
virtual Bool_t Process(Long64_t entry)
Bool_t fNotifyCalled
avoid multiple calls to Notify/InitRun
TString GetOpt(const Char_t *option) const
virtual void EndAnalysis()
virtual void ParseOptions()
void SetEvent(KVEvent *e)
Bool_t fGlobalVariableAbortEventAnalysis
KVEvent * AuxEvent
[optional] events in fAuxChain
Long64_t fEventsReadInterval
interval at which to print number of events read
HistoType * AddHisto(Args &&... args)
Int_t GetEventNumber() const
void FillTH3(TH3 *h3, Double_t one, Double_t two, Double_t three, Double_t four)
virtual TList * GetOutputList() const
KVString fPartName
(optional) classname for upcasting in KVParticleCondition::Optimize
void UnsetOpt(const Char_t *opt)
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
Manage a list of global variables.
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 void SetOwner(Bool_t enable=kTRUE)
virtual TObject * FindObject(const char *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)
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 Bool_t IsEmpty() const
virtual Int_t GetNbinsX() const
virtual const char * GetName() const
virtual const char * GetTitle() const
void AbstractMethod(const char *method) const
virtual const char * ClassName() const
virtual void Error(const char *method, const char *msgfmt,...) const
const char * Data() const
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual TTree * GetTree() const
virtual Long64_t GetEntries() const