Skip to content

Commit

Permalink
Modify the tester for parameter and a few scripts to test HGCal geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Oct 17, 2023
1 parent eb6caad commit 21e5b70
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 36 deletions.
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
60 changes: 31 additions & 29 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 @@ -304,21 +321,6 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet
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

0 comments on commit 21e5b70

Please sign in to comment.