Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-17 23:36:22

0001 // -*- C++ -*-
0002 //
0003 // Package:    HcalSimNumberingTester
0004 // Class:      HcalSimNumberingTester
0005 //
0006 /**\class HcalSimNumberingTester HcalSimNumberingTester.cc test/HcalSimNumberingTester.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Sunanda Banerjee
0015 //         Created:  Mon 2013/12/26
0016 //
0017 
0018 // system include files
0019 #include <memory>
0020 #include <iostream>
0021 #include <fstream>
0022 
0023 // user include files
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0026 
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/EventSetup.h"
0029 #include "FWCore/Framework/interface/MakerMacros.h"
0030 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0032 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0033 #include "Geometry/Records/interface/HcalSimNumberingRecord.h"
0034 #include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h"
0035 
0036 class HcalSimNumberingTester : public edm::one::EDAnalyzer<> {
0037 public:
0038   explicit HcalSimNumberingTester(const edm::ParameterSet&);
0039   ~HcalSimNumberingTester() override;
0040 
0041   void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
0042 
0043 private:
0044   edm::ESGetToken<HcalDDDSimConstants, HcalSimNumberingRecord> token_;
0045 };
0046 
0047 HcalSimNumberingTester::HcalSimNumberingTester(const edm::ParameterSet&)
0048     : token_{esConsumes<HcalDDDSimConstants, HcalSimNumberingRecord>(edm::ESInputTag{})} {}
0049 
0050 HcalSimNumberingTester::~HcalSimNumberingTester() {}
0051 
0052 // ------------ method called to produce the data  ------------
0053 void HcalSimNumberingTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0054   const HcalDDDSimConstants hdc = iSetup.getData(token_);
0055 
0056   edm::LogVerbatim("HCalGeom") << "about to getConst for 0..1";
0057   for (int i = 0; i <= 1; ++i) {
0058     std::vector<std::pair<double, double> > gcons = hdc.getConstHBHE(i);
0059     edm::LogVerbatim("HCalGeom") << "Geometry Constants for [" << i << "] with " << gcons.size() << "  elements";
0060     for (unsigned int k = 0; k < gcons.size(); ++k)
0061       edm::LogVerbatim("HCalGeom") << "Element[" << k << "] = " << gcons[k].first << " : " << gcons[k].second;
0062   }
0063   for (int i = 0; i < 4; ++i)
0064     edm::LogVerbatim("HCalGeom") << "MaxDepth[" << i << "] = " << hdc.getMaxDepth(i);
0065   hdc.printTiles();
0066 }
0067 
0068 //define this as a plug-in
0069 DEFINE_FWK_MODULE(HcalSimNumberingTester);