15 : id_(config.getParameter<
std::
string>(
"identifier"))
16 , data_tag_(config.getParameter<
std::
string>(
"dataTag"))
17 , since_run_(config.getParameter<unsigned long long>(
"sinceRun"))
18 , input_file_(config.getParameter<
edm::FileInPath>(
"inputFile").fullPath())
19 , wheel_not_side_(config.getParameter<bool>(
"wheelNotSide"))
20 , wos_fed_(config.getParameter<
std::vector<
int> >(
"wheelOrSideFED"))
21 , n_sectors_(config.getParameter<unsigned
int>(
"nSectors"))
22 , wos_sector_amc_(wos_fed_.
size(),
std::vector<
int>(n_sectors_, 0))
23 , txt_file_(config.getUntrackedParameter<
std::
string>(
"txtFile",
""))
25 std::vector<long long> wos_sector_amc_packed(config.
getParameter<std::vector<long long> >(
"wheelOrSideSectorAMC"));
27 if (
wos_fed_.size() != wos_sector_amc_packed.size()) {
28 throw cms::Exception(
"RPCAMCLinkMapHandler") <<
"Refuse to handle inconsistent input: " 29 <<
"sizes of wheelOrSideFED and wheelOrSideSectorAMC don't match";
32 std::vector<std::vector<int> >::iterator sector_amc =
wos_sector_amc_.begin();
33 for (std::vector<long long>::const_iterator sector_amc_packed = wos_sector_amc_packed.begin()
34 ; sector_amc_packed != wos_sector_amc_packed.end() ; ++sector_amc_packed, ++sector_amc) {
35 for (
unsigned int sector = 0 ; sector <
n_sectors_ ; ++sector) {
36 sector_amc->at(sector) = ((*sector_amc_packed) >> (4 * (n_sectors_ - sector - 1))) & 0xf;
50 <<
", older than most recent tag" << tag_info.
lastInterval.first;
54 unsigned int wos, sector, amc_number, amc_input;
56 std::unique_ptr<RPCAMCLinkMap> amc_link_map_object(
new RPCAMCLinkMap());
58 = amc_link_map_object->getMap();
62 std::istringstream
conv;
66 input_file >> amc_name >> amc_input >> link_name;
67 std::getline(input_file, line);
74 next = amc_name.find_first_not_of(
"+-0123456789",
pos);
76 conv.str(amc_name.substr(
pos, next -
pos));
81 next = amc_name.find_first_not_of(
"+-0123456789",
pos);
82 if (next == std::string::npos)
83 next = amc_name.size();
85 conv.str(amc_name.substr(
pos, next -
pos));
88 wos = (amc_name.at(4) ==
'n' ? 0 : 1);
90 conv.str(amc_name.substr(5, 1));
95 throw cms::Exception(
"RPCAMCLinkMapHandler") <<
"Found sector greater than the number of sectors: " 101 << wos <<
" >= " <<
wos_fed_.size();
108 amc_link_map.insert(std::pair<RPCAMCLink, RPCLBLink>(
RPCAMCLink(
wos_fed_.at(wos), amc_number, amc_input)
111 input_file >> amc_name >> amc_input >> link_name;
112 std::getline(input_file, line);
119 for (
auto const link : amc_link_map) {
120 ofstream << link.first <<
": " << link.second << std::endl;
124 edm::LogInfo(
"RPCAMCLinkMapHandler") <<
"Add to transfer list";
T getParameter(std::string const &) const
static HepMC::IO_HEPEVT conv
OldContainer m_to_transfer
cond::ValidityInterval lastInterval
RPCAMCLinkMapHandler(edm::ParameterSet const &config)
std::map< RPCAMCLink, RPCLBLink > map_type
std::vector< std::vector< int > > wos_sector_amc_
static void parse(std::string const &name, RPCLBLink &lb_link)
std::vector< int > wos_fed_
cond::TagInfo_t const & tagInfo() const