CMS 3D CMS Logo

FlatTable.cc
Go to the documentation of this file.
2 
4  for (unsigned int i = 0, n = columns_.size(); i < n; ++i) {
5  if (columns_[i].name == name)
6  return i;
7  }
8  return -1;
9 }
10 
12  if (extension() || !other.extension() || name() != other.name() || size() != other.size())
13  throw cms::Exception("LogicError", "Mismatch in adding extension");
14  for (unsigned int i = 0, n = other.nColumns(); i < n; ++i) {
15  switch (other.columnType(i)) {
16  case FloatColumn:
17  addColumn<float>(other.columnName(i), other.columnData<float>(i), other.columnDoc(i), other.columnType(i));
18  break;
19  case IntColumn:
20  addColumn<int>(other.columnName(i), other.columnData<int>(i), other.columnDoc(i), other.columnType(i));
21  break;
22  case BoolColumn: // as UInt8
23  case UInt8Column:
24  addColumn<uint8_t>(other.columnName(i), other.columnData<uint8_t>(i), other.columnDoc(i), other.columnType(i));
25  break;
26  }
27  }
28 }
29 
30 double nanoaod::FlatTable::getAnyValue(unsigned int row, unsigned int column) const {
31  if (column >= nColumns())
32  throw cms::Exception("LogicError", "Invalid column");
33  switch (columnType(column)) {
34  case FloatColumn:
35  return *(beginData<float>(column) + row);
36  case IntColumn:
37  return *(beginData<int>(column) + row);
38  case BoolColumn:
39  return *(beginData<uint8_t>(column) + row);
40  case UInt8Column:
41  return *(beginData<uint8_t>(column) + row);
42  }
43  throw cms::Exception("LogicError", "Unsupported type");
44 }
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edmStreamStallGrapher.extension
extension
Definition: edmStreamStallGrapher.py:893
trackingPlots.other
other
Definition: trackingPlots.py:1465
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
nanoaod::FlatTable::addExtension
void addExtension(const FlatTable &extension)
Definition: FlatTable.cc:11
nanoaod::FlatTable::columnIndex
int columnIndex(const std::string &name) const
Definition: FlatTable.cc:3
nanoaod::FlatTable::columns_
std::vector< Column > columns_
Definition: FlatTable.h:188
FlatTable.h
nanoaod::FlatTable::name
const std::string & name() const
Definition: FlatTable.h:55
nanoaod::FlatTable
Definition: FlatTable.h:36
nanoaod::FlatTable::getAnyValue
double getAnyValue(unsigned int row, unsigned int column) const
Definition: FlatTable.cc:30
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
cms::Exception
Definition: Exception.h:70
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443