CMS 3D CMS Logo

LMap::impl Class Reference

List of all members.

Public Member Functions

std::map< int, LMapRow > & get_map (void)
 impl ()
int read (string accessor, string type)
 ~impl ()

Private Attributes

std::map< int, LMapRow_lmap
std::vector< LMapRow_table


Detailed Description

Definition at line 31 of file LMap.cc.


Constructor & Destructor Documentation

LMap::impl::impl (  )  [inline]

Definition at line 33 of file LMap.cc.

00033 { }

LMap::impl::~impl (  )  [inline]

Definition at line 34 of file LMap.cc.

00034 { }


Member Function Documentation

std::map<int,LMapRow>& LMap::impl::get_map ( void   )  [inline]

Definition at line 37 of file LMap.cc.

References _lmap.

00037 { return _lmap; };

int LMap::impl::read ( string  accessor,
string  type 
)

Definition at line 63 of file LMap.cc.

References _lmap, _table, LMapRow::adc, count, GenMuonPlsPt100GeV_cfg::cout, LMapRow::crate, LMapRow::dcc, LMapRow::dcc_sl, LMapRow::depth, LMapRow::det, LMapRow::dphi, lat::endl(), LMapRow::eta, LMapRow::fedid, LMapRow::fi_ch, HcalBarrel, HcalEndcap, HcalForward, HcalOther, HcalOuter, LMapRow::htr, LMapRow::htr_fi, in, LMapRow::phi, LMapRow::pixel, LMapRow::qie, DetId::rawId(), LMapRow::rctcar, LMapRow::rctcon, LMapRow::rctcra, LMapRow::rm, LMapRow::rm_fi, LMapRow::side, LMapRow::slb, LMapRow::spigo, and LMapRow::wedge.

00064 {
00065 
00066   RooGKCounter lines;
00067 
00068   string _row;
00069   ifstream inFile( map_file . c_str(), ios::in );
00070   if (!inFile)
00071     {
00072       cout << "Unable to open file with the logical map: " << map_file << endl;
00073     }
00074   else
00075     {
00076       cout << "File with the logical map opened successfully: " << map_file << endl;
00077       cout << "Type: " << type << endl;
00078     }
00079   while ( getline( inFile, _row ) > 0 )
00080     {
00081       LMapRow aRow;
00082       char det[32];
00083       char rbx[32];
00084       char fpga[32];
00085       char slbin[32];
00086       char slbin2[32];
00087       char slnam[32];
00088       char rctnam[32];
00089 
00090       char * let_code = "Z";
00091 
00092       int _read;
00093       if ( type == "HBEF" )
00094         {
00095           const char * _format = " %d %d %d %d %d %s %s %d %d %d %d %d %d %d %d %d %s %d %d %d %d %d %s %s %s %d %d %d %s %d";
00096           _read = sscanf( _row . c_str(), _format,
00097                           &(aRow.side),
00098                           &(aRow.eta), &(aRow.phi), &(aRow.dphi), &(aRow.depth),
00099                           det,
00100                           rbx,
00101                           &(aRow.wedge), &(aRow.rm), &(aRow.pixel), &(aRow.qie), &(aRow.adc), &(aRow.rm_fi), &(aRow.fi_ch),
00102                           &(aRow.crate), &(aRow.htr),
00103                           fpga,
00104                           &(aRow.htr_fi),
00105                           &(aRow.dcc_sl), &(aRow.spigo), &(aRow.dcc), &(aRow.slb),
00106                           slbin, slbin2, slnam,
00107                           &(aRow.rctcra), &(aRow.rctcar), &(aRow.rctcon),
00108                           rctnam,
00109                           &(aRow.fedid) );
00110         }
00111       else if ( type == "HO" )
00112         {
00113           const char * _format = " %d %d %d %d %d %s %s %d %d %d %d %d %d %d %s %d %d %s %d %d %d %d %d";
00114           _read = sscanf( _row . c_str(), _format,
00115                           &(aRow.side),
00116                           &(aRow.eta), &(aRow.phi), &(aRow.dphi), &(aRow.depth),
00117                           det,
00118                           rbx,
00119                           &(aRow.wedge), &(aRow.rm), &(aRow.pixel), &(aRow.qie), &(aRow.adc), &(aRow.rm_fi), &(aRow.fi_ch),
00120                           &let_code,
00121                           &(aRow.crate), &(aRow.htr),
00122                           fpga,
00123                           &(aRow.htr_fi),
00124                           &(aRow.dcc_sl), &(aRow.spigo), &(aRow.dcc), &(aRow.slb) );
00125           //slbin, slbin2, slnam,
00126           //&(aRow.rctcra), &(aRow.rctcar), &(aRow.rctcon),
00127           //rctnam,
00128           //&(aRow.fedid) );
00129         }
00130       if ( _read >= 23 )
00131         {
00132           lines . count();
00133           
00134           string _det(det);
00135           if      ( _det.find("HB") != string::npos ) aRow . det = HcalBarrel;
00136           else if ( _det.find("HE") != string::npos ) aRow . det = HcalEndcap;
00137           else if ( _det.find("HF") != string::npos ) aRow . det = HcalForward;
00138           else if ( _det.find("HO") != string::npos ) aRow . det = HcalOuter;
00139           else                    aRow . det = HcalOther;
00140 
00141           aRow . rbx .append( rbx );
00142           aRow . fpga .append( fpga );
00143           aRow . slbin .append( slbin );
00144           aRow . slbin2 .append( slbin2 );
00145           aRow . slnam .append( slnam );
00146           aRow . rctnam .append( rctnam );
00147           aRow . let_code .append( let_code );
00148           
00149           _table . push_back( aRow );
00150 
00151           HcalDetId _hdid(aRow.det, aRow.side*aRow.eta, aRow.phi, aRow.depth);
00152 
00153           _lmap[_hdid.rawId()] = aRow;
00154 
00155         }
00156     }
00157   inFile.close();
00158   cout << "LMap: " << lines . getCount() << " lines read" << endl;
00159 
00160   return 0;
00161 }


Member Data Documentation

std::map<int,LMapRow> LMap::impl::_lmap [private]

Definition at line 41 of file LMap.cc.

Referenced by get_map(), and read().

std::vector<LMapRow> LMap::impl::_table [private]

Definition at line 37 of file LMap.cc.

Referenced by read().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:27:45 2009 for CMSSW by  doxygen 1.5.4