virtual Float_t DGas() {return fdGas;}
virtual Float_t DAlu() {return fdAlu;}
// assignment operator
- virtual AliMUONChamber& operator =(const AliMUONChamber& rhs);
+ AliMUONChamber& operator =(const AliMUONChamber& rhs);
protected:
Int_t fId; // chamber number
/*
$Log$
+Revision 1.3 2000/07/03 11:54:57 morsch
+AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
+The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
+
Revision 1.2 2000/06/15 07:58:48 morsch
Code from MUON-dev joined
if (fHitMap) delete[] fHitMap;
}
-void AliMUONHitMapA1::Clear()
+void AliMUONHitMapA1::Clear(const char *)
{
// Clear hitmap
memset(fHitMap,0,sizeof(int)*fMaxIndex);
// Fill hits from list of digits into hit map
virtual void FillHits();
// Clear the hit map
- virtual void Clear();
+ virtual void Clear(const char *opt = "");
// Set a single hit
virtual void SetHit(Int_t ix, Int_t iy, Int_t idigit);
// Delete a single hit
virtual void SetHit(Float_t xhit, Float_t yhit);
virtual void SetHit(Float_t xhit, Float_t yhit, Float_t zhit)
{SetHit(xhit, yhit);}
+
+ virtual void Draw(const char *opt="") {}
ClassDef(AliMUONSegmentationTrigger,1) //Segmentation class for trigger
protected:
virtual void GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y);
virtual void GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z)
{z=0; GetPadC(ix, iy, x , y);}
+
+ virtual void Draw(const char *opt="") {}
+
// Pad size Dx*Dy
virtual void SetPadSize(Float_t dp1, Float_t dp2);
// Strip size
**************************************************************************/
/*
$Log$
+Revision 1.4 2000/07/03 11:54:57 morsch
+AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
+The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
+
Revision 1.3 2000/06/29 12:34:09 morsch
AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
it usable with any other geometry class. The link to the object to which it belongs is
y[0]=x[0];
}
-void AliMUONSegmentationV0::Draw()
+void AliMUONSegmentationV0::Draw(const char *)
{
// Draws the segmentation zones
//
// Test points for auto calibration
virtual void GiveTestPoints(Int_t &n, Float_t *x, Float_t *y);
// Draw segmentation zones
- virtual void Draw();
+ virtual void Draw(const char *opt="");
// Function for systematic corrections
// Set the correction function
virtual void SetCorrFunc(Int_t dum, TF1* func) {fCorr=func;}
/*
$Log$
+Revision 1.4 2000/07/03 11:54:57 morsch
+AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
+The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
+
Revision 1.3 2000/06/29 12:34:09 morsch
AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
it usable with any other geometry class. The link to the object to which it belongs is
y[2]=x[2];
}
-void AliMUONSegmentationV01::Draw()
+void AliMUONSegmentationV01::Draw(const char *)
{
// Draws the segmentation zones
//
void GiveTestPoints(Int_t &n, Float_t *x, Float_t *y);
//
// Draw segmentation zones
- virtual void Draw();
+ virtual void Draw(const char *opt="");
// Function for systematic corrections
// Set the correction function
virtual void SetCorrFunc(Int_t dum, TF1* func);
virtual Int_t Npy();
// calculate sector from pad coordinates
virtual Int_t Sector(Int_t ix, Int_t iy);
+ virtual void Draw(const char *opt="") {}
//
// Transform from pad (wire) to real coordinates and vice versa
// Transform from pad to real coordinates
virtual void IntegrationLimits
(Float_t& x1, Float_t& x2, Float_t& y1, Float_t& y2);
// Draw the segmentation zones
- virtual void Draw(){;}
+ virtual void Draw(const char * = ""){}
// Function for systematic corrections
// Set the correction function
virtual void SetCorrFunc(Int_t dum, TF1* func) {fCorr=func;}
**************************************************************************/
/*
$Log$
+Revision 1.5 2000/07/03 11:54:57 morsch
+AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
+The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
+
Revision 1.4 2000/06/28 15:16:35 morsch
(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
to allow development of slat-muon chamber simulation and reconstruction code in the MUON
AliMUONTriggerCircuit::AliMUONTriggerCircuit()
{
// Constructor
+ fSegmentation=0;
fidCircuit=0;
fx2m=0;
fx2ud=0;
/*
$Log$
+ Revision 1.4 2000/06/30 16:48:58 dibari
+ New function GenerateTresholds() for pedestal simulation.
+
Revision 1.3 2000/06/12 15:17:58 jbarbosa
Cleaned up version.
frMin = 0.1;
frMax = 140;
fnsec = 1;
- fIndexMap[50] = 0;
+ for(Int_t i=0; i<50; ++i) fIndexMap[i] = 0;
}
AliRICHChamber::AliRICHChamber(const AliRICHChamber& Chamber)
virtual ~AliDetector();
// Inline functions
- virtual void Copy(AliDetector &det) const;
+ void Copy(AliDetector &det) const;
virtual int GetNdigits() {return fNdigits;}
virtual int GetNhits() {return fNhits;}
TClonesArray *Digits() {return fDigits;}
TObjArray *Points() {return fPoints;}
Int_t GetIshunt() {return fIshunt;}
void SetIshunt(Int_t ishunt) {fIshunt=ishunt;}
- virtual AliDetector &operator=(const AliDetector &det)
+ AliDetector &operator=(const AliDetector &det)
{det.Copy(*this); return (*this);}
// Other methods
/*
$Log$
+Revision 1.8 2000/07/11 18:24:59 fca
+Coding convention corrections + few minor bug fixes
+
Revision 1.7 1999/11/10 07:37:06 fca
Pads do not inherit editability from canvas any more
//----------------------------------------------------------------------------
void AliDisplay::HideTrack(Int_t idx) {
+ //
+ // Hide track on display
+ //
AliDetector *mTPC=(AliDetector*)gAlice->GetModule("TPC");
TObjArray *points=mTPC->Points();
int ntracks=points->GetEntriesFast();
//_____________________________________________________________________________
void AliDisplay::SetPickMode()
{
+ //
+ // Set Pick Mode -- disable zoom
+ //
fZoomMode = 0;
fArcButton->SetY1(fPickButton->GetYlowNDC()+0.5*fPickButton->GetHNDC());
//_____________________________________________________________________________
void AliDisplay::SetZoomMode()
{
+ //
+ // Set Zoom Mode -- disable pick
+ //
fZoomMode = 1;
fArcButton->SetY1(fZoomButton->GetYlowNDC()+0.5*fZoomButton->GetHNDC());
//_____________________________________________________________________________
void AliDisplay::SetPTcut(Float_t ptcut)
{
+ //
+ // Set Pt Cut
+ //
fPTcut = ptcut;
if (!fPad) return;
TSlider *CutSlider() {return fCutSlider;}
virtual void ShowTrack(Int_t trackNumber); // *MENU*
virtual void HideTrack(Int_t trackNumber); // *MENU*
- virtual void Copy(AliDisplay &disp) const;
+ void Copy(AliDisplay &disp) const;
virtual void DisableDetector(const char *name); // *MENU*
virtual void DisplayButtons();
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void SetZoomMode();
virtual void ShowNextEvent(Int_t delta=1);
virtual void UnZoom(); // *MENU*
- virtual AliDisplay& operator= (const AliDisplay &disp);
+ AliDisplay& operator= (const AliDisplay &disp);
protected:
Int_t fZoomMode; //=1 if in zoom mode
AliGenerator(const AliGenerator &gen);
virtual ~AliGenerator();
virtual void Init();
- virtual void Copy(AliGenerator &gen) const;
+ void Copy(AliGenerator &gen) const;
virtual void SetOrigin(Float_t ox, Float_t oy, Float_t oz)
{fOrigin[0]=ox;fOrigin[1]=oy;fOrigin[2]=oz;}
virtual void SetOrigin(const TLorentzVector &o)
virtual void SetMC(TGenerator *theMC)
{if (!fgMCEvGen) fgMCEvGen =theMC;}
- virtual AliGenerator & operator=(const AliGenerator &gen);
+ AliGenerator & operator=(const AliGenerator &gen);
// Getters
// Fill hits from list of digits into hit map
virtual void FillHits() =0;
// Clear the hit map
- virtual void Clear() =0;
+ virtual void Clear(const char *opt = "") =0;
// Set a single hit
virtual void SetHit(Int_t ix, Int_t iy, Int_t idigit) =0;
// Delete a single hit
Float_t phimax,Float_t rmin,Float_t rmax,Float_t zmax);
AliLego(const AliLego &lego) {lego.Copy(*this);}
virtual ~AliLego();
- virtual void Copy(AliLego &lego) const;
+ void Copy(AliLego &lego) const;
virtual void StepManager();
virtual void BeginEvent();
virtual void FinishEvent();
/*
$Log$
+Revision 1.1 2000/07/12 08:56:25 fca
+Coding convention correction and warning removal
+
Revision 1.16 2000/05/26 08:35:03 fca
Move the check on z after z has been retrieved
fNphi(nphi), fThetaBin(ntheta), fPhiBin(-1), fCurTheta(0), fCurPhi(0)
{
+ //
+ // Standard generator for Lego rays
+ //
SetPhiRange(phimin,phimax);
SetThetaRange(themin,themax);
SetName("Lego");
/*
$Log$
+Revision 1.5 2000/07/12 08:56:25 fca
+Coding convention correction and warning removal
+
Revision 1.4 2000/07/11 18:24:59 fca
Coding convention corrections + few minor bug fixes
gMC=this;
}
}
-
-void AliMC::Copy(AliMC &mc) const
-{
- //
- // Copy *this onto mc -- not implemented
- //
- Fatal("Copy","Not implemented~\n");
-}
-
public:
AliMC(const char *name, const char *title);
AliMC() {}
- AliMC(const AliMC &mc) {mc.Copy(*this);}
- virtual void Copy(AliMC &mc) const;
- virtual AliMC & operator=(const AliMC &mc) {mc.Copy(*this);return (*this);}
virtual ~AliMC() {fgMC=gMC=0;}
// static access method
private:
static AliMC* fgMC; // Pointer to the virtual MonteCarlo object
+ AliMC(const AliMC &) {}
+ AliMC & operator=(const AliMC &) {return (*this);}
ClassDef(AliMC,1) //Geometry Interface Class
};
virtual ~AliMagFCM() {delete fB;}
virtual void Field(Float_t *x, Float_t *b);
virtual void ReadField();
- virtual void Copy(AliMagFCM &magf) const;
+ void Copy(AliMagFCM &magf) const;
virtual AliMagFCM & operator=(const AliMagFCM &magf);
Float_t Bx(const Int_t ix, const Int_t iy, const Int_t iz) {
/*
$Log$
+Revision 1.2 2000/07/12 08:56:25 fca
+Coding convention correction and warning removal
+
Revision 1.1 2000/07/11 18:24:59 fca
Coding convention corrections + few minor bug fixes
: AliMagF(name,title,integ,map,factor,fmax)
{
+ //
+ // Standard constructor for the Dipole field
+ //
fType = kDipoMap;
printf("Field Map for Muon Arm from IP till muon filter %s created: map= %d, factor= %f, file=%s\n",fName.Data(),map,factor,fTitle.Data());
virtual void SetEuclidFile(char *material,char *geometry=0);
virtual void ReadEuclid(const char *filnam, char *topvol);
virtual void ReadEuclidMedia(const char *filnam);
- virtual AliModule& operator=(const AliModule &mod);
- virtual void Copy(AliModule &mod) const;
+ AliModule& operator=(const AliModule &mod);
+ void Copy(AliModule &mod) const;
protected:
// Data members
AliPoints(const AliPoints& pts);
AliPoints(Int_t nhits);
virtual ~AliPoints();
- virtual void Copy(AliPoints &pts) const;
+ void Copy(AliPoints &pts) const;
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
AliDetector *GetDetector() {return fDetector;}
virtual void InspectParticle(); // *MENU*
virtual void DumpParticle(); // *MENU*
virtual Text_t *GetObjectInfo(Int_t px, Int_t py);
- virtual AliPoints & operator=(const AliPoints &pts);
+ AliPoints & operator=(const AliPoints &pts);
virtual void Propagate(); // *MENU*
virtual void SetDetector(AliDetector *det) {fDetector = det;}
virtual void SetParticle(Int_t index) {fIndex = index;}
virtual void AddDigit(AliDigitNew & digit) ; // add a digit to the digit's indexes list
// virtual void AddTrack(AliTrack & track) ; // add a track to the tracks list
- virtual void Copy(AliRecPoint &recp) const;
+ void Copy(AliRecPoint &recp) const;
virtual void GetCovarianceMatrix(TMatrix & mat) ;
virtual AliGeometry * GetGeom() const { return fGeom; }
virtual void GetGlobalPosition(TVector3 & gpos, TMatrix & gmat) ; // return the global position in ALICE
virtual Int_t GetMaximumTrackMultiplicity() const { return fMaxTrack; }
virtual Int_t GetTracksMultiplicity(void) const { return fMulTrack ; }
virtual void Print(Option_t * opt = "void") = 0 ;
- virtual AliRecPoint & operator= (const AliRecPoint &recp);
+ AliRecPoint & operator= (const AliRecPoint &recp);
void SetIndexInList(Int_t val) { fIndexInList = val ; }
/*
$Log$
+Revision 1.40 2000/07/12 08:56:25 fca
+Coding convention correction and warning removal
+
Revision 1.39 2000/07/11 18:24:59 fca
Coding convention corrections + few minor bug fixes
fHitLists = new TList();
}
-//_____________________________________________________________________________
-AliRun::AliRun(const AliRun &run)
-{
- //
- // Copy constructor
- //
- run.Copy(*this);
-}
-
//_____________________________________________________________________________
AliRun::~AliRun()
}
}
-//_____________________________________________________________________________
-AliRun& AliRun::operator = (const AliRun &run)
-{
- //
- // Assignment operator
- //
- if(this != &run) run.Copy(*this);
- return (*this);
-}
-
-
-//_____________________________________________________________________________
-void AliRun::Copy(AliRun &/* run */) const
-{
- //
- // Copy *this onto run, not implemented for AliRun
- //
- Fatal("operator =","Assignment operator not implemented!\n");
-}
-
//_____________________________________________________________________________
void AliRun::Streamer(TBuffer &R__b)
{
// Creators - distructors
AliRun();
AliRun(const char *name, const char *title);
- AliRun(const AliRun &run);
virtual ~AliRun();
virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
virtual void ResetGenerator(AliGenerator *generator);
virtual void EnergySummary();
virtual const TDatabasePDG* PDGDB() const {return fPDGDB;}
- virtual AliRun& operator = (const AliRun &run);
- virtual void Copy(AliRun &run) const;
TTree *TreeD() {return fTreeD;}
TArrayF fSum2Energy; //Energy squared per event in each volume
TString fConfigFunction; //Configuration file to be executed
+private:
+
+ AliRun(const AliRun &) {}
+ AliRun& operator = (const AliRun &) {return *this;}
+
ClassDef(AliRun,3) //Supervisor class for all Alice detectors
};
// Test points for auto calibration
virtual void GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) = 0;
// Draw the segmentation zones
- virtual void Draw() = 0;
+ virtual void Draw(const char *opt = "") = 0;
// Function for systematic corrections
// Set the correction function
virtual void SetCorrFunc(Int_t, TF1*) = 0;
--- /dev/null
+/* *************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.8 2000/07/12 08:56:32 fca
+Coding convention correction and warning removal
+
+Revision 1.7 2000/06/28 21:27:45 morsch
+Most coding rule violations corrected.
+Still to do: Split the file (on file per class) ? Avoid the global variables.
+Copy constructors and assignment operators (dummy ?)
+
+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
+
+Revision 1.4 2000/01/18 16:12:08 morsch
+Bug in calculation of number of volume divisions and number of positionings corrected
+Browser for Material and Media properties added
+
+Revision 1.3 1999/11/14 14:31:14 fca
+Correct small error and remove compilation warnings on HP
+
+Revision 1.2 1999/11/10 16:53:35 fca
+The new geometry viewer from A.Morsch
+
+*/
+
+/*
+ * Version: 0
+ * Written by Andreas Morsch
+ *
+ *
+ *
+ * For questions critics and suggestions to this part of the code
+ * contact andreas.morsch@cern.ch
+ *
+ **************************************************************************/
+
+#include "AliDrawVolume.h"
+
+ClassImp(AliDrawVolume)
+
+AliDrawVolume::AliDrawVolume(char* name)
+{
+// Constructor
+ fName = name;
+ fTheta = 30;
+ fPhi = 30;
+ fPsi = 0;
+ fU = 10;
+ fV = 10;
+ fUscale = 0.01;
+ fVscale = 0.01;
+ fHide=0;
+ fShadow=0;
+ fFill=1;
+ fSeen=1;
+ fClip=0;
+ fClipXmin=0.;
+ fClipXmax=2000.;
+ fClipYmin=0.;
+ fClipYmax=2000.;
+ fClipZmin=0.;
+ fClipZmax=2000.;
+}
+
+char* AliDrawVolume::Name()
+{
+//
+// Return volume name
+ return fName;
+}
+
+
+void AliDrawVolume::Streamer(TBuffer &)
+{
+// Dummy Streamer
+;
+}
+
+
+
+void AliDrawVolume::Draw(Option_t *)
+{
+// Wraps the geant Gdraw
+ gMC->Gsatt(fName,"seen", fSeen);
+
+ if (fHide) {
+ gMC->Gdopt("hide", "on");
+ } else {
+ gMC->Gdopt("hide", "off");
+ }
+
+ if (fShadow) {
+ gMC->Gdopt("shad", "on");
+ gMC->Gsatt("*", "fill", fFill);
+ } else {
+ gMC->Gdopt("shad", "off");
+ }
+
+ gMC->SetClipBox(".");
+ if (fClip) {
+ gMC->SetClipBox("*", fClipXmin, fClipXmax,
+ fClipYmin, fClipYmax, fClipZmin, fClipZmax);
+ } else {
+ gMC->SetClipBox(".");
+ }
+
+
+ gMC->Gdraw(fName, fTheta, fPhi, fPsi, fU, fV, fUscale, fVscale);
+ THIGZ *higz = (THIGZ*)gROOT->GetListOfCanvases()->FindObject("higz");
+ if (higz) higz->Update();
+}
+
+void AliDrawVolume::DrawSpec()
+{
+// Wraps the Geant DrawSpec
+ gMC->Gsatt(fName,"seen", fSeen);
+
+ if (fHide) {
+ gMC->Gdopt("hide", "on");
+ } else {
+ gMC->Gdopt("hide", "off");
+ }
+
+ if (fShadow) {
+ gMC->Gdopt("shad", "on");
+ gMC->Gsatt("*", "fill", fFill);
+ } else {
+ gMC->Gdopt("shad", "off");
+ }
+
+ gMC->SetClipBox(".");
+ if (fClip) {
+ gMC->SetClipBox("*", fClipXmin, fClipXmax, fClipYmin, fClipYmax, fClipZmin, fClipZmax);
+ } else {
+ gMC->SetClipBox(".");
+ }
+
+
+ ((TGeant3*) gMC)->DrawOneSpec(fName);
+ THIGZ *higz = (THIGZ*)gROOT->GetListOfCanvases()->FindObject("higz");
+ if (higz) higz->Update();
+}
+
+void AliDrawVolume::SetParam(Int_t ip, Float_t param)
+{
+// Set drawing parameters
+ switch (ip) {
+ case kTheta:
+ fTheta=param;
+ break;
+ case kPhi:
+ fPhi=param;
+ break;
+ case kPsi:
+ fPsi=param;
+ break;
+ case kU:
+ fU=param;
+ break;
+ case kV:
+ fV=param;
+ break;
+ case kUscale:
+ fUscale=param;
+ break;
+ case kVscale:
+ fVscale=param;
+ break;
+ case kHide:
+ fHide=Int_t(param);
+ break;
+ case kShadow:
+ fShadow=Int_t(param);
+ break;
+ case kFill:
+ fFill=Int_t(param);
+ break;
+ case kSeen:
+ fSeen=Int_t(param);
+ break;
+ case kClip:
+ fClip=Int_t(param);
+ break;
+ case kClipXmin:
+ fClipXmin=param;
+ break;
+ case kClipXmax:
+ fClipXmax=param;
+ break;
+ case kClipYmin:
+ fClipYmin=param;
+ break;
+ case kClipYmax:
+ fClipYmax=param;
+ break;
+ case kClipZmin:
+ fClipZmin=param;
+ break;
+ case kClipZmax:
+ fClipZmax=param;
+ break;
+ }
+}
+
+Float_t AliDrawVolume::GetParam(Int_t ip)
+{
+// Get drawing parameters
+ switch (ip) {
+ case kTheta:
+ return fTheta;
+ case kPhi:
+ return fPhi;
+ case kPsi:
+ return fPsi;
+ case kU:
+ return fU;
+ case kV:
+ return fV;
+ case kUscale:
+ return fUscale;
+ case kVscale:
+ return fVscale;
+ case kHide:
+ return Float_t(fHide);
+ case kShadow:
+ return Float_t(fShadow);
+ case kFill:
+ return Float_t(fFill);
+ case kSeen:
+ return Float_t(fSeen);
+ case kClip:
+ return Float_t(fClip);
+ case kClipXmin:
+ return fClipXmin;
+ case kClipXmax:
+ return fClipXmax;
+ case kClipYmin:
+ return fClipYmin;
+ case kClipYmax:
+ return fClipYmax;
+ case kClipZmin:
+ return fClipZmin;
+ case kClipZmax:
+ return fClipZmax;
+ default:
+ return 0.;
+ }
+ return 0.;
+}
+
+
--- /dev/null
+#ifndef ALIDRAWVOLUME_H
+#define ALIDRAWVOLUME_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include <TGListTree.h>
+#include "TROOT.h"
+
+#include "THIGZ.h"
+#include "TGeant3.h"
+
+class AliDrawVolume : public TObject
+{
+public:
+ AliDrawVolume(char* name);
+ virtual ~AliDrawVolume(){;}
+ // Draw the volume
+ 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 param);
+ // Get volume parameters i
+ virtual Float_t GetParam(Int_t i);
+ // Set volume id
+ virtual void SetIdVolume(Int_t id) {fIdVolume = id;}
+ // Set volume copy number
+ virtual void SetIdCopy(Int_t id) {fIdCopy = id;}
+ // Set volume medium number
+ virtual void SetIdMedium(Int_t id) {fIdMedium = id;}
+ // Set volume material number
+ virtual void SetIdMaterial(Int_t id) {fIdMaterial = id;}
+ // Get volume id
+ virtual Int_t GetIdVolume() {return fIdVolume;}
+ // Get copy number
+ virtual Int_t GetIdCopy() {return fIdCopy;}
+ // Get medium number
+ virtual Int_t Medium() {return fIdMedium;}
+ // Get material number
+ virtual Int_t Material() {return fIdMaterial;}
+ // Increase copy number by one
+ virtual void AddCopy() {fIdCopy ++;}
+ // Set link to ListTree Item
+ virtual void SetItem(TGListTreeItem *item) {fItem = item;}
+ // Get link to ListTree Item
+ virtual TGListTreeItem* GetItem() {return fItem;}
+
+private:
+ char* fName; // name of the volume
+ Float_t fTheta; // theta-angle for drawing
+ Float_t fPhi; // phi-angle for drawing
+ Float_t fPsi; // psi-angle for drawing
+ Float_t fU; // u-position
+ Float_t fV; // v-position
+ Float_t fUscale; // u-scaling factor
+ Float_t fVscale; // v-scaling factor
+ Bool_t fHide; // hide flag
+ Bool_t fShadow; // shadow flag
+ Int_t fFill; // fill option 1-6
+ Int_t fSeen; // seen option -2 - 1
+ Bool_t fClip; // clipping flag
+ Float_t fClipXmin; // clip box range xmin
+ Float_t fClipXmax; // clip box range xmax
+ Float_t fClipYmin; // clip box range ymin
+ Float_t fClipYmax; // clip box range ymax
+ Float_t fClipZmin; // clip box range zmin
+ Float_t fClipZmax; // clip box range zmax
+ Int_t fIdVolume; // geant volume id
+ Int_t fIdMedium; // geant medium id
+ Int_t fIdMaterial; // geant material id
+ Int_t fIdCopy; // copy flag
+ TGListTreeItem *fItem; // current item
+
+ AliDrawVolume(const AliDrawVolume&) {}
+ AliDrawVolume & operator=(const AliDrawVolume&) {return *this;}
+
+ ClassDef(AliDrawVolume,1) // Volume Object for Drawing
+};
+
+//
+// Drawing parameter tags
+enum AliDrawParamId {
+ kTheta,
+ kPhi,
+ kPsi,
+ kU,
+ kV,
+ kUscale,
+ kVscale,
+ kShadow,
+ kHide,
+ kFill,
+ kSeen,
+ kClip,
+ kClipXmin,
+ kClipXmax,
+ kClipYmin,
+ kClipYmax,
+ kClipZmin,
+ kClipZmax
+};
+
+
+#endif
--- /dev/null
+/* *************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.8 2000/07/12 08:56:32 fca
+Coding convention correction and warning removal
+
+Revision 1.7 2000/06/28 21:27:45 morsch
+Most coding rule violations corrected.
+Still to do: Split the file (on file per class) ? Avoid the global variables.
+Copy constructors and assignment operators (dummy ?)
+
+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
+
+Revision 1.4 2000/01/18 16:12:08 morsch
+Bug in calculation of number of volume divisions and number of positionings corrected
+Browser for Material and Media properties added
+
+Revision 1.3 1999/11/14 14:31:14 fca
+Correct small error and remove compilation warnings on HP
+
+Revision 1.2 1999/11/10 16:53:35 fca
+The new geometry viewer from A.Morsch
+
+*/
+
+/*
+ * Version: 0
+ * Written by Andreas Morsch
+ *
+ *
+ *
+ * For questions critics and suggestions to this part of the code
+ * contact andreas.morsch@cern.ch
+ *
+ **************************************************************************/
+
+#include "AliGUIMaterial.h"
+
+ClassImp(AliGUIMaterial)
+
+AliGUIMaterial::AliGUIMaterial()
+{
+// Constructor
+ fId=-1;
+ fName = 0;
+ fA=-1;
+ fZ=-1;
+ fDensity=-1;
+ fRadl=-1;
+ fAbsl=-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;
+ fZ=z;
+ fDensity=dens;
+ fRadl=radl;
+ fAbsl=absl;
+}
+void AliGUIMaterial::Dump()
+{
+// Dump material information
+ printf("\n *****************************************");
+ printf("\n Material Number: %10d", fId);
+ printf("\n %s", fName);
+ printf("\n Mass Number: %10.2f", fA);
+ printf("\n Charge Number: %10.2f", fZ);
+ printf("\n Density: %10.2f", fDensity);
+ printf("\n Radiation Length: %10.2f", fRadl);
+ printf("\n Absorption Length: %10.2f", fAbsl);
+}
+
+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
+;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+#ifndef ALIGUIMATERIAL_H
+#define ALIGUIMATERIAL_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include "TObject.h"
+
+class AliGUIMaterial : public TObject
+{
+public:
+ AliGUIMaterial();
+ AliGUIMaterial(Int_t imat, char* name, Float_t a, Float_t z,
+ Float_t dens, Float_t radl, Float_t absl);
+ virtual ~AliGUIMaterial(){}
+ // Dump material parameters
+ virtual void Dump();
+ // Get material id
+ virtual Int_t Id();
+ // Get material name
+ virtual char* Name();
+ // Get mass number
+ virtual Float_t A();
+ // Get charge number
+ virtual Float_t Z();
+ // Get density
+ virtual Float_t Density();
+ // Get radiation length
+ virtual Float_t RadiationLength();
+ // Get absorption lenth
+ virtual Float_t AbsorptionLength();
+ // Plot
+ virtual void Plot();
+ // Set and get link to widget entry
+ virtual Int_t ItemId() {return fItem;}
+ virtual void SetItemId(Int_t id) {fItem=id;}
+private:
+ Int_t fId; // Id number of the material
+ char* fName; // name of the material
+ Float_t fA; // mass number of the material
+ Float_t fZ; // charge number of the material
+ Float_t fDensity; // density of the material
+ Float_t fRadl; // radiation length of the material
+ Float_t fAbsl; // absorption length
+ //
+ Int_t fItem; // Link to Widget Entry
+
+ AliGUIMaterial(const AliGUIMaterial &) {}
+ AliGUIMaterial &operator=(const AliGUIMaterial &) {return *this;}
+
+ ClassDef(AliGUIMaterial,1) // Material Object for GUI
+};
+
+#endif
+
+
+
+
+
+
+
+
--- /dev/null
+/* *************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.8 2000/07/12 08:56:32 fca
+Coding convention correction and warning removal
+
+Revision 1.7 2000/06/28 21:27:45 morsch
+Most coding rule violations corrected.
+Still to do: Split the file (on file per class) ? Avoid the global variables.
+Copy constructors and assignment operators (dummy ?)
+
+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
+
+Revision 1.4 2000/01/18 16:12:08 morsch
+Bug in calculation of number of volume divisions and number of positionings corrected
+Browser for Material and Media properties added
+
+Revision 1.3 1999/11/14 14:31:14 fca
+Correct small error and remove compilation warnings on HP
+
+Revision 1.2 1999/11/10 16:53:35 fca
+The new geometry viewer from A.Morsch
+
+*/
+
+/*
+ * Version: 0
+ * Written by Andreas Morsch
+ *
+ *
+ *
+ * For questions critics and suggestions to this part of the code
+ * contact andreas.morsch@cern.ch
+ *
+ **************************************************************************/
+
+#include "AliGUIMedium.h"
+
+ClassImp(AliGUIMedium)
+
+AliGUIMedium::AliGUIMedium()
+{
+// constructor
+ fId=-1;
+ fName = 0;
+}
+
+AliGUIMedium::AliGUIMedium(Int_t imed, Int_t imat, char* name, Int_t isvol,
+ Int_t ifield,
+ 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;
+ fIsvol=isvol;
+ fIfield=ifield;
+ fFieldm=fieldm;
+ fTmaxfd=tmaxfd;
+ fStemax=stemax;
+ fDeemax=deemax;
+ fEpsil=epsil;
+ fStmin=stmin;
+}
+
+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];
+ } else if(ipar >=23 && ipar <27) {
+ p= fPars[ipar-1+3];
+ } else {
+ p= fPars[ipar-1+4];
+ }
+
+ return p;
+}
+
+void AliGUIMedium::Streamer(TBuffer &)
+{
+// dummy streamer
+;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+#ifndef ALIGUIMEDIUM_H
+#define ALIGUIMEDIUM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include "TObject.h"
+
+const static Int_t kNPars=33;
+
+class AliGUIMedium : public TObject
+{
+public:
+ AliGUIMedium();
+ AliGUIMedium(Int_t imed, Int_t imat, char* name, Int_t isvol, Int_t ifield,
+ Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax,
+ Float_t epsil, Float_t stmin);
+
+ virtual ~AliGUIMedium(){;}
+ // Dump medium parameters
+ virtual void Dump();
+ // Get id
+ virtual Int_t Id();
+ // Get name
+ virtual char* Name();
+ // Get parameters
+ virtual Int_t IdMat() {return fIdMat;}
+ virtual Int_t Isvol() {return fIsvol;}
+ virtual Int_t Ifield() {return fIfield;}
+ virtual Float_t Fieldm() {return fFieldm;}
+ virtual Float_t Tmaxfd() {return fTmaxfd;}
+ virtual Float_t Stemax() {return fStemax;}
+ virtual Float_t Deemax() {return fDeemax;}
+ virtual Float_t Epsil() {return fEpsil;}
+ virtual Float_t Stmin() {return fStmin;}
+ virtual void SetPar(Int_t ipar, Float_t par) {fPars[ipar-1]=par;}
+ virtual Float_t GetPar(Int_t ipar);
+ // Set and get link to widget entry
+ virtual Int_t ItemId() {return fItem;}
+ virtual void SetItemId(Int_t id) {fItem=id;}
+
+ private:
+ Float_t fPars[kNPars]; // special medium parameters
+ Int_t fId; // Id number of the Medium
+ Int_t fIdMat; // Associated material
+ char* fName; // Name of the Medium
+ Int_t fIsvol; // Sensitivity flag
+ Int_t fIfield; // Magnetic Field Flag
+ Float_t fFieldm; // Maximum Field Strength
+ Float_t fTmaxfd; // Max. Ang. Deviation
+ Float_t fStemax; // Maximum Step
+ Float_t fDeemax; // Max. Frac. Energy Loss",
+ Float_t fEpsil; // Crossing Precission
+ Float_t fStmin; // Minimum Step Size
+ //
+ Int_t fItem; // Link to Widget Entry
+
+ AliGUIMedium(const AliGUIMedium&) {}
+ AliGUIMedium & operator=(const AliGUIMedium&) {return *this;}
+
+ ClassDef(AliGUIMedium,1) // Tracking Medium Object for GUI
+};
+
+#endif
--- /dev/null
+/* *************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.8 2000/07/12 08:56:32 fca
+Coding convention correction and warning removal
+
+Revision 1.7 2000/06/28 21:27:45 morsch
+Most coding rule violations corrected.
+Still to do: Split the file (on file per class) ? Avoid the global variables.
+Copy constructors and assignment operators (dummy ?)
+
+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
+
+Revision 1.4 2000/01/18 16:12:08 morsch
+Bug in calculation of number of volume divisions and number of positionings corrected
+Browser for Material and Media properties added
+
+Revision 1.3 1999/11/14 14:31:14 fca
+Correct small error and remove compilation warnings on HP
+
+Revision 1.2 1999/11/10 16:53:35 fca
+The new geometry viewer from A.Morsch
+
+*/
+
+#include <stdlib.h>
+
+#include "AliGUISliders.h"
+#include "AliDrawVolume.h"
+
+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};
+static Int_t DefaultPos[7] = { 3000, 4000, 0, 1000, 1000, 1, 1};
+
+AliGUISliders::AliGUISliders(const TGWindow *p, const TGWindow *,
+ 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);
+
+ //--- layout for the frame: place at bottom, right aligned
+ fBfly1 = new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
+//
+// Frames
+
+ for (Int_t i=0; i<7; i++) {
+ Int_t idT=i+1;
+ Int_t idS=i+8;
+ fHframe[i] = new TGHorizontalFrame(this, 400, 100, kFixedWidth);
+ fTbh[i] = new TGTextBuffer(10);
+ fTeh[i] = new TGTextEntry(fHframe[i], fTbh[i],idT);
+ char buf[10];
+ sprintf(buf, "%6.2f", Float_t(DefaultPos[i])/100);
+ fTbh[i]->AddText(0, buf);
+ fTeh[i]->Associate(this);
+
+ fHslider[i] = new TGHSlider(fHframe[i], 400, kSlider1 | kScaleBoth, idS);
+ fHslider[i]->Associate(this);
+ fHslider[i]->SetRange(IRangeMin[i], IRangeMax[i]);
+ fHslider[i]->SetPosition(DefaultPos[i]);
+
+ fLabel[i] = new TGLabel(fHframe[i], kLabelText[i]);
+
+
+ fHframe[i]->AddFrame(fLabel[i], fBfly1);
+ fHframe[i]->AddFrame(fTeh[i], fBfly1);
+ fHframe[i]->AddFrame(fHslider[i], fBfly1);
+ AddFrame(fHframe[i], fBly);
+ }
+}
+
+AliGUISliders::~AliGUISliders()
+{
+// Destructor
+ delete fBfly1; delete fBly;
+ // Delete dialog.
+ for (Int_t i=1; i<7; i++) {
+ delete fHframe[i];
+ delete fHslider[i];
+ delete fTeh[i];
+ delete fTbh[i];
+ }
+}
+
+void AliGUISliders::Update()
+{
+// Update sliders
+ char buf[10];
+
+ for (Int_t i=0; i<7; i++) {
+ Float_t param = gCurrentVolume->GetParam(i);
+//
+ fHslider[i]->SetPosition(Int_t(param*100.));
+ gClient->NeedRedraw(fHslider[i]);
+//
+ sprintf(buf, "%6.2f", param);
+ fTbh[i]->Clear();
+ fTbh[i]->AddText(0, buf);
+ gClient->NeedRedraw(fTeh[i]);
+//
+ }
+
+
+}
+
+void AliGUISliders::CloseWindow()
+{
+ // Called when window is closed via the window manager.
+
+ delete this;
+}
+
+Bool_t AliGUISliders::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+{
+ // Process slider messages.
+
+ char buf[10];
+
+ switch (GET_MSG(msg)) {
+ case kC_TEXTENTRY:
+ switch (GET_SUBMSG(msg)) {
+ case kTE_TEXTCHANGED:
+ Int_t idT=Int_t(parm1)-1;
+ fHslider[idT]->SetPosition((Int_t)atof(fTbh[idT]->GetString())*100);
+ gClient->NeedRedraw(fHslider[idT]);
+ gCurrentVolume->SetParam(idT,atof(fTbh[idT]->GetString()));
+ gCurrentVolume->Draw();
+ }
+ break;
+ case kC_HSLIDER:
+ switch (GET_SUBMSG(msg)) {
+ case kSL_POS:
+ sprintf(buf, "%6.2f", Float_t(parm2)/100);
+ Int_t idS=Int_t(parm1)-8;
+ fTbh[idS]->Clear();
+ fTbh[idS]->AddText(0, buf);
+ gClient->NeedRedraw(fTeh[idS]);
+ gCurrentVolume->SetParam(idS, Float_t(parm2)/100.);
+ gCurrentVolume->Draw();
+ }
+ break;
+ }
+ return kTRUE;
+}
+
--- /dev/null
+#ifndef ALIGUISLIDERS_H
+#define ALIGUISLIDERS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include "TGFrame.h"
+#include "TGSlider.h"
+#include "TGTextEntry.h"
+#include "TGTextBuffer.h"
+#include "TGLabel.h"
+
+class AliDrawVolume;
+
+class AliGUISliders : public TGCompositeFrame {
+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
+
+ AliGUISliders(const AliGUISliders &gs) :
+ TGCompositeFrame((const TGCompositeFrame&) gs) {}
+ AliGUISliders & operator=(const AliGUISliders &) {return *this;}
+
+
+ // ClassDef(AliGUISliders,1) // Window containing sliders
+};
+
+R__EXTERN AliDrawVolume *gCurrentVolume;
+
+#endif
/*
$Log$
+Revision 1.6 2000/07/11 18:24:59 fca
+Coding convention corrections + few minor bug fixes
+
Revision 1.5 2000/05/20 14:49:48 fca
Call gdebug at the end of gustep
AliGeant3::AliGeant3(const char *title) :
TGeant3(title) {}
+//____________________________________________________________________________
void AliGeant3::FinishGeometry()
{
+ //
+ // Finalise geometry construction
+ //
TGeant3::FinishGeometry();
//Create the color table
SetColors();
{
//
//=================Create Materials and geometry
+ //
TObjArray *modules = gAlice->Modules();
TIter next(modules);
AliModule *detector;
//____________________________________________________________________________
void AliGeant3::ProcessRun(Int_t nevent)
{
+ //
+ // Process the run
+ //
Int_t todo = TMath::Abs(nevent);
for (Int_t i=0; i<todo; i++) {
// Process one run (one run = one event)
}
}
+//_____________________________________________________________________________
void AliGeant3::ProcessEvent()
{
+ //
+ // Process one event
+ //
Gtrigi();
Gtrigc();
Gtrig();
Int_t ipp, jk, id, nt;
Float_t polar[3]={0,0,0};
Float_t mom[3];
- const char *chproc;
+ const char *kChproc;
TGeant3* geant3 = (TGeant3*) gMC;
// --- Add new created particles
if (gMC->NSecondaries() > 0) {
- chproc=gMC->ProdProcess();
+ kChproc=gMC->ProdProcess();
for (jk = 0; jk < geant3->Gcking()->ngkine; ++jk) {
ipp = Int_t (geant3->Gcking()->gkin[jk][4]+0.5);
// --- Skip neutrinos!
if (ipp != 4) {
gAlice->SetTrack(1,gAlice->CurrentTrack(),gMC->PDGFromId(ipp), geant3->Gcking()->gkin[jk],
- geant3->Gckin3()->gpos[jk], polar,geant3->Gctrak()->tofg, chproc, nt);
+ geant3->Gckin3()->gpos[jk], polar,geant3->Gctrak()->tofg, kChproc, nt);
}
}
}
class AliGeant3 : public TGeant3
{
-private:
-
public:
AliGeant3(const char *title);
AliGeant3() {}
virtual void ProcessEvent();
virtual void ProcessRun(Int_t nevent);
+private:
+
ClassDef(AliGeant3,1) //Generic MonteCarlo Class
};
--- /dev/null
+/* *************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.8 2000/07/12 08:56:32 fca
+Coding convention correction and warning removal
+
+Revision 1.7 2000/06/28 21:27:45 morsch
+Most coding rule violations corrected.
+Still to do: Split the file (on file per class) ? Avoid the global variables.
+Copy constructors and assignment operators (dummy ?)
+
+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
+
+Revision 1.4 2000/01/18 16:12:08 morsch
+Bug in calculation of number of volume divisions and number of positionings corrected
+Browser for Material and Media properties added
+
+Revision 1.3 1999/11/14 14:31:14 fca
+Correct small error and remove compilation warnings on HP
+
+Revision 1.2 1999/11/10 16:53:35 fca
+The new geometry viewer from A.Morsch
+
+*/
+
+/*
+ * Version: 0
+ * Written by Andreas Morsch
+ *
+ *
+ *
+ * For questions critics and suggestions to this part of the code
+ * contact andreas.morsch@cern.ch
+ *
+ **************************************************************************/
+
+
+#include "AliGeant3GeometryGUI.h"
+#include "AliDrawVolume.h"
+#include "AliGUIMaterial.h"
+#include "AliGUIMedium.h"
+#include "AliGuiGeomMain.h"
+
+AliDrawVolume *gCurrentVolume = new AliDrawVolume("NULL");
+AliGUIMaterial *gCurrentMaterial = new AliGUIMaterial();
+AliGUIMedium *gCurrentMedium = new AliGUIMedium();
+
+ClassImp(AliGeant3GeometryGUI)
+
+ AliGeant3GeometryGUI::AliGeant3GeometryGUI()
+{
+// Constructor
+ fPanel = new AliGuiGeomMain(gClient->GetRoot(), 500, 500);
+ fNstack = 0;
+ fVolumes = new TClonesArray("AliDrawVolume",1000);
+ fMaterials = new TClonesArray("AliGUIMaterial",1000);
+ fMedia = new TClonesArray("AliGUIMedium",1000);
+// Store local copy of zebra bank entries
+ TGeant3 *geant3 = (TGeant3*) gMC;
+ if (geant3) {
+ fZlq=geant3->Lq();
+ fZq=geant3->Q();
+ fZiq=geant3->Iq();
+ fGclink=geant3->Gclink();
+ fGcnum=geant3->Gcnum();
+//
+ ReadGeometryTree();
+ ReadMaterials();
+ }
+}
+void AliGeant3GeometryGUI::Streamer(TBuffer &)
+{
+// Dummy Streamer
+;
+}
+
+
+void AliGeant3GeometryGUI::ReadGeometryTree()
+{
+//
+// Copy zebra volume tree into ROOT LisTree
+//
+ char *vname;
+ char /* *namec, */ *tmp;
+ char namec[30];
+// Icons for
+// Closed folder (=volume containing children)
+ const TGPicture* kFolder = gClient->GetPicture("folder_t.xpm");
+// Open folder (=volume containing children)
+ const TGPicture* kOpenFolder = gClient->GetPicture("ofolder_t.xpm");
+// Empty object
+ const TGPicture* kDocument = gClient->GetPicture("doc_t.xpm");
+
+ AliDrawVolume *volume;
+
+ Int_t nst=0;
+ Int_t nlevel=1;
+ Int_t newlevel=nlevel;
+
+ volume = new AliDrawVolume("ALIC");
+ volume->SetIdVolume(((TGeant3*)gMC)->VolId("ALIC"));
+ volume->SetIdCopy(0);
+ volume->SetItem(NULL);
+ (*fVolumes)[0]=volume;
+//
+// Loop over volumes for which information has been collected
+ while(nlevel>nst) {
+ for (Int_t i=nst; i<nlevel; i++)
+ {
+ TGListTreeItem *itemi, *item2;
+// GEANT3 volume number
+ Int_t ivol=TMath::Abs(Volume(i)->GetIdVolume());
+// Copy number
+// icopy=1 normal positioning
+// icopy>1 positioning with parposp
+// icopy<0 division
+ Int_t icopy = Volume(i)->GetIdCopy();
+// Medium and material number, handle special case of divisions
+ Int_t imat, imed;
+
+ if (icopy <0) {
+ imed=Medium(-ivol);
+ imat=Material(-ivol);
+ } else {
+ imed=Medium(ivol);
+ imat=Material(ivol);
+ }
+//
+// Number of children
+ Int_t nch = NChildren(ivol);
+ strcpy(namec,((TGeant3*)gMC)->VolName(ivol));
+ if (nch >= 0) {
+ printf("\n %s has %d children \n ", namec, nch);
+ } else {
+ printf("\n %s has divisions \n ", namec);
+ }
+//
+// Name to be used in ListTree
+ vname = new char[5];
+ strncpy(vname,namec, 4);
+ vname[4]='\0';
+
+ if (icopy >1) {
+ sprintf(namec,"%s*%3dPos",namec,icopy);
+ } else if (icopy <0) {
+ sprintf(namec,"%s*%3dDiv",namec,-icopy);
+ }
+ if (i>0) {
+ itemi=Volume(i)->GetItem();
+ } else {
+ itemi=NULL;
+ }
+
+//
+// Add volume to list tree
+
+ if (nch!=0) {
+ item2 = fPanel->AddItem(new AliDrawVolume(vname),
+ itemi, namec, kOpenFolder, kFolder);
+ } else {
+ item2 = fPanel->AddItem(new AliDrawVolume(vname),
+ itemi, namec, kDocument, kDocument);
+ }
+//
+// Add medium information to list tree item
+ ((AliDrawVolume *) item2->GetUserData())->SetIdVolume(ivol);
+ ((AliDrawVolume *) item2->GetUserData())->SetIdMaterial(imat);
+ ((AliDrawVolume *) item2->GetUserData())->SetIdMedium(imed);
+//
+// Set current volume to first list tree entry
+ if (!i) gCurrentVolume= ((AliDrawVolume *) item2->GetUserData());
+
+//
+// Collect children information
+//
+// nch < 0: Children by division
+ if (nch < 0) {
+//
+// Geant volume number
+ Int_t icvol=Child(ivol,1);
+// Name
+ strcpy(namec,((TGeant3*)gMC)->VolName(-icvol));
+ tmp = new char[4];
+ strncpy(tmp,(char *) &namec, 4);
+ volume = new AliDrawVolume(namec);
+ volume->SetIdVolume(-icvol);
+// Number of divisions
+ Int_t jvo = fZlq[fGclink->jvolum-ivol];
+ Int_t jdiv = fZlq[jvo-1];
+ Int_t ndiv = Int_t (fZq[jdiv+3]);
+ volume->SetIdCopy(-ndiv);
+// Link to mother
+ volume->SetItem(item2);
+ (*fVolumes)[newlevel]=volume;
+ printf("\n volume %s %d %d %d", namec, icvol, nch, ndiv);
+ newlevel++;
+//
+// Children by positioning
+ } else {
+ Int_t nnew=0;
+// Loop over children
+ for (Int_t j=0; j<nch; j++)
+ {
+//
+// Find out if this volume was already positioned and count copies
+ Int_t icvol=Child(ivol,j+1);
+ icvol = TMath::Abs(icvol);
+ Bool_t inList=kFALSE;
+ for (Int_t k=0; k<nnew; k++) {
+ if (icvol==
+ Volume(newlevel-k-1)->GetIdVolume())
+ {
+ Volume(newlevel-k-1)->AddCopy();
+ inList=kTRUE;
+ }
+ }
+//
+// New child
+ if (!inList) {
+//
+// Name
+ strcpy(namec,((TGeant3*)gMC)->VolName(icvol));
+ tmp = new char[4];
+ strncpy(tmp,(char *) &namec, 4);
+ volume = new AliDrawVolume(namec);
+ volume->SetIdVolume(icvol);
+ volume->SetIdCopy(1);
+// Link to mother
+ volume->SetItem(item2);
+ (*fVolumes)[newlevel]=volume;
+ printf("\n volume %s %d %d", namec, icvol, nch);
+ newlevel++;
+ nnew++;
+ }
+ }
+ }
+ }
+// Move one level deaper
+ nst=nlevel;
+ nlevel=newlevel;
+ }
+}
+
+void AliGeant3GeometryGUI::ReadMaterials()
+{
+//
+// Puts media and material names into ComboBox and
+// collects material information
+//
+ Float_t a, z, dens, radl, absl;
+ a=z=dens=radl=absl=-1;
+ Int_t npar=0;
+ Int_t imat, isvol, ifield;
+ Float_t fieldm, tmaxfd, stemax, deemax, epsil, stmin;
+ Float_t par[50];
+ Float_t ubuf[50];
+ Int_t nwbuf;
+
+ char natmed[21], namate[21];
+//
+// Loop over media
+ Int_t nEntries=0;
+
+ for(Int_t itm=1;itm<=fGcnum->ntmed;itm++) {
+ Int_t jtm = fZlq[fGclink->jtmed-itm];
+ if (jtm > 0) {
+ nEntries++;
+//
+// Get medium parameters
+ ((TGeant3*)(gMC))->Gftmed(itm, natmed, imat, isvol, ifield, fieldm,
+ tmaxfd, stemax, deemax, epsil, stmin, ubuf, &nwbuf);
+ strncpy(natmed,(char*)&fZiq[jtm+1],20);
+ natmed[20]='\0';
+//
+// Create new medium object
+ AliGUIMedium * medium =
+ new AliGUIMedium(itm, imat, natmed, isvol, ifield, fieldm,
+ tmaxfd, stemax, deemax, epsil, stmin);
+ (*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
+ { //Begin local scope for j
+ for (Int_t j=23; j<=26; j++) {
+ medium->SetPar(j,Cut(itm,j+3));
+ }
+ } //End local scope for j
+ { //Begin local scope for j
+ for (Int_t j=27; j<=29; j++) {
+ medium->SetPar(j,Cut(itm,j+4));
+ }
+ } //End local scope for j
+//
+// Add to ComboBox
+ fPanel->AddMedium(medium, nEntries);
+//
+// Associated material
+ imat = Int_t (fZq[jtm+6]);
+ Int_t jma = Int_t (fZlq[fGclink->jmate-imat]);
+//
+// Get material parameters
+ ((TGeant3*)(gMC))->Gfmate (imat,namate,a,z,dens,radl,absl,par,npar);
+ strncpy(namate,(char *)&fZiq[jma+1],20);
+ namate[20]='\0';
+//
+// Create new material object
+ AliGUIMaterial * material =
+ new AliGUIMaterial(imat,namate,a,z,dens,radl,absl);
+ (*fMaterials)[nEntries-1]=material;
+ material->Dump();
+//
+// Add to combo box
+ fPanel->AddMaterial(material, nEntries);
+ gCurrentMaterial=material;
+ }
+ }
+ fPanel->SetComboEntries(fMaterials);
+ fPanel->SetMediaComboEntries(fMedia);
+ fPanel->Update();
+}
+
+Int_t AliGeant3GeometryGUI::NChildren(Int_t idvol)
+{
+//
+// Return number of children for volume idvol
+ Int_t jvo = fZlq[fGclink->jvolum-idvol];
+ Int_t nin = Int_t(fZq[jvo+3]);
+ return nin;
+}
+
+Int_t AliGeant3GeometryGUI::Child(Int_t idvol, Int_t idc)
+{
+//
+// Return GEANT id of child number idc of volume idvol
+ Int_t jvo = fZlq[fGclink->jvolum-idvol];
+ Int_t nin=idc;
+ Int_t jin = fZlq[jvo-nin];
+ Int_t numb = Int_t (fZq[jin +3]);
+ if (numb > 1) {
+ return -Int_t(fZq[jin+2]);
+ } else {
+ return Int_t(fZq[jin+2]);
+ }
+}
+
+Int_t AliGeant3GeometryGUI::Medium(Int_t idvol)
+{
+//
+// Return medium number for volume idvol.
+// If idvol is negative the volume results from a division.
+ Int_t imed;
+ if (idvol > 0) {
+ Int_t jvo = fZlq[fGclink->jvolum-idvol];
+ imed = Int_t(fZq[jvo+4]);
+ } else {
+ idvol=-idvol;
+ Int_t jdiv = fZlq[fGclink->jvolum-idvol];
+ Int_t ivin = Int_t ( fZq[jdiv+2]);
+ Int_t jvin = fZlq[fGclink->jvolum-ivin];
+ imed = Int_t (fZq[jvin+4]);
+ }
+ return imed;
+}
+
+Int_t AliGeant3GeometryGUI::Material(Int_t idvol)
+{
+// Return material number for volume idvol.
+// If idvol is negative the volume results from a division.
+
+ Int_t imed=Medium(idvol);
+ Int_t jtm = fZlq[fGclink->jtmed-imed];
+ return Int_t (fZq[jtm+6]);
+}
+
+
+Float_t AliGeant3GeometryGUI::Cut(Int_t imed, Int_t icut)
+{
+// Return cuts icut for medium idmed
+//
+ Int_t jtm = fZlq[fGclink->jtmed-imed];
+//
+// Have the defaults been modified ??
+ Int_t jtmn = fZlq[jtm];
+ if (jtmn >0) {
+ jtm=jtmn;
+
+ } else {
+ jtm=fGclink->jtmed;
+ }
+
+ return Float_t (fZq[jtm+icut]);
+}
+
+
--- /dev/null
+#ifndef ALIGEANT3GEOMETRYGUI_H
+#define ALIGEANT3GEOMETRYGUI_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+
+#include "TClonesArray.h"
+#include "TGeant3.h"
+
+class AliGuiGeomMain;
+class AliDrawVolume;
+
+class AliGeant3GeometryGUI : public TObject {
+ 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));}
+ // Return number of children for volume idvol
+ Int_t NChildren(Int_t idvol);
+ // Return child number idc of volume idvol
+ Int_t Child(Int_t idvol, Int_t idc);
+ // Return medium number for given volume idvol
+ Int_t Medium(Int_t idvol);
+ // Return material number for given volume idvol
+ Int_t Material(Int_t idvol);
+ //
+
+ AliGeant3GeometryGUI(const AliGeant3GeometryGUI&) {}
+ AliGeant3GeometryGUI & operator=(const AliGeant3GeometryGUI&)
+ {return *this;}
+
+ ClassDef(AliGeant3GeometryGUI,1) // GUI for Geant3 geometry visualisation
+};
+
+
+
+#endif
--- /dev/null
+/* *************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.8 2000/07/12 08:56:32 fca
+Coding convention correction and warning removal
+
+Revision 1.7 2000/06/28 21:27:45 morsch
+Most coding rule violations corrected.
+Still to do: Split the file (on file per class) ? Avoid the global variables.
+Copy constructors and assignment operators (dummy ?)
+
+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
+
+Revision 1.4 2000/01/18 16:12:08 morsch
+Bug in calculation of number of volume divisions and number of positionings corrected
+Browser for Material and Media properties added
+
+Revision 1.3 1999/11/14 14:31:14 fca
+Correct small error and remove compilation warnings on HP
+
+Revision 1.2 1999/11/10 16:53:35 fca
+The new geometry viewer from A.Morsch
+
+*/
+
+#include "TGButton.h"
+#include "TGTab.h"
+#include "TGComboBox.h"
+#include "TGDoubleSlider.h"
+
+#include "AliGuiGeomDialog.h"
+#include "AliGUISliders.h"
+#include "AliDrawVolume.h"
+
+AliGuiGeomDialog::AliGuiGeomDialog(const TGWindow *p, const TGWindow *main, UInt_t w,
+ UInt_t h, UInt_t options)
+ : TGTransientFrame(p, main, w, h, options)
+{
+ // Create a dialog window. A dialog window pops up with respect to its
+ // "main" window.
+
+ fFrame1 = new TGHorizontalFrame(this, 60, 20, kFixedWidth);
+
+ fOkButton = new TGTextButton(fFrame1, "&Ok", 1);
+ fOkButton->Associate(this);
+ fCancelButton = new TGTextButton(fFrame1, "&Cancel", 2);
+ fCancelButton->Associate(this);
+
+ fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
+ 2, 2, 2, 2);
+ fL2 = new TGLayoutHints(kLHintsBottom | kLHintsRight, 2, 2, 5, 1);
+
+ fFrame1->AddFrame(fOkButton, fL1);
+ fFrame1->AddFrame(fCancelButton, fL1);
+
+ fFrame1->Resize(150, fOkButton->GetDefaultHeight());
+ AddFrame(fFrame1, fL2);
+
+ //--------- create Tab widget and some composite frames for Tab testing
+
+ fTab = new TGTab(this, 300, 300);
+ fL3 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
+//
+// Tab1: Sliders
+//
+ TGCompositeFrame *tf = fTab->AddTab("Draw");
+ fF1 = new AliGUISliders(tf, this, 60, 20);
+ tf->AddFrame(fF1,fL3);
+
+//
+// Tab2: Drawing Options
+//
+ tf = fTab->AddTab("Options");
+ fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
+ 200, 2, 2, 2);
+ fF2 = new TGCompositeFrame(tf, 60, 20, kVerticalFrame);
+
+ fF2->AddFrame(fChk1 = new TGCheckButton(fF2, "Shadow", 86), fL3);
+ fF2->AddFrame(fChk2 = new TGCheckButton(fF2, "Hide ", 87), fL3);
+ fF2->AddFrame(fChk3 = new TGCheckButton(fF2, "Clip ", 88), fL3);
+
+ fF2->AddFrame(fLabel1 = new TGLabel(fF2, "Fill"),fL3);
+
+ fCombo = new TGComboBox(fF2, 89);
+ fF2->AddFrame(fCombo, fL3);
+
+ tf->AddFrame(fF2, fL3);
+
+ int i;
+ for (i = 0; i < 8; i++) {
+ char tmp[20];
+
+ sprintf(tmp, "%i", i+1);
+ fCombo->AddEntry(tmp, i+1);
+ }
+ fCombo->Select(1);
+ fCombo->Resize(50, 20);
+ fCombo->Associate(this);
+
+ fChk1->Associate(this);
+ fChk2->Associate(this);
+ fChk3->Associate(this);
+//
+// Tab3: Seen Option
+//
+ tf = fTab->AddTab("Seen");
+ fF3 = new TGCompositeFrame(tf, 60, 20, kVerticalFrame);
+ fF3->AddFrame(fLabel2 = new TGLabel(fF3, "Seen"),fL3);
+ fCombo2 = new TGComboBox(fF3, 90);
+ fF3->AddFrame(fCombo2, fL3);
+ tf->AddFrame(fF3, fL3);
+
+ for (i = 0; i < 4; i++) {
+ char tmp[20];
+
+ sprintf(tmp, "%i", i-2);
+ fCombo2->AddEntry(tmp, i+1);
+ }
+ fCombo2->Select(4);
+ fCombo2->Resize(50, 20);
+ fCombo2->Associate(this);
+//
+// Tab4: Clip Box
+//
+ tf = fTab->AddTab("ClipBox");
+ //--- layout for buttons: top align, equally expand horizontally
+ fBly = new TGLayoutHints(kLHintsTop | kLHintsExpandY, 5, 5, 5, 5);
+
+ //--- layout for the frame: place at bottom, right aligned
+ fBfly1 = new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
+//
+// Frames
+//
+// Slider1
+ fF4 = new TGCompositeFrame(tf, 60, 20, kVerticalFrame);
+
+ fHSframe1 = new TGHorizontalFrame(fF4, 400, 100, kFixedWidth);
+
+ fTbh11 = new TGTextBuffer(10);
+ fTeh11 = new TGTextEntry(fHSframe1, fTbh11,1);
+ fTbh11->AddText(0, " 0");
+ fTeh11->Associate(this);
+
+ fTbh12 = new TGTextBuffer(10);
+ fTeh12 = new TGTextEntry(fHSframe1, fTbh12,1);
+ fTbh12->AddText(0, "2000");
+ fTeh12->Associate(this);
+
+ fDslider1 = new TGDoubleHSlider(fHSframe1, 400, kSlider1 | kScaleBoth, 1);
+ fDslider1->Associate(this);
+ fDslider1->SetRange(-2000, 2000);
+ fDslider1->SetPosition(0, 2000);
+
+ fSLabel1 = new TGLabel(fHSframe1, "xmin-xmax");
+
+ fHSframe1->AddFrame(fSLabel1, fBfly1);
+ fHSframe1->AddFrame(fTeh11, fBfly1);
+ fHSframe1->AddFrame(fTeh12, fBfly1);
+ fHSframe1->AddFrame(fDslider1, fBfly1);
+
+ fF4->AddFrame(fHSframe1, fBly);
+
+//
+ fHSframe2 = new TGHorizontalFrame(fF4, 400, 100, kFixedWidth);
+
+ fTbh21 = new TGTextBuffer(10);
+ fTeh21 = new TGTextEntry(fHSframe2, fTbh21,1);
+ fTbh21->AddText(0, " 0");
+ fTeh21->Associate(this);
+
+ fTbh22 = new TGTextBuffer(10);
+ fTeh22 = new TGTextEntry(fHSframe2, fTbh22,1);
+ fTbh22->AddText(0, "2000");
+ fTeh22->Associate(this);
+
+ fDslider2 = new TGDoubleHSlider(fHSframe2, 400, kSlider1 | kScaleBoth, 2);
+ fDslider2->Associate(this);
+ fDslider2->SetRange(-2000, 2000);
+ fDslider2->SetPosition(0, 2000);
+
+ fSLabel2 = new TGLabel(fHSframe2, "ymin-ymax");
+
+ fHSframe2->AddFrame(fSLabel2, fBfly1);
+ fHSframe2->AddFrame(fTeh21, fBfly1);
+ fHSframe2->AddFrame(fTeh22, fBfly1);
+ fHSframe2->AddFrame(fDslider2, fBfly1);
+
+ fF4->AddFrame(fHSframe2, fBly);
+
+//
+ fHSframe3 = new TGHorizontalFrame(fF4, 400, 100, kFixedWidth);
+
+ fTbh31 = new TGTextBuffer(10);
+ fTeh31 = new TGTextEntry(fHSframe3, fTbh31,1);
+ fTbh31->AddText(0, " 0");
+ fTeh31->Associate(this);
+
+ fTbh32 = new TGTextBuffer(10);
+ fTeh32 = new TGTextEntry(fHSframe3, fTbh32,1);
+ fTbh32->AddText(0, "2000");
+ fTeh32->Associate(this);
+
+ fDslider3 = new TGDoubleHSlider(fHSframe3, 400, kSlider1 | kScaleBoth, 3);
+ fDslider3->Associate(this);
+ fDslider3->SetRange(-2000, 2000);
+ fDslider3->SetPosition(0, 2000);
+
+ fSLabel3 = new TGLabel(fHSframe3, "zmin-zmax");
+
+ fHSframe3->AddFrame(fSLabel3, fBfly1);
+ fHSframe3->AddFrame(fTeh31, fBfly1);
+ fHSframe3->AddFrame(fTeh32, fBfly1);
+ fHSframe3->AddFrame(fDslider3, fBfly1);
+
+ fF4->AddFrame(fHSframe3, fBly);
+ tf->AddFrame(fF4, fL3);
+//
+//
+ TGLayoutHints *fL5 = new TGLayoutHints(kLHintsBottom | kLHintsExpandX |
+ kLHintsExpandY, 2, 2, 5, 1);
+ AddFrame(fTab, fL5);
+
+ MapSubwindows();
+ Resize(GetDefaultSize());
+
+ // position relative to the parent's window
+ Window_t wdum;
+ int ax, ay;
+ gVirtualX->TranslateCoordinates(main->GetId(), GetParent()->GetId(),
+ (((TGFrame *) main)->GetWidth() - fWidth) >> 1,
+ (((TGFrame *) main)->GetHeight() - fHeight) >> 1,
+ ax, ay, wdum);
+ Move(ax, ay);
+
+ SetWindowName("Dialog");
+
+ MapWindow();
+ //gClient->WaitFor(this); // otherwise canvas contextmenu does not work
+}
+
+AliGuiGeomDialog::~AliGuiGeomDialog()
+{
+ // Delete test dialog widgets.
+
+ delete fOkButton;
+ delete fCancelButton;
+ delete fFrame1;
+ delete fChk1; delete fChk2;
+ delete fF1; delete fF2; delete fF3; delete fF4;
+ delete fCombo;
+ delete fTab;
+ delete fL3; delete fL4;
+ delete fL1; delete fL2;
+ delete fBly; delete fBfly1;
+ delete fTbh11; delete fTbh12; delete fTbh21; delete fTbh22;
+ delete fTbh31; delete fTbh32; delete fTeh11; delete fTeh12;
+ delete fTeh21; delete fTeh22; delete fTeh31; delete fTeh32;
+ delete fDslider1; delete fDslider2; delete fDslider3;
+ delete fSLabel1; delete fSLabel2; delete fSLabel3;
+}
+
+void AliGuiGeomDialog::Update()
+{
+// Update widgets
+
+ Float_t param;
+// Update Sliders
+ if (fF1) {
+ fF1->Update();
+ }
+// Seen
+ if (fCombo2) {
+ param=gCurrentVolume->GetParam(kSeen);
+ fCombo2->Select(Int_t(param)+3);
+ }
+// Hide, Shadow, Clip
+ if (fChk1) {
+ if (Int_t(gCurrentVolume->GetParam(kShadow))) {
+ fChk1->SetState(kButtonDown);
+ } else {
+ fChk1->SetState(kButtonUp);
+ }
+ }
+
+ if (fChk2) {
+ if (Int_t(gCurrentVolume->GetParam(kHide))) {
+ fChk2->SetState(kButtonDown);
+ } else {
+ fChk2->SetState(kButtonUp);
+ }
+ }
+
+ if (fChk3) {
+ if (Int_t(gCurrentVolume->GetParam(kClip))) {
+ fChk3->SetState(kButtonDown);
+ } else {
+ fChk3->SetState(kButtonUp);
+ }
+ }
+
+}
+
+void AliGuiGeomDialog::CloseWindow()
+{
+ // Called when window is closed via the window manager.
+ delete this;
+}
+
+Bool_t AliGuiGeomDialog::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+{
+ // Process messages coming from widgets associated with the dialog.
+ char buf[10];
+ Float_t min,max;
+ switch (GET_MSG(msg)) {
+ case kC_HSLIDER:
+ switch (GET_SUBMSG(msg)) {
+ case kSL_POS:
+ switch (Int_t(parm1)) {
+ case 1:
+ min=fDslider1->GetMinPosition();
+ max=fDslider1->GetMaxPosition();
+ sprintf(buf, "%6.2f", min);
+ fTbh11->Clear();
+ fTbh11->AddText(0, buf);
+ sprintf(buf, "%6.2f", max);
+ fTbh12->Clear();
+ fTbh12->AddText(0, buf);
+ gClient->NeedRedraw(fTeh11);
+ gClient->NeedRedraw(fTeh12);
+ gCurrentVolume->SetParam(kClipXmin,min);
+ gCurrentVolume->SetParam(kClipXmax,max);
+ break;
+ case 2:
+ min=fDslider2->GetMinPosition();
+ max=fDslider2->GetMaxPosition();
+ sprintf(buf, "%6.2f", min);
+ fTbh21->Clear();
+ fTbh21->AddText(0, buf);
+ sprintf(buf, "%6.2f", max);
+ fTbh22->Clear();
+ fTbh22->AddText(0, buf);
+ gClient->NeedRedraw(fTeh21);
+ gClient->NeedRedraw(fTeh22);
+ gCurrentVolume->SetParam(kClipYmin,min);
+ gCurrentVolume->SetParam(kClipYmax,max);
+ break;
+ case 3:
+ min=fDslider3->GetMinPosition();
+ max=fDslider3->GetMaxPosition();
+ sprintf(buf, "%6.2f", min);
+ fTbh31->Clear();
+ fTbh31->AddText(0, buf);
+ sprintf(buf, "%6.2f", max);
+ fTbh32->Clear();
+ fTbh32->AddText(0, buf);
+ gClient->NeedRedraw(fTeh31);
+ gClient->NeedRedraw(fTeh32);
+ gCurrentVolume->SetParam(kClipZmin,min);
+ gCurrentVolume->SetParam(kClipZmax,max);
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case kC_COMMAND:
+ switch (GET_SUBMSG(msg)) {
+ case kCM_BUTTON:
+ switch(parm1) {
+ case 1:
+ case 2:
+ printf("\nTerminating dialog: %s pressed\n",
+ (parm1 == 1) ? "OK" : "Cancel");
+ CloseWindow();
+ break;
+ }
+ break;
+ case kCM_COMBOBOX:
+ switch(parm1) {
+ case 89:
+ gCurrentVolume->SetParam(kFill, Float_t(parm2));
+ gCurrentVolume->Draw();
+ break;
+ case 90:
+ gCurrentVolume->SetParam(kSeen, Float_t(parm2-3));
+ gCurrentVolume->Draw();
+ break;
+ }
+ break;
+ case kCM_CHECKBUTTON:
+ switch (parm1) {
+ case 86:
+ if (Int_t(gCurrentVolume->GetParam(kShadow))) {
+ gCurrentVolume->SetParam(kShadow, 0.);
+ } else {
+ gCurrentVolume->SetParam(kShadow, 1.);
+ }
+ gCurrentVolume->Draw();
+ break;
+ case 87:
+ if (Int_t(gCurrentVolume->GetParam(kHide))) {
+ gCurrentVolume->SetParam(kHide, 0.);
+ } else {
+ gCurrentVolume->SetParam(kHide, 1.);
+ }
+ gCurrentVolume->Draw();
+ break;
+ case 88:
+ if (Int_t(gCurrentVolume->GetParam(kClip))) {
+ gCurrentVolume->SetParam(kClip, 0.);
+ } else {
+ gCurrentVolume->SetParam(kClip, 1.);
+ }
+ gCurrentVolume->Draw();
+ break;
+
+ default:
+ break;
+ }
+ break;
+ case kCM_TAB:
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ return kTRUE;
+}
+
--- /dev/null
+#ifndef ALIGUIGEOMDIALOG_H
+#define ALIGUIGEOMDIALOG_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include "TGFrame.h"
+
+class AliGUISliders;
+class TGButton;
+class TGComboBox;
+class TGLabel;
+class TGTab;
+class TGTextBuffer;
+class TGTextEntry;
+class TGDoubleHSlider;
+class AliDrawVolume;
+
+class AliGuiGeomDialog : public TGTransientFrame {
+public:
+ AliGuiGeomDialog(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
+ UInt_t options = kMainFrame | kVerticalFrame);
+ virtual ~AliGuiGeomDialog();
+// Destroy this window
+ virtual void CloseWindow();
+// Process messages from this window
+ 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
+
+private:
+ AliGuiGeomDialog(const AliGuiGeomDialog& gd):
+ TGTransientFrame((const TGTransientFrame&)gd) {}
+ virtual AliGuiGeomDialog & operator=(const AliGuiGeomDialog &)
+ {return *this;}
+};
+
+R__EXTERN AliDrawVolume *gCurrentVolume;
+
+#endif
--- /dev/null
+/* *************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.8 2000/07/12 08:56:32 fca
+Coding convention correction and warning removal
+
+Revision 1.7 2000/06/28 21:27:45 morsch
+Most coding rule violations corrected.
+Still to do: Split the file (on file per class) ? Avoid the global variables.
+Copy constructors and assignment operators (dummy ?)
+
+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
+
+Revision 1.4 2000/01/18 16:12:08 morsch
+Bug in calculation of number of volume divisions and number of positionings corrected
+Browser for Material and Media properties added
+
+Revision 1.3 1999/11/14 14:31:14 fca
+Correct small error and remove compilation warnings on HP
+
+Revision 1.2 1999/11/10 16:53:35 fca
+The new geometry viewer from A.Morsch
+
+*/
+
+/*
+ * Version: 0
+ * Written by Andreas Morsch
+ *
+ *
+ *
+ * For questions critics and suggestions to this part of the code
+ * contact andreas.morsch@cern.ch
+ *
+ **************************************************************************/
+
+#include <stdlib.h>
+
+#include "TGMsgBox.h"
+#include "TGMenu.h"
+#include "TGTab.h"
+#include "TGFrame.h"
+#include "TGTextBuffer.h"
+#include "TGTextEntry.h"
+#include "TGLabel.h"
+#include "TGButton.h"
+#include "TGraph.h"
+#include "TCanvas.h"
+#include "TH1.h"
+#include "TApplication.h"
+#include "TGFileDialog.h"
+
+#include "AliGuiGeomMain.h"
+#include "AliGUIMaterial.h"
+#include "AliGuiGeomDialog.h"
+#include "AliDrawVolume.h"
+#include "AliGUIMedium.h"
+#include "TGeant3.h"
+
+ClassImp(AliGuiGeomMain)
+
+static Int_t gCurrentParticle = 1;
+static Int_t gCurrentProcess = 1;
+
+ 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* kLabelTextC[10] =
+ {"CUTGAM", "CUTELE", "CUTNEU", "CUTHAD", "CUTMUO", "BCUTE", "BCUTM",
+ "DCUTE ", "DCUTM ", "PPCUTM"};
+
+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* kLabelTextMechanism[24] =
+{"HADF", "INEF", "ELAF", "FISF", "CAPF",
+ "HADG", "INEG", "ELAG", "FISG", "CAPG",
+ "LOSS", "PHOT", "ANNI", "COMP", "BREM",
+ "PAIR", "DRAY", "PFIS", "RAYL", "HADG",
+ "MUNU", "RANG", "STEP", "MUON"};
+
+
+
+
+enum ETestCommandIdentifiers {
+ kFileOpen,
+ kFileSave,
+ kFileSaveAs,
+ kFileExit,
+
+ kTestDlg,
+
+ kHelpContents,
+ kHelpSearch,
+ kHelpAbout,
+
+
+ kVId1,
+ kHId1,
+ kVId2,
+ kHId2,
+
+ kVSId1,
+ kHSId1,
+ kVSId2,
+ kHSId2
+};
+
+
+Int_t mbButtonId[9] = { kMBYes, kMBNo, kMBOk, kMBApply,
+ kMBRetry, kMBIgnore, kMBCancel,
+ kMBClose, kMBDismiss };
+
+EMsgBoxIcon mbIcon[4] = { kMBIconStop, kMBIconQuestion,
+ kMBIconExclamation, kMBIconAsterisk };
+
+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;
+ 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", kTestDlg);
+ fMenuTest->AddSeparator();
+ fMenuTest->Associate(this);
+
+
+ fMenuHelp = new TGPopupMenu(gClient->GetRoot());
+ fMenuHelp->AddEntry("&Contents", kHelpContents);
+ fMenuHelp->AddEntry("&Search...", kHelpSearch);
+ fMenuHelp->AddSeparator();
+ fMenuHelp->AddEntry("&About", kHelpAbout);
+
+ 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);
+ fMenuTest->Associate(this);
+ fMenuHelp->Associate(this);
+
+ fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
+ fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout);
+ fMenuBar->AddPopup("&Draw Control", fMenuTest, fMenuBarItemLayout);
+ fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout);
+
+ AddFrame(fMenuBar, fMenuBarLayout);
+
+//
+// Volumes
+//
+ fTab = new TGTab(this, 400, 400);
+ TGCompositeFrame *tf = fTab->AddTab("Volumes");
+ TGLayoutHints *lTab = new TGLayoutHints(kLHintsBottom | kLHintsExpandX |
+ kLHintsExpandY, 2, 2, 5, 1);
+ AddFrame(fTab, lTab);
+
+// Create TGCanvas and a canvas container which uses a tile layout manager
+ fCanvasWindow = new TGCanvas(tf, 400, 240);
+// Create TreeList
+ fLt = new TGListTree(fCanvasWindow->GetViewPort(), 10, 10, kHorizontalFrame,
+ fgWhitePixel);
+ fLt->Associate(this);
+ fCanvasWindow->SetContainer(fLt);
+
+
+ TGLayoutHints *lo = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY);
+ tf->AddFrame(fCanvasWindow, lo);
+//
+// Materials
+//
+ tf = fTab->AddTab("Materials");
+ fF2 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
+ fL2 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
+// ComboBox for materials
+ fMaterialCombo = new TGComboBox(fF2, 1);
+ fF2->AddFrame(fMaterialCombo, fL2);
+//
+// text labels with material properties
+//
+ Text_t* labelText[6] =
+ {"Material Number ",
+ "Atomic Weight ",
+ "Atomic Number ",
+ "Density ",
+ "Radiation Length ",
+ "Absorption Length"};
+
+ TGLayoutHints* bly =
+ new TGLayoutHints(kLHintsTop | kLHintsExpandY, 5, 5, 5, 5);
+ TGLayoutHints* bFly1 =
+ new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
+ fF21 = new TGCompositeFrame(fF2, 60, 20, kVerticalFrame);
+ fF2->AddFrame(fF21,fL2);
+ { //Begin local scope for i
+ 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);
+ 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);
+ }
+ } //End local scope for i
+ tf->AddFrame(fF2, fL2);
+ fMaterialCombo->Resize(200, 20);
+ fMaterialCombo->Associate(this);
+
+
+// Media Combo
+//
+ tf = fTab->AddTab("Media");
+ fF3 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
+// ComboBox for tracking media
+ fMediaCombo = new TGComboBox(fF3, 2);
+ fF3->AddFrame(fMediaCombo, fL2);
+//
+// text labels with material properties
+//
+ Text_t* labelTextM[8] =
+ {"Sensitivity Flag ",
+ "Magnetic Field Flag ",
+ "Maximum Field ",
+ "Max. Ang. Deviation ",
+ "Maximum Step ",
+ "Max. Frac. Energy Loss",
+ "Crossing Precission ",
+ "Minimum Step Size "};
+
+ fF31 = new TGCompositeFrame(fF3, 60, 20, kVerticalFrame);
+ fF3->AddFrame(fF31,fL2);
+ { //Begin local scope for i
+ 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);
+ 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);
+ }
+ } //End local scope for i
+ tf->AddFrame(fF3, fL2);
+ fMediaCombo->Resize(200, 20);
+ fMediaCombo->Associate(this);
+//
+// Processes
+ tf = fTab->AddTab("Processes");
+ fF4 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
+ fProcessLB = new TGListBox(fF4, 1);
+ fF4->AddFrame(fProcessLB, fL2);
+ tf->AddFrame(fF4, fL2);
+ fProcessLB->Resize(150, 350);
+ fProcessLB->Associate(this);
+
+//
+// Cuts
+ tf = fTab->AddTab("Cuts");
+ fF5 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
+ fCutsLB = new TGListBox(fF5, 1);
+ fF5->AddFrame(fCutsLB, fL2);
+ tf->AddFrame(fF5, fL2);
+ fCutsLB->Resize(150, 350);
+
+//
+// de/dx and cross-sections
+ tf = fTab->AddTab("DE/DX and X-Sections");
+ fF6 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
+
+// ComboBox for particles
+ fF61 = new TGCompositeFrame(fF6, 60, 20, kVerticalFrame);
+ fF6->AddFrame(fF61, fL2);
+ fParticleCombo = new TGComboBox(fF61, 3);
+ fF61->AddFrame(fParticleCombo, fL2);
+ { //Begin local scope for i
+ for (Int_t i = 0; i < 24; i++) {
+ char tmp[20];
+ sprintf(tmp, "%s", kLabelTextPart[i]);
+ fParticleCombo->AddEntry(tmp, i+1);
+ }
+ } //End local scope for i
+ fParticleCombo->Select(1);
+ fParticleCombo->Resize(100, 20);
+ fParticleCombo->Associate(this);
+
+// ComboBox for mechanisms
+ fF63 = new TGCompositeFrame(fF6, 60, 20, kVerticalFrame);
+ fF6->AddFrame(fF63, fL2);
+ fMechanismCombo = new TGComboBox(fF63, 4);
+ fF63->AddFrame(fMechanismCombo, fL2);
+ { //Begin local scope for i
+ for (Int_t i = 0; i < 24; i++) {
+ char tmp[20];
+ sprintf(tmp, "%s", kLabelTextMechanism[i]);
+ fMechanismCombo->AddEntry(tmp, i+1);
+ }
+ } //End local scope for i
+ fMechanismCombo->Select(1);
+ fMechanismCombo->Resize(100, 20);
+ fMechanismCombo->Associate(this);
+
+//
+// Energy Range
+//
+ fTbh61 = new TGTextBuffer(10);
+ fTeh61 = new TGTextEntry(fF61, fTbh61,10);
+ fTbh61->AddText(0, " 100");
+ fTeh61->Associate(this);
+
+ fTbh62 = new TGTextBuffer(10);
+ fTeh62 = new TGTextEntry(fF61, fTbh62,11);
+ fTbh62->AddText(0, "0.001");
+ fTeh62->Associate(this);
+
+ fTbh63 = new TGTextBuffer(10);
+ fTeh63 = new TGTextEntry(fF61, fTbh63,12);
+ fTbh63->AddText(0, "10.");
+ fTeh63->Associate(this);
+
+ fEmin=0.001;
+ fEmax=10.;
+ 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);
+//
+// Plot Button
+ fF62 = new TGCompositeFrame(fF6, 60, 20, kHorizontalFrame);
+ fF6->AddFrame(fF62, fL2);
+ fPlotButton = new TGTextButton(fF62, "Plot", 1);
+ fPlotButton -> Associate(this);
+ fF62->AddFrame(fPlotButton);
+
+ tf->AddFrame(fF6, fL2);
+// Window name and final mapping
+//
+ SetWindowName("AliRoot Geometry Browser");
+ MapSubwindows();
+ // We need to use GetDefault...() to initialize the layout algorithm...
+ Resize(GetDefaultSize());
+ MapWindow();
+}
+
+AliGuiGeomMain::~AliGuiGeomMain()
+{
+ // Delete all created widgets.
+
+ delete fCanvasWindow;
+
+ delete fMenuBarLayout;
+ delete fMenuBarItemLayout;
+ delete fMenuBarHelpLayout;
+
+ delete fMenuFile;
+ delete fMenuTest;
+ delete fMenuHelp;
+}
+
+void AliGuiGeomMain::Streamer(TBuffer &)
+{
+// Dummy streamer
+;
+}
+
+void AliGuiGeomMain::Plot()
+{
+// 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];
+ Int_t ixst;
+ Int_t imate=gCurrentMaterial->Id();
+ Float_t z=gCurrentMaterial->Z();
+ Float_t a=gCurrentMaterial->A();
+ Float_t density=gCurrentMaterial->Density();
+
+ Int_t ipart=gCurrentParticle;
+ const char *kChMeca= kLabelTextMechanism[gCurrentProcess-1];
+ char* tmp;
+ tmp = new char[5];
+ strncpy(tmp, kChMeca, 4);
+ tmp[4]='\0';
+ Int_t kdim=fNbins;
+ Float_t de=(fEmax-fEmin)/fNbins;
+ { //Begin local scope for i
+ for (Int_t i=0; i<kdim; i++) {
+ tkin[i]=fEmin+Float_t(i)*de;
+ value[i]=0.;
+ }
+ } //End local scope for i
+ 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.*kAvo*density/a;
+ }
+ }
+
+
+ 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);
+ c1->Divide(1,1);
+ c1->cd(1);
+
+ graph->SetFillColor(42);
+ graph->SetMarkerColor(4);
+ graph->SetMarkerStyle(21);
+ graph->Draw("AC");
+ graph->GetHistogram()->SetXTitle("Energy (GeV)");
+ if (kChMeca == "RANG" || kChMeca == "STEP") {
+ graph->GetHistogram()->SetYTitle
+ ("Distance (cm)");
+ } else if (kChMeca == "LOSS" || kChMeca == "MUON") {
+ graph->GetHistogram()->SetYTitle("dE/dx (MeV/cm)");
+ } else {
+ graph->GetHistogram()->SetYTitle
+ ("Macroscopic X-Section (1/cm)");
+ }
+ }
+
+ delete tkin;
+ delete value;
+ delete pcut;
+
+
+}
+
+void AliGuiGeomMain::Update()
+{
+// Update widgets
+ if (fDialog) {
+ fDialog->Update();
+ }
+
+ Int_t imat=gCurrentVolume->Material();
+ Int_t nmat=fComboEntries->GetEntriesFast();
+ Int_t i=0;
+ for (i=0; i<nmat; i++) {
+ gCurrentMaterial = (AliGUIMaterial*)
+ (fComboEntries->UncheckedAt(i));
+ if (gCurrentMaterial->Id()==imat) break;
+ }
+ Int_t imed = gCurrentVolume->Medium();
+ Int_t nmed=fComboMediaEntries->GetEntriesFast();
+ for (i=0; i<nmed; i++) {
+ gCurrentMedium = (AliGUIMedium*)
+ (fComboMediaEntries->UncheckedAt(i));
+ if (gCurrentMedium->Id()==imed) break;
+ }
+
+ UpdateCombo();
+ UpdateListBox();
+
+}
+
+void AliGuiGeomMain::UpdateCombo()
+{
+// Update combos
+
+ Int_t imat = gCurrentMaterial->Id();
+ Float_t a = gCurrentMaterial->A();
+ Float_t z = gCurrentMaterial->Z();
+ Float_t dens = gCurrentMaterial->Density();
+ Float_t radl = gCurrentMaterial->RadiationLength();
+ Float_t absl = gCurrentMaterial->AbsorptionLength();
+ Int_t entry=gCurrentMaterial->ItemId();
+//
+//
+ fMaterialCombo->Select(entry);
+ fMediaCombo->Select(entry);
+ char buf[10];
+
+ sprintf(buf, "%10i", imat);
+ fTbh[0]->Clear();
+ fTbh[0]->AddText(0, buf);
+ gClient->NeedRedraw(fTeh[0]);
+ sprintf(buf, "%10.2e", a);
+ fTbh[1]->Clear();
+ fTbh[1]->AddText(0, buf);
+ gClient->NeedRedraw(fTeh[1]);
+
+ sprintf(buf, "%10.2e", z);
+ fTbh[2]->Clear();
+ fTbh[2]->AddText(0, buf);
+ gClient->NeedRedraw(fTeh[2]);
+
+ sprintf(buf, "%10.2e", dens);
+ fTbh[3]->Clear();
+ fTbh[3]->AddText(0, buf);
+ gClient->NeedRedraw(fTeh[3]);
+
+ sprintf(buf, "%10.2e", radl);
+ fTbh[4]->Clear();
+ fTbh[4]->AddText(0, buf);
+ gClient->NeedRedraw(fTeh[4]);
+
+ sprintf(buf, "%10.2e", absl);
+ fTbh[5]->Clear();
+ fTbh[5]->AddText(0, buf);
+ gClient->NeedRedraw(fTeh[5]);
+
+// Media Combo
+ sprintf(buf, "%10i", gCurrentMedium->Isvol());
+ fTbhM[0]->Clear();
+ fTbhM[0]->AddText(0, buf);
+ gClient->NeedRedraw(fTehM[0]);
+
+
+ sprintf(buf, "%10i", gCurrentMedium->Ifield());
+ fTbhM[1]->Clear();
+ fTbhM[1]->AddText(0, buf);
+ gClient->NeedRedraw(fTehM[1]);
+
+ sprintf(buf, "%10.2e", gCurrentMedium->Fieldm());
+ fTbhM[2]->Clear();
+ fTbhM[2]->AddText(0, buf);
+ gClient->NeedRedraw(fTehM[2]);
+
+ sprintf(buf, "%10.2e", gCurrentMedium->Tmaxfd());
+ fTbhM[3]->Clear();
+ fTbhM[3]->AddText(0, buf);
+ gClient->NeedRedraw(fTehM[3]);
+
+ sprintf(buf, "%10.2e", gCurrentMedium->Stemax());
+ fTbhM[4]->Clear();
+ fTbhM[4]->AddText(0, buf);
+ gClient->NeedRedraw(fTehM[4]);
+
+ sprintf(buf, "%10.2e", gCurrentMedium->Deemax());
+ fTbhM[5]->Clear();
+ fTbhM[5]->AddText(0, buf);
+ gClient->NeedRedraw(fTehM[5]);
+
+ sprintf(buf, "%10.2e", gCurrentMedium->Epsil());
+ fTbhM[6]->Clear();
+ fTbhM[6]->AddText(0, buf);
+ gClient->NeedRedraw(fTehM[6]);
+
+ sprintf(buf, "%10.2e", gCurrentMedium->Stmin());
+ fTbhM[7]->Clear();
+ fTbhM[7]->AddText(0, buf);
+ gClient->NeedRedraw(fTehM[7]);
+}
+
+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", kLabelTextP[i-11], Int_t(p));
+ fProcessLB->AddEntry(tmp, i-10);
+ }
+ fProcessLB->MapSubwindows();
+ fProcessLB->Layout();
+
+ fCutsLB->RemoveEntries(1,10);
+ for (i=1; i < 11; i++) {
+ Float_t p=gCurrentMedium->GetPar(i);
+ char tmp[20];
+ sprintf(tmp, "%6s%10.3e", kLabelTextC[i-1], p);
+ fCutsLB->AddEntry(tmp,i);
+ }
+ fCutsLB->MapSubwindows();
+ fCutsLB->Layout();
+}
+
+
+void AliGuiGeomMain::CloseWindow()
+{
+ // Got close message for this MainFrame. Calls parent CloseWindow()
+ // (which destroys the window) and terminate the application.
+ // The close message is generated by the window manager when its close
+ // window menu item is selected.
+
+ TGMainFrame::CloseWindow();
+ gApplication->Terminate(0);
+}
+
+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 kC_TEXTENTRY:
+ switch (GET_SUBMSG(msg)) {
+ case kTE_TEXTCHANGED:
+ switch (parm1) {
+ case 10:
+ fNbins=(Int_t) atof(fTbh61->GetString());
+ break;
+ case 11:
+ fEmin= atof(fTbh62->GetString());
+ break;
+ case 12:
+ fEmax= atof(fTbh63->GetString());
+ break;
+ }
+ printf("\n %d %f %f binning", fNbins, fEmin, fEmax);
+ }
+ break;
+//
+// ListTree for volumes
+ case kC_LISTTREE:
+ switch (GET_SUBMSG(msg)) {
+//
+// Handle mouse click
+ case kCT_ITEMCLICK:
+//
+// Button 1: Select volume
+ if (parm1 == kButton1) {
+ TGListTreeItem *item;
+ if ((item = fLt->GetSelected()))
+ {
+ gCurrentVolume=((AliDrawVolume *) item->GetUserData());
+ Update();
+ }
+ }
+//
+// Button 2: Draw volume specifications
+
+ if (parm1 == kButton2) {
+ TGListTreeItem *item;
+ if ((item = fLt->GetSelected()))
+ {
+
+ ((AliDrawVolume *) item->GetUserData())->DrawSpec();
+
+ gCurrentVolume=((AliDrawVolume *) item->GetUserData());
+ Update();
+ }
+ }
+//
+// Button 3: Draw Volume
+ if (parm1 == kButton3) {
+ TGListTreeItem *item;
+ if ((item = fLt->GetSelected()))
+ {
+ ((AliDrawVolume *) item->GetUserData())->Draw();
+ gCurrentVolume=((AliDrawVolume *) item->GetUserData());
+ Update();
+ }
+ }
+
+
+ break;
+ case kCT_ITEMDBLCLICK:
+ if (parm1 == kButton1) {
+ if (fLt->GetSelected() != 0) {
+ gClient->NeedRedraw(fLt);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case kC_COMMAND:
+ switch (GET_SUBMSG(msg)) {
+ case kCM_BUTTON:
+ switch(parm1) {
+ case 1:
+ Plot();
+ break;
+ }
+ break;
+ case kCM_COMBOBOX:
+//
+// Combo box bindings
+ switch(parm1) {
+//
+// Material Combo
+ case 1:
+ gCurrentMaterial=(AliGUIMaterial*)
+ (fComboEntries->UncheckedAt(Int_t(parm2-1)));
+ gCurrentMedium=(AliGUIMedium*)
+ (fComboMediaEntries->UncheckedAt(Int_t(parm2-1)));
+ UpdateCombo();
+ UpdateListBox();
+ break;
+//
+// Media Combo
+ case 2:
+ gCurrentMedium=(AliGUIMedium*)
+ (fComboMediaEntries->UncheckedAt(Int_t(parm2-1)));
+ gCurrentMaterial=(AliGUIMaterial*)
+ (fComboEntries->UncheckedAt(Int_t(parm2-1)));
+ UpdateCombo();
+ UpdateListBox();
+ break;
+//
+// Particle Combo
+ case 3:
+ gCurrentParticle=Int_t(parm2);
+ break;
+//
+// Mechanism Combo
+ case 4:
+ gCurrentProcess=Int_t(parm2);
+ printf("\n Process %d", gCurrentProcess);
+ break;
+ }
+ break;
+ case kCM_MENUSELECT:
+ break;
+
+ case kCM_MENU:
+ switch (parm1) {
+
+ case kFileOpen:
+ {
+ TGFileInfo fi;
+ fi.fFileTypes = (char **)kFileTypes;
+ new TGFileDialog(gClient->GetRoot(), this, kFDOpen,&fi);
+ }
+ break;
+
+ case kTestDlg:
+ fDialog = new AliGuiGeomDialog
+ (gClient->GetRoot(), this, 400, 200);
+ break;
+
+ case kFileSave:
+ printf("kFileSave\n");
+ break;
+
+ case kFileExit:
+ CloseWindow(); // this also terminates theApp
+ break;
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+ return kTRUE;
+}
+
+void AliGuiGeomMain::AddMaterial(AliGUIMaterial *Material, Int_t i)
+{
+// Add material to material combo
+ char* tmp;
+ tmp=Material->Name();
+ Material->SetItemId(i);
+ fMaterialCombo->AddEntry(tmp, i);
+ fMaterialCombo->Select(i);
+ fMaterialCombo->Resize(200, 20);
+}
+
+void AliGuiGeomMain::AddMedium(AliGUIMedium *Medium, Int_t i)
+{
+// Add medium to medium combo
+ char* tmp;
+ tmp=Medium->Name();
+ Medium->SetItemId(i);
+
+ fMediaCombo->AddEntry(tmp, i);
+ fMediaCombo->Select(i);
+ fMediaCombo->Resize(200, 20);
+}
+
+
--- /dev/null
+#ifndef ALIGUIGEOMMAIN_H
+#define ALIGUIGEOMMAIN_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include "TClonesArray.h"
+#include "TGFrame.h"
+#include "TGListTree.h"
+#include "TGComboBox.h"
+
+class TGTab;
+class TGMenuBar;
+class TGPopupMenu;
+class TGTextBuffer;
+class TGTextEntry;
+class TGLabel;
+class TGTextButton;
+
+class AliGUIMaterial;
+class AliGUIMedium;
+class AliGuiGeomDialog;
+
+class AliGuiGeomMain : public TGMainFrame {
+ public:
+ AliGuiGeomMain(const TGWindow *p, UInt_t w, UInt_t h);
+ virtual ~AliGuiGeomMain();
+ // Destroy the main window
+ virtual void CloseWindow();
+ // Add item to ListTree
+ virtual TGListTreeItem *
+ 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 parm2);
+ // Update widgets
+ virtual void Update();
+ // Update ComboBoxes
+ virtual void UpdateCombo();
+ virtual void UpdateListBox();
+ // Relate objects to ComboEntries
+ // Currently ComboBox Entries are strings only, hence we need this construction
+ virtual void SetComboEntries(TClonesArray *entries) {fComboEntries=entries;}
+ 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
+
+ AliGuiGeomMain(const AliGuiGeomMain &gm)
+ : TGMainFrame((const TGMainFrame&)gm) {}
+ virtual AliGuiGeomMain & operator=(const AliGuiGeomMain &) {return *this;}
+
+
+ ClassDef(AliGuiGeomMain,1) // MainFrame for Geometry Browser
+};
+
+R__EXTERN AliGUIMaterial *gCurrentMaterial;
+R__EXTERN AliGUIMedium *gCurrentMedium;
+
+#endif
# C++ sources
-GSRCS = TGeant3.cxx TPaveTree.cxx THIGZ.cxx \
- TGeant3GUI.cxx AliGeant3.cxx
+GSRCS = TGeant3.cxx TPaveTree.cxx THIGZ.cxx AliGUIMedium.cxx \
+ AliGeant3.cxx AliGUIMaterial.cxx AliDrawVolume.cxx \
+ AliGUISliders.cxx AliGuiGeomDialog.cxx AliGuiGeomMain.cxx \
+ AliGeant3GeometryGUI.cxx
# C++ Headers
/*
$Log$
+Revision 1.30 2000/07/12 08:56:30 fca
+Coding convention correction and warning removal
+
Revision 1.29 2000/07/11 18:24:59 fca
Coding convention corrections + few minor bug fixes
//
// Geant3 global pointer
//
-static Int_t defSize = 600;
+static const Int_t kDefSize = 600;
ClassImp(TGeant3)
// Set range of current drawing pad to 20x20 cm
//
if (!gHigz) {
- new THIGZ(defSize);
+ new THIGZ(kDefSize);
gdinit();
}
gHigz->Range(0,0,20,20);
// Initialise HIGZ
//
if (!gHigz) {
- new THIGZ(defSize);
+ new THIGZ(kDefSize);
gdinit();
}
}
{
//
// Return Geant3 code from PDG and pseudo ENDF code
-
+ //
for(Int_t i=0;i<fNPDGCodes;++i)
if(pdg==fPDGCode[i]) return i;
return -1;
//_____________________________________________________________________________
Int_t TGeant3::PDGFromId(Int_t id) const
{
+ //
+ // Return PDG code and pseudo ENDF code from Geant3 code
+ //
if(id>0 && id<fNPDGCodes) return fPDGCode[id];
else return -1;
}
TDatabasePDG *pdgDB = TDatabasePDG::Instance();
- const Double_t autogev=0.9314943228;
- const Double_t hslash = 1.0545726663e-27;
- const Double_t erggev = 1/1.6021773349e-3;
- const Double_t hshgev = hslash*erggev;
- const Double_t yearstosec = 3600*24*365.25;
+ const Double_t kAu2Gev=0.9314943228;
+ const Double_t khSlash = 1.0545726663e-27;
+ const Double_t kErg2Gev = 1/1.6021773349e-3;
+ const Double_t khShGev = khSlash*kErg2Gev;
+ const Double_t kYear2Sec = 3600*24*365.25;
//
// Bottom mesons
// mass and life-time from PDG
// pdg mass value, Hijing uses m=2.73.
pdgDB->AddParticle("Omega(c)0","Omega(c)0",
- 2.7040, kFALSE, hshgev/0.064e-12, +0.,"Baryon", 4332);
+ 2.7040, kFALSE, khShGev/0.064e-12, +0.,"Baryon", 4332);
pdgDB->AddParticle("Omega(c)0 bar","Omega(c)0 bar",
- 2.7040, kFALSE, hshgev/0.064e-12, -0.,"Baryon", -4332);
+ 2.7040, kFALSE, khShGev/0.064e-12, -0.,"Baryon", -4332);
// mass value from Hijing
pdgDB->AddParticle("Omega(c)*0","Omega(c)*0",
2.8000, kFALSE, -1., +0.,"Baryon", 4334);
//
//
- pdgDB->AddParticle("Deuteron","Deuteron",2*autogev+8.071e-3,kTRUE,
+ pdgDB->AddParticle("Deuteron","Deuteron",2*kAu2Gev+8.071e-3,kTRUE,
0,1,"Ion",kion+10020);
fPDGCode[fNPDGCodes++]=kion+10020; // 45 = Deuteron
- pdgDB->AddParticle("Triton","Triton",3*autogev+14.931e-3,kFALSE,
- hshgev/(12.33*yearstosec),1,"Ion",kion+10030);
+ pdgDB->AddParticle("Triton","Triton",3*kAu2Gev+14.931e-3,kFALSE,
+ khShGev/(12.33*kYear2Sec),1,"Ion",kion+10030);
fPDGCode[fNPDGCodes++]=kion+10030; // 46 = Triton
- pdgDB->AddParticle("Alpha","Alpha",4*autogev+2.424e-3,kTRUE,
- hshgev/(12.33*yearstosec),2,"Ion",kion+20040);
+ pdgDB->AddParticle("Alpha","Alpha",4*kAu2Gev+2.424e-3,kTRUE,
+ khShGev/(12.33*kYear2Sec),2,"Ion",kion+20040);
fPDGCode[fNPDGCodes++]=kion+20040; // 47 = Alpha
fPDGCode[fNPDGCodes++]=0; // 48 = geantino mapped to rootino
- pdgDB->AddParticle("HE3","HE3",3*autogev+14.931e-3,kFALSE,
+ pdgDB->AddParticle("HE3","HE3",3*kAu2Gev+14.931e-3,kFALSE,
0,2,"Ion",kion+20030);
fPDGCode[fNPDGCodes++]=kion+20030; // 49 = HE3
//_____________________________________________________________________________
void TGeant3::SetCut(const char* cutName, Float_t cutValue)
{
+ //
+ // Set transport cuts for particles
+ //
if(!strcmp(cutName,"CUTGAM"))
fGccuts->cutgam=cutValue;
else if(!strcmp(cutName,"CUTGAM"))
//_____________________________________________________________________________
void TGeant3::SetProcess(const char* flagName, Int_t flagValue)
{
+ //
+ // Set thresholds for different processes
+ //
if(!strcmp(flagName,"PAIR"))
fGcphys->ipair=flagValue;
else if(!strcmp(flagName,"COMP"))
Float_t TGeant3::Xsec(char* reac, Float_t /* energy */,
Int_t part, Int_t /* mate */)
{
+ //
+ // Calculate X-sections -- dummy for the moment
+ //
if(!strcmp(reac,"PHOT"))
{
if(part!=22) {
// in the current step
//
static char proc[5];
- const Int_t ipmec[13] = { 5,6,7,8,9,10,11,12,21,23,25,105,108 };
+ const Int_t kIpMec[13] = { 5,6,7,8,9,10,11,12,21,23,25,105,108 };
Int_t mec, km, im;
//
if(fGcking->ngkine>0) {
for (km = 0; km < fGctrak->nmec; ++km) {
for (im = 0; im < 13; ++im) {
- if (fGctrak->lmec[km] == ipmec[im]) {
+ if (fGctrak->lmec[km] == kIpMec[im]) {
mec = fGctrak->lmec[km];
if (0 < mec && mec < 31) {
strncpy(proc,(char *)&fGctrak->namec[mec - 1],4);
//_____________________________________________________________________________
void TGeant3::InitLego()
{
+ //
+ // Set switches for lego transport
+ //
SetSWIT(4,0);
SetDEBU(0,0,0); //do not print a message
}
}
+//_____________________________________________________________________________
Float_t TGeant3::Gbrelm(Float_t z, Float_t t, Float_t bcut)
{
- return gbrelm(z,t,bcut);
+ //
+ // To calculate energy loss due to soft muon BREMSSTRAHLUNG
+ //
+ return gbrelm(z,t,bcut);
}
+//_____________________________________________________________________________
Float_t TGeant3::Gprelm(Float_t z, Float_t t, Float_t bcut)
{
- return gprelm(z,t,bcut);
+ //
+ // To calculate DE/DX in GeV*barn/atom for direct pair production by muons
+ //
+ return gprelm(z,t,bcut);
}
//_____________________________________________________________________________
THIGZ *higzSpec = (THIGZ*)gROOT->FindObject("higzSpec");
//printf("DrawOneSpec, gHigz=%x, higzSpec=%x\n",gHigz,higzSpec);
if (higzSpec) gHigz = higzSpec;
- else higzSpec = new THIGZ(defSize);
+ else higzSpec = new THIGZ(kDefSize);
higzSpec->SetName("higzSpec");
higzSpec->cd();
higzSpec->Clear();
char vname[5];
Vname(name,vname);
gdtree(PASSCHARD(vname), levmax, isel PASSCHARL(vname));
- gHigz->fPname = "";
+ gHigz->SetPname("");
}
//_____________________________________________________________________________
strncpy(vname,(char*)&fZiq[fGclink->jvolum+i],4);
vname[4] = 0;
gdtree(PASSCHARD(vname), levmax, isel PASSCHARL(vname));
- gHigz->fPname = "";
+ gHigz->SetPname("");
return;
}
}
//______________________________________________________________________________
void TGeant3::Ertrgo()
{
+ //
+ // Perform the tracking of the track Track parameters are in VECT
+ //
ertrgo();
}
const Float_t *x2, const Float_t *p2,
Int_t ipa, Option_t *chopt)
{
+ //************************************************************************
+ //* *
+ //* Perform the tracking of the track from point X1 to *
+ //* point X2 *
+ //* (Before calling this routine the user should also provide *
+ //* the input informations in /EROPTS/ and /ERTRIO/ *
+ //* using subroutine EUFIL(L/P/V) *
+ //* X1 - Starting coordinates (Cartesian) *
+ //* P1 - Starting 3-momentum (Cartesian) *
+ //* X2 - Final coordinates (Cartesian) *
+ //* P2 - Final 3-momentum (Cartesian) *
+ //* IPA - Particle code (a la GEANT) of the track *
+ //* *
+ //* CHOPT *
+ //* 'B' 'Backward tracking' - i.e. energy loss *
+ //* added to the current energy *
+ //* 'E' 'Exact' calculation of errors assuming *
+ //* helix (i.e. pathlength not *
+ //* assumed as infinitesimal) *
+ //* 'L' Tracking upto prescribed Lengths reached *
+ //* 'M' 'Mixed' prediction (not yet coded) *
+ //* 'O' Tracking 'Only' without calculating errors *
+ //* 'P' Tracking upto prescribed Planes reached *
+ //* 'V' Tracking upto prescribed Volumes reached *
+ //* 'X' Tracking upto prescribed Point approached *
+ //* *
+ //* Interface with GEANT : *
+ //* Track parameters are in /CGKINE/ and /GCTRAK/ *
+ //* *
+ //* ==>Called by : USER *
+ //* Authors M.Maire, E.Nagy ********//* *
+ //* *
+ //************************************************************************
ertrak(x1,p1,x2,p2,ipa,PASSCHARD(chopt) PASSCHARL(chopt));
}
// this procedure fails, ordering starts from 1.
// Arrays IOTMED and IOMATE are used for this procedure
//
- const char shape[][5]={"BOX ","TRD1","TRD2","TRAP","TUBE","TUBS","CONE",
+ const char kShape[][5]={"BOX ","TRD1","TRD2","TRAP","TUBE","TUBS","CONE",
"CONS","SPHE","PARA","PGON","PCON","ELTU","HYPE",
"GTRA","CTUB"};
Int_t i, end, itm, irm, jrm, k, nmed;
Int_t itmedc, nmatc, isvolc, ifieldc, nwbufc, isvol, nmat, ifield, nwbuf;
Float_t fieldmc, tmaxfdc, stemaxc, deemaxc, epsilc, stminc, fieldm;
Float_t tmaxf, stemax, deemax, epsil, stmin;
- const char *f10000="!\n%s\n!\n";
+ const char *k10000="!\n%s\n!\n";
//Open the input file
end=strlen(filnam);
for(i=0;i<end;i++) if(filnam[i]=='.') {
// *** write down the tracking medium definition
//
strcpy(card,"! Tracking medium");
- fprintf(lun,f10000,card);
+ fprintf(lun,k10000,card);
//
for(itm=1;itm<=fGcnum->ntmed;itm++) {
if (iws[iadtmd+itm]>0) {
//* *** write down the rotation matrix
//*
strcpy(card,"! Reperes");
- fprintf(lun,f10000,card);
+ fprintf(lun,k10000,card);
//
for(irm=1;irm<=fGcnum->nrotm;irm++) {
if (iws[iadrot+irm]>0) {
//* *** write down the volume definition
//*
strcpy(card,"! Volumes");
- fprintf(lun,f10000,card);
+ fprintf(lun,k10000,card);
//*
for(ivstak=1;ivstak<=nvstak;ivstak++) {
ivo = iws[ivstak];
if (npar>0) {
if (ivstak>1) for(i=0;i<npar;i++) par[i]=fZq[jvo+7+i];
Gckpar (ish,npar,par);
- fprintf(lun,"VOLU '%4s' '%4s' %3d %3d\n",name,shape[ish-1],iotmed[nmed],npar);
+ fprintf(lun,"VOLU '%4s' '%4s' %3d %3d\n",name,kShape[ish-1],iotmed[nmed],npar);
for(i=0;i<(npar-1)/6+1;i++) {
fprintf(lun," ");
left=npar-i*6;
fprintf(lun,"\n");
}
} else {
- fprintf(lun,"VOLU '%4s' '%4s' %3d %3d\n",name,shape[ish-1],iotmed[nmed],npar);
+ fprintf(lun,"VOLU '%4s' '%4s' %3d %3d\n",name,kShape[ish-1],iotmed[nmed],npar);
}
}
}
//*
//* *** write down the division of volumes
//*
- fprintf(lun,f10000,"! Divisions");
+ fprintf(lun,k10000,"! Divisions");
for(ivstak=1;ivstak<=nvstak;ivstak++) {
ivo = TMath::Abs(iws[ivstak]);
jvo = fZlq[fGclink->jvolum-ivo];
//*
//* *** write down the the positionnement of volumes
//*
- fprintf(lun,f10000,"! Positionnements\n");
+ fprintf(lun,k10000,"! Positionnements\n");
//
for(ivstak = 1;ivstak<=nvstak;ivstak++) {
ivo = TMath::Abs(iws[ivstak]);
-#ifndef TGeant3_H
-#define TGeant3_H
+#ifndef TGEANT3_H
+#define TGEANT3_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
class TGeant3 : public AliMC {
-protected:
- Int_t fNextVol; // Iterator for GeomIter
-
-//--------------Declarations for ZEBRA---------------------
- Int_t *fZiq, *fZlq;
- Float_t *fZq;
-
- Quest_t *fQuest;
- Gcbank_t *fGcbank;
- Gclink_t *fGclink;
- Gccuts_t *fGccuts;
- Gcmulo_t *fGcmulo;
- Gcmate_t *fGcmate;
- Gctpol_t *fGctpol;
- Gcnum_t *fGcnum;
- Gcsets_t *fGcsets;
- Gcopti_t *fGcopti;
- Gctlit_t *fGctlit;
- Gcvdma_t *fGcvdma;
- Gcvolu_t *fGcvolu;
- Gckine_t *fGckine;
- Gcflag_t *fGcflag;
- Gctmed_t *fGctmed;
- Gcphys_t *fGcphys;
- Gcphlt_t *fGcphlt;
- Gcking_t *fGcking;
- Gckin2_t *fGckin2;
- Gckin3_t *fGckin3;
- Gctrak_t *fGctrak;
-
-
- // commons for GEANE
- Ertrio_t *fErtrio;
- Eropts_t *fEropts;
- Eroptc_t *fEroptc;
- Erwork_t *fErwork;
-
- //Put here all volume names
-
- char (*fVolNames)[5]; //! Names of geant volumes as C++ chars
-
- enum {kMaxParticles = 100};
-
- Int_t fNPDGCodes;
-
- Int_t fPDGCode[kMaxParticles];
-
public:
TGeant3();
TGeant3(const char *title, Int_t nwgeant=0);
delete [] fVolNames;
fVolNames=0;}
}
+
virtual void LoadAddress();
///////////////////////////////////////////////////////////////////////
Int_t PDGFromId(Int_t pdg) const;
void DefineParticles();
const char* VolName(Int_t id) const;
- Float_t Xsec(char*, Float_t, Int_t, Int_t);
+ Float_t Xsec(char* reac, Float_t energy, Int_t part, Int_t mate);
void TrackPosition(TLorentzVector &xyz) const;
void TrackMomentum(TLorentzVector &xyz) const;
Int_t NofVolumes() const;
Int_t NSecondaries() const;
Int_t CurrentEvent() const;
const char* ProdProcess() const;
- void GetSecondary(Int_t, Int_t&, TLorentzVector&, TLorentzVector&);
+ void GetSecondary(Int_t isec, Int_t& ipart, TLorentzVector &x,
+ TLorentzVector &p);
void StopTrack();
void StopEvent();
Float_t MaxStep() const;
virtual Float_t Edep() const;
virtual Float_t Etot() const;
virtual void Rndm(Float_t* r, const Int_t n) const;
- virtual void Material(Int_t&, const char*, Float_t, Float_t, Float_t, Float_t,
- Float_t, Float_t* buf=0, Int_t nwbuf=0);
- virtual void Mixture(Int_t&, const char*, Float_t*, Float_t*, Float_t, Int_t, Float_t*);
- virtual void Medium(Int_t&, const char*, Int_t, Int_t, Int_t, Float_t, Float_t,
- Float_t, Float_t, Float_t, Float_t, Float_t* ubuf=0, Int_t nbuf=0);
- virtual void Matrix(Int_t&, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t);
+
+ virtual void Material(Int_t& kmat, const char* name, Float_t a, Float_t z,
+ Float_t dens, Float_t radl, Float_t absl,
+ Float_t* buf=0, Int_t nwbuf=0);
+
+ virtual void Mixture(Int_t& kmat, const char* name, Float_t* a,Float_t* z,
+ Float_t dens, Int_t nlmat, Float_t* wmat);
+
+ virtual void Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
+ Int_t ifield, Float_t fieldm, Float_t tmaxfd,
+ Float_t stemax, Float_t deemax, Float_t epsil,
+ Float_t stmin, Float_t* ubuf=0, Int_t nbuf=0);
+
+ virtual void Matrix(Int_t& krot, Float_t thex, Float_t phix, Float_t they,
+ Float_t phiy, Float_t thez, Float_t phiz);
/////////////////////////////////////////////////////////////////////////////////////////////
// //
virtual void Grndmq(Int_t &is1, Int_t &is2, const Int_t iseq, const Text_t *chopt);
// functions from GGEOM
- virtual void Gdxyz(Int_t );
+ virtual void Gdxyz(Int_t it);
virtual void Gdcxyz();
// functions from GGEOM
virtual void Gsatt(const char *name, const char *att, Int_t val);
virtual void Gfpara(const char *name, Int_t number, Int_t intext, Int_t& npar,
Int_t& natt, Float_t* par, Float_t* att);
- virtual void Gckpar(Int_t, Int_t, Float_t*);
- virtual void Gckmat(Int_t, char*);
+ virtual void Gckpar(Int_t ish, Int_t npar, Float_t *par);
+ virtual void Gckmat(Int_t itmed, char *natmed);
// functions from GDRAW
virtual void DefaultRange();
virtual void Gdtree(const char *name,Int_t levmax=15,Int_t ispec=0);
virtual void GdtreeParent(const char *name,Int_t levmax=15,Int_t ispec=0);
- virtual void WriteEuclid(const char*, const char*, Int_t, Int_t);
+ virtual void WriteEuclid(const char* filnam, const char* topvol,
+ Int_t number, Int_t nlevel);
virtual void SetABAN(Int_t par=1);
virtual void SetANNI(Int_t par=1);
virtual void FinishGeometry();
virtual void BuildPhysics();
+protected:
+ Int_t fNextVol; // Iterator for GeomIter
+
+//--------------Declarations for ZEBRA---------------------
+ Int_t *fZiq; // Good Old IQ of Zebra
+ Int_t *fZlq; // Good Old LQ of Zebra
+ Float_t *fZq; // Good Old Q of Zebra
+
+ Quest_t *fQuest; // QUEST common structure
+ Gcbank_t *fGcbank; // GCBANK common structure
+ Gclink_t *fGclink; // GCLINK common structure
+ Gccuts_t *fGccuts; // GCCUTS common structure
+ Gcmulo_t *fGcmulo; // GCMULO common structure
+ Gcmate_t *fGcmate; // GCMATE common structure
+ Gctpol_t *fGctpol; // GCTPOL common structure
+ Gcnum_t *fGcnum; // GCNUM common structure
+ Gcsets_t *fGcsets; // GCSETS common structure
+ Gcopti_t *fGcopti; // GCOPTI common structure
+ Gctlit_t *fGctlit; // GCTLIT common structure
+ Gcvdma_t *fGcvdma; // GCVDMA common structure
+ Gcvolu_t *fGcvolu; // GCVOLU common structure
+ Gckine_t *fGckine; // GCKINE common structure
+ Gcflag_t *fGcflag; // GCFLAG common structure
+ Gctmed_t *fGctmed; // GCTMED common structure
+ Gcphys_t *fGcphys; // GCPHYS common structure
+ Gcphlt_t *fGcphlt; // GCPHLT common structure
+ Gcking_t *fGcking; // GCKING common structure
+ Gckin2_t *fGckin2; // GCKIN2 common structure
+ Gckin3_t *fGckin3; // GCKIN3 common structure
+ Gctrak_t *fGctrak; // GCTRAK common structure
+
+
+ // commons for GEANE
+ Ertrio_t *fErtrio; // ERTRIO common structure
+ Eropts_t *fEropts; // EROPTS common structure
+ Eroptc_t *fEroptc; // EROPTC common structure
+ Erwork_t *fErwork; // ERWORK common structure
+
+ //Put here all volume names
+
+ char (*fVolNames)[5]; //! Names of geant volumes as C++ chars
+
+ enum {kMaxParticles = 100};
+
+ Int_t fNPDGCodes; // Number of PDG codes known by G3
+
+ Int_t fPDGCode[kMaxParticles]; // Translation table of PDG codes
+
+private:
+ TGeant3(const TGeant3 &) {}
+ TGeant3 & operator=(const TGeant3&) {return *this;}
+
+
ClassDef(TGeant3,1) //C++ interface to Geant basic routines
};
+++ /dev/null
-/* *************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/*
-$Log$
-Revision 1.7 2000/06/28 21:27:45 morsch
-Most coding rule violations corrected.
-Still to do: Split the file (on file per class) ? Avoid the global variables.
-Copy constructors and assignment operators (dummy ?)
-
-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
-
-Revision 1.4 2000/01/18 16:12:08 morsch
-Bug in calculation of number of volume divisions and number of positionings corrected
-Browser for Material and Media properties added
-
-Revision 1.3 1999/11/14 14:31:14 fca
-Correct small error and remove compilation warnings on HP
-
-Revision 1.2 1999/11/10 16:53:35 fca
-The new geometry viewer from A.Morsch
-
-*/
-
-/*
- * Version: 0
- * Written by Andreas Morsch
- *
- *
- *
- * For questions critics and suggestions to this part of the code
- * contact andreas.morsch@cern.ch
- *
- **************************************************************************/
-#include <stdlib.h>
-#include <TROOT.h>
-#include <AliRun.h>
-#include <AliMC.h>
-#include <TGeant3.h>
-#include <THIGZ.h>
-#include <TApplication.h>
-#include <TVirtualX.h>
-#include <TGListBox.h>
-#include <TGListTree.h>
-#include <TGClient.h>
-#include <TGFrame.h>
-#include <TGIcon.h>
-#include <TGLabel.h>
-#include <TGButton.h>
-#include <TGTextEntry.h>
-#include <TGMsgBox.h>
-#include <TGMenu.h>
-#include <TGCanvas.h>
-#include <TGComboBox.h>
-#include <TGTab.h>
-#include <TGSlider.h>
-#include <TGDoubleSlider.h>
-#include <TGFileDialog.h>
-#include <TRootEmbeddedCanvas.h>
-#include <TCanvas.h>
-#include <TH1.h>
-#include <TH2.h>
-#include <TRandom.h>
-#include <TSystem.h>
-#include <TEnv.h>
-#include <TGPicture.h>
-#include <TGraph.h>
-
-#include "TGeant3GUI.h"
-
-static AliDrawVolume *gCurrentVolume = new AliDrawVolume("NULL");
-static AliGUIMaterial *gCurrentMaterial = new AliGUIMaterial();
-static AliGUIMedium *gCurrentMedium = new AliGUIMedium();
-static Int_t gCurrentParticle = 1;
-static Int_t gCurrentProcess = 1;
-
-ClassImp(AliGeant3GeometryGUI)
-
- AliGeant3GeometryGUI::AliGeant3GeometryGUI()
-{
-// Constructor
- fPanel = new AliGuiGeomMain(gClient->GetRoot(), 500, 500);
- fNstack = 0;
- fVolumes = new TClonesArray("AliDrawVolume",1000);
- fMaterials = new TClonesArray("AliGUIMaterial",1000);
- fMedia = new TClonesArray("AliGUIMedium",1000);
-// Store local copy of zebra bank entries
- TGeant3 *geant3 = (TGeant3*) gMC;
- if (geant3) {
- fZlq=geant3->Lq();
- fZq=geant3->Q();
- fZiq=geant3->Iq();
- fGclink=geant3->Gclink();
- fGcnum=geant3->Gcnum();
-//
- ReadGeometryTree();
- ReadMaterials();
- }
-}
-void AliGeant3GeometryGUI::Streamer(TBuffer &)
-{
-// Dummy Streamer
-;
-}
-
-
-void AliGeant3GeometryGUI::ReadGeometryTree()
-{
-//
-// Copy zebra volume tree into ROOT LisTree
-//
- char *vname;
- char /* *namec, */ *tmp;
- char namec[30];
-// Icons for
-// Closed folder (=volume containing children)
- const TGPicture* kFolder = gClient->GetPicture("folder_t.xpm");
-// Open folder (=volume containing children)
- const TGPicture* kOpenFolder = gClient->GetPicture("ofolder_t.xpm");
-// Empty object
- const TGPicture* kDocument = gClient->GetPicture("doc_t.xpm");
-
- AliDrawVolume *volume;
-
- Int_t nst=0;
- Int_t nlevel=1;
- Int_t newlevel=nlevel;
-
- volume = new AliDrawVolume("ALIC");
- volume->SetIdVolume(((TGeant3*)gMC)->VolId("ALIC"));
- volume->SetIdCopy(0);
- volume->SetItem(NULL);
- (*fVolumes)[0]=volume;
-//
-// Loop over volumes for which information has been collected
- while(nlevel>nst) {
- for (Int_t i=nst; i<nlevel; i++)
- {
- TGListTreeItem *itemi, *item2;
-// GEANT3 volume number
- Int_t ivol=TMath::Abs(Volume(i)->GetIdVolume());
-// Copy number
-// icopy=1 normal positioning
-// icopy>1 positioning with parposp
-// icopy<0 division
- Int_t icopy = Volume(i)->GetIdCopy();
-// Medium and material number, handle special case of divisions
- Int_t imat, imed;
-
- if (icopy <0) {
- imed=Medium(-ivol);
- imat=Material(-ivol);
- } else {
- imed=Medium(ivol);
- imat=Material(ivol);
- }
-//
-// Number of children
- Int_t nch = NChildren(ivol);
- strcpy(namec,((TGeant3*)gMC)->VolName(ivol));
- if (nch >= 0) {
- printf("\n %s has %d children \n ", namec, nch);
- } else {
- printf("\n %s has divisions \n ", namec);
- }
-//
-// Name to be used in ListTree
- vname = new char[5];
- strncpy(vname,namec, 4);
- vname[4]='\0';
-
- if (icopy >1) {
- sprintf(namec,"%s*%3dPos",namec,icopy);
- } else if (icopy <0) {
- sprintf(namec,"%s*%3dDiv",namec,-icopy);
- }
- if (i>0) {
- itemi=Volume(i)->GetItem();
- } else {
- itemi=NULL;
- }
-
-//
-// Add volume to list tree
-
- if (nch!=0) {
- item2 = fPanel->AddItem(new AliDrawVolume(vname),
- itemi, namec, kOpenFolder, kFolder);
- } else {
- item2 = fPanel->AddItem(new AliDrawVolume(vname),
- itemi, namec, kDocument, kDocument);
- }
-//
-// Add medium information to list tree item
- ((AliDrawVolume *) item2->GetUserData())->SetIdVolume(ivol);
- ((AliDrawVolume *) item2->GetUserData())->SetIdMaterial(imat);
- ((AliDrawVolume *) item2->GetUserData())->SetIdMedium(imed);
-//
-// Set current volume to first list tree entry
- if (!i) gCurrentVolume= ((AliDrawVolume *) item2->GetUserData());
-
-//
-// Collect children information
-//
-// nch < 0: Children by division
- if (nch < 0) {
-//
-// Geant volume number
- Int_t icvol=Child(ivol,1);
-// Name
- strcpy(namec,((TGeant3*)gMC)->VolName(-icvol));
- tmp = new char[4];
- strncpy(tmp,(char *) &namec, 4);
- volume = new AliDrawVolume(namec);
- volume->SetIdVolume(-icvol);
-// Number of divisions
- Int_t jvo = fZlq[fGclink->jvolum-ivol];
- Int_t jdiv = fZlq[jvo-1];
- Int_t ndiv = Int_t (fZq[jdiv+3]);
- volume->SetIdCopy(-ndiv);
-// Link to mother
- volume->SetItem(item2);
- (*fVolumes)[newlevel]=volume;
- printf("\n volume %s %d %d %d", namec, icvol, nch, ndiv);
- newlevel++;
-//
-// Children by positioning
- } else {
- Int_t nnew=0;
-// Loop over children
- for (Int_t j=0; j<nch; j++)
- {
-//
-// Find out if this volume was already positioned and count copies
- Int_t icvol=Child(ivol,j+1);
- icvol = TMath::Abs(icvol);
- Bool_t inList=kFALSE;
- for (Int_t k=0; k<nnew; k++) {
- if (icvol==
- Volume(newlevel-k-1)->GetIdVolume())
- {
- Volume(newlevel-k-1)->AddCopy();
- inList=kTRUE;
- }
- }
-//
-// New child
- if (!inList) {
-//
-// Name
- strcpy(namec,((TGeant3*)gMC)->VolName(icvol));
- tmp = new char[4];
- strncpy(tmp,(char *) &namec, 4);
- volume = new AliDrawVolume(namec);
- volume->SetIdVolume(icvol);
- volume->SetIdCopy(1);
-// Link to mother
- volume->SetItem(item2);
- (*fVolumes)[newlevel]=volume;
- printf("\n volume %s %d %d", namec, icvol, nch);
- newlevel++;
- nnew++;
- }
- }
- }
- }
-// Move one level deaper
- nst=nlevel;
- nlevel=newlevel;
- }
-}
-
-void AliGeant3GeometryGUI::ReadMaterials()
-{
-//
-// Puts media and material names into ComboBox and
-// collects material information
-//
- Float_t a, z, dens, radl, absl;
- a=z=dens=radl=absl=-1;
- Int_t npar=0;
- Int_t imat, isvol, ifield;
- Float_t fieldm, tmaxfd, stemax, deemax, epsil, stmin;
- Float_t par[50];
- Float_t ubuf[50];
- Int_t nwbuf;
-
- char natmed[21], namate[21];
-//
-// Loop over media
- Int_t nEntries=0;
-
- for(Int_t itm=1;itm<=fGcnum->ntmed;itm++) {
- Int_t jtm = fZlq[fGclink->jtmed-itm];
- if (jtm > 0) {
- nEntries++;
-//
-// Get medium parameters
- ((TGeant3*)(gMC))->Gftmed(itm, natmed, imat, isvol, ifield, fieldm,
- tmaxfd, stemax, deemax, epsil, stmin, ubuf, &nwbuf);
- strncpy(natmed,(char*)&fZiq[jtm+1],20);
- natmed[20]='\0';
-//
-// Create new medium object
- AliGUIMedium * medium =
- new AliGUIMedium(itm, imat, natmed, isvol, ifield, fieldm,
- tmaxfd, stemax, deemax, epsil, stmin);
- (*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
- { //Begin local scope for j
- for (Int_t j=23; j<=26; j++) {
- medium->SetPar(j,Cut(itm,j+3));
- }
- } //End local scope for j
- { //Begin local scope for j
- for (Int_t j=27; j<=29; j++) {
- medium->SetPar(j,Cut(itm,j+4));
- }
- } //End local scope for j
-//
-// Add to ComboBox
- fPanel->AddMedium(medium, nEntries);
-//
-// Associated material
- imat = Int_t (fZq[jtm+6]);
- Int_t jma = Int_t (fZlq[fGclink->jmate-imat]);
-//
-// Get material parameters
- ((TGeant3*)(gMC))->Gfmate (imat,namate,a,z,dens,radl,absl,par,npar);
- strncpy(namate,(char *)&fZiq[jma+1],20);
- namate[20]='\0';
-//
-// Create new material object
- AliGUIMaterial * material =
- new AliGUIMaterial(imat,namate,a,z,dens,radl,absl);
- (*fMaterials)[nEntries-1]=material;
- material->Dump();
-//
-// Add to combo box
- fPanel->AddMaterial(material, nEntries);
- gCurrentMaterial=material;
- }
- }
- fPanel->SetComboEntries(fMaterials);
- fPanel->SetMediaComboEntries(fMedia);
- fPanel->Update();
-}
-
-Int_t AliGeant3GeometryGUI::NChildren(Int_t idvol)
-{
-//
-// Return number of children for volume idvol
- Int_t jvo = fZlq[fGclink->jvolum-idvol];
- Int_t nin = Int_t(fZq[jvo+3]);
- return nin;
-}
-
-Int_t AliGeant3GeometryGUI::Child(Int_t idvol, Int_t idc)
-{
-//
-// Return GEANT id of child number idc of volume idvol
- Int_t jvo = fZlq[fGclink->jvolum-idvol];
- Int_t nin=idc;
- Int_t jin = fZlq[jvo-nin];
- Int_t numb = Int_t (fZq[jin +3]);
- if (numb > 1) {
- return -Int_t(fZq[jin+2]);
- } else {
- return Int_t(fZq[jin+2]);
- }
-}
-
-Int_t AliGeant3GeometryGUI::Medium(Int_t idvol)
-{
-//
-// Return medium number for volume idvol.
-// If idvol is negative the volume results from a division.
- Int_t imed;
- if (idvol > 0) {
- Int_t jvo = fZlq[fGclink->jvolum-idvol];
- imed = Int_t(fZq[jvo+4]);
- } else {
- idvol=-idvol;
- Int_t jdiv = fZlq[fGclink->jvolum-idvol];
- Int_t ivin = Int_t ( fZq[jdiv+2]);
- Int_t jvin = fZlq[fGclink->jvolum-ivin];
- imed = Int_t (fZq[jvin+4]);
- }
- return imed;
-}
-
-Int_t AliGeant3GeometryGUI::Material(Int_t idvol)
-{
-// Return material number for volume idvol.
-// If idvol is negative the volume results from a division.
-
- Int_t imed=Medium(idvol);
- Int_t jtm = fZlq[fGclink->jtmed-imed];
- return Int_t (fZq[jtm+6]);
-}
-
-
-Float_t AliGeant3GeometryGUI::Cut(Int_t imed, Int_t icut)
-{
-// Return cuts icut for medium idmed
-//
- Int_t jtm = fZlq[fGclink->jtmed-imed];
-//
-// Have the defaults been modified ??
- Int_t jtmn = fZlq[jtm];
- if (jtmn >0) {
- jtm=jtmn;
-
- } else {
- jtm=fGclink->jtmed;
- }
-
- return Float_t (fZq[jtm+icut]);
-}
-
-ClassImp(AliDrawVolume)
-//
-// Drawing parameter tags
-enum AliDrawParamId {
- 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;
- fPsi = 0;
- fU = 10;
- fV = 10;
- fUscale = 0.01;
- fVscale = 0.01;
- fHide=0;
- fShadow=0;
- fFill=1;
- fSeen=1;
- fClip=0;
- fClipXmin=0.;
- fClipXmax=2000.;
- fClipYmin=0.;
- fClipYmax=2000.;
- fClipZmin=0.;
- fClipZmax=2000.;
-}
-
-char* AliDrawVolume::Name()
-{
-//
-// Return volume name
- return fName;
-}
-
-
-void AliDrawVolume::Streamer(TBuffer &)
-{
-// Dummy Streamer
-;
-}
-
-
-
-void AliDrawVolume::Draw(Option_t *)
-{
-// Wraps the geant Gdraw
- gMC->Gsatt(fName,"seen", fSeen);
-
- if (fHide) {
- gMC->Gdopt("hide", "on");
- } else {
- gMC->Gdopt("hide", "off");
- }
-
- if (fShadow) {
- gMC->Gdopt("shad", "on");
- gMC->Gsatt("*", "fill", fFill);
- } else {
- gMC->Gdopt("shad", "off");
- }
-
- gMC->SetClipBox(".");
- if (fClip) {
- gMC->SetClipBox("*", fClipXmin, fClipXmax,
- fClipYmin, fClipYmax, fClipZmin, fClipZmax);
- } else {
- gMC->SetClipBox(".");
- }
-
-
- gMC->Gdraw(fName, fTheta, fPhi, fPsi, fU, fV, fUscale, fVscale);
- THIGZ *higz = (THIGZ*)gROOT->GetListOfCanvases()->FindObject("higz");
- if (higz) higz->Update();
-}
-
-void AliDrawVolume::DrawSpec()
-{
-// Wraps the Geant DrawSpec
- gMC->Gsatt(fName,"seen", fSeen);
-
- if (fHide) {
- gMC->Gdopt("hide", "on");
- } else {
- gMC->Gdopt("hide", "off");
- }
-
- if (fShadow) {
- gMC->Gdopt("shad", "on");
- gMC->Gsatt("*", "fill", fFill);
- } else {
- gMC->Gdopt("shad", "off");
- }
-
- gMC->SetClipBox(".");
- if (fClip) {
- gMC->SetClipBox("*", fClipXmin, fClipXmax, fClipYmin, fClipYmax, fClipZmin, fClipZmax);
- } else {
- gMC->SetClipBox(".");
- }
-
-
- ((TGeant3*) gMC)->DrawOneSpec(fName);
- THIGZ *higz = (THIGZ*)gROOT->GetListOfCanvases()->FindObject("higz");
- if (higz) higz->Update();
-}
-
-void AliDrawVolume::SetParam(Int_t ip, Float_t param)
-{
-// Set drawing parameters
- switch (ip) {
- case kTheta:
- fTheta=param;
- break;
- case kPhi:
- fPhi=param;
- break;
- case kPsi:
- fPsi=param;
- break;
- case kU:
- fU=param;
- break;
- case kV:
- fV=param;
- break;
- case kUscale:
- fUscale=param;
- break;
- case kVscale:
- fVscale=param;
- break;
- case kHide:
- fHide=Int_t(param);
- break;
- case kShadow:
- fShadow=Int_t(param);
- break;
- case kFill:
- fFill=Int_t(param);
- break;
- case kSeen:
- fSeen=Int_t(param);
- break;
- case kClip:
- fClip=Int_t(param);
- break;
- case kClipXmin:
- fClipXmin=param;
- break;
- case kClipXmax:
- fClipXmax=param;
- break;
- case kClipYmin:
- fClipYmin=param;
- break;
- case kClipYmax:
- fClipYmax=param;
- break;
- case kClipZmin:
- fClipZmin=param;
- break;
- case kClipZmax:
- fClipZmax=param;
- break;
- }
-}
-
-Float_t AliDrawVolume::GetParam(Int_t ip)
-{
-// Get drawing parameters
- switch (ip) {
- case kTheta:
- return fTheta;
- case kPhi:
- return fPhi;
- case kPsi:
- return fPsi;
- case kU:
- return fU;
- case kV:
- return fV;
- case kUscale:
- return fUscale;
- case kVscale:
- return fVscale;
- case kHide:
- return Float_t(fHide);
- case kShadow:
- return Float_t(fShadow);
- case kFill:
- return Float_t(fFill);
- case kSeen:
- return Float_t(fSeen);
- case kClip:
- return Float_t(fClip);
- case kClipXmin:
- return fClipXmin;
- case kClipXmax:
- return fClipXmax;
- case kClipYmin:
- return fClipYmin;
- case kClipYmax:
- return fClipYmax;
- case kClipZmin:
- return fClipZmin;
- case kClipZmax:
- return fClipZmax;
- default:
- return 0.;
- }
- return 0.;
-}
-
-
-ClassImp(AliGuiGeomMain)
-
- 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* kLabelTextC[10] =
- {"CUTGAM", "CUTELE", "CUTNEU", "CUTHAD", "CUTMUO", "BCUTE", "BCUTM",
- "DCUTE ", "DCUTM ", "PPCUTM"};
-
-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* kLabelTextMechanism[24] =
-{"HADF", "INEF", "ELAF", "FISF", "CAPF",
- "HADG", "INEG", "ELAG", "FISG", "CAPG",
- "LOSS", "PHOT", "ANNI", "COMP", "BREM",
- "PAIR", "DRAY", "PFIS", "RAYL", "HADG",
- "MUNU", "RANG", "STEP", "MUON"};
-
-
-
-
-enum ETestCommandIdentifiers {
- kFileOpen,
- kFileSave,
- kFileSaveAs,
- kFileExit,
-
- kTestDlg,
-
- kHelpContents,
- kHelpSearch,
- kHelpAbout,
-
-
- kVId1,
- kHId1,
- kVId2,
- kHId2,
-
- kVSId1,
- kHSId1,
- kVSId2,
- kHSId2
-};
-
-
-Int_t mbButtonId[9] = { kMBYes, kMBNo, kMBOk, kMBApply,
- kMBRetry, kMBIgnore, kMBCancel,
- kMBClose, kMBDismiss };
-
-EMsgBoxIcon mbIcon[4] = { kMBIconStop, kMBIconQuestion,
- kMBIconExclamation, kMBIconAsterisk };
-
-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;
- 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", kTestDlg);
- fMenuTest->AddSeparator();
- fMenuTest->Associate(this);
-
-
- fMenuHelp = new TGPopupMenu(gClient->GetRoot());
- fMenuHelp->AddEntry("&Contents", kHelpContents);
- fMenuHelp->AddEntry("&Search...", kHelpSearch);
- fMenuHelp->AddSeparator();
- fMenuHelp->AddEntry("&About", kHelpAbout);
-
- 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);
- fMenuTest->Associate(this);
- fMenuHelp->Associate(this);
-
- fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
- fMenuBar->AddPopup("&File", fMenuFile, fMenuBarItemLayout);
- fMenuBar->AddPopup("&Draw Control", fMenuTest, fMenuBarItemLayout);
- fMenuBar->AddPopup("&Help", fMenuHelp, fMenuBarHelpLayout);
-
- AddFrame(fMenuBar, fMenuBarLayout);
-
-//
-// Volumes
-//
- fTab = new TGTab(this, 400, 400);
- TGCompositeFrame *tf = fTab->AddTab("Volumes");
- TGLayoutHints *lTab = new TGLayoutHints(kLHintsBottom | kLHintsExpandX |
- kLHintsExpandY, 2, 2, 5, 1);
- AddFrame(fTab, lTab);
-
-// Create TGCanvas and a canvas container which uses a tile layout manager
- fCanvasWindow = new TGCanvas(tf, 400, 240);
-// Create TreeList
- fLt = new TGListTree(fCanvasWindow->GetViewPort(), 10, 10, kHorizontalFrame,
- fgWhitePixel);
- fLt->Associate(this);
- fCanvasWindow->SetContainer(fLt);
-
-
- TGLayoutHints *lo = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY);
- tf->AddFrame(fCanvasWindow, lo);
-//
-// Materials
-//
- tf = fTab->AddTab("Materials");
- fF2 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
- fL2 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
-// ComboBox for materials
- fMaterialCombo = new TGComboBox(fF2, 1);
- fF2->AddFrame(fMaterialCombo, fL2);
-//
-// text labels with material properties
-//
- Text_t* labelText[6] =
- {"Material Number ",
- "Atomic Weight ",
- "Atomic Number ",
- "Density ",
- "Radiation Length ",
- "Absorption Length"};
-
- TGLayoutHints* bly =
- new TGLayoutHints(kLHintsTop | kLHintsExpandY, 5, 5, 5, 5);
- TGLayoutHints* bFly1 =
- new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
- fF21 = new TGCompositeFrame(fF2, 60, 20, kVerticalFrame);
- fF2->AddFrame(fF21,fL2);
- { //Begin local scope for i
- 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);
- 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);
- }
- } //End local scope for i
- tf->AddFrame(fF2, fL2);
- fMaterialCombo->Resize(200, 20);
- fMaterialCombo->Associate(this);
-
-
-// Media Combo
-//
- tf = fTab->AddTab("Media");
- fF3 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
-// ComboBox for tracking media
- fMediaCombo = new TGComboBox(fF3, 2);
- fF3->AddFrame(fMediaCombo, fL2);
-//
-// text labels with material properties
-//
- Text_t* labelTextM[8] =
- {"Sensitivity Flag ",
- "Magnetic Field Flag ",
- "Maximum Field ",
- "Max. Ang. Deviation ",
- "Maximum Step ",
- "Max. Frac. Energy Loss",
- "Crossing Precission ",
- "Minimum Step Size "};
-
- fF31 = new TGCompositeFrame(fF3, 60, 20, kVerticalFrame);
- fF3->AddFrame(fF31,fL2);
- { //Begin local scope for i
- 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);
- 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);
- }
- } //End local scope for i
- tf->AddFrame(fF3, fL2);
- fMediaCombo->Resize(200, 20);
- fMediaCombo->Associate(this);
-//
-// Processes
- tf = fTab->AddTab("Processes");
- fF4 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
- fProcessLB = new TGListBox(fF4, 1);
- fF4->AddFrame(fProcessLB, fL2);
- tf->AddFrame(fF4, fL2);
- fProcessLB->Resize(150, 350);
- fProcessLB->Associate(this);
-
-//
-// Cuts
- tf = fTab->AddTab("Cuts");
- fF5 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
- fCutsLB = new TGListBox(fF5, 1);
- fF5->AddFrame(fCutsLB, fL2);
- tf->AddFrame(fF5, fL2);
- fCutsLB->Resize(150, 350);
-
-//
-// de/dx and cross-sections
- tf = fTab->AddTab("DE/DX and X-Sections");
- fF6 = new TGCompositeFrame(tf, 60, 20, kHorizontalFrame);
-
-// ComboBox for particles
- fF61 = new TGCompositeFrame(fF6, 60, 20, kVerticalFrame);
- fF6->AddFrame(fF61, fL2);
- fParticleCombo = new TGComboBox(fF61, 3);
- fF61->AddFrame(fParticleCombo, fL2);
- { //Begin local scope for i
- for (Int_t i = 0; i < 24; i++) {
- char tmp[20];
- sprintf(tmp, "%s", kLabelTextPart[i]);
- fParticleCombo->AddEntry(tmp, i+1);
- }
- } //End local scope for i
- fParticleCombo->Select(1);
- fParticleCombo->Resize(100, 20);
- fParticleCombo->Associate(this);
-
-// ComboBox for mechanisms
- fF63 = new TGCompositeFrame(fF6, 60, 20, kVerticalFrame);
- fF6->AddFrame(fF63, fL2);
- fMechanismCombo = new TGComboBox(fF63, 4);
- fF63->AddFrame(fMechanismCombo, fL2);
- { //Begin local scope for i
- for (Int_t i = 0; i < 24; i++) {
- char tmp[20];
- sprintf(tmp, "%s", kLabelTextMechanism[i]);
- fMechanismCombo->AddEntry(tmp, i+1);
- }
- } //End local scope for i
- fMechanismCombo->Select(1);
- fMechanismCombo->Resize(100, 20);
- fMechanismCombo->Associate(this);
-
-//
-// Energy Range
-//
- fTbh61 = new TGTextBuffer(10);
- fTeh61 = new TGTextEntry(fF61, fTbh61,10);
- fTbh61->AddText(0, " 100");
- fTeh61->Associate(this);
-
- fTbh62 = new TGTextBuffer(10);
- fTeh62 = new TGTextEntry(fF61, fTbh62,11);
- fTbh62->AddText(0, "0.001");
- fTeh62->Associate(this);
-
- fTbh63 = new TGTextBuffer(10);
- fTeh63 = new TGTextEntry(fF61, fTbh63,12);
- fTbh63->AddText(0, "10.");
- fTeh63->Associate(this);
-
- fEmin=0.001;
- fEmax=10.;
- 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);
-//
-// Plot Button
- fF62 = new TGCompositeFrame(fF6, 60, 20, kHorizontalFrame);
- fF6->AddFrame(fF62, fL2);
- fPlotButton = new TGTextButton(fF62, "Plot", 1);
- fPlotButton -> Associate(this);
- fF62->AddFrame(fPlotButton);
-
- tf->AddFrame(fF6, fL2);
-// Window name and final mapping
-//
- SetWindowName("AliRoot Geometry Browser");
- MapSubwindows();
- // We need to use GetDefault...() to initialize the layout algorithm...
- Resize(GetDefaultSize());
- MapWindow();
-}
-
-AliGuiGeomMain::~AliGuiGeomMain()
-{
- // Delete all created widgets.
-
- delete fCanvasWindow;
-
- delete fMenuBarLayout;
- delete fMenuBarItemLayout;
- delete fMenuBarHelpLayout;
-
- delete fMenuFile;
- delete fMenuTest;
- delete fMenuHelp;
-}
-
-void AliGuiGeomMain::Streamer(TBuffer &)
-{
-// Dummy streamer
-;
-}
-
-void AliGuiGeomMain::Plot()
-{
-// 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];
- Int_t ixst;
- Int_t imate=gCurrentMaterial->Id();
- Float_t z=gCurrentMaterial->Z();
- Float_t a=gCurrentMaterial->A();
- Float_t density=gCurrentMaterial->Density();
-
- Int_t ipart=gCurrentParticle;
- const char *kChMeca= kLabelTextMechanism[gCurrentProcess-1];
- char* tmp;
- tmp = new char[5];
- strncpy(tmp, kChMeca, 4);
- tmp[4]='\0';
- Int_t kdim=fNbins;
- Float_t de=(fEmax-fEmin)/fNbins;
- { //Begin local scope for i
- for (Int_t i=0; i<kdim; i++) {
- tkin[i]=fEmin+Float_t(i)*de;
- value[i]=0.;
- }
- } //End local scope for i
- 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.*kAvo*density/a;
- }
- }
-
-
- 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);
- c1->Divide(1,1);
- c1->cd(1);
-
- graph->SetFillColor(42);
- graph->SetMarkerColor(4);
- graph->SetMarkerStyle(21);
- graph->Draw("AC");
- graph->GetHistogram()->SetXTitle("Energy (GeV)");
- if (kChMeca == "RANG" || kChMeca == "STEP") {
- graph->GetHistogram()->SetYTitle
- ("Distance (cm)");
- } else if (kChMeca == "LOSS" || kChMeca == "MUON") {
- graph->GetHistogram()->SetYTitle("dE/dx (MeV/cm)");
- } else {
- graph->GetHistogram()->SetYTitle
- ("Macroscopic X-Section (1/cm)");
- }
- }
-
- delete tkin;
- delete value;
- delete pcut;
-
-
-}
-
-void AliGuiGeomMain::Update()
-{
-// Update widgets
- if (fDialog) {
- fDialog->Update();
- }
-
- Int_t imat=gCurrentVolume->Material();
- Int_t nmat=fComboEntries->GetEntriesFast();
- Int_t i=0;
- for (i=0; i<nmat; i++) {
- gCurrentMaterial = (AliGUIMaterial*)
- (fComboEntries->UncheckedAt(i));
- if (gCurrentMaterial->Id()==imat) break;
- }
- Int_t imed = gCurrentVolume->Medium();
- Int_t nmed=fComboMediaEntries->GetEntriesFast();
- for (i=0; i<nmed; i++) {
- gCurrentMedium = (AliGUIMedium*)
- (fComboMediaEntries->UncheckedAt(i));
- if (gCurrentMedium->Id()==imed) break;
- }
-
- UpdateCombo();
- UpdateListBox();
-
-}
-
-void AliGuiGeomMain::UpdateCombo()
-{
-// Update combos
-
- Int_t imat = gCurrentMaterial->Id();
- Float_t a = gCurrentMaterial->A();
- Float_t z = gCurrentMaterial->Z();
- Float_t dens = gCurrentMaterial->Density();
- Float_t radl = gCurrentMaterial->RadiationLength();
- Float_t absl = gCurrentMaterial->AbsorptionLength();
- Int_t entry=gCurrentMaterial->ItemId();
-//
-//
- fMaterialCombo->Select(entry);
- fMediaCombo->Select(entry);
- char buf[10];
-
- sprintf(buf, "%10i", imat);
- fTbh[0]->Clear();
- fTbh[0]->AddText(0, buf);
- gClient->NeedRedraw(fTeh[0]);
- sprintf(buf, "%10.2e", a);
- fTbh[1]->Clear();
- fTbh[1]->AddText(0, buf);
- gClient->NeedRedraw(fTeh[1]);
-
- sprintf(buf, "%10.2e", z);
- fTbh[2]->Clear();
- fTbh[2]->AddText(0, buf);
- gClient->NeedRedraw(fTeh[2]);
-
- sprintf(buf, "%10.2e", dens);
- fTbh[3]->Clear();
- fTbh[3]->AddText(0, buf);
- gClient->NeedRedraw(fTeh[3]);
-
- sprintf(buf, "%10.2e", radl);
- fTbh[4]->Clear();
- fTbh[4]->AddText(0, buf);
- gClient->NeedRedraw(fTeh[4]);
-
- sprintf(buf, "%10.2e", absl);
- fTbh[5]->Clear();
- fTbh[5]->AddText(0, buf);
- gClient->NeedRedraw(fTeh[5]);
-
-// Media Combo
- sprintf(buf, "%10i", gCurrentMedium->Isvol());
- fTbhM[0]->Clear();
- fTbhM[0]->AddText(0, buf);
- gClient->NeedRedraw(fTehM[0]);
-
-
- sprintf(buf, "%10i", gCurrentMedium->Ifield());
- fTbhM[1]->Clear();
- fTbhM[1]->AddText(0, buf);
- gClient->NeedRedraw(fTehM[1]);
-
- sprintf(buf, "%10.2e", gCurrentMedium->Fieldm());
- fTbhM[2]->Clear();
- fTbhM[2]->AddText(0, buf);
- gClient->NeedRedraw(fTehM[2]);
-
- sprintf(buf, "%10.2e", gCurrentMedium->Tmaxfd());
- fTbhM[3]->Clear();
- fTbhM[3]->AddText(0, buf);
- gClient->NeedRedraw(fTehM[3]);
-
- sprintf(buf, "%10.2e", gCurrentMedium->Stemax());
- fTbhM[4]->Clear();
- fTbhM[4]->AddText(0, buf);
- gClient->NeedRedraw(fTehM[4]);
-
- sprintf(buf, "%10.2e", gCurrentMedium->Deemax());
- fTbhM[5]->Clear();
- fTbhM[5]->AddText(0, buf);
- gClient->NeedRedraw(fTehM[5]);
-
- sprintf(buf, "%10.2e", gCurrentMedium->Epsil());
- fTbhM[6]->Clear();
- fTbhM[6]->AddText(0, buf);
- gClient->NeedRedraw(fTehM[6]);
-
- sprintf(buf, "%10.2e", gCurrentMedium->Stmin());
- fTbhM[7]->Clear();
- fTbhM[7]->AddText(0, buf);
- gClient->NeedRedraw(fTehM[7]);
-}
-
-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", kLabelTextP[i-11], Int_t(p));
- fProcessLB->AddEntry(tmp, i-10);
- }
- fProcessLB->MapSubwindows();
- fProcessLB->Layout();
-
- fCutsLB->RemoveEntries(1,10);
- for (i=1; i < 11; i++) {
- Float_t p=gCurrentMedium->GetPar(i);
- char tmp[20];
- sprintf(tmp, "%6s%10.3e", kLabelTextC[i-1], p);
- fCutsLB->AddEntry(tmp,i);
- }
- fCutsLB->MapSubwindows();
- fCutsLB->Layout();
-}
-
-
-void AliGuiGeomMain::CloseWindow()
-{
- // Got close message for this MainFrame. Calls parent CloseWindow()
- // (which destroys the window) and terminate the application.
- // The close message is generated by the window manager when its close
- // window menu item is selected.
-
- TGMainFrame::CloseWindow();
- gApplication->Terminate(0);
-}
-
-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 kC_TEXTENTRY:
- switch (GET_SUBMSG(msg)) {
- case kTE_TEXTCHANGED:
- switch (parm1) {
- case 10:
- fNbins=(Int_t) atof(fTbh61->GetString());
- break;
- case 11:
- fEmin= atof(fTbh62->GetString());
- break;
- case 12:
- fEmax= atof(fTbh63->GetString());
- break;
- }
- printf("\n %d %f %f binning", fNbins, fEmin, fEmax);
- }
- break;
-//
-// ListTree for volumes
- case kC_LISTTREE:
- switch (GET_SUBMSG(msg)) {
-//
-// Handle mouse click
- case kCT_ITEMCLICK:
-//
-// Button 1: Select volume
- if (parm1 == kButton1) {
- TGListTreeItem *item;
- if ((item = fLt->GetSelected()))
- {
- gCurrentVolume=((AliDrawVolume *) item->GetUserData());
- Update();
- }
- }
-//
-// Button 2: Draw volume specifications
-
- if (parm1 == kButton2) {
- TGListTreeItem *item;
- if ((item = fLt->GetSelected()))
- {
-
- ((AliDrawVolume *) item->GetUserData())->DrawSpec();
-
- gCurrentVolume=((AliDrawVolume *) item->GetUserData());
- Update();
- }
- }
-//
-// Button 3: Draw Volume
- if (parm1 == kButton3) {
- TGListTreeItem *item;
- if ((item = fLt->GetSelected()))
- {
- ((AliDrawVolume *) item->GetUserData())->Draw();
- gCurrentVolume=((AliDrawVolume *) item->GetUserData());
- Update();
- }
- }
-
-
- break;
- case kCT_ITEMDBLCLICK:
- if (parm1 == kButton1) {
- if (fLt->GetSelected() != 0) {
- gClient->NeedRedraw(fLt);
- }
- }
- break;
- default:
- break;
- }
- break;
- case kC_COMMAND:
- switch (GET_SUBMSG(msg)) {
- case kCM_BUTTON:
- switch(parm1) {
- case 1:
- Plot();
- break;
- }
- break;
- case kCM_COMBOBOX:
-//
-// Combo box bindings
- switch(parm1) {
-//
-// Material Combo
- case 1:
- gCurrentMaterial=(AliGUIMaterial*)
- (fComboEntries->UncheckedAt(Int_t(parm2-1)));
- gCurrentMedium=(AliGUIMedium*)
- (fComboMediaEntries->UncheckedAt(Int_t(parm2-1)));
- UpdateCombo();
- UpdateListBox();
- break;
-//
-// Media Combo
- case 2:
- gCurrentMedium=(AliGUIMedium*)
- (fComboMediaEntries->UncheckedAt(Int_t(parm2-1)));
- gCurrentMaterial=(AliGUIMaterial*)
- (fComboEntries->UncheckedAt(Int_t(parm2-1)));
- UpdateCombo();
- UpdateListBox();
- break;
-//
-// Particle Combo
- case 3:
- gCurrentParticle=Int_t(parm2);
- break;
-//
-// Mechanism Combo
- case 4:
- gCurrentProcess=Int_t(parm2);
- printf("\n Process %d", gCurrentProcess);
- break;
- }
- break;
- case kCM_MENUSELECT:
- break;
-
- case kCM_MENU:
- switch (parm1) {
-
- case kFileOpen:
- {
- TGFileInfo fi;
- fi.fFileTypes = (char **)kFileTypes;
- new TGFileDialog(gClient->GetRoot(), this, kFDOpen,&fi);
- }
- break;
-
- case kTestDlg:
- fDialog = new AliGuiGeomDialog
- (gClient->GetRoot(), this, 400, 200);
- break;
-
- case kFileSave:
- printf("kFileSave\n");
- break;
-
- case kFileExit:
- CloseWindow(); // this also terminates theApp
- break;
- default:
- break;
- }
- default:
- break;
- }
- default:
- break;
- }
- return kTRUE;
-}
-
-void AliGuiGeomMain::AddMaterial(AliGUIMaterial *Material, Int_t i)
-{
-// Add material to material combo
- char* tmp;
- tmp=Material->Name();
- Material->SetItemId(i);
- fMaterialCombo->AddEntry(tmp, i);
- fMaterialCombo->Select(i);
- fMaterialCombo->Resize(200, 20);
-}
-
-void AliGuiGeomMain::AddMedium(AliGUIMedium *Medium, Int_t i)
-{
-// Add medium to medium combo
- char* tmp;
- tmp=Medium->Name();
- Medium->SetItemId(i);
-
- fMediaCombo->AddEntry(tmp, i);
- fMediaCombo->Select(i);
- fMediaCombo->Resize(200, 20);
-}
-
-
-AliGuiGeomDialog::AliGuiGeomDialog(const TGWindow *p, const TGWindow *main, UInt_t w,
- UInt_t h, UInt_t options)
- : TGTransientFrame(p, main, w, h, options)
-{
- // Create a dialog window. A dialog window pops up with respect to its
- // "main" window.
-
- fFrame1 = new TGHorizontalFrame(this, 60, 20, kFixedWidth);
-
- fOkButton = new TGTextButton(fFrame1, "&Ok", 1);
- fOkButton->Associate(this);
- fCancelButton = new TGTextButton(fFrame1, "&Cancel", 2);
- fCancelButton->Associate(this);
-
- fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
- 2, 2, 2, 2);
- fL2 = new TGLayoutHints(kLHintsBottom | kLHintsRight, 2, 2, 5, 1);
-
- fFrame1->AddFrame(fOkButton, fL1);
- fFrame1->AddFrame(fCancelButton, fL1);
-
- fFrame1->Resize(150, fOkButton->GetDefaultHeight());
- AddFrame(fFrame1, fL2);
-
- //--------- create Tab widget and some composite frames for Tab testing
-
- fTab = new TGTab(this, 300, 300);
- fL3 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5);
-//
-// Tab1: Sliders
-//
- TGCompositeFrame *tf = fTab->AddTab("Draw");
- fF1 = new AliGUISliders(tf, this, 60, 20);
- tf->AddFrame(fF1,fL3);
-
-//
-// Tab2: Drawing Options
-//
- tf = fTab->AddTab("Options");
- fL1 = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
- 200, 2, 2, 2);
- fF2 = new TGCompositeFrame(tf, 60, 20, kVerticalFrame);
-
- fF2->AddFrame(fChk1 = new TGCheckButton(fF2, "Shadow", 86), fL3);
- fF2->AddFrame(fChk2 = new TGCheckButton(fF2, "Hide ", 87), fL3);
- fF2->AddFrame(fChk3 = new TGCheckButton(fF2, "Clip ", 88), fL3);
-
- fF2->AddFrame(fLabel1 = new TGLabel(fF2, "Fill"),fL3);
-
- fCombo = new TGComboBox(fF2, 89);
- fF2->AddFrame(fCombo, fL3);
-
- tf->AddFrame(fF2, fL3);
-
- int i;
- for (i = 0; i < 8; i++) {
- char tmp[20];
-
- sprintf(tmp, "%i", i+1);
- fCombo->AddEntry(tmp, i+1);
- }
- fCombo->Select(1);
- fCombo->Resize(50, 20);
- fCombo->Associate(this);
-
- fChk1->Associate(this);
- fChk2->Associate(this);
- fChk3->Associate(this);
-//
-// Tab3: Seen Option
-//
- tf = fTab->AddTab("Seen");
- fF3 = new TGCompositeFrame(tf, 60, 20, kVerticalFrame);
- fF3->AddFrame(fLabel2 = new TGLabel(fF3, "Seen"),fL3);
- fCombo2 = new TGComboBox(fF3, 90);
- fF3->AddFrame(fCombo2, fL3);
- tf->AddFrame(fF3, fL3);
-
- for (i = 0; i < 4; i++) {
- char tmp[20];
-
- sprintf(tmp, "%i", i-2);
- fCombo2->AddEntry(tmp, i+1);
- }
- fCombo2->Select(4);
- fCombo2->Resize(50, 20);
- fCombo2->Associate(this);
-//
-// Tab4: Clip Box
-//
- tf = fTab->AddTab("ClipBox");
- //--- layout for buttons: top align, equally expand horizontally
- fBly = new TGLayoutHints(kLHintsTop | kLHintsExpandY, 5, 5, 5, 5);
-
- //--- layout for the frame: place at bottom, right aligned
- fBfly1 = new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
-//
-// Frames
-//
-// Slider1
- fF4 = new TGCompositeFrame(tf, 60, 20, kVerticalFrame);
-
- fHSframe1 = new TGHorizontalFrame(fF4, 400, 100, kFixedWidth);
-
- fTbh11 = new TGTextBuffer(10);
- fTeh11 = new TGTextEntry(fHSframe1, fTbh11,1);
- fTbh11->AddText(0, " 0");
- fTeh11->Associate(this);
-
- fTbh12 = new TGTextBuffer(10);
- fTeh12 = new TGTextEntry(fHSframe1, fTbh12,1);
- fTbh12->AddText(0, "2000");
- fTeh12->Associate(this);
-
- fDslider1 = new TGDoubleHSlider(fHSframe1, 400, kSlider1 | kScaleBoth, 1);
- fDslider1->Associate(this);
- fDslider1->SetRange(-2000, 2000);
- fDslider1->SetPosition(0, 2000);
-
- fSLabel1 = new TGLabel(fHSframe1, "xmin-xmax");
-
- fHSframe1->AddFrame(fSLabel1, fBfly1);
- fHSframe1->AddFrame(fTeh11, fBfly1);
- fHSframe1->AddFrame(fTeh12, fBfly1);
- fHSframe1->AddFrame(fDslider1, fBfly1);
-
- fF4->AddFrame(fHSframe1, fBly);
-
-//
- fHSframe2 = new TGHorizontalFrame(fF4, 400, 100, kFixedWidth);
-
- fTbh21 = new TGTextBuffer(10);
- fTeh21 = new TGTextEntry(fHSframe2, fTbh21,1);
- fTbh21->AddText(0, " 0");
- fTeh21->Associate(this);
-
- fTbh22 = new TGTextBuffer(10);
- fTeh22 = new TGTextEntry(fHSframe2, fTbh22,1);
- fTbh22->AddText(0, "2000");
- fTeh22->Associate(this);
-
- fDslider2 = new TGDoubleHSlider(fHSframe2, 400, kSlider1 | kScaleBoth, 2);
- fDslider2->Associate(this);
- fDslider2->SetRange(-2000, 2000);
- fDslider2->SetPosition(0, 2000);
-
- fSLabel2 = new TGLabel(fHSframe2, "ymin-ymax");
-
- fHSframe2->AddFrame(fSLabel2, fBfly1);
- fHSframe2->AddFrame(fTeh21, fBfly1);
- fHSframe2->AddFrame(fTeh22, fBfly1);
- fHSframe2->AddFrame(fDslider2, fBfly1);
-
- fF4->AddFrame(fHSframe2, fBly);
-
-//
- fHSframe3 = new TGHorizontalFrame(fF4, 400, 100, kFixedWidth);
-
- fTbh31 = new TGTextBuffer(10);
- fTeh31 = new TGTextEntry(fHSframe3, fTbh31,1);
- fTbh31->AddText(0, " 0");
- fTeh31->Associate(this);
-
- fTbh32 = new TGTextBuffer(10);
- fTeh32 = new TGTextEntry(fHSframe3, fTbh32,1);
- fTbh32->AddText(0, "2000");
- fTeh32->Associate(this);
-
- fDslider3 = new TGDoubleHSlider(fHSframe3, 400, kSlider1 | kScaleBoth, 3);
- fDslider3->Associate(this);
- fDslider3->SetRange(-2000, 2000);
- fDslider3->SetPosition(0, 2000);
-
- fSLabel3 = new TGLabel(fHSframe3, "zmin-zmax");
-
- fHSframe3->AddFrame(fSLabel3, fBfly1);
- fHSframe3->AddFrame(fTeh31, fBfly1);
- fHSframe3->AddFrame(fTeh32, fBfly1);
- fHSframe3->AddFrame(fDslider3, fBfly1);
-
- fF4->AddFrame(fHSframe3, fBly);
- tf->AddFrame(fF4, fL3);
-//
-//
- TGLayoutHints *fL5 = new TGLayoutHints(kLHintsBottom | kLHintsExpandX |
- kLHintsExpandY, 2, 2, 5, 1);
- AddFrame(fTab, fL5);
-
- MapSubwindows();
- Resize(GetDefaultSize());
-
- // position relative to the parent's window
- Window_t wdum;
- int ax, ay;
- gVirtualX->TranslateCoordinates(main->GetId(), GetParent()->GetId(),
- (((TGFrame *) main)->GetWidth() - fWidth) >> 1,
- (((TGFrame *) main)->GetHeight() - fHeight) >> 1,
- ax, ay, wdum);
- Move(ax, ay);
-
- SetWindowName("Dialog");
-
- MapWindow();
- //gClient->WaitFor(this); // otherwise canvas contextmenu does not work
-}
-
-AliGuiGeomDialog::~AliGuiGeomDialog()
-{
- // Delete test dialog widgets.
-
- delete fOkButton;
- delete fCancelButton;
- delete fFrame1;
- delete fChk1; delete fChk2;
- delete fF1; delete fF2; delete fF3; delete fF4;
- delete fCombo;
- delete fTab;
- delete fL3; delete fL4;
- delete fL1; delete fL2;
- delete fBly; delete fBfly1;
- delete fTbh11; delete fTbh12; delete fTbh21; delete fTbh22;
- delete fTbh31; delete fTbh32; delete fTeh11; delete fTeh12;
- delete fTeh21; delete fTeh22; delete fTeh31; delete fTeh32;
- delete fDslider1; delete fDslider2; delete fDslider3;
- delete fSLabel1; delete fSLabel2; delete fSLabel3;
-}
-
-void AliGuiGeomDialog::Update()
-{
-// Update widgets
-
- Float_t param;
-// Update Sliders
- if (fF1) {
- fF1->Update();
- }
-// Seen
- if (fCombo2) {
- param=gCurrentVolume->GetParam(kSeen);
- fCombo2->Select(Int_t(param)+3);
- }
-// Hide, Shadow, Clip
- if (fChk1) {
- if (Int_t(gCurrentVolume->GetParam(kShadow))) {
- fChk1->SetState(kButtonDown);
- } else {
- fChk1->SetState(kButtonUp);
- }
- }
-
- if (fChk2) {
- if (Int_t(gCurrentVolume->GetParam(kHide))) {
- fChk2->SetState(kButtonDown);
- } else {
- fChk2->SetState(kButtonUp);
- }
- }
-
- if (fChk3) {
- if (Int_t(gCurrentVolume->GetParam(kClip))) {
- fChk3->SetState(kButtonDown);
- } else {
- fChk3->SetState(kButtonUp);
- }
- }
-
-}
-
-void AliGuiGeomDialog::CloseWindow()
-{
- // Called when window is closed via the window manager.
- delete this;
-}
-
-Bool_t AliGuiGeomDialog::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
-{
- // Process messages coming from widgets associated with the dialog.
- char buf[10];
- Float_t min,max;
- switch (GET_MSG(msg)) {
- case kC_HSLIDER:
- switch (GET_SUBMSG(msg)) {
- case kSL_POS:
- switch (Int_t(parm1)) {
- case 1:
- min=fDslider1->GetMinPosition();
- max=fDslider1->GetMaxPosition();
- sprintf(buf, "%6.2f", min);
- fTbh11->Clear();
- fTbh11->AddText(0, buf);
- sprintf(buf, "%6.2f", max);
- fTbh12->Clear();
- fTbh12->AddText(0, buf);
- gClient->NeedRedraw(fTeh11);
- gClient->NeedRedraw(fTeh12);
- gCurrentVolume->SetParam(kClipXmin,min);
- gCurrentVolume->SetParam(kClipXmax,max);
- break;
- case 2:
- min=fDslider2->GetMinPosition();
- max=fDslider2->GetMaxPosition();
- sprintf(buf, "%6.2f", min);
- fTbh21->Clear();
- fTbh21->AddText(0, buf);
- sprintf(buf, "%6.2f", max);
- fTbh22->Clear();
- fTbh22->AddText(0, buf);
- gClient->NeedRedraw(fTeh21);
- gClient->NeedRedraw(fTeh22);
- gCurrentVolume->SetParam(kClipYmin,min);
- gCurrentVolume->SetParam(kClipYmax,max);
- break;
- case 3:
- min=fDslider3->GetMinPosition();
- max=fDslider3->GetMaxPosition();
- sprintf(buf, "%6.2f", min);
- fTbh31->Clear();
- fTbh31->AddText(0, buf);
- sprintf(buf, "%6.2f", max);
- fTbh32->Clear();
- fTbh32->AddText(0, buf);
- gClient->NeedRedraw(fTeh31);
- gClient->NeedRedraw(fTeh32);
- gCurrentVolume->SetParam(kClipZmin,min);
- gCurrentVolume->SetParam(kClipZmax,max);
- break;
- default:
- break;
- }
- }
- break;
- case kC_COMMAND:
- switch (GET_SUBMSG(msg)) {
- case kCM_BUTTON:
- switch(parm1) {
- case 1:
- case 2:
- printf("\nTerminating dialog: %s pressed\n",
- (parm1 == 1) ? "OK" : "Cancel");
- CloseWindow();
- break;
- }
- break;
- case kCM_COMBOBOX:
- switch(parm1) {
- case 89:
- gCurrentVolume->SetParam(kFill, Float_t(parm2));
- gCurrentVolume->Draw();
- break;
- case 90:
- gCurrentVolume->SetParam(kSeen, Float_t(parm2-3));
- gCurrentVolume->Draw();
- break;
- }
- break;
- case kCM_CHECKBUTTON:
- switch (parm1) {
- case 86:
- if (Int_t(gCurrentVolume->GetParam(kShadow))) {
- gCurrentVolume->SetParam(kShadow, 0.);
- } else {
- gCurrentVolume->SetParam(kShadow, 1.);
- }
- gCurrentVolume->Draw();
- break;
- case 87:
- if (Int_t(gCurrentVolume->GetParam(kHide))) {
- gCurrentVolume->SetParam(kHide, 0.);
- } else {
- gCurrentVolume->SetParam(kHide, 1.);
- }
- gCurrentVolume->Draw();
- break;
- case 88:
- if (Int_t(gCurrentVolume->GetParam(kClip))) {
- gCurrentVolume->SetParam(kClip, 0.);
- } else {
- gCurrentVolume->SetParam(kClip, 1.);
- }
- gCurrentVolume->Draw();
- break;
-
- default:
- break;
- }
- break;
- case kCM_TAB:
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- return kTRUE;
-}
-
-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};
-static Int_t DefaultPos[7] = { 3000, 4000, 0, 1000, 1000, 1, 1};
-
-AliGUISliders::AliGUISliders(const TGWindow *p, const TGWindow *,
- 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);
-
- //--- layout for the frame: place at bottom, right aligned
- fBfly1 = new TGLayoutHints(kLHintsLeft | kLHintsExpandX );
-//
-// Frames
-
- for (Int_t i=0; i<7; i++) {
- Int_t idT=i+1;
- Int_t idS=i+8;
- fHframe[i] = new TGHorizontalFrame(this, 400, 100, kFixedWidth);
- fTbh[i] = new TGTextBuffer(10);
- fTeh[i] = new TGTextEntry(fHframe[i], fTbh[i],idT);
- char buf[10];
- sprintf(buf, "%6.2f", Float_t(DefaultPos[i])/100);
- fTbh[i]->AddText(0, buf);
- fTeh[i]->Associate(this);
-
- fHslider[i] = new TGHSlider(fHframe[i], 400, kSlider1 | kScaleBoth, idS);
- fHslider[i]->Associate(this);
- fHslider[i]->SetRange(IRangeMin[i], IRangeMax[i]);
- fHslider[i]->SetPosition(DefaultPos[i]);
-
- fLabel[i] = new TGLabel(fHframe[i], kLabelText[i]);
-
-
- fHframe[i]->AddFrame(fLabel[i], fBfly1);
- fHframe[i]->AddFrame(fTeh[i], fBfly1);
- fHframe[i]->AddFrame(fHslider[i], fBfly1);
- AddFrame(fHframe[i], fBly);
- }
-}
-
-AliGUISliders::~AliGUISliders()
-{
-// Destructor
- delete fBfly1; delete fBly;
- // Delete dialog.
- for (Int_t i=1; i<7; i++) {
- delete fHframe[i];
- delete fHslider[i];
- delete fTeh[i];
- delete fTbh[i];
- }
-}
-
-void AliGUISliders::Update()
-{
-// Update sliders
- char buf[10];
-
- for (Int_t i=0; i<7; i++) {
- Float_t param = gCurrentVolume->GetParam(i);
-//
- fHslider[i]->SetPosition(Int_t(param*100.));
- gClient->NeedRedraw(fHslider[i]);
-//
- sprintf(buf, "%6.2f", param);
- fTbh[i]->Clear();
- fTbh[i]->AddText(0, buf);
- gClient->NeedRedraw(fTeh[i]);
-//
- }
-
-
-}
-
-void AliGUISliders::CloseWindow()
-{
- // Called when window is closed via the window manager.
-
- delete this;
-}
-
-Bool_t AliGUISliders::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
-{
- // Process slider messages.
-
- char buf[10];
-
- switch (GET_MSG(msg)) {
- case kC_TEXTENTRY:
- switch (GET_SUBMSG(msg)) {
- case kTE_TEXTCHANGED:
- Int_t idT=Int_t(parm1)-1;
- fHslider[idT]->SetPosition((Int_t)atof(fTbh[idT]->GetString())*100);
- gClient->NeedRedraw(fHslider[idT]);
- gCurrentVolume->SetParam(idT,atof(fTbh[idT]->GetString()));
- gCurrentVolume->Draw();
- }
- break;
- case kC_HSLIDER:
- switch (GET_SUBMSG(msg)) {
- case kSL_POS:
- sprintf(buf, "%6.2f", Float_t(parm2)/100);
- Int_t idS=Int_t(parm1)-8;
- fTbh[idS]->Clear();
- fTbh[idS]->AddText(0, buf);
- gClient->NeedRedraw(fTeh[idS]);
- gCurrentVolume->SetParam(idS, Float_t(parm2)/100.);
- gCurrentVolume->Draw();
- }
- break;
- }
- return kTRUE;
-}
-
-ClassImp(AliGUIMaterial)
-
-AliGUIMaterial::AliGUIMaterial()
-{
-// Constructor
- fId=-1;
- fName = 0;
- fA=-1;
- fZ=-1;
- fDensity=-1;
- fRadl=-1;
- fAbsl=-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;
- fZ=z;
- fDensity=dens;
- fRadl=radl;
- fAbsl=absl;
-}
-void AliGUIMaterial::Dump()
-{
-// Dump material information
- printf("\n *****************************************");
- printf("\n Material Number: %10d", fId);
- printf("\n %s", fName);
- printf("\n Mass Number: %10.2f", fA);
- printf("\n Charge Number: %10.2f", fZ);
- printf("\n Density: %10.2f", fDensity);
- printf("\n Radiation Length: %10.2f", fRadl);
- printf("\n Absorption Length: %10.2f", fAbsl);
-}
-
-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
-;
-}
-
-ClassImp(AliGUIMedium)
-
-AliGUIMedium::AliGUIMedium()
-{
-// constructor
- fId=-1;
- fName = 0;
-}
-
-AliGUIMedium::AliGUIMedium(Int_t imed, Int_t imat, char* name, Int_t isvol,
- Int_t ifield,
- 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;
- fIsvol=isvol;
- fIfield=ifield;
- fFieldm=fieldm;
- fTmaxfd=tmaxfd;
- fStemax=stemax;
- fDeemax=deemax;
- fEpsil=epsil;
- fStmin=stmin;
-}
-
-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];
- } else if(ipar >=23 && ipar <27) {
- p= fPars[ipar-1+3];
- } else {
- p= fPars[ipar-1+4];
- }
-
- return p;
-}
-
-void AliGUIMedium::Streamer(TBuffer &)
-{
-// dummy streamer
-;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+++ /dev/null
-#ifndef TGEANT3GUI
-#define TGEANT3GUI
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-#include <TROOT.h>
-#include <TVirtualX.h>
-#include <TGListBox.h>
-#include <TGListTree.h>
-#include <TGClient.h>
-#include <TGFrame.h>
-#include <TGIcon.h>
-#include <TGLabel.h>
-#include <TGButton.h>
-#include <TGTextEntry.h>
-#include <TGMsgBox.h>
-#include <TGMenu.h>
-#include <TGCanvas.h>
-#include <TGComboBox.h>
-#include <TGTab.h>
-#include <TGSlider.h>
-#include <TGDoubleSlider.h>
-#include <TGFileDialog.h>
-#include <TRootEmbeddedCanvas.h>
-#include <TCanvas.h>
-#include <TH1.h>
-#include <TH2.h>
-#include <TClonesArray.h>
-#include <TGeant3.h>
-
-class AliGuiGeomDialog;
-class AliGUISliders;
-class AliGuiGeomMain;
-class AliDrawVolume;
-class AliGUIMaterial;
-class AliGUIMedium;
-
-
-class AliGeant3GeometryGUI : public TObject {
- 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));}
- // Return number of children for volume idvol
- Int_t NChildren(Int_t idvol);
- // Return child number idc of volume idvol
- Int_t Child(Int_t idvol, Int_t idc);
- // Return medium number for given volume idvol
- Int_t Medium(Int_t idvol);
- // Return material number for given volume idvol
- Int_t Material(Int_t idvol);
- //
-
-
- ClassDef(AliGeant3GeometryGUI,1) // GUI for Geant3 geometry visualisation
-};
-
-
-class AliGuiGeomMain : public TGMainFrame {
- public:
- AliGuiGeomMain(const TGWindow *p, UInt_t w, UInt_t h);
- virtual ~AliGuiGeomMain();
- // Destroy the main window
- virtual void CloseWindow();
- // Add item to ListTree
- virtual TGListTreeItem *
- 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 parm2);
- // Update widgets
- virtual void Update();
- // Update ComboBoxes
- virtual void UpdateCombo();
- virtual void UpdateListBox();
- // Relate objects to ComboEntries
- // Currently ComboBox Entries are strings only, hence we need this construction
- virtual void SetComboEntries(TClonesArray *entries) {fComboEntries=entries;}
- 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 {
-public:
- AliGuiGeomDialog(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
- UInt_t options = kMainFrame | kVerticalFrame);
- virtual ~AliGuiGeomDialog();
-// Destroy this window
- virtual void CloseWindow();
-// Process messages from this window
- 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 {
-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
-};
-
-class AliDrawVolume : public TObject
-{
-public:
- AliDrawVolume(char* name);
- virtual ~AliDrawVolume(){;}
- // Draw the volume
- 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 param);
- // Get volume parameters i
- virtual Float_t GetParam(Int_t i);
- // Set volume id
- virtual void SetIdVolume(Int_t id) {fIdVolume = id;}
- // Set volume copy number
- virtual void SetIdCopy(Int_t id) {fIdCopy = id;}
- // Set volume medium number
- virtual void SetIdMedium(Int_t id) {fIdMedium = id;}
- // Set volume material number
- virtual void SetIdMaterial(Int_t id) {fIdMaterial = id;}
- // Get volume id
- virtual Int_t GetIdVolume() {return fIdVolume;}
- // Get copy number
- virtual Int_t GetIdCopy() {return fIdCopy;}
- // Get medium number
- virtual Int_t Medium() {return fIdMedium;}
- // Get material number
- virtual Int_t Material() {return fIdMaterial;}
- // Increase copy number by one
- virtual void AddCopy() {fIdCopy ++;}
- // Set link to ListTree Item
- virtual void SetItem(TGListTreeItem *item) {fItem = item;}
- // Get link to ListTree Item
- virtual TGListTreeItem* GetItem() {return fItem;}
-
-private:
- char* fName; // name of the volume
- Float_t fTheta; // theta-angle for drawing
- Float_t fPhi; // phi-angle for drawing
- Float_t fPsi; // psi-angle for drawing
- Float_t fU; // u-position
- Float_t fV; // v-position
- Float_t fUscale; // u-scaling factor
- Float_t fVscale; // v-scaling factor
- Bool_t fHide; // hide flag
- Bool_t fShadow; // shadow flag
- Int_t fFill; // fill option 1-6
- Int_t fSeen; // seen option -2 - 1
- Bool_t fClip; // clipping flag
- Float_t fClipXmin; // clip box range xmin
- Float_t fClipXmax; // clip box range xmax
- Float_t fClipYmin; // clip box range ymin
- Float_t fClipYmax; // clip box range ymax
- Float_t fClipZmin; // clip box range zmin
- Float_t fClipZmax; // clip box range zmax
- Int_t fIdVolume; // geant volume id
- Int_t fIdMedium; // geant medium id
- Int_t fIdMaterial; // geant material id
- Int_t fIdCopy; // copy flag
- TGListTreeItem *fItem; // current item
- ClassDef(AliDrawVolume,1) // Volume Object for Drawing
-};
-
-
-class AliGUIMaterial : public TObject
-{
-public:
- AliGUIMaterial();
- AliGUIMaterial(Int_t imat, char* name, Float_t a, Float_t z,
- Float_t dens, Float_t radl, Float_t absl);
- virtual ~AliGUIMaterial(){;}
- // Dump material parameters
- virtual void Dump();
- // Get material id
- virtual Int_t Id();
- // Get material name
- virtual char* Name();
- // Get mass number
- virtual Float_t A();
- // Get charge number
- virtual Float_t Z();
- // Get density
- virtual Float_t Density();
- // Get radiation length
- virtual Float_t RadiationLength();
- // Get absorption lenth
- virtual Float_t AbsorptionLength();
- // Plot
- virtual void Plot();
- // Set and get link to widget entry
- virtual Int_t ItemId() {return fItem;}
- virtual void SetItemId(Int_t id) {fItem=id;}
-private:
- Int_t fId; // Id number of the material
- char* fName; // name of the material
- Float_t fA; // mass number of the material
- Float_t fZ; // charge number of the material
- Float_t fDensity; // density of the material
- Float_t fRadl; // radiation length of the material
- Float_t fAbsl; // absorption length
- //
- Int_t fItem; // Link to Widget Entry
- ClassDef(AliGUIMaterial,1) // Material Object for GUI
-};
-
-
-const static Int_t kNPars=33;
-
-class AliGUIMedium : public TObject
-{
-public:
- AliGUIMedium();
- AliGUIMedium(Int_t imed, Int_t imat, char* name, Int_t isvol, Int_t ifield,
- Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax,
- Float_t epsil, Float_t stmin);
-
- virtual ~AliGUIMedium(){;}
- // Dump medium parameters
- virtual void Dump();
- // Get id
- virtual Int_t Id();
- // Get name
- virtual char* Name();
- // Get parameters
- virtual Int_t IdMat() {return fIdMat;}
- virtual Int_t Isvol() {return fIsvol;}
- virtual Int_t Ifield() {return fIfield;}
- virtual Float_t Fieldm() {return fFieldm;}
- virtual Float_t Tmaxfd() {return fTmaxfd;}
- virtual Float_t Stemax() {return fStemax;}
- virtual Float_t Deemax() {return fDeemax;}
- virtual Float_t Epsil() {return fEpsil;}
- virtual Float_t Stmin() {return fStmin;}
- virtual void SetPar(Int_t ipar, Float_t par) {fPars[ipar-1]=par;}
- virtual Float_t GetPar(Int_t ipar);
- // Set and get link to widget entry
- virtual Int_t ItemId() {return fItem;}
- virtual void SetItemId(Int_t id) {fItem=id;}
-
- private:
- Float_t fPars[kNPars]; // special medium parameters
- Int_t fId; // Id number of the Medium
- Int_t fIdMat; // Associated material
- char* fName; // Name of the Medium
- Int_t fIsvol; // Sensitivity flag
- Int_t fIfield; // Magnetic Field Flag
- Float_t fFieldm; // Maximum Field Strength
- Float_t fTmaxfd; // Max. Ang. Deviation
- Float_t fStemax; // Maximum Step
- Float_t fDeemax; // Max. Frac. Energy Loss",
- Float_t fEpsil; // Crossing Precission
- Float_t fStmin; // Minimum Step Size
- //
- Int_t fItem; // Link to Widget Entry
- ClassDef(AliGUIMedium,1) // Tracking Medium Object for GUI
-};
-
-#endif
-
-
-
-
-
-
-
-
/*
$Log$
+Revision 1.5 2000/07/12 08:56:32 fca
+Coding convention correction and warning removal
+
Revision 1.4 1999/09/29 09:24:31 fca
Introduction of the Copyright and cvs Log
# define itx ITX
#endif
-static Int_t npid = 0;
-static char cpar[1200];
+// static Int_t sNpid = 0;
+static char sCpar[1200];
static TGeant3 *geant3=(TGeant3*)gMC;
THIGZ *gHigz = 0;
//_______________________________________________________________
THIGZ::THIGZ()
- :TCanvas()
{
+ //
+ // Default constructor
+ //
}
//_______________________________________________________________
THIGZ::THIGZ(Int_t size)
:TCanvas("higz","higz",size,size)
{
+ //
+ // Standard Constructor
+ //
gHigz = this;
Reset();
SetFillColor(10);
//_______________________________________________________________
THIGZ::~THIGZ()
{
+ //
+ // Destructor
+ //
}
//_______________________________________________________________
Float_t THIGZ::Get(const char *name)
{
+ //
+ // Get Attribute
+ //
if (!strcmp(name,"FAIS")) return fFAIS;
if (!strcmp(name,"FASI")) return fFASI;
if (!strcmp(name,"LTYP")) return fLTYP;
//_______________________________________________________________
void THIGZ::Set(const char *name, Float_t val)
{
+ //
+ // Set Attribute
+ //
if (!strcmp(name,"FAIS")) {fFAIS = Int_t(val); return;}
if (!strcmp(name,"FASI")) {fFASI = Int_t(val); return;}
if (!strcmp(name,"LTYP")) {fLTYP = Int_t(val); return;}
//_______________________________________________________________
void THIGZ::Reset(Option_t *)
{
+ //
+ // Reset all attributes
+ //
fFAIS = 0;
fFASI = 1;
fLTYP = 1;
//_______________________________________________________________
extern "C" void type_of_call ifa(Int_t &n,Float_t *x, Float_t *y)
{
-// printf("ifa called, n=%d, pname=%s, pid=%d, x1=%f, y1=%f,x2=%f, y2=%f, x3=%f, y3=%f\n",n,gHigz->fPname.Data(),gHigz->fPID,x[0],y[0],x[1],y[1],x[2],y[2]);
+// printf("ifa called, n=%d, pname=%s, pid=%d, x1=%f, y1=%f,x2=%f, y2=%f, x3=%f, y3=%f\n",n,gHigz->Pname().Data(),gHigz->PID(),x[0],y[0],x[1],y[1],x[2],y[2]);
TGraph *gr = new TGraph(n,x,y);
- gr->SetFillColor(gHigz->fFACI);
+ gr->SetFillColor(gHigz->FACI());
gr->Draw("f");
}
//_______________________________________________________________
extern "C" void type_of_call igbox(Float_t &x1,Float_t &x2,Float_t &y1,Float_t &y2)
{
+ //
+ // Draw a box
+ //
printf("igbox called, x1=%f, y1=%f, x2=%f, y2=%f\n",x1,y1,x2,y2);
TBox *box = new TBox(x1,y1,x2,y2);
- box->SetLineColor(gHigz->fPLCI);
- box->SetFillColor(gHigz->fFACI);
- box->SetFillStyle(gHigz->fFASI);
+ box->SetLineColor(gHigz->PLCI());
+ box->SetFillColor(gHigz->FACI());
+ box->SetFillStyle(gHigz->FASI());
box->Draw();
}
//_______________________________________________________________
extern "C" void type_of_call igpave(Float_t &x1,Float_t &x2,Float_t &yy1,Float_t &yy2,Float_t &,Int_t &isbox,Int_t &isfram,const char *, const Int_t)
{
+ //
+ // Draw a pave
+ //
char text[5];
- strncpy(text,(char*)&gHigz->fPID,4);
+ Int_t pid=gHigz->PID();
+ strncpy(text,(char*)&pid,4);
text[4] = 0;
Float_t y1 = yy1;
Float_t y2 = yy2;
pt->SetFillColor(isbox%1000);
pt->SetLineColor(isfram%1000);
pt->Draw();
-// printf("igpave called, text=%s, Pname=%s, x1=%f, y1=%f, x2=%f, y2=%f, isbox=%d, isfram=%d\n",text,gHigz->fPname.Data(),x1,y1,x2,y2,isbox,isfram);
+// printf("igpave called, text=%s, Pname=%s, x1=%f, y1=%f, x2=%f, y2=%f, isbox=%d, isfram=%d\n",text,gHigz->Pname().Data(),x1,y1,x2,y2,isbox,isfram);
}
//_______________________________________________________________
extern "C" void type_of_call igpid(Int_t &,const char *name,const Int_t l1, Int_t &pid,const char *, const Int_t)
#endif
{
- npid++;
-// if(npid&100 == 0) printf("igpid called, npid=%d\n",npid);
- strncpy(cpar,name,l1); cpar[l1] = 0;
- gHigz->fPname = cpar;
- gHigz->fPID = pid;
+ // sNpid++;
+ // if(sNpid&100 == 0) printf("igpid called, sNpid=%d\n",sNpid);
+ strncpy(sCpar,name,l1); sCpar[l1] = 0;
+ gHigz->SetPname(sCpar);
+ gHigz->SetPID(pid);
// char text[5];
-// strncpy(text,(char*)&gHigz->fPID,4);
+// strncpy(text,(char*)&gHigz->PID(),4);
// text[4] = 0;
-// printf("igpid called, level=%d, name=%s, pid=%d, cpid=%s\n",level,cpar,pid,text);
+// printf("igpid called, level=%d, name=%s, pid=%d, cpid=%s\n",level,sCpar,pid,text);
}
//_______________________________________________________________
extern "C" void type_of_call igq(const char *name,const Int_t l1, Float_t &rval)
#endif
{
- strncpy(cpar,name,l1); cpar[l1] = 0;
-// printf("igq called, name=%s\n",cpar);
- rval = gHigz->Get(cpar);
+ strncpy(sCpar,name,l1); sCpar[l1] = 0;
+// printf("igq called, name=%s\n",sCpar);
+ rval = gHigz->Get(sCpar);
}
//_______________________________________________________________
extern "C" void type_of_call igset(const char *name, const Int_t l1,Float_t &rval)
#endif
{
- strncpy(cpar,name,l1); cpar[l1] = 0;
-// printf("igset called, name=%s, rval=%f\n",cpar,rval);
- gHigz->Set(cpar,rval);
+ strncpy(sCpar,name,l1); sCpar[l1] = 0;
+// printf("igset called, name=%s, rval=%f\n",sCpar,rval);
+ gHigz->Set(sCpar,rval);
}
//_______________________________________________________________
// printf("ipl called, n=%d, x[0]=%f,y[0]=%f, x[1]=%f, y[1]=%f\n",n,x[0],y[0],x[1],y[1]);
if (n <= 2) {
TLine *l = new TLine(x[0],y[0],x[1],y[1]);
- l->SetLineColor(gHigz->fPLCI);
- l->SetLineStyle(gHigz->fLTYP);
- l->SetLineWidth(Short_t(gHigz->fLWID));
+ l->SetLineColor(gHigz->PLCI());
+ l->SetLineStyle(gHigz->LTYP());
+ l->SetLineWidth(Short_t(gHigz->LWID()));
l->Draw();
} else {
TPolyLine *pl = new TPolyLine(n,x,y);
- pl->SetLineColor(gHigz->fPLCI);
- pl->SetLineStyle(gHigz->fLTYP);
- pl->SetLineWidth(Short_t(gHigz->fLWID));
+ pl->SetLineColor(gHigz->PLCI());
+ pl->SetLineStyle(gHigz->LTYP());
+ pl->SetLineWidth(Short_t(gHigz->LWID()));
pl->Draw();
}
}
//_______________________________________________________________
extern "C" void type_of_call ipm(Int_t &n,Float_t *x,Float_t *y)
{
+ //
+ // Draw PolyMarkers
+ //
printf("ipm called, n=%d\n",n);
TPolyMarker *pm = new TPolyMarker(n,x,y);
- pm->SetMarkerColor(gHigz->fPMCI);
- pm->SetMarkerStyle(gHigz->fMTYP);
- pm->SetMarkerSize(gHigz->fMSCF);
+ pm->SetMarkerColor(gHigz->PMCI());
+ pm->SetMarkerStyle(gHigz->MTYP());
+ pm->SetMarkerSize(gHigz->MSCF());
pm->Draw();
}
// printf("isfaci called, col=%d\n",col);
Int_t color = col%1000;
// if (color > 10) color += 35;
- gHigz->fFACI = color;
+ gHigz->SetFACI(color);
}
//_______________________________________________________________
extern "C" void type_of_call isfais(Int_t &is)
{
// printf("isfais called, is=%d\n",is);
- gHigz->fFAIS = is;
+ gHigz->SetFAIS(is);
}
//_______________________________________________________________
extern "C" void type_of_call isln(Int_t &ln)
{
// printf("isln called, ln=%d\n",ln);
- gHigz->fLTYP = ln;
+ gHigz->SetLTYP(ln);
}
//_______________________________________________________________
extern "C" void type_of_call ismk(Int_t &mk)
{
// printf("ismk called, mk=%d\n",mk);
- gHigz->fMTYP = mk;
+ gHigz->SetMTYP(mk);
}
//_______________________________________________________________
extern "C" void type_of_call islwsc(Float_t &wl)
{
// printf("islwsc called, wl=%f\n",wl);
- gHigz->fLWID = wl;
+ gHigz->SetLWID(wl);
}
//_______________________________________________________________
// printf("isplci called, col=%d\n",col);
Int_t color = col%1000;
// if (color > 10) color += 35;
- gHigz->fPLCI = color;
+ gHigz->SetPLCI(color);
}
//_______________________________________________________________
// printf("ispmci called, col=%d\n",col);
Int_t color = col%1000;
// if (color > 10) color += 35;
- gHigz->fPMCI = color;
+ gHigz->SetPMCI(color);
}
//_______________________________________________________________
// printf("istxci called, col=%d\n",col);
Int_t color = col%1000;
// if (color > 10) color += 35;
- gHigz->fTXCI = color;
+ gHigz->SetTXCI(color);
}
//_______________________________________________________________
//_______________________________________________________________
extern "C" void type_of_call itx(Float_t &x,Float_t &y,const char *ptext, const Int_t l1p)
{
- if (gHigz->fPname == "Tree") return;
+ if (gHigz->Pname() == "Tree") return;
Int_t l1=l1p;
- strncpy(cpar,ptext,l1); cpar[l1] = 0;
-//printf("itx called, x=%f, y=%f, text=%s, l1=%d\n",x,y,cpar,l1);
+ strncpy(sCpar,ptext,l1); sCpar[l1] = 0;
+//printf("itx called, x=%f, y=%f, text=%s, l1=%d\n",x,y,sCpar,l1);
while(l1) {
- if (cpar[l1-1] != ' ' && cpar[l1-1] != '$') break;
+ if (sCpar[l1-1] != ' ' && sCpar[l1-1] != '$') break;
l1--;
- cpar[l1] = 0;
+ sCpar[l1] = 0;
}
- char *small = strstr(cpar,"<");
+ char *small = strstr(sCpar,"<");
while(small && *small) {
small[0] = tolower(small[1]);
small++;
}
- TText *text = new TText(x,y,cpar);
- text->SetTextColor(gHigz->fTXCI);
- text->SetTextSize(gHigz->fCHHE);
- text->SetTextFont(gHigz->fTXFP);
- text->SetTextAlign(gHigz->fTXAL);
- text->SetTextAngle(gHigz->fTANG);
+ TText *text = new TText(x,y,sCpar);
+ text->SetTextColor(gHigz->TXCI());
+ text->SetTextSize(gHigz->CHHE());
+ text->SetTextFont(gHigz->TXFP());
+ text->SetTextAlign(gHigz->TXAL());
+ text->SetTextAngle(gHigz->TANG());
text->Draw();
}
//_______________________________________________________________
extern "C" void type_of_call hplint(Int_t &)
{
+ //
+ // Initialize HPLOT
+ //
printf("hplint called\n");
new THIGZ(600);
}
//_______________________________________________________________
extern "C" void type_of_call hplend()
{
+ //
+ // End HPLOT
+ //
printf("hplend called\n");
}
//_______________________________________________________________
extern "C" void type_of_call igmeta(Int_t &, Int_t &)
{
+ //
+ // Open metafile
+ //
printf("igmeta called\n");
}
//_______________________________________________________________
extern "C" void type_of_call igqwk(Int_t &, const char *name, Float_t &rval, const Int_t l1)
{
- strncpy(cpar,name,l1); cpar[l1] = 0;
-// printf("igqwk called, wid=%d, pname=%s\n",wid,cpar);
- rval = gHigz->Get(cpar);
+ //
+ // Query Workstation type
+ //
+ strncpy(sCpar,name,l1); sCpar[l1] = 0;
+// printf("igqwk called, wid=%d, pname=%s\n",wid,sCpar);
+ rval = gHigz->Get(sCpar);
}
class THIGZ : public TCanvas {
-public:
+protected:
Int_t fFAIS; //Fill Area Interior Style (0,1,2,3)
Int_t fFASI; //Fill Area Style Index
Int_t fLTYP; //Line TYPe
virtual void SetLogz(Int_t value = 1);
virtual void SetTickx(Int_t value = 1);
virtual void SetTicky(Int_t value = 1);
- virtual void x3d(Option_t *option="");
+ virtual void X3d(Option_t *option="");
+ virtual Int_t FAIS() const {return fFAIS;}
+ virtual Int_t FASI() const {return fFASI;}
+ virtual Int_t LTYP() const {return fLTYP;}
+ virtual Float_t BASL() const {return fBASL;}
+ virtual Float_t LWID() const {return fLWID;}
+ virtual Int_t MTYP() const {return fMTYP;}
+ virtual Float_t MSCF() const {return fMSCF;}
+ virtual Int_t PLCI() const {return fPLCI;}
+ virtual Int_t PMCI() const {return fPMCI;}
+ virtual Int_t FACI() const {return fFACI;}
+ virtual Int_t TXCI() const {return fTXCI;}
+ virtual Int_t TXAL() const {return fTXAL;}
+ virtual Float_t CHHE() const {return fCHHE;}
+ virtual Float_t TANG() const {return fTANG;}
+ virtual Int_t TXFP() const {return fTXFP;}
+ virtual Int_t BORD() const {return fBORD;}
+ virtual Int_t NCOL() const {return fNCOL;}
+ virtual Int_t DRMD() const {return fDRMD;}
+ virtual Int_t SYNC() const {return fSYNC;}
+ virtual Int_t CLIP() const {return fCLIP;}
+ virtual Int_t I2BUF() const {return f2BUF;}
+ virtual Int_t PID() const {return fPID;}
+ virtual const char* Pname() const {return fPname.Data();}
+ virtual void SetPID(Int_t pid) {fPID=pid;}
+ virtual void SetFACI(Int_t faci) {fFACI=faci;}
+ virtual void SetFAIS(Int_t fais) {fFAIS=fais;}
+ virtual void SetLTYP(Int_t lin) {fLTYP=lin;}
+ virtual void SetMTYP(Int_t mk) {fMTYP=mk;}
+ virtual void SetLWID(Int_t lw) {fLWID=lw;}
+ virtual void SetPLCI(Int_t lcol) {fPLCI=lcol;}
+ virtual void SetPMCI(Int_t mcol) {fPMCI=mcol;}
+ virtual void SetTXCI(Int_t tcol) {fTXCI=tcol;}
+ virtual void SetPname(const char *name) {fPname=name;}
+
ClassDef(THIGZ,1) //Emulation of HIGZ for Root
};
inline void THIGZ::SetLogz(Int_t) { }
inline void THIGZ::SetTickx(Int_t) { }
inline void THIGZ::SetTicky(Int_t) { }
-inline void THIGZ::x3d(Option_t *) { }
+inline void THIGZ::X3d(Option_t *) { }
#endif
/*
$Log$
+Revision 1.5 1999/09/29 09:24:31 fca
+Introduction of the Copyright and cvs Log
+
*/
///////////////////////////////////////////////////////////////////////////////
//
}
-//_____________________________________________________________________________
-TPaveTree::TPaveTree(const TPaveTree &PaveTree)
-{
- //
- // Copy Constructor
- //
- ((TPaveTree&)PaveTree).Copy(*this);
-}
-
-//_____________________________________________________________________________
-void TPaveTree::Copy(TObject &obj)
-{
- //
- // Copy this PaveTree to PaveTree
- //
- TPaveLabel::Copy(obj);
-}
-
//_____________________________________________________________________________
void TPaveTree::DrawSpec()
{
-#ifndef ROOT_TPaveTree
-#define ROOT_TPaveTree
+#ifndef TPAVETREE_H
+#define TPAVETREE_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
public:
TPaveTree();
TPaveTree(Coord_t x1, Coord_t y1,Coord_t x2 ,Coord_t y2, const Text_t *label);
- TPaveTree(const TPaveTree &PaveTree);
virtual ~TPaveTree();
- void Copy(TObject &PaveTree);
virtual void DrawSpec(); // *MENU*
virtual void DrawTree(Int_t levmax=15, Int_t iselt=111); // *MENU*
virtual void DrawTreeParent(Int_t levmax=3, Int_t iselt=111); // *MENU*
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
virtual void SavePrimitive(ofstream &out, Option_t *option);
-
+
+private:
+ TPaveTree(const TPaveTree &PaveTree) {}
+
ClassDef(TPaveTree,1) //A TPaveLabel specialized for Geant GDTREE
};