Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:49

0001 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0002 #include "FWCore/Framework/interface/EventSetup.h"
0003 #include "FWCore/Framework/interface/MakerMacros.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include "CondFormats/GeometryObjects/interface/HcalParameters.h"
0006 #include "CondFormats/GeometryObjects/interface/HcalSimulationParameters.h"
0007 #include "Geometry/Records/interface/HcalParametersRcd.h"
0008 #include <iostream>
0009 #include <sstream>
0010 
0011 class HcalSimParametersAnalyzer : public edm::one::EDAnalyzer<> {
0012 public:
0013   explicit HcalSimParametersAnalyzer(const edm::ParameterSet&);
0014 
0015   void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
0016 
0017 private:
0018   edm::ESGetToken<HcalSimulationParameters, HcalParametersRcd> simparToken_;
0019 };
0020 
0021 HcalSimParametersAnalyzer::HcalSimParametersAnalyzer(const edm::ParameterSet&) {
0022   simparToken_ = esConsumes<HcalSimulationParameters, HcalParametersRcd>(edm::ESInputTag{});
0023 }
0024 
0025 void HcalSimParametersAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup) {
0026   const auto& parS = iSetup.getData(simparToken_);
0027   const HcalSimulationParameters* parsim = &parS;
0028   if (parsim != nullptr) {
0029     std::ostringstream st1;
0030     st1 << "\nattenuationLength_: ";
0031     for (const auto& it : parsim->attenuationLength_)
0032       st1 << it << ", ";
0033     st1 << "\nlambdaLimits_: ";
0034     for (const auto& it : parsim->lambdaLimits_)
0035       st1 << it << ", ";
0036     st1 << "\nshortFiberLength_: ";
0037     for (const auto& it : parsim->shortFiberLength_)
0038       st1 << it << ", ";
0039     st1 << "\nlongFiberLength_: ";
0040     for (const auto& it : parsim->longFiberLength_)
0041       st1 << it << ", ";
0042     edm::LogVerbatim("HCalGeom") << st1.str();
0043 
0044     std::ostringstream st2;
0045     st2 << "\npmtRight_: ";
0046     for (const auto& it : parsim->pmtRight_)
0047       st2 << it << ", ";
0048     st2 << "\npmtFiberRight_: ";
0049     for (const auto& it : parsim->pmtFiberRight_)
0050       st2 << it << ", ";
0051     st2 << "\npmtLeft_: ";
0052     for (const auto& it : parsim->pmtLeft_)
0053       st2 << it << ", ";
0054     st2 << "\npmtFiberLeft_: ";
0055     for (const auto& it : parsim->pmtFiberLeft_)
0056       st2 << it << ", ";
0057     edm::LogVerbatim("HCalGeom") << st2.str();
0058 
0059     std::ostringstream st3;
0060     st3 << "\nhfLevels_: ";
0061     for (const auto& it : parsim->hfLevels_)
0062       st3 << it << ", ";
0063     st3 << "\nhfNames_: ";
0064     for (const auto& it : parsim->hfNames_)
0065       st3 << it << ", ";
0066     st3 << "\nhfFibreNames_: ";
0067     for (const auto& it : parsim->hfFibreNames_)
0068       st3 << it << ", ";
0069     st3 << "\nhfPMTNames_: ";
0070     for (const auto& it : parsim->hfPMTNames_)
0071       st3 << it << ", ";
0072     st3 << "\nhfFibreStraightNames_: ";
0073     for (const auto& it : parsim->hfFibreStraightNames_)
0074       st3 << it << ", ";
0075     st3 << "\nhfFibreConicalNames_: ";
0076     for (const auto& it : parsim->hfFibreConicalNames_)
0077       st3 << it << ", ";
0078     st3 << "\nhcalMaterialNames_: ";
0079     for (const auto& it : parsim->hcalMaterialNames_)
0080       st3 << it << ", ";
0081     edm::LogVerbatim("HCalGeom") << st3.str();
0082   }
0083 }
0084 
0085 DEFINE_FWK_MODULE(HcalSimParametersAnalyzer);