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

BfldMap.h

Go to the documentation of this file.
00001 
00002 // $Id: BfldMap.h,v 1.9 2005/02/09 04:58:14 rhatcher Exp $
00003 //
00004 // BfldMap
00005 //
00006 // This structure provides services for holding the magnetic field components
00007 // at a series of points (cf. BfldMesh).  It encapsulates knowledge 
00008 // about the field values themselves, an possibly how to adjust them
00009 // for external effects (chemistry, coil current, etc.) but doesn't
00010 // explicitly hold any knowledge about the relative spatial placement
00011 // of the field values; that it must glean from BfldMesh.
00012 //
00013 // Author:  R. Hatcher 2000.06.20
00014 //
00016 #ifndef BFLDMAP_H
00017 #define BFLDMAP_H
00018 
00019 #include "TVector3.h"
00020 #include "TClonesArray.h"
00021 // don't use simple 'class TClonesArray' or CINT can't build streamer
00022 
00023 #include "BField/BfldGrid.h"
00024 #include "BField/BfldRefCnt.h"
00025 
00026 #include <vector>
00027 
00028 class BfldMap : public TObject, public BfldRefCnt {
00029 
00030  public:
00031 
00032    BfldMap();
00033    BfldMap(BfldGrid::Grid_t grid, Int_t variant);
00034    virtual ~BfldMap();
00035 
00036    virtual TVector3  GetBField(Int_t generator);   // return corrected field
00037                                                    // oooops no longer! ==Raw
00038    virtual TVector3  GetRawField(Int_t generator); // uncorrected field
00039 
00040    BfldGrid::Grid_t  GetGrid() const;    // which grid does this map lie on?
00041    Int_t             GetVariant() const; // which map variation, due to
00042                                          // chemistry, end-plane effects, etc
00043    Float_t           GetGeneratedCoilCurrent() const;
00044 
00045  protected:
00046 
00047    void            ResizeVectors(UInt_t size);
00048    void            AddGenerator(UInt_t generator, Double_t bx, Double_t by, 
00049                                 Double_t bz=0.0);
00050                    // the TVector3 interface is for convenience only
00051                    // the preferred interface is the one with components
00052    void            AddGenerator(UInt_t generator, TVector3& bfld);
00053 
00054    BfldGrid::Grid_t    fGrid;
00055    Int_t               fVariant;
00056    Bool_t              fIs3d;       // has non-zero z components
00057 
00058    Float_t             fGeneratedCoilCurrent;  // current used when generating
00059    Bool_t              fFilledOkay;            // successful construction?
00060    std::string         fDataSource;            // e.g. filename
00061 
00062    UInt_t              fNumGenerators;
00063    std::vector<Float_t> fBx;
00064    std::vector<Float_t> fBy;
00065    std::vector<Float_t> fBz;
00066    ClassDef(BfldMap,4)
00067 
00068  private:
00069 
00070 };
00071 
00072 inline BfldGrid::Grid_t BfldMap::GetGrid() const { return fGrid; }
00073 inline Int_t            BfldMap::GetVariant() const { return fVariant; }
00074 inline Float_t          BfldMap::GetGeneratedCoilCurrent() const
00075                                      { return fGeneratedCoilCurrent; }
00076 
00077 #endif // BFLDMAP_H
00078 
00079 // RWH Blog:
00080 // Currently we have the ctor reading the text files and filling the
00081 // object, but we also need a means of doing this from the DBI tables.
00082 //    specialized functions for 
00083 //         Rect2d file reading (would simultaneously build corresponding mesh)
00084 //         Voronoi file reading
00085 // Make this class lighter by replacing TClonesArray of TVector3's
00086 // with vector<Double_t> x, y, z; bool hasZcomponents;
00087 // don't fill z unless hasZcomponents
00088 // no overhead of TObject, construct TVector3's as necessary
00089 //    

Generated on Mon Feb 15 11:06:25 2010 for loon by  doxygen 1.3.9.1