Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGeoParallelWorld.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*************************************************************************
0002  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0003  * All rights reserved.                                                  *
0004  *                                                                       *
0005  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0006  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0007  *************************************************************************/
0008 
0009 // Author: Andrei Gheata   30/06/14
0010 
0011 #ifndef ROOT_TGeoParallelWorld
0012 #define ROOT_TGeoParallelWorld
0013 
0014 #include "TNamed.h"
0015 
0016 // forward declarations
0017 class TGeoManager;
0018 class TGeoPhysicalNode;
0019 class TGeoVolume;
0020 
0021 class TGeoParallelWorld : public TNamed {
0022 protected:
0023    TGeoManager *fGeoManager;     // base geometry
0024    TObjArray *fPaths;            // array of paths
0025    Bool_t fUseOverlaps;          // Activated if user defined overlapping candidates
0026    Bool_t fIsClosed;             //! Closed flag
0027    TGeoVolume *fVolume;          //! helper volume
0028    TGeoPhysicalNode *fLastState; //! Last PN touched
0029    TObjArray *fPhysical;         //! array of physical nodes
0030 
0031    TGeoParallelWorld(const TGeoParallelWorld &) = delete;
0032    TGeoParallelWorld &operator=(const TGeoParallelWorld &) = delete;
0033 
0034 public:
0035    // constructors
0036    TGeoParallelWorld()
0037       : TNamed(),
0038         fGeoManager(nullptr),
0039         fPaths(nullptr),
0040         fUseOverlaps(kFALSE),
0041         fIsClosed(kFALSE),
0042         fVolume(nullptr),
0043         fLastState(nullptr),
0044         fPhysical(nullptr)
0045    {
0046    }
0047    TGeoParallelWorld(const char *name, TGeoManager *mgr);
0048 
0049    // destructor
0050    ~TGeoParallelWorld() override;
0051    // API for adding components nodes
0052    void AddNode(const char *path);
0053    // Activate/deactivate  overlap usage
0054    void SetUseOverlaps(Bool_t flag) { fUseOverlaps = flag; }
0055    Bool_t IsUsingOverlaps() const { return fUseOverlaps; }
0056    void ResetOverlaps() const;
0057    // Adding overlap candidates can highly improve performance.
0058    void AddOverlap(TGeoVolume *vol, Bool_t activate = kTRUE);
0059    void AddOverlap(const char *volname, Bool_t activate = kTRUE);
0060    // The normal PW mode (without declaring overlaps) does detect them
0061    Int_t PrintDetectedOverlaps() const;
0062 
0063    // Closing a parallel geometry is mandatory
0064    Bool_t CloseGeometry();
0065    // Refresh structures in case of re-alignment
0066    void RefreshPhysicalNodes();
0067 
0068    // Navigation interface
0069    TGeoPhysicalNode *FindNode(Double_t point[3]);
0070    TGeoPhysicalNode *FindNextBoundary(Double_t point[3], Double_t dir[3], Double_t &step, Double_t stepmax = 1.E30);
0071    Double_t Safety(Double_t point[3], Double_t safmax = 1.E30);
0072 
0073    // Getters
0074    TGeoManager *GetGeometry() const { return fGeoManager; }
0075    Bool_t IsClosed() const { return fIsClosed; }
0076    TGeoVolume *GetVolume() const { return fVolume; }
0077 
0078    // Utilities
0079    void CheckOverlaps(Double_t ovlp = 0.001); // default 10 microns
0080    void Draw(Option_t *option) override;
0081 
0082    ClassDefOverride(TGeoParallelWorld, 3) // parallel world base class
0083 };
0084 
0085 #endif