10#include "KVDBSystemDialog.h"
13#ifndef ROOT_TGDockableFrame
19#ifndef ROOT_TGMdiDecorFrame
25#ifndef ROOT_TGMdiFrame
28#ifndef ROOT_TGMdiMainFrame
37#ifndef ROOT_TGNumberEntry
40#ifndef ROOT_TGScrollBar
43#ifndef ROOT_TRootBrowser
49#ifndef ROOT_TGFileDialog
55#ifndef ROOT_TGButtonGroup
61#ifndef ROOT_TGFSContainer
64#ifndef ROOT_TGFSComboBox
76#ifndef ROOT_TGListView
79#ifndef ROOT_TGSplitter
82#ifndef ROOT_TGStatusBar
85#ifndef ROOT_TGListTree
97#include "KVDBSystem.h"
100#include "KVMaterial.h"
102#include "KVInputDialog.h"
105#include "KVIonRangeTable.h"
129 fCurrentSystemsFile = gDataSet->
GetDataSetEnv(
"INDRADB.Systems");
130 CreateMainWindow(
p,
main,
w,
h);
132 if (runs.IsEmpty()) fSetRuns->SetEnabled(
kFALSE);
134 Connect(
"UpdateRunlist()",
"KVINDRARunSheetGUI",
const_cast<TGWindow*
>(
main),
"UpdateListOfRuns()");
136 gClient->WaitFor(fMainFrame1475);
187 "Click OK to delete, Cancel to leave");
220 sys_name.
Form(
"%ld%s + %s %.3g MeV/A",
231 "Enter name for new system",
236 cout <<
"Creating system : " << sys_name.
Data() << endl;
251 "Enter Z of target nucleus",
259 "Enter A of target nucleus",
287 gExpDB->
Save(
"Systems");
316 if (old_vers ==
"")
return;
351#ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
358 Int_t index_selected = 0;
361 TIter itsys(syslist);
364 while ((o = itsys())) {
381 if (index < fComboBox1476->GetNumberOfEntries() - 1) {
439 if (proj.
GetZ() == 0) {
470#ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
487 while ((obj = next())) {
676 cout <<
"Created target for system : " <<
fSystem->
GetName() << endl;
687 cout <<
"Added layer " << mat->
GetTitle() <<
" to target" << endl;
702 cout <<
"Removing layer : " <<
fLayer->
GetName() <<
" from target !" << endl;
760#ifdef __WITHOUT_TGCOMBOBOX_REMOVEALL
769 Int_t n =
box->GetListBox()->GetNumberOfEntries();
770 if (n)
box->RemoveEntries(0, n - 1);
771 if (
box->GetSelectedEntry()) {
776 box->GetTextEntry()->SetTitle(
"");
790 if (n)
box->RemoveEntries(0, n - 1);
791 if (
box->GetSelectedEntry()) {
817 ULong_t red, cyan, green, yellow, magenta;
818 gClient->GetColorByName(
"#ff00ff", magenta);
819 gClient->GetColorByName(
"#ff0000", red);
820 gClient->GetColorByName(
"#00ff00", green);
821 gClient->GetColorByName(
"#00ffff", cyan);
822 gClient->GetColorByName(
"#ffff00", yellow);
830 "KVDBSystemDialog",
this,
831 "SelectSystem(Int_t)");
847 "KVDBSystemDialog",
this,
848 "EnableProjectileProperties(Bool_t)");
851 ufont =
gClient->GetFont(
"-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
870 "KVDBSystemDialog",
this,
"ProjectileSymbolChanged()");
878 "KVDBSystemDialog",
this,
"ProjectileZChanged(Long_t)");
892 "KVDBSystemDialog",
this,
"ProjectileAChanged(Long_t)");
902 fNumberEntry1504->
MoveResize(312, 24, 43, 22);
913 "KVDBSystemDialog",
this,
"ProjectileEChanged(Long_t)");
915 TGLabel* fLabel1513 =
new TGLabel(fGroupFrame1488,
"MeV/nucleon");
930 "KVDBSystemDialog",
this,
"UpdateTargetLayerProperties(Int_t)");
938 "KVDBSystemDialog",
this,
"TargetLayerThicknessChanged(Long_t)");
952 "KVDBSystemDialog",
this,
"TargetAngleChanged(Long_t)");
962 "KVDBSystemDialog",
this,
"TargetLayerAChanged(Long_t)");
978 while ((obj = it_mat())) {
990 "KVDBSystemDialog",
this,
"AddNewTargetLayer()");
993 fGroupFrame1541->
Resize(112, 104);
995 fGroupFrame1541->
MoveResize(232, 40, 112, 104);
1003 "KVDBSystemDialog",
this,
"RemoveTargetLayer()");
1011 fGroupFrame1514->
Resize(360, 168);
1013 fGroupFrame1514->
MoveResize(8, 80, 360, 168);
1027 "KVDBSystemDialog",
this,
"CreateNewSystem()");
1032 fTextButton1573->
Resize(48, 24);
1035 fTextButton1573->
MoveResize(100, 280, 60, 24);
1036 fTextButton1573->
SetToolTipText(
"Delete the currently selected system");
1037 fTextButton1573->
Connect(
"Clicked()",
1038 "KVDBSystemDialog",
this,
"DeleteSystem()");
1048 "KVDBSystemDialog",
this,
"SetRuns()");
1058 "KVDBSystemDialog",
this,
"SaveSystems()");
1062 fcloseButton->
Resize(48, 24);
1067 fcloseButton->
Connect(
"Clicked()",
1068 "KVDBSystemDialog",
this,
"DoClose()");
1071 fGroupFrame1488->
Resize(376, 320);
1073 fGroupFrame1488->
MoveResize(8, 32, 376, 320);
const Mask_t kGCBackground
const Mask_t kGCForeground
const Mask_t kGCFillStyle
const Mask_t kGCGraphicsExposures
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
R__EXTERN TSystem * gSystem
static void BackupFileWithDate(const Char_t *path)
static Bool_t SearchKVFile(const Char_t *name, TString &fullpath, const Char_t *kvsubdir="")
virtual const Char_t * GetType() const
Dialog box for setting system parameters associated to runs.
void DeleteSystem()
Delete the currently selected system.
KVNumberList fRuns
runs selected by user
void TargetAngleChanged(Long_t)
Called when target angle is changed.
KVDatedFileManager * fUndo
allows to undo changes to Systems.dat
TGLabel * fLabel1530
units for thickness
void ProjectileZChanged(Long_t)
TGComboBox * fComboBox1515
layers in current target
void SetNeedSave(Bool_t k=kTRUE)
TGComboBox * fComboBox1542
list of materials for creating target layers
TGTextButton * fTextButton1553
add new layer to target
void RemoveAll(TGComboBox *)
KVString fCurrentSystemsFile
name (including timestamp) of currently used Systems.dat
KVTarget * fTarget
current target
void ProjectileEChanged(Long_t)
void UpdateSystemProperties()
Update displayed system properties, e.g. when a new system is selected in fComboBox1476.
void UpdateTargetLayerProperties(Int_t)
TGNumberEntry * fNumberEntry1493
Z of projectile.
TGTextButton * fSetRuns
associate runs with selected system
KVMaterial * fLayer
current target layer
TGTextEntry * fTextEntry1490
symbol of projectile
TGNumberEntry * fNumberEntry1499
A of projectile.
void UpdateProjectileProperties()
TGNumberEntry * fNumberEntry1537
atomic mass of current layer
void ProjectileSymbolChanged()
KVDBSystem * fSystem
currently selected system in combo box fComboBox1476
Bool_t IsProjectileDefined()
TGNumberEntry * fNumberEntry1509
E/A of projectile.
TGNumberEntry * fNumberEntry1526
thickness of current layer
TGComboBox * fComboBox1476
combo box displaying list of systems for current dataset
void CreateMainWindow(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h)
Creates main window and displays it.
TGTransientFrame * fMainFrame1475
the main window
void TargetLayerAChanged(Long_t)
Called when target layer A is changed.
virtual ~KVDBSystemDialog()
Destructor.
void TargetLayerThicknessChanged(Long_t)
TGTextButton * fCreateSystem
button to create new system
void UpdateTargetProperties()
TGTextButton * fSaveButton
save changes
void UpdateRunlist()
Signal emitted to tell KVINDRARunSheetGUI to update the runlist.
TGTextButton * fTextButton1554
remove current layer from target
void SelectSystem(Int_t)
Called when a new system is selected in fComboBox1476.
std::unique_ptr< TObjArray > fMaterialsList
list of all available materials
void ProjectileAChanged(Long_t)
void EnableProjectileProperties(Bool_t)
Called when "Projectile" check box is checked (on=kTRUE) or unchecked (on=kFALSE)
TGNumberEntry * fNumberEntry1532
target angle to beam
TGCheckButton * fCheckButton1376
check button to define projectile
Database class used to store information on different colliding systems studied during an experiment....
void SetZtarget(UInt_t z)
void SetAtarget(UInt_t a)
void AddRun(KVDBRecord *)
void SetTarget(KVTarget *targ)
void SetEbeam(Float_t energy)
KVTarget * GetTarget() const
const Char_t * GetDataSetDir() const
const Char_t * GetDataSetEnv(const Char_t *type, const Char_t *defval="") const
KVExpDB * GetDataBase(Option_t *opt="") const
Handles a set of different versions of files with the same base name and a timestamp.
const Char_t * GetPreviousVersion(const Char_t *name)
void Update()
Updates list of files.
void AddSystem(KVDBSystem *r)
virtual KVSeqCollection * GetSystems() const
void RemoveSystem(KVDBSystem *s)
virtual void Save(const Char_t *)
Abstract base class for calculation of range & energy loss of charged particles in matter.
virtual TObjArray * GetListOfMaterials()=0
virtual Double_t GetAtomicMass(const Char_t *)
Returns atomic mass of a material in the range tables.
virtual Double_t GetZ(const Char_t *)
Returns atomic number of a material in the range tables.
Description of physical materials used to construct detectors & targets; interface to range tables.
static KVIonRangeTable * GetRangeTable()
void SetAreaDensity(Double_t dens)
Double_t GetAreaDensity() const
Description of properties and kinematics of atomic nuclei.
const Char_t * GetSymbol(Option_t *opt="") const
Int_t GetZ() const
Return the number of proton / atomic number.
Strings used to represent a set of ranges of values.
KaliVeda extensions to ROOT collection classes.
virtual TObject * At(Int_t idx) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Calculation/correction of energy losses of particles through an experimental target.
void SetAngleToBeam(Double_t a)
Int_t NumberOfLayers() const
KVMaterial * GetLayerByIndex(Int_t ilayer) const
void AddLayer(const Char_t *material, Double_t thick)
Double_t GetAngleToBeam()
Gives angle of target to incident beam direction in degrees.
KVList * GetLayers() const
void ls(Option_t *option="") const override
virtual Int_t GetSelected() const
void RemoveAll() override
virtual void Select(Int_t id, Bool_t emit=kTRUE)
virtual void AddEntry(const char *s, Int_t id)
virtual Int_t GetNumberOfEntries() const
TGDimension GetDefaultSize() const override
virtual void SetLayoutManager(TGLayoutManager *l)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
void MapSubwindows() override
void SetCleanup(Int_t mode=kLocalCleanup) override
void SetLayoutBroken(Bool_t on=kTRUE) override
FontStruct_t GetFontStruct() const
FontH_t GetFontHandle() const
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
virtual UInt_t GetDefaultHeight() const
virtual void Resize(TGDimension size)
void MapWindow() override
virtual void ChangeBackground(Pixel_t back)
void SetTextJustify(Int_t tmode)
void SetText(const char *newText)
virtual void Disable(Bool_t on=kTRUE)
void SetWindowName(const char *name=nullptr) override
virtual void SetState(Bool_t enable=kTRUE)
virtual Long_t GetIntNumber() const
virtual Double_t GetNumber() const
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
virtual void SetTextJustify(Int_t tmode)
virtual void SetMaxLength(Int_t maxlen)
const char * GetText() const
void SetEnabled(Bool_t flag=kTRUE)
virtual void SetAlignment(ETextJustification mode=kTextLeft)
virtual void SetToolTipText(const char *text, Long_t delayms=500)
virtual void SetText(const char *text, Bool_t emit=kTRUE)
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
const char * GetName() const override
const char * GetTitle() const override
virtual const char * GetName() const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
const char * Data() const
void Form(const char *fmt,...)
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RVec< PromoteTypes< T0, T1 > > pow(const RVec< T0 > &v, const T1 &y)
Bool_t fGraphicsExposures