CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Attributes
HcalEmap Class Reference

#include <CalibCalorimetry/HcalTPGAlgos/interface/HcalEmap.h>

Classes

class  HcalEmapRow
 

Public Member Functions

std::vector
< HcalEmap::HcalEmapRow > & 
get_map (void)
 
 HcalEmap ()
 
 HcalEmap (std::string filename)
 
int read_map (std::string filename)
 
 ~HcalEmap ()
 

Protected Attributes

std::vector< HcalEmapRowmap
 

Detailed Description

Description: container for the HCAL electronics map

Usage:

Definition at line 34 of file HcalEmap.h.

Constructor & Destructor Documentation

HcalEmap::HcalEmap ( )
inline

Definition at line 37 of file HcalEmap.h.

37 {}
HcalEmap::HcalEmap ( std::string  filename)
inline

Definition at line 38 of file HcalEmap.h.

References read_map().

38 { read_map(filename); }
tuple filename
Definition: lut2db_cfg.py:20
int read_map(std::string filename)
Definition: HcalEmap.cc:28
HcalEmap::~HcalEmap ( )
inline

Definition at line 39 of file HcalEmap.h.

39 {}

Member Function Documentation

std::vector< HcalEmap::HcalEmapRow > & HcalEmap::get_map ( void  )

Definition at line 72 of file HcalEmap.cc.

References python.multivaluedict::map().

Referenced by LutXml::test_access().

73 {
74  return map;
75 }
std::vector< HcalEmapRow > map
Definition: HcalEmap.h:72
int HcalEmap::read_map ( std::string  filename)

Definition at line 28 of file HcalEmap.cc.

References gather_cfg::cout, HcalEmap::HcalEmapRow::crate, HcalEmap::HcalEmapRow::dcc, HcalEmap::HcalEmapRow::fiber, HcalEmap::HcalEmapRow::fiberchan, HcalEmap::HcalEmapRow::idepth, HcalEmap::HcalEmapRow::ieta, recoMuon::in, HcalEmap::HcalEmapRow::iphi, groupFilesInBlocks::lines, python.multivaluedict::map(), HcalEmap::HcalEmapRow::rawId, HcalEmap::HcalEmapRow::slot, HcalEmap::HcalEmapRow::spigot, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HcalEmap().

29 {
30  int lines=0;
31 
32  std::string _row;
33  ifstream inFile( filename . c_str(), std::ios::in );
34  if (!inFile){
35  std::cout << "Unable to open file with the electronic map: " << filename << std::endl;
36  }
37  else{
38  std::cout << "File with the electronic map opened successfully: " << filename << std::endl;
39  }
40  while ( getline( inFile, _row ) > 0 ){
41  HcalEmapRow aRow;
42  char fpga[32];
43  char subdet[32];
44 
45  int _read;
46  const char * _format = "%d %d %d %s %d %d %d %d %s %d %d %d";
47  _read = sscanf( _row . c_str(), _format,
48  &(aRow.rawId),
49  &(aRow.crate), &(aRow.slot),
50  fpga,
51  &(aRow.dcc),
52  &(aRow.spigot),&(aRow.fiber),&(aRow.fiberchan),
53  subdet,
54  &(aRow.ieta), &(aRow.iphi), &(aRow.idepth) );
55  if ( _read >= 12 ){
56  lines++;
57 
58  aRow . subdet .append( subdet );
59  aRow . topbottom .append( fpga );
60 
61  map . push_back( aRow );
62  }
63  }
64  inFile.close();
65  std::cout << "HcalEmap: " << lines << " lines read" << std::endl;
66 
67  return 0;
68 }
std::vector< HcalEmapRow > map
Definition: HcalEmap.h:72
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

std::vector<HcalEmapRow> HcalEmap::map
protected

Definition at line 72 of file HcalEmap.h.