From 13e1359046632903619ca021597eb8be54dfb0f4 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Fri, 21 Mar 2014 19:29:52 +0100 Subject: [PATCH 1/3] Shashlik Numbering Scheme Record --- Geometry/HGCalCommonData/BuildFile.xml | 5 + .../HGCalCommonData/data/NoTaper/shashlik.xml | 5 +- .../data/NoTaper/shashlikConstantEta3.xml | 52 +++++ .../data/NoTaper/shashlikConstantEta4.xml | 52 +++++ .../data/NoTaper/shashlikmodule.xml | 2 + .../data/shashlikConstEta3.xml | 50 ++++ .../data/shashlikConstEta4.xml | 50 ++++ .../interface/ShashlikDDDConstants.h | 54 +++++ .../HGCalCommonData/plugins/BuildFile.xml | 17 +- .../plugins/DDShashlikEndcap.cc | 50 ++-- .../plugins/DDShashlikNoTaperEndcap.cc | 40 +++- .../ShashlikNumberingInitialization.cc | 78 +++++++ .../shashlikNumberingInitialization_cfi.py | 3 + .../python/testShashlikXML_cfi.py | 1 + .../src/ShashlikDDDConstants.cc | 216 ++++++++++++++++++ Geometry/HGCalCommonData/test/BuildFile.xml | 2 + .../test/ShashlikNumberingTester.cc | 125 ++++++++++ .../test/testShashlikNumbering_cfg.py | 49 ++++ .../interface/ShashlikNumberingRecord.h | 28 +++ .../Records/src/ES_ShashlikNumberingRecord.cc | 5 + .../Records/src/ShashlikNumberingRecord.cc | 16 ++ .../test/python/runShashlik_cfg.py | 2 +- 22 files changed, 861 insertions(+), 41 deletions(-) create mode 100644 Geometry/HGCalCommonData/BuildFile.xml create mode 100644 Geometry/HGCalCommonData/data/NoTaper/shashlikConstantEta3.xml create mode 100644 Geometry/HGCalCommonData/data/NoTaper/shashlikConstantEta4.xml create mode 100644 Geometry/HGCalCommonData/data/shashlikConstEta3.xml create mode 100644 Geometry/HGCalCommonData/data/shashlikConstEta4.xml create mode 100644 Geometry/HGCalCommonData/interface/ShashlikDDDConstants.h create mode 100644 Geometry/HGCalCommonData/plugins/ShashlikNumberingInitialization.cc create mode 100644 Geometry/HGCalCommonData/python/shashlikNumberingInitialization_cfi.py create mode 100644 Geometry/HGCalCommonData/src/ShashlikDDDConstants.cc create mode 100644 Geometry/HGCalCommonData/test/ShashlikNumberingTester.cc create mode 100644 Geometry/HGCalCommonData/test/testShashlikNumbering_cfg.py create mode 100644 Geometry/Records/interface/ShashlikNumberingRecord.h create mode 100644 Geometry/Records/src/ES_ShashlikNumberingRecord.cc create mode 100644 Geometry/Records/src/ShashlikNumberingRecord.cc diff --git a/Geometry/HGCalCommonData/BuildFile.xml b/Geometry/HGCalCommonData/BuildFile.xml new file mode 100644 index 0000000000000..3fcdb8c74741a --- /dev/null +++ b/Geometry/HGCalCommonData/BuildFile.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/Geometry/HGCalCommonData/data/NoTaper/shashlik.xml b/Geometry/HGCalCommonData/data/NoTaper/shashlik.xml index ddcdec583db6a..f054f48c88c53 100644 --- a/Geometry/HGCalCommonData/data/NoTaper/shashlik.xml +++ b/Geometry/HGCalCommonData/data/NoTaper/shashlik.xml @@ -15,12 +15,13 @@ - + + - + diff --git a/Geometry/HGCalCommonData/data/NoTaper/shashlikConstantEta3.xml b/Geometry/HGCalCommonData/data/NoTaper/shashlikConstantEta3.xml new file mode 100644 index 0000000000000..fb109d9597d71 --- /dev/null +++ b/Geometry/HGCalCommonData/data/NoTaper/shashlikConstantEta3.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/HGCalCommonData/data/NoTaper/shashlikConstantEta4.xml b/Geometry/HGCalCommonData/data/NoTaper/shashlikConstantEta4.xml new file mode 100644 index 0000000000000..f414c79429d71 --- /dev/null +++ b/Geometry/HGCalCommonData/data/NoTaper/shashlikConstantEta4.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/HGCalCommonData/data/NoTaper/shashlikmodule.xml b/Geometry/HGCalCommonData/data/NoTaper/shashlikmodule.xml index 699761db43e11..89429a47d7547 100644 --- a/Geometry/HGCalCommonData/data/NoTaper/shashlikmodule.xml +++ b/Geometry/HGCalCommonData/data/NoTaper/shashlikmodule.xml @@ -6,6 +6,7 @@ + @@ -50,6 +51,7 @@ + diff --git a/Geometry/HGCalCommonData/data/shashlikConstEta3.xml b/Geometry/HGCalCommonData/data/shashlikConstEta3.xml new file mode 100644 index 0000000000000..0591cf970ffa2 --- /dev/null +++ b/Geometry/HGCalCommonData/data/shashlikConstEta3.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/HGCalCommonData/data/shashlikConstEta4.xml b/Geometry/HGCalCommonData/data/shashlikConstEta4.xml new file mode 100644 index 0000000000000..a3b41b64a38a2 --- /dev/null +++ b/Geometry/HGCalCommonData/data/shashlikConstEta4.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/HGCalCommonData/interface/ShashlikDDDConstants.h b/Geometry/HGCalCommonData/interface/ShashlikDDDConstants.h new file mode 100644 index 0000000000000..28496b17cfe85 --- /dev/null +++ b/Geometry/HGCalCommonData/interface/ShashlikDDDConstants.h @@ -0,0 +1,54 @@ +#ifndef HGCalCommonData_ShashlikDDDConstants_h +#define HGCalCommonData_ShashlikDDDConstants_h + +/** \class ShashlikDDDConstants + * + * this class reads the constant section of + * the shashlik-numbering xml-file + * + * $Date: 2014/03/20 00:06:50 $ + * \author Sunanda Banerjee, SINP + * + */ + +#include +#include +#include + +#include "DetectorDescription/Core/interface/DDsvalues.h" + +class DDCompactView; +class DDFilteredView; + +class ShashlikDDDConstants { + +public: + + ShashlikDDDConstants(); + ShashlikDDDConstants( const DDCompactView& cpv ); + ~ShashlikDDDConstants(); + + std::pair getSMM(int ix, int iy) const; + std::pair getXY(int sm, int mod) const; + int getSuperModules() const {return 4*nSM;} + int getModules() const {return nMods*nMods;} + int getCols() const {return 2*nRow;} + void initialize(const DDCompactView& cpv); + bool isValidXY(int ix, int iy) const; + bool isValidSMM(int sm, int mod) const; + int quadrant(int ix, int iy) const; + int quadrant(int sm) const; + +private: + void checkInitialized() const; + void loadSpecPars(const DDFilteredView& fv); + std::vector getDDDArray(const std::string &, + const DDsvalues_type &) const; + + bool tobeInitialized; + static const int nMods=5; + int nSM, nColS, nRow; + std::vector firstY, lastY, firstSM, lastSM; +}; + +#endif diff --git a/Geometry/HGCalCommonData/plugins/BuildFile.xml b/Geometry/HGCalCommonData/plugins/BuildFile.xml index 99b88af930e8e..39ef94dc40126 100644 --- a/Geometry/HGCalCommonData/plugins/BuildFile.xml +++ b/Geometry/HGCalCommonData/plugins/BuildFile.xml @@ -1,5 +1,12 @@ - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/Geometry/HGCalCommonData/plugins/DDShashlikEndcap.cc b/Geometry/HGCalCommonData/plugins/DDShashlikEndcap.cc index 61474a5b23f8c..e2d3960a44a0c 100644 --- a/Geometry/HGCalCommonData/plugins/DDShashlikEndcap.cc +++ b/Geometry/HGCalCommonData/plugins/DDShashlikEndcap.cc @@ -13,6 +13,8 @@ #include "CLHEP/Units/GlobalPhysicalConstants.h" #include "CLHEP/Units/GlobalSystemOfUnits.h" +//#define DebugLog + DDShashlikEndcap::DDShashlikEndcap() { edm::LogInfo("HGCalGeom") << "DDShashlikEndcap test: Creating an instance"; } @@ -72,31 +74,34 @@ DDShashlikEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int yQuadran double offsetX = offsetMultiplier * pointingLocation * tan( xphi - xQuadrant*pointingAngle ); double offsetY = offsetMultiplier * pointingLocation * tan( yphi - yQuadrant*pointingAngle ); - int row(0), column(0); - +#ifdef DebugLog std::cout << " Initially, tiltAngle = " << tiltAngle - << " pointingAngle=" << pointingAngle << " pointingLocation=" << pointingLocation - << " copyNo = " << copyNo << ": offsetX,Y = " - << offsetX << "," << offsetY - << " rMin, rMax=" + << " pointingAngle=" << pointingAngle << " pointingLocation=" + << pointingLocation << " copyNo = " << copyNo << ": offsetX,Y = " + << offsetX << "," << offsetY << " rMin, rMax = " << m_rMin << "," << m_rMax << std::endl; - + int column(0), rowmax(0); +#endif while( abs(offsetX) < m_rMax) { +#ifdef DebugLog column++; - if (abs(offsetY) < m_rMax) - row++; + int row(0); +#endif while( abs(offsetY) < m_rMax) { - +#ifdef DebugLog + row++; +#endif double limit = sqrt( offsetX*offsetX + offsetY*offsetY ); - std::cout << " copyNo = " << copyNo << " (" << column << "," << row << "): offsetX,Y = " - << offsetX << "," << offsetY << " limit=" << limit - << " rMin, rMax=" - << m_rMin << "," << m_rMax << std::endl; - // Make sure we do not add supermodules in rMin area if( limit > m_rMin && limit < m_rMax ) { +#ifdef DebugLog + std::cout << " copyNo = " << copyNo << " (" << column << "," << row + << "): offsetX,Y = " << offsetX << "," << offsetY + << " limit=" << limit << " rMin, rMax = " + << m_rMin << "," << m_rMax << std::endl; +#endif DDRotation rotation; std::string rotstr( "NULL" ); @@ -111,9 +116,9 @@ DDShashlikEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int yQuadran * ( *DDcreateRotationMatrix( theta + xphi, phiX, 90.*CLHEP::deg, 90.*CLHEP::deg, xphi, 0.0 )))); } - std::cout << "Shashlik SM " << copyNo << ": xphi=" << xphi << " yphi=" << yphi << " offsets = (" << offsetX << ", " << offsetY << ", " << offsetZ << ")" << std::endl; - DDTranslation tran( offsetX, offsetY, offsetZ ); + edm::LogInfo("HGCalGeom") << "Module " << copyNo << ": location = " + << tran << " Rotation " << rotation; DDName parentName = parent().name(); cpv.position( DDName( m_childName ), parentName, copyNo, tran, rotation ); @@ -124,6 +129,9 @@ DDShashlikEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int yQuadran offsetY = offsetMultiplier * pointingLocation * tan( yphi - yQuadrant*pointingAngle ); } +#ifdef DebugLog + if (row > rowmax) rowmax = row; +#endif xphi += xQuadrant*2.*tiltAngle; yphi = yQuadrant*(tiltAngle + pointingAngle); //offsetX = offsetMultiplier * offsetZ * tan( xphi - xQuadrant*pointingAngle); @@ -131,11 +139,11 @@ DDShashlikEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int yQuadran offsetX = offsetMultiplier * pointingLocation * tan( xphi - xQuadrant*pointingAngle); offsetY = offsetMultiplier * pointingLocation * tan( yphi - yQuadrant*pointingAngle); - - - } - std::cout << row << " rows and " << column << " columns in quadrant " << xQuadrant << ":" << yQuadrant << std::endl; +#ifdef DebugLog + std::cout << rowmax << " rows and " << column << " columns in quadrant " + << xQuadrant << ":" << yQuadrant << std::endl; +#endif return copyNo; } diff --git a/Geometry/HGCalCommonData/plugins/DDShashlikNoTaperEndcap.cc b/Geometry/HGCalCommonData/plugins/DDShashlikNoTaperEndcap.cc index 92f925a3354c1..9491034bfaf59 100644 --- a/Geometry/HGCalCommonData/plugins/DDShashlikNoTaperEndcap.cc +++ b/Geometry/HGCalCommonData/plugins/DDShashlikNoTaperEndcap.cc @@ -13,6 +13,8 @@ #include "CLHEP/Units/GlobalPhysicalConstants.h" #include "CLHEP/Units/GlobalSystemOfUnits.h" +//#define DebugLog + DDShashlikNoTaperEndcap::DDShashlikNoTaperEndcap() { edm::LogInfo("HGCalGeom") << "DDShashlikNoTaperEndcap test: Creating an instance"; } @@ -64,7 +66,6 @@ DDShashlikNoTaperEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int y double phiZ = 3*theta; double offsetZ = m_zoffset; double offsetXY = m_xyoffset; - int row(0), column(0); // ccn: these need to change for no-taper option //double offsetX = offsetZ * tan( xphi ); @@ -72,17 +73,29 @@ DDShashlikNoTaperEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int y double offsetX = xQuadrant*0.5*offsetXY; double offsetY = yQuadrant*0.5*offsetXY; - while( abs(offsetX) < m_rMax) - { +#ifdef DebugLog + int rowmax(0), column(0); +#endif + while( abs(offsetX) < m_rMax) { +#ifdef DebugLog column++; - while( abs(offsetY) < m_rMax) - { + int row(0); +#endif + while( abs(offsetY) < m_rMax) { +#ifdef DebugLog row++; +#endif double limit = sqrt( offsetX*offsetX + offsetY*offsetY ); // Make sure we do not add supermodules in rMin area if( limit > m_rMin && limit < m_rMax ) { +#ifdef DebugLog + std::cout << " copyNo = " << copyNo << " (" << column << "," << row + << "): offsetX,Y = " << offsetX << "," << offsetY + << " limit=" << limit << " rMin, rMax = " + << m_rMin << "," << m_rMax << std::endl; +#endif DDRotation rotation; std::string rotstr( "NULL" ); @@ -97,13 +110,11 @@ DDShashlikNoTaperEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int y * ( *DDcreateRotationMatrix( theta + xphi, phiX, 90.*CLHEP::deg, 90.*CLHEP::deg, xphi, 0.0 )))); } - edm::LogInfo("HGCalGeom") << "Module " << copyNo << ":location = (" - << offsetX << "," - << offsetY << "," - << offsetZ << ")"; DDTranslation tran( offsetX, offsetY, offsetZ ); - + edm::LogInfo("HGCalGeom") << "Module " << copyNo << ": location = " + << tran << " Rotation " << rotation; + DDName parentName = parent().name(); cpv.position( DDName( m_childName ), parentName, copyNo, tran, rotation ); @@ -118,6 +129,9 @@ DDShashlikNoTaperEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int y ////offsetX = offsetZ * tan( xphi ); //offsetX += xQuadrant*offsetXY; } +#ifdef DebugLog + if (row > rowmax) rowmax = row; +#endif xphi += xQuadrant*2.*tiltAngle; yphi = yQuadrant*tiltAngle; // ccn: change this for no-taper @@ -127,8 +141,10 @@ DDShashlikNoTaperEndcap::createQuarter( DDCompactView& cpv, int xQuadrant, int y offsetX += xQuadrant*offsetXY; } - - // std::cout << row << " rows and " << column << " columns in quadrant " << xQuadrant << ":" << yQuadrant << std::endl; +#ifdef DebugLog + std::cout << rowmax << " rows and " << column << " columns in quadrant " + << xQuadrant << ":" << yQuadrant << std::endl; +#endif return copyNo; } diff --git a/Geometry/HGCalCommonData/plugins/ShashlikNumberingInitialization.cc b/Geometry/HGCalCommonData/plugins/ShashlikNumberingInitialization.cc new file mode 100644 index 0000000000000..874665a6cca15 --- /dev/null +++ b/Geometry/HGCalCommonData/plugins/ShashlikNumberingInitialization.cc @@ -0,0 +1,78 @@ +// -*- C++ -*- +// +// Package: ShashlikNumberingInitialization +// Class: ShashlikNumberingInitialization +// +/**\class ShashlikNumberingInitialization ShashlikNumberingInitialization.h Geometry/HGCalCommonData/interface/ShashlikNumberingInitialization.h + + Description: + + Implementation: + +*/ +// +// Original Author: Sunanda Banerjee +// Created: Tue Mar 21 16:40:29 PDT 2013 +// $Id: ShashlikNumberingInitialization.cc,v 1.0 2013/12/24 12:47:41 sunanda Exp $ +// +// + + +// system include files +#include +#include + +// user include files +#include +#include +#include + +#include +#include +#include +#include +#include + +//#define DebugLog + +class ShashlikNumberingInitialization : public edm::ESProducer { + +public: + ShashlikNumberingInitialization(const edm::ParameterSet&); + ~ShashlikNumberingInitialization(); + + typedef std::auto_ptr ReturnType; + + ReturnType produce(const ShashlikNumberingRecord&); + +private: + ShashlikDDDConstants* hcalDDDConst_; +}; + +ShashlikNumberingInitialization::ShashlikNumberingInitialization(const edm::ParameterSet& iConfig) : hcalDDDConst_(0) { +#ifdef DebugLog + std::cout <<"constructing ShashlikNumberingInitialization" << std::endl; +#endif + setWhatProduced(this); +} + + +ShashlikNumberingInitialization::~ShashlikNumberingInitialization() {} + + +// ------------ method called to produce the data ------------ +ShashlikNumberingInitialization::ReturnType +ShashlikNumberingInitialization::produce(const ShashlikNumberingRecord& iRecord) { +#ifdef DebugLog + std::cout << "in ShashlikNumberingInitialization::produce" << std::endl; +#endif + if (hcalDDDConst_ == 0) { + edm::ESTransientHandle pDD; + iRecord.getRecord().get(pDD); + hcalDDDConst_ = new ShashlikDDDConstants(*pDD); + } + return std::auto_ptr (hcalDDDConst_) ; +} + +//define this as a plug-in +DEFINE_FWK_EVENTSETUP_MODULE(ShashlikNumberingInitialization); diff --git a/Geometry/HGCalCommonData/python/shashlikNumberingInitialization_cfi.py b/Geometry/HGCalCommonData/python/shashlikNumberingInitialization_cfi.py new file mode 100644 index 0000000000000..dcf47e8d5bc77 --- /dev/null +++ b/Geometry/HGCalCommonData/python/shashlikNumberingInitialization_cfi.py @@ -0,0 +1,3 @@ +import FWCore.ParameterSet.Config as cms + +ShashlikNumberingInitialization = cms.ESProducer("ShashlikNumberingInitialization") diff --git a/Geometry/HGCalCommonData/python/testShashlikXML_cfi.py b/Geometry/HGCalCommonData/python/testShashlikXML_cfi.py index bf1a2bc5d8513..0eaabe7bcf8ca 100644 --- a/Geometry/HGCalCommonData/python/testShashlikXML_cfi.py +++ b/Geometry/HGCalCommonData/python/testShashlikXML_cfi.py @@ -12,6 +12,7 @@ 'Geometry/HGCalCommonData/data/shashlik.xml', 'Geometry/HGCalCommonData/data/shashliksupermodule.xml', 'Geometry/HGCalCommonData/data/shashlikmodule.xml', + 'Geometry/HGCalCommonData/data/shashlikConstEta3.xml', 'Geometry/HGCalSimData/data/shashliksens.xml', 'Geometry/HGCalSimData/data/shashlikProdCuts.xml'), rootNodeName = cms.string('cms:OCMS') diff --git a/Geometry/HGCalCommonData/src/ShashlikDDDConstants.cc b/Geometry/HGCalCommonData/src/ShashlikDDDConstants.cc new file mode 100644 index 0000000000000..7390cacff1e28 --- /dev/null +++ b/Geometry/HGCalCommonData/src/ShashlikDDDConstants.cc @@ -0,0 +1,216 @@ +#include "Geometry/HGCalCommonData/interface/ShashlikDDDConstants.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/Utilities/interface/Exception.h" + +#include "DetectorDescription/Base/interface/DDutils.h" +#include "DetectorDescription/Core/interface/DDValue.h" +#include "DetectorDescription/Core/interface/DDFilter.h" +#include "DetectorDescription/Core/interface/DDSolid.h" +#include "DetectorDescription/Core/interface/DDFilteredView.h" +#include "CLHEP/Units/GlobalPhysicalConstants.h" +#include "CLHEP/Units/GlobalSystemOfUnits.h" + +//#define DebugLog + +ShashlikDDDConstants::ShashlikDDDConstants() : tobeInitialized(true), nSM(0), + nColS(0) { + +#ifdef DebugLog + edm::LogInfo("HGCalGeom") << "ShashlikDDDConstants::ShashlikDDDConstants constructor"; +#endif + +} + +ShashlikDDDConstants::ShashlikDDDConstants(const DDCompactView& cpv) : tobeInitialized(true) { + +#ifdef DebugLog + edm::LogInfo("HGCalGeom") << "ShashlikDDDConstants::ShashlikDDDConstants ( const DDCompactView& cpv ) constructor"; +#endif + + initialize(cpv); + +} + + +ShashlikDDDConstants::~ShashlikDDDConstants() { +#ifdef DebugLog + std::cout << "destructed!!!" << std::endl; +#endif +} + +std::pair ShashlikDDDConstants::getSMM(int ix, int iy) const { + + int iq = quadrant(ix,iy); + if (iq != 0) { + int jx = (ix-1)/nMods; + int jy = (iy-1)/nMods; + int kx = (iq == 1 || iq == 4) ? (jx-nColS) : (nColS-1-jx); + int ky = (iq == 1 || iq == 2) ? (jy-nColS) : (nColS-1-jy); + int sm = (ky+1 >= firstY[kx] && ky+1 <= lastY[kx]) ? firstSM[kx]+ky-firstY[kx]+1+(iq-1)*nSM : 0; + int mod= (sm > 0) ? (((ix-1)%nMods) + ((iy-1)%nMods)*nMods + 1) : 0; + return std::pair(sm,mod); + } else { + return std::pair(0,0); + } +} + +std::pair ShashlikDDDConstants::getXY(int sm, int mod) const { + + int iq = quadrant(sm); + if (iq != 0) { + int ism = sm - (iq-1)*nSM; + int jx(0), jy(0); + for (unsigned int k=0; k= firstSM[k] && ism <= lastSM[k]) { + jx = k + 1; + jy = ism - firstSM[k] + firstY[k]; + break; + } + } + int kx = (iq == 1 || iq == 4) ? (jx + nColS) : (nColS+1-jx); + int ky = (iq == 1 || iq == 2) ? (jy + nColS) : (nColS+1-jy); + int ll = (mod-1)/nMods; + int ix = (kx-1)*nMods+(mod-ll*nMods); + int iy = (ky-1)*nMods+(ll+1); + return std::pair(ix,iy); + } else { + return std::pair(0,0); + } +} + +void ShashlikDDDConstants::initialize(const DDCompactView& cpv) { + + if (tobeInitialized) { + tobeInitialized = false; + + std::string attribute = "OnlyForShashlikNumbering"; + std::string value = "any"; + DDValue val(attribute, value, 0.0); + + DDSpecificsFilter filter; + filter.setCriteria(val, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); + DDFilteredView fv(cpv); + fv.addFilter(filter); + bool ok = fv.firstChild(); + + if (ok) { + loadSpecPars(fv); + + } else { + edm::LogError("HGCalGeom") << "ShashlikDDDConstants: cannot get filtered" + << " view for " << attribute + << " not matching " << value; + throw cms::Exception("DDException") << "ShashlikDDDConstants: cannot match " << attribute << " to " << value; + } + } +} + +bool ShashlikDDDConstants::isValidXY(int ix, int iy) const { + int iq = quadrant(ix,iy); + if (iq != 0) { + int jx = (ix-1)/nMods; + int jy = (iy-1)/nMods; + int kx = (iq == 1 || iq == 4) ? (jx-nColS) : (nColS-1-jx); + int ky = (iq == 1 || iq == 2) ? (jy-nColS) : (nColS-1-jy); + bool ok = (ky+1 >= firstY[kx] && ky+1 <= lastY[kx]); + return ok; + } else { + return false; + } +} + +bool ShashlikDDDConstants::isValidSMM(int sm, int mod) const { + bool ok = (sm > 0 && sm <= getSuperModules() && mod > 0 && mod <= getModules()); + return ok; +} + +int ShashlikDDDConstants::quadrant(int ix, int iy) const { + int iq(0); + if (ix>nRow && ix<=2*nRow) { + if (iy>nRow && iy<=2*nRow) iq = 1; + else if (iy>0 && iy<=nRow) iq = 4; + } else if (ix>0 && ix<=nRow) { + if (iy>nRow && iy<=2*nRow) iq = 2; + else if (iy>0 && iy<=nRow) iq = 3; + } + return iq; +} + +int ShashlikDDDConstants::quadrant(int sm) const { + int iq(0); + if (sm > 4*nSM) { + } else if (sm > 3*nSM) { + iq = 4; + } else if (sm > 2*nSM) { + iq = 3; + } else if (sm > nSM) { + iq = 2; + } else if (sm > 0) { + iq = 1; + } + return iq; +} + +void ShashlikDDDConstants::checkInitialized() const { + if (tobeInitialized) { + edm::LogError("HGCalGeom") << "ShashlikDDDConstants : to be initialized correctly"; + throw cms::Exception("DDException") << "ShashlikDDDConstants: to be initialized"; + } +} + +void ShashlikDDDConstants::loadSpecPars(const DDFilteredView& fv) { + + DDsvalues_type sv(fv.mergedSpecifics()); + + // First and Last Row number in each column + firstY = dbl_to_int(getDDDArray("firstRow",sv)); + lastY = dbl_to_int(getDDDArray("lastRow", sv)); + if (firstY.size() != lastY.size()) { + edm::LogError("HGCalGeom") << "ShashlikDDDConstants: unequal # of columns " + << firstY.size() << ":" << lastY.size() + << " for first and last rows"; + throw cms::Exception("DDException") << "ShashlikDDDConstants: wrong array sizes for first/last Row"; + } + + nSM = 0; + nColS = (int)(firstY.size()); + nRow = 0; + for (unsigned int k=0; k nRow) nRow = lastY[k]; + } + +#ifdef DebugLog + std::cout << "ShashlikDDDConstants: nSM = " << nSM << ", nModule = " + << nMods << ", nRow = " << 2*nRow << ", nColumns = " + << 2*nColS << std::endl; + for (unsigned int k=0; k ShashlikDDDConstants::getDDDArray(const std::string & str, + const DDsvalues_type & sv) const { + +#ifdef DebugLog + std::cout << "ShashlikDDDConstants:getDDDArray called for " << str << std::endl; +#endif + DDValue value(str); + if (DDfetch(&sv,value)) { +#ifdef DebugLog + std::cout << "ShashlikDDDConstants: " << value << std::endl; +#endif + const std::vector & fvec = value.doubles(); + int nval = fvec.size(); + if (nval > 0) return fvec; + } + edm::LogError("HGCalGeom") << "ShashlikDDDConstants: cannot get array " + << str; + throw cms::Exception("DDException") << "ShashlikDDDConstants: cannot get array " << str; +} diff --git a/Geometry/HGCalCommonData/test/BuildFile.xml b/Geometry/HGCalCommonData/test/BuildFile.xml index 02810ddb8f079..5e8a305aa1042 100644 --- a/Geometry/HGCalCommonData/test/BuildFile.xml +++ b/Geometry/HGCalCommonData/test/BuildFile.xml @@ -1,6 +1,8 @@ + + diff --git a/Geometry/HGCalCommonData/test/ShashlikNumberingTester.cc b/Geometry/HGCalCommonData/test/ShashlikNumberingTester.cc new file mode 100644 index 0000000000000..c31e29dc9b691 --- /dev/null +++ b/Geometry/HGCalCommonData/test/ShashlikNumberingTester.cc @@ -0,0 +1,125 @@ +// -*- C++ -*- +// +// Package: ShashlikNumberingTester +// Class: ShashlikNumberingTester +// +/**\class ShashlikNumberingTester ShashlikNumberingTester.cc test/ShashlikNumberingTester.cc + + Description: + + Implementation: + +*/ +// +// Original Author: Sunanda Banerjee +// Created: Mon 2014/03/21 +// $Id: ShashlikNumberingTester.cc,v 1.0 2014/032/21 14:06:07 sunanda Exp $ +// +// + + +// system include files +#include +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESTransientHandle.h" +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "DetectorDescription/Core/interface/DDCompactView.h" +#include "DetectorDescription/Core/interface/DDExpandedView.h" +#include "DetectorDescription/Core/interface/DDSpecifics.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/Records/interface/ShashlikNumberingRecord.h" +#include "Geometry/HGCalCommonData/interface/ShashlikDDDConstants.h" + +#include "CoralBase/Exception.h" + +// +// class decleration +// + +class ShashlikNumberingTester : public edm::EDAnalyzer { +public: + explicit ShashlikNumberingTester( const edm::ParameterSet& ); + ~ShashlikNumberingTester(); + + + virtual void analyze( const edm::Event&, const edm::EventSetup& ); +private: + // ----------member data --------------------------- +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +ShashlikNumberingTester::ShashlikNumberingTester(const edm::ParameterSet& ) {} + + +ShashlikNumberingTester::~ShashlikNumberingTester() {} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ +void ShashlikNumberingTester::analyze( const edm::Event& iEvent, const edm::EventSetup& iSetup ) { + + edm::ESHandle pSNDC; + edm::ESTransientHandle pDD; + iSetup.get().get( pDD ); + iSetup.get().get( pSNDC ); + + try { + DDExpandedView epv(*pDD); + std::cout << " without firstchild or next... epv.logicalPart() =" << epv.logicalPart() << std::endl; + } catch(const DDLogicalPart& iException) { + throw cms::Exception("Geometry") << "DDORAReader::readDB caught a DDLogicalPart exception: \""< pSNDC" << std::endl; + const ShashlikDDDConstants sdc(*pSNDC); + std::cout << "SuperModules = " << sdc.getSuperModules() << " Modules = " + << sdc.getModules() << " Number of Rows/Columns = " + << sdc.getCols() << std::endl; + for (int sm=1; sm<=sdc.getSuperModules(); ++sm) { + for (int mod=1; mod<=sdc.getModules(); ++mod) { + if (sdc.isValidSMM(sm,mod)) { + std::pair ixy = sdc.getXY(sm,mod); + std::pair ism = sdc.getSMM(ixy.first,ixy.second); + std::string flag = (ism.first == sm && ism.second == mod) ? "OK" : "ERROR"; + std::cout << "Input SM/Module " << sm << ":" << mod + << " iX/iY " << ixy.first << ":" << ixy.second + << " o/p SM/Module " << ism.first << ":" << ism.second + << " Valid " << sdc.isValidXY(ixy.first,ixy.second) + << " Flag " << flag << std::endl; + } + } + } +} + + +//define this as a plug-in +DEFINE_FWK_MODULE(ShashlikNumberingTester); diff --git a/Geometry/HGCalCommonData/test/testShashlikNumbering_cfg.py b/Geometry/HGCalCommonData/test/testShashlikNumbering_cfg.py new file mode 100644 index 0000000000000..878fc67bedbb7 --- /dev/null +++ b/Geometry/HGCalCommonData/test/testShashlikNumbering_cfg.py @@ -0,0 +1,49 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("PROD") +process.load("SimGeneral.HepPDTESSource.pdt_cfi") +process.load("Geometry.HGCalCommonData.testShashlikXML_cfi") +process.load("Geometry.HGCalCommonData.shashlikNumberingInitialization_cfi") + +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('cout'), + categories = cms.untracked.vstring('HGCalGeom'), + debugModules = cms.untracked.vstring('*'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + HGCalGeom = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), +) + +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 + +process.source = cms.Source("EmptySource") + +process.generator = cms.EDProducer("FlatRandomEGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(14), + MinEta = cms.double(-3.5), + MaxEta = cms.double(3.5), + MinPhi = cms.double(-3.14159265359), + MaxPhi = cms.double(3.14159265359), + MinE = cms.double(9.99), + MaxE = cms.double(10.01) + ), + AddAntiParticle = cms.bool(False), + Verbosity = cms.untracked.int32(0), + firstRun = cms.untracked.uint32(1) +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.prod = cms.EDAnalyzer("ShashlikNumberingTester") + +process.p1 = cms.Path(process.generator*process.prod) diff --git a/Geometry/Records/interface/ShashlikNumberingRecord.h b/Geometry/Records/interface/ShashlikNumberingRecord.h new file mode 100644 index 0000000000000..70380b3f79aa3 --- /dev/null +++ b/Geometry/Records/interface/ShashlikNumberingRecord.h @@ -0,0 +1,28 @@ +#ifndef GeometryRecord_ShashlikNumberingRecord_h +#define GeometryRecord_ShashlikNumberingRecord_h +// -*- C++ -*- +// +// Package: Record +// Class : ShashlikNumberingRecord +// +/**\class ShashlikNumberingRecord ShashlikNumberingRecord.h Geometry/Record/interface/ShashlikNumberingRecord.h + + Description: + + Usage: + + +*/ +// +// Author: +// Created: Thu Mar 21 16:41:02 PDT 2014 +// $Id: ShashlikNumberingRecord.h,v 1.0 2014/03/21 10:22:50 sunanda Exp $ +// + +#include +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "FWCore/Framework/interface/DependentRecordImplementation.h" + +class ShashlikNumberingRecord : public edm::eventsetup::DependentRecordImplementation > {}; + +#endif diff --git a/Geometry/Records/src/ES_ShashlikNumberingRecord.cc b/Geometry/Records/src/ES_ShashlikNumberingRecord.cc new file mode 100644 index 0000000000000..69dfcd7ccf693 --- /dev/null +++ b/Geometry/Records/src/ES_ShashlikNumberingRecord.cc @@ -0,0 +1,5 @@ +#include "Geometry/HGCalCommonData/interface/ShashlikDDDConstants.h" +#include "FWCore/Utilities/interface/typelookup.h" + +TYPELOOKUP_DATA_REG(ShashlikDDDConstants); + diff --git a/Geometry/Records/src/ShashlikNumberingRecord.cc b/Geometry/Records/src/ShashlikNumberingRecord.cc new file mode 100644 index 0000000000000..2e34b9c6009e0 --- /dev/null +++ b/Geometry/Records/src/ShashlikNumberingRecord.cc @@ -0,0 +1,16 @@ +// -*- C++ -*- +// +// Package: Record +// Class : ShashlikNumberingRecord +// +// Implementation: +// +// +// Author: +// Created: Thu Mar 21 16:41:02 PDT 2014 +// $Id: ShashlikNumberingRecord.cc,v 1.0 2014/03/21 19:59:39 sunanda Exp $ + +#include "Geometry/Records/interface/ShashlikNumberingRecord.h" +#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h" + +EVENTSETUP_RECORD_REG(ShashlikNumberingRecord); diff --git a/Validation/CheckOverlap/test/python/runShashlik_cfg.py b/Validation/CheckOverlap/test/python/runShashlik_cfg.py index d502ec08185e8..ec031aac6114d 100644 --- a/Validation/CheckOverlap/test/python/runShashlik_cfg.py +++ b/Validation/CheckOverlap/test/python/runShashlik_cfg.py @@ -15,7 +15,7 @@ limit = cms.untracked.int32(0) ), HGCalGeom = cms.untracked.PSet( - limit = cms.untracked.int32(-1) + limit = cms.untracked.int32(0) ), G4cout = cms.untracked.PSet( limit = cms.untracked.int32(-1) From 1d9f81d8e3556de5a1a4aabc042718c7c37eae7b Mon Sep 17 00:00:00 2001 From: Sunanda Date: Sat, 22 Mar 2014 18:51:47 +0100 Subject: [PATCH 2/3] Use new method for Shashlik SimHit --- DataFormats/EcalDetId/interface/EKDetId.h | 264 +----------------- DataFormats/EcalDetId/src/EKDetId.cc | 277 ------------------- DataFormats/EcalDetId/test/BuildFile.xml | 2 - DataFormats/EcalDetId/test/printEKDetId.cpp | 115 -------- SimG4CMS/Calo/BuildFile.xml | 1 + SimG4CMS/Calo/interface/ShashlikSD.h | 4 +- SimG4CMS/Calo/src/ShashlikSD.cc | 5 +- SimG4CMS/Calo/test/python/runShashlik_cfg.py | 1 + 8 files changed, 14 insertions(+), 655 deletions(-) delete mode 100644 DataFormats/EcalDetId/test/printEKDetId.cpp diff --git a/DataFormats/EcalDetId/interface/EKDetId.h b/DataFormats/EcalDetId/interface/EKDetId.h index 7a28c13536c76..b668cb241bf59 100644 --- a/DataFormats/EcalDetId/interface/EKDetId.h +++ b/DataFormats/EcalDetId/interface/EKDetId.h @@ -27,29 +27,20 @@ class EKDetId : public DetId { */ EKDetId(uint32_t rawid) : DetId(rawid) {} - /** Constructor from crystal ix,iy,fib,ro,iz (iz=+1/-1) (mode = XYMODE) - * or from sm,mod,fib,ro,iz (mode = SCMODULEMODE). - *

