4 #ifndef __KVSIMREADER_H
5 #define __KVSIMREADER_H
7 #include "KVSimEvent.h"
8 #include "KVSimNucleus.h"
12 #include "KVUnownedList.h"
15 #include "KVFileReader.h"
123 Int_t total_nevents,total_nevents_current_output_file;
124 KVString tree_name{
"SIMULATION_NAME"}, tree_title{
"SIMULATION"},
125 branch_name{
"Simulated_evts"}, root_file_name{
"Output.root"};
126 Bool_t fMultiFiles =
false;
127 Int_t fFileIndex = 1;
128 TString fOutputDirectory =
"./";
133 std::optional<int> max_number_events_per_output_file;
134 int current_output_file_index=0;
136 bool OutputFileIsFull()
const
138 return max_number_events_per_output_file
139 && total_nevents_current_output_file==*max_number_events_per_output_file;
141 bool NeedNewOutputFile()
const
149 stime.
Form(
"%d_%02d_%02d_%02d:%02d:%02d",
159 void InitializeOutputFileAndTree();
169 void CreateObjectList();
176 void ReadEventsInFile();
177 TString GetCurrentRootFileName();
197 max_number_events_per_output_file=nev;
210 fOutputDirectory = where;
252 root_file_name =
name;
253 if(root_file_name.
Index(
".root")>0)
254 root_file_name.
Remove(root_file_name.
Index(
".root"));
#define ClassDef(name, id)
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 on
Handle reading columns of numeric data in text files.
A generic named parameter storing values of different types.
KaliVeda extensions to ROOT collection classes.
Container class for simulated nuclei, KVSimNucleus.
Nucleus in a simulated event.
Base class to convert output from different simulation codes into TTrees containing KVSimEvent event ...
void SetROOTFileName(KVString name)
void SetMaxNumEventsPerOutputFile(int nev)
KVString GetTreeTitle() const
void SetOutputDirectory(const TString &where)
virtual Bool_t ReadEventHeader(KVSimEvent *)
void SetTreeTitle(KVString n)
virtual Bool_t ReadNucleus(KVSimNucleus *)
virtual Bool_t ReadFileHeader()
static KVSimReader * MakeSimReader(const char *model_uri)
Returns an instance of a child class specific to given model.
virtual void NotifyChangeOfOutputFile()
void ConvertEventsInFile(KVString filename)
void SetBranchName(KVString n)
int GetEventNumber() const
void SetFileIndex(Int_t i)
virtual Bool_t ReadEvent(KVSimEvent *evt)=0
void SetMultiFiles(Bool_t on=kTRUE)
void ConvertAndSaveEventsInFile(KVString filename)
Read events, convert and save in ROOT file(s)
void SetTreeName(KVString n)
virtual bool NeedToIterateReadEvent()
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Extended TList class which does not own its objects by default.
void Form(const char *fmt,...)
TString & Remove(EStripType s, char c)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const