Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Ugli.h

Go to the documentation of this file.
00001 // $Id: Ugli.h,v 1.8 2008/01/24 01:17:41 rhatcher Exp $
00002 
00003 #ifndef UGLI_H
00004 #define UGLI_H
00005 
00007 // UgliDbiSteelPln
00008 //
00009 // Package: UgliGeometry
00010 //
00011 // Concept:
00012 //
00013 //
00014 // R. Hatcher 2001-08-08
00016 
00017 #include "TVector3.h"
00018 #include "Conventions/Detector.h"
00019 
00020 namespace Ugli
00021 {
00022 
00023 // Types and Enums
00024 
00026    enum EModifyMode {
00027       kModifiable, // geometry may differ from database values 
00028       kFrozen,     // geometry is frozen at database values
00029       kUseGlobal   // choose from above based on static setting of class
00030    };
00031 
00033    typedef enum ESMRegion {
00034      kUpstream   = -1,
00035      kDownstream = -2,
00036      kSMGap      =  0,  // non-SM regions must be <= 0 
00037      kInSM1      =  1,
00038      kInSM2      =  2
00039    } SMRegion_t;
00040    
00042    typedef enum EXYRegion {
00043      kCoil    = 0,  // current carrying material (not implemented)
00044      kThroat  = 1,  // throat of the coil collar
00045      kNeck    = 2,  // narrow outer part of collar in steel
00046      kHole    = 3,  // hole in the steel
00047      kFlange  = 4,  // wide outer part of collar in gap
00048      kBypass  = 5,  // bypass region (not implemented)
00049      kSteel   = 6,  // x-y region outside collar region
00050      kHall    = 7,  // outside region covered of steel (not implemented)
00051      kRock    = 8   // outside the hall (not implemented)
00052    } XYRegion_t;
00053 
00054    // for alignment studies one would get a Modifiable geometry
00055    // and modify it, then set this flag to kModifiable
00056    // run some analysis using it (which should by default use kUseGlobal)
00057    // and compare this to running analysis with the flag set to kFrozen
00058    static EModifyMode    fDefaultModifyMode = Ugli::kFrozen;
00059 
00060    // State testing member functions
00061 
00062    // for modifying or checking which list UseGlobal will choose from
00063                  void SetDefaultModifyMode(EModifyMode mmode = kFrozen);
00064    inline EModifyMode GetDefaultModifyMode() { return fDefaultModifyMode; }
00065 
00066         const Char_t* AsString(EModifyMode mmode);
00067         const Char_t* AsString(ESMRegion   smregion);
00068         const Char_t* AsString(EXYRegion   xyregion);
00069 
00070    // coordinate transformation functions
00071           inline bool XYisUV(Detector::Detector_t det)
00072                { return (Detector::kCalDet == det); } // of three detectors ...
00073 
00074                  void uv2xy(Detector::Detector_t det, 
00075                             Double_t  u, Double_t  v,
00076                             Double_t& x, Double_t& y);
00077                  void uv2xy(Detector::Detector_t det, 
00078                             Float_t   u, Float_t   v,
00079                             Float_t&  x, Float_t&  y);
00080                  void xy2uv(Detector::Detector_t det, 
00081                             Double_t  x, Double_t  y,
00082                             Double_t& u, Double_t& v);
00083                  void xy2uv(Detector::Detector_t det, 
00084                             Float_t   x, Float_t   y,
00085                             Float_t&  u, Float_t&  v);
00086              TVector3 uvz2xyz(Detector::Detector_t det, const TVector3& uvz);
00087              TVector3 xyz2uvz(Detector::Detector_t det, const TVector3& xyz);
00088 
00089    // constants used by a variety of Ugli classes
00090    // (initialization in namespace means no use of TMath functions)
00091    static const Double_t pi      = 3.14159265358979323846;
00092    static const Double_t rad2deg = 180. / pi;
00093    static const Double_t deg2rad = pi / 180.;
00094    static const Double_t r_sqrt2 = 7.07106781186547462e-01;
00095 
00096 }
00097 
00098 #endif  // UGLI_H

Generated on Sat Nov 21 22:48:00 2009 for loon by  doxygen 1.3.9.1