ix runs from 1 to 180 along x-axis of standard CMS coordinates
- * iy runs from 1 to 180 along y-axis of standard CMS coordinates
+ /** Constructor from module ix,iy,fib,ro,iz (iz=+1/-1) + *

ix runs from 1 to N along x-axis of standard CMS coordinates
+ * iy runs from 1 to N along y-axis of standard CMS coordinates
+ * N depends on the configuration == see ShashlikDDDConstants
* fib runs from 0 to 5 for fiber type (0 is combined)
* ro runs from 0 to 2 for read out type (0 is combined)
* iz is -1 for EK- and +1 for EK+
- *

For ism see ism(), for imod see imod() - * @see ism(), imod() - * @param i ix or ism index - * @param j iy or ism index - * @param iz iz/zside index: -1 for EK-, +1 for EK+ - * @param mode pass XYMODE if i j refer to ix, iy, SCMODULEMODE if thery refer to ism, imod */ - // fast EKDetId(int module_ix, int module_iy, int fiber, int ro, int iz); - // slow - EKDetId(int i, int j, int fiber, int ro, int iz, int mode); /** Constructor from a generic cell id * @param id source detid */ - EKDetId(const DetId& id) : DetId(id){} + EKDetId(const DetId& id) : DetId(id) {} /** Assignment operator * @param id source det id @@ -95,173 +86,6 @@ class EKDetId : public DetId { * @return readout-index */ int readout() const { return (id_>>19)&0x3; } - - /** Gets the SuperModule number within the endcap. This number runs from 1 to 936. - * - * BEWARE: This number is not consistent with indices used in constructor: see details below. - * - * Numbering in quadrant 1 of EK+ is the following - * \verbatim - * 13 27 - * 12 26 40 54 70 87 104 - * 11 25 39 53 69 86 103 120 136 - * 10 24 38 52 68 85 102 119 135 151 166 - * 09 23 37 51 67 84 101 118 134 150 165 180 - * 08 22 36 50 66 83 100 117 133 149 164 179 193 - * 07 21 35 49 65 82 99 116 132 148 163 178 192 205 - * 06 20 34 48 64 81 98 115 131 147 162 177 191 204 - * 05 19 33 47 63 80 97 114 130 146 161 176 190 203 215 - * 04 18 32 46 62 79 96 113 129 145 160 175 189 202 214 225 - * 03 17 31 45 61 78 95 112 128 144 159 174 188 201 213 224 - * 02 16 30 44 60 77 94 111 127 143 158 173 187 200 212 223 232 - * 01 15 29 43 59 76 93 110 126 142 157 172 186 199 211 222 231 - * 14 28 42 58 75 92 109 125 141 156 171 185 198 210 221 230 - * 41 57 74 91 108 124 140 155 170 184 197 209 220 229 - * 56 73 90 107 123 139 154 169 183 196 208 219 228 - * 55 72 89 106 122 138 153 168 182 195 207 218 227 234 - * 71 88 105 121 137 152 167 181 194 206 217 226 233 - * - * \endverbatim - * - * Quadrant 2 indices are deduced by a symmetry about y-axis and by adding an offset - * of 234.
- * Quadrant 3 and 4 indices are deduced from quadrant 1 and 2 by a symmetry - * about x-axis and adding an offset. Quadrant N starts with index 1 + (N-1)*234. - * - *

