Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:08

0001 
0002 /*----------------------------------------------------------------------
0003 
0004 Toy EDAnalyzer for testing purposes only.
0005 
0006 ----------------------------------------------------------------------*/
0007 
0008 #include <stdexcept>
0009 #include <string>
0010 #include <iostream>
0011 #include <map>
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "FWCore/Framework/interface/MakerMacros.h"
0014 
0015 #include "CondFormats/DTObjects/test/stubs/DTMapPrint.h"
0016 
0017 namespace edmtest {
0018 
0019   DTMapPrint::DTMapPrint(edm::ParameterSet const& p) : es_token(esConsumes()) {}
0020 
0021   DTMapPrint::DTMapPrint(int i) {}
0022 
0023   void DTMapPrint::analyze(const edm::Event& e, const edm::EventSetup& context) {
0024     using namespace edm::eventsetup;
0025     // Context is not used.
0026     std::cout << " I AM IN RUN NUMBER " << e.id().run() << std::endl;
0027     std::cout << " ---EVENT NUMBER " << e.id().event() << std::endl;
0028     const auto& ro_map = context.getData(es_token);
0029     std::cout << ro_map.mapCellTdc() << " - " << ro_map.mapRobRos() << std::endl;
0030     std::cout << std::distance(ro_map.begin(), ro_map.end()) << " connections in the map" << std::endl;
0031     DTReadOutMapping::const_iterator iter = ro_map.begin();
0032     DTReadOutMapping::const_iterator iend = ro_map.end();
0033     while (iter != iend) {
0034       const DTReadOutGeometryLink& link = *iter++;
0035       std::cout << link.dduId << " " << link.rosId << " " << link.robId << " " << link.tdcId << " " << link.channelId
0036                 << " " << link.wheelId << " " << link.stationId << " " << link.sectorId << " " << link.slId << " "
0037                 << link.layerId << " " << link.cellId << std::endl;
0038     }
0039   }
0040   DEFINE_FWK_MODULE(DTMapPrint);
0041 }  // namespace edmtest