BfldMapVoronoi Class Reference

#include <BfldMapVoronoi.h>

Inheritance diagram for BfldMapVoronoi:
BfldMap BfldRefCnt

List of all members.

Public Member Functions

 BfldMapVoronoi ()
 BfldMapVoronoi (BfldGrid::Grid_t grid, Int_t variant)
virtual ~BfldMapVoronoi ()

Detailed Description

Definition at line 25 of file BfldMapVoronoi.h.


Constructor & Destructor Documentation

BfldMapVoronoi::BfldMapVoronoi (  ) 

Definition at line 38 of file BfldMapVoronoi.cxx.

00039    : BfldMap()
00040 {
00041 
00042 }

BfldMapVoronoi::BfldMapVoronoi ( BfldGrid::Grid_t  grid,
Int_t  variant 
)

Definition at line 45 of file BfldMapVoronoi.cxx.

References BfldMap::AddGenerator(), bfld::AsString(), BfldMap::fDataSource, BfldMap::fFilledOkay, BfldMap::fGeneratedCoilCurrent, Msg::kDebug, BfldGrid::kNearCoarseV, Msg::kWarning, MSG, and BfldMap::ResizeVectors().

00046    : BfldMap(grid,variant)
00047 {
00048    // read in a Map
00049 
00050    // map from grid+variant to a file or database record
00051    switch (grid) {
00052    case BfldGrid::kNearCoarseV: 
00053       fDataSource = "NearDetBFld.default";
00054       fGeneratedCoilCurrent = 1.0; // should be part of the file
00055       break;
00056    default:
00057       MSG("Bfld",Msg::kWarning)
00058          << "BfldMapVoronoi not yet supported for grid " <<
00059          BfldGrid::AsString(grid) << " variant " << variant << endl;
00060       return;
00061       break;
00062    }
00063 
00064    Msg::LogLevel_t verbosity = Msg::kDebug;
00065 
00066    MSG("Bfld",verbosity) << "BfldMapVoronoi::ctor "
00067                          << fDataSource << endl;
00068 
00069    Int_t i = 0;
00070    Int_t NodeID = 0;
00071    Float_t bx, by, bz;
00072    Int_t NodeIDLast = -999;
00073 
00074    // allocate a container, don't know the size needed yet so 
00075    // take a guess ... actually since there's just but the one
00076    // file (see above) 
00077    Int_t initSize = 4092;
00078    ResizeVectors(initSize);
00079 
00080    ifstream DATA(fDataSource.c_str(),ios::in);
00081    if(!DATA) {
00082       MSG("Bfld",Msg::kWarning) << "BfldMapVoronoi No such file: " 
00083                                 << fDataSource << endl;
00084       return;
00085    }
00086 
00087    while(!DATA.eof()){
00088       DATA >> NodeID >> bx >> by >> bz; 
00089       if (NodeID != NodeIDLast) AddGenerator(NodeID,bx,by,bz);
00090       NodeIDLast = NodeID;
00091       i++;
00092    }
00093    DATA.close(); 
00094 
00095    MSG("Bfld",verbosity) << "BfldMapVoronoi file read in " << i 
00096                          << " vectors " <<endl;
00097 
00098    fFilledOkay = kTRUE;
00099 }

BfldMapVoronoi::~BfldMapVoronoi (  )  [virtual]

Definition at line 102 of file BfldMapVoronoi.cxx.

References BfldMap::fGrid, BfldMap::fVariant, Msg::kInfo, BfldGrid::kUndefined, and MSG.

00103 {
00104    // dtor deletes owned components
00105 
00106    MSG("Bfld",Msg::kInfo) << "~BfldMapVoronoi variant " << fVariant << endl;
00107 
00108    fGrid    = BfldGrid::kUndefined;
00109    fVariant = -1;
00110 
00111 }


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1