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; };

◆ read()

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

Definition at line 51 of file LMap.cc.

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 }

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, 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().

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
HcalOther
Definition: HcalAssistant.h:38
LMapRow::rctcra
int rctcra
Definition: LMap.h:47
LMapRow::let_code
std::string let_code
Definition: LMap.h:51
LMapRow::rctnam
std::string rctnam
Definition: LMap.h:48
LMapRow::eta
int eta
Definition: LMap.h:37
LMapRow::phi
int phi
Definition: LMap.h:37
LMapRow::fedid
int fedid
Definition: LMap.h:49
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HcalBarrel
Definition: HcalAssistant.h:33
LMapRow::dphi
int dphi
Definition: LMap.h:37
LMapRow::crate
int crate
Definition: LMap.h:42
LMap::impl::_table
std::vector< LMapRow > _table
Definition: LMap.cc:36
LMapRow::rm
int rm
Definition: LMap.h:41
LMapRow::qie
int qie
Definition: LMap.h:41
LMapRow::rm_fi
int rm_fi
Definition: LMap.h:41
LMap::impl::_lmap
std::map< int, LMapRow > _lmap
Definition: LMap.cc:40
LMapRow::depth
int depth
Definition: LMap.h:37
LMapRow::rbx
std::string rbx
Definition: LMap.h:40
LMapRow::dcc_sl
int dcc_sl
Definition: LMap.h:45
LMapRow::adc
int adc
Definition: LMap.h:41
LMapRow::slb
int slb
Definition: LMap.h:45
LMapRow::rctcon
int rctcon
Definition: LMap.h:47
LMapRow::rctcar
int rctcar
Definition: LMap.h:47
LMapRow::side
int side
Definition: LMap.h:34
RooGKCounter
Definition: RooGKCounter.h:10
HcalOuter
Definition: HcalAssistant.h:35
LMapRow::htr_fi
int htr_fi
Definition: LMap.h:44
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
groupFilesInBlocks.lines
lines
Definition: groupFilesInBlocks.py:95
LMapRow::fi_ch
int fi_ch
Definition: LMap.h:41
LMapRow::slbin2
std::string slbin2
Definition: LMap.h:46
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
recoMuon::in
Definition: RecoMuonEnumerators.h:6
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
LMapRow::spigo
int spigo
Definition: LMap.h:45
HcalDetId
Definition: HcalDetId.h:12
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalForward
Definition: HcalAssistant.h:36
LMapRow::det
HcalSubdetector det
Definition: LMap.h:39
LMapRow::fpga
std::string fpga
Definition: LMap.h:43
LMapRow::htr
int htr
Definition: LMap.h:42
HcalEndcap
Definition: HcalAssistant.h:34
LMapRow::pixel
int pixel
Definition: LMap.h:41
LMapRow::slbin
std::string slbin
Definition: LMap.h:46
LMapRow::dcc
int dcc
Definition: LMap.h:45
LMapRow::slnam
std::string slnam
Definition: LMap.h:46
LMapRow
Definition: LMap.h:31
LMapRow::wedge
int wedge
Definition: LMap.h:41