#include <TMuiHVMask.h>
#include <TMuiKeyGen.h>
#include <fstream>
#include <sstream>
#include <MUIOO.h>
#include <boost/array.hpp>
#include <string>
#include <MutGeom.h>
#include <MuiGeomClasses.hh>
Go to the source code of this file.
Functions | |
ClassImp (TMuiHVMask) sgi |
|
default constructor Definition at line 11 of file TMuiHVMask.cxx. References TMuiHVMask::_disabled, TMuiHVMask::_map, TMuiHVMask::_mask_plane, TMuiHVMask::_one_tube_effic, TMuiHVMask::_run_number, TMuiHVMask::_two_tube_effic, and TMuiHVMask::_use_override.
00028 { 00029 // Default filenames 00030 // 00031 boost::array<const char*,2> files = {{_filename_north.c_str(),_filename_south.c_str()}}; 00032 MUTOO::PRINT(std::cout,"TMuiHVMask::Initialize"); 00033 std::cout << _filename_north.c_str() << std::endl; 00034 std::cout << _filename_south.c_str() << std::endl; 00035 MUTOO::PRINT(std::cout,"**"); 00036 00037 for(size_t i=0; i<files.size(); ++i){ 00038 00039 ifstream lookup_file; 00040 00041 // Input file 00042 // 00043 lookup_file.open(files[i]); 00044 if(!lookup_file.is_open()) { 00045 MUIOO::TRACE("TMuiHVMask: can't find input file"); 00046 continue; 00047 } 00048 00049 // Fill the map 00050 // 00051 while(lookup_file) { 00052 00053 UShort_t iarm=0, iplane=0, ipanel=0, iorient=0, itwopack=0; 00054 float effic=0; 00055 lookup_file >> iarm; 00056 lookup_file >> iplane; 00057 lookup_file >> ipanel; 00058 lookup_file >> iorient; 00059 lookup_file >> itwopack; 00060 lookup_file >> effic; 00061 00062 // Figure out how to to this correctly 00063 // 00064 if(iarm==0&&iplane==0&&ipanel==0&&iorient==0&&itwopack==0&&effic==0.0) continue; 00065 00066 ULong_t key = TMuiKeyGen::get_key(iarm,iplane,ipanel,iorient,itwopack); 00067 00068 // The number read is is 0, 65, 90 -- We reserve the right to adjust these 00069 // numbers hence the condition below that selects either the one tube or 00070 // two tube efficiency numbers from class data members 00071 // 00072 if(_use_override) { 00073 if(effic == 90) { 00074 _map.insert(std::make_pair(key,_two_tube_effic)); 00075 } else if(effic == 65){ 00076 _map.insert(std::make_pair(key,_one_tube_effic)); 00077 } else if(effic == 0){ 00078 _map.insert(std::make_pair(key,0)); 00079 } 00080 } else { 00081 _map.insert(std::make_pair(key,effic)); 00082 } 00083 } 00084 lookup_file.close(); 00085 } 00086 00087 // Message for the masses 00088 // 00089 MUIOO::PRINT(std::cout, "TMuiHVMask Initialization"); 00090 std::cout << "TMuiHVMask read " << _map.size() << " entries" << std::endl; 00091 MUIOO::PRINT(std::cout, "**"); 00092 00093 return true; 00094 } |