File indexing completed on 2024-04-06 12:15:08
0001 #include <iostream>
0002 #include <sstream>
0003
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "FWCore/Framework/interface/MakerMacros.h"
0007 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0009
0010 #include "CondFormats/GeometryObjects/interface/PHGCalParameters.h"
0011 #include "Geometry/Records/interface/PHGCalParametersRcd.h"
0012
0013 class HGCalParametersAnalyzer : public edm::one::EDAnalyzer<> {
0014 public:
0015 explicit HGCalParametersAnalyzer(const edm::ParameterSet&)
0016 : token_{esConsumes<PHGCalParameters, PHGCalParametersRcd>(edm::ESInputTag{})} {}
0017 ~HGCalParametersAnalyzer() override = default;
0018
0019 void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
0020
0021 private:
0022 const edm::ESGetToken<PHGCalParameters, PHGCalParametersRcd> token_;
0023 };
0024
0025 void HGCalParametersAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0026 edm::LogInfo("HGCalParametersAnalyzer") << "Here I am";
0027
0028 const auto& hgp = iSetup.getData(token_);
0029 const auto* phgp = &hgp;
0030
0031 edm::LogVerbatim("HGCalGeom") << "\nname " << phgp->name_;
0032 edm::LogVerbatim("HGCalGeom") << "nCells " << phgp->nCells_;
0033 edm::LogVerbatim("HGCalGeom") << "nSectors " << phgp->nSectors_;
0034 std::ostringstream st1;
0035 st1 << "cellsize ";
0036 for (auto it : phgp->cellSize_)
0037 st1 << it << ", ";
0038 edm::LogVerbatim("HGCalGeom") << st1.str();
0039
0040 std::ostringstream st2;
0041 st2 << "moduleLayS ";
0042 for (auto it : phgp->moduleLayS_)
0043 st2 << it << ", ";
0044 edm::LogVerbatim("HGCalGeom") << st2.str();
0045
0046 std::ostringstream st3;
0047 st3 << "ModuleBlS ";
0048 for (auto it : phgp->moduleBlS_)
0049 st3 << it << ", ";
0050 edm::LogVerbatim("HGCalGeom") << st3.str();
0051
0052 std::ostringstream st4;
0053 st4 << "ModuleTlS ";
0054 for (auto it : phgp->moduleTlS_)
0055 st4 << it << ", ";
0056 edm::LogVerbatim("HGCalGeom") << st4.str();
0057
0058 std::ostringstream st5;
0059 st5 << "moduleHS ";
0060 for (auto it : phgp->moduleHS_)
0061 st5 << it << ", ";
0062 edm::LogVerbatim("HGCalGeom") << st5.str();
0063
0064 std::ostringstream st6;
0065 st6 << "moduleDzS ";
0066 for (auto it : phgp->moduleDzS_)
0067 st6 << it << ", ";
0068 edm::LogVerbatim("HGCalGeom") << st6.str();
0069
0070 std::ostringstream st7;
0071 st7 << "moduleAlphaS ";
0072 for (auto it : phgp->moduleAlphaS_)
0073 st7 << it << ", ";
0074 edm::LogVerbatim("HGCalGeom") << st7.str();
0075
0076 std::ostringstream st8;
0077 st8 << "moduleCellS ";
0078 for (auto it : phgp->moduleCellS_)
0079 st8 << it << ", ";
0080 edm::LogVerbatim("HGCalGeom") << st8.str();
0081
0082 std::ostringstream st9;
0083 st9 << "moduleLayR ";
0084 for (auto it : phgp->moduleLayR_)
0085 st9 << it << ", ";
0086 edm::LogVerbatim("HGCalGeom") << st9.str();
0087
0088 std::ostringstream st10;
0089 st10 << "moduleBlR ";
0090 for (auto it : phgp->moduleBlR_)
0091 st10 << it << ", ";
0092 edm::LogVerbatim("HGCalGeom") << st10.str();
0093
0094 std::ostringstream st11;
0095 st11 << "moduleTlR ";
0096 for (auto it : phgp->moduleTlR_)
0097 st11 << it << ", ";
0098 edm::LogVerbatim("HGCalGeom") << st11.str();
0099
0100 std::ostringstream st12;
0101 st12 << "moduleHR ";
0102 for (auto it : phgp->moduleHR_)
0103 st12 << it << ", ";
0104 edm::LogVerbatim("HGCalGeom") << st12.str();
0105
0106 std::ostringstream st13;
0107 st13 << "moduleDzR ";
0108 for (auto it : phgp->moduleDzR_)
0109 st13 << it << ", ";
0110 edm::LogVerbatim("HGCalGeom") << st13.str();
0111
0112 std::ostringstream st14;
0113 st14 << "moduleAlphaR ";
0114 for (auto it : phgp->moduleAlphaR_)
0115 st14 << it << ", ";
0116 edm::LogVerbatim("HGCalGeom") << st14.str();
0117
0118 std::ostringstream st15;
0119 st15 << "moduleCellR ";
0120 for (auto it : phgp->moduleCellR_)
0121 st15 << it << ", ";
0122 edm::LogVerbatim("HGCalGeom") << st15.str();
0123
0124 std::ostringstream st16;
0125 st16 << "trformIndex ";
0126 for (auto it : phgp->trformIndex_)
0127 st16 << it << ", ";
0128 edm::LogVerbatim("HGCalGeom") << st16.str();
0129
0130 std::ostringstream st17;
0131 st17 << "trformTranX ";
0132 for (auto it : phgp->trformTranX_)
0133 st17 << it << ", ";
0134 edm::LogVerbatim("HGCalGeom") << st17.str();
0135
0136 std::ostringstream st18;
0137 st18 << "trformTranY ";
0138 for (auto it : phgp->trformTranY_)
0139 st18 << it << ", ";
0140 edm::LogVerbatim("HGCalGeom") << st18.str();
0141
0142 std::ostringstream st19;
0143 st19 << "trformTranZ ";
0144 for (auto it : phgp->trformTranZ_)
0145 st19 << it << ", ";
0146 edm::LogVerbatim("HGCalGeom") << st19.str();
0147
0148 std::ostringstream st20;
0149 st20 << "trformRotXX ";
0150 for (auto it : phgp->trformRotXX_)
0151 st20 << it << ", ";
0152 edm::LogVerbatim("HGCalGeom") << st20.str();
0153
0154 std::ostringstream st21;
0155 st21 << "trformRotYX ";
0156 for (auto it : phgp->trformRotYX_)
0157 st21 << it << ", ";
0158 edm::LogVerbatim("HGCalGeom") << st21.str();
0159
0160 std::ostringstream st22;
0161 st22 << "trformRotZX ";
0162 for (auto it : phgp->trformRotZX_)
0163 st22 << it << ", ";
0164 edm::LogVerbatim("HGCalGeom") << st22.str();
0165
0166 std::ostringstream st23;
0167 st23 << "trformRotXY ";
0168 for (auto it : phgp->trformRotXY_)
0169 st23 << it << ", ";
0170 edm::LogVerbatim("HGCalGeom") << st23.str();
0171
0172 std::ostringstream st24;
0173 st24 << "trformRotYY ";
0174 for (auto it : phgp->trformRotYY_)
0175 st24 << it << ", ";
0176 edm::LogVerbatim("HGCalGeom") << st24.str();
0177
0178 std::ostringstream st25;
0179 st25 << "trformRotZY ";
0180 for (auto it : phgp->trformRotZY_)
0181 st25 << it << ", ";
0182 edm::LogVerbatim("HGCalGeom") << st25.str();
0183
0184 std::ostringstream st26;
0185 st26 << "trformRotXZ ";
0186 for (auto it : phgp->trformRotXZ_)
0187 st26 << it << ", ";
0188 edm::LogVerbatim("HGCalGeom") << st26.str();
0189
0190 std::ostringstream st27;
0191 st27 << "trformRotYZ ";
0192 for (auto it : phgp->trformRotYZ_)
0193 st27 << it << ", ";
0194 edm::LogVerbatim("HGCalGeom") << st27.str();
0195
0196 std::ostringstream st28;
0197 st28 << "trformRotZZ ";
0198 for (auto it : phgp->trformRotZZ_)
0199 st28 << it << ", ";
0200 edm::LogVerbatim("HGCalGeom") << st28.str();
0201
0202 std::ostringstream st29;
0203 st29 << "layer ";
0204 for (auto it : phgp->layer_)
0205 st29 << it << ", ";
0206 edm::LogVerbatim("HGCalGeom") << st29.str();
0207
0208 std::ostringstream st30;
0209 st3 << "layerIndex ";
0210 for (auto it : phgp->layerIndex_)
0211 st30 << it << ", ";
0212 edm::LogVerbatim("HGCalGeom") << st30.str();
0213
0214 std::ostringstream st31;
0215 st31 << "layerGroup ";
0216 for (auto it : phgp->layerGroup_)
0217 st31 << it << ", ";
0218 edm::LogVerbatim("HGCalGeom") << st31.str();
0219
0220 std::ostringstream st32;
0221 st32 << "cellFactor ";
0222 for (auto it : phgp->cellFactor_)
0223 st32 << it << ", ";
0224 edm::LogVerbatim("HGCalGeom") << st32.str();
0225
0226 std::ostringstream st33;
0227 st33 << "depth ";
0228 for (auto it : phgp->depth_)
0229 st33 << it << ", ";
0230 edm::LogVerbatim("HGCalGeom") << st33.str();
0231
0232 std::ostringstream st34;
0233 st34 << "depthIndex ";
0234 for (auto it : phgp->depthIndex_)
0235 st34 << it << ", ";
0236 edm::LogVerbatim("HGCalGeom") << st34.str();
0237
0238 std::ostringstream st35;
0239 st35 << "depthLayerF ";
0240 for (auto it : phgp->depthLayerF_)
0241 st35 << it << ", ";
0242 edm::LogVerbatim("HGCalGeom") << st35.str();
0243
0244 std::ostringstream st36;
0245 st36 << "zLayerHex ";
0246 for (auto it : phgp->zLayerHex_)
0247 st36 << it << ", ";
0248 edm::LogVerbatim("HGCalGeom") << st36.str();
0249
0250 std::ostringstream st37;
0251 st37 << "MinLayHex ";
0252 for (auto it : phgp->rMinLayHex_)
0253 st37 << it << ", ";
0254 edm::LogVerbatim("HGCalGeom") << st37.str();
0255
0256 std::ostringstream st38;
0257 st38 << "rMaxLayHex ";
0258 for (auto it : phgp->rMaxLayHex_)
0259 st38 << it << ", ";
0260 edm::LogVerbatim("HGCalGeom") << st38.str();
0261
0262 std::ostringstream st39;
0263 st39 << "waferCopy ";
0264 for (auto it : phgp->waferCopy_)
0265 st39 << it << ", ";
0266 edm::LogVerbatim("HGCalGeom") << st39.str();
0267
0268 std::ostringstream st40;
0269 st40 << "waferTypeL ";
0270 for (auto it : phgp->waferTypeL_)
0271 st40 << it << ", ";
0272 edm::LogVerbatim("HGCalGeom") << st40.str();
0273
0274 std::ostringstream st41;
0275 st41 << "waferTypeT ";
0276 for (auto it : phgp->waferTypeT_)
0277 st41 << it << ", ";
0278 edm::LogVerbatim("HGCalGeom") << st41.str();
0279
0280 std::ostringstream st42;
0281 st42 << "waferPos ";
0282 for (unsigned int k = 0; k < phgp->waferPosX_.size(); ++k)
0283 st42 << "(" << phgp->waferPosX_[k] << ", " << phgp->waferPosY_[k] << ") ";
0284 edm::LogVerbatim("HGCalGeom") << st42.str();
0285
0286 std::ostringstream st43;
0287 st43 << "cellFinePos ";
0288 for (unsigned int k = 0; k < phgp->cellFineX_.size(); ++k)
0289 st43 << "(" << phgp->cellFineX_[k] << ", " << phgp->cellFineY_[k] << ") ";
0290 edm::LogVerbatim("HGCalGeom") << st43.str();
0291
0292 std::ostringstream st44;
0293 st44 << "cellCoarsePos ";
0294 for (unsigned int k = 0; k < phgp->cellCoarseX_.size(); ++k)
0295 st44 << "(" << phgp->cellCoarseX_[k] << ", " << phgp->cellCoarseY_[k] << ") ";
0296 edm::LogVerbatim("HGCalGeom") << st44.str();
0297
0298 std::ostringstream st45;
0299 st45 << "layerGroupM ";
0300 for (auto it : phgp->layerGroupM_)
0301 st45 << it << ", ";
0302 edm::LogVerbatim("HGCalGeom") << st45.str();
0303
0304 std::ostringstream st46;
0305 st46 << "layerGroupO ";
0306 for (auto it : phgp->layerGroupO_)
0307 st46 << it << ", ";
0308 edm::LogVerbatim("HGCalGeom") << st46.str();
0309
0310 std::ostringstream st47;
0311 st47 << "boundR ";
0312 for (auto it : phgp->boundR_)
0313 st47 << it << ", ";
0314 edm::LogVerbatim("HGCalGeom") << st47.str();
0315
0316 edm::LogVerbatim("HGCalGeom") << "waferR " << phgp->waferR_;
0317 edm::LogVerbatim("HGCalGeom") << "mode " << phgp->mode_;
0318
0319 std::ostringstream st48;
0320 st48 << "slopeMin ";
0321 for (auto it : phgp->slopeMin_)
0322 st48 << it << ", ";
0323 edm::LogVerbatim("HGCalGeom") << st48.str();
0324 }
0325
0326 DEFINE_FWK_MODULE(HGCalParametersAnalyzer);