40 TString ds_table_name =
Form(
"Table_%d", ds_table_number);
57 fConfigDB.add_table(DStable);
59 fConfigDB[
"Datasets"][
"Table"] = ds_table_name;
60 fConfigDB.update(
"Datasets",
"Table",
Form(
"Name=\"%s\"", sd->
GetName()));
70 fConfigDB.prepare_data_insertion(ds_table_name);
76 dstable[
"Id"].set_null();
77 dstable[
"FileName"] = sf->
GetName();
78 dstable[
"TreeInfo"] = sf->
GetTitle();
79 dstable[
"Filtered"] = 0;
83 fConfigDB.insert_data_row();
90 dstable[
"Id"].set_null();
91 dstable[
"FileName"] = sf->
GetName();
92 dstable[
"TreeInfo"] = sf->
GetTitle();
93 dstable[
"Filtered"] = 1;
99 dstable[
"Run"] = sf->
GetRun();
105 fConfigDB.insert_data_row();
108 fConfigDB.end_data_insertion();
119 : fGuirc(
".kvsimdirguirc")
121 , fConfigDB(
gSystem->ExpandPathName(
"$(HOME)/.kvsimdirguidb"))
148 BaddDir->
Connect(
"Clicked()",
"KVSimDirGUI",
this,
"AddSimDir()");
153 BimpSim->
Connect(
"Clicked()",
"KVSimDirGUI",
this,
"ImportSimulation()");
158 BremDir->
Connect(
"Clicked()",
"KVSimDirGUI",
this,
"RemSimDir()");
183 fDirListTree->
Connect(
"Clicked(TGListTreeItem*,Int_t)",
"KVSimDirGUI",
this,
"SelectSimDir(TGListTreeItem*,Int_t)");
235 change_class->
Connect(
"Clicked()",
"KVSimDirGUI",
this,
"SelectAnalysisClass()");
241 new_anal_class->
Connect(
"Clicked()",
"KVSimDirGUI",
this,
"NewSimulatedAnalysisClass()");
244 new_filt_class->
Connect(
"Clicked()",
"KVSimDirGUI",
this,
"NewFilteredAnalysisClass()");
274 for (
int i = 1; i <= ndatasets; i++) {
281 fCBdataset->
Connect(
"Selected(const char*)",
"KVSimDirGUI",
this,
"SelectDataSet(const char*)");
291 fCBsystem->
Connect(
"Selected(const char*)",
"KVSimDirGUI",
this,
"SelectSystem(const char*)");
295 fTESystem->
SetToolTipText(
"[Projectile_Symbol]+[Target_Symbol]@[Incident_Energy]MeV/A (ex: 129Xe+119Sn@50.0MeV/A)");
297 fTESystem->
Connect(
"TextChanged(const char*)",
"KVSimDirGUI",
this,
"UpdateSystemText(const char*)");
308 fCBrun->
Connect(
"Selected(const char*)",
"KVSimDirGUI",
this,
"SelectRun(const char*)");
326 bgroup->
Connect(
"Clicked(Int_t)",
"KVSimDirGUI",
this,
"FilterType(Int_t)");
376 bgroup->
Connect(
"Clicked(Int_t)",
"KVSimDirGUI",
this,
"Kinematics(Int_t)");
421 lab =
new TGLabel(hf,
"Events : ");
427 fCBAllEvents->
Connect(
"Toggled(Bool_t)",
"KVSimDirGUI",
this,
"EnableEventNumberEntry(Bool_t)");
441 launch_analysis->
Connect(
"Clicked()",
"KVSimDirGUI",
this,
"Run()");
443 launch_analysis->
Resize(40, 40);
462 bool sqlite_conversion =
false;
464 sqlite_conversion =
true;
472 if (!sqlite_conversion) {
483 if (sqlite_conversion) {
491 while (!simdirs.
End()) {
496 if (sqlite_conversion) {
498 fConfigDB[
"Datasets"][
"Directory"] = simdirectory;
506 if (sqlite_conversion) {
587 while ((o = next())) {
636 if (simdirs !=
"") simdirs +=
" ";
637 simdirs += simdirname;
643 int ds_table_num = 0;
648 "Table_%d", &ds_table_num);
653 fConfigDB[
"Datasets"][
"Name"] = simdirname;
711 while ((togo = (
KVSimDir*)next())) {
712 if (simdirs !=
"") simdirs +=
" ";
748 const char* filetypes[] = {
749 "Class header files",
"*.h",
759 if (idot < 0)
return;
836 while ((dbr = (
KVDBRun*)next())) {
906 TList* runs_to_analyse(
nullptr);
907 TList* aux_runs_to_analyse(
nullptr);
909 if (
type ==
"tree") {
910 if (!selected_sim_runs->GetEntries() && !selected_filt_runs->GetEntries()) {
922 if (selected_sim_runs->GetEntries()) {
923 if (selected_filt_runs->GetEntries()) {
926 runs_to_analyse = selected_filt_runs.get();
927 analysis_task =
"analysis filtered";
928 aux_runs_to_analyse = selected_sim_runs.get();
931 runs_to_analyse = selected_sim_runs.get();
932 analysis_task =
"analysis simulated";
936 runs_to_analyse = selected_filt_runs.get();
937 analysis_task =
"analysis filtered";
942 if (selected_filt_runs->GetEntries()) {
946 if (!selected_sim_runs->GetEntries()) {
950 runs_to_analyse = selected_sim_runs.get();
951 analysis_task =
"filter simulated";
972 if (
type ==
"filter") {
983 if (!cancel_batch_job) {
991 selected_filt_runs.reset(
nullptr);
992 selected_sim_runs.reset(
nullptr);
1008 else kinema =
"lab";
1015 filter =
"GeoThresh";
1027 Error(
"SetFilterOptions",
"Please check the format of the ad hoc system name you gave");
1028 WarningBox(
"Bad System",
"Please check the format of the ad hoc system name you gave",
kFALSE);
1040 options +=
Form(
"Filter=%s,", filter.
Data());
1041 options +=
Form(
"Kinematics=%s", kinema.
Data());
1049 options +=
",Gemini=yes";
1053 else options +=
Form(
",GemAddRotEner=no");
1068 const char* filetypes[] = {
1081 if (one_file || many_files) {
1086 while (!plugins.
End()) {
1089 if (choices.
Length()) choices +=
" ";
1101 SR->ConvertAndSaveEventsInFile(fi.
fFilename);
1113 while ((o = it())) {
1115 SR->SetMultiFiles();
1116 SR->SetFileIndex(i++);
1118 SR->ConvertAndSaveEventsInFile(o->
GetName());
1141 new KVInputDialog(
MainFrame,
"Enter name of new analysis class", &classname, &ok,
"Enter name of new analysis class");
1145 ok = ok &&
WarningBox(
"Replacing existing class",
1146 Form(
"%s is the name of an existing class defined in [%s,%s].\nDo you want to overwrite this class?\n(All existing code will be lost)",
1165 new KVInputDialog(
MainFrame,
"Enter name of new analysis class", &classname, &ok,
"Enter name of new analysis class");
1169 ok = ok &&
WarningBox(
"Replacing existing class",
1170 Form(
"%s is the name of an existing class defined in [%s,%s].\nDo you want to overwrite this class?\n(All existing code will be lost)",
1200 reply = (ret_code &
kMBYes);
1219 fConfigDB[
"Datasets"][
"Directory"].get_data<TString>()));
1221 fConfigDB[
"Datasets"][
"Table"].get_data<TString>());
1223 for (
int i = 0; i < tables.
GetNpar(); ++i) {
1228 if (dstable[
"Filtered"].get_data<int>()) {
1232 dstable[
"FileName"].get_data<TString>(), dstable[
"TreeInfo"].get_data<TString>(),
1233 dstable[
"Events"].get_data<int>(), dstable[
"TreeName"].get_data<TString>(),
1234 dstable[
"BranchName"].get_data<TString>(), dstable[
"DataSet"].get_data<TString>(),
1235 dstable[
"System"].get_data<TString>(), dstable[
"Run"].get_data<int>(),
1236 dstable[
"GeoType"].get_data<TString>(), dstable[
"OrigFile"].get_data<TString>(),
1237 dstable[
"FiltType"].get_data<TString>()
1239 f->SetGemini(dstable[
"Gemini"].get_data<bool>());
1240 if (
f->IsGemini())
f->SetGemDecayPerEvent(dstable[
"GemDecayPerEvent"].get_data<int>());
1247 dstable[
"FileName"].get_data<TString>(), dstable[
"TreeInfo"].get_data<TString>(),
1248 dstable[
"Events"].get_data<int>(), dstable[
"TreeName"].get_data<TString>(),
1249 dstable[
"BranchName"].get_data<TString>());
KVBatchSystemManager * gBatchSystemManager
KVBatchSystem * gBatchSystem
KVDataAnalyser * gDataAnalyser
KVDataSetManager * gDataSetManager
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
char * StrDup(const char *str)
R__EXTERN TSystem * gSystem
Relativistic binary kinematics calculator.
void Print(Option_t *opt="") const
void CalculateKinematics()
Base class for KaliVeda framework.
static Bool_t FindClassSourceFiles(const Char_t *class_name, KVString &imp_file, KVString &dec_file, const Char_t *dir_name=".")
static const Char_t * GetListOfPlugins(const Char_t *base)
static const Char_t * GetPluginURI(const Char_t *base, const Char_t *plugin)
virtual void Copy(TObject &) const
Make a copy of this object.
Handles list of all available batch systems for processing non-interactive data analysis tasks.
KVBatchSystem * GetDefaultBatchSystem() const
Utility GUI used for setting batch system parameters.
void cd()
Make this the default batch system.
virtual void SetBatchSystemParameters(const KVNameValueList &)
Use the parameters in the list to set all relevant parameters for batch system.
virtual void GetBatchSystemParameterList(KVNameValueList &)
virtual void Clear(Option_t *opt="")
virtual Int_t GetNumber() const
Description of an experimental run in database ,.
Database class used to store information on different colliding systems studied during an experiment.
KVUnownedList * GetRuns() const
Returns a sorted list of all the runs associated with this system.
virtual void Run()
Check all task variables, then run analyser.
virtual void SetAuxFileList(TList *)
void SetBatchSystem(KVBatchSystem *bs)
void SetUserClassOptions(const Char_t *o="")
void SetUserClass(const Char_t *kvs, Bool_t check=kTRUE)
void SetAnalysisTask(KVDataAnalysisTask *at)
virtual void SetFileList(TList *)
static KVDataAnalyser * GetAnalyser(const Char_t *plugin)
Bool_t IsUserClassValid() const
void SetNbEventToRead(Long64_t nb=0)
Define and manage data analysis tasks.
virtual Bool_t WithUserClass() const
virtual const Char_t * GetDataAnalyser() const
virtual const Char_t * GetUserBaseClass() const
Manage all datasets contained in a given data repository.
virtual Bool_t Init(KVDataRepository *=0)
virtual Int_t GetNtotal() const
KVDataAnalysisTask * GetAnalysisTaskAny(const Char_t *keywords) const
KVDataSet * GetDataSet(Int_t) const
Return pointer to DataSet using index in list of all datasets, index>=0.
Manage an experimental dataset corresponding to a given experiment or campaign.
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
Ask user to choose between several options in a drop-down list.
virtual KVDBSystem * GetSystem(const Char_t *system) const
virtual KVSeqCollection * GetSystems() const
Modified version of TGFileDialog file selection dialog.
Enhanced version of ROOT TGListView widget.
virtual void ActivateSortButtons()
virtual void SetDataColumns(Int_t ncolumns)
virtual void Display(const TCollection *l)
TList * GetSelectedObjects() const
void AllowContextMenu(Bool_t on=kTRUE)
virtual void SetDataColumn(Int_t index, const Char_t *name, const Char_t *method="", Int_t mode=kTextCenterX)
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
KVNamedParameter * GetParameter(Int_t idx) const
return the parameter object with index idx
void SetValue(const Char_t *name, value_type value)
Int_t GetNpar() const
return the number of stored parameters
value_type GetValue(const Char_t *name) const
const Char_t * GetString() const
int get_number_of_tables() const
int count(const TString &table, const TString &column="*", const TString &selection="", bool distinct=false) const
void delete_data(const TString &table, const TString &selection="")
void end_data_insertion()
bool select_data(const TString &tables, const TString &columns="*", const TString &selection="", bool distinct=false, const TString &anything_else="") const
KVNameValueList get_name_value_list(const TString &table, const TString &name_column, const TString &value_column, const TString &selection="", const TString &anything_else="")
bool get_next_result() const
void add_table(const table &)
bool prepare_data_insertion(const TString &)
void clear_table(const TString &name)
Delete all data from table.
const column & add_primary_key(const TString &name)
column & add_column(const KVSQLite::column &c)
KaliVeda extensions to ROOT collection classes.
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from list.
virtual TObject * FindObject(const char *name) const
Class piloting analyses of simulated data.
void SetDataSetForFilter(const TString &f)
void SetSystemForFilter(const TString &f)
static void Make(const Char_t *kvsname="MySimulatedAnalysis")
Generate a new simulated analysis selector class.
static void Make(const Char_t *kvsname="MyFilteredAnalysis")
Generate a new filtered analysis selector class.
GUI for analysing and filtering simulated data.
TGPictureButton * BremDir
void SelectDataSet(const char *)
void ReconstructSimDirsFromDB()
Rebuild all KVSimDir/KVSimFile objects from information in sqlite DB.
void NewFilteredAnalysisClass()
Get name of new class.
TGCheckButton * gemini_add_rot_energy
TGCompositeFrame * fAnalTab
analysis tab
KVSQLite::database fConfigDB
void SelectAnalysisClass()
TGCompositeFrame * fFiltTab
filter tab
void UpdateSystemText(const char *)
called every time the text changes
TGCheckButton * fCBAllEvents
virtual ~KVSimDirGUI()
Destructor.
void NewSimulatedAnalysisClass()
Get name of new class.
TGCheckButton * gemini_decay
TGViewPort * fDirListViewPort
TGNumberEntry * fNENumberEvents
void SelectSystem(const char *)
KVSimDir * fSelectedSimDir
void Copy(TObject &) const
TGListTree * fDirListTree
TGCanvas * fDirListCanvas
const TGPicture * pclose
used for list tree items
const TGPicture * popen
used for list tree items
KVString fAnalClassHeader
void Run()
void ChangeOutputDirectory();
void FillDataSetTableWithInfos(TString ds_table_name, KVSimDir *sd)
TGPictureButton * proof_analysis
TGTextEntry* fTEOutputDir;.
TGNumberEntry * gemini_decays
TGCheckButton * phi_rotation_check
void EnableEventNumberEntry(Bool_t)
void RunAnalysis(const TString &type)
Bool_t WarningBox(const char *title, const char *msg, Bool_t confirm)
TGPictureButton * BaddDir
Bool_t fWithPROOF
=kTRUE when running with PROOF-lite
Bool_t fCancelJob
if job parameters are not valid
TGPictureButton * BimpSim
TGPictureButton * BrefreshDir
TGTextEntry * fTEAnalysisClassFileName
void SelectSimDir(TGListTreeItem *, Int_t)
TString AddTableForDataSet(KVSimDir *sd, int ds_table_number)
Add a new dataset table for the given KVSimDir object.
void ImportSimulation()
Import simulation data from currently selected directory.
void SelectRun(const char *)
Handle directory containing simulated and/or filtered simulated data ,.
virtual const KVList * GetFiltDataList() const
void AddSimData(KVSimFile *)
virtual void AnalyseDirectory()
virtual const KVList * GetSimDataList() const
void AddFiltData(KVSimFile *)
virtual const Char_t * GetDirectory() const
Handle file containing simulated and/or filtered simulated data ,.
const Char_t * GetSystem() const
const Char_t * GetBranchName() const
const Char_t * GetOriginalFile() const
const Char_t * GetFilterType() const
const Char_t * GetGeometry() const
const Char_t * GetDataSet() const
Long64_t GetEvents() const
const Char_t * GetTreeName() const
Int_t GetGemDecayPerEvent() const
static KVSimReader * MakeSimReader(const char *model_uri)
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
virtual void ls(Option_t *option="") const
virtual Int_t GetEntries() const
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
virtual void SaveLevel(EEnvLevel level)
virtual void SetContainer(TGFrame *f)
virtual void MapSubwindows()
TGViewPort * GetViewPort() const
virtual void Select(Int_t id, Bool_t emit=kTRUE)
virtual void AddEntry(const char *s, Int_t id)
virtual void SetLayoutManager(TGLayoutManager *l)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
virtual UInt_t GetDefaultWidth() const
virtual void ChangeOptions(UInt_t options)
virtual TGDimension GetDefaultSize() const
virtual void MapSubwindows()
void SetMultipleSelection(Bool_t option)
Bool_t fMultipleSelection
virtual UInt_t GetDefaultHeight() const
virtual void Resize(TGDimension size)
virtual const char * GetText() const=0
virtual void SetPictures(const TGPicture *, const TGPicture *)
TGListTreeItem * GetFirstItem() const
Int_t DeleteItem(TGListTreeItem *item)
void AddItem(const char *string)
void CloseItem(TGListTreeItem *item)
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
void SetWindowName(const char *name=0)
TGNumberEntryField * GetNumberEntry() const
virtual void SetState(Bool_t enable=kTRUE)
virtual Double_t GetNumber() const
virtual TGCompositeFrame * AddTab(const char *text)
virtual TGLayoutManager * GetLayoutManager() const
virtual void SetToolTipText(const char *text, Long_t delayms=500)
virtual void SetText(const char *text, Bool_t emit=kTRUE)
virtual void SetName(const char *name)
virtual TObject * First() const
virtual const char * GetName() const
virtual const char * GetTitle() const
virtual const char * GetName() const
R__ALWAYS_INLINE Bool_t IsZombie() const
virtual void Error(const char *method, const char *msgfmt,...) const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
const char * Data() const
TString & Remove(EStripType s, char c)
TString & ReplaceAll(const char *s1, const char *s2)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual const char * BaseName(const char *pathname)
virtual void SetBuildDir(const char *build_dir, Bool_t isflat=kFALSE)
virtual const char * TempDirectory() const