ChannelMapSQLite class definiton.
More...
|
int | GetDataset (const std::string &, int func(void *, int, char **, char **), void *) const |
|
|
using | ReadoutIDVec = std::vector< unsigned int > |
| Define the returned data structures for a mapping between TPC Fragment IDs and the related crate and readout information. Then define the function interface to fill these data structures. More...
|
|
using | CrateNameReadoutIDPair = std::pair< std::string, ReadoutIDVec > |
|
using | TPCFragmentIDToReadoutIDMap = std::map< unsigned int, CrateNameReadoutIDPair > |
|
using | ChannelPlanePair = std::pair< unsigned int, unsigned int > |
| Define the returned data structures for a mapping between TPC readout boards and the channel information Then define the function interface to fill these data structures. More...
|
|
using | ChannelPlanePairVec = std::vector< ChannelPlanePair > |
|
using | SlotChannelVecPair = std::pair< unsigned int, ChannelPlanePairVec > |
|
using | TPCReadoutBoardToChannelMap = std::map< unsigned int, SlotChannelVecPair > |
|
using | DigitizerChannelChannelIDPair = std::pair< size_t, size_t > |
| Define the returned data structures for a mapping between PMT Fragment IDs and the related crate and readout information. Then define the function interface to fill these data structures. More...
|
|
using | DigitizerChannelChannelIDPairVec = std::vector< DigitizerChannelChannelIDPair > |
|
using | FragmentToDigitizerChannelMap = std::map< size_t, DigitizerChannelChannelIDPairVec > |
|
using | CRTHWtoSimMacAddressPair = std::pair< unsigned int, unsigned int > |
| Define the returned data structures for a mapping between CRT hardware mac_address to the simulated mac_address. Then define the function interface to fill these data structures. More...
|
|
using | CRTChannelIDToHWtoSimMacAddressPairMap = std::map< unsigned int, CRTHWtoSimMacAddressPair > |
|
using | TopCRTHWtoSimMacAddressPairMap = std::map< unsigned int, unsigned int > |
|
using | SideCRTMac5ToChannelPair = std::pair< unsigned int, unsigned int > |
|
using | SideCRTGainToPedPair = std::pair< double, double > |
|
using | SideCRTChannelToCalibrationMap = std::map< SideCRTMac5ToChannelPair, SideCRTGainToPedPair > |
|
ChannelMapSQLite class definiton.
Definition at line 37 of file ChannelMapSQLite_tool.cc.
icarusDB::ChannelMapSQLite::ChannelMapSQLite |
( |
fhicl::ParameterSet const & |
pset | ) |
|
|
explicit |
icarusDB::ChannelMapSQLite::~ChannelMapSQLite |
( |
| ) |
|
Define the returned data structures for a mapping between CRT hardware mac_address to the simulated mac_address. Then define the function interface to fill these data structures.
Implements icarusDB::IChannelMapping.
Definition at line 433 of file ChannelMapSQLite_tool.cc.
436 crtChannelIDToHWtoSimMacAddressPairMap.clear();
438 const std::string dataType(
"feb_channels");
445 throw cet::exception(
"ChannelMapSQLite::BuildCRTChannelIDToHWtoSimMacAddressPairMap") <<
"Encountered error in reading the database: '" << error <<
"'\n";
int buildCRTChannelIDToHWtoSimMacAddressPairMap_callback(void *dataIn, int argc, char **argv, char **azColName)
int GetDataset(const std::string &, int func(void *, int, char **, char **), void *) const
Define the returned data structures for a mapping between PMT Fragment IDs and the related crate and readout information. Then define the function interface to fill these data structures.
Implements icarusDB::IChannelMapping.
Definition at line 392 of file ChannelMapSQLite_tool.cc.
395 fragmentToDigitizerChannelMap.clear();
397 const std::string dataType(
"pmt_placements");
404 throw cet::exception(
"ChannelMapSQLite::BuildFragmentToDigitizerChannelMap") <<
"Encountered error in reading the database: '" << error <<
"'\n";
int GetDataset(const std::string &, int func(void *, int, char **, char **), void *) const
int buildFragmentToDigitizerChannelMap_callback(void *dataIn, int argc, char **argv, char **azColName)
Implements icarusDB::IChannelMapping.
Definition at line 486 of file ChannelMapSQLite_tool.cc.
489 sideCRTChannelToCalibrationMap.clear();
491 std::string fullFileName;
492 cet::search_path searchPath(
"FW_SEARCH_PATH");
497 throw cet::exception(
"ChannelMapSQLite::GetDataset") <<
"Can't find calibration input file: '" <<
fCalibDBFileName <<
"'\n";
502 database.UpdateData(1638918271*1e9);
504 std::vector<unsigned int> channels;
505 database.GetChannelList(channels);
507 for (
auto it = channels.begin(); it != channels.end(); ++it) {
513 database.GetNamedChannelData(*it,
"mac5", mac5);
514 database.GetNamedChannelData(*it,
"localchannel", chan);
515 database.GetNamedChannelData(*it,
"gain", gain);
516 database.GetNamedChannelData(*it,
"pedestal", ped);
519 sideCRTChannelToCalibrationMap.insert(std::make_pair(std::make_pair((
int)mac5,(
int)chan), std::make_pair(gain,ped)));
std::string fCalibDBFileName
BEGIN_PROLOG could also be cout
Implements icarusDB::IChannelMapping.
Definition at line 466 of file ChannelMapSQLite_tool.cc.
469 topcrtHWtoSimMacAddressPairMap.clear();
471 const std::string dataType(
"crtfeb");
478 throw cet::exception(
"ChannelMapSQLite::BuildTopCRTHWtoSimMacAddressPairMap") <<
"Encountered error in reading the database: '" << error <<
"'\n";
int GetDataset(const std::string &, int func(void *, int, char **, char **), void *) const
int buildTopCRTHWtoSimMacAddressPairMap_callback(void *dataIn, int argc, char **argv, char **azColName)
Define the returned data structures for a mapping between TPC Fragment IDs and the related crate and readout information. Then define the function interface to fill these data structures.
Implements icarusDB::IChannelMapping.
Definition at line 304 of file ChannelMapSQLite_tool.cc.
306 const std::string dataType(
"readout_boards");
313 throw cet::exception(
"ChannelMapSQLite::BuildTPCFragmentIDToReadoutIDMap") <<
"Encountered error in reading the database: '" << error <<
"'\n";
int GetDataset(const std::string &, int func(void *, int, char **, char **), void *) const
int buildTPCFragmentIDToReadoutIDMap_callback(void *dataIn, int argc, char **argv, char **azColName)
Define the returned data structures for a mapping between TPC readout boards and the channel information Then define the function interface to fill these data structures.
Implements icarusDB::IChannelMapping.
Definition at line 361 of file ChannelMapSQLite_tool.cc.
363 const std::string dataType(
"daq_channels");
370 throw cet::exception(
"ChannelMapSQLite::BuildTPCReadoutBoardToChannelMap") <<
"Encountered error in reading the database: '" << error <<
"'\n";
int buildTPCReadoutBoardToChannelMap_callback(void *dataIn, int argc, char **argv, char **azColName)
int GetDataset(const std::string &, int func(void *, int, char **, char **), void *) const
int icarusDB::ChannelMapSQLite::GetDataset |
( |
const std::string & |
table, |
|
|
int |
funcvoid *, int, char **, char **, |
|
|
void * |
data |
|
) |
| const |
|
private |
Definition at line 131 of file ChannelMapSQLite_tool.cc.
133 std::string fullFileName;
134 cet::search_path searchPath(
"FW_SEARCH_PATH");
136 if (!searchPath.find_file(
fDBFileName, fullFileName))
137 throw cet::exception(
"ChannelMapSQLite::GetDataset") <<
"Can't find input file: '" <<
fDBFileName <<
"'\n";
142 int rc = sqlite3_open(fullFileName.c_str(), &database);
145 throw cet::exception(
"ChannelMapSQLite::GetDataset") <<
"Can't open the database, return code:" << sqlite3_errmsg(database) <<
"'\n";
148 std::string select =
"SELECT * FROM " + table;
152 rc = sqlite3_exec(database, select.c_str(), func, data, &zErrMsg);
154 if( rc != SQLITE_OK )
156 std::cout <<
"ChannelMapSQLite::GetDataset: SQL error: " << zErrMsg << std::endl;
157 sqlite3_free(zErrMsg);
161 std::cout <<
"ChannelMapSQLite::GetDataset: Successfully read database" << std::endl;
164 sqlite3_close(database);
BEGIN_PROLOG could also be cout
std::string icarusDB::ChannelMapSQLite::fCalibDBFileName |
|
private |
std::string icarusDB::ChannelMapSQLite::fDBFileName |
|
private |
std::string icarusDB::ChannelMapSQLite::fTag |
|
private |
The documentation for this class was generated from the following file: