diff --git a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql index d2c66167e2f77fdb7f531147a93102d0f2cb0af3..419bd4e25c8f8fa7fb2e1d50bdfab7678249d77f 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql +++ b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql @@ -304,13 +304,14 @@ CREATE TABLE IF NOT EXISTS "CALOIDENTIFIER_DATA2TAG" ( -- Part 2a: HVS data -- -- Data for the HVS_NODE table -INSERT INTO "HVS_NODE" VALUES (0, "FASER", 0, 1, NULL); -INSERT INTO "HVS_NODE" VALUES (1, "Scintillator", 0, 1, NULL); -INSERT INTO "HVS_NODE" VALUES (11, "Veto", 1, 1, NULL); -INSERT INTO "HVS_NODE" VALUES (12, "Trigger", 1, 1, NULL); -INSERT INTO "HVS_NODE" VALUES (13, "Preshower", 1, 1, NULL); -INSERT INTO "HVS_NODE" VALUES (2, "Tracker", 0, 1, NULL); -INSERT INTO "HVS_NODE" VALUES (21, "SCT", 2, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (0, "FASER", 0, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (1, "Scintillator", 0, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (11, "Veto", 1, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (12, "Trigger", 1, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (13, "Preshower", 1, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (2, "Tracker", 0, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (21, "SCT", 2, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (22, "Dipole", 2, 1, NULL); INSERT INTO "HVS_NODE" VALUES (210, "SctTopLevel", 21, 0, NULL); INSERT INTO "HVS_NODE" VALUES (211, "SctBrlModule", 21, 0, NULL); INSERT INTO "HVS_NODE" VALUES (212, "SctBrlSensor", 21, 0, NULL); @@ -318,8 +319,10 @@ INSERT INTO "HVS_NODE" VALUES (213, "SctFaserGeneral", 21, 0, NULL); INSERT INTO "HVS_NODE" VALUES (214, "SctSwitches", 21, 0, NULL); INSERT INTO "HVS_NODE" VALUES (215, "SCTMaterials", 21, 0, NULL); INSERT INTO "HVS_NODE" VALUES (216, "SCTMatComponents", 21, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (220, "DipoleTopLevel", 22, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (221, "DipoleGeneral", 22, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (224, "DipoleSwitches", 22, 0, NULL); INSERT INTO "HVS_NODE" VALUES (3, "Calorimeter", 0, 1, NULL); -INSERT INTO "HVS_NODE" VALUES (4, "Magnet", 0, 1, NULL); INSERT INTO "HVS_NODE" VALUES (100, "Materials", 0, 1, NULL); INSERT INTO "HVS_NODE" VALUES (101, "StdMaterials", 100, 0, NULL); INSERT INTO "HVS_NODE" VALUES (102, "StdMatComponents", 100, 0, NULL); @@ -345,6 +348,7 @@ INSERT INTO "HVS_TAG2NODE" VALUES (0, "FASER-00", 100000, NULL, 0, 0, 1549238400 INSERT INTO "HVS_TAG2NODE" VALUES (1, "Scintillator-00", 100001, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (2, "Tracker-00", 100002, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (21, "SCT-00", 100026, NULL, 0, 0, 1567987200000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (22, "Dipole-00", 100027, NULL, 0, 0, 1568678400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (210, "SctTopLevel-00", 106788, NULL, 0, 0, 1567987200000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (211, "SctBarrelModule-00", 107003, NULL, 0, 0, 1567987200000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (212, "SctBarrelSensor-00", 106730, NULL, 0, 0, 1567987200000000000, NULL, 22); @@ -352,8 +356,10 @@ INSERT INTO "HVS_TAG2NODE" VALUES (213, "SctFaserGeneral-00", 106789, NULL, 0, 0 INSERT INTO "HVS_TAG2NODE" VALUES (214, "SctSwitches-00", 107782, NULL, 0, 0, 1567987200000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (215, "SctMaterials-00", 107777, NULL, 0, 0, 1567987200000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (216, "SctMatComponents-00", 107778, NULL, 0, 0, 1567987200000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (220, "DipoleTopLevel-00", 100029, NULL, 0, 0, 1568678400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (221, "DipoleGeneral-00", 100004, NULL, 0, 0, 1568678400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (224, "DipoleSwitches-00", 100028, NULL, 0, 0, 1568678400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (3, "Calorimeter-00", 100003, NULL, 0, 0, 1549238400000000000, NULL, 22); -INSERT INTO "HVS_TAG2NODE" VALUES (4, "Magnet-00", 100004, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (100, "Materials-00", 100005, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (101, "StdMaterials-00", 100006, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (102, "StdMatComponents-00", 100007, NULL, 0, 0, 1549238400000000000, NULL, 22); @@ -379,7 +385,6 @@ INSERT INTO "HVS_TAG2NODE" VALUES (3005, "CaloIdentifier-00", 100018, NULL, 0, 0 INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 1, 100001); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 2, 100002); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 3, 100003); -INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 4, 100004); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 100, 100005); INSERT INTO "HVS_LTAG2LTAG" VALUES (100, 100005, 101, 100006); INSERT INTO "HVS_LTAG2LTAG" VALUES (100, 100005, 102, 100007); @@ -399,6 +404,10 @@ INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 100026, 213, 106789); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 100026, 214, 107782); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 100026, 215, 107777); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 100026, 216, 107778); +INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 100002, 22, 100027); +INSERT INTO "HVS_LTAG2LTAG" VALUES (22, 100027, 220, 100029); +INSERT INTO "HVS_LTAG2LTAG" VALUES (22, 100027, 221, 100004); +INSERT INTO "HVS_LTAG2LTAG" VALUES (22, 100027, 224, 100028); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100003, 3003, 100023); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100003, 3004, 100024); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 110, 100013); @@ -421,8 +430,11 @@ INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "SctFaserGeneral", "SCTFaserGe INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "SctSwitches", "SCTSwitches-00", 107782); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "SCTMaterials", "SCTMaterials-00", 107777); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "SCTMatComponents", "SCTMatComponents-00", 107778); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "Dipole", "Dipole-00", 100027); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "DipoleTopLevel", "DipoleTopLevel-00", 100029); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "DipoleGeneral", "DipoleGeneral-00", 100004); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "DipoleSwitches", "DipoleSwitches-00", 100028); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "Calorimeter", "Calorimeter-00", 100003); -INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "Magnet", "Magnet-00", 100004); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "Materials", "Materials-00", 100005); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "StdMaterials", "StdMaterials-00", 100006); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-00", "StdMatComponents", "StdMatComponents-00", 100007); @@ -493,6 +505,7 @@ INSERT INTO "STDMATERIALS_DATA" VALUES (40,'Silica',0.7); INSERT INTO "STDMATERIALS_DATA" VALUES (41,'AlH6O3',2.42); INSERT INTO "STDMATERIALS_DATA" VALUES (42,'PyrogelXT',0.18); INSERT INTO "STDMATERIALS_DATA" VALUES (43,'Wolfram',19.3); +INSERT INTO "STDMATERIALS_DATA" VALUES (44,'Nd2Fe14B',5.8); -- INSERT INTO "STDMATERIALS_DATA2TAG" VALUES (100006, 0); INSERT INTO "STDMATERIALS_DATA2TAG" VALUES (100006, 1); @@ -538,6 +551,7 @@ INSERT INTO "STDMATERIALS_DATA2TAG" VALUES (100006, 40); INSERT INTO "STDMATERIALS_DATA2TAG" VALUES (100006, 41); INSERT INTO "STDMATERIALS_DATA2TAG" VALUES (100006, 42); INSERT INTO "STDMATERIALS_DATA2TAG" VALUES (100006, 43); +INSERT INTO "STDMATERIALS_DATA2TAG" VALUES (100006, 44); -- -- INSERT INTO "STDMATCOMPONENTS_DATA" VALUES (0,0,'Nitrogen',0.7494); @@ -664,6 +678,9 @@ INSERT INTO "STDMATCOMPONENTS_DATA" VALUES (120,42,'std::TiO2',0.05); INSERT INTO "STDMATCOMPONENTS_DATA" VALUES (121,42,'std::AlH6O3',0.05); INSERT INTO "STDMATCOMPONENTS_DATA" VALUES (122,39,'std::Viscose',0.7); INSERT INTO "STDMATCOMPONENTS_DATA" VALUES (123,43,'Wolfram',1.0); +INSERT INTO "STDMATCOMPONENTS_DATA" VALUES (124,44,'Neodymium',2.0); +INSERT INTO "STDMATCOMPONENTS_DATA" VALUES (125,44,'Iron',14.0); +INSERT INTO "STDMATCOMPONENTS_DATA" VALUES (126,44,'Boron',1.0); -- INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 0); INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 1); @@ -789,6 +806,9 @@ INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 120); INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 121); INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 122); INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 123); +INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 124); +INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 125); +INSERT INTO "STDMATCOMPONENTS_DATA2TAG" VALUES (100007, 126); -- -- INSERT INTO "ELEMENTS_DATA" VALUES (0,'Hydrogen','H',1.00797,1.0); @@ -978,9 +998,9 @@ INSERT INTO "ELEMENTS_DATA2TAG" VALUES (100008, 90); INSERT INTO "ELEMENTS_DATA2TAG" VALUES (100008, 91); -- -- -INSERT INTO "VETOTOPLEVEL_DATA" VALUES (0, 0.0, 0.0, -1650.0, 0.0, 0.0, 0.0, 321, "Veto"); -INSERT INTO "VETOTOPLEVEL_DATA" VALUES (1, 0.0, 0.0, -300.0, 0.0, 0.0, 0.0, 321, "StationA"); -INSERT INTO "VETOTOPLEVEL_DATA" VALUES (2, 0.0, 0.0, 300.0, 0.0, 0.0, 0.0, 321, "StationB"); +INSERT INTO "VETOTOPLEVEL_DATA" VALUES (0, 0.0, 0.0, -1725.0, 0.0, 0.0, 0.0, 321, "Veto"); +INSERT INTO "VETOTOPLEVEL_DATA" VALUES (1, 0.0, 0.0, -160.0, 0.0, 0.0, 0.0, 321, "StationA"); +INSERT INTO "VETOTOPLEVEL_DATA" VALUES (2, 0.0, 0.0, 160.0, 0.0, 0.0, 0.0, 321, "StationB"); INSERT INTO "VETOTOPLEVEL_DATA2TAG" VALUES (100009, 0); INSERT INTO "VETOTOPLEVEL_DATA2TAG" VALUES (100009, 1); INSERT INTO "VETOTOPLEVEL_DATA2TAG" VALUES (100009, 2); @@ -1044,10 +1064,10 @@ INSERT INTO "SCTBRLMODULE_DATA2TAG" VALUES(107003,0); -- DROP TABLE IF EXISTS "SCTTOPLEVEL_DATA"; CREATE TABLE "SCTTOPLEVEL_DATA" ( "SCTTOPLEVEL_DATA_ID" SLONGLONG ,"POSX" DOUBLE ,"POSY" DOUBLE ,"POSZ" DOUBLE ,"ROTX" DOUBLE ,"ROTY" DOUBLE ,"ROTZ" DOUBLE ,"ROTORDER" INT ,"LABEL" TEXT , UNIQUE ( "SCTTOPLEVEL_DATA_ID" ) ); -INSERT INTO "SCTTOPLEVEL_DATA" VALUES(0,0.0,0.0,-1000.0,0.0,0.0,0.0,312,'StationA'); +INSERT INTO "SCTTOPLEVEL_DATA" VALUES(0,0.0,0.0,-1200.0,0.0,0.0,0.0,312,'StationA'); INSERT INTO "SCTTOPLEVEL_DATA" VALUES(1,0.0,0.0, 0.0,0.0,0.0,0.0,312,'StationB'); -INSERT INTO "SCTTOPLEVEL_DATA" VALUES(2,0.0,0.0, 1000.0,0.0,0.0,0.0,312,'StationC'); -INSERT INTO "SCTTOPLEVEL_DATA" VALUES(3,0.0,0.0, 1000.0,0.0,0.0,0.0,312,'SCT'); +INSERT INTO "SCTTOPLEVEL_DATA" VALUES(2,0.0,0.0, 1200.0,0.0,0.0,0.0,312,'StationC'); +INSERT INTO "SCTTOPLEVEL_DATA" VALUES(3,0.0,0.0, 1290.0,0.0,0.0,0.0,312,'SCT'); DROP TABLE IF EXISTS "SCTTOPLEVEL_DATA2TAG"; CREATE TABLE "SCTTOPLEVEL_DATA2TAG" ( "SCTTOPLEVEL_TAG_ID" SLONGLONG ,"SCTTOPLEVEL_DATA_ID" SLONGLONG ); INSERT INTO "SCTTOPLEVEL_DATA2TAG" VALUES(106788,0); @@ -1058,7 +1078,7 @@ INSERT INTO "SCTTOPLEVEL_DATA2TAG" VALUES(106788,3); -- DROP TABLE IF EXISTS "SCTFASERGENERAL_DATA"; CREATE TABLE "SCTFASERGENERAL_DATA" ("SCTFASERGENERAL_DATA_ID" SLONGLONG, "NUMLAYERS" INT, "LAYERPITCH" DOUBLE, "ETAHALFPITCH" DOUBLE, "PHIHALFPITCH" DOUBLE, "DEPTHHALFPITCH" DOUBLE, "SIDEHALFPITCH" DOUBLE, UNIQUE ( "SCTFASERGENERAL_DATA_ID") ); -INSERT INTO "SCTFASERGENERAL_DATA" VALUES (0, 3, 100.0, 60.0, 30.0, 2.5, 2.5); +INSERT INTO "SCTFASERGENERAL_DATA" VALUES (0, 3, 65.0, 60.0, 30.0, 2.5, 2.5); DROP TABLE IF EXISTS "SCTFASERGENERAL_DATA2TAG"; CREATE TABLE "SCTFASERGENERAL_DATA2TAG" ( "SCTFASERGENERAL_TAG_ID" SLONGLONG ,"SCTFASERGENERAL_DATA_ID" SLONGLONG ); INSERT INTO "SCTFASERGENERAL_DATA2TAG" VALUES(106789, 0); @@ -1072,6 +1092,36 @@ CREATE TABLE "SCTSWITCHES_DATA2TAG" ( "SCTSWITCHES_TAG_ID" SLONGLONG ,"SCTSWITCH INSERT INTO "SCTSWITCHES_DATA2TAG" VALUES(107782,0); -- -- +DROP TABLE IF EXISTS "DIPOLESWITCHES_DATA"; +CREATE TABLE "DIPOLESWITCHES_DATA" ( "DIPOLESWITCHES_DATA_ID" SLONGLONG ,"DETECTORNAME" TEXT ,"G3COMPATIBLE" INT ,"G3DIGITSCOMPATIBLE" INT ,"DC2GEOMETRY" INT ,"USEMAGFIELDSVC" INT ,"COSMICLAYOUT" INT ,"VERSIONNAME" TEXT ,"LAYOUT" TEXT ,"DESCRIPTION" TEXT , UNIQUE ( "DIPOLESWITCHES_DATA_ID" ) ); +INSERT INTO "DIPOLESWITCHES_DATA" VALUES(0,'Dipole',0,0,0,1,0,'GEO','Prelim','Faser Geometry 2019'); +DROP TABLE IF EXISTS "DIPOLESWITCHES_DATA2TAG"; +CREATE TABLE "DIPOLESWITCHES_DATA2TAG" ( "DIPOLESWITCHES_TAG_ID" SLONGLONG ,"DIPOLESWITCHES_DATA_ID" SLONGLONG ); +INSERT INTO "DIPOLESWITCHES_DATA2TAG" VALUES(100028,0); +-- +-- +DROP TABLE IF EXISTS "DIPOLETOPLEVEL_DATA"; +CREATE TABLE "DIPOLETOPLEVEL_DATA" ( "DIPOLETOPLEVEL_DATA_ID" SLONGLONG ,"POSX" DOUBLE ,"POSY" DOUBLE ,"POSZ" DOUBLE ,"ROTX" DOUBLE ,"ROTY" DOUBLE ,"ROTZ" DOUBLE ,"ROTORDER" INT ,"LABEL" TEXT , UNIQUE ( "DIPOLETOPLEVEL_DATA_ID" ) ); +INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(0,0.0,0.0,-750.0,0.0,0.0,0.0,312,'UpstreamDipole'); +INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(1,0.0,0.0, 700.0,0.0,0.0,0.0,312,'CentralDipole'); +INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(2,0.0,0.0,1900.0,0.0,0.0,0.0,312,'DownstreamDipole'); +INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(3,0.0,0.0, 0.0,0.0,0.0,0.0,312,'Dipole'); +DROP TABLE IF EXISTS "DIPOLETOPLEVEL_DATA2TAG"; +CREATE TABLE "DIPOLETOPLEVEL_DATA2TAG" ( "DIPOLETOPLEVEL_TAG_ID" SLONGLONG ,"DIPOLETOPLEVEL_DATA_ID" SLONGLONG ); +INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(100029,0); +INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(100029,1); +INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(100029,2); +INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(100029,3); +-- +-- +DROP TABLE IF EXISTS "DIPOLEGENERAL_DATA"; +CREATE TABLE "DIPOLEGENERAL_DATA" ( "DIPOLEGENERAL_DATA_ID" SLONGLONG, "MATERIAL" TEXT, "INNERRAD" DOUBLE, "OUTERRAD" DOUBLE, "SHORTLENGTH" DOUBLE, "LONGLENGTH" DOUBLE, UNIQUE ( "DIPOLEGENERAL_DATA_ID") ); +INSERT INTO "DIPOLEGENERAL_DATA" VALUES(0, 'std::Nd2Fe14B', 100.0, 215.0, 1000.0, 1500.0); +DROP TABLE IF EXISTS "DIPOLEGENERAL_DATA2TAG"; +CREATE TABLE "DIPOLEGENERAL_DATA2TAG" ( "DIPOLEGENERAL_TAG_ID" SLONGLONG, "DIPOLEGENERAL_DATA_ID" SLONGLONG ); +INSERT INTO "DIPOLEGENERAL_DATA2TAG" VALUES(100004, 0); +-- +-- DROP TABLE IF EXISTS "SCTMATCOMPONENTS_DATA"; CREATE TABLE "SCTMATCOMPONENTS_DATA" ( "SCTMATCOMPONENTS_DATA_ID" SLONGLONG ,"MATERIAL_ID" SLONGLONG ,"COMPNAME" TEXT ,"FRACTION" DOUBLE , UNIQUE ( "SCTMATCOMPONENTS_DATA_ID" ) ); INSERT INTO "SCTMATCOMPONENTS_DATA" VALUES(201,50,'Carbon',0.4816); diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..d5171d36df13c1fe7670ac976fdb932aef3d93cd --- /dev/null +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py @@ -0,0 +1,60 @@ +# +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +def DipoleGeometryCfg (flags): + acc = ComponentAccumulator() + from DipoleGeoModel.DipoleGeoModelConfig import DipoleGeometryCfg + acc.merge(DipoleGeometryCfg( flags )) + return acc + + +if __name__ == "__main__": + import os + from AthenaCommon.Logging import log + from AthenaCommon.Constants import DEBUG + from AthenaCommon.Configurable import Configurable + from CalypsoConfiguration.AllConfigFlags import ConfigFlags + from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg + from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg + # Set up logging and new style config + log.setLevel(DEBUG) + Configurable.configurableRun3Behavior = True + ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-00") + # ConfigFlags.addFlag("Detector.SimulateVeto", True) + # ConfigFlags.addFlag("Detector.SimulateFaserSCT", True) + # ConfigFlags.addFlag("Detector.SimulateUpstreamDipole", True) + # ConfigFlags.addFlag("Detector.SimulateCentralDipole", True) + # ConfigFlags.addFlag("Detector.SimulateDownstreamDipole", True) + + # from AthenaConfiguration.TestDefaults import defaultTestFiles + # Provide MC input + # ConfigFlags.Input.Files = defaultTestFiles.HITS + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" + ConfigFlags.Detector.SimulateVeto = False + ConfigFlags.Detector.SimulateFaserSCT = False + ConfigFlags.Detector.SimulateUpstreamDipole = True + ConfigFlags.Detector.SimulateCentralDipole = True + ConfigFlags.Detector.SimulateDownstreamDipole = True + ConfigFlags.GeoModel.Align.Dynamic = False + # Provide data input + ##from AthenaConfiguration.TestDefaults import defaultTestFiles + # + ConfigFlags.lock() + # Construct ComponentAccumulator + acc = MainServicesSerialCfg() + acc.merge(PoolReadCfg(ConfigFlags)) + # acc.merge(ScintGeometryCfg(ConfigFlags)) + # acc.merge(FaserSCT_GeometryCfg(ConfigFlags)) + acc.merge(DipoleGeometryCfg(ConfigFlags)) + #acc.getService("StoreGateSvc").Dump=True + acc.getService("ConditionStore").Dump=True + acc.printConfig(withDetails=True) + f=open('DipoleGMCfg2.pkl','w') + acc.store(f) + f.close() + ConfigFlags.dump() + # Execute and finish + acc.run(maxEvents=3) diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py index 26510fcbbda41bcb6ceb3a581308d0a3a8ec7088..e4d950811f13bb86fec0f98678f96e6b9bc6afe5 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py @@ -7,10 +7,16 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator def FaserGeometryCfg (flags): acc = ComponentAccumulator() - from FaserGeoModel.ScintGMConfig import ScintGeometryCfg - acc.merge(ScintGeometryCfg(flags)) + if flags.Detector.SimulateScintillator or flags.Detector.GeometryScintillator: + from FaserGeoModel.ScintGMConfig import ScintGeometryCfg + acc.merge(ScintGeometryCfg(flags)) - from FaserGeoModel.SCTGMConfig import SctGeometryCfg - acc.merge(SctGeometryCfg(flags)) + if flags.Detector.SimulateTracker or flags.Detector.GeometryTracker: + from FaserGeoModel.SCTGMConfig import SctGeometryCfg + acc.merge(SctGeometryCfg(flags)) + + if flags.Detector.SimulateDipole or flags.Detector.GeometryDipole: + from FaserGeoModel.DipoleGMConfig import DipoleGeometryCfg + acc.merge(DipoleGeometryCfg(flags)) return acc diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelInit.py b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelInit.py index 3eea5bf7e0217f926debc78bb6bc00ddb1e0f292..a3cc6be03369d6ed62ae02bd3a78463ca83acbdc 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelInit.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelInit.py @@ -49,6 +49,11 @@ def _setupGeoModel(): geoModelSvc.DetectorTools += [ faserSCTDetectorTool ] + from DipoleGeoModel.DipoleGeoModelConf import DipoleTool + dipoleTool = DipoleTool( RDBAccessSvc = "RDBAccessSvc", + GeometryDBSvc = "TrackerGeometryDBSvc", + GeoDbTagSvc = "GeoDbTagSvc") + geoModelSvc.DetectorTools += [ dipoleTool ] pass diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py index e4815c75ce07c9a98352390d265f0269d7a8f48b..81803ece6f2361c770d9bf6452980c6039343068 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py @@ -22,15 +22,15 @@ if __name__ == "__main__": # Set up logging and new style config log.setLevel(DEBUG) Configurable.configurableRun3Behavior = True - ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-00") - ConfigFlags.addFlag("Detector.SimulateVeto", True) - ConfigFlags.addFlag("Detector.SimulateFaserSCT", True) + # ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-00") + # ConfigFlags.addFlag("Detector.SimulateVeto", True) + # ConfigFlags.addFlag("Detector.SimulateFaserSCT", True) # from AthenaConfiguration.TestDefaults import defaultTestFiles # Provide MC input # ConfigFlags.Input.Files = defaultTestFiles.HITS ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" - ConfigFlags.Detector.SimulateVeto = True + ConfigFlags.Detector.SimulateFaserSCT = True ConfigFlags.GeoModel.Align.Dynamic = False # Provide data input ##from AthenaConfiguration.TestDefaults import defaultTestFiles @@ -39,12 +39,12 @@ if __name__ == "__main__": # Construct ComponentAccumulator acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) - acc.merge(ScintGeometryCfg(ConfigFlags)) + # acc.merge(ScintGeometryCfg(ConfigFlags)) acc.merge(FaserSCT_GeometryCfg(ConfigFlags)) #acc.getService("StoreGateSvc").Dump=True acc.getService("ConditionStore").Dump=True acc.printConfig(withDetails=True) - f=open('ScintGMCfg2.pkl','w') + f=open('TrackerGMCfg2.pkl','w') acc.store(f) f.close() ConfigFlags.dump() diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py index 9d85ee3d484c5f11b53bd0b049955d4a3dc44a5f..35068f9a7f15a314aae05b95235f02cf47bce337 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py @@ -22,8 +22,8 @@ if __name__ == "__main__": # Set up logging and new style config log.setLevel(DEBUG) Configurable.configurableRun3Behavior = True - ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-00") - ConfigFlags.addFlag("Detector.SimulateVeto", True) + # ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-00") + # ConfigFlags.addFlag("Detector.SimulateVeto", True) # from AthenaConfiguration.TestDefaults import defaultTestFiles # Provide MC input diff --git a/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py b/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py index cc1d174dbbc46af0751ba31367edbf196e14622f..1d7386201d367ead8bf45b775327e91ef819af96 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py @@ -22,7 +22,11 @@ if __name__ == "__main__": ConfigFlags.Input.Files = defaultTestFiles.EVNT # ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01" ConfigFlags.GeoModel.FaserVersion = "FASER-00" - ConfigFlags.Detector.SimulateVeto = True + ConfigFlags.Detector.SimulateVeto = True + ConfigFlags.Detector.SimulateFaserSCT = True + ConfigFlags.Detector.SimulateUpstreamDipole = True + ConfigFlags.Detector.SimulateCentralDipole = True + ConfigFlags.Detector.SimulateDownstreamDipole = True ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() @@ -31,8 +35,8 @@ if __name__ == "__main__": acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(FaserGeometryCfg(ConfigFlags)) - #acc.getService("StoreGateSvc").Dump=True - acc.getService("ConditionStore").Dump=True + # acc.getService("StoreGateSvc").Dump=True + # acc.getService("ConditionStore").Dump=True # from GaudiCoreSvc.GaudiCoreSvcConf import MessageSvc # msgSvc = MessageSvc() diff --git a/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx b/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx index 3378010fca2eb6afbf8e248f7546ad31acb112ec..5c6b489c6d78ed3637a679f25bdd608bb7688c24 100644 --- a/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx +++ b/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx @@ -53,6 +53,9 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node) } else if (node == "SCT") { nodeOverrideTag = svc->sctVersionOverride(); trackerOverrideTag = svc->trackerVersionOverride(); + } else if (node == "Dipole") { + nodeOverrideTag = svc->dipoleVersionOverride(); + trackerOverrideTag = svc->trackerVersionOverride(); } else if (node == "Calorimeter") { nodeOverrideTag = svc->caloVersionOverride(); } else { diff --git a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoDbTagSvc.h b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoDbTagSvc.h index f9234a416c418c73c0825a2105a07f1acaf05815..172e0e9f9177dc4cd11cf1d7617842930178b191 100644 --- a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoDbTagSvc.h +++ b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoDbTagSvc.h @@ -33,7 +33,8 @@ class IGeoDbTagSvc : virtual public IInterface { virtual const std::string & triggerVersion() const =0; virtual const std::string & preshowerVersion() const =0; virtual const std::string & trackerVersion() const =0; - virtual const std::string & sctVersion() const =0; + virtual const std::string & sctVersion() const =0; + virtual const std::string & dipoleVersion() const =0; virtual const std::string & caloVersion() const =0; // virtual const std::string & magFieldVersion() const =0; // virtual const std::string & cavernInfraVersion() const =0; @@ -43,7 +44,8 @@ class IGeoDbTagSvc : virtual public IInterface { virtual const std::string & triggerVersionOverride() const =0; virtual const std::string & preshowerVersionOverride() const =0; virtual const std::string & trackerVersionOverride() const =0; - virtual const std::string & sctVersionOverride() const =0; + virtual const std::string & sctVersionOverride() const =0; + virtual const std::string & dipoleVersionOverride() const =0; virtual const std::string & caloVersionOverride() const =0; // virtual const std::string & magFieldVersionOverride() const =0; // virtual const std::string & cavernInfraVersionOverride() const =0; diff --git a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoModelSvc.h b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoModelSvc.h index cdd1177d4d01654d6d23043f42efc378bb511fdf..f115166405623b0e0a8933cbadc204c85991a27a 100644 --- a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoModelSvc.h +++ b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoModelSvc.h @@ -32,6 +32,7 @@ public: virtual const std::string & preshowerVersion() const =0; virtual const std::string & trackerVersion() const =0; virtual const std::string & sctVersion() const =0; + virtual const std::string & dipoleVersion() const =0; virtual const std::string & caloVersion() const =0; // virtual const std::string & magFieldVersion() const =0; // virtual const std::string & cavernInfraVersion() const =0; @@ -41,6 +42,7 @@ public: virtual const std::string & triggerVersionOverride() const =0; virtual const std::string & preshowerVersionOverride() const =0; virtual const std::string & trackerVersionOverride() const =0; + virtual const std::string & dipoleVersionOverride() const =0; virtual const std::string & sctVersionOverride() const =0; virtual const std::string & caloVersionOverride() const =0; // virtual const std::string & magFieldVersionOverride() const =0; diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx index f2f84287d9f33b5190eb6bdd405e1da51601695e..5ef46ab1e725311d0d06672b3c32863ddc6c4be1 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx @@ -91,6 +91,10 @@ StatusCode GeoDbTagSvc::setupTags() ? rdbAccessSvc->getChildTag("SCT", m_FaserVersion, "Tracker", "FASERDD") : m_SCTVersionOverride); + m_DipoleVersion = (m_DipoleVersionOverride.empty() + ? rdbAccessSvc->getChildTag("Dipole", m_FaserVersion, "Tracker", "FASERDD") + : m_SCTVersionOverride); + m_CaloVersion = (m_CaloVersionOverride.empty() ? rdbAccessSvc->getChildTag("Calorimeter", m_FaserVersion,"FASER", "FASERDD") : m_CaloVersionOverride); diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.h b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.h index db053c9316c07052889fde90692117e5a7d16848..ae018ab5f19d2d7f6c6208f06720eac6c3f02f1c 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.h +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.h @@ -34,6 +34,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc void setPreshowerVersionOverride(const std::string& tag) { m_PreshowerVersionOverride=tag; } void setTrackerVersionOverride(const std::string& tag) { m_TrackerVersionOverride=tag; } void setSCTVersionOverride(const std::string& tag) { m_SCTVersionOverride=tag; } + void setDipoleVersionOverride(const std::string& tag) { m_DipoleVersionOverride=tag; } void setCaloVersionOverride(const std::string& tag) { m_CaloVersionOverride=tag; } // void setMagFieldVersionOverride(const std::string& tag) { m_MagFieldVersionOverride=tag; } // void setCavernInfraVersionOverride(const std::string& tag) { m_CavernInfraVersionOverride=tag; } @@ -49,6 +50,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc const std::string & preshowerVersionOverride() const { return m_PreshowerVersionOverride; } const std::string & trackerVersionOverride() const { return m_TrackerVersionOverride; } const std::string & sctVersionOverride() const { return m_SCTVersionOverride; } + const std::string & dipoleVersionOverride() const { return m_DipoleVersionOverride; } const std::string & caloVersionOverride() const { return m_CaloVersionOverride; } // const std::string & magFieldVersionOverride() const { return m_MagFieldVersionOverride; } // const std::string & cavernInfraVersionOverride() const { return m_CavernInfraVersionOverride; } @@ -59,6 +61,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc const std::string & preshowerVersion() const { return m_PreshowerVersion; } const std::string & trackerVersion() const { return m_TrackerVersion; } const std::string & sctVersion() const { return m_SCTVersion; } + const std::string & dipoleVersion() const { return m_DipoleVersion; } const std::string & caloVersion() const { return m_CaloVersion; } // const std::string & magFieldVersion() const { return m_MagFieldVersion; } // const std::string & cavernInfraVersion() const { return m_CavernInfraVersion; } @@ -74,6 +77,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc std::string m_PreshowerVersion; std::string m_TrackerVersion; std::string m_SCTVersion; + std::string m_DipoleVersion; std::string m_CaloVersion; // std::string m_MagFieldVersion; // std::string m_CavernInfraVersion; @@ -84,6 +88,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc std::string m_PreshowerVersionOverride; std::string m_TrackerVersionOverride; std::string m_SCTVersionOverride; + std::string m_DipoleVersionOverride; std::string m_CaloVersionOverride; // std::string m_MagFieldVersionOverride; // std::string m_CavernInfraVersionOverride; diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx index 22c78634afb1ff57635a513bb61f3629efe5dd91..831d20e660cb3c6f53aa0b37604f9d0ee15fd082 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx @@ -61,6 +61,7 @@ GeoModelSvc::GeoModelSvc(const std::string& name,ISvcLocator* svc) declareProperty( "PreshowerVersionOverride", m_PreshowerVersionOverride); declareProperty( "TrackerVersionOverride", m_TrackerVersionOverride); declareProperty( "SCTVersionOverride", m_SCTVersionOverride); + declareProperty( "DipoleVersionOverride", m_DipoleVersionOverride); declareProperty( "CaloVersionOverride", m_CaloVersionOverride); // declareProperty( "MagFieldVersionOverride", m_MagFieldVersionOverride); // declareProperty( "CavernInfraVersionOverride", m_CavernInfraVersionOverride); @@ -244,6 +245,8 @@ StatusCode GeoModelSvc::geoInit() ATH_MSG_DEBUG("* Trigger tag: " << m_TriggerVersionOverride); ATH_MSG_DEBUG("* Preshower tag: " << m_PreshowerVersionOverride); ATH_MSG_DEBUG("* Tracker tag: " << m_TrackerVersionOverride); + ATH_MSG_DEBUG("* SCT tag: " << m_SCTVersionOverride); + ATH_MSG_DEBUG("* Dipole tag: " << m_DipoleVersionOverride); ATH_MSG_DEBUG("* Calo tag: " << m_CaloVersionOverride); // ATH_MSG_DEBUG("* MagField tag: " << m_MagFieldVersionOverride); // ATH_MSG_DEBUG("* CavernInfra tag: " << m_CavernInfraVersionOverride); @@ -310,6 +313,8 @@ StatusCode GeoModelSvc::geoInit() dbTagSvc->setTriggerVersionOverride(m_TriggerVersionOverride); dbTagSvc->setPreshowerVersionOverride(m_PreshowerVersionOverride); dbTagSvc->setTrackerVersionOverride(m_TrackerVersionOverride); + dbTagSvc->setSCTVersionOverride(m_SCTVersionOverride); + dbTagSvc->setDipoleVersionOverride(m_DipoleVersionOverride); dbTagSvc->setCaloVersionOverride(m_CaloVersionOverride); // dbTagSvc->setMagFieldVersionOverride(m_MagFieldVersionOverride); // dbTagSvc->setCavernInfraVersionOverride(m_CavernInfraVersionOverride); @@ -484,6 +489,10 @@ StatusCode GeoModelSvc::compareTags(IOVSVC_CALLBACK_ARGS) tagsMatch = m_PreshowerVersionOverride == pair.second; else if(tagPairName=="GeoTracker") tagsMatch = m_TrackerVersionOverride == pair.second; + else if(tagPairName=="GeoSCT") + tagsMatch = m_SCTVersionOverride == pair.second; + else if(tagPairName=="GeoDipole") + tagsMatch = m_DipoleVersionOverride == pair.second; else if(tagPairName=="GeoCalo") tagsMatch = m_CaloVersionOverride == pair.second; @@ -500,6 +509,8 @@ StatusCode GeoModelSvc::compareTags(IOVSVC_CALLBACK_ARGS) ATH_MSG_INFO("* Trigger tag: " << m_TriggerVersionOverride); ATH_MSG_INFO("* Preshower tag: " << m_PreshowerVersionOverride); ATH_MSG_INFO("* Tracker tag: " << m_TrackerVersionOverride); + ATH_MSG_INFO("* SCT tag: " << m_SCTVersionOverride); + ATH_MSG_INFO("* Dipole tag: " << m_DipoleVersionOverride); ATH_MSG_INFO("* Calo tag: " << m_CaloVersionOverride); // ATH_MSG_INFO("* MagField tag: " << m_MagFieldVersionOverride); // ATH_MSG_INFO("* CavernInfra tag: " << m_CavernInfraVersionOverride); @@ -518,6 +529,10 @@ StatusCode GeoModelSvc::compareTags(IOVSVC_CALLBACK_ARGS) ATH_MSG_INFO("*Preshower tag: " << pair.second); else if(tagPairName=="GeoTracker") ATH_MSG_INFO("*Tracker tag: " << pair.second); + else if(tagPairName=="GeoSCT") + ATH_MSG_INFO("*SCT tag: " << pair.second); + else if(tagPairName=="GeoDipole") + ATH_MSG_INFO("*Dipole tag: " << pair.second); else if(tagPairName=="GeoCalo") ATH_MSG_INFO("*Calo tag: " << pair.second); // else if(tagPairName=="GeoMagField") @@ -587,6 +602,20 @@ StatusCode GeoModelSvc::fillTagInfo() const } } + if(m_SCTVersionOverride != "") { + if(m_tagInfoMgr->addTag("GeoSCT",m_SCTVersionOverride).isFailure()) { + ATH_MSG_ERROR("GeoModelSvc SCT tag: " << m_SCTVersionOverride << " not added to TagInfo "); + return StatusCode::FAILURE; + } + } + + if(m_DipoleVersionOverride != "") { + if(m_tagInfoMgr->addTag("GeoDipole",m_DipoleVersionOverride).isFailure()) { + ATH_MSG_ERROR("GeoModelSvc Dipole tag: " << m_DipoleVersionOverride << " not added to TagInfo "); + return StatusCode::FAILURE; + } + } + if(m_CaloVersionOverride != "") { if(m_tagInfoMgr->addTag("GeoCalo",m_CaloVersionOverride).isFailure()) { ATH_MSG_ERROR("GeoModelSvc Calo tag: " << m_CaloVersionOverride << " not added to TagInfo "); diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.h b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.h index c08a614186c60e978e80c0254b5bfa3341dccdf0..0a78e27581c902392a733dc811d9b50efe231b66 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.h +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.h @@ -78,6 +78,7 @@ private: std::string m_PreshowerVersionOverride; std::string m_TrackerVersionOverride; std::string m_SCTVersionOverride; + std::string m_DipoleVersionOverride; std::string m_CaloVersionOverride; // std::string m_MagFieldVersionOverride; // std::string m_CavernInfraVersionOverride; @@ -101,6 +102,7 @@ private: const std::string & preshowerVersionOverride() const {return m_PreshowerVersionOverride ;} const std::string & trackerVersionOverride() const {return m_TrackerVersionOverride ;} const std::string & sctVersionOverride() const {return m_SCTVersionOverride ;} + const std::string & dipoleVersionOverride() const {return m_DipoleVersionOverride; } const std::string & caloVersionOverride() const {return m_CaloVersionOverride ;} // const std::string & magFieldVersionOverride() const {return m_MagFieldVersionOverride ;} // const std::string & cavernInfraVersionOverride() const {return m_CavernInfraVersionOverride ;} @@ -111,6 +113,7 @@ private: const std::string & preshowerVersion() const {return m_geoDbTagSvc->preshowerVersion(); } const std::string & trackerVersion() const {return m_geoDbTagSvc->trackerVersion(); } const std::string & sctVersion() const {return m_geoDbTagSvc->sctVersion(); } + const std::string & dipoleVersion() const {return m_geoDbTagSvc->dipoleVersion(); } const std::string & caloVersion() const {return m_geoDbTagSvc->caloVersion(); } // const std::string & magFieldVersion() const {return m_geoDbTagSvc->magFieldVersion(); } // const std::string & cavernInfraVersion() const {return m_geoDbTagSvc->cavernInfraVersion(); } diff --git a/DetectorDescription/GeoModel/GeoModelTest/python/GeoModelTestConfig.py b/DetectorDescription/GeoModel/GeoModelTest/python/GeoModelTestConfig.py index 8b0d37d45dede35297a830b245d9ceda8481a869..24fd688cbbaec45c2329f3cf0af57782271d1a96 100644 --- a/DetectorDescription/GeoModel/GeoModelTest/python/GeoModelTestConfig.py +++ b/DetectorDescription/GeoModel/GeoModelTest/python/GeoModelTestConfig.py @@ -26,6 +26,11 @@ if __name__ == "__main__": ConfigFlags.GeoModel.FaserVersion = "FASER-00" ConfigFlags.GeoModel.GeoExportFile = "faserGeo.db" ConfigFlags.GeoModel.Align.Dynamic = False + ConfigFlags.Detector.SimulateVeto = True + ConfigFlags.Detector.SimulateFaserSCT = True + ConfigFlags.Detector.SimulateUpstreamDipole = True + ConfigFlags.Detector.SimulateCentralDipole = True + ConfigFlags.Detector.SimulateDownstreamDipole = True ConfigFlags.lock() # ConfigFlags.dump() diff --git a/Simulation/G4Faser/G4FaserApp/test/runG4.py b/Simulation/G4Faser/G4FaserApp/test/runG4.py index 09832c329434257fba89b90f29947823487e380a..ed4ded1d9fc89f994614798905fc60ee89522b99 100644 --- a/Simulation/G4Faser/G4FaserApp/test/runG4.py +++ b/Simulation/G4Faser/G4FaserApp/test/runG4.py @@ -44,7 +44,7 @@ if __name__ == "__main__": ConfigFlags.ProjectName = "mc19" ConfigFlags.Common.isOnline = False ConfigFlags.Beam.Type = "collisions" - ConfigFlags.Beam.Energy = 7*TeV + ConfigFlags.Beam.Energy = 7*TeV # Informational, does not affect simulation ConfigFlags.GeoModel.FaserVersion = "FASER-00" # Always needed ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-14" # Always needed # Workaround for bug/missing flag; unimportant otherwise @@ -68,6 +68,12 @@ if __name__ == "__main__": ConfigFlags.Detector.GeometryVeto = True ConfigFlags.Detector.SimulateFaserSCT = True ConfigFlags.Detector.GeometryFaserSCT = True + ConfigFlags.Detector.SimulateUpstreamDipole = True + ConfigFlags.Detector.SimulateCentralDipole = True + ConfigFlags.Detector.SimulateDownstreamDipole = True + ConfigFlags.Detector.GeometryUpstreamDipole = True + ConfigFlags.Detector.GeometryCentralDipole = True + ConfigFlags.Detector.GeometryDownstreamDipole = True ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Sim.ReleaseGeoModel = False # diff --git a/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py b/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py index 7cc2a317a8144e1f63a96cab1dea4bc27063b1e1..f1722d2cd319ad76c8b8421eaaa90b34c137cc12 100644 --- a/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py +++ b/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py @@ -8,6 +8,7 @@ from G4AtlasTools.G4AtlasToolsConf import CylindricalEnvelope, PolyconicalEnvelo from AthenaCommon.SystemOfUnits import mm, cm, m from VetoGeoModel.VetoGeoModelConfig import VetoGeometryCfg from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg +from DipoleGeoModel.DipoleGeoModelConfig import DipoleGeometryCfg #ToDo - finish migrating this (dnoel) #Todo - just return component accumulator @@ -26,6 +27,12 @@ def SCTGeoDetectorToolCfg(ConfigFlags, name='SCT', **kwargs): kwargs.setdefault("DetectorName", "SCT") return result, GeoDetectorTool(name, **kwargs) +def DipoleGeoDetectorToolCfg(ConfigFlags, name='Dipole', **kwargs): + #set up geometry + result=DipoleGeometryCfg(ConfigFlags) + kwargs.setdefault("DetectorName", "Dipole") + return result, GeoDetectorTool(name, **kwargs) + def generateSubDetectorList(ConfigFlags): result = ComponentAccumulator() SubDetectorList=[] @@ -40,6 +47,11 @@ def generateSubDetectorList(ConfigFlags): SubDetectorList += [ toolSCT ] result.merge(accSCT) + if ConfigFlags.Detector.SimulateDipole: + accDipole, toolDipole = DipoleGeoDetectorToolCfg(ConfigFlags) + SubDetectorList += [ toolDipole ] + result.merge(accDipole) + return result, SubDetectorList def FASEREnvelopeCfg(ConfigFlags, name="Faser", **kwargs): diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/CMakeLists.txt b/Tracker/TrackerDetDescr/DipoleGeoModel/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c0a38bf6fadbbeb2cf1139f11e890fad97c4f87b --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/CMakeLists.txt @@ -0,0 +1,45 @@ +################################################################################ +# Package: DipoleGeoModel +################################################################################ + +# Declare the package name: +atlas_subdir( DipoleGeoModel ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Control/AthenaKernel + Database/RDBAccessSvc + DetectorDescription/GeoModel/GeoModelFaserUtilities + DetectorDescription/GeoModel/GeoModelUtilities + DetectorDescription/GeoPrimitives + GaudiKernel + Tracker/TrackerDetDescr/TrackerGeoModelUtils + PRIVATE + Control/SGTools + Control/StoreGate + Database/AthenaPOOL/AthenaPoolUtilities + DetectorDescription/DetDescrCond/DetDescrConditions + DetectorDescription/GeoModel/GeoModelInterfaces + DetectorDescription/GeometryDBSvc + ) + +# External dependencies: +find_package( Boost COMPONENTS filesystem thread system ) +find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess ) +find_package( Eigen ) +find_package( GeoModel ) + +# Component(s) in the package: +atlas_add_component( DipoleGeoModel + src/*.cxx + src/components/*.cxx + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODEL_LIBRARIES} AthenaKernel GeoModelFaserUtilities GeoModelUtilities GaudiKernel TrackerGeoModelUtils SGTools StoreGateLib SGtests AthenaPoolUtilities DetDescrConditions ) + +atlas_add_test( DipoleGMConfig_test + SCRIPT test/DipoleGMConfig_test.py + PROPERTIES TIMEOUT 300 ) + +# Install files from the package: +atlas_install_python_modules( python/*.py ) +atlas_install_scripts( test/*.py ) diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleDataBase.h b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleDataBase.h new file mode 100644 index 0000000000000000000000000000000000000000..0e44163469241251bf38f77141c12350b87448d8 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleDataBase.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef DipoleGeoModel_DipoleDataBase_H +#define DipoleGeoModel_DipoleDataBase_H + +#include "TrackerGeoModelUtils/TrackerDDAthenaComps.h" +#include <string> + +#include "RDBAccessSvc/IRDBAccessSvc.h" +class IRDBRecord; + + +class DipoleDataBase +{ + + +public: + + DipoleDataBase(const TrackerDD::AthenaComps* athenaComps); + + const TrackerDD::AthenaComps* athenaComps() const; + + IRDBRecordset_ptr weightTable() const; + IRDBRecordset_ptr scalingTable() const; + IRDBRecordset_ptr topLevelTable() const; + + // IRDBRecordset_ptr conditionsTable() const; + // const IRDBRecord* conditions() const; + + const IRDBRecord* dipoleGeneral() const; + // Return the Dipole version tag. + const std::string & versionTag() const; + + MsgStream& msg (MSG::Level lvl) const; + +private: + + DipoleDataBase(const DipoleDataBase &); + DipoleDataBase& operator= (const DipoleDataBase &); + +private: + + const TrackerDD::AthenaComps* m_athenaComps; + + std::string m_dipoleVersionTag; + + IRDBRecordset_ptr m_weightTable; + IRDBRecordset_ptr m_scalingTable; + IRDBRecordset_ptr m_topLevel; + // IRDBRecordset_ptr m_conditions; + + IRDBRecordset_ptr m_dipoleGeneral; + +}; + +#endif //DipoleGeoModel_DipoleDataBase_H diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleFactory.h b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleFactory.h new file mode 100644 index 0000000000000000000000000000000000000000..ba8c8fb3255991004147513e9d7133017831ae61 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleFactory.h @@ -0,0 +1,42 @@ +#ifndef DIPOLEGEOMODEL_DIPOLEFACTORY_H +#define DIPOLEGEOMODEL_DIPOLEFACTORY_H + + +#include "TrackerGeoModelUtils/TrackerDetectorFactoryBase.h" +#include "DipoleGeoModel/DipoleManager.h" + +namespace TrackerDD { + class AthenaComps; +} + +class DipoleDataBase; + +class DipoleFactory : public TrackerDD::DetectorFactoryBase { + + public: + + // Constructor: + DipoleFactory(const TrackerDD::AthenaComps * athenaComps); + + // Destructor: + ~DipoleFactory(); + + // Creation of geometry: + virtual void create(GeoPhysVol *world); + // manager + virtual const TrackerDD::DipoleManager* getDetectorManager () const; + +private: + + // Illegal operations: + const DipoleFactory & operator=(const DipoleFactory &right); + DipoleFactory(const DipoleFactory &right); + + // private data + TrackerDD::DipoleManager *m_manager; + DipoleDataBase* m_db; +}; + +#endif // DIPOLEGEOMODEL_DIPOLEFACTORY_H + + diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleGeneralParameters.h b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleGeneralParameters.h new file mode 100644 index 0000000000000000000000000000000000000000..74b1be19d37fa69c814a9faea509664bbd27f8ec --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleGeneralParameters.h @@ -0,0 +1,51 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef DipoleGeoModel_DipoleGeneralParameters_H +#define DipoleGeoModel_DipoleGeneralParameters_H + +#include "GeoModelKernel/GeoDefinitions.h" + +#include <map> +#include <string> + +class DipoleDataBase; +class TopLevelPlacements; + +class DipoleGeneralParameters { + +public: + + DipoleGeneralParameters(DipoleDataBase* rdb); + ~DipoleGeneralParameters(); + //Explicitly disallow copy, assignment to appease coverity + DipoleGeneralParameters(const DipoleGeneralParameters &) = delete; + DipoleGeneralParameters & operator=(const DipoleGeneralParameters &) = delete; + + // General + double safety() const; + + //Default conditions. + // double temperature() const; + // double biasVoltage() const; + // double depletionVoltage() const; + + const GeoTrf::Transform3D & partTransform(const std::string & partName) const; + bool partPresent(const std::string & partName) const; + + std::string material() const; + double innerRadius() const; + double outerRadius() const; + double shortLength() const; + double longLength() const; + +private: + + DipoleDataBase * m_rdb; + TopLevelPlacements * m_placements; + +}; + + +#endif // DipoleGeoModel_DipoleGeneralParameters_H diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleGeoModelAthenaComps.h b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleGeoModelAthenaComps.h new file mode 100644 index 0000000000000000000000000000000000000000..a51e7902296a294dad240423fe5cced749177c6c --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleGeoModelAthenaComps.h @@ -0,0 +1,24 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef DipoleGeoModel_DipoleGeoModelAthenaComps_H +#define DipoleGeoModel_DipoleGeoModelAthenaComps_H + +#include "TrackerGeoModelUtils/TrackerDDAthenaComps.h" + + +/// Class to hold various Athena components +class DipoleGeoModelAthenaComps : public TrackerDD::AthenaComps { + +public: + + DipoleGeoModelAthenaComps(); + + +private: + +}; + +#endif // SCT_GeoModel_SCT_GeoModelAthenaComps_H + diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleManager.h b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleManager.h new file mode 100644 index 0000000000000000000000000000000000000000..98595c0e703c393cc26d25685869298be470c058 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleManager.h @@ -0,0 +1,57 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// This is an implemetation of the GeoVDetectorManager which +// is needed by Geo2G4 to get the treetop of the geoetry to +// have the conversion to G4. Only the basic methods are implemented +// + + +#ifndef DIPOLEGEOMODEL_DIPOLEMANAGER_H +#define DIPOLEGEOMODEL_DIPOLEMANAGER_H + +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoVDetectorManager.h" +#include "AthenaKernel/CLASS_DEF.h" + + +namespace TrackerDD { + +class DipoleManager : public GeoVDetectorManager { + + public: + + // Constructor + DipoleManager( ); + + // Destructor + ~DipoleManager(); + + // Access to raw geometry: + virtual unsigned int getNumTreeTops() const; + virtual PVConstLink getTreeTop(unsigned int i) const; + + // Add a Tree top: + void addTreeTop(PVLink); + + private: + // prevent copy and assignment + const DipoleManager & operator=(const DipoleManager &right); + DipoleManager(const DipoleManager &right); + + // data members + std::vector<PVLink> m_volume; +}; + +} // namespace TrackerDD + +CLASS_DEF(TrackerDD::DipoleManager, 123016984, 1) + +#endif + + + + + diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleTool.h b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleTool.h new file mode 100644 index 0000000000000000000000000000000000000000..a0463830d384e1cc7b19b0830545bf4981d35c56 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/DipoleGeoModel/DipoleTool.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef DIPOLEGEOMODEL_DIPOLETOOL_H +#define DIPOLEGEOMODEL_DIPOLETOOL_H + +#include "GeoModelUtilities/GeoModelTool.h" + +#include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/ServiceHandle.h" + +#include <string> + +class IGeoDbTagSvc; +class IRDBAccessSvc; +class IGeometryDBSvc; +class DipoleGeoModelAthenaComps; + +namespace TrackerDD { + class DipoleManager; +} + +class DipoleTool : public GeoModelTool { + + public: + // Standard Constructor + DipoleTool( const std::string& type, const std::string& name, const IInterface* parent ); + // Standard Destructor + virtual ~DipoleTool() override final; + + virtual StatusCode create() override final; + virtual StatusCode clear() override final; + + private: + ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc; + ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc; + ServiceHandle< IGeometryDBSvc > m_geometryDBSvc; + + std::string m_overrideVersionName; + const TrackerDD::DipoleManager* m_manager; + DipoleGeoModelAthenaComps * m_athenaComps; +}; + +#endif // DIPOLEGEOMODEL_DIPOLETOOL_H + diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfig.py b/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..f569ea6b30e62ce795c8f012f468d0d35b6227a1 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfig.py @@ -0,0 +1,31 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon import CfgMgr + +def getDipoleTool(name="DipoleTool", **kwargs): + kwargs.setdefault("RDBAccessSvc", "RDBAccessSvc") + kwargs.setdefault("GeometryDBSvc", "TrackerGeometryDBSvc") + kwargs.setdefault("GeoDbTagSvc", "GeoDbTagSvc") + return CfgMgr.DipoleTool(name, **kwargs) + + +def DipoleGeometryCfg( flags ): + from FaserGeoModel.GeoModelConfig import GeoModelCfg + acc = GeoModelCfg( flags ) + geoModelSvc=acc.getPrimary() + + from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc + acc.addService(GeometryDBSvc("TrackerGeometryDBSvc")) + + from RDBAccessSvc.RDBAccessSvcConf import RDBAccessSvc + acc.addService(RDBAccessSvc("RDBAccessSvc")) + + from DBReplicaSvc.DBReplicaSvcConf import DBReplicaSvc + acc.addService(DBReplicaSvc("DBReplicaSvc")) + + from DipoleGeoModel.DipoleGeoModelConf import DipoleTool + dipoleTool = DipoleTool() + + geoModelSvc.DetectorTools += [ dipoleTool ] + + return acc diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfigDb.py b/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfigDb.py new file mode 100644 index 0000000000000000000000000000000000000000..7f39cffb7f1b243787971c8d65ad52399bf911d2 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfigDb.py @@ -0,0 +1,6 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.CfgGetter import addAlgorithm,addTool +# add tools and algorithms to the ConfiguredFactory, see: +# https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/ConfiguredFactory +addTool("DipoleGeoModel.DipoleGeoModelConfig.getDipoleTool","DipoleTool") diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleDataBase.cxx b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleDataBase.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2feae9b62dfd0453c827ccbc58c8356b06937d25 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleDataBase.cxx @@ -0,0 +1,102 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "DipoleGeoModel/DipoleDataBase.h" + +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBRecord.h" + +#include "GeoModelInterfaces/IGeoDbTagSvc.h" +#include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" + +#include "TrackerGeoModelUtils/TrackerDDAthenaComps.h" + +#include <iostream> + +DipoleDataBase::DipoleDataBase(const TrackerDD::AthenaComps * athenaComps) +{ + m_athenaComps = athenaComps; + + IGeoDbTagSvc * geoDbTag = m_athenaComps->geoDbTagSvc(); + + // Get version tag and node for Dipole + DecodeFaserVersionKey versionKey(geoDbTag,"Dipole"); + std::string versionTag = versionKey.tag(); + std::string versionNode = versionKey.node(); + + // Get version tag and node for Tracker. + DecodeFaserVersionKey trackerVersionKey(geoDbTag,"Tracker"); + + // Access the RDB + IRDBAccessSvc* rdbSvc = m_athenaComps->rdbAccessSvc(); + + // Dipole version tag + m_dipoleVersionTag = rdbSvc->getChildTag("Dipole", versionKey.tag(), versionKey.node(), "FASERDD"); + + +///////////////////////////////////////////////////////// +// +// Gets the structures +// +///////////////////////////////////////////////////////// + + msg(MSG::INFO) << "Retrieving Record Sets from database ..." << endmsg; + msg(MSG::DEBUG) << " Using version tag: " << versionTag << endmsg; + msg(MSG::DEBUG) << " at node: " << versionNode << endmsg; + msg(MSG::DEBUG) << " Dipole Version: " << m_dipoleVersionTag << endmsg; + + // ATLS - not sure I use it. + // General atlas parameters + + // + // Dipole General + // + + // Dipole TopLevel + m_topLevel = rdbSvc->getRecordsetPtr("DipoleTopLevel", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table DipoleTopLevel Fetched" << endmsg; + + // Weight Table + m_weightTable = rdbSvc->getRecordsetPtr("DipoleWeights", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table DipoleWeights Fetched" << endmsg; + + // // Extra Scaling Table. This is used for extra material studies. For nominal material the table should be empty. + // // NB this is at Tracker level node. + m_scalingTable = rdbSvc->getRecordsetPtr("DipoleMatScaling", trackerVersionKey.tag(), trackerVersionKey.node(), "FASERDD"); + msg(MSG::DEBUG) << "Table DipoleMatScaling Fetched" << endmsg; + + // // Default conditions + // m_conditions = rdbSvc->getRecordsetPtr("DipoleConditions", versionTag, versionNode, "FASERDD"); + // msg(MSG::DEBUG) << "Table DipoleConditions Fetched" << endmsg; + + // + // + // + m_dipoleGeneral = rdbSvc->getRecordsetPtr("DipoleGeneral", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table DipoleGeneral Fetched" << endmsg; + +} + +const TrackerDD::AthenaComps* DipoleDataBase::athenaComps() const { return m_athenaComps; } + +IRDBRecordset_ptr DipoleDataBase::weightTable() const {return m_weightTable;} + +IRDBRecordset_ptr DipoleDataBase::scalingTable() const {return m_scalingTable;} + +IRDBRecordset_ptr DipoleDataBase::topLevelTable() const {return m_topLevel;} + +// IRDBRecordset_ptr DipoleDataBase::conditionsTable() const {return m_conditions;} +// const IRDBRecord* DipoleDataBase::conditions() const {return (*m_conditions)[0];} + +const IRDBRecord* DipoleDataBase::dipoleGeneral() const {return (*m_dipoleGeneral)[0];} + +const std::string & DipoleDataBase::versionTag() const { + return m_dipoleVersionTag; +} + +MsgStream& DipoleDataBase::msg (MSG::Level lvl) const +{ + return m_athenaComps->msg(lvl); +} diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleFactory.cxx b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleFactory.cxx new file mode 100644 index 0000000000000000000000000000000000000000..84f4052b2ab788c058add43fc62d24f711dd4585 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleFactory.cxx @@ -0,0 +1,138 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "DipoleGeoModel/DipoleFactory.h" + +#include "DipoleGeoModel/DipoleDataBase.h" +#include "DipoleGeoModel/DipoleGeneralParameters.h" + +// Pixel, SCT and TRT factories +// #include "InDetServMatGeoModel/PixelServMatFactory.h" +// #include "InDetServMatGeoModel/SCT_ServMatFactory.h" +// #include "InDetServMatGeoModel/TRT_ServMatFactory.h" +// #include "InDetServMatGeoModel/EndPlateFactory.h" +// #include "InDetServMatGeoModel/SupportRailFactory.h" +// #include "InDetServMatGeoModel/SquirrelCageFactory.h" + +// Extra material +#include "TrackerGeoModelUtils/DistortedMaterialManager.h" +#include "TrackerGeoModelUtils/ExtraMaterial.h" + +// Material manager +#include "TrackerGeoModelUtils/TrackerMaterialManager.h" + +// GeoModel includes +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +// #include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoDefinitions.h" +#include "GaudiKernel/SystemOfUnits.h" + +#include "GeoModelInterfaces/StoredMaterialManager.h" +#include "GeoModelInterfaces/IGeoDbTagSvc.h" +#include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" + +// RDBAccessSvc includes +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" + +// StoreGate includes +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/PhysicalConstants.h" + +#include <iostream> + +DipoleFactory::DipoleFactory(const TrackerDD::AthenaComps * athenaComps) + : TrackerDD::DetectorFactoryBase(athenaComps), + m_manager(0) +{ + // create a new det manager + m_manager = new TrackerDD::DipoleManager(); + + m_db = new DipoleDataBase(athenaComps); +} + + +DipoleFactory::~DipoleFactory() +{ + delete m_db; +} + + + +//## Other Operations (implementation) +void DipoleFactory::create(GeoPhysVol *world ) +{ + + // Get the material manager: + DecodeFaserVersionKey dipoleVersionKey(geoDbTagSvc(),"Dipole"); + DecodeFaserVersionKey trackerVersionKey(geoDbTagSvc(),"Tracker"); + DecodeFaserVersionKey faserVersionKey(geoDbTagSvc(),"FASER"); + + + msg(MSG::DEBUG) << "Building Dipoles with FASER Version Tag: " << faserVersionKey.tag() << endmsg; + msg(MSG::DEBUG) << " with Tracker Version Tag: " << trackerVersionKey.tag() << " at Node: " + << trackerVersionKey.node() << endmsg; + msg(MSG::DEBUG) << " Dipole Version " << rdbAccessSvc()->getChildTag("Dipole", dipoleVersionKey.tag(), dipoleVersionKey.node(), "FASERDD") << endmsg; + +// IRDBRecordset_ptr scalingTable = rdbAccessSvc()->getRecordsetPtr("DipoleScaling", trackerVersionKey.tag(), trackerVersionKey.node(), "FASERDD"); + + TrackerMaterialManager * materialManager = new TrackerMaterialManager("DipoleMaterialManager", getAthenaComps()); +// materialManager->addScalingTable(scalingTable); + + auto parameters = std::make_unique<DipoleGeneralParameters>(m_db); + +// const GeoMaterial* air = materialManager->getMaterial("std::Air"); + const GeoMaterial* NdFeB = materialManager->getMaterial(parameters->material()); + + GeoTrf::Transform3D dipoleTransform = parameters->partTransform("Dipole"); + const GeoTube* shortShape = new GeoTube(parameters->innerRadius(), parameters->outerRadius(), parameters->shortLength()/2); + GeoLogVol* shortLog = new GeoLogVol("ShortDipole", shortShape, NdFeB); + const GeoTube* longShape = new GeoTube(parameters->innerRadius(), parameters->outerRadius(), parameters->longLength()/2); + GeoLogVol* longLog = new GeoLogVol("LongDipole", longShape, NdFeB); + + std::vector<std::string> partNames {"UpstreamDipole", "CentralDipole", "DownstreamDipole"}; + for (int station = 0; station < 3; station++) + { + if (parameters->partPresent(partNames[station])) + { + world->add(new GeoNameTag("Dipole")); + world->add(new GeoIdentifierTag(station)); + GeoTransform* stationTransform = new GeoTransform(dipoleTransform * parameters->partTransform(partNames[station])); + world->add(stationTransform); + GeoPhysVol* dipolePV {nullptr}; + if (station == 0) + { + dipolePV = new GeoPhysVol(longLog); + } + else + { + dipolePV = new GeoPhysVol(shortLog); + } + world->add(dipolePV); + m_manager->addTreeTop(dipolePV); + } + } + // Extra material +// TrackerDD::DistortedMaterialManager xMatManager; +// TrackerDD::ExtraMaterial xMat(&xMatManager); +// xMat.add(ServPhys, "InDetServMat"); + + delete materialManager; +} + + +const TrackerDD::DipoleManager* DipoleFactory::getDetectorManager () const { + return m_manager; +} + diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleGeneralParameters.cxx b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleGeneralParameters.cxx new file mode 100644 index 0000000000000000000000000000000000000000..1c8e9d9924e8ed118ca45d7d66378f4db479b780 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleGeneralParameters.cxx @@ -0,0 +1,81 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "DipoleGeoModel/DipoleGeneralParameters.h" +#include "DipoleGeoModel/DipoleDataBase.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "GaudiKernel/SystemOfUnits.h" +#include "GeoModelKernel/GeoDefinitions.h" +#include "TrackerGeoModelUtils/TopLevelPlacements.h" + +const double DIPOLE_SAFETY = 0.01 * Gaudi::Units::mm; // Used in some places to make envelopes slightly larger to ensure + // no overlaps due to rounding errors. + + +DipoleGeneralParameters::DipoleGeneralParameters(DipoleDataBase* rdb) +{ + m_rdb = rdb; + m_placements = new TopLevelPlacements(m_rdb->topLevelTable()); +} + + +DipoleGeneralParameters::~DipoleGeneralParameters() +{ + delete m_placements; +} + + +const GeoTrf::Transform3D & +DipoleGeneralParameters::partTransform(const std::string & partName) const +{ + return m_placements->transform(partName); +} + + +bool +DipoleGeneralParameters::partPresent(const std::string & partName) const +{ + return m_placements->present(partName); +} + +// +// General +// +double +DipoleGeneralParameters::safety() const +{ + return DIPOLE_SAFETY; +} + +std::string +DipoleGeneralParameters::material() const +{ + return m_rdb->dipoleGeneral()->getString("MATERIAL"); +} + +double +DipoleGeneralParameters::innerRadius() const +{ + return m_rdb->dipoleGeneral()->getDouble("INNERRAD"); +} + +double +DipoleGeneralParameters::outerRadius() const +{ + return m_rdb->dipoleGeneral()->getDouble("OUTERRAD"); +} + +double +DipoleGeneralParameters::shortLength() const +{ + return m_rdb->dipoleGeneral()->getDouble("SHORTLENGTH"); +} + +double +DipoleGeneralParameters::longLength() const +{ + return m_rdb->dipoleGeneral()->getDouble("LONGLENGTH"); +} + diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleGeoModelAthenaComps.cxx b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleGeoModelAthenaComps.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d8d7834c2791cd4ffd66af41514d9a5b7f913e0e --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleGeoModelAthenaComps.cxx @@ -0,0 +1,10 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "DipoleGeoModel/DipoleGeoModelAthenaComps.h" + +DipoleGeoModelAthenaComps::DipoleGeoModelAthenaComps() + : TrackerDD::AthenaComps("DipoleGeoModel") +{} + diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleManager.cxx b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleManager.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7f51d2a180702d9d14816ee63171d38b028f103f --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleManager.cxx @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "DipoleGeoModel/DipoleManager.h" + +namespace TrackerDD { + +DipoleManager::DipoleManager( ) +{ + setName("Dipole"); +} + + +DipoleManager::~DipoleManager() +{ + for(unsigned int i=0; i<m_volume.size(); i++) + m_volume[i]->unref(); +} + + + +unsigned int +DipoleManager::getNumTreeTops() const +{ + return m_volume.size(); +} + +PVConstLink +DipoleManager::getTreeTop(unsigned int i) const +{ + return m_volume[i]; +} + +void +DipoleManager::addTreeTop(PVLink vol){ + m_volume.push_back(vol); + vol->ref(); +} + + +} // namespace TrackerDD + + diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleTool.cxx b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..dc81501ccbe623d018b08716550c485826e92a13 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/src/DipoleTool.cxx @@ -0,0 +1,153 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "DipoleGeoModel/DipoleTool.h" +#include "DipoleGeoModel/DipoleFactory.h" +#include "DipoleGeoModel/DipoleGeoModelAthenaComps.h" + +#include "GeometryDBSvc/IGeometryDBSvc.h" +#include "GeoModelUtilities/GeoModelExperiment.h" +#include "GeoModelInterfaces/IGeoDbTagSvc.h" +#include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" +#include "StoreGate/StoreGateSvc.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "AthenaKernel/errorcheck.h" +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ToolHandle.h" + +#include "AthenaKernel/ClassID_traits.h" +#include "SGTools/DataProxy.h" + + + +/** + ** Constructor(s) + **/ +DipoleTool::DipoleTool( const std::string& type, const std::string& name, const IInterface* parent ) + : GeoModelTool( type, name, parent ), + m_geoDbTagSvc("GeoDbTagSvc",name), + m_rdbAccessSvc("RDBAccessSvc",name), + m_geometryDBSvc("TrackerGeometryDBSvc",name), + m_manager(0), + m_athenaComps(0) +{ + declareProperty("OverrideVersionName", m_overrideVersionName); + declareProperty("RDBAccessSvc", m_rdbAccessSvc); + declareProperty("GeometryDBSvc", m_geometryDBSvc); + declareProperty("GeoDbTagSvc", m_geoDbTagSvc); + // add here the properties +} +/** + ** Destructor + **/ +DipoleTool::~DipoleTool() +{ + delete m_athenaComps; +} + +/** + ** Create the Detector Node corresponding to this tool + **/ +StatusCode DipoleTool::create() +{ + // + // Locate the top level experiment node + // + GeoModelExperiment * theExpt; + if (StatusCode::SUCCESS != detStore()->retrieve( theExpt, "FASER" )) { + msg(MSG::ERROR) + << "Could not find GeoModelExperiment FASER" + << endmsg; + return (StatusCode::FAILURE); + } + + StatusCode result = StatusCode::SUCCESS; + + + // Get the detector configuration. + StatusCode sc = m_geoDbTagSvc.retrieve(); + if (sc.isFailure()) { + msg(MSG::FATAL) << "Could not locate GeoDbTagSvc" << endmsg; + return (StatusCode::FAILURE); + } + + DecodeFaserVersionKey versionKey(&*m_geoDbTagSvc, "Tracker"); + + sc = m_rdbAccessSvc.retrieve(); + if (sc.isFailure()) { + msg(MSG::FATAL) << "Could not locate RDBAccessSvc" << endmsg; + return (StatusCode::FAILURE); + } + + std::string versionTag = m_rdbAccessSvc->getChildTag("Dipole", versionKey.tag(), versionKey.node(), "FASERDD"); + msg(MSG::INFO) << "Dipole Package Version: " << PACKAGE_VERSION << endmsg; + if(msgLvl(MSG::DEBUG)) msg() << "versionTag=" << versionTag <<" %%%"<< endmsg; + + // If versionTag is NULL then don't build. + if (versionTag.empty()) { + msg(MSG::INFO) << "No Dipole Version. Dipole will not be built." << endmsg; + if(msgLvl(MSG::DEBUG)) msg() << "Tracker Version Tag: " << versionKey.tag() << " at Node: " + << versionKey.node() << endmsg; + return StatusCode::SUCCESS; + } + + if(msgLvl(MSG::DEBUG)) msg() << "Keys for Dipole Switches are " << versionKey.tag() << " " << versionKey.node() << endmsg; + + std::string versionName; + std::string descrName="noDescr"; + if (!m_rdbAccessSvc->getChildTag("DipoleSwitches", versionKey.tag(), versionKey.node(), "FASERDD").empty()) { + + IRDBRecordset_ptr switchSet = m_rdbAccessSvc->getRecordsetPtr("DipoleSwitches", versionKey.tag(), versionKey.node(), "FASERDD"); + + const IRDBRecord *switchTable = (*switchSet)[0]; + versionName = switchTable->getString("VERSIONNAME"); + if (!switchTable->isFieldNull("DESCRIPTION")) descrName = switchTable->getString("DESCRIPTION"); + } + + if (!m_overrideVersionName.empty()) { + versionName = m_overrideVersionName; + msg(MSG::INFO) << "Overriding version name: " << versionName << endmsg; + } + + msg(MSG::INFO) << "Building Dipoles. Version: " << versionName << endmsg; + + // Retrieve the Geometry DB Interface + sc = m_geometryDBSvc.retrieve(); + if (sc.isFailure()) { + msg(MSG::FATAL) << "Could not locate Geometry DB Interface: " << m_geometryDBSvc.name() << endmsg; + return (StatusCode::FAILURE); + } + + // Pass athena services to factory, etc + m_athenaComps = new DipoleGeoModelAthenaComps; + m_athenaComps->setDetStore(detStore().operator->()); + m_athenaComps->setGeoDbTagSvc(&*m_geoDbTagSvc); + m_athenaComps->setRDBAccessSvc(&*m_rdbAccessSvc); + m_athenaComps->setGeometryDBSvc(&*m_geometryDBSvc); + + GeoPhysVol *world=&*theExpt->getPhysVol(); + DipoleFactory theDipoles(m_athenaComps); + theDipoles.create(world); + m_manager=theDipoles.getDetectorManager(); + if (m_manager) { + theExpt->addManager(m_manager); + CHECK( detStore()->record (m_manager, m_manager->getName()) ); + } else { + msg(MSG::FATAL) << "Could not create DipoleManager!" << endmsg; + return StatusCode::FAILURE; + } + return result; +} + +StatusCode DipoleTool::clear() +{ + SG::DataProxy* proxy = detStore()->proxy(ClassID_traits<TrackerDD::DipoleManager>::ID(),m_manager->getName()); + if(proxy) { + proxy->reset(); + m_manager = 0; + } + return StatusCode::SUCCESS; +} diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/src/components/DipoleGeoModel_entries.cxx b/Tracker/TrackerDetDescr/DipoleGeoModel/src/components/DipoleGeoModel_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d7f8791370c574466ac422d849785c33d9a82b9f --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/src/components/DipoleGeoModel_entries.cxx @@ -0,0 +1,3 @@ +#include "DipoleGeoModel/DipoleTool.h" + +DECLARE_COMPONENT( DipoleTool ) diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/test/DipoleGMConfig_test.py b/Tracker/TrackerDetDescr/DipoleGeoModel/test/DipoleGMConfig_test.py new file mode 100755 index 0000000000000000000000000000000000000000..fa4ccba933f33231333501790a933a75fccb0df0 --- /dev/null +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/test/DipoleGMConfig_test.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +"""Run tests on SCT_GeoModel configuration + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +if __name__ == "__main__": + from AthenaCommon.Configurable import Configurable + Configurable.configurableRun3Behavior=1 + from CalypsoConfiguration.AllConfigFlags import ConfigFlags + from AthenaConfiguration.TestDefaults import defaultTestFiles + + ConfigFlags.Input.Files = defaultTestFiles.HITS + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" + ConfigFlags.Detector.SimulateDipole = True + ConfigFlags.GeoModel.Align.Dynamic = False + ConfigFlags.lock() + + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + from DipoleGeoModel.DipoleGeoModelConfig import DipoleGeometryCfg + acc = DipoleGeometryCfg(ConfigFlags) + f=open('DipoleGeometryCfg.pkl','w') + acc.store(f) + f.close() diff --git a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx index a61998839326a9dd43abdf03efa463ca2c807c39..bd1efc0e3babcd830449a99433e4af100d45ff00 100644 --- a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx +++ b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx @@ -137,21 +137,16 @@ void SCT_DetectorFactory::create(GeoPhysVol *world) // The tree tops get added to world. We name it "tracker" though. GeoPhysVol *tracker = world; - msg(MSG::ALWAYS) << "Retrieving general parameters" << endmsg; const SCT_GeneralParameters * sctGeneral = m_geometryManager->generalParameters(); - msg(MSG::ALWAYS) << "Retrieving part transform for SCT" << endmsg; GeoTrf::Transform3D sctTransform = sctGeneral->partTransform("SCT"); - msg(MSG::ALWAYS) << "Instantiating station object" << endmsg; SCT_Barrel station("Station", m_detectorManager, m_geometryManager, m_materials); - msg(MSG::ALWAYS) << "Beginning loop over stations" << endmsg; std::vector<std::string> partNames {"StationA", "StationB", "StationC"}; for (int iStation = -1; iStation <= 1; iStation++) { if (sctGeneral->partPresent(partNames[iStation+1])) { - msg(MSG::ALWAYS) << "Found part " << partNames[iStation+1] << endmsg; m_detectorManager->numerology().addBarrel(iStation); SCT_Identifier id{m_geometryManager->athenaComps()->getIdHelper()}; id.setStation(iStation); diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/VTI12GeometrySystems/VP1GeoFlags.h b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/VTI12GeometrySystems/VP1GeoFlags.h index 6fdd338081b118d5c933a78c6d1f93c67c720b4e..6d26dc45e00ecb7a6ea80b674d6bb48346aac685 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/VTI12GeometrySystems/VP1GeoFlags.h +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/VTI12GeometrySystems/VP1GeoFlags.h @@ -31,8 +31,9 @@ public: Preshower = 0x00000004, SCT = 0x00000008, + Dipole = 0x00000010, - Ecal = 0x00000010, + Ecal = 0x00000020, // Pixel = 0x00000001, // bit 0 // SCT = 0x00000002, // 1 // TRT = 0x00000004, // 2 diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/GeoSysController.cxx b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/GeoSysController.cxx index 1353fedded763282584f2dd452cb19486854fc01..10a5411504f90663c3eba8bd10cb0ae6277f4049 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/GeoSysController.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/GeoSysController.cxx @@ -153,6 +153,7 @@ GeoSysController::GeoSysController(IVP1System * sys) // Tracker m_d->subSysCheckBoxMap[VP1GeoFlags::SCT] = m_d->ui.checkBox_SCT; + m_d->subSysCheckBoxMap[VP1GeoFlags::Dipole] = m_d->ui.checkBox_dipole; // Calorimeter m_d->subSysCheckBoxMap[VP1GeoFlags::Ecal] = m_d->ui.checkBox_Ecal; diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VP1GeometrySystem.cxx b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VP1GeometrySystem.cxx index 75b176e5001cddedb229e06b3f3371c52ad9a302..8b07abe7bea6e4c8524542d3cad1373b0b36eb58 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VP1GeometrySystem.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VP1GeometrySystem.cxx @@ -333,6 +333,7 @@ QWidget * VP1GeometrySystem::buildController() m_d->addSubSystem( VP1GeoFlags::Trigger, "Trigger"); m_d->addSubSystem( VP1GeoFlags::Preshower,"Preshower"); m_d->addSubSystem( VP1GeoFlags::SCT, "SCT"); + m_d->addSubSystem( VP1GeoFlags::Dipole, "Dipole"); m_d->addSubSystem( VP1GeoFlags::Ecal, "Ecal"); @@ -1122,6 +1123,12 @@ void VP1GeometrySystem::Imp::createPathExtras(const VolumeHandle* volhandle, QSt entries.push("SCT::SCT"); return; } + case VP1GeoFlags::Dipole:{ + prefix = QString("Dipole::"); + entries.push("TRACKER::TRACKER"); + entries.push("Dipole::Dipole"); + return; + } case VP1GeoFlags::Ecal:{ prefix = QString("Ecal::"); entries.push("CALO::CALO"); diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VisAttributes.cxx b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VisAttributes.cxx index 33daeb5ea8dca9b85b257184c9ba1277cd8683e7..2d8ce3f4c81feb2a1ad04edcbf19926502f95a76 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VisAttributes.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VisAttributes.cxx @@ -275,6 +275,17 @@ DetVisAttributes::DetVisAttributes() { add("SCT",material); } + { + SoMaterial *material = new SoMaterial; + material->ambientColor.setValue(0, .157811, .187004); + material->diffuseColor.setValue(1, .5, .5); + material->specularColor.setValue(.915152, .915152, .915152); + material->shininess.setValue(0.8); + add("Dipole",material); + } + + + // { // SoMaterial *material = new SoMaterial; // add("LAr",material); @@ -520,6 +531,15 @@ MatVisAttributes::MatVisAttributes() { add("Titanium",m); } + { + //NdFeB + SoMaterial *m = new SoMaterial; + m->diffuseColor.setValue (0.62, 0.62, 0.62); + m->specularColor.setValue (0.294, 0.294, 0.294); + m->shininess.setValue(.20); + add("Nd2Fe14B",m); + } + { //ECServices SoMaterial *m = new SoMaterial; diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VolumeTreeModel.cxx b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VolumeTreeModel.cxx index cf8b66f0cddd256b84fa460392fc21a2e1f64b15..5ad7fca0825f66147beebd2be9df04f8e6cdafce 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VolumeTreeModel.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VolumeTreeModel.cxx @@ -117,6 +117,7 @@ VolumeTreeModel::VolumeTreeModel( QObject * parent ) Imp::defineSubSystem(VP1GeoFlags::Preshower, "Preshower", Imp::SCINT); // Tracker Imp::defineSubSystem(VP1GeoFlags::SCT, "SCT", Imp::TRACKER); + Imp::defineSubSystem(VP1GeoFlags::Dipole, "Dipole", Imp::TRACKER); // Calorimeter Imp::defineSubSystem(VP1GeoFlags::Ecal, "Ecal", Imp::CALO); } diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/geometrysystemcontroller.ui b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/geometrysystemcontroller.ui index d9bbb2b36d1aa521140b659942871bc36a6117fc..57805e11d209d90fe64d69c872b2d765a33909f5 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/geometrysystemcontroller.ui +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/geometrysystemcontroller.ui @@ -250,13 +250,20 @@ <property name="bottomMargin"> <number>4</number> </property> - <item> + <item row="0" column="0"> <widget class="QCheckBox" name="checkBox_SCT"> <property name="text"> <string>SCT</string> </property> </widget> </item> + <item row="0" column="1"> + <widget class="QCheckBox" name="checkBox_dipole"> + <property name="text"> + <string>Dipole magnets</string> + </property> + </widget> + </item> <item> <spacer> <property name="orientation">