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 35 of file HcalEmap.h.

Constructor & Destructor Documentation

HcalEmap::HcalEmap ( )
inline

Definition at line 38 of file HcalEmap.h.

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

Definition at line 39 of file HcalEmap.h.

References read_map().

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

Definition at line 40 of file HcalEmap.h.

40 {}

Member Function Documentation

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

Definition at line 73 of file HcalEmap.cc.

References python.multivaluedict::map().

Referenced by LutXml::test_access().

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

Definition at line 29 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, and HcalEmap::HcalEmapRow::spigot.

Referenced by HcalEmap().

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