diff --git a/Configuration/Geometry/python/GeometryRecoECALHCAL_cff.py b/Configuration/Geometry/python/GeometryRecoECALHCAL_cff.py index bf94f1e88e2fd..8cc6f1750fa5e 100644 --- a/Configuration/Geometry/python/GeometryRecoECALHCAL_cff.py +++ b/Configuration/Geometry/python/GeometryRecoECALHCAL_cff.py @@ -6,6 +6,7 @@ from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import * from Geometry.EcalMapping.EcalMapping_cfi import * from Geometry.EcalMapping.EcalMappingRecord_cfi import * +from Geometry.HcalCommonData.hcalRecNumberingInitialization_cfi import * diff --git a/Configuration/Geometry/python/GeometrySimECALHCAL_cff.py b/Configuration/Geometry/python/GeometrySimECALHCAL_cff.py index 9b1ad7f77de9f..d22523839a931 100644 --- a/Configuration/Geometry/python/GeometrySimECALHCAL_cff.py +++ b/Configuration/Geometry/python/GeometrySimECALHCAL_cff.py @@ -2,8 +2,6 @@ # Ideal geometry for ECAL+HCAL, needed for simulation from Geometry.CMSCommonData.ecalhcalGeometryXML_cfi import * - - - +from Geometry.HcalCommonData.hcalSimNumberingInitialization_cfi import * diff --git a/DataFormats/ForwardDetId/interface/CFCDetId.h b/DataFormats/ForwardDetId/interface/CFCDetId.h index a9c5dd78af8de..35367bac41d48 100644 --- a/DataFormats/ForwardDetId/interface/CFCDetId.h +++ b/DataFormats/ForwardDetId/interface/CFCDetId.h @@ -12,8 +12,8 @@ class CFCDetId : public DetId { CFCDetId(); /** Create cellid from raw id (0=invalid tower id) */ CFCDetId(uint32_t rawid); - /** Constructor from subdetector, signed ieta,iphi, depth and type */ - CFCDetId(ForwardSubdetector subdet, int ieta, int iphi, int depth, int type); + /** Constructor from subdetector, module, signed ieta, signed iphi, depth and type */ + CFCDetId(ForwardSubdetector subdet, int module, int ieta, int iphi, int depth, int type); /** Constructor from a generic cell id */ CFCDetId(const DetId& id); /** Assignment from a generic cell id */ @@ -22,13 +22,16 @@ class CFCDetId : public DetId { /// get the subdetector ForwardSubdetector subdet() const { return (ForwardSubdetector)(subdetId()); } /// get the z-side of the cell (1/-1) - int zside() const { return (id_&0x1000000)?(1):(-1); } + int zside() const { return (id_&0x80000)?(1):(-1); } /// get the absolute value of the cell ieta - int ietaAbs() const { return (id_>>10)&0x3FF; } + int ietaAbs() const { return (id_>>11)&0xFF; } /// get the cell ieta int ieta() const { return zside()*ietaAbs(); } + /// get the module # + int module() const { return (id_>>6)&0x1F; } /// get the cell iphi - int iphi() const { return id_&0x3FF; } + int signPhi() const { return (id_&0x20)?(1):(-1); } + int iphi() const { return (id_&0x1F)*signPhi(); } /// get the tower depth int depth() const { return (id_>>21)&0x7; } /// get the fibre type diff --git a/DataFormats/ForwardDetId/interface/ForwardSubdetector.h b/DataFormats/ForwardDetId/interface/ForwardSubdetector.h index 83af7f8b91048..59b17549207f7 100644 --- a/DataFormats/ForwardDetId/interface/ForwardSubdetector.h +++ b/DataFormats/ForwardDetId/interface/ForwardSubdetector.h @@ -1,6 +1,6 @@ #ifndef DataFormats_ForwardDetId_ForwardSubDetector_H #define DataFormats_ForwardDetId_ForwardSubDetector_H 1 -enum ForwardSubdetector { ForwardEmpty=0, ForwardCFC=1, ForwardBHM=2, HGCEE=3, HGCHE=4}; +enum ForwardSubdetector { ForwardEmpty=0, CFC=1, BHM=2, HGCEE=3, HGCHE=4}; #endif diff --git a/DataFormats/ForwardDetId/interface/HGCEEDetId.h b/DataFormats/ForwardDetId/interface/HGCEEDetId.h index 4f8c2f20096e6..7fc3f6aa8ed04 100644 --- a/DataFormats/ForwardDetId/interface/HGCEEDetId.h +++ b/DataFormats/ForwardDetId/interface/HGCEEDetId.h @@ -14,8 +14,7 @@ class HGCEEDetId : public DetId { /** Create cellid from raw id (0=invalid tower id) */ HGCEEDetId(uint32_t rawid); /** Constructor from subdetector, zplus, layer, module, cell numbers */ - HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, - int cellx, int celly); + HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, int cell); /** Constructor from a generic cell id */ HGCEEDetId(const DetId& id); /** Assignment from a generic cell id */ @@ -26,12 +25,11 @@ class HGCEEDetId : public DetId { /// get the z-side of the cell (1/-1) int zside() const { return (id_&0x1000000)?(1):(-1); } /// get the absolute value of the cell #'s in x and y - int cellX() const { return (id_>>6)&0x3F; } - int cellY() const { return id_&0x3F; } + int cell() const { return id_&0x7FFF; } /// get the module # - int module() const { return (id_>>12)&0x3F; } + int module() const { return (id_>>14)&0x1F; } /// get the layer # - int layer() const { return (id_>>18)&0x3F; } + int layer() const { return (id_>>19)&0x1F; } static const HGCEEDetId Undefined; diff --git a/DataFormats/ForwardDetId/src/CFCDetId.cc b/DataFormats/ForwardDetId/src/CFCDetId.cc index 2baf0f4c5e14d..67b5b727c43d1 100644 --- a/DataFormats/ForwardDetId/src/CFCDetId.cc +++ b/DataFormats/ForwardDetId/src/CFCDetId.cc @@ -1,8 +1,8 @@ #include "DataFormats/ForwardDetId/interface/CFCDetId.h" #include "FWCore/Utilities/interface/Exception.h" -#include +#include -const CFCDetId CFCDetId::Undefined(ForwardEmpty,0,0,0,0); +const CFCDetId CFCDetId::Undefined(ForwardEmpty,0,0,0,0,0); CFCDetId::CFCDetId() : DetId() { } @@ -10,18 +10,19 @@ CFCDetId::CFCDetId() : DetId() { CFCDetId::CFCDetId(uint32_t rawid) : DetId(rawid) { } -CFCDetId::CFCDetId(ForwardSubdetector subdet, int ieta, int iphi, int depth, - int type) : DetId(Forward,subdet) { +CFCDetId::CFCDetId(ForwardSubdetector subdet, int module, int ieta, int iphi, + int depth, int type) : DetId(Forward,subdet) { + // (no checking at this point!) - id_ |= ((depth&0x7)<<21) | ((type&0x1)<20) | - ((ieta>0)?(0x1000000|((ieta&0x3FF)<<10)):(((-ieta)&0x3FF)<<10)) | - (iphi&0x3FF); + id_ |= ((depth&0x7)<<21) | ((type&0x1)<<20) | + ((ieta>0)?(0x80000|((ieta&0xFF)<<11)):(((-ieta)&0xFF)<<11)) | + ((module&0x1F)<<6) | ((iphi>0)?(0x20|(iphi&0x1F)):((-iphi&0x1F))); } CFCDetId::CFCDetId(const DetId& gen) { if (!gen.null()) { ForwardSubdetector subdet=(ForwardSubdetector(gen.subdetId())); - if (gen.det()!=Forward || (subdet!=ForwardCFC)) { + if (gen.det()!=Forward || (subdet!=CFC)) { throw cms::Exception("Invalid DetId") << "Cannot initialize CFCDetId from " << std::hex << gen.rawId() << std::dec; } } @@ -31,7 +32,7 @@ CFCDetId::CFCDetId(const DetId& gen) { CFCDetId& CFCDetId::operator=(const DetId& gen) { if (!gen.null()) { ForwardSubdetector subdet=(ForwardSubdetector(gen.subdetId())); - if (gen.det()!=Forward || (subdet!=ForwardCFC)) { + if (gen.det()!=Forward || (subdet!=CFC)) { throw cms::Exception("Invalid DetId") << "Cannot assign CFCDetId from " << std::hex << gen.rawId() << std::dec; } } @@ -41,7 +42,7 @@ CFCDetId& CFCDetId::operator=(const DetId& gen) { std::ostream& operator<<(std::ostream& s,const CFCDetId& id) { switch (id.subdet()) { - case(ForwardCFC) : return s << "(CFC " << id.ieta() << ',' << id.iphi() << ',' << id.depth() << ',' << id.type() << ')'; + case(CFC) : return s << "(CFC " << id.ieta() << ',' << id.module() << ',' << id.iphi() << ',' << id.depth() << ',' << id.type() << ')'; default : return s << id.rawId(); } } diff --git a/DataFormats/ForwardDetId/src/HGCEEDetId.cc b/DataFormats/ForwardDetId/src/HGCEEDetId.cc index 4ccabfdec598e..539c77e607545 100644 --- a/DataFormats/ForwardDetId/src/HGCEEDetId.cc +++ b/DataFormats/ForwardDetId/src/HGCEEDetId.cc @@ -2,7 +2,7 @@ #include "FWCore/Utilities/interface/Exception.h" #include -const HGCEEDetId HGCEEDetId::Undefined(ForwardEmpty,0,0,0,0,0); +const HGCEEDetId HGCEEDetId::Undefined(ForwardEmpty,0,0,0,0); HGCEEDetId::HGCEEDetId() : DetId() { } @@ -11,10 +11,10 @@ HGCEEDetId::HGCEEDetId(uint32_t rawid) : DetId(rawid) { } HGCEEDetId::HGCEEDetId(ForwardSubdetector subdet, int zp, int lay, int mod, - int cellx, int celly) : DetId(Forward,subdet) { + int cell) : DetId(Forward,subdet) { // (no checking at this point!) - id_ |= (((zp>0) ? 0x1000000 : 0) | ((lay&0x3F)<<18) | ((mod&0x3F)<12) | - ((cellx&0x3F)<<6) | (celly&0x3F)); + id_ |= (((zp>0) ? 0x1000000 : 0) | ((lay&0x1F)<<19) | ((mod&0x1F)<14) | + (cell&0x7FFF)); } HGCEEDetId::HGCEEDetId(const DetId& gen) { @@ -40,7 +40,7 @@ HGCEEDetId& HGCEEDetId::operator=(const DetId& gen) { std::ostream& operator<<(std::ostream& s,const HGCEEDetId& id) { switch (id.subdet()) { - case(HGCEE) : return s << "(HGCEE " << id.zside() << ',' << id.layer() << ',' << id.module() << ',' << id.cellX() << ',' << id.cellY() << ')'; + case(HGCEE) : return s << "(HGCEE " << id.zside() << ',' << id.layer() << ',' << id.module() << ',' << id.cell() << ')'; default : return s << id.rawId(); } } diff --git a/Geometry/CMSCommonData/data/PhaseII/caloBase.xml b/Geometry/CMSCommonData/data/PhaseII/caloBase.xml index 2c5e2c6dffaa0..0e511f15757f1 100644 --- a/Geometry/CMSCommonData/data/PhaseII/caloBase.xml +++ b/Geometry/CMSCommonData/data/PhaseII/caloBase.xml @@ -1,28 +1,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2019PFCalXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2019PFCalXML_cfi.py index 96144b9ab261f..9b3d6118f9c09 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2019PFCalXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2019PFCalXML_cfi.py @@ -15,6 +15,7 @@ 'Geometry/CMSCommonData/data/cmsMuon.xml', 'Geometry/CMSCommonData/data/mgnt.xml', 'Geometry/CMSCommonData/data/PhaseI/beampipe.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', 'Geometry/CMSCommonData/data/cmsBeam.xml', 'Geometry/CMSCommonData/data/muonMB.xml', 'Geometry/CMSCommonData/data/muonMagnet.xml', @@ -205,13 +206,6 @@ 'Geometry/EcalCommonData/data/ebrot.xml', 'Geometry/EcalCommonData/data/eecon.xml', 'Geometry/EcalCommonData/data/ectkcable.xml', - ## 'Geometry/EcalCommonData/data/eefixed.xml', - ## 'Geometry/EcalCommonData/data/eehier.xml', - ## 'Geometry/EcalCommonData/data/eealgo.xml', - ## 'Geometry/EcalCommonData/data/escon.xml', - ## 'Geometry/EcalCommonData/data/esalgo.xml', - ## 'Geometry/EcalCommonData/data/eeF.xml', - ## 'Geometry/EcalCommonData/data/eeB.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/PhaseII/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalcablealgo.xml', @@ -231,7 +225,8 @@ 'Geometry/MuonCommonData/data/design/muonYoke.xml', 'Geometry/MuonCommonData/data/v2/mf.xml', 'Geometry/MuonCommonData/data/v2/rpcf.xml', - 'Geometry/MuonCommonData/data/v4/gemf.xml', + 'Geometry/MuonCommonData/data/v2/gemf.xml', + 'Geometry/MuonCommonData/data/v5/gem11.xml', 'Geometry/MuonCommonData/data/v2/csc.xml', 'Geometry/MuonCommonData/data/v2/mfshield.xml', 'Geometry/ForwardCommonData/data/forward.xml', @@ -252,7 +247,6 @@ 'Geometry/ForwardCommonData/data/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml')+cms.vstring( 'Geometry/MuonCommonData/data/v2/muonNumbering.xml', - 'Geometry/MuonCommonData/data/v2/muonGemNumbering.xml', 'Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseI/trackersens.xml', 'Geometry/TrackerRecoData/data/PhaseI/trackerRecoMaterial.xml', @@ -273,10 +267,9 @@ 'Geometry/ForwardSimData/data/zdcsens.xml', 'Geometry/HcalSimData/data/HcalProdCuts.xml', 'Geometry/EcalSimData/data/EcalProdCuts.xml', - ## 'Geometry/EcalSimData/data/ESProdCuts.xml', 'Geometry/TrackerSimData/data/PhaseI/trackerProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/MuonSimData/data/muonProdCuts.xml', + 'Geometry/MuonSimData/data/v2/muonProdCuts.xml', 'Geometry/ForwardSimData/data/CastorProdCuts.xml', 'Geometry/ForwardSimData/data/zdcProdCuts.xml', 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2019XML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2019XML_cfi.py index e00e861c79ac0..237897a6262fd 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2019XML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2019XML_cfi.py @@ -230,7 +230,8 @@ 'Geometry/MuonCommonData/data/design/muonYoke.xml', 'Geometry/MuonCommonData/data/v2/mf.xml', 'Geometry/MuonCommonData/data/v2/rpcf.xml', - 'Geometry/MuonCommonData/data/v5/gemf.xml', + 'Geometry/MuonCommonData/data/v2/gemf.xml', + 'Geometry/MuonCommonData/data/v5/gem11.xml', 'Geometry/MuonCommonData/data/v2/csc.xml', 'Geometry/MuonCommonData/data/v2/mfshield.xml', 'Geometry/ForwardCommonData/data/forward.xml', @@ -250,7 +251,6 @@ 'Geometry/ForwardCommonData/data/zdc.xml', 'Geometry/ForwardCommonData/data/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml')+cms.vstring( - 'Geometry/MuonCommonData/data/v2/muonNumbering.xml', 'Geometry/MuonCommonData/data/v5/muonGemNumbering.xml', 'Geometry/TrackerCommonData/data/PhaseI/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseI/trackersens.xml', @@ -275,7 +275,7 @@ 'Geometry/EcalSimData/data/ESProdCuts.xml', 'Geometry/TrackerSimData/data/PhaseI/trackerProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/MuonSimData/data/muonProdCuts.xml', + 'Geometry/MuonSimData/data/v2/muonProdCuts.xml', 'Geometry/ForwardSimData/data/CastorProdCuts.xml', 'Geometry/ForwardSimData/data/zdcProdCuts.xml', 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023HGCalMuonXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023HGCalMuonXML_cfi.py index 2e49b57a9ce80..7dcc80dd9de2d 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023HGCalMuonXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023HGCalMuonXML_cfi.py @@ -8,6 +8,7 @@ 'Geometry/CMSCommonData/data/PhaseI/cms.xml', 'Geometry/CMSCommonData/data/cmsMother.xml', 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', 'Geometry/CMSCommonData/data/PhaseII/caloBase.xml', 'Geometry/CMSCommonData/data/cmsCalo.xml', 'Geometry/CMSCommonData/data/PhaseII/muonBase.xml', @@ -54,7 +55,7 @@ 'Geometry/EcalCommonData/data/ebrot.xml', 'Geometry/EcalCommonData/data/eecon.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', - 'Geometry/HcalCommonData/data/PhaseII/hcalalgo.xml', + 'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', 'Geometry/HcalCommonData/data/hcalouteralgo.xml', 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', @@ -62,7 +63,6 @@ 'Geometry/HGCalCommonData/data/hgcal.xml', 'Geometry/HGCalCommonData/data/hgcalEE.xml', 'Geometry/HGCalCommonData/data/hgcalHE.xml', -## 'Geometry/PFCalGeometry/data/pfcal.xml', 'Geometry/MuonCommonData/data/v1/mbCommon.xml', 'Geometry/MuonCommonData/data/v1/mb1.xml', 'Geometry/MuonCommonData/data/v1/mb2.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023HGCalXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023HGCalXML_cfi.py index 33317cc38c42a..bf917b268c07a 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023HGCalXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023HGCalXML_cfi.py @@ -9,6 +9,7 @@ 'Geometry/CMSCommonData/data/PhaseI/cms.xml', 'Geometry/CMSCommonData/data/cmsMother.xml', 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', 'Geometry/CMSCommonData/data/PhaseII/caloBase.xml', 'Geometry/CMSCommonData/data/cmsCalo.xml', 'Geometry/CMSCommonData/data/PhaseII/muonBase.xml', @@ -57,17 +58,16 @@ 'Geometry/EcalCommonData/data/ectkcable.xml', 'Geometry/HcalCommonData/data/hcalrotations.xml', 'Geometry/HcalCommonData/data/PhaseII/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', + 'Geometry/HcalCommonData/data/hcalcablealgo.xml', 'Geometry/HcalCommonData/data/hcalouteralgo.xml', 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', 'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalRecNumbering.xml', + 'Geometry/HcalCommonData/data/PhaseII/NoHE/hcalRecNumbering.xml', 'Geometry/HGCalCommonData/data/hgcal.xml', 'Geometry/HGCalCommonData/data/hgcalEE.xml', 'Geometry/HGCalCommonData/data/hgcalHE.xml', -## 'Geometry/PFCalGeometry/data/pfcal.xml', 'Geometry/MuonCommonData/data/v1/mbCommon.xml', 'Geometry/MuonCommonData/data/v1/mb1.xml', 'Geometry/MuonCommonData/data/v1/mb2.xml', @@ -76,7 +76,8 @@ 'Geometry/MuonCommonData/data/design/muonYoke.xml', 'Geometry/MuonCommonData/data/v7/mf.xml', 'Geometry/MuonCommonData/data/v2/rpcf.xml', - 'Geometry/MuonCommonData/data/v6/gemf.xml', + 'Geometry/MuonCommonData/data/v2/gemf.xml', + 'Geometry/MuonCommonData/data/v5/gem11.xml', 'Geometry/MuonCommonData/data/v6/gem21.xml', 'Geometry/MuonCommonData/data/v2/csc.xml', 'Geometry/MuonCommonData/data/v7/mfshield.xml', @@ -108,6 +109,8 @@ 'Geometry/HcalSimData/data/hfpmt.xml', 'Geometry/HcalSimData/data/hffibrebundle.xml', 'Geometry/HcalSimData/data/CaloUtil.xml', + 'Geometry/HGCalSimData/data/hgcsens.xml', + 'Geometry/HGCalSimData/data/hgccons.xml', 'Geometry/MuonSimData/data/v4/muonSens.xml', 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', @@ -119,6 +122,7 @@ 'Geometry/ForwardSimData/data/zdcsens.xml', 'Geometry/HcalSimData/data/HcalProdCuts.xml', 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/hgcProdCuts.xml', 'Geometry/TrackerSimData/data/PhaseII/BarrelEndcap5D/trackerProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', 'Geometry/MuonSimData/data/v2/muonProdCuts.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalXML_cfi.py index 02105e321a55e..8b5426dd6b033 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometry2023SHCalXML_cfi.py @@ -9,6 +9,7 @@ 'Geometry/CMSCommonData/data/PhaseI/cms.xml', 'Geometry/CMSCommonData/data/cmsMother.xml', 'Geometry/CMSCommonData/data/cmsTracker.xml', + 'Geometry/CMSCommonData/data/eta3/etaMax.xml', 'Geometry/CMSCommonData/data/PhaseII/caloBase.xml', 'Geometry/CMSCommonData/data/cmsCalo.xml', 'Geometry/CMSCommonData/data/muonBase.xml', @@ -74,7 +75,8 @@ 'Geometry/MuonCommonData/data/design/muonYoke.xml', 'Geometry/MuonCommonData/data/v2/mf.xml', 'Geometry/MuonCommonData/data/v2/rpcf.xml', - 'Geometry/MuonCommonData/data/v4/gemf.xml', + 'Geometry/MuonCommonData/data/v2/gemf.xml', + 'Geometry/MuonCommonData/data/v5/gem11.xml', 'Geometry/MuonCommonData/data/v2/csc.xml', 'Geometry/MuonCommonData/data/v2/mfshield.xml', 'Geometry/ForwardCommonData/data/forward.xml', @@ -94,7 +96,6 @@ 'Geometry/ForwardCommonData/data/zdc.xml', 'Geometry/ForwardCommonData/data/zdclumi.xml', 'Geometry/ForwardCommonData/data/cmszdc.xml')+cms.vstring( - 'Geometry/MuonCommonData/data/v2/muonNumbering.xml', 'Geometry/MuonCommonData/data/v2/muonGemNumbering.xml', 'Geometry/TrackerCommonData/data/PhaseII/BarrelEndcap5D/trackerStructureTopology.xml', 'Geometry/TrackerSimData/data/PhaseII/BarrelEndcap5D/trackersens.xml', @@ -118,7 +119,7 @@ 'Geometry/EcalSimData/data/EcalProdCuts.xml', 'Geometry/TrackerSimData/data/PhaseII/BarrelEndcap5D/trackerProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', - 'Geometry/MuonSimData/data/muonProdCuts.xml', + 'Geometry/MuonSimData/data/v2/muonProdCuts.xml', 'Geometry/ForwardSimData/data/CastorProdCuts.xml', 'Geometry/ForwardSimData/data/zdcProdCuts.xml', 'Geometry/ForwardSimData/data/ForwardShieldProdCuts.xml', diff --git a/Geometry/CMSCommonData/python/cmsExtendedGeometryXML_cfi.py b/Geometry/CMSCommonData/python/cmsExtendedGeometryXML_cfi.py index 996c0d91d74bd..cffd69f6b008a 100644 --- a/Geometry/CMSCommonData/python/cmsExtendedGeometryXML_cfi.py +++ b/Geometry/CMSCommonData/python/cmsExtendedGeometryXML_cfi.py @@ -246,7 +246,7 @@ 'Geometry/TrackerSimData/data/trackersens.xml', 'Geometry/TrackerRecoData/data/trackerRecoMaterial.xml', 'Geometry/EcalSimData/data/ecalsens.xml', - 'Geometry/HcalCommonData/data/hcalsenspmf.xml', + 'Geometry/HcalCommonData/data/Phase0/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', 'Geometry/HcalSimData/data/hfpmt.xml', 'Geometry/HcalSimData/data/hffibrebundle.xml', diff --git a/Geometry/CMSCommonData/python/ecalhcalGeometryXML_cfi.py b/Geometry/CMSCommonData/python/ecalhcalGeometryXML_cfi.py index 1f1c23c0af89a..7fb8e70b2e85e 100644 --- a/Geometry/CMSCommonData/python/ecalhcalGeometryXML_cfi.py +++ b/Geometry/CMSCommonData/python/ecalhcalGeometryXML_cfi.py @@ -28,20 +28,21 @@ 'Geometry/EcalCommonData/data/escon.xml', 'Geometry/EcalCommonData/data/esalgo.xml', 'Geometry/EcalCommonData/data/eeF.xml', - 'Geometry/EcalCommonData/data/eeB.xml', + 'Geometry/EcalCommonData/data/eeB.xml', 'Geometry/HcalCommonData/data/hcalalgo.xml', 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', 'Geometry/HcalCommonData/data/hcalendcapalgo.xml', 'Geometry/HcalCommonData/data/hcalouteralgo.xml', + 'Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml', 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardfibre.xml', + # 'Geometry/HcalCommonData/data/hcalforwardfibre.xml', 'Geometry/HcalCommonData/data/Phase0/hcalSimNumbering.xml', 'Geometry/HcalCommonData/data/Phase0/hcalRecNumbering.xml', 'Geometry/ForwardCommonData/data/bundle/forwardshield.xml', 'Geometry/ForwardCommonData/data/forward.xml', 'Geometry/EcalSimData/data/ecalsens.xml', 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HcalCommonData/data/hcalsenspmf.xml', + 'Geometry/HcalCommonData/data/Phase0/hcalsenspmf.xml', 'Geometry/HcalSimData/data/hf.xml', 'Geometry/HcalSimData/data/hfpmt.xml', 'Geometry/HcalSimData/data/hffibrebundle.xml', diff --git a/Geometry/HGCalCommonData/data/cfc.xml b/Geometry/HGCalCommonData/data/cfc.xml index 9819a4c02f8dd..3240e7264a032 100644 --- a/Geometry/HGCalCommonData/data/cfc.xml +++ b/Geometry/HGCalCommonData/data/cfc.xml @@ -76,10 +76,6 @@ - - - - @@ -97,7 +93,7 @@ - + diff --git a/Geometry/HGCalCommonData/python/testCFCXML_cfi.py b/Geometry/HGCalCommonData/python/testCFCXML_cfi.py index 53c0e776292d0..2346d1047b52b 100644 --- a/Geometry/HGCalCommonData/python/testCFCXML_cfi.py +++ b/Geometry/HGCalCommonData/python/testCFCXML_cfi.py @@ -252,6 +252,8 @@ 'Geometry/HcalSimData/data/CaloUtil.xml', 'Geometry/HcalSimData/data/hf.xml', 'Geometry/HcalSimData/data/hffibre.xml', + 'Geometry/HGCalSimData/data/cfcsens.xml', + 'Geometry/HGCalSimData/data/cfccons.xml', 'Geometry/MuonSimData/data/muonSens.xml', 'Geometry/DTGeometryBuilder/data/dtSpecsFilter.xml', 'Geometry/CSCGeometryBuilder/data/cscSpecsFilter.xml', @@ -266,6 +268,7 @@ 'Geometry/FP420SimData/data/fp420sens.xml', 'Geometry/HcalSimData/data/HcalProdCuts.xml', 'Geometry/EcalSimData/data/EcalProdCuts.xml', + 'Geometry/HGCalSimData/data/cfcProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCuts.xml', 'Geometry/TrackerSimData/data/trackerProdCutsBEAM.xml', 'Geometry/MuonSimData/data/muonProdCuts.xml', diff --git a/Geometry/HGCalSimData/data/cfcProdCuts.xml b/Geometry/HGCalSimData/data/cfcProdCuts.xml new file mode 100644 index 0000000000000..709e0d9cd0564 --- /dev/null +++ b/Geometry/HGCalSimData/data/cfcProdCuts.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Geometry/HGCalSimData/data/cfccons.xml b/Geometry/HGCalSimData/data/cfccons.xml new file mode 100644 index 0000000000000..d7c1ae4681a8e --- /dev/null +++ b/Geometry/HGCalSimData/data/cfccons.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/HGCalSimData/data/cfcsens.xml b/Geometry/HGCalSimData/data/cfcsens.xml new file mode 100644 index 0000000000000..e7c804f8fd5ff --- /dev/null +++ b/Geometry/HGCalSimData/data/cfcsens.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Geometry/HGCalSimData/data/hgcProdCuts.xml b/Geometry/HGCalSimData/data/hgcProdCuts.xml new file mode 100644 index 0000000000000..755f3771f795e --- /dev/null +++ b/Geometry/HGCalSimData/data/hgcProdCuts.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/HGCalSimData/data/hgccons.xml b/Geometry/HGCalSimData/data/hgccons.xml new file mode 100644 index 0000000000000..9afb7119af672 --- /dev/null +++ b/Geometry/HGCalSimData/data/hgccons.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Geometry/HGCalSimData/data/hgcsens.xml b/Geometry/HGCalSimData/data/hgcsens.xml new file mode 100644 index 0000000000000..30dd536646592 --- /dev/null +++ b/Geometry/HGCalSimData/data/hgcsens.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/python/hcalNumberingInitialization_cfi.py b/Geometry/HcalCommonData/python/hcalNumberingInitialization_cfi.py new file mode 100644 index 0000000000000..96027fd57483a --- /dev/null +++ b/Geometry/HcalCommonData/python/hcalNumberingInitialization_cfi.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +HcalSimNumberingInitialization = cms.ESProducer("HcalSimNumberingInitialization") +HcalRecNumberingInitialization = cms.ESProducer("HcalRecNumberingInitialization") diff --git a/Geometry/HcalCommonData/python/testHcalOnlyGeometryXML_cfi.py~ b/Geometry/HcalCommonData/python/testHcalOnlyGeometryXML_cfi.py~ deleted file mode 100644 index cff1557edad98..0000000000000 --- a/Geometry/HcalCommonData/python/testHcalOnlyGeometryXML_cfi.py~ +++ /dev/null @@ -1,37 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource", - geomXMLFiles = cms.vstring('Geometry/CMSCommonData/data/materials.xml', - "Geometry/HcalCommonData/data/average/hcalforwardmaterial.xml", - 'Geometry/CMSCommonData/data/rotations.xml', - "Geometry/HcalCommonData/data/hcalrotations.xml", - 'Geometry/CMSCommonData/data/normal/cmsextent.xml', - 'Geometry/CMSCommonData/data/cms.xml', - 'Geometry/CMSCommonData/data/cmsMother.xml', - 'Geometry/CMSCommonData/data/caloBase.xml', - 'Geometry/CMSCommonData/data/cmsCalo.xml', - 'Geometry/CMSCommonData/data/muonBase.xml', - 'Geometry/CMSCommonData/data/cmsMuon.xml', - 'Geometry/CMSCommonData/data/mgnt.xml', - 'Geometry/CMSCommonData/data/muonMB.xml', - 'Geometry/CMSCommonData/data/muonMagnet.xml', - 'Geometry/CMSCommonData/data/eta3/etaMax.xml', - 'Geometry/HcalCommonData/data/phase2/hcalalgo.xml', - 'Geometry/HcalCommonData/data/hcalcablealgo.xml', - 'Geometry/HcalCommonData/data/hcalbarrelalgo.xml', - 'Geometry/HcalCommonData/data/phase2/hcalendcapalgo.xml', - 'Geometry/HcalCommonData/data/hcalouteralgo.xml', - 'Geometry/HcalCommonData/data/hcalforwardalgo.xml', - 'Geometry/HcalCommonData/data/phase2/hcalSimNumbering.xml', - 'Geometry/HcalCommonData/data/phase2/hcalRecNumbering.xml', - 'Geometry/ForwardCommonData/data/bundle/forwardshield.xml', - 'Geometry/ForwardCommonData/data/forward.xml', - 'Geometry/HcalSimData/data/CaloUtil.xml', - 'Geometry/HcalCommonData/data/hcalsens.xml', - 'Geometry/HcalSimData/data/hf.xml', - 'Geometry/HcalSimData/data/hfpmt.xml', - 'Geometry/HcalSimData/data/hffibrebundle.xml', - 'Geometry/HcalSimData/data/HcalProdCuts.xml', - 'Geometry/CMSCommonData/data/FieldParameters.xml'), - rootNodeName = cms.string('cms:OCMS') -) diff --git a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc index e75e4226d59de..90b59ed04f26c 100644 --- a/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc +++ b/Geometry/HcalCommonData/src/HcalDDDSimConstants.cc @@ -11,7 +11,6 @@ #include "CLHEP/Units/GlobalPhysicalConstants.h" #include "CLHEP/Units/GlobalSystemOfUnits.h" - //#define DebugLog HcalDDDSimConstants::HcalDDDSimConstants() : tobeInitialized(true) { diff --git a/Geometry/HcalCommonData/src/HcalNumberingFromDDD.cc b/Geometry/HcalCommonData/src/HcalNumberingFromDDD.cc index b086ff242ea98..89e726da38018 100644 --- a/Geometry/HcalCommonData/src/HcalNumberingFromDDD.cc +++ b/Geometry/HcalCommonData/src/HcalNumberingFromDDD.cc @@ -57,8 +57,9 @@ HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(int det, } #ifdef DebugLog - edm::LogInfo("HCalGeom") << "HcalNumberingFromDDD: point = " << point << " det " - << hsubdet << " eta/R " << etaR << " phi " << hphi; + LogDebug("HCalGeom") << "HcalNumberingFromDDD: point = " << point << " det " + << det << ":" << hsubdet << " eta/R " << etaR << " phi " + << hphi; #endif HcalNumberingFromDDD::HcalID tmp = unitID(hsubdet,etaR,hphi,depth,lay); return tmp; @@ -95,7 +96,7 @@ HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(int det, if (iphi > nphi) iphi = 1; #ifdef DebugLog - edm::LogInfo("HCalGeom") << "HcalNumberingFromDDD: etaR = " << etaR << " : " + LogDebug("HCalGeom") << "HcalNumberingFromDDD: etaR = " << etaR << " : " << zside << "/" << ieta << " phi " << hphi << " : " << iphi; #endif @@ -118,13 +119,13 @@ HcalNumberingFromDDD::HcalID HcalNumberingFromDDD::unitID(int det, int zside, int iphi_skip = hcalConstants->phiNumber(phi, units); #ifdef DebugLog - edm::LogInfo("HCalGeom") << "HcalNumberingFromDDD: phi units=" << units - << " iphi_skip=" << iphi_skip; + LogDebug("HCalGeom") << "HcalNumberingFromDDD: phi units= " << units + << " iphi_skip= " << iphi_skip; #endif HcalNumberingFromDDD::HcalID tmp(det,zside,etaDepth.second,etaDepth.first,phi,iphi_skip,lay); #ifdef DebugLog - edm::LogInfo("HCalGeom") << "HcalNumberingFromDDD: det = " << det << " " + LogDebug("HCalGeom") << "HcalNumberingFromDDD: det = " << det << " " << tmp.subdet << " zside = " << tmp.zside << " depth = " << tmp.depth << " eta/R = " << tmp.etaR << " phi = " << tmp.phi << " layer = " << tmp.lay; diff --git a/Geometry/MuonCommonData/data/v2/gem11.xml b/Geometry/MuonCommonData/data/v2/gem11.xml new file mode 100644 index 0000000000000..ec4704d0db0f4 --- /dev/null +++ b/Geometry/MuonCommonData/data/v2/gem11.xml @@ -0,0 +1,958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/MuonCommonData/data/v2/gemf.xml b/Geometry/MuonCommonData/data/v2/gemf.xml index 84725f245e975..24e87018b6a03 100644 --- a/Geometry/MuonCommonData/data/v2/gemf.xml +++ b/Geometry/MuonCommonData/data/v2/gemf.xml @@ -2,37 +2,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -77,799 +47,21 @@ + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/Geometry/MuonCommonData/data/v2/muonGemNumbering.xml b/Geometry/MuonCommonData/data/v2/muonGemNumbering.xml index dc9d0ba0a87f9..74eb55e6a199c 100644 --- a/Geometry/MuonCommonData/data/v2/muonGemNumbering.xml +++ b/Geometry/MuonCommonData/data/v2/muonGemNumbering.xml @@ -415,12 +415,12 @@ - + - + diff --git a/Geometry/MuonCommonData/data/v6/gemf.xml b/Geometry/MuonCommonData/data/v3/gem11.xml similarity index 62% rename from Geometry/MuonCommonData/data/v6/gemf.xml rename to Geometry/MuonCommonData/data/v3/gem11.xml index b8c71276d57f4..39c374220ef0e 100644 --- a/Geometry/MuonCommonData/data/v6/gemf.xml +++ b/Geometry/MuonCommonData/data/v3/gem11.xml @@ -1,17 +1,19 @@ - - - - - - - - - - - + + + + + + + + + + + + + @@ -20,7 +22,9 @@ - + + + @@ -39,16 +43,20 @@ + + + + - - + + - + - - - + + + @@ -78,17 +86,17 @@ - - + + - - + + - + - + - + @@ -140,67 +148,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -218,34 +167,38 @@ - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -254,6 +207,8 @@ + + @@ -276,22 +231,14 @@ - - - - - - - - - - + + - + @@ -299,98 +246,114 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + - - + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + @@ -426,6 +389,14 @@ + + + + + + + + @@ -508,520 +479,485 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -1034,7 +970,7 @@ - + @@ -1047,7 +983,7 @@ - + @@ -1060,7 +996,7 @@ - + @@ -1073,7 +1009,7 @@ - + @@ -1086,7 +1022,7 @@ - + @@ -1099,7 +1035,7 @@ - + @@ -1112,7 +1048,7 @@ - + diff --git a/Geometry/MuonCommonData/data/v4/gem11.xml b/Geometry/MuonCommonData/data/v4/gem11.xml new file mode 100644 index 0000000000000..53858b6e99f24 --- /dev/null +++ b/Geometry/MuonCommonData/data/v4/gem11.xml @@ -0,0 +1,1607 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/MuonCommonData/data/v5/gemf.xml b/Geometry/MuonCommonData/data/v5/gem11.xml similarity index 65% rename from Geometry/MuonCommonData/data/v5/gemf.xml rename to Geometry/MuonCommonData/data/v5/gem11.xml index 3a9fe70c14868..969b210a4adff 100644 --- a/Geometry/MuonCommonData/data/v5/gemf.xml +++ b/Geometry/MuonCommonData/data/v5/gem11.xml @@ -1,7 +1,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -140,66 +140,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -218,34 +159,34 @@ - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -276,22 +217,14 @@ - - - - - - - - - - + + - + @@ -299,98 +232,98 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -508,520 +441,455 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -1034,7 +902,7 @@ - + @@ -1047,7 +915,7 @@ - + @@ -1060,7 +928,7 @@ - + @@ -1073,7 +941,7 @@ - + @@ -1086,7 +954,7 @@ - + @@ -1099,7 +967,7 @@ - + @@ -1112,7 +980,7 @@ - + @@ -1125,27 +993,4 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Geometry/MuonCommonData/data/v5/muonGemNumbering.xml b/Geometry/MuonCommonData/data/v5/muonGemNumbering.xml index 9736b3d6b53f0..74eb55e6a199c 100644 --- a/Geometry/MuonCommonData/data/v5/muonGemNumbering.xml +++ b/Geometry/MuonCommonData/data/v5/muonGemNumbering.xml @@ -415,12 +415,12 @@ - + - + diff --git a/Geometry/MuonCommonData/data/v6/gem21.xml b/Geometry/MuonCommonData/data/v6/gem21.xml index 762405da84a86..efff32569f95b 100644 --- a/Geometry/MuonCommonData/data/v6/gem21.xml +++ b/Geometry/MuonCommonData/data/v6/gem21.xml @@ -331,19 +331,19 @@ - + - + - + - + @@ -685,22 +685,22 @@ - + - + - + - + @@ -1372,7 +1372,7 @@ - + @@ -1385,7 +1385,7 @@ - + @@ -1398,7 +1398,7 @@ - + @@ -1411,7 +1411,7 @@ - + @@ -1426,7 +1426,7 @@ - + @@ -1439,7 +1439,7 @@ - + @@ -1452,7 +1452,7 @@ - + @@ -1465,7 +1465,7 @@ - + @@ -1479,7 +1479,7 @@ - + @@ -1492,7 +1492,7 @@ - + @@ -1505,7 +1505,7 @@ - + @@ -1518,7 +1518,7 @@ - + @@ -1533,7 +1533,7 @@ - + @@ -1546,7 +1546,7 @@ - + @@ -1559,7 +1559,7 @@ - + @@ -1572,7 +1572,7 @@ - + diff --git a/Geometry/MuonCommonData/data/v6/muonGemNumbering.xml b/Geometry/MuonCommonData/data/v6/muonGemNumbering.xml index fa1afb464a4a5..02568b19d6e71 100644 --- a/Geometry/MuonCommonData/data/v6/muonGemNumbering.xml +++ b/Geometry/MuonCommonData/data/v6/muonGemNumbering.xml @@ -415,26 +415,23 @@ - - + + - + - - - + - - + diff --git a/Geometry/MuonCommonData/data/v7/muonNumbering.xml b/Geometry/MuonCommonData/data/v7/muonNumbering.xml index e55a82f292b03..2b8d0ce1a378a 100644 --- a/Geometry/MuonCommonData/data/v7/muonNumbering.xml +++ b/Geometry/MuonCommonData/data/v7/muonNumbering.xml @@ -426,26 +426,23 @@ - - + + - + - - - + - - + diff --git a/SimG4CMS/Calo/BuildFile.xml b/SimG4CMS/Calo/BuildFile.xml index c7cb3b9e77181..0f155561bd06f 100644 --- a/SimG4CMS/Calo/BuildFile.xml +++ b/SimG4CMS/Calo/BuildFile.xml @@ -4,6 +4,7 @@ + diff --git a/SimG4CMS/Calo/interface/CFCNumberingScheme.h b/SimG4CMS/Calo/interface/CFCNumberingScheme.h new file mode 100644 index 0000000000000..6365875e4de93 --- /dev/null +++ b/SimG4CMS/Calo/interface/CFCNumberingScheme.h @@ -0,0 +1,31 @@ +#ifndef SimG4CMS_CFCNumberingScheme_h +#define SimG4CMS_CFCNumberingScheme_h +/////////////////////////////////////////////////////////////////////////////// +// File: CFCNumberingScheme.h +// Description: Definition of sensitive unit numbering schema for CFC +/////////////////////////////////////////////////////////////////////////////// + +#include "Geometry/CaloGeometry/interface/CaloNumberingScheme.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include "G4Step.hh" +#include +#include + +class CFCNumberingScheme : public CaloNumberingScheme { + +public: + CFCNumberingScheme(std::vector rv, std::vector xv, + std::vector yv); + virtual ~CFCNumberingScheme(); + virtual uint32_t getUnitID(G4ThreeVector point, int iz, int mod, + int fibType, int depth=0); + +private: + CFCNumberingScheme(); + + std::vector rTable, xCellSize, yCellSize; + std::vector nMaxX; +}; + +#endif diff --git a/SimG4CMS/Calo/interface/CFCSD.h b/SimG4CMS/Calo/interface/CFCSD.h new file mode 100644 index 0000000000000..410135249b746 --- /dev/null +++ b/SimG4CMS/Calo/interface/CFCSD.h @@ -0,0 +1,62 @@ +#ifndef SimG4CMS_CFCSD_h +#define SimG4CMS_CFCSD_h +/////////////////////////////////////////////////////////////////////////////// +// File: CFCSD.h +// Description: Stores hits of the Combined Forward Calorimeter (CFC) in the +// appropriate container +/////////////////////////////////////////////////////////////////////////////// + +#include "SimG4CMS/Calo/interface/CaloSD.h" +#include "SimG4CMS/Calo/interface/CFCShowerLibrary.h" +#include "SimG4CMS/Calo/interface/CFCNumberingScheme.h" +#include "DetectorDescription/Core/interface/DDsvalues.h" + +#include "G4String.hh" +#include +#include +#include + +class DDCompactView; +class DDFilteredView; +class G4LogicalVolume; +class G4Material; +class G4Step; + +class CFCSD : public CaloSD { + +public: + + CFCSD(G4String , const DDCompactView &, SensitiveDetectorCatalog &, + edm::ParameterSet const &, const SimTrackManager*); + virtual ~CFCSD(); + virtual bool ProcessHits(G4Step * , G4TouchableHistory * ); + virtual double getEnergyDeposit(G4Step* ); + virtual uint32_t setDetUnitId(G4Step* step); + +protected: + + virtual void initRun(); + virtual bool filterHit(CaloG4Hit*, double); + +private: + + uint32_t setDetUnitId(int, G4ThreeVector, int, int); + std::vector getDDDArray(const std::string&, + const DDsvalues_type&); + bool isItinFidVolume (G4ThreeVector&); + void getFromLibrary(G4Step * step); + int setTrackID(G4Step * step); + double attLength(double lambda); + double tShift(G4ThreeVector point); + double fiberL(G4ThreeVector point); + + CFCNumberingScheme* numberingScheme; + CFCShowerLibrary * showerLibrary; + G4int mumPDG, mupPDG, nBinAtt; + double eminHit, cFibre; + bool applyFidCut; + std::vector attL, lambLim, gpar; + +}; + +#endif // CFCSD_h diff --git a/SimG4CMS/Calo/interface/CFCShowerLibrary.h b/SimG4CMS/Calo/interface/CFCShowerLibrary.h new file mode 100644 index 0000000000000..3437eb635d1fc --- /dev/null +++ b/SimG4CMS/Calo/interface/CFCShowerLibrary.h @@ -0,0 +1,56 @@ +#ifndef SimG4CMS_CFCShowerLibrary_h +#define SimG4CMS_CFCShowerLibrary_h 1 +/////////////////////////////////////////////////////////////////////////////// +// File: CFCShowerLibrary.h +// Description: Gets information from a shower library +/////////////////////////////////////////////////////////////////////////////// + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "SimG4CMS/Calo/interface/HFFibre.h" + +#include "G4ParticleTable.hh" +#include "G4ThreeVector.hh" + +//ROOT +#include "TROOT.h" +#include "TFile.h" +#include "TTree.h" + +#include +#include + +class G4Step; + +class CFCShowerLibrary { + +public: + + //Constructor and Destructor + CFCShowerLibrary(edm::ParameterSet const & p, std::vector& gpar); + ~CFCShowerLibrary(); + +public: + + struct Hit { + Hit() {} + G4ThreeVector position; // local coordinate + int type; + double lambda; + double time; + }; + + void initRun(G4ParticleTable * theParticleTable); + std::vector getHits(G4Step * aStep, bool &ok); + +private: + + std::vector gpar; + TFile* hfile; + + int emPDG, epPDG, gammaPDG, mumPDG, mupPDG; + int pi0PDG, etaPDG, nuePDG, numuPDG, nutauPDG; + int anuePDG, anumuPDG, anutauPDG, geantinoPDG; + +}; +#endif diff --git a/SimG4CMS/Calo/interface/HGCNumberingScheme.h b/SimG4CMS/Calo/interface/HGCNumberingScheme.h new file mode 100644 index 0000000000000..186922da0bb39 --- /dev/null +++ b/SimG4CMS/Calo/interface/HGCNumberingScheme.h @@ -0,0 +1,29 @@ +#ifndef SimG4CMS_HGCNumberingScheme_h +#define SimG4CMS_HGCNumberingScheme_h +/////////////////////////////////////////////////////////////////////////////// +// File: HGCNumberingScheme.h +// Description: Definition of sensitive unit numbering schema for HGC +/////////////////////////////////////////////////////////////////////////////// + +#include "Geometry/CaloGeometry/interface/CaloNumberingScheme.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include "G4Step.hh" +#include +#include + +class HGCNumberingScheme : public CaloNumberingScheme { + +public: + HGCNumberingScheme(std::vector gpar); + virtual ~HGCNumberingScheme(); + virtual uint32_t getUnitID(int subdet, G4ThreeVector point, int iz, int mod, + int layer); + +private: + HGCNumberingScheme(); + + std::vector gpar; +}; + +#endif diff --git a/SimG4CMS/Calo/interface/HGCSD.h b/SimG4CMS/Calo/interface/HGCSD.h new file mode 100644 index 0000000000000..f0bcf9799ab92 --- /dev/null +++ b/SimG4CMS/Calo/interface/HGCSD.h @@ -0,0 +1,55 @@ +#ifndef SimG4CMS_HGCSD_h +#define SimG4CMS_HGCSD_h +/////////////////////////////////////////////////////////////////////////////// +// File: HGCSD.h +// Description: Stores hits of the High Granularity Calorimeter (HGC) in the +// appropriate container +/////////////////////////////////////////////////////////////////////////////// + +#include "SimG4CMS/Calo/interface/CaloSD.h" +#include "SimG4CMS/Calo/interface/HGCNumberingScheme.h" +#include "DetectorDescription/Core/interface/DDsvalues.h" + +#include "G4String.hh" +#include +#include +#include + +class DDCompactView; +class DDFilteredView; +class G4LogicalVolume; +class G4Material; +class G4Step; + +class HGCSD : public CaloSD { + +public: + + HGCSD(G4String , const DDCompactView &, SensitiveDetectorCatalog &, + edm::ParameterSet const &, const SimTrackManager*); + virtual ~HGCSD(); + virtual bool ProcessHits(G4Step * , G4TouchableHistory * ); + virtual double getEnergyDeposit(G4Step* ); + virtual uint32_t setDetUnitId(G4Step* step); + +protected: + + virtual void initRun(); + virtual bool filterHit(CaloG4Hit*, double); + +private: + + uint32_t setDetUnitId(int, G4ThreeVector, int,int,int); + std::vector getDDDArray(const std::string&, + const DDsvalues_type&); + bool isItinFidVolume (G4ThreeVector&) {return true;} + int setTrackID(G4Step * step); + + HGCNumberingScheme* numberingScheme; + std::vector gpar; + G4int mumPDG, mupPDG; + double eminHit; + +}; + +#endif // HGCSD_h diff --git a/SimG4CMS/Calo/plugins/module.cc b/SimG4CMS/Calo/plugins/module.cc index c5739deaec8a6..7cdad515c850f 100644 --- a/SimG4CMS/Calo/plugins/module.cc +++ b/SimG4CMS/Calo/plugins/module.cc @@ -1,5 +1,7 @@ +#include "SimG4CMS/Calo/interface/CFCSD.h" #include "SimG4CMS/Calo/interface/ECalSD.h" #include "SimG4CMS/Calo/interface/HCalSD.h" +#include "SimG4CMS/Calo/interface/HGCSD.h" #include "SimG4CMS/Calo/interface/CaloTrkProcessing.h" #include "SimG4CMS/Calo/interface/HcalTestAnalysis.h" #include "SimG4Core/SensitiveDetector/interface/SensitiveDetectorPluginFactory.h" @@ -7,10 +9,14 @@ #include "FWCore/PluginManager/interface/ModuleDef.h" +typedef CFCSD CFCSensitiveDetector; +DEFINE_SENSITIVEDETECTOR(CFCSensitiveDetector); typedef ECalSD EcalSensitiveDetector; DEFINE_SENSITIVEDETECTOR(EcalSensitiveDetector); typedef HCalSD HcalSensitiveDetector; DEFINE_SENSITIVEDETECTOR(HcalSensitiveDetector); +typedef HGCSD HGCSensitiveDetector; +DEFINE_SENSITIVEDETECTOR(HGCSensitiveDetector); DEFINE_SENSITIVEDETECTOR(CaloTrkProcessing); DEFINE_SIMWATCHER (HcalTestAnalysis); diff --git a/SimG4CMS/Calo/src/CFCNumberingScheme.cc b/SimG4CMS/Calo/src/CFCNumberingScheme.cc new file mode 100644 index 0000000000000..8c8a72172557c --- /dev/null +++ b/SimG4CMS/Calo/src/CFCNumberingScheme.cc @@ -0,0 +1,69 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: CFCNumberingScheme.cc +// Description: Numbering scheme for Combined Forward Calorimeter +/////////////////////////////////////////////////////////////////////////////// +#include "SimG4CMS/Calo/interface/CFCNumberingScheme.h" +#include "DataFormats/ForwardDetId/interface/CFCDetId.h" +#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h" + +#include "CLHEP/Units/GlobalSystemOfUnits.h" +#include + +#define DebugLog + +CFCNumberingScheme::CFCNumberingScheme(std::vector rv, + std::vector xv, + std::vector yv) : + CaloNumberingScheme(0), rTable(rv), xCellSize(xv), yCellSize(yv) { + edm::LogInfo("CFCSim") << "Creating CFCNumberingScheme"; + int ntot(0); + for (unsigned int i=0; i rTable[xCellSize.size()]) return 0; + for (unsigned int i=0; i 0) nx += nMaxX[i-1]; + ny = (int)((std::abs(point.y())+0.01)/yCellSize[i]) + 1; + if (point.y() < 0) ny = -ny; + break; + } + } + ForwardSubdetector subdet = ForwardSubdetector::CFC; + + //pack it into an integer + // to be consistent with CFCDetId convention + uint32_t index = CFCDetId(subdet,module,iz*nx,ny,depth,fibType).rawId(); +#ifdef DebugLog + edm::LogInfo("CFCSim") << "CFCNumberingScheme det = " << subdet + << " module = " << module << " depth = " << depth + << " zside = " << iz << " eta = " << nx << " phi = " + << ny << " type = " << fibType << " packed index = 0x" + << std::hex << index << std::dec << " " + << CFCDetId(index); +#endif + return index; + +} diff --git a/SimG4CMS/Calo/src/CFCSD.cc b/SimG4CMS/Calo/src/CFCSD.cc new file mode 100644 index 0000000000000..f8779be999062 --- /dev/null +++ b/SimG4CMS/Calo/src/CFCSD.cc @@ -0,0 +1,328 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: CFCSD.cc +// Description: Sensitive Detector class for Combined Forward Calorimeter +/////////////////////////////////////////////////////////////////////////////// + +#include "SimG4CMS/Calo/interface/CFCSD.h" +#include "SimG4CMS/Calo/interface/CFCNumberingScheme.h" +#include "SimG4Core/Notification/interface/TrackInformation.h" +#include "DetectorDescription/Core/interface/DDFilter.h" +#include "DetectorDescription/Core/interface/DDFilteredView.h" +#include "DetectorDescription/Core/interface/DDLogicalPart.h" +#include "DetectorDescription/Core/interface/DDMaterial.h" +#include "DetectorDescription/Core/interface/DDValue.h" +#include "FWCore/Utilities/interface/Exception.h" + +#include "G4LogicalVolumeStore.hh" +#include "G4LogicalVolume.hh" +#include "G4Step.hh" +#include "G4Track.hh" +#include "G4ParticleTable.hh" +#include "G4VProcess.hh" +#include "Randomize.hh" + +#include +#include +#include + +#define DebugLog + +CFCSD::CFCSD(G4String name, const DDCompactView & cpv, + SensitiveDetectorCatalog & clg, + edm::ParameterSet const & p, const SimTrackManager* manager) : + CaloSD(name, cpv, clg, p, manager, + p.getParameter("CFCSD").getParameter("TimeSliceUnit"), + p.getParameter("CFCSD").getParameter("IgnoreTrackID")), + numberingScheme(0), showerLibrary(0) { + + edm::ParameterSet m_CFC = p.getParameter("CFCSD"); + eminHit = m_CFC.getParameter("EminHit")*MeV; + cFibre = c_light*(m_CFC.getParameter("CFibre")); + applyFidCut = m_CFC.getParameter("ApplyFiducialCut"); + +#ifdef DebugLog + LogDebug("CFCSim") << "**************************************************" + << "\n" + << "* *" + << "\n" + << "* Constructing a CFCSD with name " << name << "\n" + << "* *" + << "\n" + << "**************************************************"; +#endif + edm::LogInfo("CFCSim") << "CFCSD:: Threshold for storing hits: " << eminHit + << " Speed of light in fibre " << cFibre << " m/ns" + << " Application of Fiducial Cut " << applyFidCut; + + std::string attribute, value; + // Constants for Numbering Scheme, shower, attenuation length + attribute = "Volume"; + value = "CFC"; + DDSpecificsFilter filter0; + DDValue ddv0(attribute, value, 0); + filter0.setCriteria(ddv0, DDSpecificsFilter::equals); + DDFilteredView fv0(cpv); + fv0.addFilter(filter0); + fv0.firstChild(); + DDsvalues_type sv0(fv0.mergedSpecifics()); + + std::vector rv = getDDDArray("RadiusTable",sv0); + std::vector xv = getDDDArray("XcellSize",sv0); + std::vector yv = getDDDArray("YcellSize",sv0); + numberingScheme = new CFCNumberingScheme(rv,xv,yv); + + attL = getDDDArray("AttenuationLength",sv0); + lambLim = getDDDArray("LambdaLimit",sv0); + gpar = getDDDArray("GeomParCFC",sv0); + showerLibrary = new CFCShowerLibrary(p, gpar); + nBinAtt = (int)(attL.size()); + edm::LogInfo("CFCSim") << "CFCSD: " << nBinAtt << " attenuation lengths " + << "for lambda in the range " << lambLim[0] << ":" + << lambLim[1]; + for (int i=0; iGetName() << " for Track " + << aStep->GetTrack()->GetTrackID() << " (" + << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")"; +#endif + getFromLibrary(aStep); + } else { +#ifdef DebugLog + G4LogicalVolume* lv = + aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume(); + edm::LogInfo("CFCSim") << "CFCSD: Hit from standard path from " + << lv->GetName() << " for Track " + << aStep->GetTrack()->GetTrackID() << " (" + << aStep->GetTrack()->GetDefinition()->GetParticleName() << ")"; +#endif + if (getStepInfo(aStep)) { + if (hitExists() == false && edepositEM+edepositHAD>0.) currentHit = createNewHit(); + } + } + return true; + } +} + +double CFCSD::getEnergyDeposit(G4Step* aStep) { + double destep = aStep->GetTotalEnergyDeposit(); + return destep; +} + +uint32_t CFCSD::setDetUnitId(G4Step * aStep) { + + G4StepPoint* preStepPoint = aStep->GetPreStepPoint(); + const G4VTouchable* touch = preStepPoint->GetTouchable(); + G4ThreeVector hitPoint = preStepPoint->GetPosition(); + + int module = (touch->GetReplicaNumber(1)); + G4ThreeVector localpos = touch->GetHistory()->GetTopTransform().TransformPoint(hitPoint); + int iz = (hitPoint.z() > 0) ? 1 : -1; + + return setDetUnitId (module, localpos, iz, 0); +} + +void CFCSD::initRun() { + G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable(); + G4String particleName; + mumPDG = theParticleTable->FindParticle(particleName="mu-")->GetPDGEncoding(); + mupPDG = theParticleTable->FindParticle(particleName="mu+")->GetPDGEncoding(); +#ifdef DebugLog + LogDebug("CFCSim") << "CFCSD: Particle code for mu- = " << mumPDG + << " for mu+ = " << mupPDG; +#endif + if (showerLibrary) showerLibrary->initRun(theParticleTable); +} + +bool CFCSD::filterHit(CaloG4Hit* aHit, double time) { + return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit)); +} + + +uint32_t CFCSD::setDetUnitId (int nmod, G4ThreeVector pos, int iz, int type){ + uint32_t id = 0; + //get the ID + if (numberingScheme) id = numberingScheme->getUnitID(pos, iz, nmod, type); + return id; +} + +std::vector CFCSD::getDDDArray(const std::string & str, + const DDsvalues_type & sv) { +#ifdef DebugLog + LogDebug("CFCSim") << "CFCSD:getDDDArray called for " << str; +#endif + DDValue value(str); + if (DDfetch(&sv,value)) { +#ifdef DebugLog + LogDebug("CFCSim") << value; +#endif + const std::vector & fvec = value.doubles(); + int nval = fvec.size(); + if (nval < 1) { + edm::LogError("CFCSim") << "CFCSD : # of " << str << " bins " << nval + << " < 2 ==> illegal"; + throw cms::Exception("Unknown", "CFCSD") << "nval < 2 for array " << str << "\n"; + } + + return fvec; + } else { + edm::LogError("CFCSim") << "CFCSD : cannot get array " << str; + throw cms::Exception("Unknown", "CFCSD") << "cannot get array " << str << "\n"; + } +} + +bool CFCSD::isItinFidVolume (G4ThreeVector& hitPoint) { + bool flag = true; + if (applyFidCut) { + // Take a decision of selecting/rejecting based on local position + if (hitPoint.z() < gpar[0] || hitPoint.z() > gpar[1]) flag = false; + } +#ifdef DebugLog + edm::LogInfo("CFCSim") << "CFCSD::isItinFidVolume: point " << hitPoint + << " return flag " << flag; +#endif + return flag; +} + +void CFCSD::getFromLibrary (G4Step* aStep) { + preStepPoint = aStep->GetPreStepPoint(); + theTrack = aStep->GetTrack(); + const G4VTouchable* touch = preStepPoint->GetTouchable(); + int module = (touch->GetReplicaNumber(1)); + int iz = (preStepPoint->GetPosition().z() > 0) ? 1 : -1; + bool ok; + + std::vector hits = showerLibrary->getHits(aStep, ok); + + double etrack = preStepPoint->GetKineticEnergy(); + int primaryID = setTrackID(aStep); + + // Reset entry point for new primary + posGlobal = preStepPoint->GetPosition(); + resetForNewPrimary(posGlobal, etrack); + + G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding(); + if (particleCode==emPDG || particleCode==epPDG || particleCode==gammaPDG) { + edepositEM = 1.*GeV; + edepositHAD = 0.; + } else { + edepositEM = 0.; + edepositHAD = 1.*GeV; + } +#ifdef DebugLog + edm::LogInfo("CFCSim") << "CFCSD::getFromLibrary " <GetDefinition()->GetParticleName() + << " of " << preStepPoint->GetKineticEnergy()/GeV << " GeV"; +#endif + for (unsigned int i=0; i 0 && rn <= exp(-att*zv)) { + double time = hits[i].time + tShift(hitPoint); + currentID.setID(unitID, time, primaryID, 0); + + // check if it is in the same unit and timeslice as the previous one + if (currentID == previousID) { + updateHit(currentHit); + } else { + if (!checkHit()) currentHit = createNewHit(); + } + } + } + + //Now kill the current track + if (ok) { + theTrack->SetTrackStatus(fStopAndKill); + G4TrackVector tv = *(aStep->GetSecondary()); + for (unsigned int kk=0; kkGetVolume() == preStepPoint->GetPhysicalVolume()) + tv[kk]->SetTrackStatus(fStopAndKill); + } +} + +int CFCSD::setTrackID (G4Step* aStep) { + + theTrack = aStep->GetTrack(); + double etrack = preStepPoint->GetKineticEnergy(); + TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation()); + int primaryID = trkInfo->getIDonCaloSurface(); + if (primaryID == 0) { +#ifdef DebugLog + edm::LogInfo("CFCSim") << "CFCSD: Problem with primaryID **** set by " + << "force to TkID **** " <GetTrackID(); +#endif + primaryID = theTrack->GetTrackID(); + } + + if (primaryID != previousID.trackID()) + resetForNewPrimary(preStepPoint->GetPosition(), etrack); + + return primaryID; +} + +double CFCSD::attLength(double lambda) { + + int i = int(nBinAtt*(lambda - lambLim[0])/(lambLim[1]-lambLim[0])); + int j =i; + if (i >= nBinAtt) j = nBinAtt-1; + else if (i < 0) j = 0; + double att = attL[j]; +#ifdef DebugLog + edm::LogInfo("CFCSim") << "CFCSD::attLength for Lambda " << lambda + << " index " << i << ":" << j << " Att. Length " + << att; +#endif + return att; +} + +double CFCSD::tShift(G4ThreeVector point) { + + double zFibre = fiberL(point); + double time = zFibre/cFibre; +#ifdef DebugLog + edm::LogInfo("CFCSim") << "HFFibre::tShift for point " << point + << " (traversed length = " << zFibre/cm << " cm) = " + << time/ns << " ns"; +#endif + return time; +} + +double CFCSD::fiberL(G4ThreeVector point) { + + double zFibre = gpar[1]-point.z(); + if (zFibre < 0) zFibre = 0; +#ifdef DebugLog + edm::LogInfo("CFCSim") << "HFFibre::fiberL for point " << point << " = " + << zFibre/cm << " cm"; +#endif + return zFibre; +} diff --git a/SimG4CMS/Calo/src/CFCShowerLibrary.cc b/SimG4CMS/Calo/src/CFCShowerLibrary.cc new file mode 100644 index 0000000000000..2ad61f2f83dfe --- /dev/null +++ b/SimG4CMS/Calo/src/CFCShowerLibrary.cc @@ -0,0 +1,86 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: CFCShowerLibrary.cc +// Description: Shower library for Combined Forward Calorimeter +/////////////////////////////////////////////////////////////////////////////// + +#include "SimG4CMS/Calo/interface/CFCShowerLibrary.h" + +#include "FWCore/Utilities/interface/Exception.h" + +#include "G4VPhysicalVolume.hh" +#include "G4NavigationHistory.hh" +#include "G4Step.hh" +#include "G4Track.hh" +#include "Randomize.hh" +#include "CLHEP/Units/GlobalSystemOfUnits.h" + +#define DebugLog + +CFCShowerLibrary::CFCShowerLibrary(edm::ParameterSet const & p, + std::vector & gp) : gpar(gp) { + + + edm::ParameterSet m_CFC = p.getParameter("CFCSD"); + edm::FileInPath fp = m_CFC.getParameter("FileName"); + std::string pTreeName = fp.fullPath(); + if (pTreeName.find(".") == 0) pTreeName.erase(0,2); + const char* nTree = pTreeName.c_str(); + hfile = TFile::Open(nTree); + + if (!hfile->IsOpen()) { + edm::LogError("CFCShower") << "CFCShowerLibrary: opening " << nTree + << " failed"; + throw cms::Exception("Unknown", "CFCShowerLibrary") + << "Opening of " << pTreeName << " fails\n"; + } else { + edm::LogInfo("CFCShower") << "CFCShowerLibrary: opening " << nTree + << " successfully"; + } + + emPDG = epPDG = gammaPDG = 0; + pi0PDG = etaPDG = nuePDG = numuPDG = nutauPDG= 0; + anuePDG= anumuPDG = anutauPDG = geantinoPDG = 0; +} + +CFCShowerLibrary::~CFCShowerLibrary() { + if (hfile) hfile->Close(); +} + +void CFCShowerLibrary::initRun(G4ParticleTable * theParticleTable) { + + emPDG = theParticleTable->FindParticle("e-")->GetPDGEncoding(); + epPDG = theParticleTable->FindParticle("e+")->GetPDGEncoding(); + gammaPDG = theParticleTable->FindParticle("gamma")->GetPDGEncoding(); + mumPDG = theParticleTable->FindParticle("mu-")->GetPDGEncoding(); + mupPDG = theParticleTable->FindParticle("mu+")->GetPDGEncoding(); + pi0PDG = theParticleTable->FindParticle("pi0")->GetPDGEncoding(); + etaPDG = theParticleTable->FindParticle("eta")->GetPDGEncoding(); + nuePDG = theParticleTable->FindParticle("nu_e")->GetPDGEncoding(); + numuPDG = theParticleTable->FindParticle("nu_mu")->GetPDGEncoding(); + nutauPDG = theParticleTable->FindParticle("nu_tau")->GetPDGEncoding(); + anuePDG = theParticleTable->FindParticle("anti_nu_e")->GetPDGEncoding(); + anumuPDG = theParticleTable->FindParticle("anti_nu_mu")->GetPDGEncoding(); + anutauPDG = theParticleTable->FindParticle("anti_nu_tau")->GetPDGEncoding(); + geantinoPDG= theParticleTable->FindParticle("geantino")->GetPDGEncoding(); +#ifdef DebugLog + edm::LogInfo("CFCShower") << "CFCShowerLibrary: Particle codes for e- = " + << emPDG << ", e+ = " << epPDG << ", gamma = " + << gammaPDG << ", pi0 = " << pi0PDG << ", eta = " + << etaPDG << ", geantino = " << geantinoPDG + << "\n nu_e = " << nuePDG << ", nu_mu = " + << numuPDG << ", nu_tau = " << nutauPDG + << ", anti_nu_e = " << anuePDG << ", anti_nu_mu = " + << anumuPDG << ", anti_nu_tau = " << anutauPDG; +#endif +} + + +std::vector CFCShowerLibrary::getHits(G4Step * aStep, + bool & ok) { + + + std::vector hit; + G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding(); + ok = (parCode != mupPDG && parCode != mumPDG) ? true : false; + return hit; +} diff --git a/SimG4CMS/Calo/src/CaloSD.cc b/SimG4CMS/Calo/src/CaloSD.cc index 20d125fec2093..fe5ff21ba28a6 100644 --- a/SimG4CMS/Calo/src/CaloSD.cc +++ b/SimG4CMS/Calo/src/CaloSD.cc @@ -654,6 +654,7 @@ bool CaloSD::saveHit(CaloG4Hit* aHit) { << aHit->getEM()/GeV << " GeV (EM) and " << aHit->getHadr()/GeV << " GeV (Hadr)"; #endif + return ok; } diff --git a/SimG4CMS/Calo/src/HCalSD.cc b/SimG4CMS/Calo/src/HCalSD.cc index 92b53513ff822..682c11406fc9a 100644 --- a/SimG4CMS/Calo/src/HCalSD.cc +++ b/SimG4CMS/Calo/src/HCalSD.cc @@ -55,7 +55,7 @@ HCalSD::HCalSD(G4String name, const DDCompactView & cpv, birk3 = m_HC.getParameter("BirkC3"); useShowerLibrary = m_HC.getParameter("UseShowerLibrary"); useParam = m_HC.getParameter("UseParametrize"); - testNumber = m_HC.getParameter("TestNumberingScheme"); + testNumber = m_HC.getParameter("TestNumberingScheme"); usePMTHit = m_HC.getParameter("UsePMTHits"); betaThr = m_HC.getParameter("BetaThreshold"); eminHitHB = m_HC.getParameter("EminHitHB")*MeV; @@ -254,11 +254,12 @@ HCalSD::HCalSD(G4String name, const DDCompactView & cpv, if (fibre1LV.size() > 0 || fibre2LV.size() > 0) showerBundle = new HFShowerFibreBundle (name, cpv, p); - attribute = "ReadOutName"; - value = name; + attribute = "OnlyForHcalSimNumbering"; + value = "any"; DDSpecificsFilter filter6; DDValue ddv6(attribute,value,0); - filter6.setCriteria(ddv6,DDSpecificsFilter::equals); + filter6.setCriteria(ddv6, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); DDFilteredView fv6(cpv); fv6.addFilter(filter6); if (fv6.firstChild()) { @@ -277,10 +278,12 @@ HCalSD::HCalSD(G4String name, const DDCompactView & cpv, } //Material list for HB/HE/HO sensitive detectors - attribute = "ReadOutName"; + attribute = "OnlyForHcalSimNumbering"; + value = "any"; DDSpecificsFilter filter2; - DDValue ddv2(attribute,name,0); - filter2.setCriteria(ddv2,DDSpecificsFilter::equals); + DDValue ddv2(attribute,value,0); + filter2.setCriteria(ddv2, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); DDFilteredView fv2(cpv); fv2.addFilter(filter2); bool dodet = fv2.firstChild(); diff --git a/SimG4CMS/Calo/src/HFFibre.cc b/SimG4CMS/Calo/src/HFFibre.cc index 338b02f46f350..ec29d83c73748 100644 --- a/SimG4CMS/Calo/src/HFFibre.cc +++ b/SimG4CMS/Calo/src/HFFibre.cc @@ -74,11 +74,12 @@ HFFibre::HFFibre(std::string & name, const DDCompactView & cpv, } // Now geometry parameters - attribute = "ReadOutName"; - value = name; + attribute = "OnlyForHcalSimNumbering"; + value = "any"; + DDValue val(attribute, value, 0.0); DDSpecificsFilter filter2; - DDValue ddv2(attribute,value,0); - filter2.setCriteria(ddv2,DDSpecificsFilter::equals); + filter2.setCriteria(val, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); DDFilteredView fv2(cpv); fv2.addFilter(filter2); dodet = fv2.firstChild(); diff --git a/SimG4CMS/Calo/src/HFShower.cc b/SimG4CMS/Calo/src/HFShower.cc index a0074651710f1..4e85608f6dcf5 100644 --- a/SimG4CMS/Calo/src/HFShower.cc +++ b/SimG4CMS/Calo/src/HFShower.cc @@ -34,11 +34,12 @@ HFShower::HFShower(std::string & name, const DDCompactView & cpv, edm::LogInfo("HFShower") << "HFShower:: Maximum probability cut off " << probMax << " Check flag " << chkFibre; - G4String attribute = "ReadOutName"; - G4String value = name; + G4String attribute = "OnlyForHcalSimNumbering"; + G4String value = "any"; + DDValue val(attribute, value, 0.0); DDSpecificsFilter filter; - DDValue ddv(attribute,value,0); - filter.setCriteria(ddv,DDSpecificsFilter::equals); + filter.setCriteria(val, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); DDFilteredView fv(cpv); fv.addFilter(filter); bool dodet = fv.firstChild(); diff --git a/SimG4CMS/Calo/src/HFShowerFibreBundle.cc b/SimG4CMS/Calo/src/HFShowerFibreBundle.cc index db50f846c21f5..f1b5360c9ecea 100644 --- a/SimG4CMS/Calo/src/HFShowerFibreBundle.cc +++ b/SimG4CMS/Calo/src/HFShowerFibreBundle.cc @@ -33,11 +33,12 @@ HFShowerFibreBundle::HFShowerFibreBundle(std::string & name, << facTube << " for the straight portion and " << facCone << " for the curved portion"; - G4String attribute = "ReadOutName"; - G4String value = name; + G4String attribute = "OnlyForHcalSimNumbering"; + G4String value = "any"; + DDValue val(attribute, value, 0.0); DDSpecificsFilter filter0; - DDValue ddv0(attribute,value,0); - filter0.setCriteria(ddv0,DDSpecificsFilter::equals); + filter0.setCriteria(val, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); DDFilteredView fv0(cpv); fv0.addFilter(filter0); if (fv0.firstChild()) { diff --git a/SimG4CMS/Calo/src/HFShowerLibrary.cc b/SimG4CMS/Calo/src/HFShowerLibrary.cc index 869570e8eab12..0aeef6c90c677 100644 --- a/SimG4CMS/Calo/src/HFShowerLibrary.cc +++ b/SimG4CMS/Calo/src/HFShowerLibrary.cc @@ -103,11 +103,12 @@ HFShowerLibrary::HFShowerLibrary(std::string & name, const DDCompactView & cpv, << probMax << " Back propagation of light prob. " << backProb ; - G4String attribute = "ReadOutName"; - G4String value = name; + G4String attribute = "OnlyForHcalSimNumbering"; + G4String value = "any"; + DDValue val(attribute, value, 0.0); DDSpecificsFilter filter; - DDValue ddv(attribute,value,0); - filter.setCriteria(ddv,DDSpecificsFilter::equals); + filter.setCriteria(val, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); DDFilteredView fv(cpv); fv.addFilter(filter); bool dodet = fv.firstChild(); @@ -123,11 +124,9 @@ HFShowerLibrary::HFShowerLibrary(std::string & name, const DDCompactView & cpv, << " cm and rMax " << rMax/cm; //Delta phi - int nEta = -1; - std::vector etaTable = getDDDArray("etaTable",sv,nEta); - int nPhi = nEta + nR - 2; - std::vector phibin = getDDDArray("phibin",sv,nPhi); - dphi = phibin[nEta-1]; + int nPhi = nR - 1; + std::vector phibin = getDDDArray("phitable",sv,nPhi); + dphi = phibin[0]; edm::LogInfo("HFShower") << "HFShowerLibrary: (Half) Phi Width of wedge " << dphi/deg; diff --git a/SimG4CMS/Calo/src/HFShowerPMT.cc b/SimG4CMS/Calo/src/HFShowerPMT.cc index 8bf693a5427b0..b9fd2c1d2145a 100644 --- a/SimG4CMS/Calo/src/HFShowerPMT.cc +++ b/SimG4CMS/Calo/src/HFShowerPMT.cc @@ -25,11 +25,12 @@ HFShowerPMT::HFShowerPMT(std::string & name, const DDCompactView & cpv, edm::ParameterSet m_HF = p.getParameter("HFShowerPMT"); pePerGeV = m_HF.getParameter("PEPerGeVPMT"); - G4String attribute = "ReadOutName"; - G4String value = name; + G4String attribute = "OnlyForHcalSimNumbering"; + G4String value = "any"; + DDValue val(attribute, value, 0.0); DDSpecificsFilter filter0; - DDValue ddv0(attribute,value,0); - filter0.setCriteria(ddv0,DDSpecificsFilter::equals); + filter0.setCriteria(val, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); DDFilteredView fv0(cpv); fv0.addFilter(filter0); if (fv0.firstChild()) { diff --git a/SimG4CMS/Calo/src/HFShowerParam.cc b/SimG4CMS/Calo/src/HFShowerParam.cc index c7190af9b6c7c..71597bd3de5bc 100644 --- a/SimG4CMS/Calo/src/HFShowerParam.cc +++ b/SimG4CMS/Calo/src/HFShowerParam.cc @@ -28,7 +28,7 @@ HFShowerParam::HFShowerParam(std::string & name, const DDCompactView & cpv, edm::ParameterSet const & p) : showerLibrary(0), - fibre(0), gflash(0), + fibre(0),gflash(0), fillHisto(false) { edm::ParameterSet m_HF = p.getParameter("HFShower"); pePerGeV = m_HF.getParameter("PEPerGeV"); @@ -79,11 +79,12 @@ HFShowerParam::HFShowerParam(std::string & name, const DDCompactView & cpv, } #endif - G4String attribute = "ReadOutName"; - G4String value = name; + G4String attribute = "OnlyForHcalSimNumbering"; + G4String value = "any"; + DDValue val(attribute, value, 0.0); DDSpecificsFilter filter; - DDValue ddv(attribute,value,0); - filter.setCriteria(ddv,DDSpecificsFilter::equals); + filter.setCriteria(val, DDSpecificsFilter::not_equals, + DDSpecificsFilter::AND, true, true); DDFilteredView fv(cpv); fv.addFilter(filter); bool dodet = fv.firstChild(); diff --git a/SimG4CMS/Calo/src/HGCNumberingScheme.cc b/SimG4CMS/Calo/src/HGCNumberingScheme.cc new file mode 100644 index 0000000000000..53717b8133f73 --- /dev/null +++ b/SimG4CMS/Calo/src/HGCNumberingScheme.cc @@ -0,0 +1,42 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: HGCNumberingScheme.cc +// Description: Numbering scheme for High Granularity Calorimeter +/////////////////////////////////////////////////////////////////////////////// +#include "SimG4CMS/Calo/interface/HGCNumberingScheme.h" +#include "DataFormats/ForwardDetId/interface/HGCEEDetId.h" +#include "DataFormats/ForwardDetId/interface/HGCHEDetId.h" +#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h" + +#include "CLHEP/Units/GlobalSystemOfUnits.h" +#include + +#define DebugLog + +HGCNumberingScheme::HGCNumberingScheme(std::vector gp) : + CaloNumberingScheme(0), gpar(gp) { + edm::LogInfo("HGCSim") << "Creating HGCNumberingScheme"; +} + +HGCNumberingScheme::~HGCNumberingScheme() { + edm::LogInfo("HGCSim") << "Deleting HGCNumberingScheme"; +} + +uint32_t HGCNumberingScheme::getUnitID(int det, G4ThreeVector point, int iz, + int module, int layer) { + + int cellx(0), celly(0); + ForwardSubdetector subdet = (det == 1) ? ForwardSubdetector::HGCEE : ForwardSubdetector::HGCHE; + + //pack it into an integer + // to be consistent with HGCDetId convention + uint32_t index = (det == 1) ? HGCEEDetId(subdet,iz,module,layer,cellx).rawId() : HGCHEDetId(subdet,iz,module,layer,cellx,celly).rawId(); +#ifdef DebugLog + edm::LogInfo("HGCSim") << "HGCNumberingScheme det = " << subdet + << " module = " << module << " layer = " << layer + << " zside = " << iz << " Cell = " << cellx << ":" + << celly << " packed index = 0x" << std::hex << index + << std::dec; +#endif + return index; + +} diff --git a/SimG4CMS/Calo/src/HGCSD.cc b/SimG4CMS/Calo/src/HGCSD.cc new file mode 100644 index 0000000000000..15463a437c04d --- /dev/null +++ b/SimG4CMS/Calo/src/HGCSD.cc @@ -0,0 +1,184 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: HGCSD.cc +// Description: Sensitive Detector class for Combined Forward Calorimeter +/////////////////////////////////////////////////////////////////////////////// + +#include "SimG4CMS/Calo/interface/HGCSD.h" +#include "SimG4Core/Notification/interface/TrackInformation.h" +#include "DetectorDescription/Core/interface/DDFilter.h" +#include "DetectorDescription/Core/interface/DDFilteredView.h" +#include "DetectorDescription/Core/interface/DDLogicalPart.h" +#include "DetectorDescription/Core/interface/DDMaterial.h" +#include "DetectorDescription/Core/interface/DDValue.h" +#include "FWCore/Utilities/interface/Exception.h" + +#include "G4LogicalVolumeStore.hh" +#include "G4LogicalVolume.hh" +#include "G4Step.hh" +#include "G4Track.hh" +#include "G4ParticleTable.hh" +#include "G4VProcess.hh" + +#include +#include +#include + +#define DebugLog + +HGCSD::HGCSD(G4String name, const DDCompactView & cpv, + SensitiveDetectorCatalog & clg, + edm::ParameterSet const & p, const SimTrackManager* manager) : + CaloSD(name, cpv, clg, p, manager, + p.getParameter("HGCSD").getParameter("TimeSliceUnit"), + p.getParameter("HGCSD").getParameter("IgnoreTrackID")), + numberingScheme(0) { + + edm::ParameterSet m_HGC = p.getParameter("HGCSD"); + eminHit = m_HGC.getParameter("EminHit")*MeV; + +#ifdef DebugLog + LogDebug("HGCSim") << "**************************************************" + << "\n" + << "* *" + << "\n" + << "* Constructing a HGCSD with name " << name << "\n" + << "* *" + << "\n" + << "**************************************************"; +#endif + edm::LogInfo("HGCSim") << "HGCSD:: Threshold for storing hits: " << eminHit; + + std::string attribute, value; + // Constants for Numbering Scheme + attribute = "Volume"; + value = "HGC"; + DDSpecificsFilter filter0; + DDValue ddv0(attribute, value, 0); + filter0.setCriteria(ddv0, DDSpecificsFilter::equals); + DDFilteredView fv0(cpv); + fv0.addFilter(filter0); + fv0.firstChild(); + DDsvalues_type sv0(fv0.mergedSpecifics()); + + gpar = getDDDArray("GeomParHGC",sv0); + numberingScheme = new HGCNumberingScheme(gpar); +} + +HGCSD::~HGCSD() { + if (numberingScheme) delete numberingScheme; +} + +bool HGCSD::ProcessHits(G4Step * aStep, G4TouchableHistory * ) { + + NaNTrap( aStep ) ; + + if (aStep == NULL) { + return true; + } else { + G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding(); + bool notaMuon = (parCode == mupPDG || parCode == mumPDG ) ? false : true; +#ifdef DebugLog + G4LogicalVolume* lv = + aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume(); + edm::LogInfo("HGCSim") << "HGCSD: Hit from standard path from " + << lv->GetName() << " for Track " + << aStep->GetTrack()->GetTrackID() << " (" + << aStep->GetTrack()->GetDefinition()->GetParticleName() + << ":" << notaMuon << ")"; +#endif + if (getStepInfo(aStep)) { + if (hitExists() == false && edepositEM+edepositHAD>0.) currentHit = createNewHit(); + } + return true; + } +} + +double HGCSD::getEnergyDeposit(G4Step* aStep) { + double destep = aStep->GetTotalEnergyDeposit(); + return destep; +} + +uint32_t HGCSD::setDetUnitId(G4Step * aStep) { + + G4StepPoint* preStepPoint = aStep->GetPreStepPoint(); + const G4VTouchable* touch = preStepPoint->GetTouchable(); + G4ThreeVector hitPoint = preStepPoint->GetPosition(); + + G4ThreeVector localpos = touch->GetHistory()->GetTopTransform().TransformPoint(hitPoint); + int iz = (hitPoint.z() > 0) ? 1 : -1; + int subdet = (touch->GetReplicaNumber(4)); + int module = (touch->GetReplicaNumber(3)); + int layer = (touch->GetReplicaNumber(2)); + + return setDetUnitId (subdet, localpos, iz, module, layer); +} + +void HGCSD::initRun() { + G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable(); + G4String particleName; + mumPDG = theParticleTable->FindParticle(particleName="mu-")->GetPDGEncoding(); + mupPDG = theParticleTable->FindParticle(particleName="mu+")->GetPDGEncoding(); +#ifdef DebugLog + LogDebug("HGCSim") << "HGCSD: Particle code for mu- = " << mumPDG + << " for mu+ = " << mupPDG; +#endif +} + +bool HGCSD::filterHit(CaloG4Hit* aHit, double time) { + return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit)); +} + + +uint32_t HGCSD::setDetUnitId (int subdet, G4ThreeVector pos, int iz, int mod, + int layer) { + uint32_t id = 0; + //get the ID + if (numberingScheme) id = numberingScheme->getUnitID(subdet, pos, iz, mod, + layer); + return id; +} + +std::vector HGCSD::getDDDArray(const std::string & str, + const DDsvalues_type & sv) { +#ifdef DebugLog + LogDebug("HGCSim") << "HGCSD:getDDDArray called for " << str; +#endif + DDValue value(str); + if (DDfetch(&sv,value)) { +#ifdef DebugLog + LogDebug("HGCSim") << value; +#endif + const std::vector & fvec = value.doubles(); + int nval = fvec.size(); + if (nval < 1) { + edm::LogError("HGCSim") << "HGCSD : # of " << str << " bins " << nval + << " < 2 ==> illegal"; + throw cms::Exception("Unknown", "HGCSD") << "nval < 2 for array " << str << "\n"; + } + + return fvec; + } else { + edm::LogError("HGCSim") << "HGCSD : cannot get array " << str; + throw cms::Exception("Unknown", "HGCSD") << "cannot get array " << str << "\n"; + } +} + +int HGCSD::setTrackID (G4Step* aStep) { + theTrack = aStep->GetTrack(); + + double etrack = preStepPoint->GetKineticEnergy(); + TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation()); + int primaryID = trkInfo->getIDonCaloSurface(); + if (primaryID == 0) { +#ifdef DebugLog + edm::LogInfo("HGCSim") << "HGCSD: Problem with primaryID **** set by " + << "force to TkID **** " <GetTrackID(); +#endif + primaryID = theTrack->GetTrackID(); + } + + if (primaryID != previousID.trackID()) + resetForNewPrimary(preStepPoint->GetPosition(), etrack); + + return primaryID; +} diff --git a/SimG4CMS/Calo/src/HcalNumberingScheme.cc b/SimG4CMS/Calo/src/HcalNumberingScheme.cc index 42e5d6f52b478..4db8106a5e394 100644 --- a/SimG4CMS/Calo/src/HcalNumberingScheme.cc +++ b/SimG4CMS/Calo/src/HcalNumberingScheme.cc @@ -28,7 +28,6 @@ uint32_t HcalNumberingScheme::getUnitID(const HcalNumberingFromDDD::HcalID id){ //pack it into an integer // to be consistent with HcalDetId convention uint32_t index = HcalDetId(subdet,etaR,id.phis,id.depth).rawId(); - #ifdef DebugLog edm::LogInfo("HcalSim") << "HcalNumberingScheme det = " << id.subdet << " depth/lay = " << id.depth << "/" << id.lay diff --git a/SimG4CMS/Calo/test/python/runCFC_cfg.py b/SimG4CMS/Calo/test/python/runCFC_cfg.py new file mode 100644 index 0000000000000..9a2f957ec9593 --- /dev/null +++ b/SimG4CMS/Calo/test/python/runCFC_cfg.py @@ -0,0 +1,80 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("PROD") +process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") +process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") +process.load("Geometry.HGCalCommonData.testCFCXML_cfi") +process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Geometry.HcalCommonData.hcalNumberingInitialization_cfi") +process.load("Configuration.StandardSequences.MagneticField_cff") +process.load("Configuration.EventContent.EventContent_cff") +process.load("SimG4Core.Application.g4SimHits_cfi") + +process.MessageLogger = cms.Service("MessageLogger", + destinations = cms.untracked.vstring('cout'), + categories = cms.untracked.vstring('CaloSim', + 'CFCSim', 'G4cerr', 'G4cout'), + debugModules = cms.untracked.vstring('*'), + cout = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + DEBUG = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + CaloSim = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + CFCSim = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + G4cerr = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + G4cout = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + ) +) + +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 +process.RandomNumberGeneratorService.g4SimHits.initialSeed = 9876 +process.RandomNumberGeneratorService.VtxSmeared.initialSeed = 123456789 + +process.Timing = cms.Service("Timing") + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(5) +) + +process.source = cms.Source("EmptySource", + firstRun = cms.untracked.uint32(1), + firstEvent = cms.untracked.uint32(1) +) + +process.generator = cms.EDProducer("FlatRandomEGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(13), + MinEta = cms.double(1.75), + MaxEta = cms.double(2.90), + MinPhi = cms.double(-3.1415926), + MaxPhi = cms.double(3.1415926), + MinE = cms.double(1000.00), + MaxE = cms.double(1000.00) + ), + Verbosity = cms.untracked.int32(0), + AddAntiParticle = cms.bool(False) +) + +process.o1 = cms.OutputModule("PoolOutputModule", + process.FEVTSIMEventContent, + fileName = cms.untracked.string('simevent.root') +) + +process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits) +process.outpath = cms.EndPath(process.o1) +process.g4SimHits.Physics.type = 'SimG4Core/Physics/QGSP_FTFP_BERT_EML' +process.g4SimHits.Physics.DefaultCutValue = 0.1 + diff --git a/SimG4CMS/Calo/test/python/runHF1_cfg.py b/SimG4CMS/Calo/test/python/runHF1_cfg.py index afc2f9348fca7..1b75c2301d488 100644 --- a/SimG4CMS/Calo/test/python/runHF1_cfg.py +++ b/SimG4CMS/Calo/test/python/runHF1_cfg.py @@ -3,8 +3,12 @@ process = cms.Process("PROD") process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") process.load("IOMC.EventVertexGenerators.VtxSmearedGauss_cfi") -process.load("Geometry.CMSCommonData.cmsExtendedGeometryHFParametrizeXML_cfi") -process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +process.load("Configuration.StandardSequences.GeometryECALHCAL_cff") +#process.load("Geometry.CMSCommonData.cmsExtendedGeometryXML_cfi") +#process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi") +#process.load("Geometry.HcalCommonData.hcalNumberingInitialization_cfi") +#process.load("Geometry.CaloEventSetup.CaloTopology_cfi") +#process.load("Geometry.CaloEventSetup.CaloGeometry_cff") process.load("Configuration.StandardSequences.MagneticField_cff") process.load("Configuration.EventContent.EventContent_cff") process.load("SimG4Core.Application.g4SimHits_cfi") @@ -53,7 +57,7 @@ process.Timing = cms.Service("Timing") process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(200) + input = cms.untracked.int32(50) ) process.source = cms.Source("EmptySource", @@ -68,8 +72,8 @@ MaxEta = cms.double(3.50), MinPhi = cms.double(-3.1415926), MaxPhi = cms.double(3.1415926), - MinE = cms.double(1000.00), - MaxE = cms.double(1000.00) + MinE = cms.double(100.00), + MaxE = cms.double(100.00) ), Verbosity = cms.untracked.int32(0), AddAntiParticle = cms.bool(False) @@ -90,12 +94,16 @@ MaxTrackTimes = cms.vdouble() ) -process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits*process.hfPMTHitAnalyzer) +process.HcalSimHitsAnalyser = cms.EDAnalyzer("HcalSimHitsValidation", + outputFile = cms.untracked.string('HcalSimHitsValidation.root') +) + +process.p1 = cms.Path(process.generator*process.VtxSmeared*process.g4SimHits*process.HcalSimHitsAnalyser) process.outpath = cms.EndPath(process.o1) process.g4SimHits.Physics.type = 'SimG4Core/Physics/QGSP_FTFP_BERT_EML' process.g4SimHits.Physics.DefaultCutValue = 0.1 -process.g4SimHits.HCalSD.UseShowerLibrary = False -process.g4SimHits.HCalSD.UseParametrize = True +process.g4SimHits.HCalSD.UseShowerLibrary = True +process.g4SimHits.HCalSD.UseParametrize = False process.g4SimHits.HCalSD.UsePMTHits = True process.g4SimHits.HCalSD.UseFibreBundleHits = True process.g4SimHits.HFShower.UseShowerLibrary = False diff --git a/SimG4Core/Application/plugins/OscarProducer.cc b/SimG4Core/Application/plugins/OscarProducer.cc index bfead42cd5faf..d7132112f73be 100644 --- a/SimG4Core/Application/plugins/OscarProducer.cc +++ b/SimG4Core/Application/plugins/OscarProducer.cc @@ -79,6 +79,9 @@ OscarProducer::OscarProducer(edm::ParameterSet const & p) produces("EcalHitsEE"); produces("EcalHitsES"); produces("HcalHits"); + produces("HGCHitsEE"); + produces("HGCHitsHE"); + produces("CFCHits"); produces("CaloHitsTk"); produces("MuonDTHits"); produces("MuonCSCHits"); diff --git a/SimG4Core/Application/python/g4SimHits_cfi.py b/SimG4Core/Application/python/g4SimHits_cfi.py index 1593f72c67f2f..d7a28466dd875 100644 --- a/SimG4Core/Application/python/g4SimHits_cfi.py +++ b/SimG4Core/Application/python/g4SimHits_cfi.py @@ -379,6 +379,21 @@ BHMSD = cms.PSet( Verbosity = cms.untracked.int32(0) ), + CFCSD = cms.PSet( + Verbosity = cms.untracked.int32(0), + TimeSliceUnit = cms.int32(1), + IgnoreTrackID = cms.bool(False), + EminHit = cms.double(0.0), + CFibre = cms.double(0.5), + ApplyFiducialCut = cms.bool(True), + FileName = cms.FileInPath('SimG4CMS/Calo/data/hfshowerlibrary_lhep_140_edm.root'), + ), + HGCSD = cms.PSet( + Verbosity = cms.untracked.int32(0), + TimeSliceUnit = cms.int32(1), + IgnoreTrackID = cms.bool(False), + EminHit = cms.double(0.0), + ), PltSD = cms.PSet( EnergyThresholdForPersistencyInGeV = cms.double(0.2), EnergyThresholdForHistoryInGeV = cms.double(0.05) diff --git a/Validation/HcalHits/src/HcalSimHitsValidation.cc b/Validation/HcalHits/src/HcalSimHitsValidation.cc index 53427a52c620e..ef827ab35394c 100644 --- a/Validation/HcalHits/src/HcalSimHitsValidation.cc +++ b/Validation/HcalHits/src/HcalSimHitsValidation.cc @@ -185,7 +185,7 @@ void HcalSimHitsValidation::analyze(edm::Event const& ev, edm::EventSetup const& double pt = (*p)->momentum().perp(); if(pt > maxPt) {npart++; maxPt = pt; phi_MC = phip; eta_MC = etap; } } - +//std::cout << "Tracks " << npart << " pt|eta|phi " << maxPt << ":" << eta_MC << ":" << phi_MC << std::endl; double partR = 0.3; @@ -206,7 +206,7 @@ void HcalSimHitsValidation::analyze(edm::Event const& ev, edm::EventSetup const& int ietaMax = 0; double HcalCone = 0; - +//int khit(0); c.get().get (geometry); for (std::vector::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) { @@ -214,8 +214,11 @@ void HcalSimHitsValidation::analyze(edm::Event const& ev, edm::EventSetup const& const CaloCellGeometry* cellGeometry = geometry->getSubdetectorGeometry (cell)->getGeometry (cell); double etaS = cellGeometry->getPosition().eta () ; double phiS = cellGeometry->getPosition().phi () ; - double en = SimHits->energy(); - + double en = SimHits->energy(); + /* + khit++; + std::cout << "Hit [" << khit << "] " << cell << " en|eta|phi " << en << ":" << etaS << ":" << phiS << std::endl; + */ int sub = cell.subdet(); int depth = cell.depth(); double ieta = cell.ieta(); @@ -240,49 +243,51 @@ void HcalSimHitsValidation::analyze(edm::Event const& ev, edm::EventSetup const& if (ieta > 0) ieta--; //HB - if (sub == 1){ - meSimHitsEnergyHB->Fill(en); - if (depth == 1){ - emean_vs_ieta_HB1->Fill(double(ieta), en); - occupancy_vs_ieta_HB1->Fill(double(ieta)); + if ( dbe_ ) { + if (sub == 1){ + meSimHitsEnergyHB->Fill(en); + if (depth == 1){ + emean_vs_ieta_HB1->Fill(double(ieta), en); + occupancy_vs_ieta_HB1->Fill(double(ieta)); + } + if (depth == 2){ + emean_vs_ieta_HB2->Fill(double(ieta), en); + occupancy_vs_ieta_HB2->Fill(double(ieta)); + } } - if (depth == 2){ - emean_vs_ieta_HB2->Fill(double(ieta), en); - occupancy_vs_ieta_HB2->Fill(double(ieta)); + //HE + if (sub == 2){ + meSimHitsEnergyHE->Fill(en); + if (depth == 1){ + emean_vs_ieta_HE1->Fill(double(ieta), en); + occupancy_vs_ieta_HE1->Fill(double(ieta)); + } + if (depth == 2){ + emean_vs_ieta_HE2->Fill(double(ieta), en); + occupancy_vs_ieta_HE2->Fill(double(ieta)); + } + if (depth == 3){ + emean_vs_ieta_HE3->Fill(double(ieta), en); + occupancy_vs_ieta_HE3->Fill(double(ieta)); + } } - } - //HE - if (sub == 2){ - meSimHitsEnergyHE->Fill(en); - if (depth == 1){ - emean_vs_ieta_HE1->Fill(double(ieta), en); - occupancy_vs_ieta_HE1->Fill(double(ieta)); - } - if (depth == 2){ - emean_vs_ieta_HE2->Fill(double(ieta), en); - occupancy_vs_ieta_HE2->Fill(double(ieta)); + //HO + if (sub == 3){ + meSimHitsEnergyHO->Fill(en); + emean_vs_ieta_HO->Fill(double(ieta), en); + occupancy_vs_ieta_HO->Fill(double(ieta)); } - if (depth == 3){ - emean_vs_ieta_HE3->Fill(double(ieta), en); - occupancy_vs_ieta_HE3->Fill(double(ieta)); - } - } - //HO - if (sub == 3){ - meSimHitsEnergyHO->Fill(en); - emean_vs_ieta_HO->Fill(double(ieta), en); - occupancy_vs_ieta_HO->Fill(double(ieta)); - } - //HF - if (sub == 4){ - meSimHitsEnergyHF->Fill(en); - if (depth == 1){ - emean_vs_ieta_HF1->Fill(double(ieta), en); - occupancy_vs_ieta_HF1->Fill(double(ieta)); - } - if (depth == 2){ - emean_vs_ieta_HF2->Fill(double(ieta), en); - occupancy_vs_ieta_HF2->Fill(double(ieta)); + //HF + if (sub == 4){ + meSimHitsEnergyHF->Fill(en); + if (depth == 1){ + emean_vs_ieta_HF1->Fill(double(ieta), en); + occupancy_vs_ieta_HF1->Fill(double(ieta)); + } + if (depth == 2){ + emean_vs_ieta_HF2->Fill(double(ieta), en); + occupancy_vs_ieta_HF2->Fill(double(ieta)); + } } } } @@ -329,10 +334,12 @@ void HcalSimHitsValidation::analyze(edm::Event const& ev, edm::EventSetup const& if (ietaMax != 0){ //If ietaMax == 0, there were no good HCAL SimHits if (ietaMax > 0) ietaMax--; //Account for lack of ieta = 0 - - meEnConeEtaProfile ->Fill(double(ietaMax), HcalCone); - meEnConeEtaProfile_E ->Fill(double(ietaMax), EcalCone); - meEnConeEtaProfile_EH ->Fill(double(ietaMax), HcalCone+EcalCone); + + if ( dbe_ ) { + meEnConeEtaProfile ->Fill(double(ietaMax), HcalCone); + meEnConeEtaProfile_E ->Fill(double(ietaMax), EcalCone); + meEnConeEtaProfile_EH ->Fill(double(ietaMax), HcalCone+EcalCone); + } } nevtot++;