From ef42d733b7e1291173d30fad82c7b0d50feeee85 Mon Sep 17 00:00:00 2001 From: fca Date: Thu, 13 Jul 2000 16:19:45 +0000 Subject: [PATCH] Mainly coding conventions + some small bug fixes --- MUON/AliMUONChamber.h | 2 +- MUON/AliMUONHitMapA1.cxx | 6 +- MUON/AliMUONHitMapA1.h | 2 +- MUON/AliMUONSegmentationTrigger.h | 2 + MUON/AliMUONSegmentationTriggerX.h | 3 + MUON/AliMUONSegmentationV0.cxx | 6 +- MUON/AliMUONSegmentationV0.h | 2 +- MUON/AliMUONSegmentationV01.cxx | 6 +- MUON/AliMUONSegmentationV01.h | 2 +- MUON/AliMUONSegmentationV02.h | 1 + MUON/AliMUONSegmentationV1.h | 2 +- MUON/AliMUONTriggerCircuit.cxx | 5 + RICH/AliRICHChamber.cxx | 5 +- STEER/AliDetector.h | 4 +- STEER/AliDisplay.cxx | 15 + STEER/AliDisplay.h | 4 +- STEER/AliGenerator.h | 4 +- STEER/AliHitMap.h | 2 +- STEER/AliLego.h | 2 +- STEER/AliLegoGenerator.cxx | 6 + STEER/AliMC.cxx | 12 +- STEER/AliMC.h | 5 +- STEER/AliMagFCM.h | 2 +- STEER/AliMagFDM.cxx | 6 + STEER/AliModule.h | 4 +- STEER/AliPoints.h | 4 +- STEER/AliRecPoint.h | 4 +- STEER/AliRun.cxx | 32 +- STEER/AliRun.h | 8 +- STEER/AliSegmentation.h | 2 +- TGeant3/AliDrawVolume.cxx | 270 ++++ TGeant3/AliDrawVolume.h | 108 ++ TGeant3/AliGUIMaterial.cxx | 165 +++ TGeant3/AliGUIMaterial.h | 63 + TGeant3/AliGUIMedium.cxx | 138 ++ TGeant3/AliGUIMedium.h | 65 + TGeant3/AliGUISliders.cxx | 169 +++ TGeant3/AliGUISliders.h | 43 + TGeant3/AliGeant3.cxx | 21 +- TGeant3/AliGeant3.h | 4 +- TGeant3/AliGeant3GeometryGUI.cxx | 415 ++++++ TGeant3/AliGeant3GeometryGUI.h | 61 + TGeant3/AliGuiGeomDialog.cxx | 451 ++++++ TGeant3/AliGuiGeomDialog.h | 55 + TGeant3/AliGuiGeomMain.cxx | 848 +++++++++++ TGeant3/AliGuiGeomMain.h | 91 ++ TGeant3/Makefile | 6 +- TGeant3/TGeant3.cxx | 128 +- TGeant3/TGeant3.h | 140 +- TGeant3/TGeant3GUI.cxx | 2137 ---------------------------- TGeant3/TGeant3GUI.h | 358 ----- TGeant3/THIGZ.cxx | 152 +- TGeant3/THIGZ.h | 40 +- TGeant3/TPaveTree.cxx | 21 +- TGeant3/TPaveTree.h | 11 +- 55 files changed, 3374 insertions(+), 2746 deletions(-) create mode 100644 TGeant3/AliDrawVolume.cxx create mode 100644 TGeant3/AliDrawVolume.h create mode 100644 TGeant3/AliGUIMaterial.cxx create mode 100644 TGeant3/AliGUIMaterial.h create mode 100644 TGeant3/AliGUIMedium.cxx create mode 100644 TGeant3/AliGUIMedium.h create mode 100644 TGeant3/AliGUISliders.cxx create mode 100644 TGeant3/AliGUISliders.h create mode 100644 TGeant3/AliGeant3GeometryGUI.cxx create mode 100644 TGeant3/AliGeant3GeometryGUI.h create mode 100644 TGeant3/AliGuiGeomDialog.cxx create mode 100644 TGeant3/AliGuiGeomDialog.h create mode 100644 TGeant3/AliGuiGeomMain.cxx create mode 100644 TGeant3/AliGuiGeomMain.h delete mode 100644 TGeant3/TGeant3GUI.cxx delete mode 100644 TGeant3/TGeant3GUI.h diff --git a/MUON/AliMUONChamber.h b/MUON/AliMUONChamber.h index 147dbe87eaa..0d755d98729 100644 --- a/MUON/AliMUONChamber.h +++ b/MUON/AliMUONChamber.h @@ -108,7 +108,7 @@ public TObject 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 diff --git a/MUON/AliMUONHitMapA1.cxx b/MUON/AliMUONHitMapA1.cxx index 523aef3df76..b1007ac4d6c 100644 --- a/MUON/AliMUONHitMapA1.cxx +++ b/MUON/AliMUONHitMapA1.cxx @@ -15,6 +15,10 @@ /* $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 @@ -66,7 +70,7 @@ AliMUONHitMapA1::~AliMUONHitMapA1() if (fHitMap) delete[] fHitMap; } -void AliMUONHitMapA1::Clear() +void AliMUONHitMapA1::Clear(const char *) { // Clear hitmap memset(fHitMap,0,sizeof(int)*fMaxIndex); diff --git a/MUON/AliMUONHitMapA1.h b/MUON/AliMUONHitMapA1.h index f8d6f341f6c..7840ac05d0b 100644 --- a/MUON/AliMUONHitMapA1.h +++ b/MUON/AliMUONHitMapA1.h @@ -23,7 +23,7 @@ public AliHitMap // 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 diff --git a/MUON/AliMUONSegmentationTrigger.h b/MUON/AliMUONSegmentationTrigger.h index 318310c85c2..023c8e540d9 100644 --- a/MUON/AliMUONSegmentationTrigger.h +++ b/MUON/AliMUONSegmentationTrigger.h @@ -25,6 +25,8 @@ public AliMUONSegmentationV0 { 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: diff --git a/MUON/AliMUONSegmentationTriggerX.h b/MUON/AliMUONSegmentationTriggerX.h index 887a2717fab..9d24815f0a1 100644 --- a/MUON/AliMUONSegmentationTriggerX.h +++ b/MUON/AliMUONSegmentationTriggerX.h @@ -26,6 +26,9 @@ public AliMUONSegmentationTrigger { 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 diff --git a/MUON/AliMUONSegmentationV0.cxx b/MUON/AliMUONSegmentationV0.cxx index 6f998359ea8..483de3489be 100644 --- a/MUON/AliMUONSegmentationV0.cxx +++ b/MUON/AliMUONSegmentationV0.cxx @@ -14,6 +14,10 @@ **************************************************************************/ /* $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 @@ -269,7 +273,7 @@ void AliMUONSegmentationV0::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) y[0]=x[0]; } -void AliMUONSegmentationV0::Draw() +void AliMUONSegmentationV0::Draw(const char *) { // Draws the segmentation zones // diff --git a/MUON/AliMUONSegmentationV0.h b/MUON/AliMUONSegmentationV0.h index 0012e6fc643..71f724fade8 100644 --- a/MUON/AliMUONSegmentationV0.h +++ b/MUON/AliMUONSegmentationV0.h @@ -102,7 +102,7 @@ dummy); // 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;} diff --git a/MUON/AliMUONSegmentationV01.cxx b/MUON/AliMUONSegmentationV01.cxx index 59d15c80548..2351d7362df 100644 --- a/MUON/AliMUONSegmentationV01.cxx +++ b/MUON/AliMUONSegmentationV01.cxx @@ -15,6 +15,10 @@ /* $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 @@ -453,7 +457,7 @@ void AliMUONSegmentationV01::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) y[2]=x[2]; } -void AliMUONSegmentationV01::Draw() +void AliMUONSegmentationV01::Draw(const char *) { // Draws the segmentation zones // diff --git a/MUON/AliMUONSegmentationV01.h b/MUON/AliMUONSegmentationV01.h index 148d0ac3673..354874c1f6c 100644 --- a/MUON/AliMUONSegmentationV01.h +++ b/MUON/AliMUONSegmentationV01.h @@ -86,7 +86,7 @@ public AliMUONSegmentationV0 { 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); diff --git a/MUON/AliMUONSegmentationV02.h b/MUON/AliMUONSegmentationV02.h index 85c8a3116ef..3accc66c3b7 100644 --- a/MUON/AliMUONSegmentationV02.h +++ b/MUON/AliMUONSegmentationV02.h @@ -36,6 +36,7 @@ public AliMUONSegmentationV01 { 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 diff --git a/MUON/AliMUONSegmentationV1.h b/MUON/AliMUONSegmentationV1.h index 0221ed36b97..877e8b4f9bb 100644 --- a/MUON/AliMUONSegmentationV1.h +++ b/MUON/AliMUONSegmentationV1.h @@ -127,7 +127,7 @@ public AliSegmentation { 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;} diff --git a/MUON/AliMUONTriggerCircuit.cxx b/MUON/AliMUONTriggerCircuit.cxx index 9d0cc968b46..c8e8282af3f 100644 --- a/MUON/AliMUONTriggerCircuit.cxx +++ b/MUON/AliMUONTriggerCircuit.cxx @@ -14,6 +14,10 @@ **************************************************************************/ /* $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 @@ -43,6 +47,7 @@ ClassImp(AliMUONTriggerCircuit) AliMUONTriggerCircuit::AliMUONTriggerCircuit() { // Constructor + fSegmentation=0; fidCircuit=0; fx2m=0; fx2ud=0; diff --git a/RICH/AliRICHChamber.cxx b/RICH/AliRICHChamber.cxx index 288e5899af3..4f14ebdc02b 100644 --- a/RICH/AliRICHChamber.cxx +++ b/RICH/AliRICHChamber.cxx @@ -15,6 +15,9 @@ /* $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. @@ -48,7 +51,7 @@ AliRICHChamber::AliRICHChamber() 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) diff --git a/STEER/AliDetector.h b/STEER/AliDetector.h index f8246ffadc9..f451cdfe6dc 100644 --- a/STEER/AliDetector.h +++ b/STEER/AliDetector.h @@ -19,7 +19,7 @@ public: 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;} @@ -27,7 +27,7 @@ public: 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 diff --git a/STEER/AliDisplay.cxx b/STEER/AliDisplay.cxx index c30a481330a..f4491f269be 100644 --- a/STEER/AliDisplay.cxx +++ b/STEER/AliDisplay.cxx @@ -15,6 +15,9 @@ /* $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 @@ -323,6 +326,9 @@ void AliDisplay::ShowTrack(Int_t idx) { //---------------------------------------------------------------------------- void AliDisplay::HideTrack(Int_t idx) { + // + // Hide track on display + // AliDetector *mTPC=(AliDetector*)gAlice->GetModule("TPC"); TObjArray *points=mTPC->Points(); int ntracks=points->GetEntriesFast(); @@ -761,6 +767,9 @@ void AliDisplay::Paint(Option_t *) //_____________________________________________________________________________ void AliDisplay::SetPickMode() { + // + // Set Pick Mode -- disable zoom + // fZoomMode = 0; fArcButton->SetY1(fPickButton->GetYlowNDC()+0.5*fPickButton->GetHNDC()); @@ -770,6 +779,9 @@ void AliDisplay::SetPickMode() //_____________________________________________________________________________ void AliDisplay::SetZoomMode() { + // + // Set Zoom Mode -- disable pick + // fZoomMode = 1; fArcButton->SetY1(fZoomButton->GetYlowNDC()+0.5*fZoomButton->GetHNDC()); @@ -779,6 +791,9 @@ void AliDisplay::SetZoomMode() //_____________________________________________________________________________ void AliDisplay::SetPTcut(Float_t ptcut) { + // + // Set Pt Cut + // fPTcut = ptcut; if (!fPad) return; diff --git a/STEER/AliDisplay.h b/STEER/AliDisplay.h index 54db3450573..d670b948eba 100644 --- a/STEER/AliDisplay.h +++ b/STEER/AliDisplay.h @@ -36,7 +36,7 @@ public: 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); @@ -64,7 +64,7 @@ public: 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 diff --git a/STEER/AliGenerator.h b/STEER/AliGenerator.h index 7f545afa0e7..d52dae8a3a0 100644 --- a/STEER/AliGenerator.h +++ b/STEER/AliGenerator.h @@ -27,7 +27,7 @@ class AliGenerator : public TNamed 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) @@ -66,7 +66,7 @@ class AliGenerator : public TNamed virtual void SetMC(TGenerator *theMC) {if (!fgMCEvGen) fgMCEvGen =theMC;} - virtual AliGenerator & operator=(const AliGenerator &gen); + AliGenerator & operator=(const AliGenerator &gen); // Getters diff --git a/STEER/AliHitMap.h b/STEER/AliHitMap.h index 74f777af4b3..ed76c1df518 100644 --- a/STEER/AliHitMap.h +++ b/STEER/AliHitMap.h @@ -18,7 +18,7 @@ public TObject { // 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 diff --git a/STEER/AliLego.h b/STEER/AliLego.h index e2ed9ed02f0..1257505b169 100644 --- a/STEER/AliLego.h +++ b/STEER/AliLego.h @@ -26,7 +26,7 @@ public: 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(); diff --git a/STEER/AliLegoGenerator.cxx b/STEER/AliLegoGenerator.cxx index b4c9d2fba3c..101fce42e7e 100644 --- a/STEER/AliLegoGenerator.cxx +++ b/STEER/AliLegoGenerator.cxx @@ -15,6 +15,9 @@ /* $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 @@ -62,6 +65,9 @@ AliLegoGenerator::AliLegoGenerator(Int_t ntheta, Float_t themin, fNphi(nphi), fThetaBin(ntheta), fPhiBin(-1), fCurTheta(0), fCurPhi(0) { + // + // Standard generator for Lego rays + // SetPhiRange(phimin,phimax); SetThetaRange(themin,themax); SetName("Lego"); diff --git a/STEER/AliMC.cxx b/STEER/AliMC.cxx index 203c367106d..a69c6a3d1e1 100644 --- a/STEER/AliMC.cxx +++ b/STEER/AliMC.cxx @@ -15,6 +15,9 @@ /* $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 @@ -48,12 +51,3 @@ AliMC::AliMC(const char *name, const char *title) : TNamed(name,title) gMC=this; } } - -void AliMC::Copy(AliMC &mc) const -{ - // - // Copy *this onto mc -- not implemented - // - Fatal("Copy","Not implemented~\n"); -} - diff --git a/STEER/AliMC.h b/STEER/AliMC.h index 2ee132c00ba..0559a7f0d91 100644 --- a/STEER/AliMC.h +++ b/STEER/AliMC.h @@ -25,9 +25,6 @@ class AliMC : public TNamed 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 @@ -199,6 +196,8 @@ class AliMC : public TNamed 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 }; diff --git a/STEER/AliMagFCM.h b/STEER/AliMagFCM.h index 08c1ad41cd0..613f2d9ec9a 100644 --- a/STEER/AliMagFCM.h +++ b/STEER/AliMagFCM.h @@ -19,7 +19,7 @@ public: 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) { diff --git a/STEER/AliMagFDM.cxx b/STEER/AliMagFDM.cxx index af924b0023d..a677ee44a31 100644 --- a/STEER/AliMagFDM.cxx +++ b/STEER/AliMagFDM.cxx @@ -15,6 +15,9 @@ /* $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 @@ -34,6 +37,9 @@ const Int_t map, const Float_t factor, const Float_t fmax) : 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()); diff --git a/STEER/AliModule.h b/STEER/AliModule.h index 0797945f410..c2263ff3dff 100644 --- a/STEER/AliModule.h +++ b/STEER/AliModule.h @@ -95,8 +95,8 @@ public: 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 diff --git a/STEER/AliPoints.h b/STEER/AliPoints.h index 7dd1955aedc..c3c7aa9dfe2 100644 --- a/STEER/AliPoints.h +++ b/STEER/AliPoints.h @@ -15,7 +15,7 @@ public: 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;} @@ -25,7 +25,7 @@ public: 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;} diff --git a/STEER/AliRecPoint.h b/STEER/AliRecPoint.h index 76d56040aac..1b6f1565c26 100644 --- a/STEER/AliRecPoint.h +++ b/STEER/AliRecPoint.h @@ -44,7 +44,7 @@ public: 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 @@ -58,7 +58,7 @@ public: 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 ; } diff --git a/STEER/AliRun.cxx b/STEER/AliRun.cxx index 0e14eb7bc39..e38ab486c48 100644 --- a/STEER/AliRun.cxx +++ b/STEER/AliRun.cxx @@ -15,6 +15,9 @@ /* $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 @@ -227,15 +230,6 @@ AliRun::AliRun(const char *name, const char *title) fHitLists = new TList(); } -//_____________________________________________________________________________ -AliRun::AliRun(const AliRun &run) -{ - // - // Copy constructor - // - run.Copy(*this); -} - //_____________________________________________________________________________ AliRun::~AliRun() @@ -1573,26 +1567,6 @@ void AliRun::StepManager(Int_t id) } } -//_____________________________________________________________________________ -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) { diff --git a/STEER/AliRun.h b/STEER/AliRun.h index 428dbcc4568..5aec719fefe 100644 --- a/STEER/AliRun.h +++ b/STEER/AliRun.h @@ -29,7 +29,6 @@ public: // 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; @@ -116,8 +115,6 @@ public: 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;} @@ -160,6 +157,11 @@ protected: 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 }; diff --git a/STEER/AliSegmentation.h b/STEER/AliSegmentation.h index 73f252b65d6..cb7b64b5518 100644 --- a/STEER/AliSegmentation.h +++ b/STEER/AliSegmentation.h @@ -93,7 +93,7 @@ public TObject { // 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; diff --git a/TGeant3/AliDrawVolume.cxx b/TGeant3/AliDrawVolume.cxx new file mode 100644 index 00000000000..dff3a7faf55 --- /dev/null +++ b/TGeant3/AliDrawVolume.cxx @@ -0,0 +1,270 @@ +/* ************************************************************************* + * 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.; +} + + diff --git a/TGeant3/AliDrawVolume.h b/TGeant3/AliDrawVolume.h new file mode 100644 index 00000000000..2444a5e5db1 --- /dev/null +++ b/TGeant3/AliDrawVolume.h @@ -0,0 +1,108 @@ +#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 +#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 diff --git a/TGeant3/AliGUIMaterial.cxx b/TGeant3/AliGUIMaterial.cxx new file mode 100644 index 00000000000..8b9c062c318 --- /dev/null +++ b/TGeant3/AliGUIMaterial.cxx @@ -0,0 +1,165 @@ +/* ************************************************************************* + * 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 +; +} + + + + + + + + + + + + + + + diff --git a/TGeant3/AliGUIMaterial.h b/TGeant3/AliGUIMaterial.h new file mode 100644 index 00000000000..10fce2d7235 --- /dev/null +++ b/TGeant3/AliGUIMaterial.h @@ -0,0 +1,63 @@ +#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 + + + + + + + + diff --git a/TGeant3/AliGUIMedium.cxx b/TGeant3/AliGUIMedium.cxx new file mode 100644 index 00000000000..5eb9d1519d8 --- /dev/null +++ b/TGeant3/AliGUIMedium.cxx @@ -0,0 +1,138 @@ +/* ************************************************************************* + * 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 +; +} + + + + + + + + + + + + + + + diff --git a/TGeant3/AliGUIMedium.h b/TGeant3/AliGUIMedium.h new file mode 100644 index 00000000000..cd83a921c7c --- /dev/null +++ b/TGeant3/AliGUIMedium.h @@ -0,0 +1,65 @@ +#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 diff --git a/TGeant3/AliGUISliders.cxx b/TGeant3/AliGUISliders.cxx new file mode 100644 index 00000000000..8ba68325bc2 --- /dev/null +++ b/TGeant3/AliGUISliders.cxx @@ -0,0 +1,169 @@ +/* ************************************************************************* + * 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 + +#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; +} + diff --git a/TGeant3/AliGUISliders.h b/TGeant3/AliGUISliders.h new file mode 100644 index 00000000000..7d6612fd988 --- /dev/null +++ b/TGeant3/AliGUISliders.h @@ -0,0 +1,43 @@ +#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 diff --git a/TGeant3/AliGeant3.cxx b/TGeant3/AliGeant3.cxx index 6a6b9b4f54c..f7bd156b9d8 100644 --- a/TGeant3/AliGeant3.cxx +++ b/TGeant3/AliGeant3.cxx @@ -15,6 +15,9 @@ /* $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 @@ -59,8 +62,12 @@ ClassImp(AliGeant3) AliGeant3::AliGeant3(const char *title) : TGeant3(title) {} +//____________________________________________________________________________ void AliGeant3::FinishGeometry() { + // + // Finalise geometry construction + // TGeant3::FinishGeometry(); //Create the color table SetColors(); @@ -71,6 +78,7 @@ void AliGeant3::Init() { // //=================Create Materials and geometry + // TObjArray *modules = gAlice->Modules(); TIter next(modules); AliModule *detector; @@ -89,6 +97,9 @@ void AliGeant3::Init() //____________________________________________________________________________ void AliGeant3::ProcessRun(Int_t nevent) { + // + // Process the run + // Int_t todo = TMath::Abs(nevent); for (Int_t i=0; iNSecondaries() > 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); } } } diff --git a/TGeant3/AliGeant3.h b/TGeant3/AliGeant3.h index 383bca15543..c961626e94a 100644 --- a/TGeant3/AliGeant3.h +++ b/TGeant3/AliGeant3.h @@ -18,8 +18,6 @@ class AliGeant3 : public TGeant3 { -private: - public: AliGeant3(const char *title); AliGeant3() {} @@ -36,6 +34,8 @@ public: virtual void ProcessEvent(); virtual void ProcessRun(Int_t nevent); +private: + ClassDef(AliGeant3,1) //Generic MonteCarlo Class }; diff --git a/TGeant3/AliGeant3GeometryGUI.cxx b/TGeant3/AliGeant3GeometryGUI.cxx new file mode 100644 index 00000000000..2de266a219a --- /dev/null +++ b/TGeant3/AliGeant3GeometryGUI.cxx @@ -0,0 +1,415 @@ +/* ************************************************************************* + * 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; iGetIdVolume()); +// 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; jGetIdVolume()) + { + 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]); +} + + diff --git a/TGeant3/AliGeant3GeometryGUI.h b/TGeant3/AliGeant3GeometryGUI.h new file mode 100644 index 00000000000..a6fdc075e07 --- /dev/null +++ b/TGeant3/AliGeant3GeometryGUI.h @@ -0,0 +1,61 @@ +#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 diff --git a/TGeant3/AliGuiGeomDialog.cxx b/TGeant3/AliGuiGeomDialog.cxx new file mode 100644 index 00000000000..ec8d8e59685 --- /dev/null +++ b/TGeant3/AliGuiGeomDialog.cxx @@ -0,0 +1,451 @@ +/* ************************************************************************* + * 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; +} + diff --git a/TGeant3/AliGuiGeomDialog.h b/TGeant3/AliGuiGeomDialog.h new file mode 100644 index 00000000000..8c3173e68e5 --- /dev/null +++ b/TGeant3/AliGuiGeomDialog.h @@ -0,0 +1,55 @@ +#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 diff --git a/TGeant3/AliGuiGeomMain.cxx b/TGeant3/AliGuiGeomMain.cxx new file mode 100644 index 00000000000..12139b55c6c --- /dev/null +++ b/TGeant3/AliGuiGeomMain.cxx @@ -0,0 +1,848 @@ +/* ************************************************************************* + * 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 + +#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; iGftmat(imate, ipart, tmp, kdim, tkin, value, pcut, ixst); + } else { + for (Int_t i=0; iGbrelm(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; iUncheckedAt(i)); + if (gCurrentMaterial->Id()==imat) break; + } + Int_t imed = gCurrentVolume->Medium(); + Int_t nmed=fComboMediaEntries->GetEntriesFast(); + for (i=0; iUncheckedAt(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); +} + + diff --git a/TGeant3/AliGuiGeomMain.h b/TGeant3/AliGuiGeomMain.h new file mode 100644 index 00000000000..d689d9a0ea2 --- /dev/null +++ b/TGeant3/AliGuiGeomMain.h @@ -0,0 +1,91 @@ +#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 diff --git a/TGeant3/Makefile b/TGeant3/Makefile index ac28a712414..cf93a5e7e82 100644 --- a/TGeant3/Makefile +++ b/TGeant3/Makefile @@ -13,8 +13,10 @@ FSRCS = galicef.F # 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 diff --git a/TGeant3/TGeant3.cxx b/TGeant3/TGeant3.cxx index 502dd5c796a..1a596800ce5 100644 --- a/TGeant3/TGeant3.cxx +++ b/TGeant3/TGeant3.cxx @@ -15,6 +15,9 @@ /* $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 @@ -510,7 +513,7 @@ extern "C" // // Geant3 global pointer // -static Int_t defSize = 600; +static const Int_t kDefSize = 600; ClassImp(TGeant3) @@ -567,7 +570,7 @@ void TGeant3::DefaultRange() // Set range of current drawing pad to 20x20 cm // if (!gHigz) { - new THIGZ(defSize); + new THIGZ(kDefSize); gdinit(); } gHigz->Range(0,0,20,20); @@ -580,7 +583,7 @@ void TGeant3::InitHIGZ() // Initialise HIGZ // if (!gHigz) { - new THIGZ(defSize); + new THIGZ(kDefSize); gdinit(); } } @@ -757,7 +760,7 @@ Int_t TGeant3::IdFromPDG(Int_t pdg) const { // // Return Geant3 code from PDG and pseudo ENDF code - + // for(Int_t i=0;i0 && idAddParticle("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); @@ -935,21 +941,21 @@ void TGeant3::DefineParticles() // // - 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 @@ -1136,6 +1142,9 @@ const char* TGeant3::VolName(Int_t id) const //_____________________________________________________________________________ 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")) @@ -1164,6 +1173,9 @@ void TGeant3::SetCut(const char* cutName, Float_t cutValue) //_____________________________________________________________________________ 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")) @@ -1201,6 +1213,9 @@ void TGeant3::SetProcess(const char* flagName, Int_t flagValue) 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) { @@ -1371,13 +1386,13 @@ const char* TGeant3::ProdProcess() const // 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); @@ -1421,6 +1436,9 @@ void TGeant3::GetSecondary(Int_t isec, Int_t& ipart, //_____________________________________________________________________________ void TGeant3::InitLego() { + // + // Set switches for lego transport + // SetSWIT(4,0); SetDEBU(0,0,0); //do not print a message } @@ -1890,14 +1908,22 @@ void TGeant3::Gftmed(Int_t numed, char *name, Int_t &nmat, Int_t &isvol, } +//_____________________________________________________________________________ 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); } //_____________________________________________________________________________ @@ -3087,7 +3113,7 @@ void TGeant3::DrawOneSpec(const char *name) 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(); @@ -3121,7 +3147,7 @@ void TGeant3::Gdtree(const char *name,Int_t levmax, Int_t isel) char vname[5]; Vname(name,vname); gdtree(PASSCHARD(vname), levmax, isel PASSCHARL(vname)); - gHigz->fPname = ""; + gHigz->SetPname(""); } //_____________________________________________________________________________ @@ -3151,7 +3177,7 @@ void TGeant3::GdtreeParent(const char *name,Int_t levmax, Int_t isel) strncpy(vname,(char*)&fZiq[fGclink->jvolum+i],4); vname[4] = 0; gdtree(PASSCHARD(vname), levmax, isel PASSCHARL(vname)); - gHigz->fPname = ""; + gHigz->SetPname(""); return; } } @@ -3604,6 +3630,9 @@ void TGeant3::Vname(const char *name, char *vname) //______________________________________________________________________________ void TGeant3::Ertrgo() { + // + // Perform the tracking of the track Track parameters are in VECT + // ertrgo(); } @@ -3612,6 +3641,39 @@ void TGeant3::Ertrak(const Float_t *const x1, const Float_t *const p1, 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)); } @@ -3644,7 +3706,7 @@ void TGeant3::WriteEuclid(const char* filnam, const char* topvol, // 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; @@ -3673,7 +3735,7 @@ void TGeant3::WriteEuclid(const char* filnam, const char* topvol, 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;intmed;itm++) { if (iws[iadtmd+itm]>0) { @@ -3904,7 +3966,7 @@ void TGeant3::WriteEuclid(const char* filnam, const char* topvol, //* *** 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) { @@ -3918,7 +3980,7 @@ void TGeant3::WriteEuclid(const char* filnam, const char* topvol, //* *** 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]; @@ -3932,7 +3994,7 @@ void TGeant3::WriteEuclid(const char* filnam, const char* topvol, if (npar>0) { if (ivstak>1) for(i=0;ijvolum-ivo]; @@ -3985,7 +4047,7 @@ void TGeant3::WriteEuclid(const char* filnam, const char* topvol, //* //* *** 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]); diff --git a/TGeant3/TGeant3.h b/TGeant3/TGeant3.h index 402ead9017f..d506d1b8cc8 100644 --- a/TGeant3/TGeant3.h +++ b/TGeant3/TGeant3.h @@ -1,5 +1,5 @@ -#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 */ @@ -523,53 +523,6 @@ typedef struct { 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); @@ -577,6 +530,7 @@ public: delete [] fVolNames; fVolNames=0;} } + virtual void LoadAddress(); /////////////////////////////////////////////////////////////////////// @@ -600,7 +554,7 @@ public: 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; @@ -621,7 +575,8 @@ public: 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; @@ -635,12 +590,21 @@ public: 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); ///////////////////////////////////////////////////////////////////////////////////////////// // // @@ -757,7 +721,7 @@ public: 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 @@ -786,8 +750,8 @@ public: 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(); @@ -808,7 +772,8 @@ public: 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); @@ -859,6 +824,59 @@ public: 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 }; diff --git a/TGeant3/TGeant3GUI.cxx b/TGeant3/TGeant3GUI.cxx deleted file mode 100644 index 12f7d9af1f2..00000000000 --- a/TGeant3/TGeant3GUI.cxx +++ /dev/null @@ -1,2137 +0,0 @@ -/* ************************************************************************* - * 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#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; iGetIdVolume()); -// 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; jGetIdVolume()) - { - 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; iGftmat(imate, ipart, tmp, kdim, tkin, value, pcut, ixst); - } else { - for (Int_t i=0; iGbrelm(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; iUncheckedAt(i)); - if (gCurrentMaterial->Id()==imat) break; - } - Int_t imed = gCurrentVolume->Medium(); - Int_t nmed=fComboMediaEntries->GetEntriesFast(); - for (i=0; iUncheckedAt(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 -; -} - - - - - - - - - - - - - - - diff --git a/TGeant3/TGeant3GUI.h b/TGeant3/TGeant3GUI.h deleted file mode 100644 index f4e62165b56..00000000000 --- a/TGeant3/TGeant3GUI.h +++ /dev/null @@ -1,358 +0,0 @@ -#ifndef TGEANT3GUI -#define TGEANT3GUI -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -/* $Id$ */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -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 - - - - - - - - diff --git a/TGeant3/THIGZ.cxx b/TGeant3/THIGZ.cxx index 199262c4979..983f6d460da 100644 --- a/TGeant3/THIGZ.cxx +++ b/TGeant3/THIGZ.cxx @@ -15,6 +15,9 @@ /* $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 @@ -122,8 +125,8 @@ 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; @@ -132,14 +135,19 @@ ClassImp(THIGZ) //_______________________________________________________________ THIGZ::THIGZ() - :TCanvas() { + // + // Default constructor + // } //_______________________________________________________________ THIGZ::THIGZ(Int_t size) :TCanvas("higz","higz",size,size) { + // + // Standard Constructor + // gHigz = this; Reset(); SetFillColor(10); @@ -147,10 +155,16 @@ THIGZ::THIGZ(Int_t size) //_______________________________________________________________ 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; @@ -177,6 +191,9 @@ Float_t THIGZ::Get(const char *name) //_______________________________________________________________ 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;} @@ -214,6 +231,9 @@ void THIGZ::Set(const char *name, Float_t val) //_______________________________________________________________ void THIGZ::Reset(Option_t *) { + // + // Reset all attributes + // fFAIS = 0; fFASI = 1; fLTYP = 1; @@ -391,20 +411,23 @@ extern "C" void type_of_call idawk(Int_t &) //_______________________________________________________________ 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(); } @@ -419,8 +442,12 @@ extern "C" void type_of_call ightor(Float_t &h,Float_t &l,Float_t &s,Float_t &r, //_______________________________________________________________ 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; @@ -441,7 +468,7 @@ extern "C" void type_of_call igpave(Float_t &x1,Float_t &x2,Float_t &yy1,Float_t 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); } //_______________________________________________________________ @@ -451,16 +478,16 @@ extern "C" void type_of_call igpid(Int_t &,const char *name,Int_t &pid,const cha 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); } //_______________________________________________________________ @@ -470,9 +497,9 @@ extern "C" void type_of_call igq(const char *name,Float_t &rval, const Int_t l1) 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); } //_______________________________________________________________ @@ -495,9 +522,9 @@ extern "C" void type_of_call igset(const char *name,Float_t &rval, const Int_t l 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); } //_______________________________________________________________ @@ -518,15 +545,15 @@ extern "C" void type_of_call ipl(Int_t &n,Float_t *x,Float_t *y) // 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(); } } @@ -534,11 +561,14 @@ extern "C" void type_of_call ipl(Int_t &n,Float_t *x,Float_t *y) //_______________________________________________________________ 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(); } @@ -570,35 +600,35 @@ extern "C" void type_of_call isfaci(Int_t &col) // 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); } //_______________________________________________________________ @@ -607,7 +637,7 @@ extern "C" void type_of_call isplci(Int_t &col) // printf("isplci called, col=%d\n",col); Int_t color = col%1000; // if (color > 10) color += 35; - gHigz->fPLCI = color; + gHigz->SetPLCI(color); } //_______________________________________________________________ @@ -616,7 +646,7 @@ extern "C" void type_of_call ispmci(Int_t &col) // printf("ispmci called, col=%d\n",col); Int_t color = col%1000; // if (color > 10) color += 35; - gHigz->fPMCI = color; + gHigz->SetPMCI(color); } //_______________________________________________________________ @@ -625,7 +655,7 @@ extern "C" void type_of_call istxci(Int_t &col) // printf("istxci called, col=%d\n",col); Int_t color = col%1000; // if (color > 10) color += 35; - gHigz->fTXCI = color; + gHigz->SetTXCI(color); } //_______________________________________________________________ @@ -645,32 +675,35 @@ extern "C" void type_of_call iswn(Int_t &,Float_t &x1,Float_t &x2,Float_t &y1,Fl //_______________________________________________________________ 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); } @@ -678,6 +711,9 @@ extern "C" void type_of_call hplint(Int_t &) //_______________________________________________________________ extern "C" void type_of_call hplend() { + // + // End HPLOT + // printf("hplend called\n"); } @@ -692,6 +728,9 @@ extern "C" void type_of_call hplfra(Float_t &x1,Float_t &x2,Float_t &y1, Float_t //_______________________________________________________________ extern "C" void type_of_call igmeta(Int_t &, Int_t &) { + // + // Open metafile + // printf("igmeta called\n"); } @@ -711,8 +750,11 @@ extern "C" Int_t type_of_call igiwty(Int_t &) //_______________________________________________________________ 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); } diff --git a/TGeant3/THIGZ.h b/TGeant3/THIGZ.h index cb709d36da2..58a32b59f19 100644 --- a/TGeant3/THIGZ.h +++ b/TGeant3/THIGZ.h @@ -13,7 +13,7 @@ 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 @@ -64,8 +64,42 @@ public: 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 }; @@ -80,6 +114,6 @@ inline void THIGZ::SetLogy(Int_t) { } 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 diff --git a/TGeant3/TPaveTree.cxx b/TGeant3/TPaveTree.cxx index 9abbeb3f1ab..80713d91c03 100644 --- a/TGeant3/TPaveTree.cxx +++ b/TGeant3/TPaveTree.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.5 1999/09/29 09:24:31 fca +Introduction of the Copyright and cvs Log + */ /////////////////////////////////////////////////////////////////////////////// @@ -75,24 +78,6 @@ TPaveTree::~TPaveTree() // } -//_____________________________________________________________________________ -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() { diff --git a/TGeant3/TPaveTree.h b/TGeant3/TPaveTree.h index aa10b36ad4c..99b096358b6 100644 --- a/TGeant3/TPaveTree.h +++ b/TGeant3/TPaveTree.h @@ -1,5 +1,5 @@ -#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 */ @@ -21,15 +21,16 @@ class TPaveTree : public TPaveLabel 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 }; -- 2.43.0