Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase2-hgx346Z Modify the tester for parameter and a few scripts to test HGCal geometry #43039

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Geometry/HGCalCommonData/interface/HGCalTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ class HGCalTypes {
// Translate from flat file format to CMSSW format of Layer type
static int32_t layerType(int type);
// Get the front-back index from the layer orientation index
static int32_t layerFrontBack(int32_t layerOrient) { return ((layerOrient == WaferCenterB) ? 1 : -1); }
static int32_t waferFrontBack(int32_t index) { return ((index == 0) ? -1 : 1); }
static constexpr int32_t layerFrontBack(int32_t layerOrient) { return ((layerOrient == WaferCenterB) ? 1 : -1); }
static constexpr int32_t waferFrontBack(int32_t index) { return ((index == 0) ? -1 : 1); }

private:
static constexpr int32_t facu_ = 1;
Expand Down
61 changes: 31 additions & 30 deletions Geometry/HGCalCommonData/test/HGCalParameterTester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet
myPrint("CellSize", phgp->cellSize_, 10);
myPrint("radiusMixBoundary", phgp->radiusMixBoundary_, 10);
myPrint("LayerCenter", phgp->layerCenter_, 20);
myPrint("LayerType", phgp->layerType_, 20);
edm::LogVerbatim("HGCalGeom") << "Layer Rotation " << phgp->layerRotation_ << " with " << phgp->layerRotV_.size()
<< " parameters";
for (unsigned int k = 0; k < phgp->layerRotV_.size(); ++k)
Expand All @@ -167,6 +168,20 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet
edm::LogVerbatim("HGCalGeom") << "CalibCellRadiusHD " << phgp->calibCellRLD_;
myPrint("CalibCellFullLD", phgp->calibCellFullLD_, 12);
myPrint("CalibCellPartLD", phgp->calibCellPartLD_, 12);
myPrint("cassetteShift", phgp->cassetteShift_, 8);

edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_;
if (phgp->waferMaskMode_ > 1) {
edm::LogVerbatim("HGCalGeom") << "WaferInfo with " << phgp->waferInfoMap_.size() << " elements";
unsigned int kk(0);
std::unordered_map<int32_t, HGCalParameters::waferInfo>::const_iterator itr = phgp->waferInfoMap_.begin();
for (; itr != phgp->waferInfoMap_.end(); ++itr, ++kk)
edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "["
<< HGCalWaferIndex::waferLayer(itr->first) << ", "
<< HGCalWaferIndex::waferU(itr->first) << ", "
<< HGCalWaferIndex::waferV(itr->first) << "] (" << (itr->second).type << ", "
<< (itr->second).part << ", " << (itr->second).orient << ")";
}

myPrint("slopeMin", phgp->slopeMin_, 10);
myPrint("zFrontMin", phgp->zFrontMin_, 10);
Expand Down Expand Up @@ -219,20 +234,6 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet
printTrform(phgp);
myPrint("levelTop", phgp->levelT_, 10);
printWaferType(phgp);
myPrint("cassetteShift", phgp->cassetteShift_, 8);

edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_;
if (phgp->waferMaskMode_ > 1) {
edm::LogVerbatim("HGCalGeom") << "WaferInfo with " << phgp->waferInfoMap_.size() << " elements";
unsigned int kk(0);
std::unordered_map<int32_t, HGCalParameters::waferInfo>::const_iterator itr = phgp->waferInfoMap_.begin();
for (; itr != phgp->waferInfoMap_.end(); ++itr, ++kk)
edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "["
<< HGCalWaferIndex::waferLayer(itr->first) << ", "
<< HGCalWaferIndex::waferU(itr->first) << ", "
<< HGCalWaferIndex::waferV(itr->first) << "] (" << (itr->second).type << ", "
<< (itr->second).part << ", " << (itr->second).orient << ")";
}
} else {
// Tpaezoid (scintillator) type
edm::LogVerbatim("HGCalGeom") << "DetectorType: " << phgp->detectorType_;
Expand Down Expand Up @@ -260,6 +261,22 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet
myPrint("radiusLayer[1]", phgp->radiusLayer_[1], 10);
myPrint("iradMinBH", phgp->iradMinBH_, 20);
myPrint("iradMaxBH", phgp->iradMaxBH_, 20);
edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_;
if (phgp->waferMaskMode_ > 1) {
myPrint("tileRingR", phgp->tileRingR_, 4);
myPrint("tileRingRange", phgp->tileRingRange_, 8);
edm::LogVerbatim("HGCalGeom") << "TileInfo with " << phgp->tileInfoMap_.size() << " elements";
unsigned int kk(0);
std::unordered_map<int32_t, HGCalParameters::tileInfo>::const_iterator itr = phgp->tileInfoMap_.begin();
for (; itr != phgp->tileInfoMap_.end(); ++itr, ++kk)
edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "[" << HGCalTileIndex::tileLayer(itr->first)
<< ", " << HGCalTileIndex::tileRing(itr->first) << ", "
<< HGCalTileIndex::tilePhi(itr->first) << "] (" << (itr->second).type << ", "
<< (itr->second).sipm << std::hex << ", " << (itr->second).hex[0] << ", "
<< (itr->second).hex[1] << ", " << (itr->second).hex[2] << ", "
<< (itr->second).hex[3] << ")" << std::dec;
}

myPrint("slopeTop", phgp->slopeTop_, 10);
myPrint("zFrontTop", phgp->zFrontTop_, 10);
myPrint("rMaxFront", phgp->rMaxFront_, 10);
Expand Down Expand Up @@ -303,22 +320,6 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet
printTrform(phgp);
myPrint("levelTop", phgp->levelT_, 10);
printWaferType(phgp);

edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_;
if (phgp->waferMaskMode_ > 1) {
myPrint("tileRingR", phgp->tileRingR_, 4);
myPrint("tileRingRange", phgp->tileRingRange_, 8);
edm::LogVerbatim("HGCalGeom") << "TileInfo with " << phgp->tileInfoMap_.size() << " elements";
unsigned int kk(0);
std::unordered_map<int32_t, HGCalParameters::tileInfo>::const_iterator itr = phgp->tileInfoMap_.begin();
for (; itr != phgp->tileInfoMap_.end(); ++itr, ++kk)
edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "[" << HGCalTileIndex::tileLayer(itr->first)
<< ", " << HGCalTileIndex::tileRing(itr->first) << ", "
<< HGCalTileIndex::tilePhi(itr->first) << "] (" << (itr->second).type << ", "
<< (itr->second).sipm << std::hex << ", " << (itr->second).hex[0] << ", "
<< (itr->second).hex[1] << ", " << (itr->second).hex[2] << ", "
<< (itr->second).hex[3] << ")" << std::dec;
}
}

auto finish = std::chrono::high_resolution_clock::now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
###############################################################################
import FWCore.ParameterSet.Config as cms
import os, sys, imp, re
import os, sys, importlib, re
import FWCore.ParameterSet.VarParsing as VarParsing

####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
###############################################################################
import FWCore.ParameterSet.Config as cms
import os, sys, imp, re
import os, sys, importlib, re
import FWCore.ParameterSet.VarParsing as VarParsing

####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
###############################################################################
import FWCore.ParameterSet.Config as cms
import os, sys, imp, re
import os, sys, importlib, re
import FWCore.ParameterSet.VarParsing as VarParsing

####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
###############################################################################
import FWCore.ParameterSet.Config as cms
import os, sys, imp, re, random
import os, sys, importlib, re, random
import FWCore.ParameterSet.VarParsing as VarParsing

####################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
###############################################################################
import FWCore.ParameterSet.Config as cms
import os, sys, imp, re, random
import os, sys, importlib, re, random
import FWCore.ParameterSet.VarParsing as VarParsing

####################################################################
Expand Down