File indexing completed on 2023-10-25 09:37:40
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <stdexcept>
0010 #include <iostream>
0011 #include <fstream>
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "FWCore/Framework/interface/MakerMacros.h"
0014
0015 #include "CondTools/DT/test/stubs/DTFullMapDump.h"
0016
0017 #include "CondFormats/DTObjects/interface/DTReadOutMapping.h"
0018
0019
0020 namespace edmtest {
0021
0022 DTFullMapDump::DTFullMapDump(edm::ParameterSet const& p) {
0023
0024 fileName = p.getParameter<std::string>("fileName");
0025 }
0026
0027 DTFullMapDump::DTFullMapDump(int i) {}
0028
0029 void DTFullMapDump::analyze(const edm::Event& e, const edm::EventSetup& context) {}
0030
0031 void DTFullMapDump::endJob() {
0032 std::ifstream mapFile(fileName.c_str());
0033
0034 DTReadOutMapping* compMap = new DTReadOutMapping("rob", "ros");
0035 int ddu;
0036 int ros;
0037 int rob;
0038 int tdc;
0039 int cha;
0040 int whe;
0041 int sta;
0042 int sec;
0043 int qua;
0044 int lay;
0045 int cel;
0046 while (mapFile >> ddu >> ros >> rob >> tdc >> cha >> whe >> sta >> sec >> qua >> lay >> cel) {
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 compMap->insertReadOutGeometryLink(ddu, ros, rob, tdc, cha, whe, sta, sec, qua, lay, cel);
0059 }
0060
0061 std::cout << "now expand" << std::endl;
0062
0063
0064
0065
0066 const DTReadOutMapping* fullMap = compMap->fullMap();
0067 std::cout << "done" << std::endl;
0068 DTReadOutMapping::const_iterator iter = fullMap->begin();
0069 DTReadOutMapping::const_iterator iend = fullMap->end();
0070 while (iter != iend) {
0071 const DTReadOutGeometryLink& link = *iter++;
0072 std::cout << link.dduId << " " << link.rosId << " " << link.robId << " " << link.tdcId << " " << link.channelId
0073 << " " << link.wheelId << " " << link.stationId << " " << link.sectorId << " " << link.slId << " "
0074 << link.layerId << " " << link.cellId << std::endl;
0075 }
0076 }
0077
0078 DEFINE_FWK_MODULE(DTFullMapDump);
0079 }