CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
LMap::impl Class Reference

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 30 of file LMap.cc.

Constructor & Destructor Documentation

◆ impl()

LMap::impl::impl ( )
inline

Definition at line 32 of file LMap.cc.

32 {}

◆ ~impl()

LMap::impl::~impl ( )
inline

Definition at line 33 of file LMap.cc.

33 {}

Member Function Documentation

◆ get_map()

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

Definition at line 36 of file LMap.cc.

36 { return _lmap; };
std::map< int, LMapRow > _lmap
Definition: LMap.cc:40

◆ read()

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

Definition at line 51 of file LMap.cc.

References _lmap, _table, LMapRow::adc, LMapRow::crate, LMapRow::dcc, LMapRow::dcc_sl, LMapRow::depth, LMapRow::det, LMapRow::dphi, LMapRow::eta, LMapRow::fedid, LMapRow::fi_ch, LMapRow::fpga, HcalBarrel, HcalEndcap, HcalForward, HcalOther, HcalOuter, LMapRow::htr, LMapRow::htr_fi, if(), recoMuon::in, LMapRow::let_code, groupFilesInBlocks::lines, LMapRow::phi, LMapRow::pixel, LMapRow::qie, DetId::rawId(), LMapRow::rbx, LMapRow::rctcar, LMapRow::rctcon, LMapRow::rctcra, LMapRow::rctnam, LMapRow::rm, LMapRow::rm_fi, LMapRow::side, LMapRow::slb, LMapRow::slbin, LMapRow::slbin2, LMapRow::slnam, LMapRow::spigo, AlCaHLTBitMon_QueryRunRegistry::string, and LMapRow::wedge.

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

51  {
53 
54  std::string _row;
55  ifstream inFile(map_file.c_str(), std::ios::in);
56  if (!inFile) {
57  edm::LogError("LMap") << "Unable to open file with the logical map: " << map_file;
58  } else {
59  edm::LogInfo("LMap") << "File with the logical map opened successfully: " << map_file << std::endl
60  << "Type: " << type;
61  }
62  while (getline(inFile, _row)) {
63  LMapRow aRow;
64  char det[32];
65  char rbx[32];
66  char fpga[32];
67  char slbin[32];
68  char slbin2[32];
69  char slnam[32];
70  char rctnam[32];
71 
72  const char* let_code = "Z";
73 
74  int _read = 0;
75  if (type == "HBEF") {
76  const char* _format =
77  " %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";
78  _read = sscanf(_row.c_str(),
79  _format,
80  &(aRow.side),
81  &(aRow.eta),
82  &(aRow.phi),
83  &(aRow.dphi),
84  &(aRow.depth),
85  det,
86  rbx,
87  &(aRow.wedge),
88  &(aRow.rm),
89  &(aRow.pixel),
90  &(aRow.qie),
91  &(aRow.adc),
92  &(aRow.rm_fi),
93  &(aRow.fi_ch),
94  &(aRow.crate),
95  &(aRow.htr),
96  fpga,
97  &(aRow.htr_fi),
98  &(aRow.dcc_sl),
99  &(aRow.spigo),
100  &(aRow.dcc),
101  &(aRow.slb),
102  slbin,
103  slbin2,
104  slnam,
105  &(aRow.rctcra),
106  &(aRow.rctcar),
107  &(aRow.rctcon),
108  rctnam,
109  &(aRow.fedid));
110  } else if (type == "HO") {
111  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";
112  _read = sscanf(_row.c_str(),
113  _format,
114  &(aRow.side),
115  &(aRow.eta),
116  &(aRow.phi),
117  &(aRow.dphi),
118  &(aRow.depth),
119  det,
120  rbx,
121  &(aRow.wedge),
122  &(aRow.rm),
123  &(aRow.pixel),
124  &(aRow.qie),
125  &(aRow.adc),
126  &(aRow.rm_fi),
127  &(aRow.fi_ch),
128  &let_code,
129  &(aRow.crate),
130  &(aRow.htr),
131  fpga,
132  &(aRow.htr_fi),
133  &(aRow.dcc_sl),
134  &(aRow.spigo),
135  &(aRow.dcc),
136  &(aRow.slb));
137  //slbin, slbin2, slnam,
138  //&(aRow.rctcra), &(aRow.rctcar), &(aRow.rctcon),
139  //rctnam,
140  //&(aRow.fedid) );
141  }
142  if (_read >= 23) {
143  lines.count();
144 
145  std::string _det(det);
146  if (_det.find("HB") != std::string::npos)
147  aRow.det = HcalBarrel;
148  else if (_det.find("HE") != std::string::npos)
149  aRow.det = HcalEndcap;
150  else if (_det.find("HF") != std::string::npos)
151  aRow.det = HcalForward;
152  else if (_det.find("HO") != std::string::npos)
153  aRow.det = HcalOuter;
154  else
155  aRow.det = HcalOther;
156 
157  aRow.rbx.append(rbx);
158  aRow.fpga.append(fpga);
159  aRow.slbin.append(slbin);
160  aRow.slbin2.append(slbin2);
161  aRow.slnam.append(slnam);
162  aRow.rctnam.append(rctnam);
163  aRow.let_code.append(let_code);
164 
165  _table.push_back(aRow);
166 
167  HcalDetId _hdid(aRow.det, aRow.side * aRow.eta, aRow.phi, aRow.depth);
168 
169  _lmap[_hdid.rawId()] = aRow;
170  }
171  }
172  inFile.close();
173  edm::LogInfo("LMap") << lines.getCount() << " lines read";
174 
175  return 0;
176 }
int rctcra
Definition: LMap.h:47
int dphi
Definition: LMap.h:37
int phi
Definition: LMap.h:37
int pixel
Definition: LMap.h:41
int qie
Definition: LMap.h:41
int fedid
Definition: LMap.h:49
Log< level::Error, false > LogError
int slb
Definition: LMap.h:45
int htr
Definition: LMap.h:42
int depth
Definition: LMap.h:37
int spigo
Definition: LMap.h:45
std::string slbin
Definition: LMap.h:46
int dcc_sl
Definition: LMap.h:45
int fi_ch
Definition: LMap.h:41
int adc
Definition: LMap.h:41
std::string slnam
Definition: LMap.h:46
int crate
Definition: LMap.h:42
std::string rbx
Definition: LMap.h:40
std::map< int, LMapRow > _lmap
Definition: LMap.cc:40
std::string rctnam
Definition: LMap.h:48
int side
Definition: LMap.h:34
Log< level::Info, false > LogInfo
std::string fpga
Definition: LMap.h:43
int rm_fi
Definition: LMap.h:41
int dcc
Definition: LMap.h:45
std::string slbin2
Definition: LMap.h:46
int wedge
Definition: LMap.h:41
int rctcon
Definition: LMap.h:47
int rctcar
Definition: LMap.h:47
int htr_fi
Definition: LMap.h:44
std::string let_code
Definition: LMap.h:51
HcalSubdetector det
Definition: LMap.h:39
Definition: LMap.h:31
int eta
Definition: LMap.h:37
std::vector< LMapRow > _table
Definition: LMap.cc:36
int rm
Definition: LMap.h:41

Member Data Documentation

◆ _lmap

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

Definition at line 40 of file LMap.cc.

Referenced by read().

◆ _table

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