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 <sstream>
0009 #include <iostream>
0010 
0011 class HcalParametersAnalyzer : public edm::one::EDAnalyzer<> {
0012 public:
0013   explicit HcalParametersAnalyzer(const edm::ParameterSet&);
0014   ~HcalParametersAnalyzer(void) override;
0015 
0016   void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
0017 
0018 private:
0019   edm::ESGetToken<HcalParameters, HcalParametersRcd> parToken_;
0020   edm::ESGetToken<HcalSimulationParameters, HcalParametersRcd> simparToken_;
0021 };
0022 
0023 HcalParametersAnalyzer::HcalParametersAnalyzer(const edm::ParameterSet&) {
0024   parToken_ = esConsumes<HcalParameters, HcalParametersRcd>(edm::ESInputTag{});
0025   simparToken_ = esConsumes<HcalSimulationParameters, HcalParametersRcd>(edm::ESInputTag{});
0026 }
0027 
0028 HcalParametersAnalyzer::~HcalParametersAnalyzer(void) {}
0029 
0030 void HcalParametersAnalyzer::analyze(const edm::Event& /*iEvent*/, const edm::EventSetup& iSetup) {
0031   const auto& parR = iSetup.getData(parToken_);
0032   const HcalParameters* pars = &parR;
0033 
0034   std::ostringstream st1;
0035   st1 << "rHB: ";
0036   for (const auto& it : pars->rHB)
0037     st1 << it << ", ";
0038   st1 << "\ndrHB: ";
0039   for (const auto& it : pars->drHB)
0040     st1 << it << ", ";
0041   st1 << "\nzHE: ";
0042   for (const auto& it : pars->zHE)
0043     st1 << it << ", ";
0044   st1 << "\ndzHE: ";
0045   for (const auto& it : pars->dzHE)
0046     st1 << it << ", ";
0047   st1 << "\nzHO: ";
0048   for (const auto& it : pars->zHO)
0049     st1 << it << ", ";
0050   st1 << "\nrHO: ";
0051   for (const auto& it : pars->rHO)
0052     st1 << it << ", ";
0053   st1 << "\nrhoxHB: ";
0054   for (const auto& it : pars->rhoxHB)
0055     st1 << it << ", ";
0056   st1 << "\nzxHB: ";
0057   for (const auto& it : pars->zxHB)
0058     st1 << it << ", ";
0059   st1 << "\ndyHB: ";
0060   for (const auto& it : pars->dyHB)
0061     st1 << it << ", ";
0062   st1 << "\ndxHB: ";
0063   for (const auto& it : pars->dxHB)
0064     st1 << it << ", ";
0065   st1 << "\nrhoxHE: ";
0066   for (const auto& it : pars->rhoxHE)
0067     st1 << it << ", ";
0068   st1 << "\nzxHE: ";
0069   for (const auto& it : pars->zxHE)
0070     st1 << it << ", ";
0071   st1 << "\ndyHE: ";
0072   for (const auto& it : pars->dyHE)
0073     st1 << it << ", ";
0074   st1 << "\ndx1HE: ";
0075   for (const auto& it : pars->dx1HE)
0076     st1 << it << ", ";
0077   st1 << "\ndx2HE: ";
0078   for (const auto& it : pars->dx2HE)
0079     st1 << it << ", ";
0080   st1 << "\nphioff: ";
0081   for (const auto& it : pars->phioff)
0082     st1 << it << ", ";
0083   st1 << "\netaTable: ";
0084   for (const auto& it : pars->etaTable)
0085     st1 << it << ", ";
0086   st1 << "\nrTable: ";
0087   for (const auto& it : pars->rTable)
0088     st1 << it << ", ";
0089   st1 << "\nphibin: ";
0090   for (const auto& it : pars->phibin)
0091     st1 << it << ", ";
0092   st1 << "\nphitable: ";
0093   for (const auto& it : pars->phitable)
0094     st1 << it << ", ";
0095   st1 << "\netaRange: ";
0096   for (const auto& it : pars->etaRange)
0097     st1 << it << ", ";
0098   st1 << "\ngparHF: ";
0099   for (const auto& it : pars->gparHF)
0100     st1 << it << ", ";
0101   st1 << "\nLayer0Wt: ";
0102   for (const auto& it : pars->Layer0Wt)
0103     st1 << it << ", ";
0104   st1 << "\nHBGains: ";
0105   for (const auto& it : pars->HBGains)
0106     st1 << it << ", ";
0107   st1 << "\nHEGains: ";
0108   for (const auto& it : pars->HEGains)
0109     st1 << it << ", ";
0110   st1 << "\nHFGains: ";
0111   for (const auto& it : pars->HFGains)
0112     st1 << it << ", ";
0113   st1 << "\netaTableHF: ";
0114   for (const auto& it : pars->etaTableHF)
0115     st1 << it << ", ";
0116   st1 << "\nmodHB: ";
0117   for (const auto& it : pars->modHB)
0118     st1 << it << ", ";
0119   st1 << "\nmodHE: ";
0120   for (const auto& it : pars->modHE)
0121     st1 << it << ", ";
0122   st1 << "\nmaxDepth: ";
0123   for (const auto& it : pars->maxDepth)
0124     st1 << it << ", ";
0125   st1 << "\nlayHB: ";
0126   for (const auto& it : pars->layHB)
0127     st1 << it << ", ";
0128   st1 << "\nlayHE: ";
0129   for (const auto& it : pars->layHE)
0130     st1 << it << ", ";
0131   st1 << "\netaMin: ";
0132   for (const auto& it : pars->etaMin)
0133     st1 << it << ", ";
0134   st1 << "\netaMax: ";
0135   for (const auto& it : pars->etaMax)
0136     st1 << it << ", ";
0137   st1 << "\nnoff: ";
0138   for (const auto& it : pars->noff)
0139     st1 << it << ", ";
0140   st1 << "\nHBShift: ";
0141   for (const auto& it : pars->HBShift)
0142     st1 << it << ", ";
0143   st1 << "\nHEShift: ";
0144   for (const auto& it : pars->HEShift)
0145     st1 << it << ", ";
0146   st1 << "\nHFShift: ";
0147   for (const auto& it : pars->HFShift)
0148     st1 << it << ", ";
0149   edm::LogVerbatim("HCalGeom") << st1.str();
0150 
0151   std::ostringstream st2;
0152   for (const auto& it : pars->layerGroupEtaSim) {
0153     st2 << "layerGroupEtaSim" << it.layer << ": ";
0154     for (const auto& iit : it.layerGroup) {
0155       st2 << iit << ", ";
0156     }
0157   }
0158   st2 << "\netagroup: ";
0159   for (const auto& it : pars->etagroup)
0160     st2 << it << ", ";
0161   st2 << "\nphigroup: ";
0162   for (const auto& it : pars->phigroup)
0163     st2 << it << ", ";
0164   for (const auto& it : pars->layerGroupEtaRec) {
0165     st2 << "\nlayerGroupEtaRec" << it.layer << ": ";
0166     for (const auto& iit : it.layerGroup) {
0167       st2 << iit << ", ";
0168     }
0169   }
0170   st2 << "\ndzVcal: " << pars->dzVcal << "\n(Topology|Trigger)Mode: " << std::hex << pars->topologyMode << std::dec;
0171   edm::LogVerbatim("HCalGeom") << st2.str();
0172 
0173   const auto& parS = iSetup.getData(simparToken_);
0174   const HcalSimulationParameters* parsim = &parS;
0175   if (parsim != nullptr) {
0176     std::ostringstream st3;
0177     st3 << "\nattenuationLength_: ";
0178     for (const auto& it : parsim->attenuationLength_)
0179       st3 << it << ", ";
0180     st3 << "\nlambdaLimits_: ";
0181     for (const auto& it : parsim->lambdaLimits_)
0182       st3 << it << ", ";
0183     st3 << "\nshortFiberLength_: ";
0184     for (const auto& it : parsim->shortFiberLength_)
0185       st3 << it << ", ";
0186     st3 << "\nlongFiberLength_: ";
0187     for (const auto& it : parsim->longFiberLength_)
0188       st3 << it << ", ";
0189     edm::LogVerbatim("HCalGeom") << st3.str();
0190 
0191     std::ostringstream st4;
0192     st4 << "\npmtRight_: ";
0193     for (const auto& it : parsim->pmtRight_)
0194       st4 << it << ", ";
0195     st4 << "\npmtFiberRight_: ";
0196     for (const auto& it : parsim->pmtFiberRight_)
0197       st4 << it << ", ";
0198     st4 << "\npmtLeft_: ";
0199     for (const auto& it : parsim->pmtLeft_)
0200       st4 << it << ", ";
0201     st4 << "\npmtFiberLeft_: ";
0202     for (const auto& it : parsim->pmtFiberLeft_)
0203       st4 << it << ", ";
0204     edm::LogVerbatim("HCalGeom") << st4.str();
0205 
0206     std::ostringstream st5;
0207     st5 << "\nhfLevels_: ";
0208     for (const auto& it : parsim->hfLevels_)
0209       st5 << it << ", ";
0210     st5 << "\nhfNames_: ";
0211     for (const auto& it : parsim->hfNames_)
0212       st5 << it << ", ";
0213     st5 << "\nhfFibreNames_: ";
0214     for (const auto& it : parsim->hfFibreNames_)
0215       st5 << it << ", ";
0216     st5 << "\nhfPMTNames_: ";
0217     for (const auto& it : parsim->hfPMTNames_)
0218       st5 << it << ", ";
0219     st5 << "\nhfFibreStraightNames_: ";
0220     for (const auto& it : parsim->hfFibreStraightNames_)
0221       st5 << it << ", ";
0222     st5 << "\nhfFibreConicalNames_: ";
0223     for (const auto& it : parsim->hfFibreConicalNames_)
0224       st5 << it << ", ";
0225     st5 << "\nhcalMaterialNames_: ";
0226     for (const auto& it : parsim->hcalMaterialNames_)
0227       st5 << it << ", ";
0228     edm::LogVerbatim("HCalGeom") << st5.str();
0229   }
0230 }
0231 
0232 DEFINE_FWK_MODULE(HcalParametersAnalyzer);