EK- indices are deduced from EK+ by a symmetry about (x,y)-plane (mirrored view). It is - * inconsistent with indices used in constructor EKDetId(int, int,int) in - * SCMODULEMODE. Indices of constructor uses a symmetry along y-axis: in principal it - * considers the ism as a local index. The discrepancy is most probably due to a bug in the - * implementation of this ism() method. - */ - int ism() const; - - /** Gets module number inside SuperModule. - * Module numbering withing a supermodule in each quadrant: - * \verbatim - * A y - * (Q2) | (Q1) - * 5 10 15 20 25 | 5 10 15 20 25 - * 4 9 14 19 24 | 4 9 14 19 24 - * 3 8 13 18 23 | 3 8 13 18 23 - * 2 7 12 17 22 | 2 7 12 17 22 - * 1 6 11 16 21 | 1 6 11 16 21 - * | - * ----------------------o---------------------------> x - * | - * 5 10 15 20 25 | 5 10 15 20 25 - * 4 9 14 19 24 | 4 9 14 19 24 - * 3 8 13 18 23 | 3 8 13 18 23 - * 2 7 12 17 22 | 2 9 12 17 22 - * 1 6 11 16 21 | 1 6 11 16 21 - * (Q3) (Q4) - * \endverbatim - * - * @return module number from 1 to 25 - */ - int imod() const; - - /** Gets the quadrant of the DetId. - * Quadrant number definition, x and y in std CMS coordinates, for EK+: - * - * \verbatim - * A y - * | - * Q2 | Q1 - * | - * ----------o---------> x - * | - * Q3 | Q4 - * | - * \endverbatim - * - * @return quadrant number - */ - int iquadrant() const ; - - /** Checks if module is in EK+ - * @return true for EK+, false for EK- - */ - bool positiveZ() const {return (zside()>0);} - - /** Gets a compact index for arrays - * @return compact index from 0 to kSizeForDenseIndexing-1 - */ - int hashedIndex() const; - - /** Same as hashedIndex() - * @return compact index from 0 to kSizeForDenseIndexing-1 - */ - uint32_t denseIndex() const { return hashedIndex(); } - - /** Checks validity of a dense/hashed index - * @param din dense/hashed index as returned by hashedIndex() or denseIndex() - * method - * @return true if index is valid, false otherwise - */ - static bool validDenseIndex(uint32_t din) { return validHashIndex(din); } - - /** Converts a hashed/dense index as defined in hashedIndex() and denseIndex() - * methods to a det id. - * @param din hashed/dense index - * @return det id - */ - static EKDetId detIdFromDenseIndex(uint32_t din) { return unhashIndex(din); } - - /** Gets a DetId from a compact index for arrays. Converse of hashedIndex() method. - * @param hi dense/hashed index - * @return det id - */ - static EKDetId unhashIndex( int hi ) ; - - /** Checks if a hashed/dense index is valid - * @see hashedIndex(), denseIndex() - * @param i hashed/dense index - * @return true if the index is valid, false otherwise - */ - static bool validHashIndex( int i ) { return ( i < kSizeForDenseIndexing ) ; } - - /** Checks validity of a module (SM,Module,fiber,RO,z) index. - * @param SM supermodule index - * @param Module module index - * @param fiber fiber index - * @param RO readout type - * @param iz module z-index - * @see EKDetId(int, int, int, int, int, int) for index definition - * @return true if valid, false otherwise - */ - static bool validDetId(int iSM, int iMD, int fib, int ro, int iz); - - /** Checks validity of a module (module_ix,module_iy,fiber,RO,z) index. - * @param module_ix module x-index - * @param module_iy module y-index - * @param fiber fiber index - * @param RO readout type - * @param iz module z-index - * @see EKDetId(int, int, int, int, int, int) for index definition - * @return true if valid, false otherwise - */ - bool slowValidDetId(int module_ix, int module_iy, int fib, int ro, int iz) const; - - static bool isNextToBoundary(EKDetId id); - - static bool isNextToDBoundary(EKDetId id); - - static bool isNextToRingBoundary(EKDetId id); - - /** returns a new EKDetId offset by nrStepsX and nrStepsY (can be negative), - * returns EKDetId(0) if invalid */ - EKDetId offsetBy(int nrStepsX, int nrStepsY) const; - - /** returns a new EKDetId swapped (same iX, iY) to the other endcap, - * returns EKDetId(0) if invalid (shouldnt happen) */ - EKDetId switchZSide() const; - - /** following are static member functions of the above two functions - * which take and return a DetId, returns DetId(0) if invalid - */ - static DetId offsetBy( const DetId startId, int nrStepsX, int nrStepsY ); - static DetId switchZSide( const DetId startId ); /** Returns the distance along x-axis in module units between two EKDetId * @param a det id of first module @@ -276,86 +100,8 @@ class EKDetId : public DetId { * @return distance */ static int distanceY(const EKDetId& a,const EKDetId& b); - - /** Lower bound of supermodule index as defined in ism() - */ - static const int ISM_MIN=1; - - /** Upper bound of supermodule index defined in ism() - */ - static const int ISM_MAX=936; - - /** Lower bound of module index within a supermodule - */ - static const int IMOD_MIN=1; - - /** Upper bound of module index within a supermodule - */ - static const int IMOD_MAX=25; - - /** Lower bound of EK module x-index - */ - static const int IX_MIN=1; - - /** Upper bound of EK module y-index - */ - static const int IX_MAX=180; - - /** Lower bound of EK module y-index - */ - static const int IY_MIN=1; - - /** Upper bound of EK module y-index - */ - static const int IY_MAX=180; - - /** Maximum possibility of Fiber number (0:FIB_MAX-1) - */ - static const int FIB_MAX=6; - - /** Maximum possibility of Read-Out type (0:RO_MAX-1) - */ - static const int RO_MAX=3; - - enum { - /** Number of modules per Dee - */ - kEKhalf = 421200 , - /** Number of dense module indices, that is number of - * modules per endcap. - */ - kSizeForDenseIndexing = 2*kEKhalf - }; - - /*@{*/ - /** function modes for EKDetId(int, int, int, int) constructor - */ - static const int XYMODE = 0; - static const int SCMODULEMODE = 1; - /*@}*/ - - /** Gives supermodule index from endcap *supermodule* x and y indexes. - * @see ism() for the index definition - * @param ismCol supermodule column number: supemodule x-index for EK+ - * @param ismRow: supemodule y-index - * @return supercystal index - */ - static int ism(int ismCol, int ismRow); // output is 1-936 - static int imod(int jx, int jy); - -private: - - static const int nCols = 18; - static const int nMods = 5; /* Number of modules per row in SM */ - static const int nRows = (nCols*nMods); - static const int QuadColLimits[nCols+1]; - static const int iYoffset[nCols+1]; - - int ix(int iSM, int iMod) const; - int iy(int iSM, int iMod) const; }; - std::ostream& operator<<(std::ostream& s,const EKDetId& id); #endif diff --git a/DataFormats/EcalDetId/src/EKDetId.cc b/DataFormats/EcalDetId/src/EKDetId.cc index 10e0206cdd129..d17ed0df3e21f 100644 --- a/DataFormats/EcalDetId/src/EKDetId.cc +++ b/DataFormats/EcalDetId/src/EKDetId.cc @@ -3,10 +3,6 @@ #include #include - -const int EKDetId::QuadColLimits[EKDetId::nCols+1] = { 0,13,27,40,54,70,87,104,120,136,151,166,180,193,205,215,225,232,234 }; - -const int EKDetId::iYoffset[EKDetId::nCols+1] = { 0, 5, 4, 4, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; EKDetId::EKDetId(int module_ix, int module_iy, int fiber, int ro, int iz) : DetId( Ecal, EcalShashlik) { @@ -14,153 +10,11 @@ EKDetId::EKDetId(int module_ix, int module_iy, int fiber, int ro, ((fiber&0x7)<<16) | ((ro&0x3)<<19) | ((iz>0)?(0x200000):(0)); } -EKDetId::EKDetId(int index1, int index2, int fiber, int ro, int iz, - int mode) : DetId(Ecal, EcalShashlik) { - - int module_ix(0), module_iy(0); - if (mode == XYMODE) { - module_ix = index1; - module_iy = index2; - } else if (mode == SCMODULEMODE) { - int supermodule = index1; - int module = index2; - // std::cout << "iz " << iz << " SM " << index1 << " module " << index2 << std::endl; - module_ix = ix(supermodule, module); - module_iy = iy(supermodule, module); - } else { - throw cms::Exception("InvalidDetId") << "EKDetId: Cannot create object. Unknown mode for (int, int, int, int, int, int) constructor."; - } - - if (!slowValidDetId(module_ix,module_iy,fiber,ro,iz)) { - throw cms::Exception("InvalidDetId") - << "EKDetId: Cannot create object. Indexes out of bounds \n" - << "x = " << module_ix << " y = " << module_iy << " fiber|ro " - << fiber << "|" << ro << " z = " << iz; - } - id_ |= (module_iy&0xff) | ((module_ix&0xff)<<8) | - ((fiber&0x7)<<16) | ((ro&0x3)<<19) | ((iz>0)?(0x200000):(0)); -} - void EKDetId::setFiber(int fib, int ro) { uint32_t idc = (id_ & 0xffe0ffff); id_ = (idc) | ((fib&0x7)<<16) | ((ro&0x3)<<19); } -int EKDetId::ism() const { - return ism((1 + (ix() - 1)/nMods), (1 + (iy() - 1)/nMods)); -} - -int EKDetId::imod() const { - return imod(ix(), iy()); -} - -int EKDetId::iquadrant() const { - if (ix()>nRows) { - if (iy()>nRows) return 1; - else return 4; - } else { - if (iy()>nRows) return 2; - else return 3; - } -} - -int EKDetId::hashedIndex() const { - int iSM = ism(); - int iMod = imod(); - int iFib = fiber(); - int iRO = readout(); - return ((positiveZ() ? kEKhalf : 0) + - ((((iSM-1)*IMOD_MAX+iMod-1)*FIB_MAX+iFib)*RO_MAX+iRO)); -} - -EKDetId EKDetId::unhashIndex(int hi) { - - if (validHashIndex(hi)) { - const int iz (hi= ISM_MIN && iSM <= ISM_MAX && iMD >= IMOD_MIN && - iMD <= IMOD_MAX && fib >= 0 && fib < FIB_MAX && - ro >= 0 && ro < RO_MAX && abs(iz) == 1); -} - -bool EKDetId::slowValidDetId(int jx, int jy, int fib, int ro, int iz) const { - int iSM = ism((1 + (jx - 1)/nMods), (1 + (jy - 1)/nMods)); - int iMD = imod(jx,jy); - return validDetId(iSM, iMD, fib, ro, iz); -} - -bool EKDetId::isNextToBoundary(EKDetId id) { - return isNextToDBoundary(id) || isNextToRingBoundary(id) ; -} - -bool EKDetId::isNextToDBoundary(EKDetId id) { - // hardcoded values for D boundary - return id.ix() == nRows || id.ix() == nRows+1 ; -} - -bool EKDetId::isNextToRingBoundary(EKDetId id) { - for (int i = -1; i <= 1; ++i) { - for (int j = -1; j <= 1; ++j) { - const int iSM(ism(id.ix()+i, id.iy()+j)); - const int iMD(imod(id.ix()+i, id.iy()+j)); - if ( !validDetId(iSM, iMD, id.fiber(), id.readout(), id.zside())) { - return true; - } - } - } - return false; -} - -EKDetId EKDetId::offsetBy(int nrStepsX, int nrStepsY ) const { - int newX = ix() + nrStepsX; - int newY = iy() + nrStepsY; - - if (slowValidDetId(newX, newY, fiber(), readout(), zside())) { - return EKDetId(newX, newY, fiber(), readout(), zside()); - } else { - return EKDetId(0); - } -} - -EKDetId EKDetId::switchZSide() const { - int newZSide = -1 * zside(); - if(slowValidDetId(ix(), iy(), fiber(), readout(), newZSide)) { - return EKDetId( ix(), iy(), fiber(), readout(), newZSide); - } else { - return EKDetId(0); - } -} - -DetId EKDetId::offsetBy(const DetId startId, int nrStepsX, int nrStepsY ) { - if (startId.det() == DetId::Ecal && startId.subdetId() == EcalShashlik) { - EKDetId eeStartId(startId); - return eeStartId.offsetBy(nrStepsX, nrStepsY).rawId(); - } else { - return DetId(0); - } -} - -DetId EKDetId::switchZSide(const DetId startId) { - if (startId.det() == DetId::Ecal && startId.subdetId() == EcalShashlik) { - EKDetId eeStartId(startId); - return eeStartId.switchZSide().rawId(); - } else { - return DetId(0); - } -} - int EKDetId::distanceX(const EKDetId& a,const EKDetId& b) { return abs(a.ix()-b.ix()); } @@ -169,137 +23,6 @@ int EKDetId::distanceY(const EKDetId& a,const EKDetId& b) { return abs(a.iy() - b.iy()); } -int EKDetId::ism(int ismCol, int ismRow) { - - if (0 < ismCol && 2*nCols >= ismCol && 0 < ismRow && 2*nCols >= ismRow) { - const int iquad ((nCols=ismCol && nCols=ismCol && nCols>=ismRow ? 3 : 4)))); - - const int iCol = (1 == iquad || 4 == iquad ? ismCol - nCols : nCols+1 - ismCol); - const int iRow = (1 == iquad || 2 == iquad ? ismRow - nCols : nCols+1 - ismRow ) ; - - static int nSMinQuadrant = ISM_MAX/4; - const int yOff (iYoffset[iCol]); - const int qOff (nSMinQuadrant*(iquad - 1)); - - const int ismOne (QuadColLimits[iCol-1] + iRow - yOff); - return (yOff >= iRow ? -1 : - (QuadColLimits[iCol] < ismOne ? -2 : ismOne + qOff)) ; - } else { - return -3 ; // bad inputs - } -} - -int EKDetId::imod(int jx, int jy) { - /* - * Return module number from (x,y) coordinates. - * - * Input : ix, iy - (x,y) position of module - */ - const int iquad ((jx>nRows) ? ((jy>nRows) ? 1 : 4) : ((jy>nRows) ? 2 : 3)); - const int imodCol(((iquad == 1 || iquad == 4)) ? (jx-nRows-1)%nMods : - (jx-1)%nMods); - const int imodRow(((iquad == 1 || iquad == 2)) ? (jy-nRows-1)%nMods : - (jy-1)%nMods); - return (5*imodCol + imodRow + 1); -} - -int EKDetId::ix(int iSM, int iMod) const { - /* - * ix() return individual module x-coordinate - * - * Input : iSM, iMod - SuperModule and module ids - */ - - int nSMinQuadrant = QuadColLimits[nCols]; - if (iSM > 4*nSMinQuadrant || iSM < 1) { - throw cms::Exception("InvalidDetId") << "EKDetId::ix() called with wrong arguments SM/Module " << iSM << ":" << iMod; - } - - // Map SC number into (x>0,y>0) quadrant. - int iSMmap, iqx,iq; - if (iSM > 3*nSMinQuadrant) { - iSMmap = iSM - 3*nSMinQuadrant; - iqx = 1; - iq = 4; - } else if (iSM > 2*nSMinQuadrant) { - iSMmap = iSM - 2*nSMinQuadrant; - iqx =-1; - iq = 3; - } else if (iSM > nSMinQuadrant) { - iSMmap = iSM - nSMinQuadrant; - iqx =-1; - iq = 2; - } else { - iSMmap = iSM; - iqx = 1; - iq = 1; - } - - // Decide which column the SC is in - int iCol = 0 ; - while (iSMmap > QuadColLimits[iCol++]) ; - iCol-- ; - - int ixMod = IX_MAX/2; - if (iq == 1 || iq == 4) { - ixMod += iqx*(5*(iCol-1)) + (int)(iMod+4)/5; - } else { - ixMod += iqx*(5*iCol) + (int)(iMod+4)/5; - } - // returning a value from 1 to 180 - return ixMod; -} - -int EKDetId::iy(int iSM, int iMod) const { - /* - * iy() return individual module y-coordinate - * - * Input : iSM, iMod - Supermodule and module ids - */ - - int nSMinQuadrant = QuadColLimits[nCols]; - if (iSM > 4*nSMinQuadrant || iSM < 1) { - throw cms::Exception("InvalidDetId") << "EKDetId::iy() called with wrong arguments SM/Module " << iSM << ":" << iMod; - } - - // Map SC number into (x>0,y>0) quadrant - int iSMmap, iqy, iq; - if (iSM > 3*nSMinQuadrant) { - iSMmap = iSM - 3*nSMinQuadrant; - iqy =-1; - iq = 4; - } else if (iSM > 2*nSMinQuadrant) { - iSMmap = iSM - 2*nSMinQuadrant; - iqy =-1; - iq = 3; - } else if (iSM > nSMinQuadrant) { - iSMmap = iSM - nSMinQuadrant; - iqy = 1; - iq = 2; - } else { - iSMmap = iSM; - iqy = 1; - iq = 1; - } - - // Decide which column the SM is in - int iCol = 0; - while (iSMmap > QuadColLimits[iCol++]) ; - iCol--; - - int iSMy = iSMmap - QuadColLimits[iCol-1] + iYoffset[iCol]; - - int iyMod = IY_MAX/2; - if (iq == 3 || iq == 4) { - iyMod += iqy*(5*iSMy) + (iMod-1)%5 + 1; - } else { - iyMod += iqy*(5*(iSMy-1)) + (iMod-1)%5 + 1; - } - return iyMod; -} - #include std::ostream& operator<<(std::ostream& s,const EKDetId& id) { return s << "(EK iz " << ((id.zside()>0)?("+ "):("- ")) << " fiber " diff --git a/DataFormats/EcalDetId/test/BuildFile.xml b/DataFormats/EcalDetId/test/BuildFile.xml index 427a8779a3ef6..4ba2ac8d37804 100644 --- a/DataFormats/EcalDetId/test/BuildFile.xml +++ b/DataFormats/EcalDetId/test/BuildFile.xml @@ -6,8 +6,6 @@ - - diff --git a/DataFormats/EcalDetId/test/printEKDetId.cpp b/DataFormats/EcalDetId/test/printEKDetId.cpp deleted file mode 100644 index 042eb3ca8a5eb..0000000000000 --- a/DataFormats/EcalDetId/test/printEKDetId.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// prints EKDetId mappings for humans to check over - -#include -#include -#include -#include - -#include "DataFormats/EcalDetId/interface/EKDetId.h" - -std::ostream& pcenter(unsigned w, std::string s){ - int pad = ((int)w - (int)s.size()) / 2; - // if(pad<0) pad = 0; - for(int i = 0; i < pad; ++i) std::cout << " "; - std::cout << s; - for(int i = pad + s.size(); i < (int)w; ++i) std::cout << " "; - return std::cout; -} - -int main(int argc, char* argv[]) { - const int colsize = 8; -#define COL std::cout << std::setw(colsize) - - std::cout << std::right; - pcenter(5*(colsize+1)-1, "input") << "|"; - pcenter(12*(colsize+1), "detid") << "|"; - pcenter(4*(colsize+1), "detid->(ix,iy,fib,ro,iz)->detid") << "\n"; - - //input - COL << "ism" << " "; - COL << "im" << " "; - COL << "fib" << " "; - COL << "ro" << " "; - COL << "iz" << "|"; - - //detId - COL << "ix" << " "; - COL << "iy" << " "; - COL << "fib" << " "; - COL << "ro" << " "; - COL << "zside" << " "; - COL << "iquad" << " "; - COL << "Z" << " "; - COL << "hash_ind" << " "; - COL << "hash_chk" << " "; - COL << "dense_ind" << " "; - COL << "ism" << " "; - COL << "im" << "|"; - - //detid->isc,ic->detid - COL << "ix" << " "; - COL << "iy" << " "; - COL << "iz" << " "; - COL << "iscic_chk" << "\n"; - - - try { - for(int iz = -1 ; iz <= 1; iz += 2){ - COL << "========== " << (iz>0 ? "EK+" : "EK-" ) << " ========== \n"; - for(int ism = 1; ism <= 1000; ++ism) { - for(int im = 1; im <= 30; ++im) { - for(int fib = 0; fib <= 1; ++fib) { - for(int ro = 0; ro <= 1; ++ro) { - if(!EKDetId::validDetId(ism,im,fib,ro,iz)) continue; - - //input - COL << ism << " "; - COL << im << " "; - COL << fib << " "; - COL << ro << " "; - COL << iz << " "; - //detid - EKDetId id(ism,im,fib,ro,iz,EKDetId::SCMODULEMODE) ; - COL << id.ism() << (ism != id.ism() ? "!!!" : "") << " "; - COL << id.imod() << (im != id.imod() ? "!!!" : "") << " "; - COL << id.fiber() << (fib != id.fiber() ? "!!!" : "") << " "; - COL << id.readout() << (ro != id.readout() ? "!!!" : "") << " "; - COL << id.zside() << (iz != id.zside() ? "!!!" : "") << " "; - COL << id.iquadrant() << " "; - COL << (id.positiveZ() ? "z+" : "z-") << (id.positiveZ() != (iz > 0) ? "!!!" : "" ) << " "; - - //hashed index - int ih = id.hashedIndex() ; - COL << ih << " "; - if(!EKDetId::validHashIndex(ih) || EKDetId::unhashIndex(ih)!=id || EKDetId::unhashIndex(ih).rawId() != id.rawId()){ - COL << "ERR!!!" << " "; - } else{ - COL << "OK" << " "; - } - - COL << id.denseIndex() << (id.denseIndex() != (uint32_t)ih ? "!!!" : "") << " "; - - //IXY - const int ix = id.ix(); - COL << ix << " "; - const int iy = id.iy(); - COL << iy << " "; - EKDetId id1(ix, iy, fib, ro, iz); - COL << id1.ix() << (id1.ix()!=ix ? "!!!" : "") << " "; - COL << id1.iy() << (id1.iy()!=iy ? "!!!" : "") << " "; - COL << id1.zside() << (id1.zside()!=iz ? "!!!" : "") << " "; - if(id!=id1 || id.rawId()!=id1.rawId()){ - COL << "ERR!!!" << " "; - } else{ - COL << "OK" << " "; - } - COL << "\n"; - } //next ro - } // next fiber - } //next im - } //next ism - } //next iz - } catch (std::exception &e) { - std::cerr << e.what(); - } -} diff --git a/SimG4CMS/Calo/BuildFile.xml b/SimG4CMS/Calo/BuildFile.xml index 0f155561bd06f..6bf0ec9274836 100644 --- a/SimG4CMS/Calo/BuildFile.xml +++ b/SimG4CMS/Calo/BuildFile.xml @@ -12,6 +12,7 @@ + diff --git a/SimG4CMS/Calo/interface/ShashlikSD.h b/SimG4CMS/Calo/interface/ShashlikSD.h index cee0ac5694b97..a46eaf2f75bb7 100644 --- a/SimG4CMS/Calo/interface/ShashlikSD.h +++ b/SimG4CMS/Calo/interface/ShashlikSD.h @@ -11,6 +11,7 @@ #include "DetectorDescription/Core/interface/DDsvalues.h" #include "DataFormats/DetId/interface/DetId.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/HGCalCommonData/interface/ShashlikDDDConstants.h" #include "G4String.hh" @@ -28,7 +29,7 @@ class ShashlikSD : public CaloSD { public: ShashlikSD(G4String, const DDCompactView &, SensitiveDetectorCatalog &, - edm::ParameterSet const & p, const SimTrackManager*); + edm::ParameterSet const &, const SimTrackManager*); virtual ~ShashlikSD(); virtual bool ProcessHits(G4Step*, G4TouchableHistory*); virtual double getEnergyDeposit(G4Step*); @@ -42,6 +43,7 @@ class ShashlikSD : public CaloSD { std::vector getDDDArray(const std::string&, const DDsvalues_type&); + ShashlikDDDConstants* sdc; bool useWeight, useAtt, useBirk; double birk1, birk2, birk3, attL, moduleL; int roType; diff --git a/SimG4CMS/Calo/src/ShashlikSD.cc b/SimG4CMS/Calo/src/ShashlikSD.cc index b6ad3252cb51d..4e4a58a94448f 100644 --- a/SimG4CMS/Calo/src/ShashlikSD.cc +++ b/SimG4CMS/Calo/src/ShashlikSD.cc @@ -80,6 +80,8 @@ ShashlikSD::ShashlikSD(G4String name, const DDCompactView & cpv, << " correct for attenuation " << useAtt << " using " << attL; + sdc = new ShashlikDDDConstants(cpv); + //Length of fiber for each layer std::string attribute = "ReadOutName"; DDSpecificsFilter filter; @@ -208,6 +210,7 @@ uint32_t ShashlikSD::setDetUnitId(G4Step *aStep) { int module = touch->GetReplicaNumber(1); int ism = touch->GetReplicaNumber(2); int iz = ((aStep->GetPreStepPoint()->GetPosition()).z() > 0) ? 1 : -1; + std::pair ixy = sdc->getXY(ism,module); #ifdef DebugLog int theSize = touch->GetHistoryDepth()+1; std::cout << "ShaslikSD:: ISM|Module|IZ " << ism << ":" << module << ":" @@ -217,7 +220,7 @@ uint32_t ShashlikSD::setDetUnitId(G4Step *aStep) { << "(" << touch->GetReplicaNumber(ii) << ")"; std::cout << std::endl; #endif - return EKDetId(ism,module,0,0,iz,EKDetId::SCMODULEMODE).rawId(); + return EKDetId(ixy.first,ixy.second,0,0,iz).rawId(); } G4double ShashlikSD::fiberWt(G4int k, G4ThreeVector localPoint) { diff --git a/SimG4CMS/Calo/test/python/runShashlik_cfg.py b/SimG4CMS/Calo/test/python/runShashlik_cfg.py index 152a711445057..6b4c68086e311 100644 --- a/SimG4CMS/Calo/test/python/runShashlik_cfg.py +++ b/SimG4CMS/Calo/test/python/runShashlik_cfg.py @@ -8,6 +8,7 @@ process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") process.load("SimG4CMS.Calo.HFPMTHitAnalyzer_cfi") +process.load("Geometry.HGCalCommonData.shashlikNumberingInitialization_cfi") process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring('cout'), From d3b887dd1839c9e9957d1fd7671946337beeeca2 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Mon, 24 Mar 2014 09:47:08 +0100 Subject: [PATCH 3/3] Add the approrpriate xml in cfis --- .../Geometry/python/GeometryExtended2023SHCal4Eta_cff.py | 2 ++ .../Geometry/python/GeometryExtended2023SHCalRebuild_cff.py | 1 + Configuration/Geometry/python/GeometryExtended2023SHCal_cff.py | 1 + .../Geometry/python/GeometrySimECALHCALPhaseII_cff.py | 3 +-- .../python/cmsExtendedGeometry2023SHCal4EtaXML_cfi.py | 1 + .../python/cmsExtendedGeometry2023SHCalNoTaperXML_cfi.py | 1 + .../python/cmsExtendedGeometry2023SHCalRebuildXML_cfi.py | 1 + .../python/cmsExtendedGeometry2023SHCalXML_cfi.py | 1 + .../CMSCommonData/python/ecalhcalPhaseIIGeometryXML_cfi.py | 1 + 9 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Configuration/Geometry/python/GeometryExtended2023SHCal4Eta_cff.py b/Configuration/Geometry/python/GeometryExtended2023SHCal4Eta_cff.py index 889abe649f670..f4f2aae50e512 100644 --- a/Configuration/Geometry/python/GeometryExtended2023SHCal4Eta_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023SHCal4Eta_cff.py @@ -2,3 +2,5 @@ from Geometry.CMSCommonData.cmsExtendedGeometry2023SHCal4EtaXML_cfi import * from Geometry.TrackerNumberingBuilder.trackerNumberingSLHCGeometry_cfi import * +from Geometry.HcalCommonData.hcalSimNumberingInitialization_cfi import * +from Geometry.HGCalCommonData.shashlikNumberingInitialization_cfi import * diff --git a/Configuration/Geometry/python/GeometryExtended2023SHCalRebuild_cff.py b/Configuration/Geometry/python/GeometryExtended2023SHCalRebuild_cff.py index 450a66c09bbba..04f455056c995 100644 --- a/Configuration/Geometry/python/GeometryExtended2023SHCalRebuild_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023SHCalRebuild_cff.py @@ -3,6 +3,7 @@ from Geometry.CMSCommonData.cmsExtendedGeometry2023SHCalRebuildXML_cfi import * from Geometry.TrackerNumberingBuilder.trackerNumberingSLHCGeometry_cfi import * from Geometry.HcalCommonData.hcalSimNumberingInitialization_cfi import * +from Geometry.HGCalCommonData.shashlikNumberingInitialization_cfi import * # Reconstruction geometry services # Tracking Geometry diff --git a/Configuration/Geometry/python/GeometryExtended2023SHCal_cff.py b/Configuration/Geometry/python/GeometryExtended2023SHCal_cff.py index f9e644e6804aa..3af814f02870d 100644 --- a/Configuration/Geometry/python/GeometryExtended2023SHCal_cff.py +++ b/Configuration/Geometry/python/GeometryExtended2023SHCal_cff.py @@ -3,3 +3,4 @@ from Geometry.CMSCommonData.cmsExtendedGeometry2023SHCalXML_cfi import * from Geometry.TrackerNumberingBuilder.trackerNumberingSLHCGeometry_cfi import * from Geometry.HcalCommonData.hcalSimNumberingInitialization_cfi import * +from Geometry.HGCalCommonData.shashlikNumberingInitialization_cfi import * diff --git a/Configuration/Geometry/python/GeometrySimECALHCALPhaseII_cff.py b/Configuration/Geometry/python/GeometrySimECALHCALPhaseII_cff.py index 95120b3cc9f36..5178606471b02 100644 --- a/Configuration/Geometry/python/GeometrySimECALHCALPhaseII_cff.py +++ b/Configuration/Geometry/python/GeometrySimECALHCALPhaseII_cff.py @@ -3,5 +3,4 @@ # Ideal geometry for ECAL+HCAL, needed for simulation from Geometry.CMSCommonData.ecalhcalPhaseIIGeometryXML_cfi import * from Geometry.HcalCommonData.hcalSimNumberingInitialization_cfi import * - - +from Geometry.HGCalCommonData.shashlikNumberingInitialization_cfi import * diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCal4EtaXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCal4EtaXML_cfi.py index c13ff5ed40348..bab0f973fca29 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCal4EtaXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCal4EtaXML_cfi.py @@ -104,6 +104,7 @@ 'Geometry/TrackerCommonData/data/PhaseII/BarrelEndcap5D/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseII/BarrelEndcap5D/trackersens.xml', 'Geometry/TrackerRecoData/data/PhaseII/BarrelEndcap5D/trackerRecoMaterial.xml', + 'Geometry/HGCalCommonData/data/shashlikConstEta4.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HGCalSimData/data/shashliksens.xml', 'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalsenspmf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalNoTaperXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalNoTaperXML_cfi.py index b14560dd1bc40..25d71053327f2 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalNoTaperXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalNoTaperXML_cfi.py @@ -103,6 +103,7 @@ 'Geometry/TrackerCommonData/data/PhaseII/BarrelEndcap5D/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseII/BarrelEndcap5D/trackersens.xml', 'Geometry/TrackerRecoData/data/PhaseII/BarrelEndcap5D/trackerRecoMaterial.xml', + 'Geometry/HGCalCommonData/data/NoTaper/shashlikConstEta3.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HGCalSimData/data/shashliksens.xml', 'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalsenspmf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalRebuildXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalRebuildXML_cfi.py index 92cd0fdef29a6..6f2b38d858624 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalRebuildXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalRebuildXML_cfi.py @@ -103,6 +103,7 @@ 'Geometry/TrackerCommonData/data/PhaseII/BarrelEndcap5D/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseII/BarrelEndcap5D/trackersens.xml', 'Geometry/TrackerRecoData/data/PhaseII/BarrelEndcap5D/trackerRecoMaterial.xml', + 'Geometry/HGCalCommonData/data/shashlikConstEta3.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HGCalSimData/data/shashliksens.xml', 'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalsenspmf.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalXML_cfi.py index 92cd0fdef29a6..6f2b38d858624 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalXML_cfi.py @@ -103,6 +103,7 @@ 'Geometry/TrackerCommonData/data/PhaseII/BarrelEndcap5D/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseII/BarrelEndcap5D/trackersens.xml', 'Geometry/TrackerRecoData/data/PhaseII/BarrelEndcap5D/trackerRecoMaterial.xml', + 'Geometry/HGCalCommonData/data/shashlikConstEta3.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HGCalSimData/data/shashliksens.xml', 'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalsenspmf.xml', diff --git a/Geometry/CMSCommonData/python/ecalhcalPhaseIIGeometryXML_cfi.py b/Geometry/CMSCommonData/python/ecalhcalPhaseIIGeometryXML_cfi.py index 1b8b016fa50b9..0ef38adaaa9ee 100644 --- a/Geometry/CMSCommonData/python/ecalhcalPhaseIIGeometryXML_cfi.py +++ b/Geometry/CMSCommonData/python/ecalhcalPhaseIIGeometryXML_cfi.py @@ -36,6 +36,7 @@ 'Geometry/HcalCommonData/data/PhaseII/hcalRecNumbering.xml', 'Geometry/ForwardCommonData/data/v2/forwardshield.xml', 'Geometry/ForwardCommonData/data/forward.xml', + 'Geometry/HGCalCommonData/data/shashlikConstEta3.xml', 'Geometry/EcalSimData/data/PhaseII/ecalsens.xml', 'Geometry/HcalSimData/data/CaloUtil.xml', 'Geometry/HcalCommonData/data/Phase0/hcalsenspmf.xml',