File indexing completed on 2024-04-06 11:59:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <memory>
0020 #include <iostream>
0021 #include <algorithm>
0022
0023
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/EventSetup.h"
0028 #include "FWCore/Framework/interface/ESHandle.h"
0029
0030 #include "FWCore/Framework/interface/Event.h"
0031 #include "FWCore/Framework/interface/MakerMacros.h"
0032
0033 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0034
0035 #include "CondFormats/SiStripObjects/interface/Phase2TrackerModule.h"
0036 #include "CondFormats/SiStripObjects/interface/Phase2TrackerCabling.h"
0037 #include "CondFormats/DataRecord/interface/Phase2TrackerCablingRcd.h"
0038
0039
0040
0041
0042
0043 class CheckPhase2Cabling : public edm::one::EDAnalyzer<> {
0044 public:
0045 explicit CheckPhase2Cabling(const edm::ParameterSet&);
0046 ~CheckPhase2Cabling();
0047
0048 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0049
0050 private:
0051 virtual void analyze(const edm::Event&, const edm::EventSetup&);
0052
0053
0054 const edm::ESGetToken<Phase2TrackerCabling, Phase2TrackerCablingRcd> cablingToken_;
0055 };
0056
0057
0058
0059
0060 CheckPhase2Cabling::CheckPhase2Cabling(const edm::ParameterSet& iConfig) : cablingToken_(esConsumes()) {}
0061
0062 CheckPhase2Cabling::~CheckPhase2Cabling() = default;
0063
0064
0065
0066
0067
0068 void CheckPhase2Cabling::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0069 using namespace edm;
0070
0071 ESHandle<Phase2TrackerCabling> cablingHandle = iSetup.getHandle(cablingToken_);
0072
0073
0074 std::cout << cablingHandle->summaryDescription() << std::endl;
0075
0076 std::cout << cablingHandle->description() << std::endl;
0077
0078
0079 Phase2TrackerModule module = cablingHandle->findFedCh(std::make_pair(0, 1));
0080
0081
0082 std::cout << "Information about the module connected to FED 0.1:" << std::endl;
0083 std::cout << module.description() << std::endl;
0084
0085
0086 Phase2TrackerCabling coolingLoop = cablingHandle->filterByCoolingLine(0);
0087 std::cout << "Subset in cooling line 0:" << std::endl;
0088 std::cout << coolingLoop.description(1) << std::endl;
0089
0090
0091 Phase2TrackerCabling powerGroup = cablingHandle->filterByPowerGroup(1);
0092 std::cout << "Subset in power group 1:" << std::endl;
0093 std::cout << powerGroup.description(1) << std::endl;
0094 }
0095
0096
0097 void CheckPhase2Cabling::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0098
0099
0100 edm::ParameterSetDescription desc;
0101 desc.setUnknown();
0102 descriptions.addDefault(desc);
0103 }
0104
0105
0106 DEFINE_FWK_MODULE(CheckPhase2Cabling);