CMS 3D CMS Logo

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

Constructor & Destructor Documentation

◆ HcalEmap() [1/2]

HcalEmap::HcalEmap ( )
inline

Definition at line 34 of file HcalEmap.h.

34 {}

◆ HcalEmap() [2/2]

HcalEmap::HcalEmap ( std::string  filename)
inline

Definition at line 35 of file HcalEmap.h.

35 { read_map(filename); }

References corrVsCorr::filename, and read_map().

◆ ~HcalEmap()

HcalEmap::~HcalEmap ( )
inline

Definition at line 36 of file HcalEmap.h.

36 {}

Member Function Documentation

◆ get_map()

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

Definition at line 71 of file HcalEmap.cc.

71 { return map; }

References genParticles_cff::map.

Referenced by LutXml::test_access().

◆ read_map()

int HcalEmap::read_map ( std::string  filename)

Definition at line 25 of file HcalEmap.cc.

25  {
26  int lines = 0;
27 
28  std::string _row;
29  ifstream inFile(filename.c_str(), std::ios::in);
30  if (!inFile) {
31  std::cout << "Unable to open file with the electronic map: " << filename << std::endl;
32  } else {
33  std::cout << "File with the electronic map opened successfully: " << filename << std::endl;
34  }
35  while (getline(inFile, _row)) {
36  HcalEmapRow aRow;
37  char fpga[32];
38  char subdet[32];
39 
40  int _read;
41  const char* _format = "%d %d %d %s %d %d %d %d %s %d %d %d";
42  _read = sscanf(_row.c_str(),
43  _format,
44  &(aRow.rawId),
45  &(aRow.crate),
46  &(aRow.slot),
47  fpga,
48  &(aRow.dcc),
49  &(aRow.spigot),
50  &(aRow.fiber),
51  &(aRow.fiberchan),
52  subdet,
53  &(aRow.ieta),
54  &(aRow.iphi),
55  &(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 }

References gather_cfg::cout, HcalEmap::HcalEmapRow::crate, HcalEmap::HcalEmapRow::dcc, HcalEmap::HcalEmapRow::fiber, HcalEmap::HcalEmapRow::fiberchan, corrVsCorr::filename, HcalEmap::HcalEmapRow::idepth, HcalEmap::HcalEmapRow::ieta, recoMuon::in, HcalEmap::HcalEmapRow::iphi, groupFilesInBlocks::lines, genParticles_cff::map, HcalEmap::HcalEmapRow::rawId, HcalEmap::HcalEmapRow::slot, HcalEmap::HcalEmapRow::spigot, AlCaHLTBitMon_QueryRunRegistry::string, HcalEmap::HcalEmapRow::subdet, and HcalEmap::HcalEmapRow::topbottom.

Referenced by HcalEmap().

Member Data Documentation

◆ map

std::vector<HcalEmapRow> HcalEmap::map
protected
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HcalEmap::map
std::vector< HcalEmapRow > map
Definition: HcalEmap.h:68
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
groupFilesInBlocks.lines
lines
Definition: groupFilesInBlocks.py:95
recoMuon::in
Definition: RecoMuonEnumerators.h:6
HcalEmap::read_map
int read_map(std::string filename)
Definition: HcalEmap.cc:25
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256