diff --git a/DataFormats/CTPPSDetId/interface/CTPPSDetId.h b/DataFormats/CTPPSDetId/interface/CTPPSDetId.h index e2753e74f8e48..fa3a4be55be84 100644 --- a/DataFormats/CTPPSDetId/interface/CTPPSDetId.h +++ b/DataFormats/CTPPSDetId/interface/CTPPSDetId.h @@ -153,4 +153,13 @@ class CTPPSDetId : public DetId { std::ostream &operator<<(std::ostream &os, const CTPPSDetId &id); +namespace std { + template <> + struct hash { + typedef CTPPSDetId argument_type; + typedef std::size_t result_type; + result_type operator()(const argument_type &id) const noexcept { return std::hash()(id.rawId()); } + }; +} // namespace std + #endif diff --git a/Geometry/VeryForwardData/data/2021/v1/RP_220_Left_Station.xml b/Geometry/VeryForwardData/data/2021/v1/RP_220_Left_Station.xml new file mode 100644 index 0000000000000..76bb308f2c129 --- /dev/null +++ b/Geometry/VeryForwardData/data/2021/v1/RP_220_Left_Station.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/2021/v1/RP_220_Right_Station.xml b/Geometry/VeryForwardData/data/2021/v1/RP_220_Right_Station.xml new file mode 100644 index 0000000000000..915c3cdda26d4 --- /dev/null +++ b/Geometry/VeryForwardData/data/2021/v1/RP_220_Right_Station.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/2021/v1/Timing_Stations_Assembly.xml b/Geometry/VeryForwardData/data/2021/v1/Timing_Stations_Assembly.xml new file mode 100644 index 0000000000000..0889845266174 --- /dev/null +++ b/Geometry/VeryForwardData/data/2021/v1/Timing_Stations_Assembly.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Geometry/VeryForwardData/data/CTPPS_Timing_Stations_Assembly.xml b/Geometry/VeryForwardData/data/Timing_Stations_Assembly.xml similarity index 63% rename from Geometry/VeryForwardData/data/CTPPS_Timing_Stations_Assembly.xml rename to Geometry/VeryForwardData/data/Timing_Stations_Assembly.xml index 2e6254a3eb4ae..43ddc85375ebd 100644 --- a/Geometry/VeryForwardData/data/CTPPS_Timing_Stations_Assembly.xml +++ b/Geometry/VeryForwardData/data/Timing_Stations_Assembly.xml @@ -1,23 +1,24 @@ - + - - - + + + - - + + - + - + + - + diff --git a/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2016_cfi.py b/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2016_cfi.py index 37e7bbbabf487..cca78e2984290 100644 --- a/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2016_cfi.py +++ b/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2016_cfi.py @@ -91,7 +91,7 @@ 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Positive_Station.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Negative_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/Timing_Stations_Assembly.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', diff --git a/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2017_cfi.py b/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2017_cfi.py index 37e7bbbabf487..cca78e2984290 100644 --- a/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2017_cfi.py +++ b/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2017_cfi.py @@ -91,7 +91,7 @@ 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Positive_Station.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Negative_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/Timing_Stations_Assembly.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', diff --git a/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2018_cfi.py b/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2018_cfi.py index 4a4b33efd94c5..b36bb2afbce6a 100644 --- a/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2018_cfi.py +++ b/Geometry/VeryForwardGeometry/python/geometryIdealPPSFromDD_2018_cfi.py @@ -84,7 +84,7 @@ 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Positive_Station.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Negative_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/Timing_Stations_Assembly.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', diff --git a/Geometry/VeryForwardGeometry/python/geometryRPFromDB_cfi.py b/Geometry/VeryForwardGeometry/python/geometryRPFromDB_cfi.py index bfdf3d2a349bc..f297dccfab15e 100644 --- a/Geometry/VeryForwardGeometry/python/geometryRPFromDB_cfi.py +++ b/Geometry/VeryForwardGeometry/python/geometryRPFromDB_cfi.py @@ -10,3 +10,12 @@ verbosity = cms.untracked.uint32(1), compactViewTag = cms.string('XMLIdealGeometryESSource_CTPPS') ) + +from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016 +ctpps_2016.toModify(ctppsGeometryESModule, legacyDiamondHierarchy=cms.untracked.bool(True)) + +from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017 +ctpps_2017.toModify(ctppsGeometryESModule, legacyDiamondHierarchy=cms.untracked.bool(True)) + +from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018 +ctpps_2018.toModify(ctppsGeometryESModule, legacyDiamondHierarchy=cms.untracked.bool(True)) diff --git a/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2017_cfi.py b/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2017_cfi.py index 8449588967ed3..9d3a41464aad9 100644 --- a/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2017_cfi.py +++ b/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2017_cfi.py @@ -91,7 +91,7 @@ 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Positive_Station.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Negative_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/Timing_Stations_Assembly.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', diff --git a/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2018_cfi.py b/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2018_cfi.py index 0946d1a71b8e0..c4b62e7ad37c4 100644 --- a/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2018_cfi.py +++ b/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2018_cfi.py @@ -84,7 +84,7 @@ 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Positive_Station.xml', 'Geometry/VeryForwardData/data/CTPPS_Timing_Negative_Station.xml', - 'Geometry/VeryForwardData/data/CTPPS_Timing_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/Timing_Stations_Assembly.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', diff --git a/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2021_cfi.py b/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2021_cfi.py new file mode 100644 index 0000000000000..55269bf6c9585 --- /dev/null +++ b/Geometry/VeryForwardGeometry/python/geometryRPFromDD_2021_cfi.py @@ -0,0 +1,152 @@ +# TODO: for the moment this is just copy of the 2018 config !!! this needs updating !!! + +import FWCore.ParameterSet.Config as cms + +# common and strip files +totemGeomXMLFiles = cms.vstring( + 'Geometry/CMSCommonData/data/materials.xml', + 'Geometry/CMSCommonData/data/rotations.xml', + 'Geometry/CMSCommonData/data/extend/cmsextent.xml', + 'Geometry/CMSCommonData/data/cms/2017/v1/cms.xml', + 'Geometry/CMSCommonData/data/beampipe/2017/v1/beampipe.xml', + 'Geometry/CMSCommonData/data/cmsBeam.xml', + 'Geometry/CMSCommonData/data/cmsMother.xml', + 'Geometry/CMSCommonData/data/mgnt.xml', + 'Geometry/ForwardCommonData/data/forward.xml', + 'Geometry/ForwardCommonData/data/totemRotations.xml', + 'Geometry/ForwardCommonData/data/totemMaterials.xml', + 'Geometry/ForwardCommonData/data/totemt1.xml', + 'Geometry/ForwardCommonData/data/totemt2.xml', + 'Geometry/ForwardCommonData/data/ionpump.xml', + 'Geometry/VeryForwardData/data/RP_Box.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_000.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_001.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_002.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_003.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_004.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_005.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_020.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_021.xml', + #'Geometry/VeryForwardData/data/RP_Box/RP_Box_022.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_023.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_024.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_025.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_100.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_101.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_102.xml', + 'Geometry/VeryForwardData/data/RP_Box/2018/RP_Box_103.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_104.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_105.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_120.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_121.xml', + #'Geometry/VeryForwardData/data/RP_Box/RP_Box_122.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_123.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_124.xml', + 'Geometry/VeryForwardData/data/RP_Box/RP_Box_125.xml', + 'Geometry/VeryForwardData/data/RP_Hybrid.xml', + 'Geometry/VeryForwardData/data/RP_Materials.xml', + 'Geometry/VeryForwardData/data/RP_Transformations.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_000.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_001.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_002.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_004.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_005.xml', + #'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_022.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_024.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_025.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_100.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_101.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_102.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_104.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_105.xml', + #'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_122.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_124.xml', + 'Geometry/VeryForwardData/data/RP_Detectors_Assembly/RP_Detectors_Assembly_125.xml', + 'Geometry/VeryForwardData/data/RP_Device.xml', + 'Geometry/VeryForwardData/data/RP_Vertical_Device.xml', + 'Geometry/VeryForwardData/data/RP_Horizontal_Device.xml', + 'Geometry/VeryForwardData/data/2021/v1/RP_220_Right_Station.xml', + 'Geometry/VeryForwardData/data/2021/v1/RP_220_Left_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/RP_147_Right_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/RP_147_Left_Station.xml', + 'Geometry/VeryForwardData/data/RP_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/RP_Sensitive_Dets.xml', + 'Geometry/VeryForwardData/data/RP_Cuts_Per_Region.xml', + 'Geometry/VeryForwardData/data/RP_Param_Beam_Region.xml' + ) + +# diamond files +ctppsDiamondGeomXMLFiles = cms.vstring( + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Materials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Transformations.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_X_Distance.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Station_Parameters.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Horizontal_Pot.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Positive_Station.xml', + 'Geometry/VeryForwardData/data/CTPPS_Timing_Negative_Station.xml', + 'Geometry/VeryForwardData/data/2021/v1/Timing_Stations_Assembly.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern1_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern2_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern3_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_Segments/CTPPS_Diamond_Pattern4_Segment5.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane1.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane3.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Planes/CTPPS_Diamond_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_Diamond_2018/CTPPS_Diamond_Detector_Assembly.xml' + ) + +# UFSD files +ctppsUFSDGeomXMLFiles = cms.vstring( + # UFSDetectors + 'Geometry/VeryForwardData/data/CTPPS_UFSD_Segments/CTPPS_UFSD_Pattern1.xml', + 'Geometry/VeryForwardData/data/CTPPS_UFSD_Segments/CTPPS_UFSD_Pattern2_SegmentA.xml', + 'Geometry/VeryForwardData/data/CTPPS_UFSD_Segments/CTPPS_UFSD_Pattern2_SegmentB.xml', + 'Geometry/VeryForwardData/data/CTPPS_UFSD_Planes/CTPPS_UFSD_Plane4.xml', + 'Geometry/VeryForwardData/data/CTPPS_UFSD_Parameters.xml', + ) + +# Totem Timing files +totemTimingGeomXMLFiles = cms.vstring( + # UFSDetectors + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_Dist_Beam_Cent.xml', + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_DetectorAssembly.xml', + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_Parameters.xml', + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_Plane.xml', + 'Geometry/VeryForwardData/data/TotemTiming/TotemTiming_Station.xml', + ) + +# pixel files +ctppsPixelGeomXMLFiles = cms.vstring( + 'Geometry/VeryForwardData/data/ppstrackerMaterials.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_Module_2x2.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_023.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_123.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_003.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_2018/CTPPS_Pixel_Assembly_Box_Real_103.xml', + 'Geometry/VeryForwardData/data/CTPPS_Pixel_Sens.xml' + ) + +XMLIdealGeometryESSource_CTPPS = cms.ESSource("XMLIdealGeometryESSource", + geomXMLFiles = totemGeomXMLFiles + ctppsDiamondGeomXMLFiles + ctppsUFSDGeomXMLFiles + totemTimingGeomXMLFiles + ctppsPixelGeomXMLFiles, + rootNodeName = cms.string('cms:CMSE') + ) + +# position of RPs +XMLIdealGeometryESSource_CTPPS.geomXMLFiles.append("Geometry/VeryForwardData/data/2016_ctpps_15sigma_margin0/RP_Dist_Beam_Cent.xml") + +ctppsGeometryESModule = cms.ESProducer("CTPPSGeometryESModule", + verbosity = cms.untracked.uint32(1), + compactViewTag = cms.string('XMLIdealGeometryESSource_CTPPS') + ) diff --git a/Geometry/VeryForwardGeometryBuilder/plugins/CTPPSGeometryESModule.cc b/Geometry/VeryForwardGeometryBuilder/plugins/CTPPSGeometryESModule.cc index b0986f1ca31d5..5259617799d3f 100644 --- a/Geometry/VeryForwardGeometryBuilder/plugins/CTPPSGeometryESModule.cc +++ b/Geometry/VeryForwardGeometryBuilder/plugins/CTPPSGeometryESModule.cc @@ -81,9 +81,10 @@ class CTPPSGeometryESModule : public edm::ESProducer { const char* name); static void applyAlignments(const DetGeomDesc&, const CTPPSRPAlignmentCorrectionsData*, DetGeomDesc*&); - static void buildDetGeomDesc(DDFilteredView* fv, DetGeomDesc* gd); + void buildDetGeomDesc(DDFilteredView* fv, DetGeomDesc* gd) const; const unsigned int verbosity_; + const bool legacyDiamondHierarchy_; const edm::ESGetToken compactViewToken_; const GDTokens gdRealTokens_; @@ -98,6 +99,7 @@ class CTPPSGeometryESModule : public edm::ESProducer { CTPPSGeometryESModule::CTPPSGeometryESModule(const edm::ParameterSet& iConfig) : verbosity_(iConfig.getUntrackedParameter("verbosity")), + legacyDiamondHierarchy_(iConfig.getUntrackedParameter("legacyDiamondHierarchy")), compactViewToken_{setWhatProduced(this, &CTPPSGeometryESModule::produceIdealGD) .consumes(edm::ESInputTag( "" /*optional module label */, iConfig.getParameter("compactViewTag")))}, @@ -112,6 +114,7 @@ CTPPSGeometryESModule::CTPPSGeometryESModule(const edm::ParameterSet& iConfig) void CTPPSGeometryESModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.addUntracked("verbosity", 1); + desc.addUntracked("legacyDiamondHierarchy", false); desc.add("compactViewTag", std::string()); descriptions.add("DoodadESSource", desc); } @@ -174,7 +177,7 @@ void CTPPSGeometryESModule::applyAlignments(const DetGeomDesc& idealGD, //---------------------------------------------------------------------------------------------------- -void CTPPSGeometryESModule::buildDetGeomDesc(DDFilteredView* fv, DetGeomDesc* gd) { +void CTPPSGeometryESModule::buildDetGeomDesc(DDFilteredView* fv, DetGeomDesc* gd) const { // try to dive into next level if (!fv->firstChild()) return; @@ -261,11 +264,24 @@ void CTPPSGeometryESModule::buildDetGeomDesc(DDFilteredView* fv, DetGeomDesc* gd else if (name == DDD_CTPPS_DIAMONDS_SEGMENT_NAME || name == DDD_CTPPS_UFSD_SEGMENT_NAME) { const std::vector& copy_num = fv->copyNumbers(); + // check size of copy numbers array + if (copy_num.size() < 2) + throw cms::Exception("DDDTotemRPConstruction") + << "size of copyNumbers for diamond segments is " << copy_num.size() << ". It must be >= 2."; + + const unsigned int decRPId = copy_num[1]; + unsigned int arm, station, rp; + if (legacyDiamondHierarchy_) { + arm = decRPId - 1; + station = 1; + rp = 6; + } else { + arm = (decRPId / 100) / 10; + station = (decRPId / 10) % 10; + rp = decRPId % 10; + } const unsigned int id = copy_num[copy_num.size() - 1]; - const unsigned int arm = copy_num[1] - 1; - const unsigned int station = 1; - const unsigned int rp = 6; - const unsigned int plane = (id / 100); + const unsigned int plane = id / 100; const unsigned int channel = id % 100; newGD->setGeographicalID(CTPPSDiamondDetId(arm, station, rp, plane, channel)); @@ -275,14 +291,22 @@ void CTPPSGeometryESModule::buildDetGeomDesc(DDFilteredView* fv, DetGeomDesc* gd else if (name == DDD_CTPPS_DIAMONDS_RP_NAME) { const std::vector& copy_num = fv->copyNumbers(); - // check size of copy numubers array + // check size of copy numbers array if (copy_num.size() < 2) - throw cms::Exception("DDDTotemRPContruction") + throw cms::Exception("DDDTotemRPConstruction") << "size of copyNumbers for diamond RP is " << copy_num.size() << ". It must be >= 2."; - const unsigned int arm = copy_num[1] - 1; - const unsigned int station = 1; - const unsigned int rp = 6; + const unsigned int decRPId = copy_num[1]; + unsigned int arm, station, rp; + if (legacyDiamondHierarchy_) { + arm = decRPId - 1; + station = 1; + rp = 6; + } else { + arm = (decRPId / 100) % 10; + station = (decRPId / 10) % 10; + rp = decRPId % 10; + } newGD->setGeographicalID(CTPPSDiamondDetId(arm, station, rp)); } diff --git a/RecoPPS/Local/plugins/CTPPSDiamondLocalTrackFitter.cc b/RecoPPS/Local/plugins/CTPPSDiamondLocalTrackFitter.cc index a07904ba9cce7..3f96bac38f955 100644 --- a/RecoPPS/Local/plugins/CTPPSDiamondLocalTrackFitter.cc +++ b/RecoPPS/Local/plugins/CTPPSDiamondLocalTrackFitter.cc @@ -28,7 +28,6 @@ class CTPPSDiamondLocalTrackFitter : public edm::stream::EDProducer<> { public: explicit CTPPSDiamondLocalTrackFitter(const edm::ParameterSet&); - ~CTPPSDiamondLocalTrackFitter() override; static void fillDescriptions(edm::ConfigurationDescriptions&); @@ -36,65 +35,45 @@ class CTPPSDiamondLocalTrackFitter : public edm::stream::EDProducer<> { void produce(edm::Event&, const edm::EventSetup&) override; edm::EDGetTokenT > recHitsToken_; - CTPPSDiamondTrackRecognition trk_algo_45_; - CTPPSDiamondTrackRecognition trk_algo_56_; + const edm::ParameterSet trk_algo_params_; + std::unordered_map > trk_algo_; }; CTPPSDiamondLocalTrackFitter::CTPPSDiamondLocalTrackFitter(const edm::ParameterSet& iConfig) : recHitsToken_( consumes >(iConfig.getParameter("recHitsTag"))), - trk_algo_45_(iConfig.getParameter("trackingAlgorithmParams")), - trk_algo_56_(iConfig.getParameter("trackingAlgorithmParams")) { + trk_algo_params_(iConfig.getParameter("trackingAlgorithmParams")) { produces >(); } -CTPPSDiamondLocalTrackFitter::~CTPPSDiamondLocalTrackFitter() {} - void CTPPSDiamondLocalTrackFitter::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { + // prepare the output auto pOut = std::make_unique >(); edm::Handle > recHits; iEvent.getByToken(recHitsToken_, recHits); - const CTPPSDiamondDetId id_45(0, 1, 6, 0, 0), id_56(1, 1, 6, 0, 0); - - pOut->find_or_insert(id_45); // tracks in 4-5 - edm::DetSet& tracks56 = pOut->find_or_insert(id_56); // tracks in 5-6 - - // workaround to retrieve the detset for 4-5 without losing the reference - edm::DetSet& tracks45 = pOut->operator[](id_45); - // feed hits to the track producers for (const auto& vec : *recHits) { - const CTPPSDiamondDetId detid(vec.detId()); - for (const auto& hit : vec) { + const CTPPSDiamondDetId raw_detid(vec.detId()), detid(raw_detid.arm(), raw_detid.station(), raw_detid.rp()); + // if algorithm is not found, build it + if (trk_algo_.count(detid) == 0) + trk_algo_[detid].reset(new CTPPSDiamondTrackRecognition(trk_algo_params_)); + for (const auto& hit : vec) // skip hits without a leading edge - if (hit.ootIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING) - continue; - - switch (detid.arm()) { - case 0: { - trk_algo_45_.addHit(hit); - } break; - case 1: { - trk_algo_56_.addHit(hit); - } break; - default: - edm::LogWarning("CTPPSDiamondLocalTrackFitter") << "Invalid arm for rechit: " << detid.arm(); - break; - } - } + if (hit.ootIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING) + trk_algo_[detid]->addHit(hit); } - // retrieve the tracks for both arms - trk_algo_45_.produceTracks(tracks45); - trk_algo_56_.produceTracks(tracks56); + for (auto& algo_vs_id : trk_algo_) { + auto& tracks = pOut->find_or_insert(algo_vs_id.first); + // build the tracks for all stations + algo_vs_id.second->produceTracks(tracks); + // clear all hits to prepare for the next event + algo_vs_id.second->clear(); + } iEvent.put(std::move(pOut)); - - // remove all hits from the track producers to prepare for the next event - trk_algo_45_.clear(); - trk_algo_56_.clear(); } void CTPPSDiamondLocalTrackFitter::fillDescriptions(edm::ConfigurationDescriptions& descr) { diff --git a/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc b/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc index cba96e78b40c1..3ed23090ab219 100644 --- a/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc +++ b/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc @@ -411,8 +411,7 @@ void CTPPSProtonProducer::produce(edm::Event &iEvent, const edm::EventSetup &iSe continue; // interpolation from tracking RPs - const double z_ti = - -hGeometry->rpTranslation(tr_ti.rpId()).z(); // the minus sign fixes a bug in the diamond geometry + const double z_ti = hGeometry->rpTranslation(tr_ti.rpId()).z(); const double f_i = (z_ti - z_j) / (z_i - z_j), f_j = (z_i - z_ti) / (z_i - z_j); const double x_inter = f_i * tr_i.x() + f_j * tr_j.x(); const double x_inter_unc_sq = diff --git a/Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc b/Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc index d04fc363c0e78..e1e1fa1ce6070 100644 --- a/Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc +++ b/Validation/CTPPS/plugins/CTPPSDirectProtonSimulation.cc @@ -439,10 +439,6 @@ void CTPPSDirectProtonSimulation::processProton( const auto &gl_a1 = geometry.localToGlobal(detId, CTPPSGeometry::Vector(1, 0, 0)) - gl_o; const auto &gl_a2 = geometry.localToGlobal(detId, CTPPSGeometry::Vector(0, 1, 0)) - gl_o; - double gl_o_z = gl_o.z(); - if (detId.subdetId() == CTPPSDetId::sdTimingDiamond) - gl_o_z = -gl_o_z; // fix bug in diamond geometry - TMatrixD A(3, 3); TVectorD B(3); A(0, 0) = a_x; @@ -456,7 +452,7 @@ void CTPPSDirectProtonSimulation::processProton( A(2, 0) = z_sign; A(2, 1) = -gl_a1.z(); A(2, 2) = -gl_a2.z(); - B(2) = gl_o_z - z_scoringPlane; + B(2) = gl_o.z() - z_scoringPlane; TMatrixD Ai(3, 3); Ai = A.Invert(); TVectorD P(3); @@ -547,7 +543,7 @@ void CTPPSDirectProtonSimulation::processProton( 2. * x_half_width, gl_o.y(), 2. * y_half_width, - gl_o_z, + gl_o.z(), 2. * z_half_width, t0, tot,