diff --git a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc index 5121d3a585f69..1bb50e0a30c9a 100644 --- a/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDRecConstants.cc @@ -15,14 +15,14 @@ HcalDDDRecConstants::HcalDDDRecConstants(const HcalParameters* hp, hpar(hp), hcons(hc) { #ifdef EDM_ML_DEBUG - std::cout << "HcalDDDRecConstants::HcalDDDRecConstants (const HcalParameters* hp) constructor" << std::endl; + edm::LogVerbatim("HcalGeom") << "HcalDDDRecConstants::HcalDDDRecConstants (const HcalParameters* hp) constructor"; #endif initialize(); } HcalDDDRecConstants::~HcalDDDRecConstants() { #ifdef EDM_ML_DEBUG - std::cout << "HcalDDDRecConstants::destructed!!!" << std::endl; + edm::LogVerbatim("HcalGeom") << "HcalDDDRecConstants::destructed!!!"; #endif } @@ -111,21 +111,23 @@ HcalDDDRecConstants::getEtaBins(const int& itype) const { } } #ifdef EDM_ML_DEBUG - std::cout << "Prepares " << bins.size() << " eta bins for type " << type - << std::endl; + edm::LogVerbatim("HcalGeom") << "Prepares " << bins.size() + << " eta bins for type " << type; for (unsigned int i=0; i M_PI) phi -= (2*M_PI); #ifdef EDM_ML_DEBUG - std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta << "|" - << iphi << " eta|phi " << eta << "|" << phi << std::endl; + edm::LogVerbatim("HcalGeom") << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" + << ieta << "|" << iphi << " eta|phi " << eta + << "|" << phi; #endif return std::pair(eta,phi); } @@ -206,9 +209,9 @@ HcalDDDRecConstants::getHCID(int subdet, int keta, int iphi, int lay, } } #ifdef EDM_ML_DEBUG - std::cout << "getHCID: input " << subdet << ":" << ieta << ":" << iphi - << ":" << idepth << ":" << lay << " output " << eta << ":" << phi - << ":" << depth << std::endl; + edm::LogVerbatim("HcalGeom") << "getHCID: input " << subdet << ":" << ieta + << ":" << iphi << ":" << idepth << ":" << lay + << " output " << eta << ":" << phi << ":" <& laye layers[lay] = layerGroup(ieta-1,l); } #ifdef EDM_ML_DEBUG - std::cout << "getLayerDepth::Input " << ieta << " Output " - << layers.size() << " entries" << std::endl; + edm::LogVerbatim("HcalGeom") << "getLayerDepth::Input " << ieta << " Output " + << layers.size() << " entries"; for (std::map::iterator itr=layers.begin(); itr != layers.end(); - ++itr) std::cout << " [" << itr->first << "] " << itr->second; - std::cout << std::endl; + ++itr) + edm::LogVerbatim("HcalGeom") << " [" << itr->first << "] " << itr->second; #endif } @@ -304,8 +308,9 @@ int HcalDDDRecConstants::getLayerBack(const int& idet, const int& ieta, } if (layBack < 0 || layBack > laymax) layBack = laymax; #ifdef EDM_ML_DEBUG - std::cout << "getLayerBack::Input " << idet << ":" << ieta << ":" - << iphi << ":" << depth << " Output " << layBack << std::endl; + edm::LogVerbatim("HcalGeom") << "getLayerBack::Input " << idet << ":" << ieta + << ":" << iphi << ":" << depth << " Output " + << layBack; #endif return layBack; } @@ -335,8 +340,9 @@ int HcalDDDRecConstants::getLayerFront(const int& idet, const int& ieta, if (layFront < laymin) layFront = laymin; } #ifdef EDM_ML_DEBUG - std::cout << "getLayerFront::Input " << idet << ":" << ieta << ":" - << iphi << ":" << depth << " Output " << layFront << std::endl; + edm::LogVerbatim("HcalGeom") << "getLayerFront::Input " << idet << ":" << ieta + << ":" << iphi << ":" << depth << " Output " + << layFront; #endif return layFront; } @@ -357,8 +363,9 @@ int HcalDDDRecConstants::getMaxDepth (const int& itype, const int& ieta, } } #ifdef EDM_ML_DEBUG - std::cout << "getMaxDepth::Input " << itype << ":" << ieta << ":" - << iphi << ":" << zside << " Output " << lmax << std::endl; + edm::LogVerbatim("HcalGeom") << "getMaxDepth::Input " << itype << ":" << ieta + << ":" << iphi << ":" << zside << " Output " + << lmax; #endif return lmax; } @@ -402,11 +409,11 @@ HcalDDDRecConstants::getPhis(const int& subdet, const int& ieta) const { phis.emplace_back(std::pair(iphi,phi)); } #ifdef EDM_ML_DEBUG - std::cout << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" << ieta - << " with " << phis.size() << " phi bins" << std::endl; + edm::LogVerbatim("HcalGeom") << "getEtaPhi: subdet|ieta|iphi " << subdet << "|" + << ieta << " with " << phis.size() << " phi bins"; for (unsigned int k=0; k>& phiz) const } } #ifdef EDM_ML_DEBUG - std::cout << "Special RBX for detector " << subdet << " with " << phiz.size() - << " phi/z bins"; + edm::LogVerbatim("HcalGeom") << "Special RBX for detector " << subdet + << " with " << phiz.size() << " phi/z bins"; for (unsigned int k=0; k(HcalBarrel)) ? (gconsHB[layf].first) : (gconsHE[layf].first)); #ifdef EDM_ML_DEBUG - std::cout << "getRZ: subdet|ieta|ipho|depth " << subdet << "|" << ieta << "|" - << iphi << "|" << depth << " lay|rz " << layf << "|" << rz - << std::endl; + edm::LogVerbatim("HcalGeom") << "getRZ: subdet|ieta|ipho|depth " << subdet + << "|" << ieta << "|" << iphi << "|" << depth + << " lay|rz " << layf << "|" << rz; #endif return rz; } @@ -460,8 +467,8 @@ double HcalDDDRecConstants::getRZ(const int& subdet, const int& layer) const { rz = ((subdet == static_cast(HcalBarrel)) ? (gconsHB[layer-1].first) : (gconsHE[layer-1].first)); #ifdef EDM_ML_DEBUG - std::cout << "getRZ: subdet|layer " << subdet << "|" << layer << " rz " - << rz << std::endl; + edm::LogVerbatim("HcalGeom") << "getRZ: subdet|layer " << subdet << "|" + << layer << " rz " << rz; #endif return rz; } @@ -483,9 +490,10 @@ std::pair HcalDDDRecConstants::getRZ(const HcalDetId& id) const{ zside*(gconsHB[layb].first+gconsHB[layb].second) : zside*(gconsHE[layb].first+gconsHE[layb].second)); #ifdef EDM_ML_DEBUG - std::cout << "getRZ: subdet|ieta|ipho|depth " << subdet << "|" << ieta << "|" - << iphi << "|" << depth << " lay|rz (front) " << layf << "|" << rzf - << " lay|rz (back) " << layb << "|" << rzb << std::endl; + edm::LogVerbatim("HcalGeom") << "getRZ: subdet|ieta|ipho|depth " << subdet + << "|" << ieta << "|" << iphi << "|" << depth + << " lay|rz (front) " << layf << "|" << rzf + << " lay|rz (back) " << layb << "|" << rzb; #endif return std::pair(rzf,rzb); } @@ -509,12 +517,14 @@ HcalDDDRecConstants::getThickActive(const int& type) const { double scale = 1.0/((type == 0) ? sin(theta) : cos(theta)); int depth = bin.depthStart; #ifdef EDM_ML_DEBUG - std::cout << "Eta " << ieta << " zside " << zside << " depth " << depth - << " Layers " << layf << ":" << layl << ":" << bin.layer.size(); - for (auto ll : bin.layer) std::cout << " " << ll.first << ":" << ll.second; - std::cout << " phi "; - for (auto phi : bin.phis) std::cout << " " << phi.first; - std::cout << std::endl; + edm::LogVerbatim("HcalGeom") << "Eta " << ieta << " zside " << zside + << " depth " << depth << " Layers " << layf + << ":" << layl << ":" << bin.layer.size(); + for (auto ll : bin.layer) + edm::LogVerbatim("HcalGeom") << "Layer " << ll.first << ":" << ll.second; + for (auto phi : bin.phis) + edm::LogVerbatim("HcalGeom") << "Phi " << phi.first << ":" + << phi.second/CLHEP::deg; #endif for (unsigned int i = 0; i < bin.layer.size(); ++i) { double thick(0); @@ -527,8 +537,8 @@ HcalDDDRecConstants::getThickActive(const int& type) const { if (t > 0) thick += t; } #ifdef EDM_ML_DEBUG - std::cout << "Type " << type << " L " << lmin << ":" << lmax << " T " - << thick << std::endl; + edm::LogVerbatim("HcalGeom") << "Type " << type << " L " << lmin << ":" + << lmax << " T " << thick; #endif thick *= (2.*scale); HcalDDDRecConstants::HcalActiveLength active(ieta,depth,zside,stype,zside*eta,thick); @@ -538,10 +548,11 @@ HcalDDDRecConstants::getThickActive(const int& type) const { ++depth; #ifdef EDM_ML_DEBUG kount++; - std::cout << "getThickActive: [" << kount << "] eta:" << active.ieta - << ":" << active.eta << " zside " << active.zside << " depth " - << active.depth << " type " << active.stype << " thick " - << active.thick << std::endl; + edm::LogVerbatim("HcalGeom") << "getThickActive: [" << kount << "] eta:" + << active.ieta << ":" << active.eta + << " zside " << active.zside << " depth " + << active.depth << " type " << active.stype + << " thick " << active.thick; #endif } } @@ -603,10 +614,10 @@ HcalDDDRecConstants::HcalCellTypes(HcalSubdetector subdet) const { } } #ifdef EDM_ML_DEBUG - std::cout << "HcalDDDRecConstants: found " << cells.size() - << " cells for sub-detector type " << isub << std::endl; + edm::LogVerbatim("HcalGeom") << "HcalDDDRecConstants: found " << cells.size() + << " cells for sub-detector type " << isub; for (unsigned int ic=0; ic lymax) ? lymax : layers.size(); #ifdef EDM_ML_DEBUG - std::cout << "Eta " << ieta << ":" << hpar->noff[1] << " zside " << zside - << " lymax " << lymx0 << ":" << lymax << " Depth " << dep << ":" - << itr->second; + edm::LogVerbatim("HcalGeom") << "Eta " << ieta << ":" << hpar->noff[1] + << " zside " << zside << " lymax " << lymx0 + << ":" << lymax << " Depth " << dep << ":" + << itr->second; unsigned int l(0); for (itr = layers.begin(); itr != layers.end(); ++itr,++l) - std::cout << " [" << l << "] " << itr->first << ":" << itr->second; - std::cout << std::endl << " with " << phis.size() << " phis"; + edm::LogVerbatim("HcalGeom") << "Layer [" << l << "] " << itr->first + << ":" << itr->second; + edm::LogVerbatim("HcalGeom") << "With " << phis.size() << " phis"; for (unsigned int l=0; lfirst <= (int)(lymx0)) { @@ -786,13 +799,14 @@ void HcalDDDRecConstants::getOneEtaBin(HcalSubdetector subdet, int ieta, int zsi etabin0.phis.insert(etabin0.phis.end(),phis.begin(),phis.end()); bins.emplace_back(etabin0); #ifdef EDM_ML_DEBUG - std::cout << "etabin0: dStatrt " << etabin0.depthStart << " layers " - << etabin0.layer.size() << ":" << lmin << ":" << lmax - << " phis " << phis.size() << std::endl; + edm::LogVerbatim("HcalGeom") << "etabin0: dStatrt " << etabin0.depthStart + << " layers " << etabin0.layer.size() << ":" + << lmin << ":" << lmax << " phis " + << phis.size(); for (unsigned int k=0; knoff[1]) { } else { @@ -804,13 +818,13 @@ void HcalDDDRecConstants::getOneEtaBin(HcalSubdetector subdet, int ieta, int zsi etabin.depthStart = dstart; bins.emplace_back(etabin); #ifdef EDM_ML_DEBUG - std::cout << "etabin: dStatrt " << etabin.depthStart << " layers " - << etabin.layer.size() << ":" << lmin << ":" << lmax - << " phis " << etabin.phis.size() << std::endl; + edm::LogVerbatim("HcalGeom") << "etabin: dStatrt " << etabin.depthStart + << " layers " << etabin.layer.size() << ":" + << lmin << ":" << lmax << " phis " + << etabin.phis.size(); for (unsigned int k=0; k nPhiBins[2]) nPhiBins[2] = nphi; } #ifdef EDM_ML_DEBUG - std::cout << "Modified eta/deltaphi table for " << nEta << " bins" << std::endl; + edm::LogVerbatim("HcalGeom") << "Modified eta/deltaphi table for " << nEta + << " bins"; for (int i=0; ietaTableHF.size(); ++i) - std::cout << " [" << i << "] = " << hpar->etaTableHF[i]; - std::cout << std::endl; - std::cout << "PhiBinHF"; + edm::LogVerbatim("HcalGeom") << " [" << i << "] = " << hpar->etaTableHF[i]; + edm::LogVerbatim("HcalGeom") << "PhiBinHF"; for (unsigned int i=0; iphitable.size(); ++i) - std::cout << " [" << i << "] = " << hpar->phitable[i]; - std::cout << std::endl; + edm::LogVerbatim("HcalGeom") << " [" << i << "] = " << hpar->phitable[i]; #endif //Now the depths @@ -914,22 +927,23 @@ void HcalDDDRecConstants::initialize(void) { int laymax0 = (imx > 16) ? layerGroup(i,16) : laymax; if (i+1 == iEtaMax[0]) laymax0 = hcons.getDepthEta16M(1); #ifdef EDM_ML_DEBUG - std::cout << "HB " << i << " " << imx << " " << laymax << " " - << laymax0 << std::endl; + edm::LogVerbatim("HcalGeom") << "HB " << i << " " << imx << " " << laymax + << " " << laymax0; #endif if (maxDepth[0] < laymax0) maxDepth[0] = laymax0; } if (i >= iEtaMin[1]-1 && i < iEtaMax[1]) { #ifdef EDM_ML_DEBUG - std::cout << "HE " << i << " " << imx << " " << laymax << std::endl; + edm::LogVerbatim("HcalGeom") << "HE " << i << " " << imx << " " << laymax; #endif if (maxDepth[1] < laymax) maxDepth[1] = laymax; } } #ifdef EDM_ML_DEBUG for (int i=0; i<4; ++i) - std::cout << "Detector Type[" << i << "] iEta " << iEtaMin[i] << ":" - << iEtaMax[i] << " MaxDepth " << maxDepth[i] << std::endl; + edm::LogVerbatim("HcalGeom") << "Detector Type[" << i << "] iEta " + << iEtaMin[i] << ":" << iEtaMax[i] + << " MaxDepth " << maxDepth[i]; #endif //Now the geometry constants @@ -937,27 +951,29 @@ void HcalDDDRecConstants::initialize(void) { nHalves[0] = hpar->modHB[1]; for (unsigned int i=0; irHB.size(); ++i) { gconsHB.emplace_back(std::pair(hpar->rHB[i]/CLHEP::cm, - hpar->drHB[i]/CLHEP::cm)); + hpar->drHB[i]/CLHEP::cm)); } #ifdef EDM_ML_DEBUG - std::cout << "HB with " << nModule[0] << " modules and " << nHalves[0] - <<" halves and " << gconsHB.size() << " layers" << std::endl; + edm::LogVerbatim("HcalGeom") << "HB with " << nModule[0] << " modules and " + << nHalves[0] <<" halves and " << gconsHB.size() + << " layers"; for (unsigned int i=0; imodHE[0]; nHalves[1] = hpar->modHE[1]; for (unsigned int i=0; izHE.size(); ++i) { gconsHE.emplace_back(std::pair(hpar->zHE[i]/CLHEP::cm, - hpar->dzHE[i]/CLHEP::cm)); + hpar->dzHE[i]/CLHEP::cm)); } #ifdef EDM_ML_DEBUG - std::cout << "HE with " << nModule[1] << " modules and " << nHalves[1] - <<" halves and " << gconsHE.size() << " layers" << std::endl; + edm::LogVerbatim("HcalGeom") << "HE with " << nModule[1] << " modules and " + << nHalves[1] <<" halves and " << gconsHE.size() + << " layers"; for (unsigned int i=0; i maxDepth[1]) maxDepth[1] = depthMaxSp_.second; } #ifdef EDM_ML_DEBUG - std::cout << "Detector type and maximum depth for all RBX " - << depthMaxDf_.first << ":" << depthMaxDf_.second - << " and for special RBX " << depthMaxSp_.first << ":" - << depthMaxSp_.second << std::endl; + edm::LogVerbatim("HcalGeom") << "Detector type and maximum depth for all RBX " + << depthMaxDf_.first << ":" << depthMaxDf_.second + << " and for special RBX " << depthMaxSp_.first + << ":" << depthMaxSp_.second; #endif //Map of special DetId's @@ -1001,12 +1017,14 @@ void HcalDDDRecConstants::initialize(void) { } if (depth != 0) oldDep[depth] = std::pair(lmin,lymax-1); #ifdef EDM_ML_DEBUG - std::cout << "Eta|Phi|Zside " << eta << ":" << phi << ":" << zside - << " with " << oldDep.size() << " old Depths" << std::endl; + edm::LogVerbatim("HcalGeom") << "Eta|Phi|Zside " << eta << ":" << phi + << ":" << zside << " with " << oldDep.size() + << " old Depths"; unsigned int kk(0); for (std::map >::const_iterator itr=oldDep.begin(); itr != oldDep.end(); ++itr,++kk) - std::cout << "[" << kk << "] " << itr->first << " --> " - << itr->second.first << ":" << itr->second.second << "\n"; + edm::LogVerbatim("HcalGeom") << "[" << kk << "] " << itr->first <<" --> " + << itr->second.first << ":" + << itr->second.second; #endif std::pair depths = hcons.ldMap()->getDepths(eta); for (int ndepth=depths.first; ndepth<=depths.second; ++ndepth) { @@ -1037,8 +1055,8 @@ void HcalDDDRecConstants::initialize(void) { } } #ifdef EDM_ML_DEBUG - std::cout << "New Depth " << ndepth << " old Depth " << odepth - << " max " << maxlay << std::endl; + edm::LogVerbatim("HcalGeom") << "New Depth " << ndepth << " old Depth " + << odepth << " max " << maxlay; #endif for (int k : phis) { zside = (k > 0) ? 1 : -1; @@ -1058,22 +1076,22 @@ void HcalDDDRecConstants::initialize(void) { } } #ifdef EDM_ML_DEBUG - std::cout << "Map for merging new channels to old channel IDs with " - << detIdSp_.size() << " entries" << std::endl; + edm::LogVerbatim("HcalGeom") << "Map for merging new channels to old channel" + << " IDs with " << detIdSp_.size() <<" entries"; int l(0); for (auto itr : detIdSp_) { - std::cout << "[" << l << "] Special " << itr.first << " Standard " - << itr.second << std::endl; + edm::LogVerbatim("HcalGeom") << "[" << l << "] Special " << itr.first + << " Standard " << itr.second; ++l; } - std::cout << "Reverse Map for mapping old to new IDs with " - << detIdSpR_.size() << " entries" << std::endl; + edm::LogVerbatim("HcalGeom") <<"Reverse Map for mapping old to new IDs with " + << detIdSpR_.size() << " entries"; l = 0; for (auto itr : detIdSpR_) { - std::cout << "[" << l << "] Standard " << itr.first << " Special"; + edm::LogVerbatim("HcalGeom") << "[" << l << "] Standard " << itr.first + << " Special"; for (auto itr1 : itr.second) - std::cout << " " << (itr1); - std::cout << std::endl; + edm::LogVerbatim("HcalGeom") << "ID " << (itr1); ++l; } #endif diff --git a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc index 85a726acfca4e..90128a38ba75d 100644 --- a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc @@ -1111,7 +1111,8 @@ void HcalDDDSimConstants::printTileHB(const int& eta, const int& phi, << layL << ":" << layH-1; for (int lay=layL; lay area(2,0); - int kk=0; + int kk(0); + double mean(0); for (unsigned int k=0; klayHB.size(); ++k) { if (lay == hpar->layHB[k]) { double zmin = hpar->rhoxHB[k]*std::cos(thetaL)/std::sin(thetaL); @@ -1119,17 +1120,21 @@ void HcalDDDSimConstants::printTileHB(const int& eta, const int& phi, double dz = (std::min(zmax,hpar->dxHB[k]) - zmin); if (dz > 0) { area[kk] = dz*hpar->dyHB[k]; + mean += area[kk]; kk++; } } } - if (area[0] > 0) + if (area[0] > 0) { + mean /= (kk*100); edm::LogVerbatim("HcalGeom") << std::setw(2) << lay << " Area " << std::setw(8) << area[0] << " " - << std::setw(8) << area[1]; + << std::setw(8) << area[1] << " Mean " + << mean; + } } } - + void HcalDDDSimConstants::printTileHE(const int& eta, const int& phi, const int& zside, const int& depth) const { @@ -1148,7 +1153,8 @@ void HcalDDDSimConstants::printTileHE(const int& eta, const int& phi, << layL << ":" << layH-1 << " phi " << nphi; for (int lay=layL; lay area(4,0); - int kk=0; + int kk(0); + double mean(0); for (unsigned int k=0; klayHE.size(); ++k) { if (lay == hpar->layHE[k]) { double rmin = hpar->zxHE[k]*std::tan(thetaH); @@ -1165,9 +1171,11 @@ void HcalDDDSimConstants::printTileHE(const int& eta, const int& phi, double ar1=0, ar2=0; if (nphi == 1) { ar1 = 0.5*(rmax-rmin)*(dx1+dx2-4.*hpar->dx1HE[k]); + mean += ar1; } else { ar1 = 0.5*(rmax-rmin)*(dx1+dx2-2.*hpar->dx1HE[k]); ar2 = 0.5*(rmax-rmin)*((rmax+rmin)*tan(10.*CLHEP::deg)-4*hpar->dx1HE[k])-ar1; + mean += (ar1+ar2); } area[kk] = ar1; area[kk+2] = ar2; @@ -1179,15 +1187,19 @@ void HcalDDDSimConstants::printTileHE(const int& eta, const int& phi, int lay0 = lay-1; if (eta == 18) lay0++; if (nphi == 1) { + mean /= (kk*100); edm::LogVerbatim("HcalGeom") << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " - << std::setw(8) << area[1]; + << std::setw(8) << area[1] << " Mean " + << mean; } else { + mean /= (kk*200); edm::LogVerbatim("HcalGeom") << std::setw(2) << lay0 << " Area " << std::setw(8) << area[0] << " " << std::setw(8) << area[1] << ":" << std::setw(8) << area[2] << " " - << std::setw(8) << area[3]; + << std::setw(8) << area[3] << " Mean " + << mean; } } } diff --git a/Geometry/HcalCommonData/test/HcalRecNumberingTester.cc b/Geometry/HcalCommonData/test/HcalRecNumberingTester.cc index 73a2b60e179df..0c672305ec127 100644 --- a/Geometry/HcalCommonData/test/HcalRecNumberingTester.cc +++ b/Geometry/HcalCommonData/test/HcalRecNumberingTester.cc @@ -29,7 +29,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" - +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DetectorDescription/Core/interface/DDCompactView.h" #include "DetectorDescription/Core/interface/DDExpandedView.h" @@ -61,130 +61,142 @@ void HcalRecNumberingTester::analyze( const edm::Event& iEvent, const edm::Event iSetup.get().get(pHSNDC); if (pHSNDC.isValid()) { - std::cout << "about to de-reference the edm::ESHandle pHSNDC" << std::endl; + edm::LogVerbatim("HcalGeom") << "about to de-reference the edm::ESHandle pHSNDC"; const HcalDDDRecConstants hdc (*pHSNDC); - std::cout << "about to getPhiOff and getPhiBin for 0..2" << std::endl; + edm::LogVerbatim("HcalGeom") << "about to getPhiOff and getPhiBin for 0..2"; int neta = hdc.getNEta(); - std::cout << neta << " eta bins with phi off set for barrel = " - << hdc.getPhiOff(0) << ", endcap = " << hdc.getPhiOff(1) - << std::endl; + edm::LogVerbatim("HcalGeom") << neta << " eta bins with phi off set for " + << "barrel = " << hdc.getPhiOff(0) + << ", endcap = " << hdc.getPhiOff(1); for (int i=0; i etas = hdc.getEtaLimit(i); double fbin = hdc.getPhiBin(i); std::vector depths = hdc.getDepth(i,false); - std::cout << "EtaBin[" << i << "]: EtaLimit = (" << etas.first << ":" - << etas.second << ") phiBin = " << fbin << " depths = ("; + edm::LogVerbatim("HcalGeom") << "EtaBin[" << i << "]: EtaLimit = (" + << etas.first << ":" << etas.second + << ") phiBin = " << fbin << " and " + << depths.size() << " depths"; for (unsigned int k=0; k etar = hdc.getEtaRange(type); - std::cout << "Detector type: " << type << " with eta ranges " - << etar.first << ":" << etar.second << std::endl; + edm::LogVerbatim("HcalGeom") << "Detector type: " << type + << " with eta ranges " << etar.first << ":" + << etar.second; for (int eta=etar.first; eta<=etar.second; ++eta) { std::vector > phis = hdc.getPhis(type+1, eta); for (auto & phi : phis) { - std::cout << "Type:Eta:phi " << type << ":" << eta << ":" - << phi.first << " Depth range (+z) " - << hdc.getMinDepth(type,eta,phi.first,1) << ":" - << hdc.getMaxDepth(type,eta,phi.first,1) << " (-z) " - << hdc.getMinDepth(type,eta,phi.first,-1) << ":" - << hdc.getMaxDepth(type,eta,phi.first,-1) << std::endl; + edm::LogVerbatim("HcalGeom") << "Type:Eta:phi " << type << ":" << eta + << ":" << phi.first <<" Depth range (+z) " + << hdc.getMinDepth(type,eta,phi.first,1) +<< ":" + << hdc.getMaxDepth(type,eta,phi.first,1) << " (-z) " + << hdc.getMinDepth(type,eta,phi.first,-1) << ":" + << hdc.getMaxDepth(type,eta,phi.first,-1); } } } std::vector hbar = hdc.getEtaBins(0); std::vector hcap = hdc.getEtaBins(1); - std::cout << "Topology Mode " << hdc.getTopoMode() - << " HB with " << hbar.size() << " eta sectors and HE with " - << hcap.size() << " eta sectors" << std::endl; + edm::LogVerbatim("HcalGeom") << "Topology Mode " << hdc.getTopoMode() + << " HB with " << hbar.size() + << " eta sectors and HE with " + << hcap.size() << " eta sectors"; std::vector hbcell = hdc.HcalCellTypes(HcalBarrel); - std::cout << "HB with " << hbcell.size() << " cells" << std::endl; + edm::LogVerbatim("HcalGeom") << "HB with " << hbcell.size() << " cells"; unsigned int i1(0), i2(0), i3(0), i4(0); for (const auto& cell : hbcell) { - std::cout << "HB[" << i1 << "] det " << cell.detType() << " zside " - << cell.zside() << ":" << cell.halfSize() - << " RO " << cell.actualReadoutDirection() - << " eta " << cell.etaBin() << ":" << cell.etaMin() - << ":" << cell.etaMax() << " phi " << cell.nPhiBins() - << ":" << cell.nPhiModule() << ":" << cell.phiOffset() - << ":" << cell.phiBinWidth() << ":" << cell.unitPhi() - << " depth " << cell.depthSegment() - << ":" << cell.depth() << ":" << cell.depthMin() - << ":" << cell.depthMax() << ":" << cell.depthType() - << std::endl; + edm::LogVerbatim("HcalGeom") << "HB[" << i1 << "] det " << cell.detType() + << " zside " << cell.zside() << ":" + << cell.halfSize() << " RO " + << cell.actualReadoutDirection() + << " eta " << cell.etaBin() << ":" + << cell.etaMin() << ":" << cell.etaMax() + << " phi " << cell.nPhiBins() << ":" + << cell.nPhiModule() << ":" <>phis = cell.phis(); - std::cout << "Phis (" << phis.size() << ") :"; + edm::LogVerbatim("HcalGeom") << "Phis (" << phis.size() << ") :"; for (const auto& phi : phis) - std::cout << " [" << phi.first << ", " << phi.second << "]"; - std::cout << std::endl; + edm::LogVerbatim("HcalGeom") << " [" << phi.first << ", " << phi.second + << "]"; } std::vector hecell = hdc.HcalCellTypes(HcalEndcap); - std::cout << "HE with " << hecell.size() << " cells" << std::endl; + edm::LogVerbatim("HcalGeom") << "HE with " << hecell.size() << " cells"; for (const auto& cell : hecell) { - std::cout << "HE[" << i2 << "] det " << cell.detType() << " zside " - << cell.zside() << ":" << cell.halfSize() - << " RO " << cell.actualReadoutDirection() - << " eta " << cell.etaBin() << ":" << cell.etaMin() - << ":" << cell.etaMax() << " phi " << cell.nPhiBins() - << ":" << cell.nPhiModule() << ":" << cell.phiOffset() - << ":" << cell.phiBinWidth() << ":" << cell.unitPhi() - << " depth " << cell.depthSegment() - << ":" << cell.depth() << ":" << cell.depthMin() - << ":" << cell.depthMax() << ":" << cell.depthType() - << std::endl; + edm::LogVerbatim("HcalGeom") << "HE[" << i2 << "] det " << cell.detType() + << " zside " << cell.zside() << ":" + << cell.halfSize() << " RO " + << cell.actualReadoutDirection() << " eta " + << cell.etaBin() << ":" << cell.etaMin()<< ":" + << cell.etaMax() << " phi " << cell.nPhiBins() + << ":" << cell.nPhiModule() << ":" + << cell.phiOffset() << ":" + << cell.phiBinWidth() << ":" << cell.unitPhi() + << " depth " << cell.depthSegment() << ":" + << cell.depth() << ":" << cell.depthMin() + << ":" << cell.depthMax() << ":" + << cell.depthType(); ++i2; std::vector>phis = cell.phis(); - std::cout << "Phis (" << phis.size() << ") :"; + edm::LogVerbatim("HcalGeom") << "Phis (" << phis.size() << ") :"; for (const auto& phi : phis) - std::cout << " [" << phi.first << ", " << phi.second << "]"; - std::cout << std::endl; + edm::LogVerbatim("HcalGeom") << " [" << phi.first << ", " + << phi.second << "]"; } std::vector hfcell = hdc.HcalCellTypes(HcalForward); - std::cout << "HF with " << hfcell.size() << " cells" << std::endl; + edm::LogVerbatim("HcalGeom") << "HF with " << hfcell.size() << " cells"; for (const auto& cell : hfcell) { - std::cout << "HF[" << i3 << "] det " << cell.detType() << " zside " - << cell.zside() << ":" << cell.halfSize() - << " RO " << cell.actualReadoutDirection() - << " eta " << cell.etaBin() << ":" << cell.etaMin() - << ":" << cell.etaMax() << " phi " << cell.nPhiBins() - << ":" << cell.nPhiModule() << ":" << cell.phiOffset() - << ":" << cell.phiBinWidth() << ":" << cell.unitPhi() - << " depth " << cell.depthSegment() - << ":" << cell.depth() << ":" << cell.depthMin() - << ":" << cell.depthMax() << ":" << cell.depthType() - << std::endl; + edm::LogVerbatim("HcalGeom") << "HF[" << i3 << "] det " << cell.detType() + << " zside " << cell.zside() << ":" + << cell.halfSize() << " RO " + << cell.actualReadoutDirection() << " eta " + << cell.etaBin() << ":" << cell.etaMin() <<":" + << cell.etaMax() << " phi " << cell.nPhiBins() + << ":" << cell.nPhiModule() << ":" + << cell.phiOffset() << ":" + << cell.phiBinWidth() << ":" << cell.unitPhi() + << " depth " << cell.depthSegment() << ":" + << cell.depth() << ":" << cell.depthMin() + << ":" << cell.depthMax() << ":" + << cell.depthType(); ++i3; } std::vector hocell = hdc.HcalCellTypes(HcalOuter); - std::cout << "HO with " << hocell.size() << " cells" << std::endl; + edm::LogVerbatim("HcalGeom") << "HO with " << hocell.size() << " cells"; for (const auto& cell : hocell) { - std::cout << "HO[" << i4 << "] det " << cell.detType() << " zside " - << cell.zside() << ":" << cell.halfSize() - << " RO " << cell.actualReadoutDirection() - << " eta " << cell.etaBin() << ":" << cell.etaMin() - << ":" << cell.etaMax() << " phi " << cell.nPhiBins() - << ":" << cell.nPhiModule() << ":" << cell.phiOffset() - << ":" << cell.phiBinWidth() << ":" << cell.unitPhi() - << " depth " << cell.depthSegment() - << ":" << cell.depth() << ":" << cell.depthMin() - << ":" << cell.depthMax() << ":" << cell.depthType() - << std::endl; + edm::LogVerbatim("HcalGeom") << "HO[" << i4 << "] det " << cell.detType() + << " zside " << cell.zside() << ":" + << cell.halfSize() << " RO " + << cell.actualReadoutDirection() << " eta " + << cell.etaBin() << ":" << cell.etaMin()<< ":" + << cell.etaMax() << " phi " << cell.nPhiBins() + << ":" << cell.nPhiModule() << ":" + << cell.phiOffset() << ":" + << cell.phiBinWidth() << ":" << cell.unitPhi() + << " depth " << cell.depthSegment() << ":" + << cell.depth() << ":" << cell.depthMin() + << ":" << cell.depthMax() << ":" + << cell.depthType(); ++i4; } for (int type=0; type <= 1; ++type ) { std::vector act = hdc.getThickActive(type); - std::cout << "Hcal type " << type << " has " << act.size() - << " eta/depth segment " << std::endl; + edm::LogVerbatim("HcalGeom") << "Hcal type " << type << " has " + << act.size() << " eta/depth segments"; for (const auto& active : act) { - std::cout << "zside " << active.zside << " ieta " << active.ieta - << " depth " << active.depth << " type " << active.stype - << " eta " << active.eta << " active thickness " - << active.thick << std::endl; + edm::LogVerbatim("HcalGeom") << "zside " << active.zside << " ieta " + << active.ieta << " depth " << active.depth + << " type " << active.stype << " eta " + << active.eta << " active thickness " + << active.thick; } } @@ -199,10 +211,11 @@ void HcalRecNumberingTester::analyze( const edm::Event& iEvent, const edm::Event int zside = (k>0) ? 1 : -1; int iphi = (k>0) ? k : -k; #ifdef EDM_ML_DEBUG - std::cout << "Look for Subdet " << subdet << " Zside " << zside - << " Eta " << eta << " Phi " << iphi << " depths " - << hdc.getMinDepth(type,eta,iphi,zside) << ":" - << hdc.getMaxDepth(type,eta,iphi,zside) << std::endl; + edm::LogVerbatim("HcalGeom") << "Look for Subdet " << subdet + << " Zside " << zside << " Eta " << eta + << " Phi " << iphi << " depths " + << hdc.getMinDepth(type,eta,iphi,zside) << ":" + << hdc.getMaxDepth(type,eta,iphi,zside); #endif std::vector ids; for (int depth=hdc.getMinDepth(type,eta,iphi,zside); @@ -210,34 +223,34 @@ void HcalRecNumberingTester::analyze( const edm::Event& iEvent, const edm::Event HcalDetId id(subdet,zside*eta,iphi,depth); HcalDetId hid = hdc.mergedDepthDetId(id); hdc.unmergeDepthDetId(hid,ids); - std::cout << "Input ID " << id << " Merged ID " << hid - << " containing " << ids.size() << " IDS:"; + edm::LogVerbatim("HcalGeom") << "Input ID " << id << " Merged ID " + << hid << " containing " << ids.size() + << " IDS:"; for (auto id : ids) - std::cout << " " << id; - std::cout << std::endl; + edm::LogVerbatim("HcalGeom") << " " << id; } } } } - // Test merging + // R,Z of cells for (const auto& cell : hbcell) { int ieta = cell.etaBin()*cell.zside(); double rz = hdc.getRZ(HcalBarrel,ieta,cell.phis()[0].first, cell.depthSegment()); - std::cout << "HB (eta=" << ieta << ", phi=" << cell.phis()[0].first - << ", depth=" << cell.depthSegment() << ") r/z = " << rz - << std::endl; + edm::LogVerbatim("HcalGeom") << "HB (eta=" << ieta << ", phi=" + << cell.phis()[0].first << ", depth=" + << cell.depthSegment() << ") r/z = " << rz ; } for (const auto& cell : hecell) { int ieta = cell.etaBin()*cell.zside(); double rz = hdc.getRZ(HcalEndcap,ieta,cell.phis()[0].first, cell.depthSegment()); - std::cout << "HE (eta=" << ieta << ", phi=" << cell.phis()[0].first - << ", depth=" << cell.depthSegment() << ") r/z = " << rz - << std::endl; + edm::LogVerbatim("HcalGeom") << "HE (eta=" << ieta << ", phi=" + << cell.phis()[0].first << ", depth=" + << cell.depthSegment() << ") r/z = " << rz; } } else { - std::cout << "No record found with HcalDDDRecConstants" << std::endl; + edm::LogVerbatim("HcalGeom") << "No record found with HcalDDDRecConstants"; } } diff --git a/Geometry/HcalCommonData/test/HcalSimNumberingTester.cc b/Geometry/HcalCommonData/test/HcalSimNumberingTester.cc index c8fbb300c3721..0007f6ec18268 100644 --- a/Geometry/HcalCommonData/test/HcalSimNumberingTester.cc +++ b/Geometry/HcalCommonData/test/HcalSimNumberingTester.cc @@ -29,7 +29,7 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" - +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DetectorDescription/Core/interface/DDCompactView.h" #include "DetectorDescription/Core/interface/DDExpandedView.h" @@ -61,20 +61,21 @@ void HcalSimNumberingTester::analyze( const edm::Event& iEvent, const edm::Event iSetup.get().get( pHSNDC ); if (pHSNDC.isValid()) { - std::cout << "about to de-reference the edm::ESHandle pHSNDC" << std::endl; + edm::LogVerbatim("HcalGeom") << "about to de-reference the edm::ESHandle pHSNDC"; const HcalDDDSimConstants hdc (*pHSNDC); - std::cout << "about to getConst for 0..1" << std::endl; + edm::LogVerbatim("HcalGeom") << "about to getConst for 0..1"; for (int i=0; i<1; ++i) { std::vector > gcons = hdc.getConstHBHE(i); - std::cout << "Geometry Constants for [" << i << "] with " - << gcons.size() << " elements" << std::endl; + edm::LogVerbatim("HcalGeom") << "Geometry Constants for [" << i + << "] with " << gcons.size() << " elements"; for (unsigned int k=0; k