Description: A class implimentating a look up table
Implementation: Internally stores data in vector filled with 32 bit ints address and output is masked to specifed number of bits vector only allocates as necessary, eg we may have a 32 bit address but we obviously dont want to allocate a 4gb vector
Error handling: currently waiting guidance on how to deal with this Exceptions are currently forbiden, emulator fails should not impact on the rest of the software chain. As such, everything silently fails gracefully
- Author
- : Sam Harper - RAL, Jim Brooke - Bristol
Definition at line 27 of file LUT.h.
int l1t::LUT::read |
( |
std::istream & |
stream | ) |
|
Definition at line 35 of file LUT.cc.
References addressMask_, data_, dataMask_, DUP_ENTRIES, python.tagInventory::entries, spr::find(), geometryCSVtoXML::line, max(), MAX_ADDRESS_OUTOFRANGE, MISS_ENTRIES, NO_ENTRIES, readHeader_(), python.multivaluedict::sort(), AlCaHLTBitMon_QueryRunRegistry::string, SUCCESS, and create_public_lumi_plots::transform.
Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), LUT(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().
40 if(readHeaderCode!=
SUCCESS)
return readHeaderCode;
42 std::vector<std::pair<unsigned int,int> >
entries;
46 while(std::getline(
stream,line)){
47 line.erase(
std::find( line.begin(), line.end(),
'#' ), line.end() );
48 std::istringstream lineStream(line);
49 std::pair<unsigned int,int> entry;
50 while(lineStream >> entry.first >> entry.second ){
53 entries.push_back(entry);
54 if(entry.first>maxAddress || maxAddress==
addressMask_) maxAddress=entry.first;
67 if(entries.front().first!=0 ||
68 std::adjacent_find(entries.begin(),entries.end(),
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const T & max(const T &a, const T &b)
unsigned int addressMask_
int readHeader_(std::istream &)