/*
$Log$
+Revision 1.6 2000/04/14 11:07:46 morsch
+Correct volume to medium assignment in case several media are asigned to the
+same material.
+
Revision 1.5 2000/03/20 15:11:03 fca
Mods to make the code compile on HP
AliGeant3GeometryGUI::AliGeant3GeometryGUI()
{
+// Constructor
fPanel = new AliGuiGeomMain(gClient->GetRoot(), 500, 500);
fNstack = 0;
fVolumes = new TClonesArray("AliDrawVolume",1000);
}
void AliGeant3GeometryGUI::Streamer(TBuffer &)
{
+// Dummy Streamer
;
}
char namec[30];
// Icons for
// Closed folder (=volume containing children)
- const TGPicture* Folder = gClient->GetPicture("folder_t.xpm");
+ const TGPicture* kFolder = gClient->GetPicture("folder_t.xpm");
// Open folder (=volume containing children)
- const TGPicture* OpenFolder = gClient->GetPicture("ofolder_t.xpm");
+ const TGPicture* kOpenFolder = gClient->GetPicture("ofolder_t.xpm");
// Empty object
- const TGPicture* Document = gClient->GetPicture("doc_t.xpm");
+ const TGPicture* kDocument = gClient->GetPicture("doc_t.xpm");
AliDrawVolume *volume;
if (nch!=0) {
item2 = fPanel->AddItem(new AliDrawVolume(vname),
- itemi, namec, OpenFolder, Folder);
+ itemi, namec, kOpenFolder, kFolder);
} else {
item2 = fPanel->AddItem(new AliDrawVolume(vname),
- itemi, namec, Document, Document);
+ itemi, namec, kDocument, kDocument);
}
//
// Add medium information to list tree item
char natmed[21], namate[21];
//
// Loop over media
- Int_t NEntries=0;
+ Int_t nEntries=0;
for(Int_t itm=1;itm<=fGcnum->ntmed;itm++) {
Int_t jtm = fZlq[fGclink->jtmed-itm];
if (jtm > 0) {
- NEntries++;
+ nEntries++;
//
// Get medium parameters
((TGeant3*)(gMC))->Gftmed(itm, natmed, imat, isvol, ifield, fieldm,
AliGUIMedium * medium =
new AliGUIMedium(itm, imat, natmed, isvol, ifield, fieldm,
tmaxfd, stemax, deemax, epsil, stmin);
- (*fMedia)[NEntries-1]=medium;
+ (*fMedia)[nEntries-1]=medium;
{ //Begin local scope for j
for (Int_t j=1; j<=22; j++) {
medium->SetPar(j,Cut(itm,j));
} //End local scope for j
//
// Add to ComboBox
- fPanel->AddMedium(medium, NEntries);
+ fPanel->AddMedium(medium, nEntries);
//
// Associated material
imat = Int_t (fZq[jtm+6]);
// Create new material object
AliGUIMaterial * material =
new AliGUIMaterial(imat,namate,a,z,dens,radl,absl);
- (*fMaterials)[NEntries-1]=material;
+ (*fMaterials)[nEntries-1]=material;
material->Dump();
//
// Add to combo box
- fPanel->AddMaterial(material, NEntries);
+ fPanel->AddMaterial(material, nEntries);
gCurrentMaterial=material;
}
}
//
// Drawing parameter tags
enum AliDrawParamId {
- P_Theta,
- P_Phi,
- P_Psi,
- P_U,
- P_V,
- P_Uscale,
- P_Vscale,
- P_Shadow,
- P_Hide,
- P_Fill,
- P_Seen,
- P_Clip,
- P_ClipXmin,
- P_ClipXmax,
- P_ClipYmin,
- P_ClipYmax,
- P_ClipZmin,
- P_ClipZmax
+ kTheta,
+ kPhi,
+ kPsi,
+ kU,
+ kV,
+ kUscale,
+ kVscale,
+ kShadow,
+ kHide,
+ kFill,
+ kSeen,
+ kClip,
+ kClipXmin,
+ kClipXmax,
+ kClipYmin,
+ kClipYmax,
+ kClipZmin,
+ kClipZmax
};
AliDrawVolume::AliDrawVolume(char* name)
{
+// Constructor
fName = name;
fTheta = 30;
fPhi = 30;
void AliDrawVolume::Streamer(TBuffer &)
{
+// Dummy Streamer
;
}
void AliDrawVolume::Draw(Option_t *)
{
+// Wraps the geant Gdraw
gMC->Gsatt(fName,"seen", fSeen);
if (fHide) {
void AliDrawVolume::DrawSpec()
{
+// Wraps the Geant DrawSpec
gMC->Gsatt(fName,"seen", fSeen);
if (fHide) {
void AliDrawVolume::SetParam(Int_t ip, Float_t param)
{
+// Set drawing parameters
switch (ip) {
- case P_Theta:
+ case kTheta:
fTheta=param;
break;
- case P_Phi:
+ case kPhi:
fPhi=param;
break;
- case P_Psi:
+ case kPsi:
fPsi=param;
break;
- case P_U:
+ case kU:
fU=param;
break;
- case P_V:
+ case kV:
fV=param;
break;
- case P_Uscale:
+ case kUscale:
fUscale=param;
break;
- case P_Vscale:
+ case kVscale:
fVscale=param;
break;
- case P_Hide:
+ case kHide:
fHide=Int_t(param);
break;
- case P_Shadow:
+ case kShadow:
fShadow=Int_t(param);
break;
- case P_Fill:
+ case kFill:
fFill=Int_t(param);
break;
- case P_Seen:
+ case kSeen:
fSeen=Int_t(param);
break;
- case P_Clip:
+ case kClip:
fClip=Int_t(param);
break;
- case P_ClipXmin:
+ case kClipXmin:
fClipXmin=param;
break;
- case P_ClipXmax:
+ case kClipXmax:
fClipXmax=param;
break;
- case P_ClipYmin:
+ case kClipYmin:
fClipYmin=param;
break;
- case P_ClipYmax:
+ case kClipYmax:
fClipYmax=param;
break;
- case P_ClipZmin:
+ case kClipZmin:
fClipZmin=param;
break;
- case P_ClipZmax:
+ case kClipZmax:
fClipZmax=param;
break;
}
Float_t AliDrawVolume::GetParam(Int_t ip)
{
+// Get drawing parameters
switch (ip) {
- case P_Theta:
+ case kTheta:
return fTheta;
- case P_Phi:
+ case kPhi:
return fPhi;
- case P_Psi:
+ case kPsi:
return fPsi;
- case P_U:
+ case kU:
return fU;
- case P_V:
+ case kV:
return fV;
- case P_Uscale:
+ case kUscale:
return fUscale;
- case P_Vscale:
+ case kVscale:
return fVscale;
- case P_Hide:
+ case kHide:
return Float_t(fHide);
- case P_Shadow:
+ case kShadow:
return Float_t(fShadow);
- case P_Fill:
+ case kFill:
return Float_t(fFill);
- case P_Seen:
+ case kSeen:
return Float_t(fSeen);
- case P_Clip:
+ case kClip:
return Float_t(fClip);
- case P_ClipXmin:
+ case kClipXmin:
return fClipXmin;
- case P_ClipXmax:
+ case kClipXmax:
return fClipXmax;
- case P_ClipYmin:
+ case kClipYmin:
return fClipYmin;
- case P_ClipYmax:
+ case kClipYmax:
return fClipYmax;
- case P_ClipZmin:
+ case kClipZmin:
return fClipZmin;
- case P_ClipZmax:
+ case kClipZmax:
return fClipZmax;
default:
return 0.;
ClassImp(AliGuiGeomMain)
- const Text_t* LabelTextP[19] =
+ const Text_t* kLabelTextP[19] =
{"PAIR ", "COMP ", "PHOT ", "PFIS ", "DRAY ", "ANNI ", "BREM ",
"HADR ", "MUNU ", "DCAY ", "LOSS ", "MULS ", "GHCOR1", "BIRK1 ",
"BIRK2 ", "BIRK3 ", "LABS ", "SYNC ", "STRA "};
- const Text_t* LabelTextC[10] =
+ const Text_t* kLabelTextC[10] =
{"CUTGAM", "CUTELE", "CUTNEU", "CUTHAD", "CUTMUO", "BCUTE", "BCUTM",
"DCUTE ", "DCUTM ", "PPCUTM"};
-const Text_t* LabelTextPart[24] =
+const Text_t* kLabelTextPart[24] =
{"Photon", "Positron", "Electron", "Neutrino", "Muon+", "Muon-",
"Pi0", "Pi+", "Pi-", "Kaon_L", "Kaon+", "Kaon-", "Neutron", "Proton",
"Anti Proton", "Kaon_S", "Eta", "Lambda", "Sigma+", "Sigma0", "Sigma-",
"Xi0", "Xi-", "Omega-"};
-const Text_t* LabelTextMechanism[24] =
+const Text_t* kLabelTextMechanism[24] =
{"HADF", "INEF", "ELAF", "FISF", "CAPF",
"HADG", "INEG", "ELAG", "FISG", "CAPG",
"LOSS", "PHOT", "ANNI", "COMP", "BREM",
enum ETestCommandIdentifiers {
- M_FILE_OPEN,
- M_FILE_SAVE,
- M_FILE_SAVEAS,
- M_FILE_EXIT,
+ kFileOpen,
+ kFileSave,
+ kFileSaveAs,
+ kFileExit,
- M_TEST_DLG,
+ kTestDlg,
- M_HELP_CONTENTS,
- M_HELP_SEARCH,
- M_HELP_ABOUT,
+ kHelpContents,
+ kHelpSearch,
+ kHelpAbout,
- VId1,
- HId1,
- VId2,
- HId2,
+ kVId1,
+ kHId1,
+ kVId2,
+ kHId2,
- VSId1,
- HSId1,
- VSId2,
- HSId2
+ kVSId1,
+ kHSId1,
+ kVSId2,
+ kHSId2
};
-Int_t mb_button_id[9] = { kMBYes, kMBNo, kMBOk, kMBApply,
+Int_t mbButtonId[9] = { kMBYes, kMBNo, kMBOk, kMBApply,
kMBRetry, kMBIgnore, kMBCancel,
kMBClose, kMBDismiss };
-EMsgBoxIcon mb_icon[4] = { kMBIconStop, kMBIconQuestion,
+EMsgBoxIcon mbIcon[4] = { kMBIconStop, kMBIconQuestion,
kMBIconExclamation, kMBIconAsterisk };
-const char *filetypes[] = { "All files", "*",
+const char *kFileTypes[] = { "All files", "*",
"ROOT files", "*.root",
"ROOT macros", "*.C",
0, 0 };
TGListTreeItem* AliGuiGeomMain::
AddItem(TObject * obj, TGListTreeItem *parent, const char* name, const TGPicture *open, const TGPicture *closed)
{
+// Add item to the list tree
return fLt->AddItem(parent, name, obj, open, closed);
}
AliGuiGeomMain::AliGuiGeomMain(const TGWindow *p, UInt_t w, UInt_t h)
: TGMainFrame(p, w, h)
{
+ // Create test main frame. A TGMainFrame is a top level window.
+ // Create menubar and popup menus. The hint objects are used to place
+ // and group the different menu widgets with respect to eachother.
+
fDialog=0;
- // Create test main frame. A TGMainFrame is a top level window.
- // Create menubar and popup menus. The hint objects are used to place
- // and group the different menu widgets with respect to eachother.
- fMenuBarLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
- 0, 0, 1, 1);
- fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
- fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight);
-
- fMenuFile = new TGPopupMenu(gClient->GetRoot());
- fMenuFile->AddEntry("&Open...", M_FILE_OPEN);
- fMenuFile->AddEntry("&Save", M_FILE_SAVE);
- fMenuFile->AddEntry("S&ave as...", M_FILE_SAVEAS);
- fMenuFile->AddEntry("&Close", -1);
- fMenuFile->AddSeparator();
- fMenuFile->AddEntry("E&xit", M_FILE_EXIT);
-
- fMenuFile->DisableEntry(M_FILE_SAVEAS);
- fMenuFile->DisableEntry(M_FILE_OPEN);
- fMenuFile->DisableEntry(M_FILE_SAVE);
-
+ fMenuBarLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
+ 0, 0, 1, 1);
+ fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
+ fMenuBarHelpLayout = new TGLayoutHints(kLHintsTop | kLHintsRight);
+
+ fMenuFile = new TGPopupMenu(gClient->GetRoot());
+ fMenuFile->AddEntry("&Open...", kFileOpen);
+ fMenuFile->AddEntry("&Save", kFileSave);
+ fMenuFile->AddEntry("S&ave as...", kFileSaveAs);
+ fMenuFile->AddEntry("&Close", -1);
+ fMenuFile->AddSeparator();
+ fMenuFile->AddEntry("E&xit", kFileExit);
+
+ fMenuFile->DisableEntry(kFileSaveAs);
+ fMenuFile->DisableEntry(kFileOpen);
+ fMenuFile->DisableEntry(kFileSave);
+
fMenuTest = new TGPopupMenu(this);
fMenuTest->AddLabel("Draw");
fMenuTest->AddSeparator();
- fMenuTest->AddEntry("&Volume Draw Control", M_TEST_DLG);
+ fMenuTest->AddEntry("&Volume Draw Control", kTestDlg);
fMenuTest->AddSeparator();
fMenuTest->Associate(this);
fMenuHelp = new TGPopupMenu(gClient->GetRoot());
- fMenuHelp->AddEntry("&Contents", M_HELP_CONTENTS);
- fMenuHelp->AddEntry("&Search...", M_HELP_SEARCH);
+ fMenuHelp->AddEntry("&Contents", kHelpContents);
+ fMenuHelp->AddEntry("&Search...", kHelpSearch);
fMenuHelp->AddSeparator();
- fMenuHelp->AddEntry("&About", M_HELP_ABOUT);
+ fMenuHelp->AddEntry("&About", kHelpAbout);
- fMenuFile->DisableEntry(M_HELP_CONTENTS);
- fMenuFile->DisableEntry(M_HELP_SEARCH);
- fMenuFile->DisableEntry(M_HELP_ABOUT);
+ fMenuFile->DisableEntry(kHelpContents);
+ fMenuFile->DisableEntry(kHelpSearch);
+ fMenuFile->DisableEntry(kHelpAbout);
// Menu button messages are handled by the main frame (i.e. "this")
// ProcessMessage() method.
fMenuFile->Associate(this);
//
// text labels with material properties
//
- Text_t* LabelText[6] =
+ Text_t* labelText[6] =
{"Material Number ",
"Atomic Weight ",
"Atomic Number ",
"Radiation Length ",
"Absorption Length"};
- TGLayoutHints* Bly =
+ TGLayoutHints* bly =
new TGLayoutHints(kLHintsTop | kLHintsExpandY, 5, 5, 5, 5);
- TGLayoutHints* Bfly1 =
+ TGLayoutHints* bFly1 =
new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
fF21 = new TGCompositeFrame(fF2, 60, 20, kVerticalFrame);
fF2->AddFrame(fF21,fL2);
for (Int_t i=0; i<6; i++) {
Int_t idT=i+1;
fHframe[i] = new TGHorizontalFrame(fF21, 400, 100, kFixedWidth);
- fF21->AddFrame(fHframe[i], Bly);
+ fF21->AddFrame(fHframe[i], bly);
fTbh[i] = new TGTextBuffer(10);
fTeh[i] = new TGTextEntry(fHframe[i], fTbh[i],idT);
fTeh[i]->Associate(this);
- fLabel[i] = new TGLabel(fHframe[i], LabelText[i]);
- fHframe[i]->AddFrame(fLabel[i], Bfly1);
- fHframe[i]->AddFrame(fTeh[i], Bfly1);
+ fLabel[i] = new TGLabel(fHframe[i], labelText[i]);
+ fHframe[i]->AddFrame(fLabel[i], bFly1);
+ fHframe[i]->AddFrame(fTeh[i], bFly1);
}
tf->AddFrame(fF2, fL2);
fMaterialCombo->Resize(200, 20);
//
// text labels with material properties
//
- Text_t* LabelTextM[8] =
+ Text_t* labelTextM[8] =
{"Sensitivity Flag ",
"Magnetic Field Flag ",
"Maximum Field ",
for (Int_t i=0; i<8; i++) {
Int_t idT=i+1;
fHframeM[i] = new TGHorizontalFrame(fF31, 400, 100, kFixedWidth);
- fF31->AddFrame(fHframeM[i], Bly);
+ fF31->AddFrame(fHframeM[i], bly);
fTbhM[i] = new TGTextBuffer(10);
fTehM[i] = new TGTextEntry(fHframeM[i], fTbhM[i],idT);
fTehM[i]->Associate(this);
- fLabelM[i] = new TGLabel(fHframeM[i], LabelTextM[i]);
- fHframeM[i]->AddFrame(fLabelM[i], Bfly1);
- fHframeM[i]->AddFrame(fTehM[i], Bfly1);
+ fLabelM[i] = new TGLabel(fHframeM[i], labelTextM[i]);
+ fHframeM[i]->AddFrame(fLabelM[i], bFly1);
+ fHframeM[i]->AddFrame(fTehM[i], bFly1);
}
} //End local scope for i
tf->AddFrame(fF3, fL2);
{ //Begin local scope for i
for (Int_t i = 0; i < 24; i++) {
char tmp[20];
- sprintf(tmp, "%s", LabelTextPart[i]);
+ sprintf(tmp, "%s", kLabelTextPart[i]);
fParticleCombo->AddEntry(tmp, i+1);
}
} //End local scope for i
{ //Begin local scope for i
for (Int_t i = 0; i < 24; i++) {
char tmp[20];
- sprintf(tmp, "%s", LabelTextMechanism[i]);
+ sprintf(tmp, "%s", kLabelTextMechanism[i]);
fMechanismCombo->AddEntry(tmp, i+1);
}
} //End local scope for i
fNbins=100;
fSLabel61 = new TGLabel(fF61, "Nbins-Emin-Emax");
- Bfly1 = new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
- fF61->AddFrame(fSLabel61, Bfly1);
- fF61->AddFrame(fTeh61, Bfly1);
- fF61->AddFrame(fTeh62, Bfly1);
- fF61->AddFrame(fTeh63, Bfly1);
+ bFly1 = new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
+ fF61->AddFrame(fSLabel61, bFly1);
+ fF61->AddFrame(fTeh61, bFly1);
+ fF61->AddFrame(fTeh62, bFly1);
+ fF61->AddFrame(fTeh63, bFly1);
//
// Plot Button
fF62 = new TGCompositeFrame(fF6, 60, 20, kHorizontalFrame);
{
// Delete all created widgets.
- delete fContainer;
delete fCanvasWindow;
delete fMenuBarLayout;
void AliGuiGeomMain::Streamer(TBuffer &)
{
+// Dummy streamer
;
}
void AliGuiGeomMain::Plot()
{
- const Float_t avo=0.60221367;
+// plot de/dx or cross-sections
+ const Float_t kAvo=0.60221367;
Float_t *tkin = new Float_t[fNbins];
Float_t *value = new Float_t[fNbins];
Float_t *pcut = new Float_t[fNbins];
Float_t density=gCurrentMaterial->Density();
Int_t ipart=gCurrentParticle;
- const char *chmeca= LabelTextMechanism[gCurrentProcess-1];
+ const char *kChMeca= kLabelTextMechanism[gCurrentProcess-1];
char* tmp;
tmp = new char[5];
- strncpy(tmp, chmeca, 4);
+ strncpy(tmp, kChMeca, 4);
tmp[4]='\0';
Int_t kdim=fNbins;
Float_t de=(fEmax-fEmin)/fNbins;
tkin[i]=fEmin+Float_t(i)*de;
value[i]=0.;
}
- if (chmeca!="MUON") {
+ if (kChMeca!="MUON") {
((TGeant3*) gMC)->Gftmat(imate, ipart, tmp, kdim, tkin, value, pcut, ixst);
} else {
for (Int_t i=0; i<kdim; i++) {
Float_t ekin=tkin[i];
value[i]+=((TGeant3*) gMC)->Gbrelm(z,ekin,1.e10);
value[i]+=((TGeant3*) gMC)->Gprelm(z,ekin,1.e10);
- value[i]*=1000.*avo*density/a;
+ value[i]*=1000.*kAvo*density/a;
}
}
- printf("\n %d %d %s %d \n",imate, ipart, chmeca, kdim);
+ printf("\n %d %d %s %d \n",imate, ipart, kChMeca, kdim);
if (ixst) {
TGraph *graph = new TGraph(kdim,tkin,value);
TCanvas *c1 = new TCanvas("c1"," ",400,10,600,700);
graph->SetMarkerStyle(21);
graph->Draw("AC");
graph->GetHistogram()->SetXTitle("Energy (GeV)");
- if (chmeca == "RANG" || chmeca == "STEP") {
+ if (kChMeca == "RANG" || kChMeca == "STEP") {
graph->GetHistogram()->SetYTitle
("Distance (cm)");
- } else if (chmeca == "LOSS" || chmeca == "MUON") {
+ } else if (kChMeca == "LOSS" || kChMeca == "MUON") {
graph->GetHistogram()->SetYTitle("dE/dx (MeV/cm)");
} else {
graph->GetHistogram()->SetYTitle
void AliGuiGeomMain::Update()
{
+// Update widgets
if (fDialog) {
fDialog->Update();
}
void AliGuiGeomMain::UpdateCombo()
{
+// Update combos
Int_t imat = gCurrentMaterial->Id();
Float_t a = gCurrentMaterial->A();
void AliGuiGeomMain::UpdateListBox()
{
+// Update the list box
Int_t i;
fProcessLB->RemoveEntries(1,19);
for (i=11; i < 30; i++) {
Float_t p=gCurrentMedium->GetPar(i);
char tmp[20];
- sprintf(tmp, "%6s%5d", LabelTextP[i-11], Int_t(p));
+ sprintf(tmp, "%6s%5d", kLabelTextP[i-11], Int_t(p));
fProcessLB->AddEntry(tmp, i-10);
}
fProcessLB->MapSubwindows();
for (i=1; i < 11; i++) {
Float_t p=gCurrentMedium->GetPar(i);
char tmp[20];
- sprintf(tmp, "%6s%10.3e", LabelTextC[i-1], p);
+ sprintf(tmp, "%6s%10.3e", kLabelTextC[i-1], p);
fCutsLB->AddEntry(tmp,i);
}
fCutsLB->MapSubwindows();
Bool_t AliGuiGeomMain::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
{
+// Process messages to widgets
switch (GET_MSG(msg)) {
//
// Text entries for binning of cross-section plots
case kCM_MENU:
switch (parm1) {
- case M_FILE_OPEN:
+ case kFileOpen:
{
TGFileInfo fi;
- fi.fFileTypes = (char **)filetypes;
+ fi.fFileTypes = (char **)kFileTypes;
new TGFileDialog(gClient->GetRoot(), this, kFDOpen,&fi);
}
break;
- case M_TEST_DLG:
+ case kTestDlg:
fDialog = new AliGuiGeomDialog
(gClient->GetRoot(), this, 400, 200);
break;
- case M_FILE_SAVE:
- printf("M_FILE_SAVE\n");
+ case kFileSave:
+ printf("kFileSave\n");
break;
- case M_FILE_EXIT:
+ case kFileExit:
CloseWindow(); // this also terminates theApp
break;
default:
void AliGuiGeomMain::AddMaterial(AliGUIMaterial *Material, Int_t i)
{
+// Add material to material combo
char* tmp;
tmp=Material->Name();
Material->SetItemId(i);
void AliGuiGeomMain::AddMedium(AliGUIMedium *Medium, Int_t i)
{
+// Add medium to medium combo
char* tmp;
tmp=Medium->Name();
Medium->SetItemId(i);
void AliGuiGeomDialog::Update()
{
+// Update widgets
Float_t param;
// Update Sliders
}
// Seen
if (fCombo2) {
- param=gCurrentVolume->GetParam(P_Seen);
+ param=gCurrentVolume->GetParam(kSeen);
fCombo2->Select(Int_t(param)+3);
}
// Hide, Shadow, Clip
if (fChk1) {
- if (Int_t(gCurrentVolume->GetParam(P_Shadow))) {
+ if (Int_t(gCurrentVolume->GetParam(kShadow))) {
fChk1->SetState(kButtonDown);
} else {
fChk1->SetState(kButtonUp);
}
if (fChk2) {
- if (Int_t(gCurrentVolume->GetParam(P_Hide))) {
+ if (Int_t(gCurrentVolume->GetParam(kHide))) {
fChk2->SetState(kButtonDown);
} else {
fChk2->SetState(kButtonUp);
}
if (fChk3) {
- if (Int_t(gCurrentVolume->GetParam(P_Clip))) {
+ if (Int_t(gCurrentVolume->GetParam(kClip))) {
fChk3->SetState(kButtonDown);
} else {
fChk3->SetState(kButtonUp);
fTbh12->AddText(0, buf);
gClient->NeedRedraw(fTeh11);
gClient->NeedRedraw(fTeh12);
- gCurrentVolume->SetParam(P_ClipXmin,min);
- gCurrentVolume->SetParam(P_ClipXmax,max);
+ gCurrentVolume->SetParam(kClipXmin,min);
+ gCurrentVolume->SetParam(kClipXmax,max);
break;
case 2:
min=fDslider2->GetMinPosition();
fTbh22->AddText(0, buf);
gClient->NeedRedraw(fTeh21);
gClient->NeedRedraw(fTeh22);
- gCurrentVolume->SetParam(P_ClipYmin,min);
- gCurrentVolume->SetParam(P_ClipYmax,max);
+ gCurrentVolume->SetParam(kClipYmin,min);
+ gCurrentVolume->SetParam(kClipYmax,max);
break;
case 3:
min=fDslider3->GetMinPosition();
fTbh32->AddText(0, buf);
gClient->NeedRedraw(fTeh31);
gClient->NeedRedraw(fTeh32);
- gCurrentVolume->SetParam(P_ClipZmin,min);
- gCurrentVolume->SetParam(P_ClipZmax,max);
+ gCurrentVolume->SetParam(kClipZmin,min);
+ gCurrentVolume->SetParam(kClipZmax,max);
break;
default:
break;
case kCM_COMBOBOX:
switch(parm1) {
case 89:
- gCurrentVolume->SetParam(P_Fill, Float_t(parm2));
+ gCurrentVolume->SetParam(kFill, Float_t(parm2));
gCurrentVolume->Draw();
break;
case 90:
- gCurrentVolume->SetParam(P_Seen, Float_t(parm2-3));
+ gCurrentVolume->SetParam(kSeen, Float_t(parm2-3));
gCurrentVolume->Draw();
break;
}
case kCM_CHECKBUTTON:
switch (parm1) {
case 86:
- if (Int_t(gCurrentVolume->GetParam(P_Shadow))) {
- gCurrentVolume->SetParam(P_Shadow, 0.);
+ if (Int_t(gCurrentVolume->GetParam(kShadow))) {
+ gCurrentVolume->SetParam(kShadow, 0.);
} else {
- gCurrentVolume->SetParam(P_Shadow, 1.);
+ gCurrentVolume->SetParam(kShadow, 1.);
}
gCurrentVolume->Draw();
break;
case 87:
- if (Int_t(gCurrentVolume->GetParam(P_Hide))) {
- gCurrentVolume->SetParam(P_Hide, 0.);
+ if (Int_t(gCurrentVolume->GetParam(kHide))) {
+ gCurrentVolume->SetParam(kHide, 0.);
} else {
- gCurrentVolume->SetParam(P_Hide, 1.);
+ gCurrentVolume->SetParam(kHide, 1.);
}
gCurrentVolume->Draw();
break;
case 88:
- if (Int_t(gCurrentVolume->GetParam(P_Clip))) {
- gCurrentVolume->SetParam(P_Clip, 0.);
+ if (Int_t(gCurrentVolume->GetParam(kClip))) {
+ gCurrentVolume->SetParam(kClip, 0.);
} else {
- gCurrentVolume->SetParam(P_Clip, 1.);
+ gCurrentVolume->SetParam(kClip, 1.);
}
gCurrentVolume->Draw();
break;
return kTRUE;
}
-static Text_t* LabelText[7] =
+static Text_t* kLabelText[7] =
{"Theta ", "Phi ", "Psi ", "U ", "V ", "UScale", "VScale"};
static Int_t IRangeMin[7] = { 0, 0, 0, 0, 0, 0, 0};
static Int_t IRangeMax[7] = {36000, 36000, 36000, 2000, 2000, 10, 10};
UInt_t w, UInt_t h) :
TGCompositeFrame(p, w, h,kVerticalFrame)
{
+// Constructor
ChangeOptions((GetOptions() & ~kHorizontalFrame) | kVerticalFrame);
//--- layout for buttons: top align, equally expand horizontally
fBly = new TGLayoutHints(kLHintsTop | kLHintsExpandY, 5, 5, 5, 5);
fHslider[i]->SetRange(IRangeMin[i], IRangeMax[i]);
fHslider[i]->SetPosition(DefaultPos[i]);
- fLabel[i] = new TGLabel(fHframe[i], LabelText[i]);
+ fLabel[i] = new TGLabel(fHframe[i], kLabelText[i]);
fHframe[i]->AddFrame(fLabel[i], fBfly1);
AliGUISliders::~AliGUISliders()
{
+// Destructor
delete fBfly1; delete fBly;
// Delete dialog.
for (Int_t i=1; i<7; i++) {
void AliGUISliders::Update()
{
+// Update sliders
char buf[10];
for (Int_t i=0; i<7; i++) {
AliGUIMaterial::AliGUIMaterial()
{
+// Constructor
fId=-1;
fName = 0;
fA=-1;
AliGUIMaterial::AliGUIMaterial(Int_t imat, char* name, Float_t a, Float_t z,
Float_t dens, Float_t radl, Float_t absl)
{
+// Constructor
fId=imat;
fName=name;
fA=a;
}
void AliGUIMaterial::Dump()
{
+// Dump material information
printf("\n *****************************************");
printf("\n Material Number: %10d", fId);
printf("\n %s", fName);
Int_t AliGUIMaterial::Id()
{
+// return material id
return fId;
}
char* AliGUIMaterial::Name()
{
+// return material name
return fName;
}
Float_t AliGUIMaterial::A()
{
+// return atomic number
return fA;
}
Float_t AliGUIMaterial::Z()
{
+// return charge number
return fZ;
}
Float_t AliGUIMaterial::Density()
{
+// return density
return fDensity;
}
Float_t AliGUIMaterial::RadiationLength()
{
+// return radiation length
return fRadl;
}
Float_t AliGUIMaterial::AbsorptionLength()
{
+// return absorption length
return fAbsl;
}
void AliGUIMaterial::Plot()
{
+// dummy plot routine
;
}
void AliGUIMaterial::Streamer(TBuffer &)
{
+// dummy streamner
;
}
AliGUIMedium::AliGUIMedium()
{
+// constructor
fId=-1;
fName = 0;
}
Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax,
Float_t epsil, Float_t stmin)
{
+// constructor
fId=imed;
fIdMat=imat;
fName=name;
void AliGUIMedium::Dump()
{
+// Dummy dump
;
}
Int_t AliGUIMedium::Id()
{
+// return medium id
return fId;
}
char* AliGUIMedium::Name()
{
+// return medium name
return fName;
}
Float_t AliGUIMedium::GetPar(Int_t ipar)
{
+// Get parameter number ipar
Float_t p;
if (ipar < 23) {
p= fPars[ipar-1];
void AliGUIMedium::Streamer(TBuffer &)
{
+// dummy streamer
;
}
-#ifndef ROOT_guitest
-#define ROOT_guitest
+#ifndef TGEANT3GUI
+#define TGEANT3GUI
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
class AliGeant3GeometryGUI : public TObject {
- private:
- AliGuiGeomMain *fPanel; // the main gui panel
- Int_t fNstack; // number of volumes
- TClonesArray *fVolumes; // array of volumes
- Int_t fNMaterials; // number of materials and media
- TClonesArray *fMaterials; // array of materials
- TClonesArray *fMedia; // array of materials
-// Zebra bank related information
- Int_t* fZlq;
- Float_t* fZq;
- Int_t* fZiq;
- Gclink_t* fGclink;
- Gcnum_t* fGcnum;
public:
AliGeant3GeometryGUI();
+ virtual ~AliGeant3GeometryGUI(){;}
+
// Reads the zebra geometry tree and put it into the ListTree
void ReadGeometryTree();
// Read material and media information and put it into ComboBox
void ReadMaterials();
Float_t Cut(Int_t idmed, Int_t icut);
+ private:
+ AliGuiGeomMain *fPanel; // the main gui panel
+ Int_t fNstack; // number of volumes
+ TClonesArray *fVolumes; // array of volumes
+ Int_t fNMaterials; // number of materials and media
+ TClonesArray *fMaterials; // array of materials
+ TClonesArray *fMedia; // array of materials
+// Zebra bank related information
+ Int_t* fZlq; // pointer to Zebra bank lq
+ Float_t* fZq; // pointer to Zebra bank q
+ Int_t* fZiq; // pointer to Zebra bank iq
+ Gclink_t* fGclink; // pointer to Geant common block
+ Gcnum_t* fGcnum; // pointer to Geant common block
+
private:
virtual AliDrawVolume* Volume(Int_t id)
{return (AliDrawVolume *) (fVolumes->UncheckedAt(id));}
class AliGuiGeomMain : public TGMainFrame {
-
-private:
- TGTab *fTab;
- TGCanvas *fCanvasWindow;
- TGCompositeFrame *fContainer, *fF2, *fF21, *fF3, *fF31, *fF4, *fF5;
- TGCompositeFrame *fF6, *fF61, *fF62, *fF63;
- TGListTree *fLt;
- TGMenuBar *fMenuBar;
- TGPopupMenu *fMenuFile, *fMenuTest, *fMenuHelp;
- TGLayoutHints *fMenuBarItemLayout, *fMenuBarHelpLayout,
- *fMenuBarLayout, fLTab;
- TGLayoutHints *fL2;
- AliGuiGeomDialog *fDialog; //! no output please
- TGComboBox *fMaterialCombo;
- TGComboBox *fMechanismCombo;
- TGComboBox *fMediaCombo, *fParticleCombo;
- TGListBox *fProcessLB, *fCutsLB;
- TClonesArray *fComboEntries;
- TClonesArray *fComboMediaEntries;
- TGHorizontalFrame *fHframe[6],*fHframeM[8];
- TGTextBuffer *fTbh[6], *fTbhM[8], *fTbh61, *fTbh62, *fTbh63;
- TGTextEntry *fTeh[6], *fTehM[8], *fTeh61, *fTeh62, *fTeh63;
- TGLabel *fLabel[6], *fLabelM[8], *fSLabel61;
- TGTextButton *fPlotButton;
- Float_t fEmin;
- Float_t fEmax;
- Int_t fNbins;
-
public:
AliGuiGeomMain(const TGWindow *p, UInt_t w, UInt_t h);
virtual ~AliGuiGeomMain();
virtual void CloseWindow();
// Add item to ListTree
virtual TGListTreeItem *
- AddItem(TObject *, TGListTreeItem* ,
- const char*, const TGPicture*, const TGPicture*);
+ AddItem(TObject *obj, TGListTreeItem* parent,
+ const char* name,
+ const TGPicture* open, const TGPicture* closed);
// Add Material to ComboBox
virtual void AddMaterial(AliGUIMaterial *Material, Int_t i);
// Add Medium to ComboBox
virtual void AddMedium(AliGUIMedium *Medium, Int_t i);
// Process messages from this window
- virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t);
+ virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
// Update widgets
virtual void Update();
// Update ComboBoxes
virtual void SetMediaComboEntries(TClonesArray *entries)
{fComboMediaEntries=entries;}
virtual void Plot();
+private:
+ TGTab *fTab; // Contains Tab entries: volumes, materials..
+ TGCanvas *fCanvasWindow; // Canvas window for list tree
+ TGCompositeFrame *fF2, *fF21, *fF3, *fF31, *fF4, *fF5; // Frames for combos
+ TGCompositeFrame *fF6, *fF61, *fF62, *fF63; // Frames for combos
+ TGListTree *fLt; // Volumes list tree
+ TGMenuBar *fMenuBar; // Menu bar: File, Draw Control ...
+ TGPopupMenu *fMenuFile, *fMenuTest, *fMenuHelp; // Pop-up menus
+ TGLayoutHints *fMenuBarItemLayout, *fMenuBarHelpLayout, // Lay-out hints
+ *fMenuBarLayout, fLTab; // Lay-out hints
+ TGLayoutHints *fL2; // Lay-out hints
+ AliGuiGeomDialog *fDialog; //! no output please
+ TGComboBox *fMaterialCombo; // Material combo box
+ TGComboBox *fMechanismCombo; // Mechanism combo box
+ TGComboBox *fMediaCombo, *fParticleCombo; // Media and particle combo boxes
+ TGListBox *fProcessLB, *fCutsLB; // List boxes for cuts and processes
+ TClonesArray *fComboEntries; // List of materials
+ TClonesArray *fComboMediaEntries; // List of media
+ TGHorizontalFrame *fHframe[6],*fHframeM[8]; // sub frames
+ TGTextBuffer *fTbh[6], *fTbhM[8], *fTbh61, *fTbh62, *fTbh63; // text frames
+ TGTextEntry *fTeh[6], *fTehM[8], *fTeh61, *fTeh62, *fTeh63; // text entries
+ TGLabel *fLabel[6], *fLabelM[8], *fSLabel61; // labels
+ TGTextButton *fPlotButton; // Plot-Button
+ Float_t fEmin; // minimum energy for de/dx plot
+ Float_t fEmax; // maximum energy for de/dx plot
+ Int_t fNbins; // number of bins for de/dx plot
+
+
ClassDef(AliGuiGeomMain,1) // MainFrame for Geometry Browser
};
class AliGuiGeomDialog : public TGTransientFrame {
-
-private:
- AliGUISliders *fF1;
- TGCompositeFrame *fFrame1, *fF2, *fF3, *fF4;
- TGButton *fOkButton, *fCancelButton;
- TGButton *fChk1, *fChk2, *fChk3;
- TGComboBox *fCombo, *fCombo2;
- TGLabel *fLabel1, *fLabel2;
- TGTab *fTab;
- TGLayoutHints *fL1, *fL2, *fL3, *fL4, *fBly, *fBfly1;
- TGHorizontalFrame *fHSframe1, *fHSframe2, *fHSframe3;
- TGTextBuffer *fTbh11, *fTbh12, *fTbh21, *fTbh22, *fTbh31, *fTbh32;
- TGTextEntry *fTeh11, *fTeh12, *fTeh21, *fTeh22, *fTeh31, *fTeh32;
- TGDoubleHSlider *fDslider1, *fDslider2, *fDslider3;
- TGLabel *fSLabel1, *fSLabel2, *fSLabel3;
-
public:
AliGuiGeomDialog(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
UInt_t options = kMainFrame | kVerticalFrame);
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
// Update widgets
virtual void Update();
+private:
+ AliGUISliders *fF1; // Slider for Draw Control
+ TGCompositeFrame *fFrame1, *fF2, *fF3, *fF4; // Outer frames
+ TGButton *fOkButton, *fCancelButton; // Buttons
+ TGButton *fChk1, *fChk2, *fChk3; // Buttons
+ TGComboBox *fCombo, *fCombo2; // Combo Boxes
+ TGLabel *fLabel1, *fLabel2; // Labels
+ TGTab *fTab; // Tab Entries
+ TGLayoutHints *fL1, *fL2, *fL3, *fL4, *fBly, *fBfly1; // Layout hints
+ TGHorizontalFrame *fHSframe1, *fHSframe2, *fHSframe3; // Horizontal frames
+ TGTextBuffer *fTbh11, *fTbh12, *fTbh21, *fTbh22, *fTbh31, *fTbh32; // Text buffers
+ TGTextEntry *fTeh11, *fTeh12, *fTeh21, *fTeh22, *fTeh31, *fTeh32; // Text Entries
+ TGDoubleHSlider *fDslider1, *fDslider2, *fDslider3; // Sliders for clip box
+ TGLabel *fSLabel1, *fSLabel2, *fSLabel3; // Labels
};
class AliGUISliders : public TGCompositeFrame {
-
-private:
-//
- TGHorizontalFrame *fHframe[8];
- TGLayoutHints *fBly, *fBfly1;
- TGHSlider *fHslider[8];
- TGTextEntry *fTeh[8];
- TGTextBuffer *fTbh[8];
- TGLabel *fLabel[8];
- Text_t fLabelText[8];
public:
AliGUISliders(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h);
virtual ~AliGUISliders();
virtual void CloseWindow();
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
virtual void Update();
+private:
+//
+ TGHorizontalFrame *fHframe[8]; // 8 Horizontal frames for sliders
+ TGLayoutHints *fBly, *fBfly1; // Lay-out hints
+ TGHSlider *fHslider[8]; // 8 Sliders
+ TGTextEntry *fTeh[8]; // Text entries for slider position
+ TGTextBuffer *fTbh[8]; // Text buffer
+ TGLabel *fLabel[8]; // Slider labels
+ Text_t fLabelText[8]; // Label text
// ClassDef(AliGUISliders,1) // Window containing sliders
};
AliDrawVolume(char* name);
virtual ~AliDrawVolume(){;}
// Draw the volume
- virtual void Draw(Option_t * =0);
+ virtual void Draw(Option_t * option =0);
// Draw volume specs
virtual void DrawSpec();
// Return volume name
virtual char* Name();
// Set volume parameter i
- virtual void SetParam(Int_t i, Float_t);
+ virtual void SetParam(Int_t i, Float_t param);
// Get volume parameters i
virtual Float_t GetParam(Int_t i);
// Set volume id
Int_t fIdMedium; // geant medium id
Int_t fIdMaterial; // geant material id
Int_t fIdCopy; // copy flag
- TGListTreeItem *fItem;
+ TGListTreeItem *fItem; // current item
ClassDef(AliDrawVolume,1) // Volume Object for Drawing
};