diff --git a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql index 79afa451f9737fad53e084b3f6c62c8d72b0a4bd..d03eafb9eda60a9e923da8da01ee28d3a2856700 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql +++ b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql @@ -144,6 +144,25 @@ CREATE TABLE IF NOT EXISTS "EMULSIONGENERAL_DATA2TAG" ( "EMULSIONGENERAL_DATA_ID" SLONGLONG ); -- +DROP TABLE IF EXISTS "EMULSIONSUPPORT_DATA"; +CREATE TABLE IF NOT EXISTS "EMULSIONSUPPORT_DATA" ( + "EMULSIONSUPPORT_DATA_ID" SLONGLONG UNIQUE, + "MATERIAL" TEXT, + "DX" DOUBLE, + "DY" DOUBLE, + "DZ" DOUBLE, + "X" DOUBLE, + "Y" DOUBLE, + "Z" DOUBLE, + "LABEL" TEXT +); +-- +DROP TABLE IF EXISTS "EMULSIONSUPPORT_DATA2TAG"; +CREATE TABLE IF NOT EXISTS "EMULSIONSUPPORT_DATA2TAG" ( + "EMULSIONSUPPORT_TAG_ID" SLONGLONG, + "EMULSIONSUPPORT_DATA_ID" SLONGLONG +); +-- DROP TABLE IF EXISTS "EMULSIONFILM_DATA"; CREATE TABLE IF NOT EXISTS "EMULSIONFILM_DATA" ( "EMULSIONFILM_DATA_ID" SLONGLONG UNIQUE, @@ -703,6 +722,7 @@ INSERT INTO "HVS_NODE" VALUES (111, "EmulsionGeneral", 11, 0, NULL); INSERT INTO "HVS_NODE" VALUES (112, "EmulsionFilm", 11, 0, NULL); INSERT INTO "HVS_NODE" VALUES (113, "EmulsionPlates", 11, 0, NULL); INSERT INTO "HVS_NODE" VALUES (114, "EmulsionSwitches", 11, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (115, "EmulsionSupport", 11, 0, NULL); INSERT INTO "HVS_NODE" VALUES (2, "Scintillator", 0, 1, NULL); INSERT INTO "HVS_NODE" VALUES (2003, "ScintMaterials", 2, 0, NULL); INSERT INTO "HVS_NODE" VALUES (2004, "ScintMatComponents", 2, 0, NULL); @@ -781,6 +801,7 @@ INSERT INTO "HVS_TAG2NODE" VALUES (111, "EmulsionGeneral-00", 107805, NULL, 0, 0 INSERT INTO "HVS_TAG2NODE" VALUES (112, "EmulsionFilm-00", 107806, NULL, 0, 0, 1619308800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (113, "EmulsionPlates-00", 107807, NULL, 0, 0, 1619308800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (114, "EmulsionSwitches-00", 100036, NULL, 0, 0, 1582416000000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (115, "EmulsionSupport-00", 107842, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (2, "Scintillator-00", 100001, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (2, "Scintillator-01", 100042, NULL, 0, 0, 1590796800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (2, "Scintillator-02", 107789, NULL, 0, 0, 1619222400000000000, NULL, 22); @@ -949,11 +970,12 @@ INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107812, 111, 107805); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107812, 112, 107806); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107812, 113, 107807); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107812, 114, 100036); -INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107840, 110, 100035); +INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107840, 110, 107841); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107840, 111, 107805); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107840, 112, 107806); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107840, 113, 107807); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107840, 114, 100036); +INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 107840, 115, 107842); INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 100031, 1003, 100032); INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 100031, 1004, 100033); INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 100031, 1005, 100030); @@ -1538,6 +1560,7 @@ INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EmulsionGeneral", "Emulsion INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EmulsionFilm", "EmulsionFilm-00", 107806); INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EmulsionPlates", "EmulsionPlates-00", 107807); INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EmulsionSwitches", "EmulsionSwitches-00", 100036); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EmulsionSupport", "EmulsionSupport-00", 107842); INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Scintillator", "Scintillator-02", 107789); INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Tracker", "Tracker-03", 107836); INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SCT", "SCT-02", 107791); @@ -2146,6 +2169,14 @@ INSERT INTO "EMULSIONGENERAL_DATA" VALUES (0, 35, 22, -524.275, 525.275); INSERT INTO "EMULSIONGENERAL_DATA2TAG" VALUES (107805, 0); -- -- +INSERT INTO "EMULSIONSUPPORT_DATA" VALUES (0, "std::SSteel", 250.0, 300.0, 20.0, 0.0, 0.0, 535.45, "BoxBack"); +INSERT INTO "EMULSIONSUPPORT_DATA" VALUES (1, "std::SSteel", 250.0, 300.0, 30.0, 0.0, 0.0, -540.45, "Pusher"); +INSERT INTO "EMULSIONSUPPORT_DATA" VALUES (2, "std::SSteel", 250.0, 300.0, 20.0, 0.0, 0.0, -604.55, "BoxFront"); +INSERT INTO "EMULSIONSUPPORT_DATA2TAG" VALUES (107842, 0); +INSERT INTO "EMULSIONSUPPORT_DATA2TAG" VALUES (107842, 1); +INSERT INTO "EMULSIONSUPPORT_DATA2TAG" VALUES (107842, 2); +-- +-- INSERT INTO "EMULSIONFILM_DATA" VALUES (0, 250.0, 300.0, 0.210, "neutrino::Polystyrene", 250.0, 300.0, 0.070, "neutrino::Emulsion"); INSERT INTO "EMULSIONFILM_DATA2TAG" VALUES (107806, 0); -- diff --git a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDataBase.cxx b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDataBase.cxx index eae5fd1e07a8e70ec9bcec697d3deeb4da41d4d0..4f3a48084e7c3e7e2357844508fed2c17ac8de46 100644 --- a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDataBase.cxx +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDataBase.cxx @@ -80,6 +80,8 @@ EmulsionDataBase::EmulsionDataBase(const EmulsionGeoModelAthenaComps * athenaCom m_emulsionPlates = rdbSvc->getRecordsetPtr("EmulsionPlates", versionTag, versionNode, "FASERDD"); msg(MSG::DEBUG) << "Table EmulsionPlates Fetched" << endmsg; + m_emulsionSupport = rdbSvc->getRecordsetPtr("EmulsionSupport", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table EmulsionSupport Fetched" << endmsg; } const EmulsionGeoModelAthenaComps* EmulsionDataBase::athenaComps() const { return m_athenaComps; } @@ -91,6 +93,8 @@ IRDBRecordset_ptr EmulsionDataBase::scalingTable() const {return m_scalingTable; // //const IRDBRecord* EmulsionDataBase::atls() const {return *m_atls)[0];} IRDBRecordset_ptr EmulsionDataBase::topLevelTable() const {return m_topLevel;} +IRDBRecordset_ptr EmulsionDataBase::emulsionSupportTable() const {return m_emulsionSupport;} + // IRDBRecordset_ptr EmulsionDataBase::conditionsTable() const {return m_conditions;} // const IRDBRecord* EmulsionDataBase::conditions() const {return (*m_conditions)[0];} diff --git a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDataBase.h b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDataBase.h index 35bf120c7a04cfe5ecaa88effd524785642271a2..879a5e01012fb257d283c568c0688eb4557fbe19 100644 --- a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDataBase.h +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDataBase.h @@ -25,6 +25,7 @@ public: IRDBRecordset_ptr weightTable() const; IRDBRecordset_ptr scalingTable() const; IRDBRecordset_ptr topLevelTable() const; + IRDBRecordset_ptr emulsionSupportTable() const; const IRDBRecord* emulsionGeneral() const; const IRDBRecord* emulsionFilm() const; @@ -54,6 +55,7 @@ private: IRDBRecordset_ptr m_emulsionGeneral; IRDBRecordset_ptr m_emulsionFilm; IRDBRecordset_ptr m_emulsionPlates; + IRDBRecordset_ptr m_emulsionSupport; }; diff --git a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDetectorFactory.cxx b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDetectorFactory.cxx index 25fc89125f7974ef00f89ae2899a67a7b68d2551..30cb89edb936f0d61397ac6bc6522d0a7636d07d 100644 --- a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDetectorFactory.cxx +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionDetectorFactory.cxx @@ -14,6 +14,7 @@ #include "EmulsionGeometryManager.h" #include "EmulsionMaterialManager.h" #include "EmulsionGeneralParameters.h" +#include "EmulsionSupportParameters.h" #include "NeutrinoReadoutGeometry/Version.h" #include "NeutrinoReadoutGeometry/NeutrinoCommonItems.h" #include "NeutrinoReadoutGeometry/NeutrinoDD_Defs.h" @@ -143,13 +144,16 @@ void EmulsionDetectorFactory::create(GeoPhysVol *world) // The tree tops get added to world. We name it "neutrino" though. GeoPhysVol *neutrino = world; + // const EmulsionSupportParameters* emulsionSupport = m_geometryManager->supportParameters(); + // msg(MSG::ALWAYS) << "Found " << emulsionSupport->supportElements().size() << " emulsion support elements" << endmsg; + const EmulsionGeneralParameters * emulsionGeneral = m_geometryManager->generalParameters(); GeoTrf::Transform3D emulsionTransform = emulsionGeneral->partTransform("Emulsion"); - std::string stationA_Label = "StationA"; + std::string stationA_Label = "StationA"; - bool stationA_Present = emulsionGeneral->partPresent(stationA_Label); + bool stationA_Present = emulsionGeneral->partPresent(stationA_Label); // // Plate is the same for all stations diff --git a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionGeometryManager.cxx b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionGeometryManager.cxx index 679678fba793dddd06cb3b2e13169f57a08a1b0d..dca5f2d2ad0b16f977f58026d9e86854dcc0ec4c 100644 --- a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionGeometryManager.cxx +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionGeometryManager.cxx @@ -11,6 +11,7 @@ #include "EmulsionPlatesParameters.h" #include "EmulsionDataBase.h" #include "EmulsionGeneralParameters.h" +#include "EmulsionSupportParameters.h" #include "EmulsionGeoModel/EmulsionGeoModelAthenaComps.h" EmulsionGeometryManager::EmulsionGeometryManager(EmulsionDataBase* rdb) @@ -23,6 +24,7 @@ EmulsionGeometryManager::EmulsionGeometryManager(EmulsionDataBase* rdb) m_filmParameters = std::make_unique<EmulsionFilmParameters>(m_rdb); m_platesParameters = std::make_unique<EmulsionPlatesParameters>(m_rdb); m_generalParameters = std::make_unique<EmulsionGeneralParameters>(m_rdb); + m_supportParameters = std::make_unique<EmulsionSupportParameters>(m_rdb); m_distortedMatManager = std::make_unique<NeutrinoDD::DistortedMaterialManager>(); } @@ -79,6 +81,12 @@ EmulsionGeometryManager::generalParameters() const return m_generalParameters.get(); } +const EmulsionSupportParameters * +EmulsionGeometryManager::supportParameters() const +{ + return m_supportParameters.get(); +} + const NeutrinoDD::DistortedMaterialManager * EmulsionGeometryManager::distortedMatManager() const { @@ -95,6 +103,7 @@ EmulsionGeometryManager::operator=(const EmulsionGeometryManager& right) { m_filmParameters.reset(new EmulsionFilmParameters(m_rdb)); m_platesParameters.reset(new EmulsionPlatesParameters(m_rdb)); m_generalParameters.reset(new EmulsionGeneralParameters(m_rdb)); + m_supportParameters.reset(new EmulsionSupportParameters(m_rdb)); m_distortedMatManager.reset(new NeutrinoDD::DistortedMaterialManager()); } return *this; @@ -108,5 +117,6 @@ EmulsionGeometryManager::EmulsionGeometryManager(const EmulsionGeometryManager& m_filmParameters.reset(new EmulsionFilmParameters(m_rdb)); m_platesParameters.reset(new EmulsionPlatesParameters(m_rdb)); m_generalParameters.reset(new EmulsionGeneralParameters(m_rdb)); + m_supportParameters.reset(new EmulsionSupportParameters(m_rdb)); m_distortedMatManager.reset(new NeutrinoDD::DistortedMaterialManager()); } diff --git a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionGeometryManager.h b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionGeometryManager.h index a068602e658925ba5a363bd571d0486fa08a04ec..989520e43084b873c843cebc5f0e01546f375a8d 100644 --- a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionGeometryManager.h +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionGeometryManager.h @@ -18,6 +18,7 @@ class EmulsionFilmParameters; class EmulsionPlatesParameters; class EmulsionDataBase; class EmulsionGeneralParameters; +class EmulsionSupportParameters; class EmulsionGeoModelAthenaComps; class EmulsionGeometryManager { @@ -43,6 +44,7 @@ public: const EmulsionFilmParameters* filmParameters() const; const EmulsionPlatesParameters* platesParameters() const; const EmulsionGeneralParameters* generalParameters() const; + const EmulsionSupportParameters* supportParameters() const; const NeutrinoDD::DistortedMaterialManager* distortedMatManager() const; EmulsionGeometryManager& operator=(const EmulsionGeometryManager& right); @@ -58,6 +60,7 @@ private: std::unique_ptr<EmulsionFilmParameters> m_filmParameters; std::unique_ptr<EmulsionPlatesParameters> m_platesParameters; std::unique_ptr<EmulsionGeneralParameters> m_generalParameters; + std::unique_ptr<EmulsionSupportParameters> m_supportParameters; std::unique_ptr<NeutrinoDD::DistortedMaterialManager> m_distortedMatManager; }; diff --git a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionSupportParameters.cxx b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionSupportParameters.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7ed41a0050ee15c99c6dc4f840cce3e572ee663e --- /dev/null +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionSupportParameters.cxx @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "EmulsionSupportParameters.h" +#include "EmulsionGeometryManager.h" + +#include "EmulsionDataBase.h" + +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "GaudiKernel/SystemOfUnits.h" + +#include <cmath> + + +EmulsionSupportParameters::EmulsionSupportParameters(EmulsionDataBase* rdb) +{ + m_rdb = rdb; +} + +std::vector<EmulsionSupportParameters::SupportElement> +EmulsionSupportParameters::supportElements() const +{ + std::vector<SupportElement> result; + IRDBRecordset_ptr table = m_rdb->emulsionSupportTable(); + if (table.get() == nullptr) return result; + + size_t numElements = table->size(); + for (size_t i = 0; i < numElements; i++) + { + const IRDBRecord* element = (*table)[i]; + result.push_back(SupportElement(element->getDouble("DX"), + element->getDouble("DY"), + element->getDouble("DZ"), + element->getDouble("X"), + element->getDouble("Y"), + element->getDouble("Z"), + element->getString("MATERIAL"), + element->getString("LABEL"))); + } + + return result; + +} \ No newline at end of file diff --git a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionSupportParameters.h b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionSupportParameters.h new file mode 100644 index 0000000000000000000000000000000000000000..b357bfcb02fcbf06b90db67d2e26a7b16254287f --- /dev/null +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionSupportParameters.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef EmulsionGeoModel_EmulsionSupportParameters_H +#define EmulsionGeoModel_EmulsionSupportParameters_H + +#include <string> +#include <vector> + +class EmulsionDataBase; + +class EmulsionSupportParameters { + +public: + + // Constructor + EmulsionSupportParameters(EmulsionDataBase* rdb); + + + class SupportElement + { + public: + SupportElement(double width, double height, double thickness, double xPos, double yPos, double zPos, std::string material, std::string name) + : dx{width}, dy{height}, dz{thickness}, x{xPos}, y{yPos}, z{zPos}, mat{material}, label{name} {} + double dx; + double dy; + double dz; + double x; + double y; + double z; + std::string mat; + std::string label; + }; + + // General + + std::vector<SupportElement> supportElements() const; + + private: + EmulsionDataBase * m_rdb; + +}; + + +#endif // EmulsionGeoModel_EmulsionSupportParameters_H