Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:14

0001 // @(#)root/g3d:$Id$
0002 // Author: "Valery fine"   31/10/97
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 #ifndef ROOT_TMarker3DBox
0012 #define ROOT_TMarker3DBox
0013 
0014 
0015 ////////////////////////////////////////////////////////////////////////////
0016 //                                                                        //
0017 // TMarker3DBox                                                           //
0018 //                                                                        //
0019 // Marker3DBox is a special 3-D marker designed for event display.        //
0020 // It has the following parameters:                                       //
0021 //    fDx;              half length in X                                  //
0022 //    fDy;              half length in Y                                  //
0023 //    fDz;              half length in Z                                  //
0024 //    fTranslation[3];  the coordinates of the center of the box          //
0025 //    fDirCos[3];       the direction cosinus defining the orientation    //
0026 //    fRefObject;       A reference to an object                          //
0027 //                                                                        //
0028 ////////////////////////////////////////////////////////////////////////////
0029 
0030 #include "TObject.h"
0031 #include "TAttLine.h"
0032 #include "TAttFill.h"
0033 #include "TAtt3D.h"
0034 
0035 class TH1;
0036 
0037 class TMarker3DBox : public TObject, public TAttLine, public TAttFill,
0038                      public TAtt3D {
0039 protected:
0040    Float_t  fX;               // X coordinate of center of box
0041    Float_t  fY;               // Y coordinate of center of box
0042    Float_t  fZ;               // Z coordinate of center of box
0043    Float_t  fDx;              // half length in x
0044    Float_t  fDy;              // half length in y
0045    Float_t  fDz;              // half length in z
0046 
0047    Float_t  fTheta;           // Angle of box z axis with respect to main Z axis
0048    Float_t  fPhi;             // Angle of box x axis with respect to main Xaxis
0049    TObject *fRefObject;       // Pointer to an object
0050 
0051    TMarker3DBox(const TMarker3DBox&);
0052    TMarker3DBox& operator=(const TMarker3DBox&);
0053 
0054    enum { kTemporary = BIT(23) }; // Use TObject::fBits to record if we are temporary
0055 
0056 public:
0057    TMarker3DBox();
0058    TMarker3DBox(Float_t x, Float_t y, Float_t z,
0059                 Float_t dx, Float_t dy, Float_t dz,
0060                 Float_t theta, Float_t phi);
0061           ~TMarker3DBox() override;
0062 
0063    Int_t   DistancetoPrimitive(Int_t px, Int_t py) override;
0064    void    ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0065    TObject        *GetRefObject() const {return fRefObject;}
0066    virtual void    GetDirection(Float_t &theta, Float_t &phi) const {theta = fTheta; phi = fPhi;}
0067    virtual void    GetPosition(Float_t &x, Float_t &y, Float_t &z) const {x=fX; y=fY, z=fZ;}
0068    virtual void    GetSize(Float_t &dx, Float_t &dy, Float_t &dz) const {dx=fDx; dy=fDy; dz=fDz;}
0069 
0070    void    Paint(Option_t *option) override;
0071    static  void    PaintH3(TH1 *h, Option_t *option);
0072    void    SavePrimitive(std::ostream &out, Option_t *option = "") override;
0073    virtual void    SetPoints(Double_t *buff) const;
0074    virtual void    SetDirection(Float_t theta, Float_t phi);
0075    virtual void    SetPosition(Float_t x, Float_t y, Float_t z);
0076    virtual void    SetSize(Float_t dx, Float_t dy, Float_t dz);
0077    virtual void    SetRefObject(TObject *obj = nullptr) {fRefObject = obj;}
0078 
0079    ClassDefOverride(TMarker3DBox,2)  //A special 3-D marker designed for event display
0080 };
0081 
0082 #endif