Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:26

0001 /*
0002 // \class CSCGeometryBuilderFromDDD
0003 //
0004 //  Description: CSC Geometry Builder for DD4hep
0005 //              
0006 //
0007 // \author Sergio Lo Meo (sergio.lo.meo@cern.ch) following what Ianna Osburne made for DTs (DD4hep migration)
0008 //         Created:  Thu, 05 March 2020 
0009 //         Modified: Thu, 04 June 2020, following what made in PR #30047               
0010 //   
0011 //         Original author: Tim Cox
0012 */
0013 //
0014 #include "CSCGeometryBuilderFromDDD.h"
0015 #include "CSCGeometryBuilder.h"
0016 #include "Geometry/CSCGeometryBuilder/interface/CSCGeometryParsFromDD.h"
0017 #include "CondFormats/GeometryObjects/interface/RecoIdealGeometry.h"
0018 #include "CondFormats/GeometryObjects/interface/CSCRecoDigiParameters.h"
0019 #include "DetectorDescription/DDCMS/interface/DDFilteredView.h"
0020 #include "DetectorDescription/DDCMS/interface/DDCompactView.h"
0021 #include "FWCore/Utilities/interface/Exception.h"
0022 #include <utility>
0023 
0024 CSCGeometryBuilderFromDDD::CSCGeometryBuilderFromDDD() : myName("CSCGeometryBuilderFromDDD") {}
0025 
0026 CSCGeometryBuilderFromDDD::~CSCGeometryBuilderFromDDD() {}
0027 // DDD
0028 void CSCGeometryBuilderFromDDD::build(CSCGeometry& geom,
0029                                       const DDCompactView* cview,
0030                                       const MuonGeometryConstants& muonConstants) {
0031   RecoIdealGeometry rig;
0032   CSCRecoDigiParameters rdp;
0033 
0034   // simple class just really a method to get the parameters... but I want this method
0035   // available to classes other than CSCGeometryBuilderFromDDD so... simple class...
0036   CSCGeometryParsFromDD cscp;
0037   if (!cscp.build(cview, muonConstants, rig, rdp)) {
0038     throw cms::Exception("CSCGeometryBuilderFromDDD", "Failed to build the necessary objects from the DDD");
0039   }
0040   CSCGeometryBuilder realbuilder;
0041   realbuilder.build(geom, rig, rdp);
0042 }
0043 
0044 // for DD4hep
0045 
0046 void CSCGeometryBuilderFromDDD::build(CSCGeometry& geom,
0047                                       const cms::DDCompactView* cview,
0048                                       const MuonGeometryConstants& muonConstants) {
0049   RecoIdealGeometry rig;
0050   CSCRecoDigiParameters rdp;
0051 
0052   CSCGeometryParsFromDD cscp;
0053   if (!cscp.build(cview, muonConstants, rig, rdp)) {
0054     throw cms::Exception("CSCGeometryBuilderFromDDD", "Failed to build the necessary objects from the DD4hep");
0055   }
0056 
0057   CSCGeometryBuilder realbuilder;
0058   realbuilder.build(geom, rig, rdp);
0059 }