diff --git a/Control/CalypsoConfiguration/python/DetectorConfigFlags.py b/Control/CalypsoConfiguration/python/DetectorConfigFlags.py index 763f1176951ecef9e3ecb3a57d7b8a607d449bbb..b2588ba84ef16b18af9084a029cdccbcbe8fae8f 100644 --- a/Control/CalypsoConfiguration/python/DetectorConfigFlags.py +++ b/Control/CalypsoConfiguration/python/DetectorConfigFlags.py @@ -7,15 +7,16 @@ from CalypsoConfiguration.AutoConfigFlags import DetDescrInfo, getDefaultDetecto allDetectors = [ - 'Emulsion', 'Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Ecal', 'Dipole', + 'Emulsion', 'Veto', 'Trigger', 'Preshower', 'VetoNu', 'FaserSCT', 'Ecal', 'Dipole', 'Trench' ] allGroups = { 'Neutrino' : [ 'Emulsion' ], 'Tracker' : ['SCT'], - 'Scintillator' : ['Veto', 'Trigger', 'Preshower'], + 'Scintillator' : ['Veto', 'Trigger', 'Preshower', 'VetoNu'], 'FaserCalo' : ['Ecal'], - 'Magnet' : ['Dipole'] + 'Magnet' : ['Dipole'], + 'Cavern' : ['Trench'] } def createDetectorConfigFlags(): @@ -32,17 +33,20 @@ def createDetectorConfigFlags(): dcf.addFlag('Detector.GeometryVeto', False) dcf.addFlag('Detector.GeometryTrigger', False) dcf.addFlag('Detector.GeometryPreshower', False) + dcf.addFlag('Detector.GeometryVetoNu', False) dcf.addFlag('Detector.GeometryScintillator', lambda prevFlags : (prevFlags.Detector.GeometryVeto or prevFlags.Detector.GeometryTrigger or - prevFlags.Detector.GeometryPreshower)) + prevFlags.Detector.GeometryPreshower or + prevFlags.Detector.GeometryVetoNu)) dcf.addFlag('Detector.GeometryFaserSCT', False) dcf.addFlag('Detector.GeometryTracker', lambda prevFlags : prevFlags.Detector.GeometryFaserSCT ) dcf.addFlag('Detector.GeometryEcal', False) dcf.addFlag('Detector.GeometryFaserCalo', lambda prevFlags : prevFlags.Detector.GeometryEcal) - # Cavern (disabled by default) - # dcf.addFlag('Detector.GeometryCavern',False) + # Trench (disabled by default) + dcf.addFlag('Detector.GeometryTrench',False) + dcf.addFlag('Detector.GeometryFaserCavern', lambda prevFlags : (prevFlags.Detector.GeometryTrench )) # dcf.addFlag('Detector.GeometryFaser', lambda prevFlags : (prevFlags.Detector.GeometryDecayVolume or # prevFlags.Detector.GeometryScintillator or @@ -66,9 +70,11 @@ def createDetectorConfigFlags(): dcf.addFlag('Detector.EnableVeto', lambda prevFlags : 'Veto' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) dcf.addFlag('Detector.EnableTrigger', lambda prevFlags : 'Trigger' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) dcf.addFlag('Detector.EnablePreshower', lambda prevFlags : 'Preshower' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) + dcf.addFlag('Detector.EnableVetoNu', lambda prevFlags : 'VetoNu' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) dcf.addFlag('Detector.EnableScintillator',lambda prevFlags : (prevFlags.Detector.EnableVeto or prevFlags.Detector.EnableTrigger or - prevFlags.Detector.EnablePreshower)) + prevFlags.Detector.EnablePreshower or + prevFlags.Detector.EnableVetoNu)) dcf.addFlag('Detector.EnableFaserSCT', lambda prevFlags : 'FaserSCT' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) dcf.addFlag('Detector.EnableTracker', lambda prevFlags : prevFlags.Detector.EnableFaserSCT ) dcf.addFlag('Detector.EnableEcal', lambda prevFlags : 'Ecal' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) @@ -86,8 +92,9 @@ def createDetectorConfigFlags(): dcf.addFlag('Detector.RecoTrigger', False) dcf.addFlag('Detector.RecoPreshower', False) dcf.addFlag('Detector.RecoEcal', False) + dcf.addFlag('Detector.RecoVetoNu', False) dcf.addFlag('Detector.RecoWaveform', lambda prevFlags : (prevFlags.Detector.RecoVeto or prevFlags.Detector.RecoTrigger or - prevFlags.Detector.RecoPreshower or prevFlags.Detector.RecoEcal)) + prevFlags.Detector.RecoPreshower or prevFlags.Detector.RecoVetoNu or prevFlags.Detector.RecoEcal)) dcf.addFlag('Detector.RecoFaserSCT', False) dcf.addFlag('Detector.RecoTracker', lambda prevFlags : (prevFlags.Detector.RecoFaserSCT)) diff --git a/Control/CalypsoConfiguration/python/testDetectorFlags.py b/Control/CalypsoConfiguration/python/testDetectorFlags.py index 9a555b4c637e5699aefd8516874286f1e127b51c..ab8c1e99cf6373e09dc02b94fd72d2560df187d2 100644 --- a/Control/CalypsoConfiguration/python/testDetectorFlags.py +++ b/Control/CalypsoConfiguration/python/testDetectorFlags.py @@ -54,11 +54,13 @@ assert flags.Detector.GeometryDipole assert not flags.Detector.EnableFaserSCT assert not flags.Detector.EnableEcal assert not flags.Detector.EnableVeto +assert not flags.Detector.EnableVetoNu assert not flags.Detector.EnableTrigger assert not flags.Detector.EnablePreshower assert not flags.Detector.GeometryFaserSCT assert not flags.Detector.GeometryEcal assert not flags.Detector.GeometryVeto +assert not flags.Detector.GeometryVetoNu assert not flags.Detector.GeometryTrigger assert not flags.Detector.GeometryPreshower print() diff --git a/Control/CalypsoExample/Digitization/scripts/faser_digi.py b/Control/CalypsoExample/Digitization/scripts/faser_digi.py index 5ef818999634d592b21142b88ad2cee5c1a324f1..91de9cad754ec1bb739a3f689f27911139e48882 100755 --- a/Control/CalypsoExample/Digitization/scripts/faser_digi.py +++ b/Control/CalypsoExample/Digitization/scripts/faser_digi.py @@ -82,7 +82,7 @@ elif runtype == "TestBeamMC" : # New TI12 geometry (ugh) elif runtype == "TI12MC": - ConfigFlags.GeoModel.FaserVersion = "FASERNU-02" + ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" else: diff --git a/Control/CalypsoExample/GeoModelTest/CMakeLists.txt b/Control/CalypsoExample/GeoModelTest/CMakeLists.txt index 9db978f852f7d3ae840297d164670b9c6ba9aa00..772543c3ad28c4f31b5d42e382cff2cc79215192 100644 --- a/Control/CalypsoExample/GeoModelTest/CMakeLists.txt +++ b/Control/CalypsoExample/GeoModelTest/CMakeLists.txt @@ -25,6 +25,11 @@ atlas_add_test( Faser02GeoCheck PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR} PROPERTIES TIMEOUT 300 ) +atlas_add_test( Faser03GeoCheck + SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/Faser03TestConfig.py + PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + PROPERTIES TIMEOUT 300 ) + atlas_add_test( TestBeamGeoCheck SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/python/TestBeamTestConfig.py diff --git a/Control/CalypsoExample/GeoModelTest/python/Faser01TestConfig.py b/Control/CalypsoExample/GeoModelTest/python/Faser01TestConfig.py index 69a57833523e460b1ab5465312f410ae9e2509d6..e85fd9e4b3f2529de19b5d4d6e323275dbc5b5e6 100644 --- a/Control/CalypsoExample/GeoModelTest/python/Faser01TestConfig.py +++ b/Control/CalypsoExample/GeoModelTest/python/Faser01TestConfig.py @@ -19,6 +19,7 @@ def GeoModelTestCfg(flags, name="GeoModelTestAlg", **kwargs): GeoModelTestAlg = CompFactory.GeoModelTestAlg a.addEventAlgo(GeoModelTestAlg(name, FirstSCTStation=1, LastSCTStation=3, + NumVetoNuStations=0, **kwargs)) return a diff --git a/Control/CalypsoExample/GeoModelTest/python/Faser02TestConfig.py b/Control/CalypsoExample/GeoModelTest/python/Faser02TestConfig.py index 03913db74587b020b24c290fc6a2928eb965e22d..ba3f91b75be389c3c4053b6f694ee1bdbde0fa99 100644 --- a/Control/CalypsoExample/GeoModelTest/python/Faser02TestConfig.py +++ b/Control/CalypsoExample/GeoModelTest/python/Faser02TestConfig.py @@ -19,6 +19,7 @@ def GeoModelTestCfg(flags, name="GeoModelTestAlg", **kwargs): GeoModelTestAlg = CompFactory.GeoModelTestAlg a.addEventAlgo(GeoModelTestAlg(name, FirstSCTStation=0, LastSCTStation=3, + NumVetoNuStations=0, PrintSctIDs=True, **kwargs)) @@ -35,7 +36,7 @@ if __name__ == "__main__": ConfigFlags.Input.isMC = True # Needed to bypass autoconfig ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion ConfigFlags.GeoModel.FaserVersion = "FASERNU-02" # Default FASER geometry - # ConfigFlags.GeoModel.GeoExportFile = "faserGeoNu02.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) + ConfigFlags.GeoModel.GeoExportFile = "FaserNu02.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) # ConfigFlags.Detector.EnableVeto = True # ConfigFlags.Detector.EnableTrigger = True # ConfigFlags.Detector.EnablePreshower= True diff --git a/Control/CalypsoExample/GeoModelTest/python/Faser03TestConfig.py b/Control/CalypsoExample/GeoModelTest/python/Faser03TestConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..70322eb150975256868a84bf7bd2174697d0a0da --- /dev/null +++ b/Control/CalypsoExample/GeoModelTest/python/Faser03TestConfig.py @@ -0,0 +1,68 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +#!/usr/bin/env python +import sys +from AthenaCommon.Constants import VERBOSE, INFO +from AthenaConfiguration.ComponentFactory import CompFactory + +def GeoModelTestCfg(flags, name="GeoModelTestAlg", **kwargs): + + # Initialize GeoModel + from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg + a = FaserGeometryCfg(flags) + + # Initialize field service + from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg + a.merge(MagneticFieldSvcCfg(flags)) + + # Configure the algorithm itself + GeoModelTestAlg = CompFactory.GeoModelTestAlg + a.addEventAlgo(GeoModelTestAlg(name, FirstSCTStation=0, + LastSCTStation=3, + PrintSctIDs=True, + **kwargs)) + + return a + +if __name__ == "__main__": + from AthenaCommon.Logging import log#, logging + from AthenaCommon.Configurable import Configurable + from CalypsoConfiguration.AllConfigFlags import ConfigFlags + + Configurable.configurableRun3Behavior = True + +# Flags for this job + ConfigFlags.Input.isMC = True # Needed to bypass autoconfig + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion + ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Default FASER geometry + ConfigFlags.GeoModel.GeoExportFile = "FaserNu03.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) + ConfigFlags.Detector.GeometryEmulsion = True + ConfigFlags.Detector.GeometryTrench = True + # ConfigFlags.Detector.EnableVeto = True + # ConfigFlags.Detector.EnableTrigger = True + # ConfigFlags.Detector.EnablePreshower= True + # ConfigFlags.Detector.EnableFaserSCT = True + # ConfigFlags.Detector.EnableUpstreamDipole = True + # ConfigFlags.Detector.EnableCentralDipole = True + # ConfigFlags.Detector.EnableDownstreamDipole = True + # ConfigFlags.Detector.EnableEcal = True + ConfigFlags.lock() + +# Configure components + from CalypsoConfiguration.MainServicesConfig import MainServicesCfg + acc = MainServicesCfg(ConfigFlags) + +# Set up algorithm + acc.merge(GeoModelTestCfg(ConfigFlags)) + +# Configure verbosity + msgSvc = acc.getService("MessageSvc") + msgSvc.Format = "% F%30W%S%7W%R%T %0W%M" + # ConfigFlags.dump() + # logging.getLogger('forcomps').setLevel(VERBOSE) + acc.foreach_component("*").OutputLevel = VERBOSE + acc.foreach_component("*ClassID*").OutputLevel = INFO + log.setLevel(VERBOSE) + +# Execute and finish + sys.exit(int(acc.run(maxEvents=1).isFailure())) diff --git a/Control/CalypsoExample/GeoModelTest/python/TestBeamTestConfig.py b/Control/CalypsoExample/GeoModelTest/python/TestBeamTestConfig.py index d590b125b0570e1628481ecbcaad312c357aa021..5dd299336c754e97a9de0fe8ec7b798c79a30f75 100644 --- a/Control/CalypsoExample/GeoModelTest/python/TestBeamTestConfig.py +++ b/Control/CalypsoExample/GeoModelTest/python/TestBeamTestConfig.py @@ -25,6 +25,7 @@ def GeoModelTestCfg(flags, name="GeoModelTestAlg", **kwargs): LastSCTStation=0, NumVetoStations=1, NumVetoPlatesPerStation=2, + NumVetoNuStations=0, NumTriggerStations=0, PrintSctIDs=True, **kwargs)) diff --git a/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.cxx b/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.cxx index 0865640503cfd4d2862f643acb6cbe38a7828dc4..0db09483da97480f304421db1ff6a1e464e0b0c5 100644 --- a/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.cxx +++ b/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.cxx @@ -4,6 +4,7 @@ #include "GeoModelFaserUtilities/GeoModelExperiment.h" #include "ScintReadoutGeometry/VetoDetectorManager.h" +#include "ScintReadoutGeometry/VetoNuDetectorManager.h" #include "ScintReadoutGeometry/TriggerDetectorManager.h" #include "ScintReadoutGeometry/PreshowerDetectorManager.h" #include "TrackerReadoutGeometry/SCT_DetectorManager.h" @@ -12,6 +13,7 @@ #include "TrackerReadoutGeometry/SiDetectorElement.h" #include "ScintIdentifier/VetoID.h" +#include "ScintIdentifier/VetoNuID.h" #include "ScintIdentifier/TriggerID.h" #include "ScintIdentifier/PreshowerID.h" #include "TrackerIdentifier/FaserSCT_ID.h" @@ -68,6 +70,8 @@ StatusCode GeoModelTestAlg::execute(const EventContext& ctx) const ATH_CHECK(testVeto()); + if (m_numVetoNuStations > 0) ATH_CHECK(testVetoNu()); + ATH_CHECK(testTrigger()); ATH_CHECK(testPreshower()); @@ -469,6 +473,160 @@ StatusCode GeoModelTestAlg::testSCT() const return StatusCode::SUCCESS; } +StatusCode GeoModelTestAlg::testVetoNu() const +{ + // Test retrieval of helper object directly from store + const VetoNuID* helper = nullptr; + ATH_CHECK(detStore()->retrieve(helper, "VetoNuID")); + if (helper != nullptr) + { + // Test neighbors with helper function + const IdContext& context = helper->plate_context(); + ATH_MSG_ALWAYS("Retrieved VetoNuID helper from DetStore."); + for (int iStation = 0; iStation < m_numVetoNuStations; iStation++) + { + for (int iPlate = 0; iPlate < m_numVetoNuPlatesPerStation; iPlate++) + { + Identifier thisId = helper->plate_id(iStation, iPlate, true); + IdentifierHash thisHash = helper->plate_hash(thisId); + IdentifierHash prevHash; + IdentifierHash nextHash; + Identifier prevId; + Identifier nextId; + int prevStation {-1}; + int prevPlate {-1}; + int nextStation {-1}; + int nextPlate {-1}; + int prevStat = helper->get_prev_in_z(thisHash, prevHash); + if (prevStat == 0) + { + IdentifierHash testHash; + int nextStat = helper->get_next_in_z(prevHash, testHash); + if (nextStat != 0 || testHash != thisHash) + { + ATH_MSG_FATAL("Next VetoNu plate (" << testHash << ") of previous (" << prevHash << ") is not the original (" << thisHash <<")" ); + return StatusCode::FAILURE; + } + prevStat = helper->get_id(prevHash, prevId, &context); + if (prevStat == 0) + { + prevStation = helper->station(prevId); + prevPlate = helper->plate(prevId); + } + } + int nextStat = helper->get_next_in_z(thisHash, nextHash); + if (nextStat == 0) + { + IdentifierHash testHash; + prevStat = helper->get_prev_in_z(nextHash, testHash); + if (prevStat != 0 || testHash != thisHash) + { + ATH_MSG_FATAL("Previous veto plate (" << testHash << ") of next (" << nextHash << ") is not the original (" << thisHash <<")" ); + return StatusCode::FAILURE; + } + nextStat = helper->get_id(nextHash, nextId, &context); + if (nextStat == 0) + { + nextStation = helper->station(nextId); + nextPlate = helper->plate(nextId); + } + } + ATH_MSG_ALWAYS("Station/Plate " << iStation << "/" << iPlate << + " (" << thisHash << ") " << + " : prev = " << prevStation << "/" << prevPlate << + " , next = " << nextStation << "/" << nextPlate ); + } + } + } + else + { + ATH_MSG_FATAL("Failed to retrieve VetoNuID helper from DetStore."); + return StatusCode::FAILURE; + } + + // Test direct retrieval of typed managers from DetStore + const ScintDD::VetoNuDetectorManager* vetoMgr = nullptr; + ATH_CHECK(detStore()->retrieve(vetoMgr, "VetoNu")); + if (vetoMgr != nullptr) + { + ATH_MSG_ALWAYS("Retrieved (typed) VetoNu detector manager with " << vetoMgr->getNumTreeTops() << " treetops directly from DetStore."); + // Compare numerology with the "right" answers from our properties + if (vetoMgr->numerology().numStations() != m_numVetoNuStations) + { + ATH_MSG_FATAL("Disagreement in number of veto stations."); + return StatusCode::FAILURE; + } + if (m_numVetoNuStations > 0 && vetoMgr->numerology().numPlatesPerStation() != m_numVetoNuPlatesPerStation) + { + ATH_MSG_FATAL("Disagreement in number of plates per veto station."); + return StatusCode::FAILURE; + } + if (m_numVetoNuStations > 0 && m_numVetoNuPlatesPerStation > 0 && vetoMgr->numerology().numPmtsPerPlate() != m_numVetoNuPmtsPerPlate) + { + ATH_MSG_FATAL("Disagreement in number of pmts per veto plate."); + return StatusCode::FAILURE; + } + // Test detector elements + const ScintDD::ScintDetectorElementCollection* elements = vetoMgr->getDetectorElementCollection(); + for (int station = 0; station < m_numVetoNuStations; station++) + { + for (int plate = 0; plate < m_numVetoNuPlatesPerStation; plate++) + { + Identifier id = helper->plate_id(station, plate, true); + if (!vetoMgr->identifierBelongs(id)) + { + ATH_MSG_FATAL("Valid VetoNu identifier does not pass identifierBelongs."); + return StatusCode::FAILURE; + } + IdentifierHash hash = helper->plate_hash(id); + ScintDD::ScintDetectorElement* elementByLevels = vetoMgr->getDetectorElement(station, plate); + ScintDD::ScintDetectorElement* elementById = vetoMgr->getDetectorElement(id); + ScintDD::ScintDetectorElement* elementByHash = vetoMgr->getDetectorElement(hash); + ScintDD::ScintDetectorElement* element = (*elements)[hash]; + if (elementByLevels != element || elementById != element || elementByHash != element) + { + ATH_MSG_FATAL("Inconsistent retrieval of VetoNu detector elements"); + return StatusCode::FAILURE; + } + ATH_MSG_ALWAYS("Found VetoNu plate (" << station << ", " << plate << ") with global center at (" << + element->center().x() << ", " << + element->center().y() << ", " << + element->center().z() << ")." + ); + const ScintDD::ScintDetectorElement* next = element->nextInZ(); + if (next != nullptr) + { + if (next->prevInZ() != element) + { + ATH_MSG_FATAL("Previous neighbor of next VetoNu element is not this element."); + return StatusCode::FAILURE; + } + } + const ScintDD::ScintDetectorElement* prev = element->prevInZ(); + if (prev != nullptr) + { + if (prev->nextInZ() != element) + { + ATH_MSG_FATAL("Next neighbor of previous VetoNu element is not this element."); + return StatusCode::FAILURE; + } + } + if (next == nullptr && prev == nullptr && m_numVetoPlatesPerStation > 1) + { + ATH_MSG_FATAL("Veto element " << hash << " has no previous OR next neighbor."); + return StatusCode::FAILURE; + } + } + } + } + else + { + ATH_MSG_FATAL("Failed to retrieve (typed) Veto detector manager directly from DetStore."); + return StatusCode::FAILURE; + } + return StatusCode::SUCCESS; +} + StatusCode GeoModelTestAlg::testVeto() const { // Test retrieval of helper object directly from store @@ -623,6 +781,10 @@ StatusCode GeoModelTestAlg::testVeto() const return StatusCode::SUCCESS; } + + + + StatusCode GeoModelTestAlg::testTrigger() const { // Test retrieval of helper object directly from store diff --git a/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.h b/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.h index 010be38c93980f6bb9db5f3f4779b5bc6144b559..9fe9ab00f3ca5fc31ca2208b2f5ae72024829636 100644 --- a/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.h +++ b/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.h @@ -26,6 +26,7 @@ class GeoModelTestAlg : public AthReentrantAlgorithm private: StatusCode testVeto() const; + StatusCode testVetoNu() const; StatusCode testTrigger() const; StatusCode testPreshower() const; StatusCode testSCT() const; @@ -45,6 +46,10 @@ class GeoModelTestAlg : public AthReentrantAlgorithm Gaudi::Property<int> m_numPreshowerPlatesPerStation {this, "NumPreshowerPlatesPerStation", 2, "Number of plates per station in the Preshower detector"}; Gaudi::Property<int> m_numPreshowerPmtsPerPlate {this, "NumPreshowerPmtsPerPlate", 1, "Number of pmts per plate in the Preshower detector"}; + Gaudi::Property<int> m_numVetoNuStations {this, "NumVetoNuStations", 1, "Number of stations in the VetoNu detector"}; + Gaudi::Property<int> m_numVetoNuPlatesPerStation {this, "NumVetoNuPlatesPerStation", 2, "Number of plates per station in the VetoNu detector"}; + Gaudi::Property<int> m_numVetoNuPmtsPerPlate {this, "NumVetoNuPmtsPerPlate", 1, "Number of pmts per plate in the VetoNu detector"}; + Gaudi::Property<int> m_firstSctStation {this, "FirstSCTStation", 1, "Identifier of the first SCT station (0 w/FaserNu, 1 otherwise)"}; Gaudi::Property<int> m_lastSctStation {this, "LastSCTStation", 3, "Identifier of the last SCT station (normally 3)"}; Gaudi::Property<int> m_numSctPlanesPerStation {this, "NumSCTPlanesPerStation", 3, "Number of planes per station in the SCT detector"}; diff --git a/DetectorDescription/FaserDetDescr/src/FaserDetectorID.cxx b/DetectorDescription/FaserDetDescr/src/FaserDetectorID.cxx index 9653eb67aad080822c7354fbc2229a64693f0b1c..59d81a8d8006bdde022b1db76092a6f97567e85e 100644 --- a/DetectorDescription/FaserDetDescr/src/FaserDetectorID.cxx +++ b/DetectorDescription/FaserDetDescr/src/FaserDetectorID.cxx @@ -42,9 +42,9 @@ FaserDetectorID::FaserDetectorID() m_CALO_ID(4), m_EMULSION_ID(1), m_VETO_ID(1), + m_VETONU_ID(4), m_TRIGGER_ID(2), m_PRESHOWER_ID(3), - m_VETONU_ID(4), m_SCT_ID(1), m_ECAL_ID(1), m_isSLHC(false), @@ -78,9 +78,9 @@ FaserDetectorID::FaserDetectorID(const FaserDetectorID& other) m_CALO_ID (other.m_CALO_ID), m_EMULSION_ID (other.m_EMULSION_ID), m_VETO_ID (other.m_VETO_ID), + m_VETONU_ID (other.m_VETONU_ID), m_TRIGGER_ID (other.m_TRIGGER_ID), m_PRESHOWER_ID (other.m_PRESHOWER_ID), - m_VETONU_ID (other.m_VETONU_ID), m_SCT_ID (other.m_SCT_ID), m_ECAL_ID (other.m_ECAL_ID), m_isSLHC (other.m_isSLHC), diff --git a/DetectorDescription/GeoModel/FaserGeoAdaptors/FaserGeoAdaptors/GeoScintHit.h b/DetectorDescription/GeoModel/FaserGeoAdaptors/FaserGeoAdaptors/GeoScintHit.h index b64fe128eac2531f3a4c44b98dbb2e19f2f9d301..3b212bbd59e5503dd7a6f14b55cc805fb6f22bb1 100644 --- a/DetectorDescription/GeoModel/FaserGeoAdaptors/FaserGeoAdaptors/GeoScintHit.h +++ b/DetectorDescription/GeoModel/FaserGeoAdaptors/FaserGeoAdaptors/GeoScintHit.h @@ -20,10 +20,12 @@ class ScintHit; class VetoID; class TriggerID; class PreshowerID; +class VetoNuID; namespace ScintDD { class VetoDetectorManager; class TriggerDetectorManager; class PreshowerDetectorManager; + class VetoNuDetectorManager; } class GeoScintHit { @@ -41,7 +43,7 @@ class GeoScintHit { // Is this hit ok? - operator bool () const { return s_veto || s_trigger || s_preshower; } + operator bool () const { return s_veto || s_trigger || s_preshower || s_vetonu; } private: @@ -49,9 +51,11 @@ class GeoScintHit { const ScintHit *m_hit; static const ScintDD::VetoDetectorManager *s_veto; + static const ScintDD::VetoNuDetectorManager *s_vetonu; static const ScintDD::TriggerDetectorManager *s_trigger; static const ScintDD::PreshowerDetectorManager *s_preshower; static const VetoID *s_vID; + static const VetoNuID *s_vnID; static const TriggerID *s_tID; static const PreshowerID *s_pID; }; diff --git a/DetectorDescription/GeoModel/FaserGeoAdaptors/FaserGeoAdaptors/GeoScintHit.icc b/DetectorDescription/GeoModel/FaserGeoAdaptors/FaserGeoAdaptors/GeoScintHit.icc index 47610f91a19cded0a84bb7e6c3c955d3bf4faaa9..ad0534374be219ff4a41f944a7ebd3de52f5c090 100644 --- a/DetectorDescription/GeoModel/FaserGeoAdaptors/FaserGeoAdaptors/GeoScintHit.icc +++ b/DetectorDescription/GeoModel/FaserGeoAdaptors/FaserGeoAdaptors/GeoScintHit.icc @@ -5,11 +5,13 @@ #include "ScintSimEvent/ScintHit.h" #include "ScintReadoutGeometry/ScintDetectorElement.h" #include "ScintReadoutGeometry/VetoDetectorManager.h" +#include "ScintReadoutGeometry/VetoNuDetectorManager.h" #include "ScintReadoutGeometry/TriggerDetectorManager.h" #include "ScintReadoutGeometry/PreshowerDetectorManager.h" #include "StoreGate/StoreGateSvc.h" #include "StoreGate/StoreGateSvc.h" #include "ScintIdentifier/VetoID.h" +#include "ScintIdentifier/VetoNuID.h" #include "ScintIdentifier/TriggerID.h" #include "ScintIdentifier/PreshowerID.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h" @@ -20,12 +22,16 @@ inline void GeoScintHit::init() { if (detStore.retrieve().isSuccess()) { if(detStore->retrieve(s_veto,"Veto").isFailure()) s_veto = 0; + if(detStore->retrieve(s_vetonu,"VetoNu").isFailure()) + s_vetonu = 0; if(detStore->retrieve(s_trigger,"Trigger").isFailure()) s_trigger = 0; if(detStore->retrieve(s_preshower,"Preshower").isFailure()) s_preshower = 0; if(detStore->retrieve(s_vID,"VetoID").isFailure()) s_vID = 0; + if(detStore->retrieve(s_vnID,"VetoNuID").isFailure()) + s_vnID = 0; if(detStore->retrieve(s_tID,"TriggerID").isFailure()) s_tID = 0; if(detStore->retrieve(s_pID,"PreshowerID").isFailure()) @@ -35,7 +41,7 @@ inline void GeoScintHit::init() { inline GeoScintHit::GeoScintHit (const ScintHit & h) { m_hit = &h; - if (!s_veto || ! s_trigger || ! s_preshower ) init(); + if (!s_veto || ! s_trigger || ! s_preshower || ! s_vetonu) init(); } inline HepGeom::Point3D<double> GeoScintHit::getGlobalPosition() const { @@ -48,6 +54,11 @@ inline HepGeom::Point3D<double> GeoScintHit::getGlobalPosition() const { m_hit->getPlate()); geoelement = s_veto->getDetectorElement(id); } + else if (m_hit->isVetoNu()) { + id = s_vnID->plate_id(Station, + m_hit->getPlate()); + geoelement = s_vetonu->getDetectorElement(id); + } else if (m_hit->isTrigger()) { id = s_tID->plate_id(Station, m_hit->getPlate()); diff --git a/DetectorDescription/GeoModel/FaserGeoAdaptors/src/statics.cxx b/DetectorDescription/GeoModel/FaserGeoAdaptors/src/statics.cxx index ca6dd213cbe3a3782bbe5a45500b9a09e48eee09..ab41b1e48be0304a68b0a79e846096bbd60f2acd 100644 --- a/DetectorDescription/GeoModel/FaserGeoAdaptors/src/statics.cxx +++ b/DetectorDescription/GeoModel/FaserGeoAdaptors/src/statics.cxx @@ -9,12 +9,14 @@ const NeutrinoDD::EmulsionDetectorManager *GeoNeutrinoHit::s_emulsion = 0; const ScintDD::VetoDetectorManager *GeoScintHit::s_veto = 0; +const ScintDD::VetoNuDetectorManager *GeoScintHit::s_vetonu = 0; const ScintDD::TriggerDetectorManager *GeoScintHit::s_trigger = 0; const ScintDD::PreshowerDetectorManager *GeoScintHit::s_preshower = 0; const TrackerDD::SCT_DetectorManager *GeoFaserSiHit::s_sct; const CaloDD::EcalDetectorManager *GeoFaserCaloHit::s_ecal = 0; const EmulsionID *GeoNeutrinoHit::s_nID = 0; const VetoID *GeoScintHit::s_vID = 0; +const VetoNuID *GeoScintHit::s_vnID = 0; const TriggerID *GeoScintHit::s_tID = 0; const PreshowerID *GeoScintHit::s_pID = 0; const FaserSCT_ID *GeoFaserSiHit::s_sID = 0; diff --git a/DetectorDescription/GeoModel/FaserGeoModel/CMakeLists.txt b/DetectorDescription/GeoModel/FaserGeoModel/CMakeLists.txt index 2086d60b12f50e223aa3bf0f0230ca8717aee6c7..38a8976dafe047cce2da022e6e1cee2267ef2aad 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/CMakeLists.txt +++ b/DetectorDescription/GeoModel/FaserGeoModel/CMakeLists.txt @@ -8,17 +8,17 @@ atlas_subdir( FaserGeoModel ) if (INSTALL_GEOMDB) add_custom_command ( - OUTPUT ${CMAKE_BINARY_DIR}/data/geomDB_sqlite + OUTPUT ${CMAKE_BINARY_DIR}/data/geomDB/geomDB_sqlite DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/geomDB.sql - COMMAND mkdir -p ${CMAKE_BINARY_DIR}/data - COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/data/geomDB.sql | sqlite3 ${CMAKE_BINARY_DIR}/data/geomDB_sqlite + COMMAND mkdir -p ${CMAKE_BINARY_DIR}/data/geomDB + COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/data/geomDB.sql | sqlite3 ${CMAKE_BINARY_DIR}/data/geomDB/geomDB_sqlite ) - add_custom_target( geomDB ALL DEPENDS ${CMAKE_BINARY_DIR}/data/geomDB_sqlite ) + add_custom_target( geomDB ALL DEPENDS ${CMAKE_BINARY_DIR}/data/geomDB/geomDB_sqlite ) # Install the generated file: - install( FILES ${CMAKE_BINARY_DIR}/data/geomDB_sqlite - DESTINATION ${CMAKE_INSTALL_DATADIR} ) + install( FILES ${CMAKE_BINARY_DIR}/data/geomDB/geomDB_sqlite + DESTINATION ${CMAKE_INSTALL_DATADIR}/geomDB/ ) endif() # Install python files from the package: diff --git a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql index 25673485d439d673d60366b80f62285228601f98..81a979c3cc714898a733bc15ffa8896047c0d5a9 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, @@ -250,6 +269,75 @@ CREATE TABLE IF NOT EXISTS "VETORADIATORGENERAL_DATA2TAG" ( "VETORADIATORGENERAL_DATA_ID" SLONGLONG ); -- +-- Tables for describing VetoNu scintillator plates (and passive radiators) +-- +DROP TABLE IF EXISTS "VETONUTOPLEVEL_DATA"; +CREATE TABLE IF NOT EXISTS "VETONUTOPLEVEL_DATA" ( + "VETONUTOPLEVEL_DATA_ID" SLONGLONG UNIQUE, + "POSX" DOUBLE, + "POSY" DOUBLE, + "POSZ" DOUBLE, + "ROTX" DOUBLE, + "ROTY" DOUBLE, + "ROTZ" DOUBLE, + "ROTORDER" INT, + "LABEL" TEXT +); +-- +-- The DATA2TAG tables associate specific rows of the corresponding +-- _DATA table with the referenced tag (from the HVS_TAG2NODE table). +-- This is a many-to-many relationship: each row may belong to +-- several tags, and each tag may apply to several rows. +DROP TABLE IF EXISTS "VETONUTOPLEVEL_DATA2TAG"; +CREATE TABLE IF NOT EXISTS "VETONUTOPLEVEL_DATA2TAG" ( + "VETONUTOPLEVEL_TAG_ID" SLONGLONG, + "VETONUTOPLEVEL_DATA_ID" SLONGLONG +); +-- +DROP TABLE IF EXISTS "VETONUSTATIONGENERAL_DATA"; +CREATE TABLE IF NOT EXISTS "VETONUSTATIONGENERAL_DATA" ( + "VETONUSTATIONGENERAL_DATA_ID" SLONGLONG UNIQUE, + "NUMPLATES" INT, + "PLATEPITCH" DOUBLE +); +-- +DROP TABLE IF EXISTS "VETONUSTATIONGENERAL_DATA2TAG"; +CREATE TABLE IF NOT EXISTS "VETONUSTATIONGENERAL_DATA2TAG" ( + "VETONUSTATIONGENERAL_TAG_ID" SLONGLONG, + "VETONUSTATIONGENERAL_DATA_ID" SLONGLONG +); +-- +DROP TABLE IF EXISTS "VETONUPLATEGENERAL_DATA"; +CREATE TABLE IF NOT EXISTS "VETONUPLATEGENERAL_DATA" ( + "VETONUPLATEGENERAL_DATA_ID" SLONGLONG UNIQUE, + "NUMPMTS" INT, + "WIDTH" DOUBLE, + "LENGTH" DOUBLE, + "THICKNESS" DOUBLE, + "MATERIAL" TEXT +); +-- +DROP TABLE IF EXISTS "VETONUPLATEGENERAL_DATA2TAG"; +CREATE TABLE IF NOT EXISTS "VETONUPLATEGENERAL_DATA2TAG" ( + "VETONUPLATEGENERAL_TAG_ID" SLONGLONG, + "VETONUPLATEGENERAL_DATA_ID" SLONGLONG +); +-- +DROP TABLE IF EXISTS "VETONURADIATORGENERAL_DATA"; +CREATE TABLE IF NOT EXISTS "VETONURADIATORGENERAL_DATA" ( + "VETONURADIATORGENERAL_DATA_ID" SLONGLONG UNIQUE, + "WIDTH" DOUBLE, + "LENGTH" DOUBLE, + "THICKNESS" DOUBLE, + "MATERIAL" TEXT +); +-- +DROP TABLE IF EXISTS "VETONURADIATORGENERAL_DATA2TAG"; +CREATE TABLE IF NOT EXISTS "VETONURADIATORGENERAL_DATA2TAG" ( + "VETONURADIATORGENERAL_TAG_ID" SLONGLONG, + "VETONURADIATORGENERAL_DATA_ID" SLONGLONG +); +-- -- Tables for describing Trigger scintillator plates (and passive radiators) -- DROP TABLE IF EXISTS "TRIGGERTOPLEVEL_DATA"; @@ -583,6 +671,22 @@ CREATE TABLE IF NOT EXISTS "VETOSWITCHES_DATA2TAG" ( "VETOSWITCHES_DATA_ID" SLONGLONG ); -- +DROP TABLE IF EXISTS "VETONUSWITCHES_DATA"; +CREATE TABLE IF NOT EXISTS "VETONUSWITCHES_DATA" ( + "VETONUSWITCHES_DATA_ID" SLONGLONG UNIQUE, + "DETECTORNAME" TEXT , + "USEMAGFIELDSVC" INT , + "COSMICLAYOUT" INT , + "VERSIONNAME" TEXT , + "LAYOUT" TEXT , + "DESCRIPTION" TEXT +); +DROP TABLE IF EXISTS "VETONUSWITCHES_DATA2TAG"; +CREATE TABLE IF NOT EXISTS "VETONUSWITCHES_DATA2TAG" ( + "VETONUSWITCHES_TAG_ID" SLONGLONG, + "VETONUSWITCHES_DATA_ID" SLONGLONG +); +-- DROP TABLE IF EXISTS "TRIGGERSWITCHES_DATA"; CREATE TABLE IF NOT EXISTS "TRIGGERSWITCHES_DATA" ( "TRIGGERSWITCHES_DATA_ID" SLONGLONG UNIQUE, @@ -631,6 +735,24 @@ CREATE TABLE IF NOT EXISTS "ECALSWITCHES_DATA2TAG" ( "ECALSWITCHES_TAG_ID" SLONGLONG, "ECALSWITCHES_DATA_ID" SLONGLONG ); +-- +DROP TABLE IF EXISTS "TRENCHSWITCHES_DATA"; +CREATE TABLE IF NOT EXISTS "TRENCHSWITCHES_DATA" ( + "TRENCHSWITCHES_DATA_ID" SLONGLONG UNIQUE, + "DETECTORNAME" TEXT , + "USEMAGFIELDSVC" INT , + "COSMICLAYOUT" INT , + "VERSIONNAME" TEXT , + "LAYOUT" TEXT , + "DESCRIPTION" TEXT, + "GDMLFILE" TEXT +); +DROP TABLE IF EXISTS "TRENCHSWITCHES_DATA2TAG"; +CREATE TABLE IF NOT EXISTS "TRENCHSWITCHES_DATA2TAG" ( + "TRENCHSWITCHES_TAG_ID" SLONGLONG, + "TRENCHSWITCHES_DATA_ID" SLONGLONG +); + -- DROP TABLE IF EXISTS "NEUTRINOIDENTIFIER_DATA"; CREATE TABLE IF NOT EXISTS "NEUTRINOIDENTIFIER_DATA" ( @@ -689,6 +811,9 @@ CREATE TABLE IF NOT EXISTS "CALOIDENTIFIER_DATA2TAG" ( -- Data for the HVS_NODE table INSERT INTO "HVS_NODE" VALUES (0, "FASER", 0, 1, NULL); INSERT INTO "HVS_NODE" VALUES (90, "FaserCommon", 0, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (5, "Cavern", 0, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (51, "Trench", 5, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (514, "TrenchSwitches", 0, 0, NULL); INSERT INTO "HVS_NODE" VALUES (9000, "Materials", 0, 1, NULL); INSERT INTO "HVS_NODE" VALUES (9001, "StdMaterials", 9000, 0, NULL); INSERT INTO "HVS_NODE" VALUES (9002, "StdMatComponents", 9000, 0, NULL); @@ -703,6 +828,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); @@ -725,6 +851,12 @@ INSERT INTO "HVS_NODE" VALUES (232, "PreshowerPlateGeneral", 23, 0, NULL); INSERT INTO "HVS_NODE" VALUES (234, "PreshowerSwitches", 23, 0, NULL ); INSERT INTO "HVS_NODE" VALUES (235, "PreshowerRadiatorGeneral", 23, 0, NULL); INSERT INTO "HVS_NODE" VALUES (236, "PreshowerAbsorberGeneral", 23, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (24, "VetoNu", 2, 1, NULL); +INSERT INTO "HVS_NODE" VALUES (240, "VetoNuTopLevel", 24, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (241, "VetoNuStationGeneral", 24, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (242, "VetoNuPlateGeneral", 24, 0, NULL); +INSERT INTO "HVS_NODE" VALUES (244, "VetoNuSwitches", 24, 0, NULL ); +INSERT INTO "HVS_NODE" VALUES (245, "VetoNuRadiatorGeneral", 24, 0, NULL); INSERT INTO "HVS_NODE" VALUES (3, "Tracker", 0, 1, NULL); INSERT INTO "HVS_NODE" VALUES (3003, "TrackerMaterials", 3, 0, NULL); INSERT INTO "HVS_NODE" VALUES (3004, "TrackerMatComponents", 3, 0, NULL); @@ -762,30 +894,40 @@ INSERT INTO "HVS_TAG2NODE" VALUES (0, "FASER-CR", 107784, NULL, 0, 0, 1598400000 INSERT INTO "HVS_TAG2NODE" VALUES (0, "FASER-02", 107788, NULL, 0, 0, 1619222400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (0, "FASERNU-02", 107804, NULL, 0, 0, 1619308800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (0, "FASER-TB00", 107834, NULL, 0, 0, 1627862400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (0, "FASERNU-03", 107835, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (90, "FaserCommon-00", 100013, NULL, 0, 0, 1549324800000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (5, "Cavern-00", 107850, NULL, 0, 0, 1652313600000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (51, "Trench-00", 107851, NULL, 0, 0, 1652313600000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (514,"TrenchSwitches-00", 107852, NULL, 0, 0, 1652313600000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (9000, "Materials-00", 100005, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (9001, "StdMaterials-00", 100006, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (9002, "StdMatComponents-00", 100007, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (9003, "Elements-00", 100008, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (1, "Neutrino-00", 100031, NULL, 0, 0, 1582416000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (1, "Neutrino-TB00", 107811, NULL, 0, 0, 1627862400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (1, "Neutrino-01", 107839, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (11,"Emulsion-00", 100034, NULL, 0, 0, 1582416000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (11,"Emulsion-TB00", 107812, NULL, 0, 0, 1582416000000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (11,"Emulsion-01", 107840, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (110, "EmulsionTopLevel-00", 100035, NULL, 0, 0, 1582416000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (110, "EmulsionTopLevel-TB00", 107813, NULL, 0, 0, 1627862400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (110, "EmulsionTopLevel-01", 107841, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (111, "EmulsionGeneral-00", 107805, NULL, 0, 0, 1619308800000000000, NULL, 22); 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); INSERT INTO "HVS_TAG2NODE" VALUES (2, "Scintillator-TB00", 107814, NULL, 0, 0, 1627862400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (2, "Scintillator-03", 107843, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (3, "Tracker-00", 100002, NULL, 0, 0, 1549238400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (3, "Tracker-01", 100038, NULL, 0, 0, 1590796800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (3, "Tracker-CR", 107783, NULL, 0, 0, 1598400000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (3, "Tracker-02", 107790, NULL, 0, 0, 1619222400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (3, "Tracker-TB00", 107815, NULL, 0, 0, 1627862400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (3, "Tracker-03", 107836, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (31, "SCT-00", 100026, NULL, 0, 0, 1567987200000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (31, "SCT-01", 100037, NULL, 0, 0, 1159079680000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (31, "SCT-CR", 107781, NULL, 0, 0, 1598400000000000000, NULL, 22); @@ -795,6 +937,7 @@ INSERT INTO "HVS_TAG2NODE" VALUES (32, "Dipole-00", 100027, NULL, 0, 0, 15686784 INSERT INTO "HVS_TAG2NODE" VALUES (32, "Dipole-01", 100041, NULL, 0, 0, 1590796800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (32, "Dipole-02", 107792, NULL, 0, 0, 1619222400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (32, "Dipole-TB00", 107817, NULL, 0, 0, 1627862400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (32, "Dipole-03", 107837, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (310, "SctTopLevel-00", 106788, NULL, 0, 0, 1567987200000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (310, "SctTopLevel-01", 106790, NULL, 0, 0, 1590796800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (310, "SctTopLevel-CR", 107786, NULL, 0, 0, 1598400000000000000, NULL, 22); @@ -816,6 +959,7 @@ INSERT INTO "HVS_TAG2NODE" VALUES (320, "DipoleTopLevel-00", 100029, NULL, 0, 0, INSERT INTO "HVS_TAG2NODE" VALUES (320, "DipoleTopLevel-01", 100040, NULL, 0, 0, 1590796800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (320, "DipoleTopLevel-02", 107794, NULL, 0, 0, 1619222400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (320, "DipoleTopLevel-TB00", 107819, NULL, 0, 0, 1627862400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (320, "DipoleTopLevel-03", 107838, NULL, 0, 0, 1652054400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (321, "DipoleGeneral-00", 100004, NULL, 0, 0, 1568678400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (324, "DipoleSwitches-00", 100028, NULL, 0, 0, 1568678400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (4, "Calorimeter-00", 100003, NULL, 0, 0, 1549238400000000000, NULL, 22); @@ -856,6 +1000,12 @@ INSERT INTO "HVS_TAG2NODE" VALUES (231, "PreshowerStationGeneral-01", 100052, N INSERT INTO "HVS_TAG2NODE" VALUES (232, "PreshowerPlateGeneral-00", 120025, NULL, 0, 0, 1581292800000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (235, "PreshowerRadatorGeneral-00", 107808, NULL, 0, 0, 1627776000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (236, "PreshowerAbsorberGeneral-00", 107809, NULL, 0, 0, 1627776000000000000, NULL, 22); + +INSERT INTO "HVS_TAG2NODE" VALUES (240, "VetoNuTopLevel-00", 107845, NULL, 0, 0, 1652054400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (241, "VetoNuStationGeneral-00", 107846, NULL, 0, 0, 1652054400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (242, "VetoNuPlateGeneral-00", 107847, NULL, 0, 0, 1652054400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (245, "VetoNuRadiatorGeneral-00", 107849, NULL, 0, 0, 1652054400000000000, NULL, 22); + INSERT INTO "HVS_TAG2NODE" VALUES (1003, "NeutrinoMaterials-00", 100032, NULL, 0, 0, 1582416000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (1004, "NeutrinoMatComponents-00", 100033, NULL, 0, 0, 1582416000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (2003, "ScintMaterials-00", 100011, NULL, 0, 0, 1549238400000000000, NULL, 22); @@ -867,6 +1017,7 @@ INSERT INTO "HVS_TAG2NODE" VALUES (4004, "CaloMatComponents-00", 100024, NULL, 0 INSERT INTO "HVS_TAG2NODE" VALUES (214, "VetoSwitches-00", 100014, NULL, 0, 0, 1550361600000000000 ,NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (224, "TriggerSwitches-00", 110014, NULL, 0, 0, 1581292800000000000 ,NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (234, "PreshowerSwitches-00", 120014, NULL, 0, 0, 1550361600000000000 ,NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (244, "VetoNuSwitches-00", 107848, NULL, 0, 0, 1550361600000000000 ,NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (21, "Veto-00", 100015, NULL, 0, 0, 1550448000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (22, "Trigger-00", 100019, NULL, 0, 0, 1550448000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (23, "Preshower-00", 100020, NULL, 0, 0, 1550448000000000000, NULL, 22); @@ -879,6 +1030,8 @@ INSERT INTO "HVS_TAG2NODE" VALUES (23, "Preshower-02", 107803, NULL, 0, 0, 16192 INSERT INTO "HVS_TAG2NODE" VALUES (21, "Veto-TB00", 107826, NULL, 0, 0, 1627862400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (22, "Trigger-TB00", 107827, NULL, 0, 0, 1627862400000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (23, "Preshower-TB00", 107828, NULL, 0, 0, 1627862400000000000, NULL, 22); +INSERT INTO "HVS_TAG2NODE" VALUES (24, "VetoNu-00", 107844, NULL, 0, 0, 1652054400000000000, NULL, 22); + INSERT INTO "HVS_TAG2NODE" VALUES (1005, "NeutrinoIdentifier-00", 100030, NULL, 0, 0, 1582416000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (2005, "ScintIdentifier-00", 100016, NULL, 0, 0, 1550448000000000000, NULL, 22); INSERT INTO "HVS_TAG2NODE" VALUES (2005, "ScintIdentifier-TB00", 107832, NULL, 0, 0, 1627862400000000000, NULL, 22); @@ -890,36 +1043,51 @@ INSERT INTO "HVS_TAG2NODE" VALUES (4005, "CaloIdentifier-00", 100018, NULL, 0, 0 INSERT INTO "HVS_TAG2NODE" VALUES (4005, "CaloIdentifier-TB00", 107831, NULL, 0, 0, 1627862400000000000, NULL, 22); -- Data for the HVS_LTAG2LTAG table INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107804, 1, 100031); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107835, 1, 107839); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107834, 1, 107811); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 2, 100001); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100039, 2, 100042); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107784, 2, 100042); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107788, 2, 107789); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107804, 2, 107789); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107834, 2, 107814); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107835, 2, 107843); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 3, 100002); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100039, 3, 100038); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107784, 3, 107783); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107788, 3, 107790); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107804, 3, 107790); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107834, 3, 107815); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107835, 3, 107836); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 4, 100003); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100039, 4, 100003); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107784, 4, 100003); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107788, 4, 107795); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107804, 4, 107795); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107834, 4, 107820); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107835, 4, 107795); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 90, 100013); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100039, 90, 100013); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107788, 90, 100013); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107804, 90, 100013); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107834, 90, 100013); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107835, 90, 100013); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107835, 5, 107850); +INSERT INTO "HVS_LTAG2LTAG" VALUES (5, 107850, 51, 107851); +INSERT INTO "HVS_LTAG2LTAG" VALUES (51, 107835, 514, 107852); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100000, 9000, 100005); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 100039, 9000, 100005); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107784, 9000, 100005); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107788, 9000, 100005); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107804, 9000, 100005); INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107834, 9000, 100005); +INSERT INTO "HVS_LTAG2LTAG" VALUES (0, 107835, 9000, 100005); INSERT INTO "HVS_LTAG2LTAG" VALUES (9000, 100005, 9001, 100006); INSERT INTO "HVS_LTAG2LTAG" VALUES (9000, 100005, 9002, 100007); INSERT INTO "HVS_LTAG2LTAG" VALUES (9000, 100005, 9003, 100008); INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 100031, 11, 100034); INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 107811, 11, 107812); +INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 107839, 11, 107840); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 100034, 110, 100035); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 100034, 111, 107805); INSERT INTO "HVS_LTAG2LTAG" VALUES (11, 100034, 112, 107806); @@ -930,12 +1098,21 @@ 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, 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); INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 107811, 1003, 100032); INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 107811, 1004, 100033); INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 107811, 1005, 100030); +INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 107839, 1003, 100032); +INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 107839, 1004, 100033); +INSERT INTO "HVS_LTAG2LTAG" VALUES (1, 107839, 1005, 100030); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 100001, 21, 100015); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 100001, 22, 100019); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 100001, 23, 100020); @@ -948,6 +1125,10 @@ INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107789, 23, 107803); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107814, 21, 107826); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107814, 22, 107827); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107814, 23, 107828); +INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107843, 21, 107801); +INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107843, 22, 107802); +INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107843, 23, 107803); +INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107843, 24, 107844); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 100001, 2003, 100011); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 100001, 2004, 100012); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 100001, 2005, 100016); @@ -960,6 +1141,9 @@ INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107789, 2005, 100016); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107814, 2003, 100011); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107814, 2004, 100012); INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107814, 2005, 100016); +INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107843, 2003, 100011); +INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107843, 2004, 100012); +INSERT INTO "HVS_LTAG2LTAG" VALUES (2, 107843, 2005, 100016); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 100015, 210, 100009); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 100043, 210, 100046); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 107801, 210, 100046); @@ -976,6 +1160,7 @@ INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 100015, 214, 100014); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 100043, 214, 100014); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 107801, 214, 100014); INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 107826, 214, 100014); +INSERT INTO "HVS_LTAG2LTAG" VALUES (21, 107801, 215, 107810); INSERT INTO "HVS_LTAG2LTAG" VALUES (22, 100019, 220, 110009); INSERT INTO "HVS_LTAG2LTAG" VALUES (22, 100044, 220, 100047); INSERT INTO "HVS_LTAG2LTAG" VALUES (22, 107802, 220, 100047); @@ -1008,28 +1193,40 @@ INSERT INTO "HVS_LTAG2LTAG" VALUES (23, 100020, 234, 120014); INSERT INTO "HVS_LTAG2LTAG" VALUES (23, 100045, 234, 120014); INSERT INTO "HVS_LTAG2LTAG" VALUES (23, 107803, 234, 120014); INSERT INTO "HVS_LTAG2LTAG" VALUES (23, 107828, 234, 120014); +INSERT INTO "HVS_LTAG2LTAG" VALUES (23, 107803, 235, 107808); +INSERT INTO "HVS_LTAG2LTAG" VALUES (23, 107803, 236, 107809); +INSERT INTO "HVS_LTAG2LTAG" VALUES (24, 107844, 240, 107845); +INSERT INTO "HVS_LTAG2LTAG" VALUES (24, 107844, 241, 107846); +INSERT INTO "HVS_LTAG2LTAG" VALUES (24, 107844, 242, 107847); +INSERT INTO "HVS_LTAG2LTAG" VALUES (24, 107844, 244, 107848); +INSERT INTO "HVS_LTAG2LTAG" VALUES (24, 107844, 245, 107849); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100002, 31, 100026); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100038, 31, 100037); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107783, 31, 107781); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107790, 31, 107791); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107815, 31, 107816); +INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107836, 31, 107791); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100002, 32, 100027); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100038, 32, 100041); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107790, 32, 107792); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107815, 32, 107817); +INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107836, 32, 107837); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100002, 3003, 100021); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100038, 3003, 100021); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107790, 3003, 100021); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107815, 3003, 100021); +INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107836, 3003, 100021); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100002, 3004, 100022); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100038, 3004, 100022); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107790, 3004, 100022); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107815, 3004, 100022); +INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107836, 3004, 100022); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100002, 3005, 100017); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 100038, 3005, 100017); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107781, 3005, 107785); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107790, 3005, 107787); INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107815, 3005, 107829); +INSERT INTO "HVS_LTAG2LTAG" VALUES (3, 107836, 3005, 107787); INSERT INTO "HVS_LTAG2LTAG" VALUES (31, 100026, 310, 106788); INSERT INTO "HVS_LTAG2LTAG" VALUES (31, 100037, 310, 106790); INSERT INTO "HVS_LTAG2LTAG" VALUES (31, 100081, 310, 107786); @@ -1074,14 +1271,17 @@ INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 100027, 320, 100029); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 100041, 320, 100040); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107792, 320, 107794); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107817, 320, 107819); +INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107837, 320, 107838); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 100027, 321, 100004); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 100041, 321, 100004); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107792, 321, 100004); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107817, 321, 100004); +INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107837, 321, 100004); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 100027, 324, 100028); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 100041, 324, 100028); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107792, 324, 100028); INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107817, 324, 100028); +INSERT INTO "HVS_LTAG2LTAG" VALUES (32, 107837, 324, 100028); INSERT INTO "HVS_LTAG2LTAG" VALUES (4, 100003, 41, 100056); INSERT INTO "HVS_LTAG2LTAG" VALUES (4, 107795, 41, 107796); INSERT INTO "HVS_LTAG2LTAG" VALUES (4, 107820, 41, 107821); @@ -1489,6 +1689,83 @@ INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-TB00", "NeutrinoIdentifier", "Neutrino INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-TB00", "ScintIdentifier", "ScintIdentifier-TB00", 107832); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-TB00", "TrackerIdentifier", "TrackerIdentifier-TB00", 107829); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-TB00", "CaloIdentifier", "CaloIdentifier-TB00", 107831); +-- +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "FASER", "FASERNU-03", 107835); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "FaserCommon", "FaserCommon-00", 100013); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Cavern", "Cavern-00", 107850); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Trench", "Trench-00", 107851); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "TrenchSwitches", "TrenchSwitches-00", 107852); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Materials", "Materials-00", 100005); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "StdMaterials", "StdMaterials-00", 100006); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "StdMatComponents", "StdMatComponents-00", 100007); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Elements", "Elements-00", 100008); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Neutrino", "Neutrino-01", 107839); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Emulsion", "Emulsion-01", 107840); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EmulsionTopLevel", "EmulsionTopLevel-01", 107841); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EmulsionGeneral", "EmulsionGeneral-00", 107805); +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-03", 107843); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Tracker", "Tracker-03", 107836); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SCT", "SCT-02", 107791); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctTopLevel", "SCTTopLevel-02", 107793); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctBrlModule", "SCTBrlModule-00", 107003); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctBrlSensor", "SCTBrlSensor-00", 106730); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctFaserGeneral", "SCTFaserGeneral-01", 106791); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctSwitches", "SCTSwitches-00", 107782); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SCTMaterials", "SCTMaterials-00", 107777); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SCTMatComponents", "SCTMatComponents-00", 107778); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctConditions", "SctConditions-00", 107779); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctFrame", "SctFrame-00", 100053); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctFrameGeneral", "SctFrameGeneral-00", 100054); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "SctFrameShape", "SctFrameShape-00", 100055); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Dipole", "Dipole-03", 107837); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "DipoleTopLevel", "DipoleTopLevel-03", 107838); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "DipoleGeneral", "DipoleGeneral-00", 100004); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "DipoleSwitches", "DipoleSwitches-00", 100028); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Calorimeter", "Calorimeter-02", 107795); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Ecal", "Ecal-02", 107796); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EcalTopLevel", "EcalTopLevel-02", 107797); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EcalRowGeneral", "EcalRowGeneral-00", 100059); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "EcalSwitches", "EcalSwitches-00", 100057); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoTopLevel", "VetoTopLevel-02", 107798); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoStationGeneral", "VetoStationGeneral-01", 100049); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoPlateGeneral", "VetoPlateGeneral-01", 100050); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoRadiatorGeneral", "VetoRadiatorGeneral-00", 107810); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoNuTopLevel", "VetoNuTopLevel-00", 107845); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoNuStationGeneral", "VetoNuStationGeneral-00", 107846); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoNuPlateGeneral", "VetoNuPlateGeneral-00", 107847); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoNuRadiatorGeneral","VetoNuRadiatorGeneral-00", 107849); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "TriggerTopLevel", "TriggerTopLevel-02", 107799); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "TriggerStationGeneral", "TriggerStationGeneral-01", 100051); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "TriggerPlateGeneral", "TriggerPlateGeneral-00", 110025); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "PreshowerTopLevel", "PreshowerTopLevel-02", 107800); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "PreshowerStationGeneral", "PreshowerStationGeneral-01", 100052); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "PreshowerPlateGeneral", "PreshowerPlateGeneral-00", 120025); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "PreshowerRadiatorGeneral", "PreshowerRadiatorGeneral-00", 107808); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "PreshowerAbsorberGeneral", "PreshowerAbsorberGeneral-00", 107809); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "NeutrinoMaterials", "NeutrinoMaterials-00", 100032); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "NeutrinoMatComponents", "NeutrinoMatComponents-00", 100033); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "ScintMaterials", "ScintMaterials-00", 100011); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "ScintMatComponents", "ScintMatComponents-00", 100012); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "TrackerMaterials", "TrackerMaterials-00", 100021); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "TrackerMatComponents", "TrackerMatComponents-00", 100022); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "CaloMaterials", "CaloMaterials-00", 100023); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "CaloMatComponents", "CaloMatComponents-00", 100024); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoSwitches", "VetoSwitches-00", 100014); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "TriggerSwitches", "TriggerSwitches-00", 110014); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "PreshowerSwitches", "PreshowerSwitches-00", 120014); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoNuSwitches", "VetoNuSwitches-00", 107848); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Veto", "Veto-02", 107801); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Trigger", "Trigger-02", 107802); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "Preshower", "Preshower-02", 107803); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "VetoNu", "VetoNu-00", 107844); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "NeutrinoIdentifier", "NeutrinoIdentifier-00", 100030); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "ScintIdentifier", "ScintIdentifier-00", 100016); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "TrackerIdentifier", "TrackerIdentifier-02", 107787); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASERNU-03", "CaloIdentifier", "CaloIdentifier-00", 100018); -- -- -- Part 2b: Content (Leaf node) data @@ -2033,15 +2310,25 @@ INSERT INTO "ELEMENTS_DATA2TAG" VALUES (100008, 91); -- INSERT INTO "EMULSIONTOPLEVEL_DATA" VALUES (0, 0.0, 0.0, -2475.72, 0.0, 0.0, 0.0, 321, "Emulsion"); INSERT INTO "EMULSIONTOPLEVEL_DATA" VALUES (1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 321, "StationA"); +INSERT INTO "EMULSIONTOPLEVEL_DATA" VALUES (2, 10.0, -21.0, -2510.27, 0.0, 0.0, 0.0, 321, "Emulsion"); INSERT INTO "EMULSIONTOPLEVEL_DATA2TAG" VALUES (100035, 0); INSERT INTO "EMULSIONTOPLEVEL_DATA2TAG" VALUES (100035, 1); -INSERT INTO "EMULSIONTOPLEVEL_DATA2TAG" VALUES (107813, 0); +INSERT INTO "EMULSIONTOPLEVEL_DATA2TAG" VALUES (107841, 2); +INSERT INTO "EMULSIONTOPLEVEL_DATA2TAG" VALUES (107841, 1); -- -- 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); -- @@ -2122,6 +2409,19 @@ INSERT INTO "VETORADIATORGENERAL_DATA" VALUES (0, 400.0, 350.0, 100.0, "std::Lea INSERT INTO "VETORADIATORGENERAL_DATA2TAG" VALUES (107810, 0); -- -- +INSERT INTO "VETONUTOPLEVEL_DATA" VALUES (0, 10.0, -21.0, -3112.0, 0.0, 0.0, 0.0, 321, "VetoNu"); +INSERT INTO "VETONUTOPLEVEL_DATA" VALUES (1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 321, "StationA"); +INSERT INTO "VETONUTOPLEVEL_DATA2TAG" VALUES (107845, 0); +INSERT INTO "VETONUTOPLEVEL_DATA2TAG" VALUES (107845, 1); +-- +INSERT INTO "VETONUSTATIONGENERAL_DATA" VALUES (0, 2, 21.0); +INSERT INTO "VETONUSTATIONGENERAL_DATA2TAG" VALUES (107846, 0); +-- +-- +INSERT INTO "VETONUPLATEGENERAL_DATA" VALUES (0, 1, 300.0, 350.0, 20.0, "scint::Scintillator"); +INSERT INTO "VETONUPLATEGENERAL_DATA2TAG" VALUES (107847, 0); +-- +-- INSERT INTO "TRIGGERTOPLEVEL_DATA" VALUES (0, 0.0, 0.0, 187.0, 0.0, 0.0, 0.0, 321, "Trigger"); INSERT INTO "TRIGGERTOPLEVEL_DATA" VALUES (1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 321, "StationA"); INSERT INTO "TRIGGERTOPLEVEL_DATA" VALUES (2, 0.0, -5.0, -28.9, 0.0, 0.0, 0.0, 321, "Trigger"); @@ -2227,6 +2527,10 @@ INSERT INTO "VETOSWITCHES_DATA" VALUES (0, "Veto", 1, 0, "GEO", "Development", INSERT INTO "VETOSWITCHES_DATA2TAG" VALUES (100014, 0); -- -- +INSERT INTO "VETONUSWITCHES_DATA" VALUES (0, "VetoNu", 1, 0, "GEO", "Development", "Baseline geometry"); +INSERT INTO "VETONUSWITCHES_DATA2TAG" VALUES (107848, 0); +-- +-- INSERT INTO "TRIGGERSWITCHES_DATA" VALUES (0, "Trigger", 1, 0, "GEO", "Development", "Baseline geometry"); INSERT INTO "TRIGGERSWITCHES_DATA2TAG" VALUES (110014, 0); -- @@ -2239,6 +2543,10 @@ INSERT INTO "ECALSWITCHES_DATA" VALUES ( 0, "Ecal", 1, 0, "GEO", "Development", INSERT INTO "ECALSWITCHES_DATA2TAG" VALUES (100057, 0); -- -- +INSERT INTO "TRENCHSWITCHES_DATA" VALUES ( 0, "Trench", 1, 0, "GEO", "Development", "Baseline geometry", "TrenchGeoModel/Trench.gdml"); +INSERT INTO "TRENCHSWITCHES_DATA2TAG" VALUES (107852, 0); +-- +-- INSERT INTO "NEUTRINOIDENTIFIER_DATA" VALUES (0, "Neutrino", "NeutrinoIdDictFiles/IdDictNeutrino.xml", "Baseline layout"); INSERT INTO "NEUTRINOIDENTIFIER_DATA2TAG" VALUES (100030, 0); -- @@ -2443,6 +2751,7 @@ INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(7,0.0,0.0,-812.60,0.0,0.0,0.0,312,'Upst INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(8,0.0,0.0, 637.40,0.0,0.0,0.0,312,'CentralDipole'); INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(9,0.0,0.0,1837.40,0.0,0.0,0.0,312,'DownstreamDipole'); INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(10,0.0,0.0, 0.0,0.0,0.0,0.0,312,'Dipole'); +INSERT INTO "DIPOLETOPLEVEL_DATA" VALUES(11,0.0,0.0,-815.30,0.0,0.0,0.0,312,'UpstreamDipole'); -- shifted 2.7 mm upstream DROP TABLE IF EXISTS "DIPOLETOPLEVEL_DATA2TAG"; CREATE TABLE "DIPOLETOPLEVEL_DATA2TAG" ( "DIPOLETOPLEVEL_TAG_ID" SLONGLONG ,"DIPOLETOPLEVEL_DATA_ID" SLONGLONG ); @@ -2459,6 +2768,11 @@ INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(107794,7); INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(107794,8); INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(107794,9); INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(107819,10); +INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(107838,11); +INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(107838,3); +INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(107838,8); +INSERT INTO "DIPOLETOPLEVEL_DATA2TAG" VALUES(107838,9); + -- -- DROP TABLE IF EXISTS "DIPOLEGENERAL_DATA"; diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py index 72e1d79a4266d82191dfef3141587dea7ac460d3..d1390bf949c6322de99495b12ba0ade905fce47e 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py @@ -23,4 +23,7 @@ def FaserGeometryCfg (flags): from EcalGeoModel.EcalGeoModelConfig import EcalGeometryCfg acc.merge(EcalGeometryCfg( flags )) + from FaserGeoModel.TrenchGMConfig import TrenchGeometryCfg + acc.merge(TrenchGeometryCfg( flags )) + return acc diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelInit.py b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelInit.py index 0911c1db4ec3b16c8720abf755edf2c2568db721..af1ed16dcb630fd08948f6a648d9deb6d46756e2 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelInit.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelInit.py @@ -47,6 +47,16 @@ def _setupGeoModel(): emulsionDetectorTool = EmulsionDetectorTool(DetectorName = "Emulsion", Alignable = True, RDBAccessSvc = "RDBAccessSvc", GeometryDBSvc = "NeutrinoGeometryDBSvc", GeoDbTagSvc = "GeoDbTagSvc") geoModelSvc.DetectorTools += [ emulsionDetectorTool ] + if "FASERNU-03" in DDversion: + from VetoNuGeoModel.VetoNuGeoModelConf import VetoNuDetectorTool + vetoNuDetectorTool = VetoNuDetectorTool( DetectorName = "VetoNu", + Alignable = True, + RDBAccessSvc = "RDBAccessSvc", + GeometryDBSvc = "ScintGeometryDBSvc", + GeoDbTagSvc = "GeoDbTagSvc") + + geoModelSvc.DetectorTools += [ vetoNuDetectorTool ] + from VetoGeoModel.VetoGeoModelConf import VetoDetectorTool vetoDetectorTool = VetoDetectorTool( DetectorName = "Veto", Alignable = True, @@ -112,6 +122,11 @@ def _setupGeoModel(): geoModelSvc.DetectorTools += [ ecalDetectorTool ] + if "FASERNU-03" in DDversion: + from TrenchGeoModel.TrenchGeoModelConf import TrenchDetectorTool + trenchDetectorTool = TrenchDetectorTool( ) + + geoModelSvc.DetectorTools += [ trenchDetectorTool ] pass diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py index 93c42c057852c8b24ac4760ea70a612941c04855..039b5155efd0d9b69278f79cd6a0cbc2fdf69ccc 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py @@ -6,6 +6,10 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator def ScintGeometryCfg (flags): acc = ComponentAccumulator() + + from VetoNuGeoModel.VetoNuGeoModelConfig import VetoNuGeometryCfg + acc.merge(VetoNuGeometryCfg( flags )) + from VetoGeoModel.VetoGeoModelConfig import VetoGeometryCfg acc.merge(VetoGeometryCfg( flags )) diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/TrenchGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/TrenchGMConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..b53147bcddab5129489d520f75cc01a0ae6e5f74 --- /dev/null +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/TrenchGMConfig.py @@ -0,0 +1,13 @@ +# +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# +from AthenaConfiguration.ComponentFactory import CompFactory + +def TrenchGeometryCfg( flags ): + from FaserGeoModel.GeoModelConfig import GeoModelCfg + acc = GeoModelCfg( flags ) + + if flags.Detector.GeometryTrench: + TrenchDetectorTool=CompFactory.TrenchDetectorTool + acc.getPrimary().DetectorTools += [ TrenchDetectorTool() ] + return acc diff --git a/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx b/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx index a913211431b395745ecb18e14b537351ec81a7d9..010fa49563a9b8d1bd83d135d132911bb7b9f826 100644 --- a/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx +++ b/DetectorDescription/GeoModel/GeoModelFaserUtilities/src/DecodeFaserVersionKey.cxx @@ -49,6 +49,9 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node) } else if (node == "Veto") { scintOverrideTag = svc->scintVersionOverride(); nodeOverrideTag = svc->vetoVersionOverride(); + } else if (node == "VetoNu") { + scintOverrideTag = svc->scintVersionOverride(); + nodeOverrideTag = svc->vetoNuVersionOverride(); } else if (node == "Trigger") { scintOverrideTag = svc->scintVersionOverride(); nodeOverrideTag = svc->triggerVersionOverride(); @@ -68,11 +71,12 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node) } else if (node == "Ecal") { caloOverrideTag = svc->caloVersionOverride(); nodeOverrideTag = svc->ecalVersionOverride(); + } else if (node == "Trench") { + nodeOverrideTag = svc->trenchVersionOverride(); } else { std::cout << "DecodeFaserVersionKey passed an unknown node:" << node << std::endl; nodeOverrideTag = ""; } - // Default to faser version m_tag = svc->faserVersion(); m_node = "FASER"; @@ -137,6 +141,7 @@ void DecodeFaserVersionKey::defineTag(const T* svc, const std::string & node) m_tag = outputTag; m_node = node; } + } const std::string & diff --git a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoDbTagSvc.h b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoDbTagSvc.h index ecb285ff291c3c6b7584d137f07de5d38f970c3d..9f8e103c63901d01d42283a648ca9b8e862e5396 100644 --- a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoDbTagSvc.h +++ b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoDbTagSvc.h @@ -32,6 +32,7 @@ class IGeoDbTagSvc : virtual public IInterface { virtual const std::string & emulsionVersion() const =0; virtual const std::string & scintVersion() const =0; virtual const std::string & vetoVersion() const =0; + virtual const std::string & vetoNuVersion() const =0; virtual const std::string & triggerVersion() const =0; virtual const std::string & preshowerVersion() const =0; virtual const std::string & trackerVersion() const =0; @@ -40,12 +41,13 @@ class IGeoDbTagSvc : virtual public IInterface { virtual const std::string & caloVersion() const =0; virtual const std::string & ecalVersion() const =0; // virtual const std::string & magFieldVersion() const =0; - // virtual const std::string & cavernInfraVersion() const =0; + virtual const std::string & trenchVersion() const =0; virtual const std::string & neutrinoVersionOverride() const =0; virtual const std::string & emulsionVersionOverride() const =0; virtual const std::string & scintVersionOverride() const =0; virtual const std::string & vetoVersionOverride() const =0; + virtual const std::string & vetoNuVersionOverride() const =0; virtual const std::string & triggerVersionOverride() const =0; virtual const std::string & preshowerVersionOverride() const =0; virtual const std::string & trackerVersionOverride() const =0; @@ -54,7 +56,7 @@ class IGeoDbTagSvc : virtual public IInterface { virtual const std::string & caloVersionOverride() const =0; virtual const std::string & ecalVersionOverride() const =0; // virtual const std::string & magFieldVersionOverride() const =0; - // virtual const std::string & cavernInfraVersionOverride() const =0; + virtual const std::string & trenchVersionOverride() const =0; virtual GeoModel::GeoConfig geoConfig() const = 0; }; diff --git a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoModelSvc.h b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoModelSvc.h index 2268f87fb1f490b135f04aa8ed6c9d7ccb114763..b5c7d10665f1928f2acb22dd43e4f1236dd9995e 100644 --- a/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoModelSvc.h +++ b/DetectorDescription/GeoModel/GeoModelInterfaces/GeoModelInterfaces/IGeoModelSvc.h @@ -30,6 +30,7 @@ public: virtual const std::string & emulsionVersion() const =0; virtual const std::string & scintVersion() const =0; virtual const std::string & vetoVersion() const =0; + virtual const std::string & vetoNuVersion() const =0; virtual const std::string & triggerVersion() const =0; virtual const std::string & preshowerVersion() const =0; virtual const std::string & trackerVersion() const =0; @@ -38,12 +39,13 @@ public: virtual const std::string & caloVersion() const =0; virtual const std::string & ecalVersion() const =0; // virtual const std::string & magFieldVersion() const =0; - // virtual const std::string & cavernInfraVersion() const =0; + virtual const std::string & trenchVersion() const =0; virtual const std::string & neutrinoVersionOverride() const =0; virtual const std::string & emulsionVersionOverride() const =0; virtual const std::string & scintVersionOverride() const =0; virtual const std::string & vetoVersionOverride() const =0; + virtual const std::string & vetoNuVersionOverride() const =0; virtual const std::string & triggerVersionOverride() const =0; virtual const std::string & preshowerVersionOverride() const =0; virtual const std::string & trackerVersionOverride() const =0; @@ -52,7 +54,7 @@ public: virtual const std::string & caloVersionOverride() const =0; virtual const std::string & ecalVersionOverride() const =0; // virtual const std::string & magFieldVersionOverride() const =0; - // virtual const std::string & cavernInfraVersionOverride() const =0; + virtual const std::string & trenchVersionOverride() const =0; virtual GeoModel::GeoConfig geoConfig() const = 0; diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx index f329c0f6d3b599c5a1971cc53ad1f52331c7aba2..7c64133060caaa8bf9036f6fbacb3fff0d978a37 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx @@ -84,6 +84,10 @@ StatusCode GeoDbTagSvc::setupTags() ? rdbAccessSvc->getChildTag("Veto", m_ScintVersion, "Scintillator", "FASERDD") : m_VetoVersionOverride); + m_VetoNuVersion = (m_VetoNuVersionOverride.empty() + ? rdbAccessSvc->getChildTag("VetoNu", m_ScintVersion, "Scintillator", "FASERDD") + : m_VetoNuVersionOverride); + m_TriggerVersion = (m_TriggerVersionOverride.empty() ? rdbAccessSvc->getChildTag("Trigger", m_ScintVersion, "Scintillator", "FASERDD") : m_TriggerVersionOverride); @@ -116,9 +120,9 @@ StatusCode GeoDbTagSvc::setupTags() // ? rdbAccessSvc->getChildTag("MagneticField",m_AtlasVersion,"ATLAS") // : m_MagFieldVersionOverride); - // m_CavernInfraVersion = (m_CavernInfraVersionOverride.empty() - // ? rdbAccessSvc->getChildTag("CavernInfra",m_AtlasVersion,"ATLAS") - // : m_CavernInfraVersionOverride); + m_TrenchVersion = (m_TrenchVersionOverride.empty() + ? rdbAccessSvc->getChildTag("Trench", m_FaserVersion,"FASERDD") + : m_TrenchVersionOverride); // Retrieve geometry config information (RUN1, RUN2, etc...) IRDBRecordset_ptr faserCommonRec = rdbAccessSvc->getRecordsetPtr("FaserCommon", m_FaserVersion, "FASER", "FASERDD"); diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.h b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.h index c7ed5637321b3e6a4124e39d40c72d8e3091a207..4fb1b0a29038b226a4955c9a9211c612defaa1bd 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.h +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.h @@ -32,6 +32,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc void setEmulsionVersionOverride(const std::string& tag) { m_EmulsionVersionOverride=tag; } void setScintVersionOverride(const std::string& tag) { m_ScintVersionOverride=tag; } void setVetoVersionOverride(const std::string& tag) { m_VetoVersionOverride=tag; } + void setVetoNuVersionOverride(const std::string& tag) { m_VetoNuVersionOverride=tag; } void setTriggerVersionOverride(const std::string& tag) { m_TriggerVersionOverride=tag; } void setPreshowerVersionOverride(const std::string& tag) { m_PreshowerVersionOverride=tag; } void setTrackerVersionOverride(const std::string& tag) { m_TrackerVersionOverride=tag; } @@ -40,7 +41,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc void setCaloVersionOverride(const std::string& tag) { m_CaloVersionOverride=tag; } void setEcalVersionOverride(const std::string& tag) { m_EcalVersionOverride=tag; } // void setMagFieldVersionOverride(const std::string& tag) { m_MagFieldVersionOverride=tag; } - // void setCavernInfraVersionOverride(const std::string& tag) { m_CavernInfraVersionOverride=tag; } + void setTrenchVersionOverride(const std::string& tag) { m_TrenchVersionOverride=tag; } StatusCode setupTags(); @@ -51,6 +52,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc const std::string & emulsionVersionOverride() const { return m_EmulsionVersionOverride; } const std::string & scintVersionOverride() const { return m_ScintVersionOverride; } const std::string & vetoVersionOverride() const { return m_VetoVersionOverride; } + const std::string & vetoNuVersionOverride() const { return m_VetoNuVersionOverride; } const std::string & triggerVersionOverride() const { return m_TriggerVersionOverride; } const std::string & preshowerVersionOverride() const { return m_PreshowerVersionOverride; } const std::string & trackerVersionOverride() const { return m_TrackerVersionOverride; } @@ -59,12 +61,13 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc const std::string & caloVersionOverride() const { return m_CaloVersionOverride; } const std::string & ecalVersionOverride() const { return m_EcalVersionOverride; } // const std::string & magFieldVersionOverride() const { return m_MagFieldVersionOverride; } - // const std::string & cavernInfraVersionOverride() const { return m_CavernInfraVersionOverride; } + const std::string & trenchVersionOverride() const { return m_TrenchVersionOverride; } const std::string & neutrinoVersion() const { return m_NeutrinoVersion; } const std::string & emulsionVersion() const { return m_EmulsionVersion; } const std::string & scintVersion() const { return m_ScintVersion; } const std::string & vetoVersion() const { return m_VetoVersion; } + const std::string & vetoNuVersion() const { return m_VetoNuVersion; } const std::string & triggerVersion() const { return m_TriggerVersion; } const std::string & preshowerVersion() const { return m_PreshowerVersion; } const std::string & trackerVersion() const { return m_TrackerVersion; } @@ -73,7 +76,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc const std::string & caloVersion() const { return m_CaloVersion; } const std::string & ecalVersion() const { return m_EcalVersion; } // const std::string & magFieldVersion() const { return m_MagFieldVersion; } - // const std::string & cavernInfraVersion() const { return m_CavernInfraVersion; } + const std::string & trenchVersion() const { return m_TrenchVersion; } GeoModel::GeoConfig geoConfig() const { return m_geoConfig; } @@ -84,6 +87,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc std::string m_EmulsionVersion; std::string m_ScintVersion; std::string m_VetoVersion; + std::string m_VetoNuVersion; std::string m_TriggerVersion; std::string m_PreshowerVersion; std::string m_TrackerVersion; @@ -92,12 +96,13 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc std::string m_CaloVersion; std::string m_EcalVersion; // std::string m_MagFieldVersion; - // std::string m_CavernInfraVersion; + std::string m_TrenchVersion; std::string m_NeutrinoVersionOverride; std::string m_EmulsionVersionOverride; std::string m_ScintVersionOverride; std::string m_VetoVersionOverride; + std::string m_VetoNuVersionOverride; std::string m_TriggerVersionOverride; std::string m_PreshowerVersionOverride; std::string m_TrackerVersionOverride; @@ -106,7 +111,7 @@ class GeoDbTagSvc : public AthService, virtual public IGeoDbTagSvc std::string m_CaloVersionOverride; std::string m_EcalVersionOverride; // std::string m_MagFieldVersionOverride; - // std::string m_CavernInfraVersionOverride; + std::string m_TrenchVersionOverride; GeoModel::GeoConfig m_geoConfig; }; diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx index 4f728d36e0d6a1798d262c10cc4267b8f4d9089b..a1bf57b7f50e2ccf84714e96ae86b600c32ba46e 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx @@ -56,6 +56,7 @@ GeoModelSvc::GeoModelSvc(const std::string& name,ISvcLocator* svc) declareProperty( "EmulsionVersionOverride", m_EmulsionVersionOverride); declareProperty( "ScintVersionOverride", m_ScintVersionOverride); declareProperty( "VetoVersionOverride", m_VetoVersionOverride); + declareProperty( "VetoNuVersionOverride", m_VetoNuVersionOverride); declareProperty( "TriggerVersionOverride", m_TriggerVersionOverride); declareProperty( "PreshowerVersionOverride", m_PreshowerVersionOverride); declareProperty( "TrackerVersionOverride", m_TrackerVersionOverride); @@ -64,7 +65,7 @@ GeoModelSvc::GeoModelSvc(const std::string& name,ISvcLocator* svc) declareProperty( "CaloVersionOverride", m_CaloVersionOverride); declareProperty( "EcalVersionOverride", m_EcalVersionOverride); // declareProperty( "MagFieldVersionOverride", m_MagFieldVersionOverride); - // declareProperty( "CavernInfraVersionOverride", m_CavernInfraVersionOverride); + declareProperty( "TrenchVersionOverride", m_TrenchVersionOverride); declareProperty( "AlignCallbacks", m_callBackON); declareProperty( "IgnoreTagDifference", m_ignoreTagDifference); declareProperty( "UseTagInfo", m_useTagInfo); @@ -189,6 +190,7 @@ StatusCode GeoModelSvc::geoInit() ATH_MSG_DEBUG("* Emulsion tag: " << m_EmulsionVersionOverride); ATH_MSG_DEBUG("* Scint tag: " << m_ScintVersionOverride); ATH_MSG_DEBUG("* Veto tag: " << m_VetoVersionOverride); + ATH_MSG_DEBUG("* VetoNu tag: " << m_VetoNuVersionOverride); ATH_MSG_DEBUG("* Trigger tag: " << m_TriggerVersionOverride); ATH_MSG_DEBUG("* Preshower tag: " << m_PreshowerVersionOverride); ATH_MSG_DEBUG("* Tracker tag: " << m_TrackerVersionOverride); @@ -197,7 +199,7 @@ StatusCode GeoModelSvc::geoInit() ATH_MSG_DEBUG("* Calo tag: " << m_CaloVersionOverride); ATH_MSG_DEBUG("* Ecal tag: " << m_EcalVersionOverride); // ATH_MSG_DEBUG("* MagField tag: " << m_MagFieldVersionOverride); - // ATH_MSG_DEBUG("* CavernInfra tag: " << m_CavernInfraVersionOverride); + ATH_MSG_DEBUG("* Trench tag: " << m_TrenchVersionOverride); // GetRDBAccessSvc and open connection to DB ServiceHandle<IRDBAccessSvc> rdbAccess("RDBAccessSvc",name()); @@ -261,6 +263,7 @@ StatusCode GeoModelSvc::geoInit() dbTagSvc->setEmulsionVersionOverride(m_EmulsionVersionOverride); dbTagSvc->setScintVersionOverride(m_ScintVersionOverride); dbTagSvc->setVetoVersionOverride(m_VetoVersionOverride); + dbTagSvc->setVetoNuVersionOverride(m_VetoNuVersionOverride); dbTagSvc->setTriggerVersionOverride(m_TriggerVersionOverride); dbTagSvc->setPreshowerVersionOverride(m_PreshowerVersionOverride); dbTagSvc->setTrackerVersionOverride(m_TrackerVersionOverride); @@ -269,7 +272,7 @@ StatusCode GeoModelSvc::geoInit() dbTagSvc->setCaloVersionOverride(m_CaloVersionOverride); dbTagSvc->setEcalVersionOverride(m_EcalVersionOverride); // dbTagSvc->setMagFieldVersionOverride(m_MagFieldVersionOverride); - // dbTagSvc->setCavernInfraVersionOverride(m_CavernInfraVersionOverride); + dbTagSvc->setTrenchVersionOverride(m_TrenchVersionOverride); if(dbTagSvc->setupTags().isFailure()) { ATH_MSG_FATAL("Failed to setup subsystem tags"); @@ -431,6 +434,8 @@ StatusCode GeoModelSvc::compareTags() tagsMatch = m_ScintVersionOverride == pair.second; else if(tagPairName=="GeoVeto") tagsMatch = m_VetoVersionOverride == pair.second; + else if(tagPairName=="GeoVetoNu") + tagsMatch = m_VetoNuVersionOverride == pair.second; else if(tagPairName=="GeoTrigger") tagsMatch = m_TriggerVersionOverride == pair.second; else if(tagPairName=="GeoPreshower") @@ -445,6 +450,8 @@ StatusCode GeoModelSvc::compareTags() tagsMatch = m_CaloVersionOverride == pair.second; else if(tagPairName=="GeoEcal") tagsMatch = m_EcalVersionOverride == pair.second; + else if(tagPairName=="GeoTrench") + tagsMatch = m_TrenchVersionOverride == pair.second; if(!tagsMatch) break; } @@ -458,6 +465,7 @@ StatusCode GeoModelSvc::compareTags() ATH_MSG_INFO("* Emulsion tag: " << m_EmulsionVersionOverride); ATH_MSG_INFO("* Scint tag: " << m_ScintVersionOverride); ATH_MSG_INFO("* Veto tag: " << m_VetoVersionOverride); + ATH_MSG_INFO("* VetoNu tag: " << m_VetoNuVersionOverride); ATH_MSG_INFO("* Trigger tag: " << m_TriggerVersionOverride); ATH_MSG_INFO("* Preshower tag: " << m_PreshowerVersionOverride); ATH_MSG_INFO("* Tracker tag: " << m_TrackerVersionOverride); @@ -466,7 +474,7 @@ StatusCode GeoModelSvc::compareTags() ATH_MSG_INFO("* Calo tag: " << m_CaloVersionOverride); ATH_MSG_INFO("* Ecal tag: " << m_EcalVersionOverride); // ATH_MSG_INFO("* MagField tag: " << m_MagFieldVersionOverride); - // ATH_MSG_INFO("* CavernInfra tag: " << m_CavernInfraVersionOverride); + ATH_MSG_INFO("* Trench tag: " << m_TrenchVersionOverride); ATH_MSG_INFO("** TAG INFO configuration: "); for (const auto& pair : pairs) { std::string tagPairName = pair.first; @@ -480,6 +488,8 @@ StatusCode GeoModelSvc::compareTags() ATH_MSG_INFO("*Scint tag: " << pair.second); else if(tagPairName=="GeoVeto") ATH_MSG_INFO("*Veto tag: " << pair.second); + else if(tagPairName=="GeoVetoNu") + ATH_MSG_INFO("*VetoNu tag: " << pair.second); else if(tagPairName=="GeoTrigger") ATH_MSG_INFO("*Trigger tag: " << pair.second); else if(tagPairName=="GeoPreshower") @@ -496,8 +506,8 @@ StatusCode GeoModelSvc::compareTags() ATH_MSG_INFO("*Ecal tag: " << pair.second); // else if(tagPairName=="GeoMagField") // ATH_MSG_INFO("*MagField tag: " << pair.second); - // else if(tagPairName=="GeoCavernInfra") - // ATH_MSG_INFO("*CavernInfra tag: " << pair.second); + else if(tagPairName=="GeoTrench") + ATH_MSG_INFO("*Trench tag: " << pair.second); } if(!m_ignoreTagDifference) { @@ -554,6 +564,13 @@ StatusCode GeoModelSvc::fillTagInfo() const } } + if(m_VetoNuVersionOverride != "") { + if(m_tagInfoMgr->addTag("GeoVetoNu",m_VetoNuVersionOverride).isFailure()) { + ATH_MSG_ERROR("GeoModelSvc VetoNu tag: " << m_VetoNuVersionOverride << " not added to TagInfo " ); + return StatusCode::FAILURE; + } + } + if(m_TriggerVersionOverride != "") { if(m_tagInfoMgr->addTag("GeoTrigger",m_TriggerVersionOverride).isFailure()) { ATH_MSG_ERROR("GeoModelSvc Trigger tag: " << m_TriggerVersionOverride << " not added to TagInfo " ); @@ -610,12 +627,12 @@ StatusCode GeoModelSvc::fillTagInfo() const // } // } - // if(m_CavernInfraVersionOverride != "") { - // if(m_tagInfoMgr->addTag("GeoCavernInfra",m_CavernInfraVersionOverride).isFailure()) { - // ATH_MSG_ERROR("GeoModelSvc CavernInfra tag: " << m_CavernInfraVersionOverride << " not added to TagInfo "); - // return StatusCode::FAILURE; - // } - // } + if(m_TrenchVersionOverride != "") { + if(m_tagInfoMgr->addTag("GeoTrench",m_TrenchVersionOverride).isFailure()) { + ATH_MSG_ERROR("GeoModelSvc Trench tag: " << m_TrenchVersionOverride << " not added to TagInfo "); + return StatusCode::FAILURE; + } + } return StatusCode::SUCCESS; } diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.h b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.h index e3880ced363400cb05ff949091346511d5c90c86..e40c06f9da7af23d6a20a14a95aab76f6faf5680 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.h +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.h @@ -79,6 +79,7 @@ private: std::string m_EmulsionVersionOverride; std::string m_ScintVersionOverride; std::string m_VetoVersionOverride; + std::string m_VetoNuVersionOverride; std::string m_TriggerVersionOverride; std::string m_PreshowerVersionOverride; std::string m_TrackerVersionOverride; @@ -87,7 +88,7 @@ private: std::string m_CaloVersionOverride; std::string m_EcalVersionOverride; // std::string m_MagFieldVersionOverride; - // std::string m_CavernInfraVersionOverride; + std::string m_TrenchVersionOverride; bool m_printMaterials; // Print the contents of the Material Manager at the end of geoInit bool m_callBackON; // Register callback for Detector Tools @@ -105,6 +106,7 @@ private: const std::string & emulsionVersionOverride() const {return m_EmulsionVersionOverride; } const std::string & scintVersionOverride() const {return m_ScintVersionOverride; } const std::string & vetoVersionOverride() const {return m_VetoVersionOverride; } + const std::string & vetoNuVersionOverride() const {return m_VetoNuVersionOverride; } const std::string & triggerVersionOverride() const {return m_TriggerVersionOverride ;} const std::string & preshowerVersionOverride() const {return m_PreshowerVersionOverride ;} const std::string & trackerVersionOverride() const {return m_TrackerVersionOverride ;} @@ -113,12 +115,13 @@ private: const std::string & caloVersionOverride() const {return m_CaloVersionOverride ;} const std::string & ecalVersionOverride() const {return m_EcalVersionOverride ;} // const std::string & magFieldVersionOverride() const {return m_MagFieldVersionOverride ;} - // const std::string & cavernInfraVersionOverride() const {return m_CavernInfraVersionOverride ;} + const std::string & trenchVersionOverride() const {return m_TrenchVersionOverride ;} const std::string & neutrinoVersion() const {return m_geoDbTagSvc->neutrinoVersion(); } const std::string & emulsionVersion() const {return m_geoDbTagSvc->emulsionVersion(); } const std::string & scintVersion() const {return m_geoDbTagSvc->scintVersion(); } const std::string & vetoVersion() const {return m_geoDbTagSvc->vetoVersion(); } + const std::string & vetoNuVersion() const {return m_geoDbTagSvc->vetoNuVersion(); } const std::string & triggerVersion() const {return m_geoDbTagSvc->triggerVersion(); } const std::string & preshowerVersion() const {return m_geoDbTagSvc->preshowerVersion(); } const std::string & trackerVersion() const {return m_geoDbTagSvc->trackerVersion(); } @@ -127,7 +130,7 @@ private: const std::string & caloVersion() const {return m_geoDbTagSvc->caloVersion(); } const std::string & ecalVersion() const {return m_geoDbTagSvc->ecalVersion(); } // const std::string & magFieldVersion() const {return m_geoDbTagSvc->magFieldVersion(); } - // const std::string & cavernInfraVersion() const {return m_geoDbTagSvc->cavernInfraVersion(); } + const std::string & trenchVersion() const {return m_geoDbTagSvc->trenchVersion(); } GeoModel::GeoConfig geoConfig() const {return m_geoDbTagSvc->geoConfig();} diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx index dd440226fdff6abfc3e609d4f705e92884edd61e..988191de12501bf2105e9045baa3e468d234a0f5 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx @@ -215,35 +215,37 @@ StatusCode RDBMaterialManager::readMaterialsFromDB(ISvcLocator* pSvcLocator) log << MSG::WARNING << " Getting SCTMaterials with default tag" <<endmsg; m_trackermaterials = iAccessSvc->getRecordsetPtr("SCTMaterials","SCTMaterials-00", "", "FASERDD"); } + // TrackerMatComponents and TrackerMaterials tables in DB are empty // --- Tracker materials - DecodeFaserVersionKey keyTracker(iGeoModel, "Tracker"); - m_trackermatcomponents = iAccessSvc->getRecordsetPtr("TrackerMatComponents",keyTracker.tag(),keyTracker.node(),"FASERDD"); - if(m_trackermatcomponents->size()==0) { - if(log.level()<=MSG::WARNING) - log << MSG::WARNING << " Getting TrackerMatComponents with default tag" <<endmsg; - m_trackermatcomponents = iAccessSvc->getRecordsetPtr("TrackerMatComponents","TrackerMatComponents-00", "", "FASERDD"); - } - m_trackermaterials = iAccessSvc->getRecordsetPtr("TrackerMaterials",keyTracker.tag(),keyTracker.node(), "FASERDD"); - if(m_trackermaterials->size()==0) { - if(log.level()<=MSG::WARNING) - log << MSG::WARNING << " Getting TrackerMaterials with default tag" <<endmsg; - m_trackermaterials = iAccessSvc->getRecordsetPtr("TrackerMaterials","TrackerMaterials-00", "", "FASERDD"); - } - - // --- Tracker materials - DecodeFaserVersionKey keyCalorimeter(iGeoModel, "Calorimeter"); - m_calomatcomponents = iAccessSvc->getRecordsetPtr("CaloMatComponents",keyCalorimeter.tag(),keyCalorimeter.node(),"FASERDD"); - if(m_calomatcomponents->size()==0) { - if(log.level()<=MSG::WARNING) - log << MSG::WARNING << " Getting CaloMatComponents with default tag" <<endmsg; - m_calomatcomponents = iAccessSvc->getRecordsetPtr("CaloMatComponents","CaloMatComponents-00", "", "FASERDD"); - } - m_calomaterials = iAccessSvc->getRecordsetPtr("CaloMaterials",keyCalorimeter.tag(),keyCalorimeter.node(), "FASERDD"); - if(m_calomaterials->size()==0) { - if(log.level()<=MSG::WARNING) - log << MSG::WARNING << " Getting CaloMaterials with default tag" <<endmsg; - m_calomaterials = iAccessSvc->getRecordsetPtr("CaloMaterials","CaloMaterials-00", "", "FASERDD"); - } + // DecodeFaserVersionKey keyTracker(iGeoModel, "Tracker"); + // m_trackermatcomponents = iAccessSvc->getRecordsetPtr("TrackerMatComponents",keyTracker.tag(),keyTracker.node(),"FASERDD"); + // if(m_trackermatcomponents->size()==0) { + // if(log.level()<=MSG::WARNING) + // log << MSG::WARNING << " Getting TrackerMatComponents with default tag" <<endmsg; + // m_trackermatcomponents = iAccessSvc->getRecordsetPtr("TrackerMatComponents","TrackerMatComponents-00", "", "FASERDD"); + // } + // m_trackermaterials = iAccessSvc->getRecordsetPtr("TrackerMaterials",keyTracker.tag(),keyTracker.node(), "FASERDD"); + // if(m_trackermaterials->size()==0) { + // if(log.level()<=MSG::WARNING) + // log << MSG::WARNING << " Getting TrackerMaterials with default tag" <<endmsg; + // m_trackermaterials = iAccessSvc->getRecordsetPtr("TrackerMaterials","TrackerMaterials-00", "", "FASERDD"); + // } + + // CaloMatComponents and CaloMaterials tables are also empty + // // --- Calorimeter materials + // DecodeFaserVersionKey keyCalorimeter(iGeoModel, "Calorimeter"); + // m_calomatcomponents = iAccessSvc->getRecordsetPtr("CaloMatComponents",keyCalorimeter.tag(),keyCalorimeter.node(),"FASERDD"); + // if(m_calomatcomponents->size()==0) { + // if(log.level()<=MSG::WARNING) + // log << MSG::WARNING << " Getting CaloMatComponents with default tag" <<endmsg; + // m_calomatcomponents = iAccessSvc->getRecordsetPtr("CaloMatComponents","CaloMatComponents-00", "", "FASERDD"); + // } + // m_calomaterials = iAccessSvc->getRecordsetPtr("CaloMaterials",keyCalorimeter.tag(),keyCalorimeter.node(), "FASERDD"); + // if(m_calomaterials->size()==0) { + // if(log.level()<=MSG::WARNING) + // log << MSG::WARNING << " Getting CaloMaterials with default tag" <<endmsg; + // m_calomaterials = iAccessSvc->getRecordsetPtr("CaloMaterials","CaloMaterials-00", "", "FASERDD"); + // } return StatusCode::SUCCESS; } diff --git a/FaserGeometryCommon/TrenchGeoModel/CMakeLists.txt b/FaserGeometryCommon/TrenchGeoModel/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..041a00338e4f25ed8b0e27a1077571fbf23a342f --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/CMakeLists.txt @@ -0,0 +1,35 @@ +################################################################################ +# Package: TrenchGeoModel +################################################################################ + +# Declare the package name: +atlas_subdir( TrenchGeoModel ) + +# External dependencies: +find_package( Boost COMPONENTS filesystem thread system ) +find_package( Eigen ) +find_package( GeoModel COMPONENTS GeoModelKernel GeoModelDBManager GDMLtoGM ) +find_package( XercesC ) + +# Component(s) in the package: +atlas_add_component( TrenchGeoModel + src/*.cxx + src/components/*.cxx + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${GEOMODEL_INCLUDE_DIR} ${XERCESC_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${GEOMODEL_LIBRARIES} ${XERCESC_LIBRARIES} AthenaKernel GeoModelFaserUtilities GaudiKernel + StoreGateLib GeoModelInterfaces RDBAccessSvcLib PathResolver) + +add_custom_command (OUTPUT ${CMAKE_XML_OUTPUT_DIRECTORY}/TrenchGeoModel/Trench.gdml + COMMAND mkdir -p ${CMAKE_XML_OUTPUT_DIRECTORY}/TrenchGeoModel/ + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/data/Trench.gdml ${CMAKE_XML_OUTPUT_DIRECTORY}/TrenchGeoModel/Trench.gdml ) +add_custom_target (make_cavern_gdml ALL DEPENDS ${CMAKE_XML_OUTPUT_DIRECTORY}/TrenchGeoModel/Trench.gdml) +get_filename_component( _realpath ${CMAKE_CURRENT_SOURCE_DIR}/data/Trench.gdml REALPATH ) + +install(FILES ${_realpath} DESTINATION ${CMAKE_INSTALL_PREFIX}/XML/TrenchGeoModel RENAME Trench.gdml) +unset( _realpath ) + +# Install files from the package: +#atlas_install_python_modules( python/*.py ) +#atlas_install_scripts( test/*.py ) +# Not needed as done with symlink above +#atlas_install_xmls( data/*.gdml ) diff --git a/FaserGeometryCommon/TrenchGeoModel/data/Trench.gdml b/FaserGeometryCommon/TrenchGeoModel/data/Trench.gdml new file mode 100644 index 0000000000000000000000000000000000000000..5249b55d6630eb96ff07e11904677133945bf397 --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/data/Trench.gdml @@ -0,0 +1,182 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gdml xsi:noNamespaceSchemaLocation="schema/gdml.xsd"> + <define> + <position name="RampinWorldpos" unit="mm" x="576.9" y="-177.6" z="-598.8"/> + <rotation name="RampinWorldrot" unit="deg" z="0" y="-9.50625" x="0.711918"/> + <position name="Subpos" unit="mm" x="-668.4" y="245.1" z="498.3" /> + <rotation name="Subrot" unit="deg" x="90.7119" y="-9.50625" z="0" /> + <constant name="WorldSize" value="20000"/> + <constant name="RampWidth" value="7000"/> + <constant name="RampLengthZ" value="8422"/> + <constant name="RampMinThickness" value="2000"/> + <constant name="RampSlope" value="0.08533"/> + </define> + <materials> + <isotope N="1.400000000000000e+01" Z="7.000000000000000e+00" name="N140x8e46440"> + <atom unit="g/mole" value="1.400310000000000e+01"/> + </isotope> + <isotope N="1.500000000000000e+01" Z="7.000000000000000e+00" name="N150x8e48da0"> + <atom unit="g/mole" value="1.500010000000000e+01"/> + </isotope> + <element name="N0x8e48c30"> + <fraction n="9.963200000000001e-01" ref="N140x8e46440"/> + <fraction n="3.680000000000000e-03" ref="N150x8e48da0"/> + </element> + <isotope N="1.600000000000000e+01" Z="8.000000000000000e+00" name="O160x1167b880"> + <atom unit="g/mole" value="1.599490000000000e+01"/> + </isotope> + <isotope N="1.700000000000000e+01" Z="8.000000000000000e+00" name="O170x1167b7d0"> + <atom unit="g/mole" value="1.699909999999999e+01"/> + </isotope> + <isotope N="1.800000000000000e+01" Z="8.000000000000000e+00" name="O180xfb79770"> + <atom unit="g/mole" value="1.799920000000000e+01"/> + </isotope> + <element name="O0x1167b4f0"> + <fraction n="9.975700000000000e-01" ref="O160x1167b880"/> + <fraction n="3.800000000000000e-04" ref="O170x1167b7d0"/> + <fraction n="2.050000000000000e-03" ref="O180xfb79770"/> + </element> + <isotope N="2.800000000000000e+01" Z="1.400000000000000e+01" name="Si280x8146230"> + <atom unit="g/mole" value="2.797690000000000e+01"/> + </isotope> + <isotope N="2.900000000000000e+01" Z="1.400000000000000e+01" name="Si290x8146280"> + <atom unit="g/mole" value="2.897650000000000e+01"/> + </isotope> + <isotope N="3.000000000000000e+01" Z="1.400000000000000e+01" name="Si300x8146e50"> + <atom unit="g/mole" value="2.997380000000000e+01"/> + </isotope> + <element name="Si0x8147580"> + <fraction n="9.222960777039223e-01" ref="Si280x8146230"/> + <fraction n="4.683195316804684e-02" ref="Si290x8146280"/> + <fraction n="3.087196912803088e-02" ref="Si300x8146e50"/> + </element> + <isotope N="4.000000000000000e+01" Z="2.000000000000000e+01" name="Ca400xee155f0"> + <atom unit="g/mole" value="3.996260000000000e+01"/> + </isotope> + <isotope N="4.200000000000000e+01" Z="2.000000000000000e+01" name="Ca420xee15640"> + <atom unit="g/mole" value="4.195860000000000e+01"/> + </isotope> + <isotope N="4.300000000000000e+01" Z="2.000000000000000e+01" name="Ca430xee15690"> + <atom unit="g/mole" value="4.295880000000000e+01"/> + </isotope> + <isotope N="4.400000000000000e+01" Z="2.000000000000000e+01" name="Ca440xee156e0"> + <atom unit="g/mole" value="4.395550000000001e+01"/> + </isotope> + <isotope N="4.600000000000000e+01" Z="2.000000000000000e+01" name="Ca460xee15730"> + <atom unit="g/mole" value="4.595370000000000e+01"/> + </isotope> + <isotope N="4.800000000000000e+01" Z="2.000000000000000e+01" name="Ca480xee15780"> + <atom unit="g/mole" value="4.795250000000000e+01"/> + </isotope> + <element name="Ca0xee154a0"> + <fraction n="9.694100000000000e-01" ref="Ca400xee155f0"/> + <fraction n="6.470000000000000e-03" ref="Ca420xee15640"/> + <fraction n="1.350000000000000e-03" ref="Ca430xee15690"/> + <fraction n="2.086000000000000e-02" ref="Ca440xee156e0"/> + <fraction n="4.000000000000000e-05" ref="Ca460xee15730"/> + <fraction n="1.870000000000000e-03" ref="Ca480xee15780"/> + </element> + <isotope N="2.300000000000000e+01" Z="1.100000000000000e+01" name="Na230x9095660"> + <atom unit="g/mole" value="2.298980000000000e+01"/> + </isotope> + <element name="Na0x90954f0"> + <fraction n="1.000000000000000e+00" ref="Na230x9095660"/> + </element> + <isotope N="5.400000000000000e+01" Z="2.600000000000000e+01" name="Fe540x11685b60"> + <atom unit="g/mole" value="5.393959999999999e+01"/> + </isotope> + <isotope N="5.600000000000000e+01" Z="2.600000000000000e+01" name="Fe560x11685bb0"> + <atom unit="g/mole" value="5.593490000000000e+01"/> + </isotope> + <isotope N="5.700000000000000e+01" Z="2.600000000000000e+01" name="Fe570x11685c00"> + <atom unit="g/mole" value="5.693540000000000e+01"/> + </isotope> + <isotope N="5.800000000000000e+01" Z="2.600000000000000e+01" name="Fe580x11685c50"> + <atom unit="g/mole" value="5.793330000000000e+01"/> + </isotope> + <element name="Fe0x116859d0"> + <fraction n="5.845000000000000e-02" ref="Fe540x11685b60"/> + <fraction n="9.175400000000000e-01" ref="Fe560x11685bb0"/> + <fraction n="2.119000000000000e-02" ref="Fe570x11685c00"/> + <fraction n="2.820000000000000e-03" ref="Fe580x11685c50"/> + </element> + <isotope N="2.700000000000000e+01" Z="1.300000000000000e+01" name="Al270x116850d0"> + <atom unit="g/mole" value="2.698150000000000e+01"/> + </isotope> + <element name="Al0x11684f90"> + <fraction n="1.000000000000000e+00" ref="Al270x116850d0"/> + </element> + <material name="Concrete" state="solid"> + <MEE unit="eV" value="1.271741855079048e+02"/> + <D unit="g/cm3" value="2.499998684602534e+00"/> + <fraction n="5.306122448979591e-01" ref="O0x1167b4f0"/> + <fraction n="3.316326530612245e-01" ref="Si0x8147580"/> + <fraction n="6.122448979591836e-02" ref="Ca0xee154a0"/> + <fraction n="1.530612244897959e-02" ref="Na0x90954f0"/> + <fraction n="2.040816326530612e-02" ref="Fe0x116859d0"/> + <fraction n="4.081632653061224e-02" ref="Al0x11684f90"/> + </material> + <material name="Air" state="gas"> + <T unit="K" value="2.930000000000000e+02"/> + <MEE unit="eV" value="8.570323231865051e+01"/> + <D unit="g/cm3" value="1.204999365978422e-03"/> + <fraction n="7.000000000000000e-01" ref="N0x8e48c30"/> + <fraction n="3.000000000000000e-01" ref="O0x1167b4f0"/> + </material> + </materials> + <solids> + <arb8 name="ramp" lunit="mm" + v1x="-RampWidth/2" v1y="-RampMinThickness" v2x="RampWidth/2" v2y="-RampMinThickness" v3x="RampWidth/2" v3y="RampSlope*RampLengthZ" v4x="-RampWidth/2" v4y="RampSlope*RampLengthZ" + v5x="-RampWidth/2" v5y="-RampMinThickness" v6x="RampWidth/2" v6y="-RampMinThickness" v7x="RampWidth/2" v7y="0" v8x="-RampWidth/2" v8y="0" + dz="RampLengthZ/2" /> + <box name="world" lunit="mm" x="WorldSize" y="WorldSize" z="WorldSize" /> + <xtru name="trenchOutline" lunit="mm"> + <twoDimVertex x="-249.75647241976003" y="-3162.7618497323056"/> + <twoDimVertex x="436.065806982358" y="-3162.7608114181166"/> + <twoDimVertex x="750.3626731862572" y="-1286.045959074479"/> + <twoDimVertex x="750.4059394616982" y="-604.5461685406792"/> + <twoDimVertex x="750.6632036024528" y="3447.692178833775"/> + <twoDimVertex x="598.5775838786217" y="3447.7018373451183"/> + <twoDimVertex x="-251.25127807309354" y="3447.755796000657"/> + <twoDimVertex x="-624.2972688145043" y="1219.150232226327"/> + <twoDimVertex x="-659.4916199548085" y="1008.9993568866641"/> + <twoDimVertex x="-659.5757293651513" y="-315.8326195671569"/> + <twoDimVertex x="-659.6885336897632" y="-2092.6465942800164"/> + <twoDimVertex x="-249.68853582392614" y="-2092.672626612777"/> + <section zOrder="0" zPosition="-375.0" xOffset="0" yOffset="0" scalingFactor="1" /> + <section zOrder="1" zPosition="375.0" xOffset="0" yOffset="0" scalingFactor="1" /> + </xtru> + <subtraction name="faserTrench"> + <first ref="ramp"/> + <firstpositionref ref="RampinWorldpos"/> + <firstrotationref ref="RampinWorldrot"/> + <second ref="trenchOutline"/> + <!-- + <rotationref ref="Subrot"/> + <positionref ref="Subpos"/> + --> + <rotation name="Xrotation" unit="deg" x="90"/> + <position name="Yshift" unit="mm" y="75"/> + </subtraction> + </solids> + <structure> + <volume name="Trench"> + <solidref ref="faserTrench"/> + <materialref ref="Concrete"/> + </volume> + <volume name="World" > + <materialref ref="Air" /> + <solidref ref="world" /> + <physvol> + <volumeref ref="Trench" /> + <!-- + <rotationref ref="RampinWorldrot"/> + <positionref ref="RampinWorldpos"/> + --> + </physvol> + </volume> + </structure> + <setup name="Default" version="1.0" > + <world ref="World" /> + </setup> +</gdml> \ No newline at end of file diff --git a/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorFactory.cxx b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorFactory.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c2dcc9b2201c4441f0ec5fbe92fccb4177dd5d74 --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorFactory.cxx @@ -0,0 +1,99 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrenchDetectorFactory.h" + +#include "GeoModelXMLParser/XercesParser.h" +#include "PathResolver/PathResolver.h" + + +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "StoreGate/StoreGateSvc.h" + + +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" + +#include "GaudiKernel/MsgStream.h" + +#include <string> +#include <map> + +TrenchDetectorFactory::TrenchDetectorFactory(StoreGateSvc *detStore, + IRDBAccessSvc *pAccess) + :m_detectorManager(NULL), + m_detectorStore(detStore), + m_access(pAccess) +{ +} + +TrenchDetectorFactory::~TrenchDetectorFactory() +{ +} + +void TrenchDetectorFactory::create(GeoPhysVol *world) +{ + m_detectorManager=new TrenchDetectorManager(); + + std::string gdmlFile; + IRDBRecordset_ptr switchSet{m_access->getRecordsetPtr("TrenchSwitches", m_versionTag, m_versionNode, "FASERDD")}; + if (!switchSet || switchSet->size() == 0) + { + MsgStream gLog(Athena::getMessageSvc(), "TrenchDetectorFactory"); + gLog << MSG::WARNING << "Unable to retrieve switches; Trench cannot be created" << endmsg; + return; + } + const IRDBRecord* switches{(*switchSet)[0]}; + if (not switches->isFieldNull("GDMLFILE") && gdmlFile.empty()) + { + gdmlFile = switches->getString("GDMLFILE"); + } + if (gdmlFile.empty()) + { + MsgStream gLog(Athena::getMessageSvc(), "TrenchDetectorFactory"); + gLog << MSG::WARNING << "GDML file name not found; Trench cannot be created" << endmsg; + return; + } + + std::string resolvedFile = PathResolver::find_file(gdmlFile, "XMLPATH", PathResolver::RecursiveSearch); + + auto store = XMLHandlerStore::GetHandlerStore(); + for (auto p : *store) + { + delete p.second; + } + store->clear(); + + GDMLController controller {"TrenchGDMLController"}; + + std::cout << "creating parser" << std::endl; + XercesParser xercesParser; + + std::cout << "parsing " << resolvedFile << std::endl; + xercesParser.ParseFileAndNavigate(resolvedFile); + std::cout << "done parsing " << resolvedFile << std::endl; + + const GeoLogVol* trenchLog = controller.retrieveLogicalVolume("Trench").first; + GeoPhysVol* trenchPhys = new GeoPhysVol(trenchLog); + GeoNameTag *tag = new GeoNameTag("Trench"); + world->add(tag); + world->add(trenchPhys); + m_detectorManager->addTreeTop(trenchPhys); +} + +const TrenchDetectorManager * TrenchDetectorFactory::getDetectorManager() const +{ + return m_detectorManager; +} + +void TrenchDetectorFactory::setTagNode(const std::string& tag, + const std::string& node) +{ + m_versionTag = tag; + m_versionNode = node; +} + diff --git a/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorFactory.h b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorFactory.h new file mode 100644 index 0000000000000000000000000000000000000000..14cdbaa18bdc8cc941fb894c9085298ec4191f38 --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorFactory.h @@ -0,0 +1,59 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TrenchDetectorFactory_h +#define TrenchDetectorFactory_h 1 + +#include "GeoModelKernel/GeoVDetectorFactory.h" +#include "TrenchDetectorManager.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "GDMLInterface/GDMLController.h" + +#include <string> + +class StoreGateSvc; + +class TrenchDetectorFactory : public GeoVDetectorFactory +{ + + public: + + // Constructor: + TrenchDetectorFactory(StoreGateSvc *pDetStore, + IRDBAccessSvc *pAccess); + + // Destructor: + ~TrenchDetectorFactory(); + + // Creation of geometry: + virtual void create(GeoPhysVol *world); + + // Access to the results: + virtual const TrenchDetectorManager * getDetectorManager() const; + + // Set version Tag and Node + void setTagNode(const std::string& tag, const std::string& node); + + + private: + // Illegal operations: + const TrenchDetectorFactory & operator=(const TrenchDetectorFactory &right); + TrenchDetectorFactory(const TrenchDetectorFactory &right); + + // The manager: + TrenchDetectorManager *m_detectorManager; + + StoreGateSvc *m_detectorStore; + IRDBAccessSvc *m_access; + std::string m_versionTag; + std::string m_versionNode; + +// GDMLController m_controller {"TrenchGDMLController"}; + +}; + +// Class TrenchDetectorFactory +#endif + + diff --git a/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorManager.cxx b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorManager.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f8df3b923f9a316af0d237285090ca34ba1107a1 --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorManager.cxx @@ -0,0 +1,38 @@ +/* + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrenchDetectorManager.h" + +TrenchDetectorManager::TrenchDetectorManager() +{ + setName("Trench"); +} + + +TrenchDetectorManager::~TrenchDetectorManager() +{ + for(unsigned int i=0; i<m_treeTops.size(); i++) + m_treeTops[i]->unref(); +} + + +unsigned int TrenchDetectorManager::getNumTreeTops() const +{ + return m_treeTops.size(); +} + +PVConstLink TrenchDetectorManager::getTreeTop(unsigned int i) const +{ + if(i<m_treeTops.size()) + return m_treeTops[i]; + else + return 0; +} + +void TrenchDetectorManager::addTreeTop(PVLink link) +{ + link->ref(); + m_treeTops.push_back(link); +} + diff --git a/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorManager.h b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorManager.h new file mode 100644 index 0000000000000000000000000000000000000000..87ea3d0c258b7afa5d7255f8b4fa521c5f072883 --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorManager.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TrenchDetectorManager_h +#define TrenchDetectorManager_h 1 + +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoVDetectorManager.h" +#include <vector> + +class TrenchDetectorManager : public GeoVDetectorManager +{ + public: + + // Constructor + TrenchDetectorManager(); + + // Destructor + ~TrenchDetectorManager(); + + // Access to raw geometry: + virtual unsigned int getNumTreeTops() const; + virtual PVConstLink getTreeTop(unsigned int i) const; + + void addTreeTop(PVLink); // Add a Tree top: + + private: + + const TrenchDetectorManager & operator=(const TrenchDetectorManager &right); + TrenchDetectorManager(const TrenchDetectorManager &right); + + // Tree Tops + std::vector<PVLink> m_treeTops; +}; + +#ifndef GAUDI_NEUTRAL +#include "AthenaKernel/CLASS_DEF.h" +CLASS_DEF(TrenchDetectorManager, 124400828, 1) +#endif + +#endif + + diff --git a/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorTool.cxx b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..cfd2b94f43cc4fc0202b1e8af1ddee7a98700564 --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorTool.cxx @@ -0,0 +1,106 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrenchDetectorTool.h" +#include "TrenchDetectorFactory.h" +#include "TrenchDetectorManager.h" + +#include "GeoModelInterfaces/IGeoDbTagSvc.h" +#include "GeoModelFaserUtilities/GeoModelExperiment.h" +#include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" + +#include "boost/algorithm/string/predicate.hpp" + +TrenchDetectorTool::TrenchDetectorTool( const std::string& type, + const std::string& name, + const IInterface* parent ) + : GeoModelTool( type, name, parent ), + m_manager(0) +{ +} + +TrenchDetectorTool::~TrenchDetectorTool() +{ +} + + +StatusCode TrenchDetectorTool::create() +{ + IGeoDbTagSvc *geoDbTag; + StatusCode sc = service ("GeoDbTagSvc",geoDbTag); + if(sc.isFailure()) { + msg(MSG::ERROR) << "Could not locate GeoDbTagSvc" << endmsg; + return sc; + } + + IRDBAccessSvc* raccess = 0; + sc = service("RDBAccessSvc",raccess); + if(sc.isFailure()) { + msg(MSG::ERROR) << "Could not locate RDBAccessSvc" << endmsg; + return sc; + } + + DecodeFaserVersionKey versionKey(geoDbTag,"Trench"); + IRDBRecordset_ptr switchSet + = raccess->getRecordsetPtr("TrenchSwitches", versionKey.tag(), versionKey.node(),"FASERDD"); + const IRDBRecord *switches = (*switchSet)[0]; + msg(MSG::DEBUG) << "Retrieved TrenchSwitches" << endmsg; + + +// std::string trenchVersion = geoDbTag->trenchVersion(); + std::string trenchVersion = versionKey.tag(); + msg(MSG::INFO) << "Building Trench geometry version " << trenchVersion << endmsg; + if(trenchVersion.empty()) { + msg(MSG::INFO) << "No Trench version for the given configuration. Skip building TrenchGeoModel" << endmsg; + return StatusCode::SUCCESS; + } + + std::string versionNode = versionKey.node(); + + GeoModelExperiment* theExpt = nullptr; + if (StatusCode::SUCCESS != detStore()->retrieve(theExpt,"FASER")) { + msg(MSG::ERROR) << "Could not find GeoModelExperiment FASER" << endmsg; + return StatusCode::FAILURE; + } + + GeoPhysVol *world=&*theExpt->getPhysVol(); + + if(!m_manager) { + // If geometry has not been built yet fall back to the default factory + TrenchDetectorFactory theTrenchFactory(detStore().operator->(),raccess); + theTrenchFactory.setTagNode(trenchVersion,versionNode); + theTrenchFactory.create(world); + m_manager = theTrenchFactory.getDetectorManager(); + } + + if(m_manager) { + theExpt->addManager(m_manager); + sc = detStore()->record(m_manager, + m_manager->getName()); + if(sc.isFailure()) { + msg(MSG::ERROR) << "Could not register Trench detector manager" << endmsg; + return sc; + } + } + else { + msg(MSG::ERROR) << "ERROR. Failed to build Trench Version " << trenchVersion << endmsg; + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +StatusCode TrenchDetectorTool::clear() +{ + SG::DataProxy* proxy = detStore()->proxy(ClassID_traits<TrenchDetectorManager>::ID(),m_manager->getName()); + if(proxy) { + proxy->reset(); + m_manager = 0; + } + return StatusCode::SUCCESS; +} + diff --git a/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorTool.h b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorTool.h new file mode 100644 index 0000000000000000000000000000000000000000..6c5407662e5508608d8b189aa57c3d37d82a4eda --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/src/TrenchDetectorTool.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRENCHDETECTORTOOL_H +#define TRENCHDETECTORTOOL_H + +#include "GeoModelFaserUtilities/GeoModelTool.h" +class TrenchDetectorManager; + +class TrenchDetectorTool final : public GeoModelTool +{ + public: + + // Standard Constructor + TrenchDetectorTool( const std::string& type, const std::string& name, const IInterface* parent ); + + // Standard Destructor + virtual ~TrenchDetectorTool() override final; + + virtual StatusCode create() override final; + virtual StatusCode clear() override final; + + private: + const TrenchDetectorManager* m_manager; +}; + +#endif diff --git a/FaserGeometryCommon/TrenchGeoModel/src/components/TrenchGeoModel_entries.cxx b/FaserGeometryCommon/TrenchGeoModel/src/components/TrenchGeoModel_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..732ee6b6b059d51d29acadecabaab16b50562cd2 --- /dev/null +++ b/FaserGeometryCommon/TrenchGeoModel/src/components/TrenchGeoModel_entries.cxx @@ -0,0 +1,3 @@ +#include "../TrenchDetectorTool.h" + +DECLARE_COMPONENT( TrenchDetectorTool ) \ No newline at end of file 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/EmulsionPlates.cxx b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionPlates.cxx index 7424987e17929d371002aa7f778e7a2a0ae08b06..5dbe4b9b91c6246124800f7e3f885a46a47ce1a8 100644 --- a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionPlates.cxx +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionPlates.cxx @@ -40,16 +40,16 @@ EmulsionPlates::EmulsionPlates(const std::string & name, m_logVolume = preBuild(); } - void EmulsionPlates::getParameters() { const EmulsionGeneralParameters * generalParameters = m_geometryManager->generalParameters(); const EmulsionPlatesParameters * platesParameters = m_geometryManager->platesParameters(); + const EmulsionSupportParameters* supportParameters = m_geometryManager->supportParameters(); - m_width = platesParameters->platesWidth(); - m_height = platesParameters->platesHeight(); - m_thickness = platesParameters->platesThickness(); + m_tungstenWidth = platesParameters->platesWidth(); + m_tungstenHeight = platesParameters->platesHeight(); + m_tungstenThickness = platesParameters->platesThickness(); m_material = m_materials->getMaterial(platesParameters->platesMaterial()); m_nBasesPerModule = generalParameters->nBasesPerModule(); @@ -57,6 +57,8 @@ EmulsionPlates::getParameters() m_firstBaseZ = generalParameters->firstBaseZ(); m_lastBaseZ = generalParameters->lastBaseZ(); + m_supportElements = supportParameters->supportElements(); + m_detectorManager->numerology().setNumBasesPerModule(m_nBasesPerModule); } @@ -66,6 +68,27 @@ EmulsionPlates::preBuild() // create child element m_base = new EmulsionBase("Base", m_detectorManager, m_geometryManager, m_materials); + double width = m_tungstenWidth/2; + double height = m_tungstenHeight/2; + // double thickness = m_tungstenThickness/2; + double minZ = -m_tungstenThickness/2; + double maxZ = m_tungstenThickness/2; + + for (auto e : m_supportElements) + { + width = std::max(width, std::max(std::abs(e.x + e.dx/2),std::abs(e.x - e.dx/2))); + height = std::max(height, std::max(std::abs(e.y + e.dy/2),std::abs(e.y - e.dy/2))); + minZ = std::min(minZ, e.z - e.dz/2); + maxZ = std::max(maxZ, e.z + e.dz/2); + const GeoBox* supportShape = new GeoBox(e.dx/2, e.dy/2, e.dz/2); + GeoLogVol* supportLog = new GeoLogVol(e.label, supportShape, m_materials->getMaterial(e.mat)); + m_supportVolumes.push_back(supportLog); + } + + m_width = 2 * width; + m_height = 2 * height; + m_thickness = maxZ - minZ; + m_zShift = -(maxZ + minZ)/2; // Build a box to hold everything const GeoBox* platesShape = new GeoBox(0.5*m_width, 0.5*m_height, 0.5*m_thickness); @@ -97,7 +120,7 @@ EmulsionPlates::build(EmulsionIdentifier id) for (int base = 0; base < m_nBasesPerModule; base++) { id.setBase(base); - GeoAlignableTransform* theTransform = new GeoAlignableTransform( GeoTrf::Translate3D {0.0, 0.0, m_firstBaseZ + ((m_lastBaseZ - m_firstBaseZ)/(nBasesTotal-1))*nBases++} ); + GeoAlignableTransform* theTransform = new GeoAlignableTransform( GeoTrf::Translate3D {0.0, 0.0, m_zShift + m_firstBaseZ + ((m_lastBaseZ - m_firstBaseZ)/(nBasesTotal-1))*nBases++} ); plates->add(theTransform); plates->add(new GeoNameTag("Base#"+intToString(module*100 + base))); plates->add(new GeoIdentifierTag(module*100 + base)); @@ -108,5 +131,16 @@ EmulsionPlates::build(EmulsionIdentifier id) m_detectorManager->numerology().useModule(module); } + auto iv = m_supportVolumes.begin(); + for (auto e : m_supportElements) + { + GeoVPhysVol* pv = new GeoPhysVol(*iv); + GeoTransform* theTransform = new GeoTransform( GeoTrf::Translate3D {e.x, e.y, e.z + m_zShift}); + plates->add(theTransform); + plates->add(new GeoNameTag(e.label)); + plates->add(pv); + iv++; + } + return plates; } diff --git a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionPlates.h b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionPlates.h index b827265b9f0753fd834f24d0d051eb02ba2a5675..431aecbf467997cc8a096547e15bca6c5c56c4fb 100644 --- a/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionPlates.h +++ b/Neutrino/NeutrinoDetDescr/EmulsionGeoModel/src/EmulsionPlates.h @@ -6,6 +6,7 @@ #define EMULSIONGEOMODEL_EMULSIONPLATES_H #include "EmulsionComponentFactory.h" +#include "EmulsionSupportParameters.h" #include "EmulsionBase.h" #include "GeoPrimitives/GeoPrimitives.h" #include "GeoModelKernel/GeoDefinitions.h" @@ -28,6 +29,7 @@ public: double thickness() const {return m_thickness;} double width() const {return m_width;} double height() const {return m_height;} + double shift() const {return m_zShift;} virtual GeoVPhysVol * build(EmulsionIdentifier id); @@ -38,6 +40,10 @@ private: double m_thickness; double m_width; double m_height; + double m_tungstenThickness; + double m_tungstenWidth; + double m_tungstenHeight; + double m_zShift; const GeoMaterial * m_material; int m_nModules; @@ -45,7 +51,10 @@ private: double m_firstBaseZ; double m_lastBaseZ; + std::vector<EmulsionSupportParameters::SupportElement> m_supportElements; + EmulsionBase* m_base; + std::vector<GeoLogVol*> m_supportVolumes; }; 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 diff --git a/README.md b/README.md index 0b334b19690dd56d1a0bae23fd5c0849c1cd83dd..2d7e57abb75b58112939efb7b2726607bcfb6ec3 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ source ./setup.sh Don't omit the dot in the `source ./setup.sh` command! -It can be convenient to alias the "asetup --input=calypso/asetup.faser" to something like "fsetup" +It can be convenient to alias the command "asetup --input=calypso/asetup.faser" to something like "fsetup" **Lxplus/afs setup** @@ -44,12 +44,12 @@ When compiling, CERN IT recommends using condor to submit batch jobs. The basics * It is now essential to use the tags `ConfigFlags.GeoModel.FaserVersion` and `ConfigFlags.IOVDb.GlobalTag` in a consistent way. If nothing is specified the first option (baseline) should be chosen by default. -** `ConfigFlags.GeoModel.FaserVersion = "FASER-01"` and `ConfigFlags.IOVDb.GlobalTag = OFLCOND-FASER-01` enables the baseline TI-12 detector +** `ConfigFlags.GeoModel.FaserVersion = "FASER-01"` and `ConfigFlags.IOVDb.GlobalTag = OFLCOND-FASER-01` enables the baseline TI-12 detector (obsolete and no longer supported) -** `ConfigFlags.GeoModel.FaserVersion = "FASER-02"` and `ConfigFlags.IOVDb.GlobalTag = OFLCOND-FASER-02` enables the interface tracker and repositioned Veto +** `ConfigFlags.GeoModel.FaserVersion = "FASER-02"` and `ConfigFlags.IOVDb.GlobalTag = OFLCOND-FASER-02` enables the interface tracker and repositioned Veto (obsolete and no longer supported) -** `ConfigFlags.GeoModel.FaserVersion = "FASERNU-02"` and `ConfigFlags.IOVDb.GlobalTag = OFLCOND-FASER-02` enables the full FaserNu (IFT + emulsion) setup +** `ConfigFlags.GeoModel.FaserVersion = "FASERNU-03"` and `ConfigFlags.IOVDb.GlobalTag = OFLCOND-FASER-02` enables the full FaserNu (IFT + emulsion) setup ** `ConfigFlags.GeoModel.FaserVersion = "FASER-TB00"` and `ConfigFlags.IOVDb.GlobalTag = OFLCOND-FASER-TB00` enables the 2021 Test-beam setup. -* The command `lsetup "lcgenv -p LCG_98python3_ATLAS_8 x86_64-centos7-gcc8-opt sqlite"` may be necessary to avoid errors when generating a database +* The command `source /cvmfs/sft.cern.ch/lcg/releases/LCG_101_ATLAS_6/sqlite/3320300/x86_64-centos7-gcc11-opt/sqlite-env.sh` may be necessary to avoid errors when generating a database diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorElement.h b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorElement.h index 2f1e7c0a95be335fcc8e349159d9f6b4b4efe213..6711c085aff1e6b7386f3680b04bb06b9dc65659 100644 --- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorElement.h +++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorElement.h @@ -156,6 +156,7 @@ namespace ScintDD { bool isVeto() const; bool isTrigger() const; bool isPreshower() const; + bool isVetoNu() const; // Identifier <-> pmt @@ -458,6 +459,7 @@ namespace ScintDD { bool m_isVeto; bool m_isTrigger; bool m_isPreshower; + bool m_isVetoNu; // // Cached values. diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/VetoNuDetectorManager.h b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/VetoNuDetectorManager.h new file mode 100644 index 0000000000000000000000000000000000000000..86d34b84c94bc6f7ef4087a57696afa0be7ce3b3 --- /dev/null +++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/VetoNuDetectorManager.h @@ -0,0 +1,163 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////////////////////////// +// VetoNuDetectorManager.h +/////////////////////////////////////////////////////////////////// +// (c) ATLAS Detector software +/////////////////////////////////////////////////////////////////// + +#ifndef SCINTREADOUTGEOMETRY_VETONUDETECTORMANAGER_H +#define SCINTREADOUTGEOMETRY_VETONUDETECTORMANAGER_H + +#include "GeoPrimitives/GeoPrimitives.h" + +#include "GeoModelKernel/GeoVPhysVol.h" + +#include "ScintReadoutGeometry/ScintDetectorManager.h" +#include "ScintReadoutGeometry/ScintDetectorElementCollection.h" +#include "ScintReadoutGeometry/ScintDD_Defs.h" + +#include "ScintIdentifier/VetoNuID.h" + +class StoreGateSvc; +class Identifier; +class IdentifierHash; +class GeoAlignableTransform; +class GeoVFullPhysVol; +class GeoVPhysVol; +class GeoVAlignmentStore; +class CondAttrListCollection; + +namespace ScintDD { + + class ScintDetectorElement; + class ExtendedAlignableTransform; + class VetoNuDetectorDesign; + + /** @class VetoNuDetectorManager + + Dedicated detector manager extending the functionality of the ScintDetectorManager + with dedicated VetoNu information, access. + + @author: Grant Gorfine + - modified and maintained by Nick Styles & Andreas Salzburger + - modified for FASER by D. Casper + */ + + class VetoNuDetectorManager : public ScintDetectorManager { + + public: + + // Constructor + VetoNuDetectorManager( StoreGateSvc* detStore ); + + // Destructor + virtual ~VetoNuDetectorManager(); + + /** Access Raw Geometry */ + virtual unsigned int getNumTreeTops() const override; + virtual PVConstLink getTreeTop(unsigned int i) const override; + /** Add tree top */ + void addTreeTop(PVLink); + + + // + // Access Readout Elements + // + + /** access to individual elements via Identifier */ + virtual ScintDetectorElement * getDetectorElement(const Identifier &id) const override; + + /** access to individual elements via IdentifierHash */ + virtual ScintDetectorElement * getDetectorElement(const IdentifierHash &idHash) const override; + + /** access to individual elements via module numbering schema */ + ScintDetectorElement * getDetectorElement(int station, int plate) const; + + /** access to whole collectiom via iterators */ + virtual const ScintDetectorElementCollection * getDetectorElementCollection() const override; + virtual ScintDetectorElementCollection::const_iterator getDetectorElementBegin() const override; + virtual ScintDetectorElementCollection::const_iterator getDetectorElementEnd() const override; + + /** Add elememts during construction */ + virtual void addDetectorElement(ScintDetectorElement * element) override; + + /** Add alignable transforms. No access to these, they will be changed by manager: */ + virtual void addAlignableTransform (int level, + const Identifier &id, + GeoAlignableTransform *xf, + const GeoVFullPhysVol * child); + + /** As above but does a dynamic_cast to GeoVFullPhysVol */ + virtual void addAlignableTransform (int level, + const Identifier &id, + GeoAlignableTransform *xf, + const GeoVPhysVol * child); + + /** Initialize the neighbours. This can only be done when all elements are built. */ + virtual void initNeighbours() override; + + /** Check identifier is for this detector */ + virtual bool identifierBelongs(const Identifier & id) const override; + + /** Access to module design, casts to VetoNuDetectorDesign */ + const ScintDetectorDesign * getVetoNuDesign() const; + + /** Process new global DB folders for L1 and L2 **/ + virtual + bool processGlobalAlignment(const std::string &, int level, FrameType frame, + const CondAttrListCollection* obj, + GeoVAlignmentStore* alignStore) const override; + + // comply with ScintDetectorManager interface + bool processSpecialAlignment(const std::string & key, + ScintDD::AlignFolderType alignfolder) const override; + + bool processSpecialAlignment(const std::string& key, + const CondAttrListCollection* obj=nullptr, + GeoVAlignmentStore* alignStore=nullptr) const override; + + + private: + /** implements the main alignment update for delta transforms in different frames, + it translates into the LocalDelta or GlobalDelta function of ScintDetectorManager + */ + virtual bool setAlignableTransformDelta(int level, + const Identifier & id, + const Amg::Transform3D & delta, + FrameType frame, + GeoVAlignmentStore* alignStore) const override; + + /** Prevent copy and assignment */ + const VetoNuDetectorManager & operator=(const VetoNuDetectorManager &right); + VetoNuDetectorManager(const VetoNuDetectorManager &right); + + virtual const VetoNuID* getIdHelper() const override; + + // Private member data + std::vector<PVLink> m_volume; + ScintDetectorElementCollection m_elementCollection; + typedef std::map<Identifier, ExtendedAlignableTransform *> AlignableTransformMap; + std::vector< AlignableTransformMap > m_higherAlignableTransforms; + std::vector< ExtendedAlignableTransform *> m_alignableTransforms; + const VetoNuID* m_idHelper; + + /** This variable switches the how the local alignment corrections are applied + If true they will be calcualted on top of all of other corrections but in the default reference frame + If false they will be calcualted on top of all of other corrections but in the globally aligned reference frame + */ + bool m_isLogical; + + + }; + +} // namespace ScintDD + +#ifndef GAUDI_NEUTRAL +#include "AthenaKernel/CLASS_DEF.h" +CLASS_DEF(ScintDD::VetoNuDetectorManager, 238247911, 1) +#endif + +#endif // SCINTREADOUTGEOMETRY_VETONIDETECTORMANAGER_H diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintDetectorElement.cxx b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintDetectorElement.cxx index 3b4a0c4812177549e28af5e39cae2a4ed2d92e91..e06fa94894bf323189fad6f786d9e1daf6b57da1 100644 --- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintDetectorElement.cxx +++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/ScintDetectorElement.cxx @@ -14,6 +14,7 @@ #include "ScintIdentifier/VetoID.h" #include "ScintIdentifier/TriggerID.h" #include "ScintIdentifier/PreshowerID.h" +#include "ScintIdentifier/VetoNuID.h" #include "GeoModelKernel/GeoVFullPhysVol.h" #include "GeoModelFaserUtilities/GeoAlignmentStore.h" @@ -93,13 +94,14 @@ ScintDetectorElement::commonConstructor() m_isVeto = getIdHelper()->is_veto(m_id); m_isTrigger = getIdHelper()->is_trigger(m_id); m_isPreshower = getIdHelper()->is_preshower(m_id); - if (!m_isVeto && !m_isTrigger && !m_isPreshower) + m_isVetoNu = getIdHelper()->is_vetonu(m_id); + if (!m_isVeto && !m_isTrigger && !m_isPreshower && !m_isVetoNu) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Element id is not for veto, trigger or preshower" << endmsg; + if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Element id is not for veto, trigger, preshower or vetonu" << endmsg; } - else if ((m_isVeto && m_isTrigger) || (m_isVeto && m_isPreshower) || (m_isTrigger && m_isPreshower)) + else if ((m_isVeto && m_isTrigger) || (m_isVeto && m_isPreshower) || (m_isTrigger && m_isPreshower) || (m_isVetoNu && (m_isVeto || m_isTrigger || m_isPreshower))) { - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Element id belongs to more than one of veto, trigger or preshower" << endmsg; + if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Element id belongs to more than one of veto, trigger, preshower or vetonu" << endmsg; } // Set IdHash. @@ -118,6 +120,11 @@ ScintDetectorElement::commonConstructor() const PreshowerID* preshowerId = dynamic_cast<const PreshowerID* >(getIdHelper()); m_idHash = preshowerId->plate_hash(m_id); } + else if (isVetoNu()) + { + const VetoNuID* vetoNuId = dynamic_cast<const VetoNuID* >(getIdHelper()); + m_idHash = vetoNuId->plate_hash(m_id); + } if (!m_idHash.is_valid()) throw std::runtime_error("ScintDetectorElement: Unable to set IdentifierHash"); @@ -599,6 +606,11 @@ bool ScintDetectorElement::isPreshower() const return m_isPreshower; } +bool ScintDetectorElement::isVetoNu() const +{ + return m_isVetoNu; +} + Trk::Surface & ScintDetectorElement::surface() { diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/VetoNuDetectorManager.cxx b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/VetoNuDetectorManager.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b7990ebc33a4b0af1f4e24dcdc5acd6bfc21d611 --- /dev/null +++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/VetoNuDetectorManager.cxx @@ -0,0 +1,348 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ScintReadoutGeometry/VetoNuDetectorManager.h" + +#include "AthenaBaseComps/AthMsgStreamMacros.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" +#include "GeoPrimitives/CLHEPtoEigenConverter.h" +#include "Identifier/Identifier.h" +#include "Identifier/IdentifierHash.h" +#include "ScintIdentifier/VetoNuID.h" +#include "ScintReadoutGeometry/ScintDetectorElementCollection.h" +#include "ScintReadoutGeometry/ScintDetectorElement.h" +#include "ScintReadoutGeometry/ExtendedAlignableTransform.h" +#include "ScintReadoutGeometry/ScintDetectorDesign.h" +#include "StoreGate/StoreGateSvc.h" + +#include <iostream> + +namespace ScintDD { + + const int FIRST_HIGHER_LEVEL = 1; + + VetoNuDetectorManager::VetoNuDetectorManager( StoreGateSvc* detStore ) + : ScintDetectorManager(detStore, "VetoNu"), + m_idHelper(0), + m_isLogical(false) // Change to true to change the definition of local module corrections + { + // + // Initialized the Identifier helper. + // + StatusCode sc = detStore->retrieve(m_idHelper, "VetoNuID"); + if (sc.isFailure()) { + ATH_MSG_ERROR("Could not retrieve VetoNu id helper"); + } + // Initialize the collections. + if (m_idHelper) { + m_elementCollection.resize(m_idHelper->plate_hash_max()); + m_alignableTransforms.resize(m_idHelper->plate_hash_max()); + // m_moduleAlignableTransforms.resize(m_idHelper->plate_hash_max()); + } + } + + + + VetoNuDetectorManager::~VetoNuDetectorManager() + { + // Clean up + for (size_t i=0; i < m_volume.size(); i++) { + m_volume[i]->unref(); + } + + for (size_t j=0; j < m_higherAlignableTransforms.size(); j++){ + AlignableTransformMap::iterator iterMap; + for (iterMap = m_higherAlignableTransforms[j].begin(); + iterMap != m_higherAlignableTransforms[j].end(); + ++iterMap) { + delete iterMap->second; + } + } + + for (size_t k=0; k < m_alignableTransforms.size(); k++){ + delete m_alignableTransforms[k]; + } + + // for (size_t l=0; l < m_moduleAlignableTransforms.size(); l++){ + // delete m_moduleAlignableTransforms[l]; + // } + } + + unsigned int VetoNuDetectorManager::getNumTreeTops() const + { + return m_volume.size(); + } + + PVConstLink VetoNuDetectorManager::getTreeTop(unsigned int i) const + { + return m_volume[i]; + } + + void VetoNuDetectorManager::addTreeTop(PVLink vol){ + vol->ref(); + m_volume.push_back(vol); + } + + + ScintDetectorElement* VetoNuDetectorManager::getDetectorElement(const Identifier & id) const + { + // NB the id helpers implementation for getting a hash is not optimal. + // Essentially does a binary search. + // Make sure it is a wafer Id + Identifier waferId = m_idHelper->plate_id(id); + IdentifierHash idHash = m_idHelper->plate_hash(waferId); + if (idHash.is_valid()) { + return m_elementCollection[idHash]; + } else { + return 0; + } + } + + ScintDetectorElement* VetoNuDetectorManager::getDetectorElement(const IdentifierHash & idHash) const + { + return m_elementCollection[idHash]; + } + + ScintDetectorElement* VetoNuDetectorManager::getDetectorElement(int station, int plate) const + { + return getDetectorElement(m_idHelper->plate_id(station, plate)); + } + + const ScintDetectorElementCollection* VetoNuDetectorManager::getDetectorElementCollection() const + { + return &m_elementCollection; + } + + ScintDetectorElementCollection::const_iterator VetoNuDetectorManager::getDetectorElementBegin() const + { + return m_elementCollection.begin(); + } + + ScintDetectorElementCollection::const_iterator VetoNuDetectorManager::getDetectorElementEnd() const + { + return m_elementCollection.end(); + } + + + void VetoNuDetectorManager::addDetectorElement(ScintDetectorElement * element) + { + IdentifierHash idHash = element->identifyHash(); + if (idHash >= m_elementCollection.size()) + throw std::runtime_error("VetoNuDetectorManager: Error adding detector element."); + m_elementCollection[idHash] = element; + } + + void VetoNuDetectorManager::initNeighbours() + { + ScintDetectorElementCollection::iterator iter; + + // Loop over all elements and set the neighbours + for (iter = m_elementCollection.begin(); iter != m_elementCollection.end(); ++iter){ + + ScintDetectorElement * element = *iter; + if (element) { + + IdentifierHash idHash = element->identifyHash(); + IdentifierHash idHashOther; + + int result; + // If no neighbour, result != 0 in which case we leave neighbour as null + result = m_idHelper->get_next_in_z(idHash, idHashOther); + if (result==0) element->setNextInZ(m_elementCollection[idHashOther]); + + result = m_idHelper->get_prev_in_z(idHash, idHashOther); + if (result==0) element->setPrevInZ(m_elementCollection[idHashOther]); + } + } + } + + const VetoNuID* VetoNuDetectorManager::getIdHelper() const + { + return m_idHelper; + } + + + bool VetoNuDetectorManager::setAlignableTransformDelta(int level, + const Identifier & id, + const Amg::Transform3D & delta, + FrameType frame, + GeoVAlignmentStore* alignStore) const + { + + if (level == 0) { // 0 - At the element level + + // We retrieve it via a hashId. + IdentifierHash idHash = m_idHelper->plate_hash(id); + if (!idHash.is_valid()) return false; + + if (frame == ScintDD::global) { // global shift + // Its a global transform + return setAlignableTransformGlobalDelta(m_alignableTransforms[idHash], delta, alignStore); + + } else if (frame == ScintDD::local) { // local shift + + ScintDetectorElement * element = m_elementCollection[idHash]; + if (!element) return false; + + + // Its a local transform + //See header file for definition of m_isLogical + if( m_isLogical ){ + //Ensure cache is up to date and use the alignment corrected local to global transform + element->setCache(); + return setAlignableTransformLocalDelta(m_alignableTransforms[idHash], element->transform(), delta, alignStore); + } else + //Use default local to global transform + return setAlignableTransformLocalDelta(m_alignableTransforms[idHash], element->defTransform(), delta, alignStore); + + } else { + // other not supported + ATH_MSG_WARNING("Frames other than global or local are not supported."); + return false; + } + } else { // higher level + if (frame != ScintDD::global) { + ATH_MSG_WARNING("Non global shift at higher levels is not supported."); + return false; + } + + int index = level - FIRST_HIGHER_LEVEL; // level 0 is treated separately. + if (index >= static_cast<int>(m_higherAlignableTransforms.size())) return false; + + // We retrieve it from a map. + AlignableTransformMap::const_iterator iter; + iter = m_higherAlignableTransforms[index].find(id); + if (iter == m_higherAlignableTransforms[index].end()) return false; + + // Its a global transform + return setAlignableTransformGlobalDelta(iter->second, delta, alignStore); + } + } + + void VetoNuDetectorManager::addAlignableTransform (int level, + const Identifier & id, + GeoAlignableTransform *transform, + const GeoVPhysVol * child) + { + if (m_idHelper) { + + const GeoVFullPhysVol * childFPV = dynamic_cast<const GeoVFullPhysVol *>(child); + if (!childFPV) { + ATH_MSG_ERROR("Child of alignable transform is not a full physical volume"); + } else { + addAlignableTransform (level, id, transform, childFPV); + } + } + } + + void VetoNuDetectorManager::addAlignableTransform (int level, + const Identifier & id, + GeoAlignableTransform *transform, + const GeoVFullPhysVol * child) + { + if (m_idHelper) { + if (level == 0) { + // Element + IdentifierHash idHash = m_idHelper->plate_hash(id); + if (idHash.is_valid()) { + m_alignableTransforms[idHash]= new ExtendedAlignableTransform(transform, child); + } + } else { + // Higher levels are saved in a map. NB level=0 is treated above. + int index = level - FIRST_HIGHER_LEVEL; // level 0 is treated separately. + if (index >= static_cast<int>(m_higherAlignableTransforms.size())) m_higherAlignableTransforms.resize(index+1); + m_higherAlignableTransforms[index][id] = new ExtendedAlignableTransform(transform, child); + } + } + } + + bool + VetoNuDetectorManager::identifierBelongs(const Identifier & id) const + { + return getIdHelper()->is_vetonu(id); + } + + + const ScintDetectorDesign* VetoNuDetectorManager::getVetoNuDesign() const + { + return dynamic_cast<const ScintDetectorDesign *>(getDesign()); + } + + // New global alignment folders + bool VetoNuDetectorManager::processGlobalAlignment(const std::string & key, int level, FrameType frame, + const CondAttrListCollection* obj, GeoVAlignmentStore* alignStore) const + { + ATH_MSG_INFO("Processing new global alignment containers with key " << key << " in the " << frame << " frame at level "); + + const CondAttrListCollection* atrlistcol=obj; + if(atrlistcol==nullptr and m_detStore->retrieve(atrlistcol,key)!=StatusCode::SUCCESS) { + ATH_MSG_INFO("Cannot find new global align Container for key " + << key << " - no new global alignment "); + return false; + } + + bool alignmentChange = false; + Identifier ident=Identifier(); + + // loop over objects in collection + for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); citr!=atrlistcol->end();++citr) { + const coral::AttributeList& atrlist=citr->second; + // SCT manager, therefore ignore all that is not a SCT Identifier + // if (atrlist["det"].data<int>()!=2) continue; + ATH_MSG_FATAL("Using invalid alignment data for VetoNu detector (correct treatment not yet implemented"); + ident = getIdHelper()->plate_id(atrlist["station"].data<int>(), + atrlist["plate"].data<int>()); // The last is the module side which is at this ident-level always the 0-side + + // construct new transform + // Order of rotations is defined as around z, then y, then x. + Amg::Translation3D newtranslation(atrlist["Tx"].data<float>(),atrlist["Ty"].data<float>(),atrlist["Tz"].data<float>()); + Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity(); + newtrans *= Amg::AngleAxis3D(atrlist["Rz"].data<float>()*CLHEP::mrad, Amg::Vector3D(0.,0.,1.)); + newtrans *= Amg::AngleAxis3D(atrlist["Ry"].data<float>()*CLHEP::mrad, Amg::Vector3D(0.,1.,0.)); + newtrans *= Amg::AngleAxis3D(atrlist["Rx"].data<float>()*CLHEP::mrad, Amg::Vector3D(1.,0.,0.)); + + ATH_MSG_DEBUG("New global DB -- channel: " << citr->first + << " ,det: " << atrlist["det"].data<int>() + << " ,bec: " << atrlist["bec"].data<int>() + << " ,layer: " << atrlist["layer"].data<int>() + << " ,ring: " << atrlist["ring"].data<int>() + << " ,sector: " << atrlist["sector"].data<int>() + << " ,Tx: " << atrlist["Tx"].data<float>() + << " ,Ty: " << atrlist["Ty"].data<float>() + << " ,Tz: " << atrlist["Tz"].data<float>() + << " ,Rx: " << atrlist["Rx"].data<float>() + << " ,Ry: " << atrlist["Ry"].data<float>() + << " ,Rz: " << atrlist["Rz"].data<float>()); + + // Set the new transform; Will replace existing one with updated transform + bool status = setAlignableTransformDelta(level, + ident, + newtrans, + frame, + alignStore); + + if (!status) { + ATH_MSG_DEBUG("Cannot set AlignableTransform for identifier." + << getIdHelper()->show_to_string(ident) + << " at level " << level << " for new global DB "); + } + + alignmentChange = (alignmentChange || status); + } + return alignmentChange; + } + +bool VetoNuDetectorManager::processSpecialAlignment( + const std::string &, ScintDD::AlignFolderType) const { + return false; +} + +bool VetoNuDetectorManager::processSpecialAlignment(const std::string& /*key*/, + const CondAttrListCollection* /*obj*/, + GeoVAlignmentStore* /*alignStore*/) const { + return false; + +} + +} // namespace ScintDD diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/CMakeLists.txt b/Scintillator/ScintDetDescr/VetoNuGeoModel/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..404a64a14c4deecf4fd9f51908c5800e0129cd28 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/CMakeLists.txt @@ -0,0 +1,29 @@ +################################################################################ +# Package: VetoNuGeoModel +################################################################################ + +# Declare the package name: +atlas_subdir( VetoNuGeoModel ) + +# 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( VetoNuGeoModel + src/*.cxx + src/components/*.cxx + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODEL_LIBRARIES} AthenaKernel GeoModelFaserUtilities GaudiKernel SGTools StoreGateLib SGtests AthenaPoolUtilities DetDescrConditions FaserDetDescr ScintGeoModelUtils ScintReadoutGeometry ScintIdentifier Identifier ) + +atlas_add_test( VetoNuGMConfig_test + SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/VetoNuGMConfig_test.py + PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + PROPERTIES TIMEOUT 300 ) + + +# Install files from the package: +atlas_install_python_modules( python/*.py ) +atlas_install_scripts( test/*.py ) diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/VetoNuGeoModel/VetoNuDetectorTool.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/VetoNuGeoModel/VetoNuDetectorTool.h new file mode 100644 index 0000000000000000000000000000000000000000..60e4ee6ab63659996fd6b2b942e6dc64ceb03fbb --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/VetoNuGeoModel/VetoNuDetectorTool.h @@ -0,0 +1,61 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VETONUGEOMODEL_VETONUDETECTORTOOL_H +#define VETONUGEOMODEL_VETONUDETECTORTOOL_H + +#include "GeoModelFaserUtilities/GeoModelTool.h" +#include "VetoNuGeoModel/VetoNuGeoModelAthenaComps.h" + +#include "GeometryDBSvc/IGeometryDBSvc.h" +#include "GeoModelInterfaces/IGeoDbTagSvc.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" + +#include "GaudiKernel/ServiceHandle.h" + +#include <string> + +namespace ScintDD { + class VetoNuDetectorManager; +} + +class VetoNuID; +// class FaserDetectorID; + +class VetoNuDetectorTool : public GeoModelTool { + +public: + // Standard Constructor + VetoNuDetectorTool(const std::string& type, const std::string& name, const IInterface* parent); + + virtual StatusCode create() override final; + virtual StatusCode clear() override final; + + // Register callback function on ConDB object + virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override final; + + // Callback function itself + virtual StatusCode align(IOVSVC_CALLBACK_ARGS) override; + +private: + StringProperty m_detectorName{this, "DetectorName", "VetoNu"}; + BooleanProperty m_alignable{this, "Alignable", true}; + BooleanProperty m_useDynamicAlignFolders{this, "useDynamicAlignFolders", false}; + bool m_cosmic; + + const ScintDD::VetoNuDetectorManager* m_manager; + + VetoNuGeoModelAthenaComps m_athenaComps; + + ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc; + ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc; + ServiceHandle< IGeometryDBSvc > m_geometryDBSvc; + + StringProperty m_run1Folder{this, "Run1Folder", "/Scint/Align"}; + StringProperty m_run2L1Folder{this, "Run2L1Folder", "/Scint/AlignL1/ID"}; + StringProperty m_run2L2Folder{this, "Run2L2Folder", "/Scint/AlignL2/SCT"}; + StringProperty m_run2L3Folder{this, "Run2L3Folder", "/Scint/AlignL3"}; +}; + +#endif // VETOGEOMODEL_VETODETECTORTOOL_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/VetoNuGeoModel/VetoNuGeoModelAthenaComps.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/VetoNuGeoModel/VetoNuGeoModelAthenaComps.h new file mode 100644 index 0000000000000000000000000000000000000000..c873da9365eade697769bbcc116d05bfd1b9ee45 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/VetoNuGeoModel/VetoNuGeoModelAthenaComps.h @@ -0,0 +1,29 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VetoNuGeoModel_VetoNuGeoModelAthenaComps_H +#define VetoNuGeoModel_VetoNuGeoModelAthenaComps_H 1 + +#include "ScintGeoModelUtils/ScintDDAthenaComps.h" + +class VetoNuID; + +/// Class to hold various Athena components +// template <class ID_HELPER> +class VetoNuGeoModelAthenaComps : public ScintDD::AthenaComps { + +public: + + VetoNuGeoModelAthenaComps(); + + void setIdHelper(const VetoNuID* idHelper); + + const VetoNuID* getIdHelper() const; + +private: + const VetoNuID* m_idHelper; + +}; + +#endif // VetoNuGeoModel_VetoNuGeoModelAthenaComps_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/python/VetoNuGeoModelConfig.py b/Scintillator/ScintDetDescr/VetoNuGeoModel/python/VetoNuGeoModelConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..9f55fbad90243aa8ba56ba4044a99ca085a1a811 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/python/VetoNuGeoModelConfig.py @@ -0,0 +1,20 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentFactory import CompFactory +# from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline + +def VetoNuGeometryCfg( flags ): + from FaserGeoModel.GeoModelConfig import GeoModelCfg + acc = GeoModelCfg( flags ) + geoModelSvc = acc.getPrimary() + + GeometryDBSvc=CompFactory.GeometryDBSvc + acc.addService(GeometryDBSvc("ScintGeometryDBSvc")) + + VetoNuDetectorTool = CompFactory.VetoNuDetectorTool + vetoNuDetectorTool = VetoNuDetectorTool() + + vetoNuDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic + geoModelSvc.DetectorTools += [ vetoNuDetectorTool ] + + return acc diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuComponentFactory.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuComponentFactory.cxx new file mode 100644 index 0000000000000000000000000000000000000000..711a8dfd097f349dddc59d33a00dc955090bcd2c --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuComponentFactory.cxx @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuComponentFactory.h" +#include "GaudiKernel/SystemOfUnits.h" + +#include <sstream> +#include <string> + +using ScintDD::VetoNuDetectorManager; + +const double VetoNuComponentFactory::s_epsilon = 1.0e-6 * Gaudi::Units::mm; + +VetoNuComponentFactory::VetoNuComponentFactory(const std::string & name, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials) + : m_detectorManager(detectorManager), + m_geometryManager(geometryManager), + m_materials(materials), + m_name(name) +{} + +VetoNuComponentFactory::~VetoNuComponentFactory() +{} + +std::string +VetoNuComponentFactory::intToString(int i) const +{ + std::ostringstream str; + str << i; + return str.str(); +} + +double +VetoNuComponentFactory::epsilon() const +{ + return s_epsilon; +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuComponentFactory.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuComponentFactory.h new file mode 100644 index 0000000000000000000000000000000000000000..340f896f9b111f7b620194b7ded5943c72523899 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuComponentFactory.h @@ -0,0 +1,89 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VETONUGEOMODEL_VETONUCOMPONENTFACTORY_H +#define VETONUGEOMODEL_VETONUCOMPONENTFACTORY_H + +#include "VetoNuIdentifier.h" +#include <string> + +namespace ScintDD{class VetoNuDetectorManager;} +class VetoNuGeometryManager; +class VetoNuMaterialManager; + +class GeoLogVol; +class GeoVPhysVol; + + +class VetoNuComponentFactory +{ + +public: + VetoNuComponentFactory(const std::string & name, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials); + + const std::string & getName() const {return m_name;} + + // utility function to covert int to string + std::string intToString(int i) const; + +protected: + ScintDD::VetoNuDetectorManager* m_detectorManager; + const VetoNuGeometryManager* m_geometryManager; + VetoNuMaterialManager* m_materials; + + double epsilon() const; + virtual ~VetoNuComponentFactory(); + +private: + std::string m_name; + static const double s_epsilon; + +}; + + +class VetoNuSharedComponentFactory : public VetoNuComponentFactory +{ + +public: + VetoNuSharedComponentFactory(const std::string & name, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials=nullptr) : + VetoNuComponentFactory(name, detectorManager, geometryManager, materials), + m_physVolume(nullptr) + {}; + + GeoVPhysVol * getVolume() {return m_physVolume;} + +protected: + GeoVPhysVol * m_physVolume; + virtual GeoVPhysVol * build() = 0; + +}; + +class VetoNuUniqueComponentFactory : public VetoNuComponentFactory +{ + +public: + VetoNuUniqueComponentFactory(const std::string & name, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials=nullptr) : + VetoNuComponentFactory(name, detectorManager, geometryManager, materials), + m_logVolume{nullptr} + {}; + + virtual GeoVPhysVol * build(VetoNuIdentifier id) = 0; + +protected: + const GeoLogVol * m_logVolume; + + virtual const GeoLogVol * preBuild() = 0; + +}; + +#endif // VETOGEOMODEL_VETOCOMPONENTFACTORY_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDataBase.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDataBase.cxx new file mode 100644 index 0000000000000000000000000000000000000000..58c19908bda3299b05f846b04c24439d01d499ec --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDataBase.cxx @@ -0,0 +1,109 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuDataBase.h" + +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBRecord.h" + +#include "GeoModelInterfaces/IGeoDbTagSvc.h" +#include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" + +#include "VetoNuGeoModel/VetoNuGeoModelAthenaComps.h" + +#include <iostream> + +VetoNuDataBase::VetoNuDataBase(const VetoNuGeoModelAthenaComps * athenaComps) +{ + m_athenaComps = athenaComps; + + IGeoDbTagSvc * geoDbTag = m_athenaComps->geoDbTagSvc(); + + // Get version tag and node for VetoNu + DecodeFaserVersionKey versionKey(geoDbTag,"VetoNu"); + std::string versionTag = versionKey.tag(); + std::string versionNode = versionKey.node(); + + // Get version tag and node for Scintillator. + DecodeFaserVersionKey scintVersionKey(geoDbTag,"Scintillator"); + + // Access the RDB + IRDBAccessSvc* rdbSvc = m_athenaComps->rdbAccessSvc(); + + // VetoNu version tag + m_vetoVersionTag = rdbSvc->getChildTag("VetoNu", 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) << " VetoNu Version: " << m_vetoVersionTag << endmsg; + + // ATLS - not sure I use it. + // General atlas parameters + + // + // VetoNu General + // + + // VetoNu TopLevel + m_topLevel = rdbSvc->getRecordsetPtr("VetoNuTopLevel", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table VetoNuTopLevel Fetched" << endmsg; + + // Weight Table + m_weightTable = rdbSvc->getRecordsetPtr("VetoNuWeights", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table VetoNuWeights Fetched" << endmsg; + + // Extra Scaling Table. This is used for extra material studies. For nominal material the table should be empty. + // NB this is at InnerDetector level node. + m_scalingTable = rdbSvc->getRecordsetPtr("VetoNuMatScaling", scintVersionKey.tag(), scintVersionKey.node(), "FASERDD"); + msg(MSG::DEBUG) << "Table VetoNuMatScaling Fetched" << endmsg; + +// // Default conditions +// m_conditions = rdbSvc->getRecordsetPtr("VetoNuConditions", versionTag, versionNode, "FASERDD"); +// msg(MSG::DEBUG) << "Table VetoNuConditions Fetched" << endmsg; + + m_stationGeneral = rdbSvc->getRecordsetPtr("VetoNuStationGeneral", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table VetoNuStationGeneral Fetched" << endmsg; + + m_plateGeneral = rdbSvc->getRecordsetPtr("VetoNuPlateGeneral", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table VetoNuPlateGeneral Fetched" << endmsg; + + m_radiatorGeneral = rdbSvc->getRecordsetPtr("VetoNuRadiatorGeneral", versionTag, versionNode, "FASERDD"); + msg(MSG::DEBUG) << "Table VetoNuRadiatorGeneral Fetched" << endmsg; + + +} + +const VetoNuGeoModelAthenaComps* VetoNuDataBase::athenaComps() const { return m_athenaComps; } + +IRDBRecordset_ptr VetoNuDataBase::weightTable() const {return m_weightTable;} + +IRDBRecordset_ptr VetoNuDataBase::scalingTable() const {return m_scalingTable;} + +// //const IRDBRecord* VetoNuDataBase::atls() const {return *m_atls)[0];} +IRDBRecordset_ptr VetoNuDataBase::topLevelTable() const {return m_topLevel;} + +// IRDBRecordset_ptr VetoNuDataBase::conditionsTable() const {return m_conditions;} +// const IRDBRecord* VetoNuDataBase::conditions() const {return (*m_conditions)[0];} + +const IRDBRecord* VetoNuDataBase::stationGeneral() const {return (*m_stationGeneral)[0];} +const IRDBRecord* VetoNuDataBase::plateGeneral() const {return (*m_plateGeneral)[0];} +const IRDBRecord* VetoNuDataBase::radiatorGeneral() const {return (*m_radiatorGeneral)[0];} + +const std::string & VetoNuDataBase::versionTag() const { + return m_vetoVersionTag; +} + +MsgStream& VetoNuDataBase::msg (MSG::Level lvl) const +{ + return m_athenaComps->msg(lvl); +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDataBase.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDataBase.h new file mode 100644 index 0000000000000000000000000000000000000000..1028ed0198798fabf12c64604f9b25ddc355a427 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDataBase.h @@ -0,0 +1,155 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VetoNuGeoModel_VetoNuDataBase_H +#define VetoNuGeoModel_VetoNuDataBase_H + +#include "VetoNuGeoModel/VetoNuGeoModelAthenaComps.h" +#include <string> + +#include "RDBAccessSvc/IRDBAccessSvc.h" +class IRDBRecord; + + +class VetoNuDataBase +{ + + +public: + + VetoNuDataBase(const VetoNuGeoModelAthenaComps* athenaComps); + + const VetoNuGeoModelAthenaComps* athenaComps() const; + + IRDBRecordset_ptr weightTable() const; + IRDBRecordset_ptr scalingTable() const; + IRDBRecordset_ptr topLevelTable() const; + +// IRDBRecordset_ptr conditionsTable() const; +// const IRDBRecord* conditions() const; + +// const IRDBRecord* brlSensor() const; +// const IRDBRecord* brlModule() const; + +// const IRDBRecord* brlSki() const; +// const IRDBRecord* brlSkiZ(int i) const; +// int brlSkiZSize() const; +// const IRDBRecord* brlLayer(int i) const; +// const IRDBRecord* brlServices() const; +// const IRDBRecord* brlServPerLayer(int i) const; +// const IRDBRecord* brlThermalShield() const; + const IRDBRecord* stationGeneral() const; + const IRDBRecord* plateGeneral() const; + const IRDBRecord* radiatorGeneral() const; +// const IRDBRecord* brlFSI() const; +// int brlFSISize() const; +// const IRDBRecord* brlFSILocation(int i) const; + +// const IRDBRecord* fwdSensor(int i) const; +// const IRDBRecord* fwdHybrid() const; +// const IRDBRecord* fwdSpine(int i) const; +// const IRDBRecord* fwdModule(int i) const; +// int fwdModuleSize() const; +// IRDBRecordset_ptr fwdModuleConnectorTable() const; +// const IRDBRecord* fwdModuleConnector() const; + +// const IRDBRecord* fwdRing(int i) const; +// int fwdRingSize() const; +// const IRDBRecord* fwdWheel(int i) const; +// const IRDBRecord* fwdWheelRingMap(int i) const; +// int fwdWheelRingMapSize() const; +// const IRDBRecord* fwdDiscSupport() const; +// const IRDBRecord* fwdPatchPanelLoc(int i) const; +// int fwdPatchPanelLocSize() const; +// const IRDBRecord* fwdPatchPanel(int i) const; +// int fwdPatchPanelSize() const; +// const IRDBRecord* fwdPPConnector() const; +// int fwdPPConnectorSize() const; +// const IRDBRecord* fwdPPCooling() const; +// int fwdPPCoolingSize() const; +// const IRDBRecord* fwdCoolingBlock(int i) const; +// const IRDBRecord* fwdRingServices(int i) const; +// const IRDBRecord* fwdServices() const; +// const IRDBRecord* fwdFSILocation(int i) const; +// int fwdFSILocationSize() const; +// const IRDBRecord* fwdFSIType(int i) const; +// int fwdFSITypeSize() const; +// const IRDBRecord* fwdFSI(int i) const; +// int fwdFSISize() const; +// const IRDBRecord* fwdThermalShield(int i) const; +// int fwdThermalShieldSize() const; +// const IRDBRecord* fwdGeneral() const; +// IRDBRecordset_ptr fwdOptoHarnessTable() const; +// const IRDBRecord* fwdOptoHarness(int i) const; +// IRDBRecordset_ptr fwdDiscFixationTable() const; +// const IRDBRecord* fwdDiscFixation() const; +// const IRDBRecord* fwdCylServ(int i) const; +// int fwdCylServSize() const; +// const IRDBRecord* fwdCylServLoc(int i) const; +// int fwdCylServLocSize() const; + + // Return the VetoNu version tag. + const std::string & versionTag() const; + + MsgStream& msg (MSG::Level lvl) const; + +private: + + VetoNuDataBase(const VetoNuDataBase &); + VetoNuDataBase& operator= (const VetoNuDataBase &); + +private: + + const VetoNuGeoModelAthenaComps* m_athenaComps; + + std::string m_vetoVersionTag; + + IRDBRecordset_ptr m_weightTable; + IRDBRecordset_ptr m_scalingTable; + IRDBRecordset_ptr m_topLevel; + IRDBRecordset_ptr m_conditions; + +// IRDBRecordset_ptr m_brlSensor; +// IRDBRecordset_ptr m_brlModule; +// IRDBRecordset_ptr m_brlSki; +// IRDBRecordset_ptr m_brlSkiZ; +// IRDBRecordset_ptr m_brlLayer; +// IRDBRecordset_ptr m_brlServices; +// IRDBRecordset_ptr m_brlServPerLayer; +// IRDBRecordset_ptr m_brlThermalShield; + IRDBRecordset_ptr m_stationGeneral; + IRDBRecordset_ptr m_plateGeneral; + IRDBRecordset_ptr m_radiatorGeneral; +// IRDBRecordset_ptr m_brlFSI; +// IRDBRecordset_ptr m_brlFSILocation; +// IRDBRecordset_ptr m_fwdSensor; +// IRDBRecordset_ptr m_fwdHybrid; +// IRDBRecordset_ptr m_fwdSpine; +// IRDBRecordset_ptr m_fwdModule; +// IRDBRecordset_ptr m_fwdModuleConnector; +// IRDBRecordset_ptr m_fwdRing; +// IRDBRecordset_ptr m_fwdWheel; +// IRDBRecordset_ptr m_fwdWheelRingMap; +// IRDBRecordset_ptr m_fwdDiscSupport; +// IRDBRecordset_ptr m_fwdPatchPanelLoc; +// IRDBRecordset_ptr m_fwdPatchPanel; +// IRDBRecordset_ptr m_fwdPPConnector; +// IRDBRecordset_ptr m_fwdPPCooling; +// IRDBRecordset_ptr m_fwdCoolingBlock; +// IRDBRecordset_ptr m_fwdRingServices; +// IRDBRecordset_ptr m_fwdServices; +// IRDBRecordset_ptr m_fwdFSILocation; +// IRDBRecordset_ptr m_fwdFSIType; +// IRDBRecordset_ptr m_fwdFSI; +// IRDBRecordset_ptr m_fwdThermalShield; +// IRDBRecordset_ptr m_fwdGeneral; +// IRDBRecordset_ptr m_fwdOptoHarness; +// IRDBRecordset_ptr m_fwdDiscFixation; +// IRDBRecordset_ptr m_fwdCylServ; +// IRDBRecordset_ptr m_fwdCylServLoc; + + +}; + +#endif //VetoNuGeoModel_VetoNuDataBase_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2ac00cd600b65c83b8b483dc27b43b10da9e4cb6 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.cxx @@ -0,0 +1,279 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// +// VetoNuDetectorFactory: This is the top level node +// + + +#include "VetoNuDetectorFactory.h" + +#include "VetoNuDataBase.h" +#include "VetoNuIdentifier.h" +#include "VetoNuGeometryManager.h" +#include "VetoNuMaterialManager.h" +#include "VetoNuGeneralParameters.h" +#include "ScintReadoutGeometry/Version.h" +#include "ScintReadoutGeometry/ScintCommonItems.h" +#include "ScintReadoutGeometry/ScintDD_Defs.h" +#include "ScintReadoutGeometry/ScintDetectorDesign.h" + +#include "VetoNuStation.h" +#include "VetoNuRadiator.h" +#include "VetoNuPlate.h" +#include "VetoNuDataBase.h" +#include "VetoNuGeoModel/VetoNuGeoModelAthenaComps.h" + +// +// GeoModel include files: +// +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoTube.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoVPhysVol.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeUnion.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GeoModelInterfaces/StoredMaterialManager.h" +#include "GeoModelInterfaces/IGeoDbTagSvc.h" +#include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" +#include "RDBAccessSvc/IRDBAccessSvc.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" +#include "DetDescrConditions/AlignableTransformContainer.h" +# +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/ISvcLocator.h" + +#include "GeoModelKernel/GeoDefinitions.h" +#include "GaudiKernel/SystemOfUnits.h" + + + +#include <iostream> +#include <iomanip> +#include <string> + +using ScintDD::VetoNuDetectorManager; +using ScintDD::ScintCommonItems; + +VetoNuDetectorFactory::VetoNuDetectorFactory(const VetoNuGeoModelAthenaComps * athenaComps, + const VetoNuOptions & options) + : ScintDD::DetectorFactoryBase(athenaComps), + m_useDynamicAlignFolders(false) +{ + + // Create the detector manager + m_detectorManager = new VetoNuDetectorManager(detStore()); + msg(MSG::DEBUG) << "Created VetoNuDetectorManager" << endmsg; + + // Create the database + m_db = new VetoNuDataBase{athenaComps}; + msg(MSG::DEBUG) << "Created VetoNuDataBase" << endmsg; + + // Create the material manager + m_materials = new VetoNuMaterialManager{m_db}; + msg(MSG::DEBUG) << "Created VetoNuMaterialManager" << endmsg; + + // Create the geometry manager. + m_geometryManager = new VetoNuGeometryManager{m_db}; + msg(MSG::DEBUG) << "Created VetoNuGeometryManager" << endmsg; + m_geometryManager->setOptions(options); + msg(MSG::DEBUG) << "Set options on VetoNuGeometryManager" << endmsg; + + m_useDynamicAlignFolders = options.dynamicAlignFolders(); + + // Set Version information + // Get the geometry tag + DecodeFaserVersionKey versionKey(geoDbTagSvc(),"VetoNu"); + IRDBRecordset_ptr switchSet + = rdbAccessSvc()->getRecordsetPtr("VetoNuSwitches", versionKey.tag(), versionKey.node(),"FASERDD"); + const IRDBRecord *switches = (*switchSet)[0]; + msg(MSG::DEBUG) << "Retrieved VetoNuSwitches" << endmsg; + + std::string layout = "Final"; + std::string description; + if (!switches->isFieldNull("LAYOUT")) { + layout = switches->getString("LAYOUT"); + } + if (!switches->isFieldNull("DESCRIPTION")) { + description = switches->getString("DESCRIPTION"); + } + + std::string versionTag = rdbAccessSvc()->getChildTag("VetoNu", versionKey.tag(), versionKey.node(),"FASERDD"); + std::string versionName = switches->getString("VERSIONNAME"); + int versionMajorNumber = 1; + int versionMinorNumber = 0; + int versionPatchNumber = 0; + ScintDD::Version version(versionTag, + versionName, + layout, + description, + versionMajorNumber, + versionMinorNumber, + versionPatchNumber); + m_detectorManager->setVersion(version); +} + + +VetoNuDetectorFactory::~VetoNuDetectorFactory() +{ + // NB the detector manager (m_detectorManager)is stored in the detector store by the + // Tool and so we don't delete it. + delete m_db; + delete m_materials; + delete m_geometryManager; +} + +void VetoNuDetectorFactory::create(GeoPhysVol *world) +{ + + msg(MSG::INFO) << "Building VetoNu Detector." << endmsg; + msg(MSG::INFO) << " " << m_detectorManager->getVersion().fullDescription() << endmsg; + + // Change precision. + int oldPrecision = std::cout.precision(6); + + // The tree tops get added to world. We name it "indet" though. + GeoPhysVol *scint = world; + + const VetoNuGeneralParameters * vetoGeneral = m_geometryManager->generalParameters(); + + GeoTrf::Transform3D vetoTransform = vetoGeneral->partTransform("VetoNu"); + + std::string stationA_Label = "StationA"; + // std::string stationB_Label = "StationB"; + // std::string radiator_Label = "Radiator"; + + bool stationA_Present = vetoGeneral->partPresent(stationA_Label); + // bool stationB_Present = vetoGeneral->partPresent(stationB_Label); + // bool radiator_Present = vetoGeneral->partPresent(radiator_Label); + // + // Plate is the same for all stations + // + VetoNuPlate plate("Plate", m_detectorManager, m_geometryManager, m_materials); + msg(MSG::DEBUG) << "Created VetoNu plate with dimensions (" << plate.thickness() << "," << plate.width() << "," << plate.length() << ")" << endmsg; + // + // Station A + // + if (stationA_Present) + { + msg(MSG::DEBUG) << "Building the VetoNu Station A." << endmsg; + m_detectorManager->numerology().addStation(0); + + // Create the station + VetoNuStation stationA("VetoNuStationA", &plate, m_detectorManager, m_geometryManager, m_materials); + VetoNuIdentifier id{m_geometryManager->athenaComps()->getIdHelper()}; + id.setStation(0); + GeoVPhysVol* stationA_PV = stationA.build(id); + GeoAlignableTransform* stationA_Transform = new GeoAlignableTransform(vetoTransform * vetoGeneral->partTransform(stationA_Label)); + + GeoNameTag* topLevelNameTag = new GeoNameTag("VetoNu"); + scint->add(topLevelNameTag); + scint->add(new GeoIdentifierTag(0)); + scint->add(stationA_Transform); + scint->add(stationA_PV); + m_detectorManager->addTreeTop(stationA_PV); + + // Store alignable transform for station (level = 1) + m_detectorManager->addAlignableTransform(1, id.getPlateId(), stationA_Transform, stationA_PV); + } + + // // + // // Station B + // // + // if (stationB_Present) + // { + // msg(MSG::DEBUG) << "Building the VetoNu Station B." << endmsg; + // m_detectorManager->numerology().addStation(1); + + // // Create the station + // VetoNuStation stationB("VetoNuStationB", &plate, m_detectorManager, m_geometryManager, m_materials); + // VetoNuIdentifier id{m_geometryManager->athenaComps()->getIdHelper()}; + // id.setStation(1); + // GeoVPhysVol* stationB_PV = stationB.build(id); + // GeoAlignableTransform* stationB_Transform = new GeoAlignableTransform(vetoTransform * vetoGeneral->partTransform(stationB_Label)); + + // GeoNameTag* topLevelNameTag = new GeoNameTag("VetoNu"); + // scint->add(topLevelNameTag); + // scint->add(new GeoIdentifierTag(0)); + // scint->add(stationB_Transform); + // scint->add(stationB_PV); + // m_detectorManager->addTreeTop(stationB_PV); + + // // Store alignable transform for station (level = 1) + // m_detectorManager->addAlignableTransform(1, id.getPlateId(), stationB_Transform, stationB_PV); + // } + + // // Passive radiator + // if (radiator_Present) + // { + // msg(MSG::DEBUG) << "Building the VetoNu Radiator." << endmsg; + + // // Create the radiator + // VetoNuRadiator radiator("VetoNuRadiator", m_detectorManager, m_geometryManager, m_materials); + // GeoAlignableTransform* radiator_Transform = new GeoAlignableTransform(vetoTransform * vetoGeneral->partTransform(radiator_Label)); + + // GeoNameTag* topLevelNameTag = new GeoNameTag("VetoNu"); + // scint->add(topLevelNameTag); + // scint->add(new GeoIdentifierTag(0)); + // scint->add(radiator_Transform); + // scint->add(radiator.getVolume()); + // m_detectorManager->addTreeTop(radiator.getVolume()); + + // } + + + // Set the neighbours + m_detectorManager->initNeighbours(); + + // Set number of pmts in numerology. + const ScintDD::ScintDetectorDesign* design = m_detectorManager->getVetoNuDesign(); + if (design != nullptr) + { + m_detectorManager->numerology().setNumPmtsPerPlate(m_detectorManager->getVetoNuDesign()->cells()); + } + else + { + m_detectorManager->numerology().setNumPmtsPerPlate(0); + } + + + // Register the keys and the level corresponding to the key + // and whether it expects a global or local shift. + // level 0: sensor, level 1: module, level 2, layer/disc, level 3: whole barrel/enccap + + + if (!m_useDynamicAlignFolders){ + + m_detectorManager->addAlignFolderType(ScintDD::static_run1); + // m_detectorManager->addFolder("/Scint/Align"); + } + else { + m_detectorManager->addAlignFolderType(ScintDD::timedependent_run2); + // m_detectorManager->addGlobalFolder("/Scint/AlignL1/Scint"); + // m_detectorManager->addGlobalFolder("/Scint/AlignL2/VetoNu"); + // m_detectorManager->addChannel("/Scint/AlignL1/Scint",3,ScintDD::global); + // m_detectorManager->addChannel("/Scint/AlignL2/VetoNu",2,ScintDD::global); + // m_detectorManager->addFolder("/Scint/AlignL3"); + } + + // Return precision to its original value + std::cout.precision(oldPrecision); + +} + + +const VetoNuDetectorManager * VetoNuDetectorFactory::getDetectorManager() const +{ + return m_detectorManager; +} + + diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.h new file mode 100644 index 0000000000000000000000000000000000000000..f9cc9e793dbd1a1cd4b088d79f5d3d30f81a0d1c --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorFactory.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VETONUGEOMODEL_VETONUDETECTORFACTORY_H +#define VETONUGEOMODEL_VETONUDETECTORFACTORY_H + +#include "ScintGeoModelUtils/DetectorFactoryBase.h" +#include "ScintReadoutGeometry/VetoNuDetectorManager.h" +#include "ScintReadoutGeometry/ScintDD_Defs.h" + +class GeoPhysVol; +class VetoNuDataBase; +class VetoNuGeometryManager; +class VetoNuGeoModelAthenaComps; +class VetoNuMaterialManager; +class VetoNuOptions; + +class VetoNuDetectorFactory : public ScintDD::DetectorFactoryBase +{ + + public: + // Constructor + VetoNuDetectorFactory(const VetoNuGeoModelAthenaComps * athenaComps, + const VetoNuOptions & options); + + // Destructor + virtual ~VetoNuDetectorFactory(); + + // Creation of geometry: + virtual void create(GeoPhysVol *world); + + // Access to the results: + virtual const ScintDD::VetoNuDetectorManager * getDetectorManager() const; + + private: + // Copy and assignments operations illegal and so are made private + VetoNuDetectorFactory(const VetoNuDetectorFactory &right); + const VetoNuDetectorFactory & operator=(const VetoNuDetectorFactory &right); + + ScintDD::VetoNuDetectorManager *m_detectorManager; + VetoNuGeometryManager *m_geometryManager; + VetoNuDataBase* m_db; + VetoNuMaterialManager* m_materials; + bool m_useDynamicAlignFolders; + +}; + +#endif + diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorTool.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9b74df9592c7c1e4226163a36a06cd0e4a872962 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuDetectorTool.cxx @@ -0,0 +1,249 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuGeoModel/VetoNuDetectorTool.h" + +#include "VetoNuDetectorFactory.h" +#include "VetoNuDataBase.h" +// #include "VetoNuMaterialManager.h" +#include "VetoNuOptions.h" + +// temporary +#include "ScintReadoutGeometry/VetoNuDetectorManager.h" +#include "ScintIdentifier/VetoNuID.h" +#include "DetDescrConditions/AlignableTransformContainer.h" + +#include "GeoModelFaserUtilities/GeoModelExperiment.h" +#include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" +#include "StoreGate/DataHandle.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" + +#include "AthenaKernel/ClassID_traits.h" +#include "SGTools/DataProxy.h" + +using ScintDD::VetoNuDetectorManager; +using ScintDD::ScintDetectorManager; + +// +// Constructor +// +VetoNuDetectorTool::VetoNuDetectorTool(const std::string& type, + const std::string& name, + const IInterface* parent) + : GeoModelTool(type, name, parent), + m_cosmic{false}, + m_manager{nullptr}, + m_athenaComps{ }, + m_geoDbTagSvc{"GeoDbTagSvc", name}, + m_rdbAccessSvc{"RDBAccessSvc", name}, + m_geometryDBSvc{"ScintGeometryDBSvc", name} +{ + // Get parameter values from jobOptions file + declareProperty("GeoDbTagSvc", m_geoDbTagSvc); + declareProperty("RDBAccessSvc", m_rdbAccessSvc); + declareProperty("GeometryDBSvc", m_geometryDBSvc); +} + +// +// Create the Geometry via the factory corresponding to this tool +// + +StatusCode +VetoNuDetectorTool::create() +{ + // Get the detector configuration. + ATH_CHECK(m_geoDbTagSvc.retrieve()); + + DecodeFaserVersionKey versionKey{&*m_geoDbTagSvc, "VetoNu"}; + // Issue error if AUTO. + if (versionKey.tag() == "AUTO") { + ATH_MSG_ERROR("AUTO Faser version. Please select a version."); + } + ATH_MSG_INFO("Building VetoNu with Version Tag: " << versionKey.tag() << " at Node: " << versionKey.node()); + + ATH_CHECK(m_rdbAccessSvc.retrieve()); + // Print the VetoNu version tag: + std::string vetoVersionTag{m_rdbAccessSvc->getChildTag("VetoNu", versionKey.tag(), versionKey.node(), "FASERDD")}; + ATH_MSG_INFO("VetoNu Version: " << vetoVersionTag); + // Check if version is empty. If so, then the VetoNu cannot be built. This may or may not be intentional. We + // just issue an INFO message. + if (vetoVersionTag.empty()) { + ATH_MSG_INFO("No VetoNu Version. VetoNu will not be built."); + } else { + std::string versionName; + if (versionKey.custom()) { + ATH_MSG_WARNING("VetoNuDetectorTool: Detector Information coming from a custom configuration!!"); + } else { + ATH_MSG_DEBUG("VetoNuDetectorTool: Detector Information coming from the database and job options IGNORED."); + ATH_MSG_DEBUG("Keys for VetoNu Switches are " << versionKey.tag() << " " << versionKey.node()); + + IRDBRecordset_ptr switchSet{m_rdbAccessSvc->getRecordsetPtr("VetoNuSwitches", versionKey.tag(), versionKey.node(), "FASERDD")}; + const IRDBRecord* switches{(*switchSet)[0]}; + m_detectorName.setValue(switches->getString("DETECTORNAME")); + + if (not switches->isFieldNull("COSMICLAYOUT")) + { + m_cosmic = switches->getInt("COSMICLAYOUT"); + } + if (not switches->isFieldNull("VERSIONNAME")) + { + versionName = switches->getString("VERSIONNAME"); + } + } + + ATH_MSG_DEBUG("Creating the VetoNu"); + ATH_MSG_DEBUG("VetoNu Geometry Options: "); + ATH_MSG_DEBUG(" Alignable: " << (m_alignable.value() ? "true" : "false")); + ATH_MSG_DEBUG(" CosmicLayout: " << (m_cosmic ? "true" : "false")); + ATH_MSG_DEBUG(" VersionName: " << versionName); + + VetoNuOptions options; + options.setAlignable(m_alignable.value()); + options.setDynamicAlignFolders(m_useDynamicAlignFolders.value()); + m_manager = nullptr; + + // + // Locate the top level experiment node + // + GeoModelExperiment* theExpt{nullptr}; + ATH_CHECK(detStore()->retrieve(theExpt, "FASER")); + + // Retrieve the Geometry DB Interface + ATH_CHECK(m_geometryDBSvc.retrieve()); + + // Pass athena services to factory, etc + m_athenaComps.setDetStore(detStore().operator->()); + m_athenaComps.setGeoDbTagSvc(&*m_geoDbTagSvc); + m_athenaComps.setGeometryDBSvc(&*m_geometryDBSvc); + m_athenaComps.setRDBAccessSvc(&*m_rdbAccessSvc); + const VetoNuID* idHelper{nullptr}; + ATH_CHECK(detStore()->retrieve(idHelper, "VetoNuID")); + m_athenaComps.setIdHelper(idHelper); + idHelper->test_plate_packing(); + // + // This strange way of casting is to avoid an + // utterly brain damaged compiler warning. + // + GeoPhysVol* world{&*theExpt->getPhysVol()}; + if (world != nullptr) ATH_MSG_INFO("Retrieved World PhysVol"); + + VetoNuDetectorFactory theVetoNu{&m_athenaComps, options}; + ATH_MSG_INFO("Created instance of detector factory"); + theVetoNu.create(world); + ATH_MSG_INFO("Called create methon on factory"); + m_manager = theVetoNu.getDetectorManager(); + ATH_MSG_INFO("Attempted to retrieve detector manager"); + + if (m_manager==nullptr) { + ATH_MSG_FATAL("VetoNuDetectorManager not created"); + return StatusCode::FAILURE; + } + + // Get the manager from the factory and store it in the detector store. + // m_detector is non constant so I can not set it to a const pointer. + // m_detector = theSCT.getDetectorManager(); + + ATH_MSG_DEBUG("Registering VetoNuDetectorManager. "); + ATH_CHECK(detStore()->record(m_manager, m_manager->getName())); + theExpt->addManager(m_manager); + + // Create a symLink to the ScintDetectorManager base class + const ScintDetectorManager* scintDetManager{m_manager}; + ATH_CHECK(detStore()->symLink(m_manager, scintDetManager)); + } + + return StatusCode::SUCCESS; +} + +StatusCode +VetoNuDetectorTool::clear() +{ + ATH_MSG_WARNING("Called untested VetoNuDetectorTool::clear()"); + SG::DataProxy* proxy{detStore()->proxy(ClassID_traits<VetoNuDetectorManager>::ID(), m_manager->getName())}; + if (proxy) { + proxy->reset(); + m_manager = nullptr; + } + return StatusCode::SUCCESS; +} + +StatusCode +VetoNuDetectorTool::registerCallback() +{ + StatusCode sc{StatusCode::FAILURE}; + if (m_alignable.value()) { + ATH_MSG_WARNING("Called untested VetoNuDetectorTool::registerCallback()"); + if (m_useDynamicAlignFolders.value()) { + + if (detStore()->contains<CondAttrListCollection>(m_run2L1Folder.value())) { + ATH_MSG_DEBUG("Registering callback on global Container with folder " << m_run2L1Folder.value()); + const DataHandle<CondAttrListCollection> calc; + ATH_CHECK(detStore()->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool*>(this), calc, m_run2L1Folder.value())); + sc = StatusCode::SUCCESS; + } else { + ATH_MSG_WARNING("Unable to register callback on global Container with folder " << m_run2L1Folder.value()); + return StatusCode::FAILURE; + } + + if (detStore()->contains<CondAttrListCollection>(m_run2L2Folder.value())) { + ATH_MSG_DEBUG("Registering callback on global Container with folder " << m_run2L2Folder.value()); + const DataHandle<CondAttrListCollection> calc; + ATH_CHECK(detStore()->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool*>(this), calc, m_run2L2Folder.value())); + sc = StatusCode::SUCCESS; + } else { + ATH_MSG_WARNING("Unable to register callback on global Container with folder " << m_run2L2Folder.value()); + return StatusCode::FAILURE; + } + + if (detStore()->contains<AlignableTransformContainer>(m_run2L3Folder.value())) { + ATH_MSG_DEBUG("Registering callback on AlignableTransformContainer with folder " << m_run2L3Folder.value()); + const DataHandle<AlignableTransformContainer> atc; + ATH_CHECK(detStore()->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool*>(this), atc, m_run2L3Folder.value())); + sc = StatusCode::SUCCESS; + } else { + ATH_MSG_WARNING("Unable to register callback on AlignableTransformContainer with folder " << m_run2L3Folder.value()); + return StatusCode::FAILURE; + } + + } else { + + if (detStore()->contains<AlignableTransformContainer>(m_run1Folder.value())) { + ATH_MSG_DEBUG("Registering callback on AlignableTransformContainer with folder " << m_run1Folder.value()); + const DataHandle<AlignableTransformContainer> atc; + ATH_CHECK(detStore()->regFcn(&IGeoModelTool::align, dynamic_cast<IGeoModelTool*>(this), atc, m_run1Folder.value())); + sc = StatusCode::SUCCESS; + } else { + ATH_MSG_WARNING("Unable to register callback on AlignableTransformContainer with folder " + << m_run1Folder.value() << ", Alignment disabled (only if no Run2 scheme is loaded)!"); + return StatusCode::FAILURE; + } + } + } else { + ATH_MSG_INFO("Alignment disabled. No callback registered"); + // We return failure otherwise it will try and register + // a GeoModelSvc callback associated with this callback. + return StatusCode::FAILURE; + } + return sc; +} + +StatusCode +VetoNuDetectorTool::align(IOVSVC_CALLBACK_ARGS_P(I, keys)) +{ + ATH_MSG_WARNING("Called untested VetoNuDetectorTool::align()"); + void* i = &I; + void* k = &keys; + if (i == nullptr && k == nullptr) return StatusCode::SUCCESS; // suppress stupid warning + if (m_manager==nullptr) { + ATH_MSG_FATAL("Manager does not exist"); + return StatusCode::FAILURE; + } + if (m_alignable.value()) { + return m_manager->align(I, keys); + } else { + ATH_MSG_DEBUG("Alignment disabled. No alignments applied"); + return StatusCode::SUCCESS; + } +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeneralParameters.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeneralParameters.cxx new file mode 100644 index 0000000000000000000000000000000000000000..2e88fe60692993cd96c766032a9a396e8fb65416 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeneralParameters.cxx @@ -0,0 +1,88 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuGeneralParameters.h" +#include "VetoNuDataBase.h" +#include "RDBAccessSvc/IRDBRecord.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "GaudiKernel/SystemOfUnits.h" +#include "GeoModelKernel/GeoDefinitions.h" +#include "ScintGeoModelUtils/TopLevelPlacements.h" + +const double VetoNuSAFETY = 0.01 * Gaudi::Units::mm; // Used in some places to make envelopes slightly larger to ensure + // no overlaps due to rounding errors. + + +VetoNuGeneralParameters::VetoNuGeneralParameters(VetoNuDataBase* rdb) +{ + m_rdb = rdb; + m_placements = new TopLevelPlacements(m_rdb->topLevelTable()); +} + + +VetoNuGeneralParameters::~VetoNuGeneralParameters() +{ + delete m_placements; +} + + +const GeoTrf::Transform3D & +VetoNuGeneralParameters::partTransform(const std::string & partName) const +{ + return m_placements->transform(partName); +} + + +bool +VetoNuGeneralParameters::partPresent(const std::string & partName) const +{ + return m_placements->present(partName); +} + + + +// +// General +// +double +VetoNuGeneralParameters::safety() const +{ + return VetoNuSAFETY; +} + +// Default Conditions. Values should be come form conditions data base. These values provide +// default vlaues if nothing from the conditions database is provided. + + +// double +// VetoNuGeneralParameters::temperature() const +// { +// if (m_rdb->conditionsTable()->size() == 0) { +// return 266.15 * Gaudi::Units::kelvin; // -7 C +// } +// return (m_rdb->conditions()->getDouble("TEMPERATURE") + 273.15) * Gaudi::Units::kelvin; +// } + + +// double +// SCT_GeneralParameters::biasVoltage() const +// { +// if (m_rdb->conditionsTable()->size() == 0) { +// return 100 * Gaudi::Units::volt; +// } +// return m_rdb->conditions()->getDouble("BIASVOLT") * Gaudi::Units::volt; +// } + +// double +// SCT_GeneralParameters::depletionVoltage() const +// { +// if (m_rdb->conditionsTable()->size() == 0) { +// return 20 * Gaudi::Units::volt; +// } +// return m_rdb->conditions()->getDouble("DEPLETIONVOLT") * Gaudi::Units::volt; +// } + + + + diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeneralParameters.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeneralParameters.h new file mode 100644 index 0000000000000000000000000000000000000000..d8a6d55788bf3ea6347204ecd8980f79f157854d --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeneralParameters.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VetoNuGeoModel_VetoNuGeneralParameters_H +#define VetoNuGeoModel_VetoNuGeneralParameters_H + +#include "GeoModelKernel/GeoDefinitions.h" + +#include <map> +#include <string> + +class VetoNuDataBase; +class TopLevelPlacements; + +class VetoNuGeneralParameters { + +public: + + VetoNuGeneralParameters(VetoNuDataBase* rdb); + ~VetoNuGeneralParameters(); + //Explicitly disallow copy, assignment to appease coverity + VetoNuGeneralParameters(const VetoNuGeneralParameters &) = delete; + VetoNuGeneralParameters & operator=(const VetoNuGeneralParameters &) = 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; + +private: + + VetoNuDataBase * m_rdb; + TopLevelPlacements * m_placements; + +}; + + +#endif // SCT_GeoModel_SCT_GeneralParameters_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeoModelAthenaComps.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeoModelAthenaComps.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ad8256acbb791c752d6cf80272104e4f76944b98 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeoModelAthenaComps.cxx @@ -0,0 +1,23 @@ +/* + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuGeoModel/VetoNuGeoModelAthenaComps.h" + +VetoNuGeoModelAthenaComps::VetoNuGeoModelAthenaComps() + : ScintDD::AthenaComps("VetoNuGeoModel"), + m_idHelper(0) +{} + +void +VetoNuGeoModelAthenaComps::setIdHelper(const VetoNuID* idHelper) +{ + m_idHelper = idHelper; +} + +const VetoNuID* +VetoNuGeoModelAthenaComps::getIdHelper() const +{ + return m_idHelper; +} + diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeometryManager.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeometryManager.cxx new file mode 100644 index 0000000000000000000000000000000000000000..df334a198a6f6c6a8c61d66863327000a2e3c71d --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeometryManager.cxx @@ -0,0 +1,123 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuGeometryManager.h" + +#include "ScintGeoModelUtils/DistortedMaterialManager.h" +#include "ScintIdentifier/VetoNuID.h" +#include "ScintReadoutGeometry/ScintCommonItems.h" +#include "VetoNuStationParameters.h" +#include "VetoNuPlateParameters.h" +#include "VetoNuRadiatorParameters.h" +#include "VetoNuDataBase.h" +#include "VetoNuGeneralParameters.h" +#include "VetoNuGeoModel/VetoNuGeoModelAthenaComps.h" + +VetoNuGeometryManager::VetoNuGeometryManager(VetoNuDataBase* rdb) + : m_athenaComps{rdb->athenaComps()}, + m_rdb{rdb} +{ + // This class uses reference counting. Should not be delete'd in destructor. + m_commonItems = new ScintDD::ScintCommonItems(m_athenaComps->getIdHelper()); + + m_stationParameters = std::make_unique<VetoNuStationParameters>(m_rdb); + m_plateParameters = std::make_unique<VetoNuPlateParameters>(m_rdb); + m_radiatorParameters = std::make_unique<VetoNuRadiatorParameters>(m_rdb); + m_generalParameters = std::make_unique<VetoNuGeneralParameters>(m_rdb); + m_distortedMatManager = std::make_unique<ScintDD::DistortedMaterialManager>(); +} + +VetoNuGeometryManager::~VetoNuGeometryManager() +{ +} + +// +// Access to run time options. +// +const VetoNuOptions & +VetoNuGeometryManager::options() const +{ + return m_options; +} + +void +VetoNuGeometryManager::setOptions(const VetoNuOptions & options) +{ + m_options = options; +} + +const VetoNuGeoModelAthenaComps * +VetoNuGeometryManager::athenaComps() const +{ + return m_athenaComps; +} + +// +// ScintCommonItems which are passed to ScintDetectorElements. +// + +const ScintDD::ScintCommonItems * +VetoNuGeometryManager::commonItems() const +{ + return m_commonItems; +} + +const VetoNuStationParameters * +VetoNuGeometryManager::stationParameters() const +{ + return m_stationParameters.get(); +} + +const VetoNuPlateParameters * +VetoNuGeometryManager::plateParameters() const +{ + return m_plateParameters.get(); +} + +const VetoNuRadiatorParameters * +VetoNuGeometryManager::radiatorParameters() const +{ + return m_radiatorParameters.get(); +} + + +const VetoNuGeneralParameters * +VetoNuGeometryManager::generalParameters() const +{ + return m_generalParameters.get(); +} + +const ScintDD::DistortedMaterialManager * +VetoNuGeometryManager::distortedMatManager() const +{ + return m_distortedMatManager.get(); +} + +VetoNuGeometryManager& +VetoNuGeometryManager::operator=(const VetoNuGeometryManager& right) { + if (this != &right) { + m_options = right.m_options; + m_athenaComps = right.m_athenaComps; + m_commonItems = right.m_commonItems; + m_rdb = right.m_rdb; + m_stationParameters.reset(new VetoNuStationParameters(m_rdb)); + m_plateParameters.reset(new VetoNuPlateParameters(m_rdb)); + m_radiatorParameters.reset(new VetoNuRadiatorParameters(m_rdb)); + m_generalParameters.reset(new VetoNuGeneralParameters(m_rdb)); + m_distortedMatManager.reset(new ScintDD::DistortedMaterialManager()); + } + return *this; +} + +VetoNuGeometryManager::VetoNuGeometryManager(const VetoNuGeometryManager& right) { + m_options = right.m_options; + m_athenaComps = right.m_athenaComps; + m_commonItems = right.m_commonItems; + m_rdb = right.m_rdb; + m_stationParameters.reset(new VetoNuStationParameters(m_rdb)); + m_plateParameters.reset(new VetoNuPlateParameters(m_rdb)); + m_radiatorParameters.reset(new VetoNuRadiatorParameters(m_rdb)); + m_generalParameters.reset(new VetoNuGeneralParameters(m_rdb)); + m_distortedMatManager.reset(new ScintDD::DistortedMaterialManager()); +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeometryManager.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeometryManager.h new file mode 100644 index 0000000000000000000000000000000000000000..0fa5eff1bc628cf691df5ee05269832b5aa62eb4 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuGeometryManager.h @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VetoNuGeoModel_VetoNuGeometryManager_H +#define VetoNuGeoModel_VetoNuGeometryManager_H + +#include "VetoNuOptions.h" + +#include <memory> + +namespace ScintDD { + class ScintCommonItems; + class DistortedMaterialManager; +} + +class VetoNuStationParameters; +class VetoNuPlateParameters; +class VetoNuRadiatorParameters; +class VetoNuDataBase; +class VetoNuGeneralParameters; +class VetoNuGeoModelAthenaComps; + +class VetoNuGeometryManager { + +public: + + // Constructor + VetoNuGeometryManager(VetoNuDataBase* rdb); + + // Destructor + ~VetoNuGeometryManager(); + + // Access to run time options + const VetoNuOptions & options() const; + void setOptions(const VetoNuOptions & options); + + // Access to athena components + const VetoNuGeoModelAthenaComps * athenaComps() const; + + // To be passed to detector element. + const ScintDD::ScintCommonItems * commonItems() const; + + const VetoNuStationParameters* stationParameters() const; + const VetoNuPlateParameters* plateParameters() const; + const VetoNuRadiatorParameters* radiatorParameters() const; + const VetoNuGeneralParameters* generalParameters() const; + const ScintDD::DistortedMaterialManager* distortedMatManager() const; + + VetoNuGeometryManager& operator=(const VetoNuGeometryManager& right); + VetoNuGeometryManager(const VetoNuGeometryManager& right); + +private: + + VetoNuOptions m_options; + const VetoNuGeoModelAthenaComps * m_athenaComps; + ScintDD::ScintCommonItems * m_commonItems; + VetoNuDataBase* m_rdb; + + std::unique_ptr<VetoNuStationParameters> m_stationParameters; + std::unique_ptr<VetoNuPlateParameters> m_plateParameters; + std::unique_ptr<VetoNuRadiatorParameters> m_radiatorParameters; + std::unique_ptr<VetoNuGeneralParameters> m_generalParameters; + std::unique_ptr<ScintDD::DistortedMaterialManager> m_distortedMatManager; + +}; + + +#endif // VetoNuGeoModel_VetoNuGeometryManager_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuIdentifier.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuIdentifier.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8ef8f33806fce3f29f70568fe1feeac9c623eaad --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuIdentifier.cxx @@ -0,0 +1,23 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuIdentifier.h" +#include "ScintIdentifier/VetoNuID.h" +#include "Identifier/Identifier.h" + +#include <cassert> +#include <iostream> + +Identifier +VetoNuIdentifier::getPlateId() +{ + assert (m_idHelper); + return m_idHelper->plate_id(m_station, m_plate); +} + +void VetoNuIdentifier::print() +{ + std::cout << "2/1/" << m_station << "/" + << m_plate << std::endl; +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuIdentifier.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuIdentifier.h new file mode 100644 index 0000000000000000000000000000000000000000..b19425ffe01c560ad0338cd28c6d04b05131e0a2 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuIdentifier.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VETONUGEOMODEL_VETONUIDENTIFIER_H +#define VETONUGEOMODEL_VETONUIDENTIFIER_H + +class Identifier; +class VetoNuID; + +class VetoNuIdentifier +{ +public: + + VetoNuIdentifier( const VetoNuID* idHelper, + int station = 0, + int plate = 0 ) + : m_idHelper{idHelper}, + m_station{station}, + m_plate{plate} + {}; + + + void setStation(int i) {m_station = i;} + int getStation() const {return m_station;} + + void setPlate(int i) {m_plate = i;} + int getPlate() const {return m_plate;} + + Identifier getPlateId(); + + // For debugging purposes. + void print(); + +private: + const VetoNuID* m_idHelper; + int m_station; + int m_plate; +}; + +#endif // VETOGEOMODEL_VETOIDENTIFIER_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuMaterialManager.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuMaterialManager.cxx new file mode 100644 index 0000000000000000000000000000000000000000..da71318c2526648265235b17e51297ef98f9dde5 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuMaterialManager.cxx @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuMaterialManager.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoElement.h" +#include "VetoNuDataBase.h" +#include "RDBAccessSvc/IRDBRecordset.h" +#include "StoreGate/StoreGateSvc.h" +#include "GaudiKernel/Bootstrap.h" +#include "GaudiKernel/ISvcLocator.h" +#include "GaudiKernel/SystemOfUnits.h" + +#include <iostream> + +// Constructor +VetoNuMaterialManager::VetoNuMaterialManager(VetoNuDataBase* db) +{ + // Get my material manager. + ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap + StoreGateSvc* detStore; + StatusCode sc = svcLocator->service("DetectorStore", detStore ); + if (sc.isFailure()) { + std::cout << "Could not locate DetectorStore" << std::endl; + return; + } + + m_materialManager = std::make_unique<ScintMaterialManager>("VetoNuMaterialManager", db->athenaComps()); + m_materialManager->addWeightTable(db->weightTable(), "veto"); + m_materialManager->addScalingTable(db->scalingTable()); + + loadMaterials(); + + m_gasMaterial = m_materialManager->getMaterial("std::Air"); +} + +// Add materials not yet in the database +void +VetoNuMaterialManager::loadMaterials() +{ +} + +const GeoElement* +VetoNuMaterialManager::getElement(const std::string & elementName) const +{ + return m_materialManager->getElement(elementName); +} + +const GeoMaterial* +VetoNuMaterialManager::getMaterial(const std::string & materialName) const +{ + return m_materialManager->getMaterial(materialName); +} + +void +VetoNuMaterialManager::addMaterial(GeoMaterial* material) +{ + return m_materialManager->addMaterial(material); +} + +const GeoMaterial* +VetoNuMaterialManager::getMaterial(const std::string & originalMaterial, + double density, + const std::string & newName) +{ + + return m_materialManager->getMaterial(originalMaterial, density, newName); +} + +const GeoMaterial * +VetoNuMaterialManager::getMaterialForVolume(const std::string & materialName, double volume) +{ + return m_materialManager->getMaterialForVolume(materialName, volume); +} + + + +const GeoMaterial* +VetoNuMaterialManager::gasMaterial() const +{ + return m_gasMaterial; +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuMaterialManager.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuMaterialManager.h new file mode 100644 index 0000000000000000000000000000000000000000..32f0ded52b1868e2b09b926d64d9bf3c6417dbff --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuMaterialManager.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VETONUMATERIALMANAGER_H +#define VETONUMATERIALMANAGER_H + +// VetoNuMaterialManager. This provides an interface to the ScintMaterialManager which in turn +// is an interface to GeoModel Material Manager with some additional functionality. +#include "ScintGeoModelUtils/ScintMaterialManager.h" + +#include <memory> +#include <string> + +class GeoMaterial; +class GeoElement; +class ScintMaterialManager; +class VetoNuDataBase; + +class VetoNuMaterialManager +{ + +public: + + VetoNuMaterialManager(VetoNuDataBase* db); + + const GeoMaterial* getMaterial(const std::string & materialName) const; + const GeoElement* getElement(const std::string & elementName) const; + + const GeoMaterial* getMaterial(const std::string & originalMaterial, + double density, + const std::string & newName = ""); + const GeoMaterial *getMaterialForVolume(const std::string & materialName, double volume); + + // Default gas material + const GeoMaterial* gasMaterial() const; + +private: + void loadMaterials(); + void addMaterial(GeoMaterial* material); + + std::unique_ptr<ScintMaterialManager> m_materialManager; + const GeoMaterial* m_gasMaterial; + +}; + + +#endif // VETONUMATERIALMANAGER_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuOptions.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuOptions.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0c63b320f4d5e2063e5047c4fa07a0ac1ebd011c --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuOptions.cxx @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuOptions.h" + +VetoNuOptions::VetoNuOptions() + : m_alignable(true) +// , m_alignModule(true) + , m_dynAlignFolders(false) +{} + +void +VetoNuOptions::setAlignable(bool flag) +{ + m_alignable = flag; +} + +bool +VetoNuOptions::alignable() const +{ + return m_alignable; +} + +// following may eventually become useful +// +// void +// SCT_Options::setAlignAtModuleLevel(bool flag) +// { +// m_alignModule = flag; +// } + +// bool +// SCT_Options::alignAtModuleLevel() const +// { +// return m_alignModule; +// } + +void VetoNuOptions::setDynamicAlignFolders(const bool flag) +{ + m_dynAlignFolders = flag; +} + +bool VetoNuOptions::dynamicAlignFolders() const +{ + return m_dynAlignFolders; +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuOptions.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuOptions.h new file mode 100644 index 0000000000000000000000000000000000000000..166ae9e6cb2116b3372b3d485e5b9df0f91402aa --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuOptions.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VetoNuGeoModel_VetoNuOptions_H +#define VetoNuGeoModel_VetoNuOptions_H + +// Class for any run time options. + + +class VetoNuOptions +{ + +public: + VetoNuOptions(); + bool alignable() const; +// bool alignAtModuleLevel() const; + + void setAlignable(bool flag = true); +// void setAlignAtModuleLevel(bool flag = true); + + //dynamic alignment folders + void setDynamicAlignFolders(const bool flag = true); + bool dynamicAlignFolders() const; + +private: + + bool m_alignable; +// bool m_alignModule; + bool m_dynAlignFolders; //controls which set of alignment folders is used + +}; + + +#endif // VetoNuGeoModel_VetoNuOptions_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlate.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlate.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e14c88cbe5cb09c886752d7be8d8a57c0dfbd836 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlate.cxx @@ -0,0 +1,117 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuPlate.h" + +#include "VetoNuGeometryManager.h" +#include "VetoNuMaterialManager.h" + +#include "VetoNuPlateParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" + +#include "ScintReadoutGeometry/VetoNuDetectorManager.h" +#include "ScintReadoutGeometry/ScintDetectorDesign.h" +#include "ScintReadoutGeometry/ScintDetectorElement.h" +#include "ScintReadoutGeometry/ScintDD_Defs.h" +#include "ScintReadoutGeometry/ScintCommonItems.h" + +#include "GaudiKernel/SystemOfUnits.h" + +using namespace ScintDD; + +VetoNuPlate::VetoNuPlate(const std::string & name, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials) + : VetoNuUniqueComponentFactory(name, detectorManager, geometryManager, materials), + m_noElementWarning{true} +{ + getParameters(); + m_logVolume = preBuild(); +} + + +void +VetoNuPlate::getParameters() +{ + + const VetoNuPlateParameters * parameters = m_geometryManager->plateParameters(); + m_material = m_materials->getMaterial(parameters->plateMaterial()); + m_thickness = parameters->plateThickness(); + m_length = parameters->plateLength(); + m_width = parameters->plateWidth(); + m_detectorManager->numerology().setNumPmtsPerPlate(parameters->platePmts()); +} + +const GeoLogVol * +VetoNuPlate::preBuild() +{ + + // Build the plate. Just a simple box. + // const GeoBox * plateShape = new GeoBox(0.5*m_thickness, 0.5*m_width, 0.5*m_length); + const GeoBox * plateShape = new GeoBox(0.5*m_width, 0.5*m_length, 0.5*m_thickness); + GeoLogVol * plateLog = new GeoLogVol(getName(), plateShape, m_material); + + // Make the scint design for this plate + makeDesign(); + + m_detectorManager->setDesign(m_design); + + return plateLog; +} + + +void +VetoNuPlate::makeDesign() +{ + //SiDetectorDesign::Axis etaAxis = SiDetectorDesign::zAxis; + //SiDetectorDesign::Axis phiAxis = SiDetectorDesign::yAxis; + //SiDetectorDesign::Axis depthAxis = SiDetectorDesign::xAxis; + + const VetoNuPlateParameters * parameters = m_geometryManager->plateParameters(); + + m_design = new ScintDetectorDesign(m_thickness, + m_length, + m_width, + parameters->platePmts()); +} + + + +GeoVPhysVol * +VetoNuPlate::build(VetoNuIdentifier id) +{ + GeoFullPhysVol * plate = new GeoFullPhysVol(m_logVolume); + + // Make detector element and add to collection + // Only do so if we have a valid id helper. + + //id.print(); // for debugging only + + const ScintCommonItems* commonItems = m_geometryManager->commonItems(); + + if (commonItems->getIdHelper()) { + + ScintDetectorElement * detElement; + + detElement = new ScintDetectorElement(id.getPlateId(), + m_design, + plate, + commonItems); + + // Add the detector element. + m_detectorManager->addDetectorElement(detElement); + + } else { + if (m_noElementWarning) { + std::cout << "WARNING!!!!: No VetoNu id helper and so no elements being produced." << std::endl; + m_noElementWarning = false; + } + } + return plate; +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlate.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlate.h new file mode 100644 index 0000000000000000000000000000000000000000..efc8638052c8dcb8c083d63584dccf649354d7ce --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlate.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VETONUGEOMODEL_VETONUPLATE_H +#define VETONUGEOMODEL_VETONUPLATE_H + +#include "VetoNuComponentFactory.h" + +#include <atomic> +#include <string> + +class GeoMaterial; +class GeoVPhysVol; +namespace ScintDD{class ScintDetectorDesign;} + +class VetoNuPlate: public VetoNuUniqueComponentFactory +{ +public: + VetoNuPlate(const std::string & name, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + + virtual GeoVPhysVol * build(VetoNuIdentifier id); + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + void makeDesign(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + + ScintDD::ScintDetectorDesign * m_design; + + mutable std::atomic_bool m_noElementWarning; +}; + +#endif // VETOGEOMODEL_VETOPLATE_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlateParameters.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlateParameters.cxx new file mode 100644 index 0000000000000000000000000000000000000000..121df4dcbc9c60ead0099ea05b22d9de56e78809 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlateParameters.cxx @@ -0,0 +1,52 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuPlateParameters.h" +#include "VetoNuGeometryManager.h" + +#include "VetoNuDataBase.h" + +#include "RDBAccessSvc/IRDBRecord.h" +#include "GaudiKernel/SystemOfUnits.h" + +#include <cmath> + + +VetoNuPlateParameters::VetoNuPlateParameters(VetoNuDataBase* rdb) +{ + m_rdb = rdb; +} + +// +// Plate General +// +int +VetoNuPlateParameters::platePmts() const +{ + return m_rdb->plateGeneral()->getInt("NUMPMTS"); +} + +double +VetoNuPlateParameters::plateWidth() const +{ + return m_rdb->plateGeneral()->getDouble("WIDTH") * Gaudi::Units::mm; +} + +double +VetoNuPlateParameters::plateLength() const +{ + return m_rdb->plateGeneral()->getDouble("LENGTH") * Gaudi::Units::mm; +} + +double +VetoNuPlateParameters::plateThickness() const +{ + return m_rdb->plateGeneral()->getDouble("THICKNESS") * Gaudi::Units::mm; +} + +std::string VetoNuPlateParameters::plateMaterial() const +{ + return m_rdb->plateGeneral()->getString("MATERIAL"); +} + diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlateParameters.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlateParameters.h new file mode 100644 index 0000000000000000000000000000000000000000..11ebd07129db93286277420b25c532d2cf51bbce --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuPlateParameters.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VetoNuGeoModel_VetoNuPlateParameters_H +#define VetoNuGeoModel_VetoNuPlateParameters_H + +#include <string> + +class VetoNuDataBase; + +class VetoNuPlateParameters { + +public: + + // Constructor + VetoNuPlateParameters(VetoNuDataBase* rdb); + + // Barrel General + int platePmts() const; + double plateThickness() const; + double plateWidth() const; + double plateLength() const; + std::string plateMaterial() const; + + private: + VetoNuDataBase * m_rdb; + +}; + + +#endif // VetoNuGeoModel_VetoNuPlateParameters_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiator.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiator.cxx new file mode 100644 index 0000000000000000000000000000000000000000..49a9fe83c78c883f968f020d38e942fcd53ffdbe --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiator.cxx @@ -0,0 +1,55 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuRadiator.h" + +#include "VetoNuMaterialManager.h" + +#include "VetoNuGeometryManager.h" +#include "VetoNuGeneralParameters.h" +#include "VetoNuRadiatorParameters.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoMaterial.h" + +VetoNuRadiator::VetoNuRadiator(const std::string & name, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials) + : VetoNuSharedComponentFactory(name, detectorManager, geometryManager, materials) +{ + getParameters(); + m_physVolume = build(); +} + +void +VetoNuRadiator::getParameters() +{ + const VetoNuRadiatorParameters * parameters = m_geometryManager->radiatorParameters(); + const VetoNuGeneralParameters* generalParameters = m_geometryManager->generalParameters(); + + m_material = m_materials->getMaterial(parameters->radiatorMaterial()); + m_safety = generalParameters->safety(); + m_thickness = parameters->radiatorThickness(); + m_width = parameters->radiatorWidth(); + m_length = parameters->radiatorLength(); +} + +GeoVPhysVol * +VetoNuRadiator::build() +{ + // Just a simple box. + const GeoBox * simpleRadiatorShape = new GeoBox(0.5*m_width, + 0.5*m_length, + 0.5*m_thickness); + + const GeoLogVol * simpleRadiatorLog = + new GeoLogVol(getName(), simpleRadiatorShape, m_material); + + GeoPhysVol * simpleRadiator = new GeoPhysVol(simpleRadiatorLog); + + return simpleRadiator; +} diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiator.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiator.h new file mode 100644 index 0000000000000000000000000000000000000000..5c25fcec17f21b848c1a7f9e3f41d2b396e77277 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiator.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VETONUGEOMODEL_VETONURADIATOR_H +#define VETONUGEOMODEL_VETONURADIATOR_H + +#include "VetoNuComponentFactory.h" + +class GeoVPhysVol; +class GeoFullPhysVol; +class GeoLogVol; +class GeoMaterial; + +class VetoNuRadiator : public VetoNuSharedComponentFactory +{ + +public: + VetoNuRadiator(const std::string & name, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials); + +public: + const GeoMaterial * material() const {return m_material;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + +private: + virtual GeoVPhysVol * build(); + void getParameters(); + + const GeoMaterial * m_material; + double m_thickness; + double m_width; + double m_length; + + double m_safety; +}; + +#endif // VETOGEOMODEL_VETORADIATOR_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiatorParameters.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiatorParameters.cxx new file mode 100644 index 0000000000000000000000000000000000000000..33391054eaba30e6fde505065921e3a2594cd0d2 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiatorParameters.cxx @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuRadiatorParameters.h" +#include "VetoNuGeometryManager.h" + +#include "VetoNuDataBase.h" + +#include "RDBAccessSvc/IRDBRecord.h" +#include "GaudiKernel/SystemOfUnits.h" + +#include <cmath> + + +VetoNuRadiatorParameters::VetoNuRadiatorParameters(VetoNuDataBase* rdb) +{ + m_rdb = rdb; +} + +// +// Radiator General +// +double +VetoNuRadiatorParameters::radiatorWidth() const +{ + return m_rdb->radiatorGeneral()->getDouble("WIDTH") * Gaudi::Units::mm; +} + +double +VetoNuRadiatorParameters::radiatorLength() const +{ + return m_rdb->radiatorGeneral()->getDouble("LENGTH") * Gaudi::Units::mm; +} + +double +VetoNuRadiatorParameters::radiatorThickness() const +{ + return m_rdb->radiatorGeneral()->getDouble("THICKNESS") * Gaudi::Units::mm; +} + +std::string VetoNuRadiatorParameters::radiatorMaterial() const +{ + return m_rdb->radiatorGeneral()->getString("MATERIAL"); +} + diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiatorParameters.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiatorParameters.h new file mode 100644 index 0000000000000000000000000000000000000000..eedd316d60e0c52a5b4f0b55640a5ddfea62f7b4 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuRadiatorParameters.h @@ -0,0 +1,31 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VetoNuGeoModel_VetoNuRadiatorParameters_H +#define VetoNuGeoModel_VetoNuRadiatorParameters_H + +#include <string> + +class VetoNuDataBase; + +class VetoNuRadiatorParameters { + +public: + + // Constructor + VetoNuRadiatorParameters(VetoNuDataBase* rdb); + + // Barrel General + double radiatorThickness() const; + double radiatorWidth() const; + double radiatorLength() const; + std::string radiatorMaterial() const; + + private: + VetoNuDataBase * m_rdb; + +}; + + +#endif // VetoNuGeoModel_VetoNuRadiatorParameters_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStation.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStation.cxx new file mode 100644 index 0000000000000000000000000000000000000000..65fb5fd7b80d4eb2af761723476d75259923af43 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStation.cxx @@ -0,0 +1,100 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuStation.h" + +#include "VetoNuMaterialManager.h" + +#include "VetoNuGeometryManager.h" +#include "VetoNuStationParameters.h" +#include "VetoNuGeneralParameters.h" +#include "VetoNuIdentifier.h" +#include "VetoNuPlate.h" + +#include "ScintReadoutGeometry/VetoNuDetectorManager.h" + +#include "ScintGeoModelUtils/ExtraMaterial.h" + +#include "GeoModelKernel/GeoBox.h" +#include "GeoModelKernel/GeoLogVol.h" +#include "GeoModelKernel/GeoFullPhysVol.h" +#include "GeoModelKernel/GeoPhysVol.h" +#include "GeoModelKernel/GeoNameTag.h" +#include "GeoModelKernel/GeoIdentifierTag.h" +#include "GeoModelKernel/GeoTransform.h" +#include "GeoModelKernel/GeoAlignableTransform.h" +#include "GeoModelKernel/GeoMaterial.h" +#include "GeoModelKernel/GeoShape.h" +#include "GeoModelKernel/GeoShapeShift.h" +#include "GaudiKernel/SystemOfUnits.h" + +#include <iostream> + +VetoNuStation::VetoNuStation(const std::string & name, + VetoNuPlate* plate, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials) + : VetoNuUniqueComponentFactory(name, detectorManager, geometryManager, materials), + m_plate { plate } +{ + getParameters(); + m_logVolume = preBuild(); +} + + +void +VetoNuStation::getParameters() +{ + const VetoNuStationParameters * parameters = m_geometryManager->stationParameters(); + + m_numPlates = parameters->numPlates(); + m_platePitch = parameters->platePitch(); + + const VetoNuGeneralParameters* generalParameters = m_geometryManager->generalParameters(); + m_safety = generalParameters->safety(); + + m_width = m_plate->width() + m_safety; + m_length = m_plate->length() + m_safety; + // pitch includes thickness of one plate + m_thickness = (m_numPlates - 1) * m_platePitch + m_plate->thickness() + m_safety; + + // Set numerology + m_detectorManager->numerology().setNumPlatesPerStation(m_numPlates); +} + +const GeoLogVol * +VetoNuStation::preBuild() +{ + // Create the station volume + // Box envelope containing the station. + const GeoBox* stationEnvelopeShape = new GeoBox(0.5 * m_width, 0.5 * m_length, 0.5 * m_thickness); + GeoLogVol* stationLog = new GeoLogVol(getName(), stationEnvelopeShape, m_materials->gasMaterial()); + return stationLog; +} + +GeoVPhysVol * +VetoNuStation::build(VetoNuIdentifier id) +{ + + GeoFullPhysVol * station = new GeoFullPhysVol(m_logVolume); + + double activeDepth = m_thickness - m_safety; + double plateThickness = m_plate->thickness(); + for (int iPlate = 0; iPlate < m_numPlates; iPlate++) + { + station->add(new GeoNameTag("Plate#"+intToString(iPlate))); + station->add(new GeoIdentifierTag(iPlate)); + id.setPlate(iPlate); + GeoAlignableTransform* transform = new GeoAlignableTransform(GeoTrf::Translate3D(0.0, + 0.0, + (plateThickness - activeDepth)/2 + iPlate * m_platePitch)); + station->add(transform); + GeoVPhysVol* platePV = m_plate->build(id); + station->add(platePV); + m_detectorManager->addAlignableTransform(0, id.getPlateId(), transform, platePV); + } + return station; +} + diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStation.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStation.h new file mode 100644 index 0000000000000000000000000000000000000000..50702df10006c6d767c929f68750b797c8fcae56 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStation.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VETONUGEOMODEL_VETONUSTATION_H +#define VETONUGEOMODEL_VETONUSTATION_H + +#include "VetoNuComponentFactory.h" + +class GeoVPhysVol; +class GeoFullPhysVol; +class GeoLogVol; +class VetoNuIdentifier; +class VetoNuPlate; + +class VetoNuStation : public VetoNuUniqueComponentFactory +{ + +public: + VetoNuStation(const std::string & name, + VetoNuPlate* plate, + ScintDD::VetoNuDetectorManager* detectorManager, + const VetoNuGeometryManager* geometryManager, + VetoNuMaterialManager* materials); + virtual GeoVPhysVol * build(VetoNuIdentifier id); + +public: + int numPlates() const {return m_numPlates;} + double platePitch() const {return m_platePitch;} + double thickness() const {return m_thickness;} + double width() const {return m_width;} + double length() const {return m_length;} + +private: + void getParameters(); + virtual const GeoLogVol * preBuild(); + + VetoNuPlate* m_plate; + + int m_numPlates; + double m_platePitch; + + double m_thickness; + double m_width; + double m_length; + + double m_safety; +}; + +#endif // VETONUGEOMODEL_VETONUSTATION_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStationParameters.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStationParameters.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9ec319eaa4377a7e5b58702f09b876d93c4752de --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStationParameters.cxx @@ -0,0 +1,872 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "VetoNuStationParameters.h" +#include "VetoNuGeometryManager.h" + +#include "VetoNuDataBase.h" + +#include "RDBAccessSvc/IRDBRecord.h" +#include "GaudiKernel/SystemOfUnits.h" + +#include <cmath> + + +VetoNuStationParameters::VetoNuStationParameters(VetoNuDataBase* rdb) +{ + m_rdb = rdb; +} + + +// // +// // Barrel Ski +// // +// int +// SCT_BarrelParameters::skiFirstStagger() const +// { +// return m_rdb->brlSki()->getInt("SKIFIRSTSTAGGER"); +// } + +// double +// SCT_BarrelParameters::skiRadialSep() const +// { +// return m_rdb->brlSki()->getDouble("SKIRADIALSEP") * Gaudi::Units::mm; +// } + +// int +// SCT_BarrelParameters::modulesPerSki() const +// { +// return m_rdb->brlSkiZSize(); +// } + +// double +// SCT_BarrelParameters::skiZPosition(int index) const +// { +// return m_rdb->brlSkiZ(index)->getDouble("ZPOSITION") * Gaudi::Units::mm; +// } + +// int +// SCT_BarrelParameters::skiModuleIdentifier(int index) const +// { +// return m_rdb->brlSkiZ(index)->getInt("MODULEID"); +// } + +// // +// // Barrel Layer +// // +// double +// SCT_BarrelParameters::tilt(int iLayer) const +// { +// return m_rdb->brlLayer(iLayer)->getDouble("TILT") * Gaudi::Units::degree; +// } + +// int +// SCT_BarrelParameters::layerStereoSign(int iLayer) const +// { +// return m_rdb->brlLayer(iLayer)->getInt("STEREOSIGN"); +// } + + +// double +// SCT_BarrelParameters::radius(int iLayer) const +// { +// return m_rdb->brlLayer(iLayer)->getDouble("RADIUS") * Gaudi::Units::mm; +// } + +// int +// SCT_BarrelParameters::skisPerLayer(int iLayer) const +// { +// return m_rdb->brlLayer(iLayer)->getInt("SKISPERLAYER"); +// } + +// double +// SCT_BarrelParameters::layerBracketPhiOffset(int iLayer) const +// { +// return m_rdb->brlLayer(iLayer)->getDouble("BRACKETPHIOFFSET") * Gaudi::Units::deg; +// } + +// double +// SCT_BarrelParameters::layerPhiOfRefModule(int iLayer) const +// { +// // For backward compatibility, if field is null return (90 - tilt) +// // as ref module is horizontal in old versions. +// if (m_rdb->brlLayer(iLayer)->isFieldNull("PHIOFREFMODULE")) { +// return 90*Gaudi::Units::deg - tilt(iLayer); +// } +// return m_rdb->brlLayer(iLayer)->getDouble("PHIOFREFMODULE") * Gaudi::Units::deg; +// } + + +// // +// // Barrel Bracket +// // +// double +// SCT_BarrelParameters::bracketThickness() const +// { +// return m_rdb->brlSki()->getDouble("BRACKETTHICKNESS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::bracketWidth() const +// { +// return m_rdb->brlSki()->getDouble("BRACKETWIDTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::bracketLength() const +// { +// return m_rdb->brlSki()->getDouble("BRACKETLENGTH") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::bracketMaterial() const +// { +// return m_rdb->brlSki()->getString("BRACKETMATERIAL"); +// } + +// // +// // Barrel Dogleg +// // +// double +// SCT_BarrelParameters::doglegThickness() const +// { +// return m_rdb->brlSki()->getDouble("DOGLEGTHICKNESS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::doglegWidth() const +// { +// return m_rdb->brlSki()->getDouble("DOGLEGWIDTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::doglegLength() const +// { +// return m_rdb->brlSki()->getDouble("DOGLEGLENGTH") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::doglegMaterial() const +// { +// return m_rdb->brlSki()->getString("DOGLEGMATERIAL"); +// } + +// double +// SCT_BarrelParameters::doglegOffsetX() const +// { +// return m_rdb->brlSki()->getDouble("DOGLEGOFFSETX") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::doglegOffsetY() const +// { +// return m_rdb->brlSki()->getDouble("DOGLEGOFFSETY") * Gaudi::Units::mm; +// } + +// // +// // Barrel CoolingBlock +// // +// double +// SCT_BarrelParameters::coolingBlockThickness() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGBLOCKTHICK") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::coolingBlockWidth() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGBLOCKWIDTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::coolingBlockLength() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGBLOCKLENGTH") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::coolingBlockMaterial() const +// { +// return m_rdb->brlSki()->getString("COOLINGBLOCKMATERIAL"); +// } + +// double +// SCT_BarrelParameters::coolingBlockOffsetX() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGBLOCKOFFSETX") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::coolingBlockOffsetY() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGBLOCKOFFSETY") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::coolingBlockOffsetZ() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGBLOCKOFFSETZ") * Gaudi::Units::mm; +// } + +// // +// // Barrel CoolingPipe +// // +// double +// SCT_BarrelParameters::coolingPipeRadius() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGPIPERADIUS") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::coolingPipeMaterial() const +// { +// return m_rdb->brlSki()->getString("COOLINGPIPEMATERIAL"); +// } + +// double +// SCT_BarrelParameters::coolingPipeOffsetX() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGPIPEOFFSETX") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::coolingPipeOffsetY() const +// { +// return m_rdb->brlSki()->getDouble("COOLINGPIPEOFFSETY") * Gaudi::Units::mm; +// } + + +// // +// // Barrel PowerTape +// // +// double +// SCT_BarrelParameters::powerTapeThickness() const +// { +// return m_rdb->brlSki()->getDouble("POWERTAPETHICKNESS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::powerTapeWidth() const +// { +// return m_rdb->brlSki()->getDouble("POWERTAPEWIDTH") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::powerTapeMaterial() const +// { +// return m_rdb->brlSki()->getString("POWERTAPEMATERIAL"); +// } + +// double +// SCT_BarrelParameters::powerTapeStartPointOffset() const +// { +// return m_rdb->brlSki()->getDouble("POWERTAPESTARTOFFSET") * Gaudi::Units::mm; +// } + +// // +// // Barrel Harness +// // +// double +// SCT_BarrelParameters::harnessThickness() const +// { +// return m_rdb->brlSki()->getDouble("HARNESSTHICKNESS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::harnessWidth() const +// { +// return m_rdb->brlSki()->getDouble("HARNESSWIDTH") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::harnessMaterial() const +// { +// return m_rdb->brlSki()->getString("HARNESSMATERIAL"); +// } + +// // +// // Barrel SupportCyl +// // +// double +// SCT_BarrelParameters::supportCylInnerRadius(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getDouble("SUPPORTCYLINNERRAD") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::supportCylOuterRadius(int iLayer) const +// { +// return supportCylInnerRadius(iLayer) + supportCylDeltaR(iLayer); +// } + +// double +// SCT_BarrelParameters::supportCylDeltaR(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getDouble("SUPPORTCYLDELTAR") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::supportCylMaterial(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getString("SUPPORTCYLMATERIAL"); +// } + + +// // +// // Barrel Flange +// // +// double +// SCT_BarrelParameters::flangeDeltaZ(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getDouble("FLANGEDELTAZ") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::flangeDeltaR(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getDouble("FLANGEDELTAR") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::flangeMaterial(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getString("FLANGEMATERIAL"); +// } + +// // +// // Barrel Clamp +// // +// double +// SCT_BarrelParameters::clampDeltaZ(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getDouble("CLAMPDELTAZ") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::clampDeltaR(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getDouble("CLAMPDELTAR") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::clampMaterial(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getString("CLAMPMATERIAL"); +// } + +// // +// // Barrel Cooling Inlet/outlets +// // +// double +// SCT_BarrelParameters::coolingEndDeltaR(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getDouble("COOLINGENDDELTAR") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::coolingEndMaterial(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getString("COOLINGENDMATERIAL"); +// } + +// // +// // Barrel CloseOut +// // +// double +// SCT_BarrelParameters::closeOutDeltaZ(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getDouble("CLOSEOUTDELTAZ") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::closeOutMaterial(int iLayer) const +// { +// return m_rdb->brlServPerLayer(iLayer)->getString("CLOSEOUTMATERIAL"); +// } + +// // +// // Barrel InterLink and B6 bearing +// // +// double +// SCT_BarrelParameters::interLinkDeltaZ() const +// { +// return m_rdb->brlServices()->getDouble("INTERLINKDELTAZ") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::interLinkInnerRadius() const +// { +// return m_rdb->brlServices()->getDouble("INTERLINKINNERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::interLinkOuterRadius() const +// { +// return m_rdb->brlServices()->getDouble("INTERLINKOUTERRADIUS") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::interLinkMaterial() const +// { +// return m_rdb->brlServices()->getString("INTERLINKMATERIAL"); +// } + +// double +// SCT_BarrelParameters::interLinkDeltaPhi() const +// { +// if (m_rdb->brlServices()->isFieldNull("INTERLINKDPHI")) { +// return 360.*Gaudi::Units::deg; +// } +// return m_rdb->brlServices()->getDouble("INTERLINKDPHI") * Gaudi::Units::deg; +// } + +// double +// SCT_BarrelParameters::interLinkPhiPos() const +// { +// if (m_rdb->brlServices()->isFieldNull("INTERLINKPHIPOS")) { +// return 0.; +// } +// return m_rdb->brlServices()->getDouble("INTERLINKPHIPOS") * Gaudi::Units::deg; +// } + +// int +// SCT_BarrelParameters::interLinkNRepeat() const +// { +// if (m_rdb->brlServices()->isFieldNull("INTERLINKNREPEAT")) { +// return 1; +// } +// return m_rdb->brlServices()->getInt("INTERLINKNREPEAT"); +// } + +// double +// SCT_BarrelParameters::bearingDeltaPhi() const +// { +// if (m_rdb->brlServices()->isFieldNull("BEARINGDPHI")) { +// return 0.; +// } +// return m_rdb->brlServices()->getDouble("BEARINGDPHI") * Gaudi::Units::deg; +// } + +// double +// SCT_BarrelParameters::bearingPhiPos() const +// { +// if (m_rdb->brlServices()->isFieldNull("BEARINGPHIPOS")) { +// return 0.; +// } +// return m_rdb->brlServices()->getDouble("BEARINGPHIPOS") * Gaudi::Units::deg; +// } + +// int +// SCT_BarrelParameters::bearingNRepeat() const +// { +// if (m_rdb->brlServices()->isFieldNull("BEARINGNREPEAT")) { +// return 0; +// } +// return m_rdb->brlServices()->getInt("BEARINGNREPEAT"); +// } + +// std::string +// SCT_BarrelParameters::bearingMaterial() const +// { +// if (m_rdb->brlServices()->isFieldNull("BEARINGMATERIAL")) { +// return " "; +// } +// return m_rdb->brlServices()->getString("BEARINGMATERIAL"); +// } + +// // +// // Barrel FSI and FSI flange +// // +// bool +// SCT_BarrelParameters::includeFSI() const +// { +// if (m_rdb->brlFSISize() > 0) {return true;} +// return false; +// } + +// double +// SCT_BarrelParameters::fsiFlangeInnerRadius() const +// { +// return m_rdb->brlFSI()->getDouble("FLANGEINNERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::fsiFlangeOuterRadius() const +// { +// return m_rdb->brlFSI()->getDouble("FLANGEOUTERRADIUS") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::fsiFlangeMaterial() const +// { +// return m_rdb->brlFSI()->getString("FLANGEMATERIAL"); +// } + +// double +// SCT_BarrelParameters::fsiFibreMaskDeltaR() const +// { +// return m_rdb->brlFSI()->getDouble("FIBREMASKDELTAR") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::fsiFibreMaskMaterial() const +// { +// return m_rdb->brlFSI()->getString("FIBREMASKMATERIAL"); +// } + +// double +// SCT_BarrelParameters::fsiEndJewelRadialWidth() const +// { +// return m_rdb->brlFSI()->getDouble("ENDJEWELRADIALWIDTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::fsiEndJewelRPhiWidth() const +// { +// return m_rdb->brlFSI()->getDouble("ENDJEWELRPHIWIDTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::fsiEndJewelLength() const +// { +// return m_rdb->brlFSI()->getDouble("ENDJEWELLENGTH") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::fsiEndJewelMaterial() const +// { +// return m_rdb->brlFSI()->getString("ENDJEWELMATERIAL"); +// } + +// int +// SCT_BarrelParameters::fsiEndJewelNRepeat(int iLayer) const +// { +// return m_rdb->brlFSILocation(iLayer)->getInt("ENDJEWELNREPEAT"); +// } + +// double +// SCT_BarrelParameters::fsiEndJewelPhi(int iLayer) const +// { +// return m_rdb->brlFSILocation(iLayer)->getDouble("ENDJEWELPHI") * Gaudi::Units::degree; +// } + +// double +// SCT_BarrelParameters::fsiEndJewelZ(int iLayer) const +// { +// return m_rdb->brlFSILocation(iLayer)->getDouble("ENDJEWELZ") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::fsiScorpionRadialWidth() const +// { +// return m_rdb->brlFSI()->getDouble("SCORPIONRADIALWIDTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::fsiScorpionRPhiWidth() const +// { +// return m_rdb->brlFSI()->getDouble("SCORPIONRPHIWIDTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::fsiScorpionLength() const +// { +// return m_rdb->brlFSI()->getDouble("SCORPIONLENGTH") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::fsiScorpionMaterial() const +// { +// return m_rdb->brlFSI()->getString("SCORPIONMATERIAL"); +// } + +// int +// SCT_BarrelParameters::fsiScorpionNRepeat(int iLayer) const +// { +// return m_rdb->brlFSILocation(iLayer)->getInt("SCORPIONNREPEAT"); +// } + +// double +// SCT_BarrelParameters::fsiScorpionPhi(int iLayer) const +// { +// return m_rdb->brlFSILocation(iLayer)->getDouble("SCORPIONPHI") * Gaudi::Units::degree; +// } + +// double +// SCT_BarrelParameters::fsiScorpionZ(int iLayer) const +// { +// return m_rdb->brlFSILocation(iLayer)->getDouble("SCORPIONZ") * Gaudi::Units::mm; +// } + + +// // +// // Barrel Cooling Spider +// // +// double +// SCT_BarrelParameters::spiderDeltaZ() const +// { +// return m_rdb->brlServices()->getDouble("SPIDERDELTAZ") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::spiderInnerRadius() const +// { +// return m_rdb->brlServices()->getDouble("SPIDERINNERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::spiderOuterRadius() const +// { +// return m_rdb->brlServices()->getDouble("SPIDEROUTERRADIUS") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::spiderMaterial() const +// { +// return m_rdb->brlServices()->getString("SPIDERMATERIAL"); +// } + +// // +// // Barrel Thermal Shield +// // +// double +// SCT_BarrelParameters::thermalShieldInnerRadius() const +// { +// return m_rdb->brlThermalShield()->getDouble("INNERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldOuterRadius() const +// { +// return m_rdb->brlThermalShield()->getDouble("OUTERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldEndZMax() const +// { +// return m_rdb->brlThermalShield()->getDouble("ENDZMAX") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldCylTotalThickness() const +// { +// return m_rdb->brlThermalShield()->getDouble("CYLTOTALTHICKNESS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldCylInnerWallThickness() const +// { +// return m_rdb->brlThermalShield()->getDouble("CYLINNERWALLTHICK") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldCylOuterWallThickness() const +// { +// return m_rdb->brlThermalShield()->getDouble("CYLOUTERWALLTHICK") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldSpacerZWidth() const +// { +// return m_rdb->brlThermalShield()->getDouble("SPACERZWIDTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldFirstSpacerZMin() const +// { +// return m_rdb->brlThermalShield()->getDouble("FIRSTSPACERZMIN") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldEndCapCylThickness() const +// { +// return m_rdb->brlThermalShield()->getDouble("ENDCAPCYLTHICKNESS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldEndCapThickness() const +// { +// return m_rdb->brlThermalShield()->getDouble("ENDCAPTHICKNESS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldBulkheadInnerRadius() const +// { +// return m_rdb->brlThermalShield()->getDouble("BULKHEADINNERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldBulkheadOuterRadius() const +// { +// return m_rdb->brlThermalShield()->getDouble("BULKHEADOUTERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldEndPanelInnerRadius() const +// { +// return m_rdb->brlThermalShield()->getDouble("ENDPANELINNERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::thermalShieldEndPanelOuterRadius() const +// { +// return m_rdb->brlThermalShield()->getDouble("ENDPANELOUTERRADIUS") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::thermalShieldMaterialSpacer() const +// { +// return m_rdb->brlThermalShield()->getString("MATERIALSPACER"); +// } + +// std::string +// SCT_BarrelParameters::thermalShieldMaterialCyl() const +// { +// return m_rdb->brlThermalShield()->getString("MATERIALCYL"); +// } + +// std::string +// SCT_BarrelParameters::thermalShieldMaterialOuterSect() const +// { +// return m_rdb->brlThermalShield()->getString("MATERIALOUTERSECT"); +// } + +// std::string +// SCT_BarrelParameters::thermalShieldMaterialInnerSect() const +// { +// return m_rdb->brlThermalShield()->getString("MATERIALINNERSECT"); +// } + +// // +// // Barrel EMI Shield +// // +// double +// SCT_BarrelParameters::emiShieldInnerRadius() const +// { +// return m_rdb->brlServices()->getDouble("EMIINNERRADIUS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::emiShieldDeltaR() const +// { +// return m_rdb->brlServices()->getDouble("EMIDELTAR") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::emiShieldZMax() const +// { +// return m_rdb->brlServices()->getDouble("EMIZMAX") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::emiShieldMaterial() const +// { +// return m_rdb->brlServices()->getString("EMIMATERIAL"); +// } + +// double +// SCT_BarrelParameters::emiJointDeltaR() const +// { +// return m_rdb->brlServices()->getDouble("EMIJOINTDELTAR") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::emiJointRPhi() const +// { +// return m_rdb->brlServices()->getDouble("EMIJOINTRPHI") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::emiJointMaterial() const +// { +// return m_rdb->brlServices()->getString("EMIJOINTMATERIAL"); +// } + + + +// // +// // Attachment of pixel to SCT. +// // +// double +// SCT_BarrelParameters::pixelAttachmentInnerRadius() const +// { +// return m_rdb->brlServices()->getDouble("PIXELATTACHINNERRAD") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::pixelAttachmentOuterRadius() const +// { +// return m_rdb->brlServices()->getDouble("PIXELATTACHOUTERRAD") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::pixelAttachmentZMin() const +// { +// return m_rdb->brlServices()->getDouble("PIXELATTACHZMIN") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::pixelAttachmentDeltaZ() const +// { +// return m_rdb->brlServices()->getDouble("PIXELATTACHDELTAZ") * Gaudi::Units::mm; +// } + +// std::string +// SCT_BarrelParameters::pixelAttachmentMaterial() const +// { +// return m_rdb->brlServices()->getString("PIXELATTACHMATERIAL"); +// } + +// +// Barrel General +// +int +VetoNuStationParameters::numPlates() const +{ + return m_rdb->stationGeneral()->getInt("NUMPLATES"); +} + +double +VetoNuStationParameters::platePitch() const +{ + return m_rdb->stationGeneral()->getDouble("PLATEPITCH"); +} + +// double +// VetoNuStationParameters::stationWidth() const +// { +// return m_rdb->stationGeneral()->getDouble("WIDTH") * Gaudi::Units::mm; +// } + +// double +// VetoNuStationParameters::stationLength() const +// { +// return m_rdb->stationGeneral()->getDouble("LENGTH") * Gaudi::Units::mm; +// } + +// double +// VetoNuStationParameters::stationThickness() const +// { +// return m_rdb->stationGeneral()->getDouble("THICKNESS") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::cylinderLength() const +// { +// return m_rdb->brlGeneral()->getDouble("CYLINDERLENGTH") * Gaudi::Units::mm; +// } + +// double +// SCT_BarrelParameters::activeLength() const +// { +// return m_rdb->brlGeneral()->getDouble("ACTIVELENGTH") * Gaudi::Units::mm; +// } + +// bool +// SCT_BarrelParameters::isOldGeometry() const +// { +// if (m_rdb->brlGeneral()->isFieldNull("CYLINDERLENGTH")) {return true;} +// return false; +// } + diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStationParameters.h b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStationParameters.h new file mode 100644 index 0000000000000000000000000000000000000000..843b6095e29ff703ab1605e1c8eb66cdd114f635 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/VetoNuStationParameters.h @@ -0,0 +1,30 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef VetoNuGeoModel_VetoNuStationParameters_H +#define VetoNuGeoModel_VetoNuStationParameters_H + +#include <string> + +class VetoNuDataBase; + +class VetoNuStationParameters { + +public: + + // Constructor + VetoNuStationParameters(VetoNuDataBase* rdb); + + + // General + int numPlates() const; + double platePitch() const; + + private: + VetoNuDataBase * m_rdb; + +}; + + +#endif // VetoNuGeoModel_VetoNuStationParameters_H diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/src/components/VetoNuGeoModel_entries.cxx b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/components/VetoNuGeoModel_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..cc2cd2581e8954fa96943ded066d9e6f5cb15544 --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/src/components/VetoNuGeoModel_entries.cxx @@ -0,0 +1,3 @@ +#include "VetoNuGeoModel/VetoNuDetectorTool.h" + +DECLARE_COMPONENT( VetoNuDetectorTool ) \ No newline at end of file diff --git a/Scintillator/ScintDetDescr/VetoNuGeoModel/test/VetoNuGMConfig_test.py b/Scintillator/ScintDetDescr/VetoNuGeoModel/test/VetoNuGMConfig_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8a8bca5989485cfa7c046e244e966d8d00c0d85f --- /dev/null +++ b/Scintillator/ScintDetDescr/VetoNuGeoModel/test/VetoNuGMConfig_test.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Run tests on VetoNuGeoModel 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-FASER-01" # Always needed; must match FaserVersion + ConfigFlags.GeoModel.Align.Dynamic = False + ConfigFlags.lock() + + from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + from VetoNuGeoModel.VetoNuGeoModelConfig import VetoNuGeometryCfg + acc = VetoNuGeometryCfg(ConfigFlags) + f=open('VetoNuGeometryCfg.pkl','wb') + acc.store(f) + f.close() diff --git a/Scintillator/ScintG4/VetoNuG4_SD/CMakeLists.txt b/Scintillator/ScintG4/VetoNuG4_SD/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..eb9aab190b1ea05e06536d8f0477d6909a0f8499 --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/CMakeLists.txt @@ -0,0 +1,22 @@ +################################################################################ +# Package: VetoNuG4_SD +################################################################################ + +# Declare the package name: +atlas_subdir( VetoNuG4_SD ) + +# External dependencies: +find_package( CLHEP ) +find_package( Geant4 ) +find_package( XercesC ) + +# Component(s) in the package: +atlas_add_component( VetoNuG4_SD + src/*.cxx + src/components/*.cxx + INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} StoreGateLib SGtests GaudiKernel ScintSimEvent G4AtlasToolsLib FaserMCTruth ) + +# Install files from the package: +atlas_install_python_modules( python/*.py ) + diff --git a/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDConfig.py b/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..053b12e58099026922369886fb8f4f22575733c2 --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDConfig.py @@ -0,0 +1,22 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from ISF_Algorithms.collection_merger_helpersNew import CollectionMergerCfg + +VetoNuSensorSDTool=CompFactory.VetoNuSensorSDTool + +def getVetoNuSensorSD(ConfigFlags, name="VetoNuSensorSD", **kwargs): + + result = ComponentAccumulator() + bare_collection_name = "VetoNuHits" + mergeable_collection_suffix = "_G4" + merger_input_property = "VetoNuHits" + + acc, hits_collection_name = CollectionMergerCfg(ConfigFlags, bare_collection_name, mergeable_collection_suffix, merger_input_property) + kwargs.setdefault("LogicalVolumeNames", ["VetoNu::Plate"]) + kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) + + result.merge(acc) + return result, VetoNuSensorSDTool(name, **kwargs) + diff --git a/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDConfigDb.py b/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDConfigDb.py new file mode 100644 index 0000000000000000000000000000000000000000..5909581e180436c7d1505a0581c5244155993ef4 --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDConfigDb.py @@ -0,0 +1,5 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.CfgGetter import addTool + +addTool("VetoNuG4_SD.VetoNuG4_SDConfig.getVetoNuSensorSD" , "VetoNuSensorSD" ) diff --git a/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDToolConfig.py b/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDToolConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..8ea87d4239aa26a87481f39918dd59f8665508c8 --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/python/VetoNuG4_SDToolConfig.py @@ -0,0 +1,24 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +# from ISF_Algorithms.collection_merger_helpersNew import CollectionMergerCfg + +VetoNuSensorSDTool=CompFactory.VetoNuSensorSDTool + +def VetoNuSensorSDCfg(ConfigFlags, name="VetoNuSensorSD", **kwargs): + + result = ComponentAccumulator() + bare_collection_name = "VetoNuHits" + # mergeable_collection_suffix = "_G4" + # merger_input_property = "VetoNuHits" + + # acc, hits_collection_name = CollectionMergerCfg(ConfigFlags, bare_collection_name, mergeable_collection_suffix, merger_input_property, 'SCINT') + # kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) + kwargs.setdefault("LogicalVolumeNames", ["VetoNu::Plate"]) + kwargs.setdefault("OutputCollectionNames", [bare_collection_name]) + + result = ComponentAccumulator() + result.setPrivateTools(CompFactory.VetoNuSensorSDTool(name, **kwargs)) + return result + diff --git a/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSD.cxx b/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSD.cxx new file mode 100644 index 0000000000000000000000000000000000000000..85587985abcde4886e642fdf0ef72fe832e9160f --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSD.cxx @@ -0,0 +1,116 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// +// VetoNu Sensitive Detector. +// The Hits are processed here. For every hit I get the position and +// an information on the sensor in which the interaction happened +// + +// class headers +#include "VetoNuSensorSD.h" + +// athena includes +#include "FaserMCTruth/FaserTrackHelper.h" + +// Geant4 includes +#include "G4Step.hh" +#include "G4ThreeVector.hh" +#include "G4SDManager.hh" +#include "G4Geantino.hh" +#include "G4ChargedGeantino.hh" + +// CLHEP transform +#include "CLHEP/Geometry/Transform3D.h" + +#include <memory> // For make unique + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +VetoNuSensorSD::VetoNuSensorSD( const std::string& name, const std::string& hitCollectionName ) + : G4VSensitiveDetector( name ) + , m_HitColl( hitCollectionName ) +{ +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void VetoNuSensorSD::Initialize(G4HCofThisEvent *) +{ + if (!m_HitColl.isValid()) m_HitColl = std::make_unique<ScintHitCollection>(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4bool VetoNuSensorSD::ProcessHits(G4Step* aStep, G4TouchableHistory* /*ROhist*/) +{ + double edep = aStep->GetTotalEnergyDeposit(); + if(edep==0.) { + if(aStep->GetTrack()->GetDefinition()!=G4Geantino::GeantinoDefinition() && + aStep->GetTrack()->GetDefinition()!=G4ChargedGeantino::ChargedGeantinoDefinition()) + return false; + } + edep *= CLHEP::MeV; + // + // Get the Touchable History: + // + const G4TouchableHistory *myTouch = dynamic_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable()); + // + // Get the hit coordinates. Start and End Point + // + G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition(); + G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition(); + // + // Calculate the local step begin and end position. + // From a G4 FAQ: + // http://geant4-hn.slac.stanford.edu:5090/HyperNews/public/get/geometry/17/1.html + // + const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform(); + G4ThreeVector localPosition1 = transformation.TransformPoint(coord1); + G4ThreeVector localPosition2 = transformation.TransformPoint(coord2); + // + // Get it into a vector in local coords and with the right units: + // + HepGeom::Point3D<double> lP1,lP2; + + // No funny business with coordinates like ATLAS... + lP1[2] = localPosition1[2]*CLHEP::mm; + lP1[1] = localPosition1[1]*CLHEP::mm; + lP1[0] = localPosition1[0]*CLHEP::mm; + + lP2[2] = localPosition2[2]*CLHEP::mm; + lP2[1] = localPosition2[1]*CLHEP::mm; + lP2[0] = localPosition2[0]*CLHEP::mm; + + // Now Navigate the history to know in what detector the step is: + // and finally set the ID of det element in which the hit is. + // + //G4int History; + // + // Get station and plate + // + int station = 0; + int plate = 0; + this->indexMethod(myTouch, station, plate); + // get the HepMcParticleLink from the TrackHelper + FaserTrackHelper trHelp(aStep->GetTrack()); + m_HitColl->Emplace(lP1, + lP2, + edep, + aStep->GetPreStepPoint()->GetGlobalTime(),//use the global time. i.e. the time from the beginning of the event + trHelp.GetParticleLink(), + 3,station,plate); + return true; +} + +void VetoNuSensorSD::indexMethod(const G4TouchableHistory *myTouch, + int &station, int &plate) { + + + plate = myTouch->GetVolume()->GetCopyNo(); + const std::string stationName = myTouch->GetVolume(1)->GetLogicalVolume()->GetName(); + station = (stationName == "VetoNu::VetoNuStationA" ? 0 : 1 ); + + return; +} diff --git a/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSD.h b/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSD.h new file mode 100644 index 0000000000000000000000000000000000000000..478121ccd5a3c27a19ee200153bc290a872ff1b6 --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSD.h @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +/**************************************************************** + VetoNu Sensitive Detector class +****************************************************************/ + +#ifndef VETONUG4_SD_VETONUSENSORSD_H +#define VETONUG4_SD_VETONUSENSORSD_H + +// Base class +#include "G4VSensitiveDetector.hh" + +// For the hits +#include "ScintSimEvent/ScintHitCollection.h" +#include "StoreGate/WriteHandle.h" + +// G4 needed classes +class G4Step; +class G4TouchableHistory; + +class VetoNuSensorSD : public G4VSensitiveDetector +{ +public: + // Constructor + VetoNuSensorSD(const std::string& name, const std::string& hitCollectionName); + + // Destructor + ~VetoNuSensorSD() { /* If all goes well we do not own myHitColl here */ } + + // Deal with each G4 hit + G4bool ProcessHits(G4Step*, G4TouchableHistory*) override; + + // For setting up the hit collection + void Initialize(G4HCofThisEvent*) override final; + + /** Templated method to stuff a single hit into the sensitive detector class. This + could get rather tricky, but the idea is to allow fast simulations to use the very + same SD classes as the standard simulation. */ + template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); } + +private: + void indexMethod(const G4TouchableHistory *myTouch, int &station, int &plate); +protected: + // The hits collection + SG::WriteHandle<ScintHitCollection> m_HitColl; +}; + +#endif //VETONUG4_SD_VETONUSENSORSD_H diff --git a/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSDTool.cxx b/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSDTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6f3a6f5a693e2fd25e42bf58121d79cc91de310f --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSDTool.cxx @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// VetoNu Sensitive Detector Tool. +// + +// class header +#include "VetoNuSensorSDTool.h" + +// package includes +#include "VetoNuSensorSD.h" + +// STL includes +#include <exception> + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +VetoNuSensorSDTool::VetoNuSensorSDTool(const std::string& type, const std::string& name, const IInterface* parent) + : SensitiveDetectorBase( type , name , parent ) +{ + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4VSensitiveDetector* VetoNuSensorSDTool::makeSD() const +{ + ATH_MSG_DEBUG( "Creating VetoNu SD: " << name() ); + return new VetoNuSensorSD(name(), m_outputCollectionNames[0]); +} + diff --git a/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSDTool.h b/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSDTool.h new file mode 100644 index 0000000000000000000000000000000000000000..073a7cd07a136376d97e8b1361a9a4fc252a23d4 --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/src/VetoNuSensorSDTool.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/**************************************************************** + VetoNu Sensitive Detector Tool + ****************************************************************/ + +#ifndef VETONUG4_SD_VETONUSENSORSDTOOL_H +#define VETONUG4_SD_VETONUSENSORSDTOOL_H + +// Base class +#include "G4AtlasTools/SensitiveDetectorBase.h" + +// STL headers +#include <string> + +class G4VSensitiveDetector; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... + +class VetoNuSensorSDTool : public SensitiveDetectorBase +{ + public: + // Constructor + VetoNuSensorSDTool(const std::string& type, const std::string& name, const IInterface *parent); + + // Destructor + ~VetoNuSensorSDTool() { /* If all goes well we do not own myHitColl here */ } + +protected: + // Make me an SD! + G4VSensitiveDetector* makeSD() const override final; +}; + +#endif //VETOG4_SD_VETOSENSORSDTOOL_H diff --git a/Scintillator/ScintG4/VetoNuG4_SD/src/components/VetoNuG4_SD_entries.cxx b/Scintillator/ScintG4/VetoNuG4_SD/src/components/VetoNuG4_SD_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5ae057c14079dc0241808a300e4487ec3638d53d --- /dev/null +++ b/Scintillator/ScintG4/VetoNuG4_SD/src/components/VetoNuG4_SD_entries.cxx @@ -0,0 +1,3 @@ +#include "../VetoNuSensorSDTool.h" + +DECLARE_COMPONENT( VetoNuSensorSDTool ) diff --git a/Scintillator/ScintSimEvent/ScintSimEvent/ScintHit.h b/Scintillator/ScintSimEvent/ScintSimEvent/ScintHit.h index 5a0a4d17282cc234c09b697cdee2c028480a2b96..a2e02b596f4485d330a24ae6a5190832c9f0fa24 100644 --- a/Scintillator/ScintSimEvent/ScintSimEvent/ScintHit.h +++ b/Scintillator/ScintSimEvent/ScintSimEvent/ScintHit.h @@ -106,6 +106,7 @@ public: bool isVeto() const; bool isTrigger() const; bool isPreshower() const; + bool isVetoNu() const; // Station int getStation() const; diff --git a/Scintillator/ScintSimEvent/ScintSimEvent/ScintHitIdHelper.h b/Scintillator/ScintSimEvent/ScintSimEvent/ScintHitIdHelper.h index 233acb37e9a01ff47d8e3f93924e473eebe37f62..a8740bf0f779f74f89f427b3b3458dbe275d4398 100644 --- a/Scintillator/ScintSimEvent/ScintSimEvent/ScintHitIdHelper.h +++ b/Scintillator/ScintSimEvent/ScintSimEvent/ScintHitIdHelper.h @@ -28,6 +28,7 @@ #include "ScintIdentifier/VetoID.h" #include "ScintIdentifier/TriggerID.h" #include "ScintIdentifier/PreshowerID.h" +#include "ScintIdentifier/VetoNuID.h" #include "Identifier/Identifier.h" @@ -45,6 +46,7 @@ class ScintHitIdHelper : HitIdHelper { bool isVeto(const int& hid) const; bool isTrigger(const int& hid) const; bool isPreshower(const int& hid) const; + bool isVetoNu(const int& hid) const; // Barrel or Endcap int getStation(const int& hid) const; @@ -71,6 +73,7 @@ class ScintHitIdHelper : HitIdHelper { const VetoID* m_vetoID{nullptr}; const TriggerID* m_triggerID{nullptr}; const PreshowerID* m_preshowerID{nullptr}; + const VetoNuID* m_vetoNuID{nullptr}; }; diff --git a/Scintillator/ScintSimEvent/src/ScintHit.cxx b/Scintillator/ScintSimEvent/src/ScintHit.cxx index 2ef1cfd9b1361c75183fd1e399ffa31e453604db..3f5506ed8af50ea471fbba91e8d5c674ab803648 100644 --- a/Scintillator/ScintSimEvent/src/ScintHit.cxx +++ b/Scintillator/ScintSimEvent/src/ScintHit.cxx @@ -138,6 +138,10 @@ bool ScintHit::isPreshower() const { return ScintHitIdHelper::GetHelper()->isPreshower(m_ID); } +bool ScintHit::isVetoNu() const { + return ScintHitIdHelper::GetHelper()->isVetoNu(m_ID); +} + HepGeom::Point3D<double> ScintHit::localStartPosition() const { return HepGeom::Point3D<double>((double) m_stX, (double) m_stY, (double) m_stZ); @@ -162,7 +166,9 @@ void ScintHit::print() const { } else if (isTrigger()) { std::cout << "*** Trigger Hit " << std::endl; } else if (isPreshower()) { - std::cout << "*** Preshower Hit " << std::endl; + std::cout << "*** Preshower Hit " << std::endl; + } else if (isVetoNu()) { + std::cout << "*** VetoNu Hit " << std::endl; } else { std::cout << "*** Unrecognized Scintillator Hit " << std::endl; } diff --git a/Scintillator/ScintSimEvent/src/ScintHitIdHelper.cxx b/Scintillator/ScintSimEvent/src/ScintHitIdHelper.cxx index 5f115d47109690e545267e6cbc561fc5b8e7afdf..52b0faa99ce77f29913d1f94de525becce3d450f 100644 --- a/Scintillator/ScintSimEvent/src/ScintHitIdHelper.cxx +++ b/Scintillator/ScintSimEvent/src/ScintHitIdHelper.cxx @@ -40,15 +40,15 @@ void ScintHitIdHelper::Initialize() { // determine whether hits were created with an SLHC dictionary // in which case eta module field is expanded. // Need to lock this thread-unsafe retrieval - const VetoID* pix; ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "ScitHitIdHelper"); if (detStore.retrieve().isSuccess()) { if (detStore->retrieve(m_vetoID, "VetoID").isFailure()) { m_vetoID = 0; } + if (detStore->retrieve(m_vetoNuID, "VetoNuID").isFailure()) { m_vetoNuID = 0; } if (detStore->retrieve(m_triggerID, "TriggerID").isFailure()) { m_triggerID = 0; } if (detStore->retrieve(m_preshowerID, "PreshowerID").isFailure()) { m_preshowerID = 0; } } - InitializeField("VetoTriggerPreshower", 0, 2); + InitializeField("VetoTriggerPreshower", 0, 3); InitializeField("Station", -2, 2); InitializeField("Plate", 0, 4); } @@ -62,6 +62,13 @@ bool ScintHitIdHelper::isVeto(const int& hid) const else return false; } +bool ScintHitIdHelper::isVetoNu(const int& hid) const +{ + int ps = this->GetFieldValue("VetoTriggerPreshower", hid); + if ( ps == 3 ) return true; + else return false; +} + bool ScintHitIdHelper::isTrigger(const int& hid) const { int ps = this->GetFieldValue("VetoTriggerPreshower", hid); @@ -98,6 +105,8 @@ Identifier ScintHitIdHelper::getIdentifier(const int& hid) const return m_triggerID->pmt_id(getStation(hid), getPlate(hid), 0); } else if (isPreshower(hid)) { return m_preshowerID->pmt_id(getStation(hid), getPlate(hid), 0); + } else if (isVetoNu(hid)) { + return m_vetoNuID->pmt_id(getStation(hid), getPlate(hid), 0); } return Identifier(); } diff --git a/Simulation/G4Faser/G4FaserAlg/CMakeLists.txt b/Simulation/G4Faser/G4FaserAlg/CMakeLists.txt index dbd7917dbf989e1db8456a1ec6e929b7886d715d..35042d814e913677a0ddf4d643e792a75b362f2d 100644 --- a/Simulation/G4Faser/G4FaserAlg/CMakeLists.txt +++ b/Simulation/G4Faser/G4FaserAlg/CMakeLists.txt @@ -32,7 +32,7 @@ atlas_add_test( G4FaserAlgConfig_TestFaser PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) atlas_add_test( G4FaserAlgConfig_TestFaserNu - SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/G4FaserAlgConfigNew_Test.py GeoModel.FaserVersion="'FASERNU-02'" IOVDb.GlobalTag="'OFLCOND-FASER-02'" Output.HITSFileName='faserNu.HITS.pool.root' + SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/G4FaserAlgConfigNew_Test.py GeoModel.FaserVersion="'FASERNU-03'" IOVDb.GlobalTag="'OFLCOND-FASER-02'" Output.HITSFileName='faserNu.HITS.pool.root' PROPERTIES TIMEOUT 300 PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) diff --git a/Simulation/G4Faser/G4FaserAlg/python/G4FaserAlgConfigNew.py b/Simulation/G4Faser/G4FaserAlg/python/G4FaserAlgConfigNew.py index 82c35779d0225b979cf8d04c2f3b20bd17f5f930..e4b9721c03c8d697e101de48f9e279022051d7fb 100644 --- a/Simulation/G4Faser/G4FaserAlg/python/G4FaserAlgConfigNew.py +++ b/Simulation/G4Faser/G4FaserAlg/python/G4FaserAlgConfigNew.py @@ -125,6 +125,9 @@ def G4FaserAlgOutputCfg(ConfigFlags): if ConfigFlags.Detector.EnableVeto: ItemList += ["ScintHitCollection#VetoHits"] + if ConfigFlags.Detector.EnableVetoNu: + ItemList += ["ScintHitCollection#VetoNuHits"] + if ConfigFlags.Detector.EnableTrigger: ItemList += ["ScintHitCollection#TriggerHits"] diff --git a/Simulation/G4Faser/G4FaserAlg/test/G4FaserAlgConfigNew_Test.py b/Simulation/G4Faser/G4FaserAlg/test/G4FaserAlgConfigNew_Test.py index 3b1aac71e96914107c58558ae96a11eb2c4f7340..0caf7f3fe8083eacf42ce9e5a720637a36509899 100644 --- a/Simulation/G4Faser/G4FaserAlg/test/G4FaserAlgConfigNew_Test.py +++ b/Simulation/G4Faser/G4FaserAlg/test/G4FaserAlgConfigNew_Test.py @@ -46,7 +46,7 @@ if __name__ == '__main__': ConfigFlags.addFlag("Sim.Beam.xangle", 0) # Potential beam crossing angles ConfigFlags.addFlag("Sim.Beam.yangle", 0) - ConfigFlags.GeoModel.FaserVersion = "FASERNU-02" # Geometry set-up + ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Geometry set-up ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Conditions set-up ConfigFlags.addFlag("Input.InitialTimeStamp", 0) # To avoid autoconfig ConfigFlags.GeoModel.Align.Dynamic = False @@ -72,6 +72,8 @@ if __name__ == '__main__': detectors += ['Trigger', 'Dipole'] if ConfigFlags.GeoModel.FaserVersion.count("FASERNU") > 0 : detectors += ['Emulsion'] + if ConfigFlags.GeoModel.FaserVersion.count("FASERNU-03") > 0: + detectors += ['VetoNu', 'Trench'] # # Setup detector flags # diff --git a/Simulation/G4Faser/G4FaserTools/python/G4FaserToolsConfigNew.py b/Simulation/G4Faser/G4FaserTools/python/G4FaserToolsConfigNew.py index f4bb4333d7b62b77b377663d9181e30e64b9f2f8..8f01d6b15fca1ff7a591132160aed2a2e31ff283 100644 --- a/Simulation/G4Faser/G4FaserTools/python/G4FaserToolsConfigNew.py +++ b/Simulation/G4Faser/G4FaserTools/python/G4FaserToolsConfigNew.py @@ -50,6 +50,9 @@ def ScintSensitiveDetectorListCfg(ConfigFlags): if ConfigFlags.Detector.EnableVeto: from VetoG4_SD.VetoG4_SDToolConfig import VetoSensorSDCfg tools += [ result.popToolsAndMerge(VetoSensorSDCfg(ConfigFlags)) ] + if ConfigFlags.Detector.EnableVetoNu: + from VetoNuG4_SD.VetoNuG4_SDToolConfig import VetoNuSensorSDCfg + tools += [ result.popToolsAndMerge(VetoNuSensorSDCfg(ConfigFlags)) ] if ConfigFlags.Detector.EnableTrigger: from TriggerG4_SD.TriggerG4_SDToolConfig import TriggerSensorSDCfg tools += [ result.popToolsAndMerge(TriggerSensorSDCfg(ConfigFlags)) ] diff --git a/Simulation/G4Faser/G4FaserTools/python/G4FieldConfigNew.py b/Simulation/G4Faser/G4FaserTools/python/G4FieldConfigNew.py index 33d34f728c6e0b0d7f6b451b5e81464ecf9c5f5b..4f4de1b8984b40d2cb5a8ed10f2239ff63d20e06 100644 --- a/Simulation/G4Faser/G4FaserTools/python/G4FieldConfigNew.py +++ b/Simulation/G4Faser/G4FaserTools/python/G4FieldConfigNew.py @@ -54,7 +54,7 @@ def BasicDetectorConstantFieldManagerToolCfg(ConfigFlags, name='BasicDetectorCon # def EmulsionFieldManagerToolCfg(ConfigFlags, name='EmulsionFieldManager', **kwargs): - kwargs.setdefault("LogicalVolumes", ['Emulsion::Emulsion']) + kwargs.setdefault("LogicalVolumes", ['Emulsion::EmulsionStationA']) #kwargs.setdefault('DeltaChord', 0.00001) kwargs.setdefault('DeltaIntersection', 0.00001) kwargs.setdefault('DeltaOneStep', 0.0001) @@ -63,7 +63,16 @@ def EmulsionFieldManagerToolCfg(ConfigFlags, name='EmulsionFieldManager', **kwar return BasicDetectorFieldManagerToolCfg(ConfigFlags, name, **kwargs) def VetoFieldManagerToolCfg(ConfigFlags, name='VetoFieldManager', **kwargs): - kwargs.setdefault("LogicalVolumes", ['Veto::Veto']) + kwargs.setdefault("LogicalVolumes", ['Veto::VetoStationA']) + #kwargs.setdefault('DeltaChord', 0.00001) + kwargs.setdefault('DeltaIntersection', 0.00001) + kwargs.setdefault('DeltaOneStep', 0.0001) + kwargs.setdefault('MaximumEpsilonStep', 0.001) + kwargs.setdefault('MinimumEpsilonStep', 0.00001) + return BasicDetectorFieldManagerToolCfg(ConfigFlags, name, **kwargs) + +def VetoNuFieldManagerToolCfg(ConfigFlags, name='VetoNuFieldManager', **kwargs): + kwargs.setdefault("LogicalVolumes", ['VetoNu::VetoNuStationA']) #kwargs.setdefault('DeltaChord', 0.00001) kwargs.setdefault('DeltaIntersection', 0.00001) kwargs.setdefault('DeltaOneStep', 0.0001) @@ -119,3 +128,12 @@ def EcalFieldManagerToolCfg(ConfigFlags, name='EcalFieldManager', **kwargs): kwargs.setdefault('MinimumEpsilonStep', 0.00001) return BasicDetectorFieldManagerToolCfg(ConfigFlags, name, **kwargs) +def TrenchFieldManagerToolCfg(ConfigFlags, name='TrenchFieldManager', **kwargs): + kwargs.setdefault("LogicalVolumes", ['Trench::Trench']) + #kwargs.setdefault('DeltaChord', 0.00001) + kwargs.setdefault('DeltaIntersection', 0.00001) + kwargs.setdefault('DeltaOneStep', 0.0001) + kwargs.setdefault('MaximumEpsilonStep', 0.001) + kwargs.setdefault('MinimumEpsilonStep', 0.00001) + return BasicDetectorFieldManagerToolCfg(ConfigFlags, name, **kwargs) + diff --git a/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py b/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py index 064cde911986868ace4708e37374a17e20a6de16..4e6f59490a97baee0020453bb9572fab2b090fbc 100644 --- a/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py +++ b/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py @@ -7,21 +7,23 @@ from AthenaConfiguration.ComponentFactory import CompFactory from AthenaCommon import Logging #the physics region tools -from G4FaserTools.G4PhysicsRegionConfigNew import NeutrinoPhysicsRegionToolCfg, TrackerPhysicsRegionToolCfg, ScintillatorPhysicsRegionToolCfg, EcalPhysicsRegionToolCfg +from G4FaserTools.G4PhysicsRegionConfigNew import NeutrinoPhysicsRegionToolCfg, TrackerPhysicsRegionToolCfg, ScintillatorPhysicsRegionToolCfg, EcalPhysicsRegionToolCfg, CavernPhysicsRegionToolCfg #the field config tools -from G4FaserTools.G4FieldConfigNew import FASERFieldManagerToolCfg, EmulsionFieldManagerToolCfg, VetoFieldManagerToolCfg, TriggerFieldManagerToolCfg, PreshowerFieldManagerToolCfg, TrackerFieldManagerToolCfg, DipoleFieldManagerToolCfg, EcalFieldManagerToolCfg +from G4FaserTools.G4FieldConfigNew import FASERFieldManagerToolCfg, EmulsionFieldManagerToolCfg, VetoFieldManagerToolCfg, VetoNuFieldManagerToolCfg, TriggerFieldManagerToolCfg, PreshowerFieldManagerToolCfg, TrackerFieldManagerToolCfg, DipoleFieldManagerToolCfg, EcalFieldManagerToolCfg, TrenchFieldManagerToolCfg from G4FaserTools.G4FaserToolsConfigNew import SensitiveDetectorMasterToolCfg GeoDetectorTool=CompFactory.GeoDetectorTool from EmulsionGeoModel.EmulsionGeoModelConfig import EmulsionGeometryCfg from VetoGeoModel.VetoGeoModelConfig import VetoGeometryCfg +from VetoNuGeoModel.VetoNuGeoModelConfig import VetoNuGeometryCfg from TriggerGeoModel.TriggerGeoModelConfig import TriggerGeometryCfg from PreshowerGeoModel.PreshowerGeoModelConfig import PreshowerGeometryCfg from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg from DipoleGeoModel.DipoleGeoModelConfig import DipoleGeometryCfg from EcalGeoModel.EcalGeoModelConfig import EcalGeometryCfg +from FaserGeoModel.TrenchGMConfig import TrenchGeometryCfg BoxEnvelope, MaterialDescriptionTool, VoxelDensityTool, G4AtlasDetectorConstructionTool = CompFactory.getComps("BoxEnvelope", "MaterialDescriptionTool", "VoxelDensityTool", "G4AtlasDetectorConstructionTool",) @@ -59,6 +61,16 @@ def VetoGeoDetectorToolCfg(ConfigFlags, name='Veto', **kwargs): result.setPrivateTools(GeoDetectorTool(name, **kwargs)) return result +def VetoNuGeoDetectorToolCfg(ConfigFlags, name='VetoNu', **kwargs): + #set up geometry + result=VetoNuGeometryCfg(ConfigFlags) + kwargs.setdefault("DetectorName", "VetoNu") + #add the GeometryNotifierSvc + result.addService(G4GeometryNotifierSvcCfg(ConfigFlags)) + kwargs.setdefault("GeometryNotifierSvc", result.getService("G4GeometryNotifierSvc")) + result.setPrivateTools(GeoDetectorTool(name, **kwargs)) + return result + def TriggerGeoDetectorToolCfg(ConfigFlags, name='Trigger', **kwargs): #set up geometry result=TriggerGeometryCfg(ConfigFlags) @@ -109,6 +121,16 @@ def EcalGeoDetectorToolCfg(ConfigFlags, name='Ecal', **kwargs): result.setPrivateTools(GeoDetectorTool(name, **kwargs)) return result +def TrenchGeoDetectorToolCfg(ConfigFlags, name='Trench', **kwargs): + #set up geometry + result=TrenchGeometryCfg(ConfigFlags) + kwargs.setdefault("DetectorName", "Trench") + #add the GeometryNotifierSvc + result.addService(G4GeometryNotifierSvcCfg(ConfigFlags)) + kwargs.setdefault("GeometryNotifierSvc", result.getService("G4GeometryNotifierSvc")) + result.setPrivateTools(GeoDetectorTool(name, **kwargs)) + return result + def generateSubDetectorList(ConfigFlags): result = ComponentAccumulator() SubDetectorList=[] @@ -121,6 +143,10 @@ def generateSubDetectorList(ConfigFlags): toolVeto = result.popToolsAndMerge(VetoGeoDetectorToolCfg(ConfigFlags)) SubDetectorList += [ toolVeto ] + if ConfigFlags.Detector.GeometryVetoNu: + toolVetoNu = result.popToolsAndMerge(VetoNuGeoDetectorToolCfg(ConfigFlags)) + SubDetectorList += [ toolVetoNu ] + if ConfigFlags.Detector.GeometryTrigger: toolTrigger = result.popToolsAndMerge(TriggerGeoDetectorToolCfg(ConfigFlags)) SubDetectorList += [ toolTrigger ] @@ -140,6 +166,11 @@ def generateSubDetectorList(ConfigFlags): if ConfigFlags.Detector.GeometryEcal: toolEcal = result.popToolsAndMerge(EcalGeoDetectorToolCfg(ConfigFlags)) SubDetectorList += [ toolEcal ] + + if ConfigFlags.Detector.GeometryTrench: + toolTrench = result.popToolsAndMerge(TrenchGeoDetectorToolCfg(ConfigFlags)) + SubDetectorList += [ toolTrench ] + result.setPrivateTools(SubDetectorList) return result @@ -196,6 +227,9 @@ def getFASER_RegionCreatorList(ConfigFlags): if ConfigFlags.Detector.GeometryFaserCalo: regionCreatorList += [EcalPhysicsRegionToolCfg(ConfigFlags)] + + if ConfigFlags.Detector.GeometryFaserCavern: + regionCreatorList += [CavernPhysicsRegionToolCfg(ConfigFlags)] return regionCreatorList @@ -217,6 +251,11 @@ def FASER_FieldMgrListCfg(ConfigFlags): tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] + if ConfigFlags.Detector.GeometryVetoNu: + acc = VetoNuFieldManagerToolCfg(ConfigFlags) + tool = result.popToolsAndMerge(acc) + fieldMgrList += [tool] + if ConfigFlags.Detector.GeometryTrigger: acc = TriggerFieldManagerToolCfg(ConfigFlags) tool = result.popToolsAndMerge(acc) @@ -242,6 +281,12 @@ def FASER_FieldMgrListCfg(ConfigFlags): tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] + if ConfigFlags.Detector.GeometryTrench: + acc = TrenchFieldManagerToolCfg(ConfigFlags) + tool = result.popToolsAndMerge(acc) + fieldMgrList += [tool] + + result.setPrivateTools(fieldMgrList) return result diff --git a/Simulation/G4Faser/G4FaserTools/python/G4PhysicsRegionConfigNew.py b/Simulation/G4Faser/G4FaserTools/python/G4PhysicsRegionConfigNew.py index 040853dc2f46d08f0a92843d8b2f0dfef945ef11..42016881857b3de6bd2aee6c3f682419b52fe2de 100644 --- a/Simulation/G4Faser/G4FaserTools/python/G4PhysicsRegionConfigNew.py +++ b/Simulation/G4Faser/G4FaserTools/python/G4PhysicsRegionConfigNew.py @@ -16,7 +16,7 @@ def NeutrinoPhysicsRegionToolCfg(ConfigFlags, name="NeutrinoPhysicsRegionTool", def ScintillatorPhysicsRegionToolCfg(ConfigFlags, name='ScintillatorPhysicsRegionTool', **kwargs): kwargs.setdefault("RegionName", 'Scintillator') - volumeList = ['Veto::Plate' , 'Trigger::Plate', 'Preshower::Plate'] + volumeList = ['Veto::Plate' , 'Trigger::Plate', 'Preshower::Plate', 'VetoNu::Plate'] kwargs.setdefault("VolumeList", volumeList) kwargs.setdefault("ElectronCut", 0.05) kwargs.setdefault("PositronCut", 0.05) @@ -45,3 +45,13 @@ def EcalPhysicsRegionToolCfg(ConfigFlags, name='EcalPhysicsRegionTool', **kwargs kwargs.setdefault("PositronCut", rangeEMB) kwargs.setdefault("GammaCut", rangeEMB) return RegionCreator(name, **kwargs) + +def CavernPhysicsRegionToolCfg(ConfigFlags, name='CavernPhysicsRegionTool', **kwargs): + kwargs.setdefault("RegionName", 'Cavern') + volumeList = ['Trench::Trench'] + kwargs.setdefault("VolumeList", volumeList) + kwargs.setdefault("ElectronCut", 0.05) + kwargs.setdefault("PositronCut", 0.05) + kwargs.setdefault("GammaCut", 0.05) + return RegionCreator(name, **kwargs) + diff --git a/Simulation/ISF/ISF_Core/FaserISF_Services/src/FaserGeoIDSvc.cxx b/Simulation/ISF/ISF_Core/FaserISF_Services/src/FaserGeoIDSvc.cxx index ed4a3370a690cd833e68a4a930fba0967df54541..89b57d8284ced7dd0b48522f381501dd8f13780c 100644 --- a/Simulation/ISF/ISF_Core/FaserISF_Services/src/FaserGeoIDSvc.cxx +++ b/Simulation/ISF/ISF_Core/FaserISF_Services/src/FaserGeoIDSvc.cxx @@ -123,7 +123,8 @@ FaserDetDescr::FaserRegion ISF::FaserGeoIDSvc::identifyGeoID(const Amg::Vector3D if (lvName == "Veto::Veto" || lvName == "Veto::VetoStationA" || lvName == "Trigger::Trigger" || lvName == "Trigger::TriggerStationA" || - lvName == "Preshower::Preshower" || lvName == "Preshower::PreshowerStationA") return FaserDetDescr::fFaserScintillator; + lvName == "Preshower::Preshower" || lvName == "Preshower::PreshowerStationA" || + lvName == "VetoNu::VetoNu" || lvName == "VetoNu::VetoNuStationA" ) return FaserDetDescr::fFaserScintillator; if (lvName == "Ecal::Ecal") return FaserDetDescr::fFaserCalorimeter; diff --git a/Simulation/ISF/ISF_Geant4/FaserISF_Geant4Event/FaserISF_Geant4Event/FaserISFG4GeoHelper.h b/Simulation/ISF/ISF_Geant4/FaserISF_Geant4Event/FaserISF_Geant4Event/FaserISFG4GeoHelper.h index 8dc36356a51a161846307e0a677eaf5fa861a24b..96cf70d316be5b74e858c6ffeecd97bed93d917c 100644 --- a/Simulation/ISF/ISF_Geant4/FaserISF_Geant4Event/FaserISF_Geant4Event/FaserISFG4GeoHelper.h +++ b/Simulation/ISF/ISF_Geant4/FaserISF_Geant4Event/FaserISF_Geant4Event/FaserISFG4GeoHelper.h @@ -21,7 +21,7 @@ class FaserISFG4GeoHelper static bool checkVolumeDepth(G4LogicalVolume* logicalVol, int volLevel, int depth=0); private: - static G4LogicalVolume *s_vetoLV, *s_triggerLV, *s_preshowerLV, *s_sctLV, *s_dipoleLV, *s_ecalLV, *s_emulsionLV; + static G4LogicalVolume *s_vetoLV, *s_triggerLV, *s_preshowerLV, *s_vetonuLV, *s_sctLV, *s_dipoleLV, *s_ecalLV, *s_emulsionLV; }; diff --git a/Simulation/ISF/ISF_Geant4/FaserISF_Geant4Event/src/FaserISFG4GeoHelper.cxx b/Simulation/ISF/ISF_Geant4/FaserISF_Geant4Event/src/FaserISFG4GeoHelper.cxx index 6697607742a1a4cb0cdebf08aa138ba1fca4ba6c..f5337083756488e4939979a5a5424e1cf7b0b04c 100644 --- a/Simulation/ISF/ISF_Geant4/FaserISF_Geant4Event/src/FaserISFG4GeoHelper.cxx +++ b/Simulation/ISF/ISF_Geant4/FaserISF_Geant4Event/src/FaserISFG4GeoHelper.cxx @@ -19,6 +19,7 @@ G4LogicalVolume* iGeant4::FaserISFG4GeoHelper::s_sctLV = nullptr; G4LogicalVolume* iGeant4::FaserISFG4GeoHelper::s_vetoLV = nullptr; +G4LogicalVolume* iGeant4::FaserISFG4GeoHelper::s_vetonuLV = nullptr; G4LogicalVolume* iGeant4::FaserISFG4GeoHelper::s_triggerLV = nullptr; G4LogicalVolume* iGeant4::FaserISFG4GeoHelper::s_preshowerLV = nullptr; G4LogicalVolume* iGeant4::FaserISFG4GeoHelper::s_ecalLV = nullptr; @@ -30,7 +31,7 @@ FaserDetDescr::FaserRegion iGeant4::FaserISFG4GeoHelper::nextGeoId(const G4Step* aStep, int truthVolLevel) { - if (s_sctLV == nullptr && s_vetoLV == nullptr && s_triggerLV == nullptr && s_preshowerLV == nullptr && s_ecalLV == nullptr && s_emulsionLV == nullptr && s_dipoleLV == nullptr) // Initialize + if (s_sctLV == nullptr && s_vetoLV == nullptr && s_triggerLV == nullptr && s_preshowerLV == nullptr && s_vetonuLV == nullptr && s_ecalLV == nullptr && s_emulsionLV == nullptr && s_dipoleLV == nullptr) // Initialize { G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance(); for (size_t i = 0; i < lvs->size(); ++i) { @@ -39,6 +40,7 @@ iGeant4::FaserISFG4GeoHelper::nextGeoId(const G4Step* aStep, int truthVolLevel) G4String thisName = thisLV->GetName(); if ( ( s_sctLV == nullptr && thisName == "SCT::Station" ) || thisName == "SCT::SCT" ) { s_sctLV = thisLV; } else if ( ( s_vetoLV == nullptr && thisName == "Veto::VetoStationA" ) || thisName == "Veto::Veto" ) { s_vetoLV = thisLV; } + else if ( ( s_vetonuLV == nullptr && thisName == "VetoNu::VetoNuStationA" ) || thisName == "VetoNu::VetoNu" ) { s_vetonuLV = thisLV; } else if ( ( s_triggerLV == nullptr && thisName == "Trigger::TriggerStationA" ) || thisName == "Trigger::Trigger" ) { s_triggerLV = thisLV; } else if ( ( s_preshowerLV == nullptr && thisName == "Preshower::PreshowerStationA" ) || thisName == "Preshower::Preshower" ) { s_preshowerLV = thisLV; } else if ( thisName == "Ecal::Ecal" ) { s_ecalLV = thisLV; } @@ -73,6 +75,7 @@ iGeant4::FaserISFG4GeoHelper::nextGeoId(const G4Step* aStep, int truthVolLevel) nextGeoID = FaserDetDescr::fFaserTracker; } else if ((s_vetoLV != nullptr && s_vetoLV == postStepVolume) || + (s_vetonuLV != nullptr && s_vetonuLV == postStepVolume) || (s_triggerLV != nullptr && s_triggerLV == postStepVolume) || (s_preshowerLV != nullptr && s_preshowerLV == postStepVolume)) { @@ -107,6 +110,7 @@ bool iGeant4::FaserISFG4GeoHelper::checkVolumeDepth(G4LogicalVolume* lv, int vol if ( ((s_sctLV != nullptr) && (lv->GetName() == s_sctLV->GetName())) || ((s_vetoLV != nullptr) && (lv->GetName() == s_vetoLV->GetName())) || + ((s_vetonuLV != nullptr) && (lv->GetName() == s_vetonuLV->GetName())) || ((s_triggerLV != nullptr) && (lv->GetName() == s_triggerLV->GetName())) || ((s_preshowerLV != nullptr) && (lv->GetName() == s_preshowerLV->GetName())) || ((s_dipoleLV != nullptr) && (lv->GetName() == s_dipoleLV->GetName())) || diff --git a/graphics/VTI12/README.md b/graphics/VTI12/README.md index 708260f7e77ac3591b3d629b1f6f76107b0a6eb8..bfd96be854ac9668b93117ed4ea20c04ba0fb023 100644 --- a/graphics/VTI12/README.md +++ b/graphics/VTI12/README.md @@ -8,7 +8,7 @@ To run on Calypso MC data (from an installation (run) directory): Note that VP1PLUGINPATH can be ninja-changed by asetup, and if it does not include the Calypso installation library folder, nothing will work. Also note that it must be an ABSOLUTE (not relative) path! -You can also give the -detdescr="FASER-01" (baseline detector), -detdescr="FASER-02" (baseline + IFT), -detdescr="FASERNU-02" (baseline + IFT + emulsion) or -detdescr="FASER-TB00" (2021 Test-beam) to specify the geometry. +You can also give the -detdescr="FASER-01" (baseline detector), -detdescr="FASER-02" (baseline + IFT), -detdescr="FASERNU-03" (baseline + IFT + emulsion) or -detdescr="FASER-TB00" (2021 Test-beam) to specify the geometry. You also need either -globcond="OFLCOND-FASER-01" (baseline) or -globcond="OFLCOND-FASER-02" (IFT with or without emulsion), or -globcond="OFLCOND-FASER-TB00" (test-beam) flags to specify the conditions. diff --git a/graphics/VTI12/VTI12Algs/share/vti12.py b/graphics/VTI12/VTI12Algs/share/vti12.py index 3878899db88d845cd247602b91faf6a1204cee7b..07a3a97a2ca79ae0f920f1516590a03c55a2a13b 100644 --- a/graphics/VTI12/VTI12Algs/share/vti12.py +++ b/graphics/VTI12/VTI12Algs/share/vti12.py @@ -32,7 +32,8 @@ if not 'vp1NoSortDBReplicas' in dir(): vp1NoSortDBReplicas=False if not 'vp1FilterEvents' in dir(): vp1FilterEvents="" if not 'vp1NoGui' in dir(): vp1NoGui=False if not 'vp1SpacePoints' in dir(): vp1SpacePoints=False -if not 'vp1Cavern' in dir(): vp1Cavern=False +# if not 'vp1Cavern' in dir(): vp1Cavern=False +vp1Cavern=True if not 'vp1NoAutoConf' in dir(): vp1NoAutoConf=False if not 'vp1Trig' in dir(): vp1Trig=False if not 'vp1NSW' in dir(): vp1NSW=False diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/VTI12GeometrySystems/VP1GeoFlags.h b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/VTI12GeometrySystems/VP1GeoFlags.h index a50cf0d19605f3bbd922459105c416271968d1d7..8aefd8e48631325fefad9f9a25253e5c2f147a13 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/VTI12GeometrySystems/VP1GeoFlags.h +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/VTI12GeometrySystems/VP1GeoFlags.h @@ -27,14 +27,16 @@ public: None = 0x00000000, Emulsion = 0x00000001, - Veto = 0x00000002, - Trigger = 0x00000004, - Preshower = 0x00000008, + VetoNu = 0x00000002, + Veto = 0x00000004, + Trigger = 0x00000008, + Preshower = 0x00000010, - SCT = 0x00000010, - Dipole = 0x00000020, + SCT = 0x00000020, + Dipole = 0x00000040, - Ecal = 0x00000040, + Ecal = 0x00000080, + CavernInfra = 0x00000100, // 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 e6325f8f2ff62915d13dc462bd87e626b23c9227..fbb27a254fe2aa6454d1e5b80060e083804ffc1e 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/GeoSysController.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/GeoSysController.cxx @@ -150,6 +150,7 @@ GeoSysController::GeoSysController(IVP1System * sys) m_d->subSysCheckBoxMap[VP1GeoFlags::Emulsion] = m_d->ui.checkBox_Emulsion; // SCINTILLATOR + m_d->subSysCheckBoxMap[VP1GeoFlags::VetoNu] = m_d->ui.checkBox_VetoNu; m_d->subSysCheckBoxMap[VP1GeoFlags::Veto] = m_d->ui.checkBox_Veto; m_d->subSysCheckBoxMap[VP1GeoFlags::Trigger] = m_d->ui.checkBox_Trigger; m_d->subSysCheckBoxMap[VP1GeoFlags::Preshower] = m_d->ui.checkBox_Preshower; @@ -161,6 +162,9 @@ GeoSysController::GeoSysController(IVP1System * sys) // Calorimeter m_d->subSysCheckBoxMap[VP1GeoFlags::Ecal] = m_d->ui.checkBox_Ecal; + // Cavern + m_d->subSysCheckBoxMap[VP1GeoFlags::CavernInfra] = m_d->ui.checkBox_CavernInfra; + // MISCELLANEOUS // OTHER m_d->subSysCheckBoxMap[VP1GeoFlags::AllUnrecognisedVolumes] = m_d->ui.checkBox_other; diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VP1GeometrySystem.cxx b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VP1GeometrySystem.cxx index 8e4b61921f3d849bdd127f00f5c0c4ca1b868aa2..e5c0eed5d6622562488cc3075dc3115659796fcc 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VP1GeometrySystem.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VP1GeometrySystem.cxx @@ -329,12 +329,14 @@ QWidget * VP1GeometrySystem::buildController() bool negategrandchildrenregexp = false // wheter we want to negate teh granchildren regex */ m_d->addSubSystem( VP1GeoFlags::Emulsion, "Emulsion"); + m_d->addSubSystem( VP1GeoFlags::VetoNu, "VetoNu"); m_d->addSubSystem( VP1GeoFlags::Veto, "Veto"); 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"); + m_d->addSubSystem( VP1GeoFlags::CavernInfra, "Cavern"); @@ -1109,6 +1111,12 @@ void VP1GeometrySystem::Imp::createPathExtras(const VolumeHandle* volhandle, QSt entries.push("Veto::Veto"); return; } + case VP1GeoFlags::VetoNu:{ + prefix = QString("VetoNu::"); + entries.push("SCINT::SCINT"); + entries.push("VetoNu::VetoNu"); + return; + } case VP1GeoFlags::Trigger:{ prefix = QString("Trigger::"); entries.push("SCINT::SCINT"); @@ -1139,6 +1147,13 @@ void VP1GeometrySystem::Imp::createPathExtras(const VolumeHandle* volhandle, QSt entries.push("Ecal::Ecal"); return; } + case VP1GeoFlags::CavernInfra:{ + prefix = QString("Cavern::"); + entries.push("CAVERN::CAVERN"); + entries.push("Trench::Trench"); + return; + } + case VP1GeoFlags::None: case VP1GeoFlags::AllUnrecognisedVolumes: default:{ diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VisAttributes.cxx b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VisAttributes.cxx index 82825c71806f9cddaef0e065a30086fffae4e270..27fd3362c4a18bfa999517529fc925951fbff20c 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VisAttributes.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VisAttributes.cxx @@ -160,6 +160,7 @@ DetVisAttributes::DetVisAttributes() { material->specularColor.setValue(.915152, .915152, .915152); material->shininess.setValue(0.642424); add("Veto",material); + add("VetoNu",material); add("Trigger",material); add("Preshower",material); } diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VolumeTreeModel.cxx b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VolumeTreeModel.cxx index b1aff16c0a2c354c77428af96bf7fb8b7c1d2dc6..ea681cdd6fe6b261a90d6701c5b8fa864777b39c 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VolumeTreeModel.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/VolumeTreeModel.cxx @@ -31,7 +31,7 @@ class VolumeTreeModel::Imp { public: //Static definitions of sections and which subsystems goes in which sections: - enum SECTION { UNKNOWN, NEUTRINO, SCINT, TRACKER, CALO, MISC }; + enum SECTION { UNKNOWN, NEUTRINO, SCINT, TRACKER, CALO, MISC, CAVERN }; static std::map<SECTION,QString> section2string; static std::map<VP1GeoFlags::SubSystemFlag,SECTION> subsysflag2section; static std::map<VP1GeoFlags::SubSystemFlag,QString> subsysflag2string; @@ -108,6 +108,7 @@ VolumeTreeModel::VolumeTreeModel( QObject * parent ) Imp::section2string[Imp::SCINT] = "Scintillators"; Imp::section2string[Imp::TRACKER] = "Tracker"; Imp::section2string[Imp::CALO] = "Calorimeter"; + Imp::section2string[Imp::CAVERN] = "Cavern"; Imp::section2string[Imp::MISC] = "Miscellaneous"; } if (Imp::subsysflag2section.empty()) { @@ -116,6 +117,7 @@ VolumeTreeModel::VolumeTreeModel( QObject * parent ) Imp::defineSubSystem(VP1GeoFlags::Emulsion, "Emulsion", Imp::NEUTRINO); // Scintillator Imp::defineSubSystem(VP1GeoFlags::Veto, "Veto", Imp::SCINT); + Imp::defineSubSystem(VP1GeoFlags::VetoNu, "VetoNu", Imp::SCINT); Imp::defineSubSystem(VP1GeoFlags::Trigger, "Trigger", Imp::SCINT); Imp::defineSubSystem(VP1GeoFlags::Preshower, "Preshower", Imp::SCINT); // Tracker @@ -123,6 +125,8 @@ VolumeTreeModel::VolumeTreeModel( QObject * parent ) Imp::defineSubSystem(VP1GeoFlags::Dipole, "Dipole", Imp::TRACKER); // Calorimeter Imp::defineSubSystem(VP1GeoFlags::Ecal, "Ecal", Imp::CALO); + // Cavern + Imp::defineSubSystem(VP1GeoFlags::CavernInfra, "Cavern", Imp::CAVERN); } } diff --git a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/geometrysystemcontroller.ui b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/geometrysystemcontroller.ui index be9ac807d6b5d2511d214a4a6265064f0bd7ef26..a5ef9228de57c9a314e6348a78af6eca572d31cb 100644 --- a/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/geometrysystemcontroller.ui +++ b/graphics/VTI12/VTI12Systems/VTI12GeometrySystems/src/geometrysystemcontroller.ui @@ -239,20 +239,27 @@ <number>0</number> </property> <item row="0" column="0"> + <widget class="QCheckBox" name="checkBox_VetoNu"> + <property name="text"> + <string>VetoNu</string> + </property> + </widget> + </item> + <item row="0" column="1"> <widget class="QCheckBox" name="checkBox_Veto"> <property name="text"> <string>Veto</string> </property> </widget> </item> - <item row="0" column="1"> + <item row="1" column="0"> <widget class="QCheckBox" name="checkBox_Trigger"> <property name="text"> <string>Trigger</string> </property> </widget> </item> - <item row="0" column="2"> + <item row="1" column="1"> <widget class="QCheckBox" name="checkBox_Preshower"> <property name="text"> <string>Preshower</string> @@ -333,7 +340,7 @@ <property name="title"> <string>Calorimeter</string> </property> - <layout class="QVBoxLayout" name="_12"> + <layout class="QVBoxLayout" name="_121"> <property name="spacing"> <number>0</number> </property> @@ -350,7 +357,7 @@ <number>4</number> </property> <item> - <layout class="QHBoxLayout" name="_14"> + <layout class="QHBoxLayout" name="_141"> <item> <widget class="QCheckBox" name="checkBox_Ecal"> <property name="text"> diff --git a/graphics/VTI12/VTI12Systems/VTI12SimHitSystems/src/VP1SimHitSystem.cxx b/graphics/VTI12/VTI12Systems/VTI12SimHitSystems/src/VP1SimHitSystem.cxx index 19634a20a2b55431ade9a88704a8b9ca6cf06ba4..a9eec098eed63415284583faeaf4b0e4fe71dd0c 100755 --- a/graphics/VTI12/VTI12Systems/VTI12SimHitSystems/src/VP1SimHitSystem.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12SimHitSystems/src/VP1SimHitSystem.cxx @@ -64,6 +64,7 @@ QWidget* VP1SimHitSystem::buildController() // Populate Check Box Names Map m_clockwork->checkBoxNamesMap.insert(ui.chbxEmulsionHits,"Emulsion"); + m_clockwork->checkBoxNamesMap.insert(ui.chbxVetoNuHits,"VetoNu"); m_clockwork->checkBoxNamesMap.insert(ui.chbxVetoHits,"Veto"); m_clockwork->checkBoxNamesMap.insert(ui.chbxTriggerHits,"Trigger"); m_clockwork->checkBoxNamesMap.insert(ui.chbxPreshowerHits,"Preshower"); @@ -84,6 +85,7 @@ void VP1SimHitSystem::systemcreate(StoreGateSvc* /*detstore*/) { // Populate Color Map m_clockwork->colorMap.insert("Emulsion",SbColor(1,0,1)); + m_clockwork->colorMap.insert("VetoNu",SbColor(0,1,1)); m_clockwork->colorMap.insert("Veto",SbColor(0,0,1)); m_clockwork->colorMap.insert("Trigger",SbColor(1,1,1)); m_clockwork->colorMap.insert("Preshower",SbColor(1,0,0)); @@ -227,6 +229,25 @@ void VP1SimHitSystem::buildHitTree(const QString& detector) else message("Unable to retrieve Veto Hits"); } + else if(detector=="VetoNu") + { + // + // VetoNu: + // + const ScintHitCollection* p_collection = nullptr; + if(sg->retrieve(p_collection, "VetoNuHits")==StatusCode::SUCCESS) + { + for(ScintHitConstIterator i_hit=p_collection->begin(); i_hit!=p_collection->end(); ++i_hit) + { + GeoScintHit ghit(*i_hit); + if(!ghit) continue; + HepGeom::Point3D<double> u = ghit.getGlobalPosition(); + hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z()); + } + } + else + message("Unable to retrieve VetoNu Hits"); + } else if(detector=="Trigger") { // diff --git a/graphics/VTI12/VTI12Systems/VTI12SimHitSystems/src/simhitcontrollerform.ui b/graphics/VTI12/VTI12Systems/VTI12SimHitSystems/src/simhitcontrollerform.ui index 67f62d51f9450ac5416d1452f106c37633f25809..b9797015a001150b7da85edc1463ee245a168c9d 100755 --- a/graphics/VTI12/VTI12Systems/VTI12SimHitSystems/src/simhitcontrollerform.ui +++ b/graphics/VTI12/VTI12Systems/VTI12SimHitSystems/src/simhitcontrollerform.ui @@ -106,6 +106,13 @@ <string>Scintillator</string> </property> <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QCheckBox" name="chbxVetoNuHits"> + <property name="text"> + <string>VetoNu Hits</string> + </property> + </widget> + </item> <item> <widget class="QCheckBox" name="chbxVetoHits"> <property name="text"> @@ -181,7 +188,7 @@ <property name="title"> <string>Calorimeter</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> + <layout class="QVBoxLayout" name="verticalLayout_31"> <item> <widget class="QCheckBox" name="chbxCaloHits"> <property name="text"> diff --git a/graphics/VTI12/VTI12Systems/VTI12TrackSystems/src/TrackCollHandle_TruthTracks.cxx b/graphics/VTI12/VTI12Systems/VTI12TrackSystems/src/TrackCollHandle_TruthTracks.cxx index ef731fa9549323d72b6b4f7d516fb7989b4182b3..eedf4ed49e4a50c1c6c6534f47cb8297659593e5 100644 --- a/graphics/VTI12/VTI12Systems/VTI12TrackSystems/src/TrackCollHandle_TruthTracks.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12TrackSystems/src/TrackCollHandle_TruthTracks.cxx @@ -127,8 +127,9 @@ QStringList TrackCollHandle_TruthTracks::availableCollections( IVP1System*sys ) if (VP1JobConfigInfo::hasVetoGeometry() || VP1JobConfigInfo::hasTriggerGeometry() || - VP1JobConfigInfo::hasPreshowerGeometry()) - keys_scintillatorhits = sgcont.getKeys<ScintHitCollection>();//"VetoHits", "TriggerHits" and "PreshowerHits" + VP1JobConfigInfo::hasPreshowerGeometry() || + VP1JobConfigInfo::hasVetoNuGeometry()) + keys_scintillatorhits = sgcont.getKeys<ScintHitCollection>();//"VetoHits", "VetoNuHits", "TriggerHits" and "PreshowerHits" if (VP1JobConfigInfo::hasSCTGeometry()) keys_siliconhits = sgcont.getKeys<FaserSiHitCollection>();//"SCT_Hits" if (VP1JobConfigInfo::hasEcalGeometry()) @@ -264,6 +265,7 @@ bool TrackCollHandle_TruthTracks::Imp::loadHitLists(std::map<SimBarCode,SimHitLi if (VP1JobConfigInfo::hasEmulsionGeometry()) addHitCollections<NeutrinoHitCollection>(hitLists); if (VP1JobConfigInfo::hasVetoGeometry() || + VP1JobConfigInfo::hasVetoNuGeometry() || VP1JobConfigInfo::hasTriggerGeometry() || VP1JobConfigInfo::hasPreshowerGeometry()) // std::cout << "Called addHitCollections" << std::endl; diff --git a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/VP1WaveformHitSystem.h b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/VP1WaveformHitSystem.h index fa0831b3f579c8c052fd3d38639da1a491888d7c..52312553b7c1a6aa39d64e8535faa1a463f7c946 100644 --- a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/VP1WaveformHitSystem.h +++ b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/VP1WaveformHitSystem.h @@ -45,6 +45,7 @@ public: public slots: void updateVetoElements(bool); + void updateVetoNuElements(bool); void updateTriggerElements(bool); void updatePreshowerElements(bool); void updateCalorimeterElements(bool); diff --git a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/VP1WaveformSystem.h b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/VP1WaveformSystem.h index d17e3b60f5e58fc5709064be6c77215c21d7a5b4..73535d6ad2f19aac9982a89b8f559615268de775 100644 --- a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/VP1WaveformSystem.h +++ b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/VP1WaveformSystem.h @@ -45,6 +45,7 @@ public: public slots: void updateVetoElements(bool); + void updateVetoNuElements(bool); void updateTriggerElements(bool); void updatePreshowerElements(bool); void updateCalorimeterElements(bool); diff --git a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/WaveformSysController.h b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/WaveformSysController.h index ebb3c4c34ca693d245a300b2f47813ce738b4597..74a2191c7277af9cbf31374466911804ff531e1e 100644 --- a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/WaveformSysController.h +++ b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/VTI12WaveformSystems/WaveformSysController.h @@ -40,6 +40,7 @@ public: /////////////////////////////////// bool vetoEnabled() const; + bool vetoNuEnabled() const; bool triggerEnabled() const; bool preshowerEnabled() const; bool calorimeterEnabled() const; @@ -52,6 +53,7 @@ public: /////////////////////////////////////// signals: void vetoEnabledChanged(bool); + void vetoNuEnabledChanged(bool); void triggerEnabledChanged(bool); void preshowerEnabledChanged(bool); void calorimeterEnabledChanged(bool); @@ -65,6 +67,7 @@ private: private slots: void possibleChange_vetoEnabled(); + void possibleChange_vetoNuEnabled(); void possibleChange_triggerEnabled(); void possibleChange_preshowerEnabled(); void possibleChange_calorimeterEnabled(); diff --git a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/VP1WaveformHitSystem.cxx b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/VP1WaveformHitSystem.cxx index 7d0c07c942414273964ffed851b27b745cca2756..c46089cf4a23397d324b422ea07d4dcc008e896f 100644 --- a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/VP1WaveformHitSystem.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/VP1WaveformHitSystem.cxx @@ -46,6 +46,7 @@ public: VP1WaveformHitSystem *theclass; WaveformSysController * controller; std::vector<QChart*> vetoCharts; + std::vector<QChart*> vetoNuCharts; std::vector<QChart*> triggerCharts; std::vector<QChart*> preshowerCharts; std::vector<QChart*> calorimeterCharts; @@ -82,6 +83,7 @@ QWidget * VP1WaveformHitSystem::buildController() m_d->controller = new WaveformSysController(this); connect(m_d->controller,SIGNAL(vetoEnabledChanged(bool)),this,SLOT(updateVetoElements(bool))); + connect(m_d->controller,SIGNAL(vetoNuEnabledChanged(bool)),this,SLOT(updateVetoNuElements(bool))); connect(m_d->controller,SIGNAL(triggerEnabledChanged(bool)),this,SLOT(updateTriggerElements(bool))); connect(m_d->controller,SIGNAL(preshowerEnabledChanged(bool)),this,SLOT(updatePreshowerElements(bool))); connect(m_d->controller,SIGNAL(calorimeterEnabledChanged(bool)),this,SLOT(updateCalorimeterElements(bool))); @@ -99,6 +101,7 @@ void VP1WaveformHitSystem::buildEventItemCollection(StoreGateSvc* sg, VP1Graphic } m_d->vetoCharts.clear(); + m_d->vetoNuCharts.clear(); m_d->triggerCharts.clear(); m_d->preshowerCharts.clear(); m_d->calorimeterCharts.clear(); @@ -107,6 +110,7 @@ void VP1WaveformHitSystem::buildEventItemCollection(StoreGateSvc* sg, VP1Graphic // m_d->nCharts = 0; m_d->createCharts(sg, root, m_d->controller->vetoEnabled(), m_d->vetoCharts, "VetoWaveformHits"); + m_d->createCharts(sg, root, m_d->controller->vetoNuEnabled(), m_d->vetoNuCharts, "VetoNuWaveformHits"); m_d->createCharts(sg, root, m_d->controller->triggerEnabled(), m_d->triggerCharts, "TriggerWaveformHits"); m_d->createCharts(sg, root, m_d->controller->preshowerEnabled(), m_d->preshowerCharts, "PreshowerWaveformHits"); m_d->createCharts(sg, root, m_d->controller->calorimeterEnabled(), m_d->calorimeterCharts, "CaloWaveformHits"); @@ -264,6 +268,7 @@ QChart* VP1WaveformHitSystem::Imp::createChart(const std::vector<float>& times, void VP1WaveformHitSystem::Imp::getVisible() { visibleCharts.clear(); + getVisible(vetoNuCharts); getVisible(vetoCharts); getVisible(triggerCharts); getVisible(preshowerCharts); @@ -356,6 +361,16 @@ void VP1WaveformHitSystem::updateVetoElements(bool enabled) m_d->layoutCharts(); } +void VP1WaveformHitSystem::updateVetoNuElements(bool enabled) +{ + for (QChart* c : m_d->vetoNuCharts) + { + c->setVisible(enabled); + } + m_d->layoutCharts(); +} + + void VP1WaveformHitSystem::updateTriggerElements(bool enabled) { for (QChart* c : m_d->triggerCharts) diff --git a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/VP1WaveformSystem.cxx b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/VP1WaveformSystem.cxx index ffe6bd00acecfd6f3fe611c01b24a1f2ea6afd1a..172bdebd9d22b183a4304bd8414b6e6f3be3985e 100644 --- a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/VP1WaveformSystem.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/VP1WaveformSystem.cxx @@ -45,6 +45,7 @@ public: VP1WaveformSystem *theclass; WaveformSysController * controller; std::vector<QChart*> vetoCharts; + std::vector<QChart*> vetoNuCharts; std::vector<QChart*> triggerCharts; std::vector<QChart*> preshowerCharts; std::vector<QChart*> calorimeterCharts; @@ -80,6 +81,7 @@ QWidget * VP1WaveformSystem::buildController() m_d->controller = new WaveformSysController(this); connect(m_d->controller,SIGNAL(vetoEnabledChanged(bool)),this,SLOT(updateVetoElements(bool))); + connect(m_d->controller,SIGNAL(vetoNuEnabledChanged(bool)),this,SLOT(updateVetoNuElements(bool))); connect(m_d->controller,SIGNAL(triggerEnabledChanged(bool)),this,SLOT(updateTriggerElements(bool))); connect(m_d->controller,SIGNAL(preshowerEnabledChanged(bool)),this,SLOT(updatePreshowerElements(bool))); connect(m_d->controller,SIGNAL(calorimeterEnabledChanged(bool)),this,SLOT(updateCalorimeterElements(bool))); @@ -97,6 +99,7 @@ void VP1WaveformSystem::buildEventItemCollection(StoreGateSvc* sg, VP1GraphicsIt } m_d->vetoCharts.clear(); + m_d->vetoNuCharts.clear(); m_d->triggerCharts.clear(); m_d->preshowerCharts.clear(); m_d->calorimeterCharts.clear(); @@ -105,6 +108,7 @@ void VP1WaveformSystem::buildEventItemCollection(StoreGateSvc* sg, VP1GraphicsIt // m_d->nCharts = 0; m_d->createCharts(sg, root, m_d->controller->vetoEnabled(), m_d->vetoCharts, "VetoWaveforms"); + m_d->createCharts(sg, root, m_d->controller->vetoNuEnabled(), m_d->vetoNuCharts, "VetoNuWaveforms"); m_d->createCharts(sg, root, m_d->controller->triggerEnabled(), m_d->triggerCharts, "TriggerWaveforms"); m_d->createCharts(sg, root, m_d->controller->preshowerEnabled(), m_d->preshowerCharts, "PreshowerWaveforms"); m_d->createCharts(sg, root, m_d->controller->calorimeterEnabled(), m_d->calorimeterCharts, "CaloWaveforms"); @@ -194,6 +198,7 @@ void VP1WaveformSystem::Imp::getVisible() { visibleCharts.clear(); getVisible(vetoCharts); + getVisible(vetoNuCharts); getVisible(triggerCharts); getVisible(preshowerCharts); getVisible(calorimeterCharts); @@ -286,6 +291,15 @@ void VP1WaveformSystem::updateVetoElements(bool enabled) m_d->layoutCharts(); } +void VP1WaveformSystem::updateVetoNuElements(bool enabled) +{ + for (QChart* c : m_d->vetoNuCharts) + { + c->setVisible(enabled); + } + m_d->layoutCharts(); +} + void VP1WaveformSystem::updateTriggerElements(bool enabled) { for (QChart* c : m_d->triggerCharts) diff --git a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/WaveformSysController.cxx b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/WaveformSysController.cxx index 765ce0d4d702245b2c2733f4003824b21a150ba2..856fc0071f9679cfbf585bd0279587a521fcc220 100644 --- a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/WaveformSysController.cxx +++ b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/WaveformSysController.cxx @@ -45,6 +45,7 @@ public: } bool last_vetoEnabled; + bool last_vetoNuEnabled; bool last_triggerEnabled; bool last_preshowerEnabled; bool last_calorimeterEnabled; @@ -62,6 +63,9 @@ WaveformSysController::WaveformSysController(IVP1System * sys) addUpdateSlot(SLOT(possibleChange_vetoEnabled())); connectToLastUpdateSlot(m_d->ui.checkBox_vetoEnabled); + addUpdateSlot(SLOT(possibleChange_vetoNuEnabled())); + connectToLastUpdateSlot(m_d->ui.checkBox_vetoNuEnabled); + addUpdateSlot(SLOT(possibleChange_triggerEnabled())); connectToLastUpdateSlot(m_d->ui.checkBox_triggerEnabled); @@ -91,6 +95,11 @@ bool WaveformSysController::vetoEnabled() const return m_d->ui.checkBox_vetoEnabled->isChecked(); } +bool WaveformSysController::vetoNuEnabled() const +{ + return m_d->ui.checkBox_vetoNuEnabled->isChecked(); +} + bool WaveformSysController::triggerEnabled() const { return m_d->ui.checkBox_triggerEnabled->isChecked(); @@ -126,6 +135,7 @@ void WaveformSysController::actualSaveSettings(VP1Serialise&s) const { s.save(m_d->ui.checkBox_vetoEnabled); + s.save(m_d->ui.checkBox_vetoNuEnabled); s.save(m_d->ui.checkBox_triggerEnabled); s.save(m_d->ui.checkBox_preshowerEnabled); s.save(m_d->ui.checkBox_calorimeterEnabled); @@ -143,6 +153,7 @@ void WaveformSysController::actualRestoreSettings(VP1Deserialise& s) } s.restore(m_d->ui.checkBox_vetoEnabled); + s.restore(m_d->ui.checkBox_vetoNuEnabled); s.restore(m_d->ui.checkBox_triggerEnabled); s.restore(m_d->ui.checkBox_preshowerEnabled); s.restore(m_d->ui.checkBox_calorimeterEnabled); @@ -157,6 +168,7 @@ void WaveformSysController::actualRestoreSettings(VP1Deserialise& s) #define VP1CONTROLLERCLASSNAME WaveformSysController #include "VP1Base/VP1ControllerMacros.h" POSSIBLECHANGE_IMP(vetoEnabled) +POSSIBLECHANGE_IMP(vetoNuEnabled) POSSIBLECHANGE_IMP(triggerEnabled) POSSIBLECHANGE_IMP(preshowerEnabled) POSSIBLECHANGE_IMP(calorimeterEnabled) diff --git a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/waveformcontrollerform.ui b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/waveformcontrollerform.ui index cb854170cb4351c4f61e0672cd51cf6853af6fe2..a90933874c20e67ba073ae34ccfa1053b86d2a41 100644 --- a/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/waveformcontrollerform.ui +++ b/graphics/VTI12/VTI12Systems/VTI12WaveformSystems/src/waveformcontrollerform.ui @@ -32,6 +32,16 @@ <number>0</number> </property> <item row="0" column="0"> + <widget class="QCheckBox" name="checkBox_vetoNuEnabled"> + <property name="text"> + <string>VetoNu</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0"> <widget class="QCheckBox" name="checkBox_vetoEnabled"> <property name="text"> <string>Veto</string> @@ -41,7 +51,7 @@ </property> </widget> </item> - <item row="1" column="0"> + <item row="2" column="0"> <widget class="QCheckBox" name="checkBox_triggerEnabled"> <property name="text"> <string>Trigger</string> @@ -51,7 +61,7 @@ </property> </widget> </item> - <item row="2" column="0"> + <item row="3" column="0"> <widget class="QCheckBox" name="checkBox_preshowerEnabled"> <property name="text"> <string>Preshower</string> @@ -61,7 +71,7 @@ </property> </widget> </item> - <item row="3" column="0"> + <item row="4" column="0"> <widget class="QCheckBox" name="checkBox_calorimeterEnabled"> <property name="text"> <string>Calorimeter</string> @@ -71,7 +81,7 @@ </property> </widget> </item> - <item row="4" column="0"> + <item row="5" column="0"> <widget class="QCheckBox" name="checkBox_clockEnabled"> <property name="text"> <string>Clock</string> @@ -81,7 +91,7 @@ </property> </widget> </item> - <item row="5" column="0"> + <item row="6" column="0"> <widget class="QCheckBox" name="checkBox_testEnabled"> <property name="text"> <string>Test</string> diff --git a/graphics/VTI12/VTI12Utils/VTI12Utils/VP1DetInfo.h b/graphics/VTI12/VTI12Utils/VTI12Utils/VP1DetInfo.h index ff521e608e83558942909b2af4eb7f5f3d227f8d..46ae0c23a4ed356d0149f79b0378dc047fdc737d 100644 --- a/graphics/VTI12/VTI12Utils/VTI12Utils/VP1DetInfo.h +++ b/graphics/VTI12/VTI12Utils/VTI12Utils/VP1DetInfo.h @@ -23,6 +23,7 @@ class StoreGateSvc; namespace NeutrinoDD { class EmulsionDetectorManager; } namespace TrackerDD { class SCT_DetectorManager; } namespace ScintDD { class VetoDetectorManager; } +namespace ScintDD { class VetoNuDetectorManager; } namespace ScintDD { class TriggerDetectorManager; } namespace ScintDD { class PreshowerDetectorManager; } namespace CaloDD { class EcalDetectorManager; } @@ -31,6 +32,7 @@ class FaserDetectorID; class EmulsionDetectorID; class ScintDetectorID; class VetoID; +class VetoNuID; class TriggerID; class PreshowerID; class FaserSCT_ID; @@ -51,6 +53,7 @@ public: static const NeutrinoDD::EmulsionDetectorManager * emulsionDetMgr(); static const ScintDD::VetoDetectorManager * vetoDetMgr(); + static const ScintDD::VetoNuDetectorManager * vetoNuDetMgr(); static const ScintDD::TriggerDetectorManager * triggerDetMgr(); static const ScintDD::PreshowerDetectorManager * preshowerDetMgr(); @@ -66,6 +69,7 @@ public: static const EmulsionID * emulsionIDHelper(); static const VetoID * vetoIDHelper(); + static const VetoNuID * vetoNuIDHelper(); static const TriggerID * triggerIDHelper(); static const PreshowerID * preshowerIDHelper(); diff --git a/graphics/VTI12/VTI12Utils/VTI12Utils/VP1JobConfigInfo.h b/graphics/VTI12/VTI12Utils/VTI12Utils/VP1JobConfigInfo.h index a90910903a46ee80f207ee10a8e5d2295602fe33..96c80ac470dedb37562dc2b6d7e1c38ff5bec9c3 100644 --- a/graphics/VTI12/VTI12Utils/VTI12Utils/VP1JobConfigInfo.h +++ b/graphics/VTI12/VTI12Utils/VTI12Utils/VP1JobConfigInfo.h @@ -35,6 +35,7 @@ public: static bool hasEmulsionGeometry(); static bool hasVetoGeometry(); + static bool hasVetoNuGeometry(); static bool hasTriggerGeometry(); static bool hasPreshowerGeometry(); @@ -42,6 +43,8 @@ public: static bool hasEcalGeometry(); + static bool hasCavernInfraGeometry(); + //Top geomodel volume link (not strictly "JobConfig", but here it is): static const GeoPVConstLink * geoModelWorld();//might return 0 diff --git a/graphics/VTI12/VTI12Utils/src/VP1DetInfo.cxx b/graphics/VTI12/VTI12Utils/src/VP1DetInfo.cxx index ba2ecb3fb349040c013933feb8d81474ddc2f5a8..b92e7cf2c2f1f066c2177de36448b49f8bf78fcb 100644 --- a/graphics/VTI12/VTI12Utils/src/VP1DetInfo.cxx +++ b/graphics/VTI12/VTI12Utils/src/VP1DetInfo.cxx @@ -25,6 +25,7 @@ #include "NeutrinoReadoutGeometry/EmulsionDetectorManager.h" #include "ScintReadoutGeometry/VetoDetectorManager.h" +#include "ScintReadoutGeometry/VetoNuDetectorManager.h" #include "ScintReadoutGeometry/TriggerDetectorManager.h" #include "ScintReadoutGeometry/PreshowerDetectorManager.h" @@ -37,6 +38,7 @@ #include "NeutrinoIdentifier/EmulsionID.h" #include "ScintIdentifier/VetoID.h" +#include "ScintIdentifier/VetoNuID.h" #include "ScintIdentifier/TriggerID.h" #include "ScintIdentifier/PreshowerID.h" @@ -58,6 +60,7 @@ public: static const NeutrinoDD::EmulsionDetectorManager * m_emulsionDetMgr; static const ScintDD::VetoDetectorManager * m_vetoDetMgr; + static const ScintDD::VetoNuDetectorManager * m_vetoNuDetMgr; static const ScintDD::TriggerDetectorManager * m_triggerDetMgr; static const ScintDD::PreshowerDetectorManager * m_preshowerDetMgr; @@ -70,6 +73,7 @@ public: static const EmulsionID * m_emulsionIDHelper; static const VetoID * m_vetoIDHelper; + static const VetoNuID * m_vetoNuIDHelper; static const TriggerID * m_triggerIDHelper; static const PreshowerID * m_preshowerIDHelper; @@ -84,6 +88,7 @@ const char VP1DetInfo::Imp::m_badInitFlag = ' '; const NeutrinoDD::EmulsionDetectorManager * VP1DetInfo::Imp::m_emulsionDetMgr = 0; const ScintDD::VetoDetectorManager * VP1DetInfo::Imp::m_vetoDetMgr = 0; +const ScintDD::VetoNuDetectorManager * VP1DetInfo::Imp::m_vetoNuDetMgr = 0; const ScintDD::TriggerDetectorManager * VP1DetInfo::Imp::m_triggerDetMgr = 0; const ScintDD::PreshowerDetectorManager * VP1DetInfo::Imp::m_preshowerDetMgr = 0; @@ -96,6 +101,7 @@ const FaserDetectorID * VP1DetInfo::Imp::m_faserIDHelper = 0; const EmulsionID * VP1DetInfo::Imp::m_emulsionIDHelper = 0; const VetoID * VP1DetInfo::Imp::m_vetoIDHelper = 0; +const VetoNuID * VP1DetInfo::Imp::m_vetoNuIDHelper = 0; const TriggerID * VP1DetInfo::Imp::m_triggerIDHelper = 0; const PreshowerID * VP1DetInfo::Imp::m_preshowerIDHelper = 0; @@ -144,6 +150,7 @@ const T * VP1DetInfo::Imp::cachedRetrieve(const T*& cachedPtr, const char* prefe const NeutrinoDD::EmulsionDetectorManager * VP1DetInfo::emulsionDetMgr() { return Imp::cachedRetrieve(Imp::m_emulsionDetMgr,"Emulsion",VP1JobConfigInfo::hasEmulsionGeometry()); } const ScintDD::VetoDetectorManager * VP1DetInfo::vetoDetMgr() { return Imp::cachedRetrieve(Imp::m_vetoDetMgr,"Veto",VP1JobConfigInfo::hasVetoGeometry()); } +const ScintDD::VetoNuDetectorManager * VP1DetInfo::vetoNuDetMgr() { return Imp::cachedRetrieve(Imp::m_vetoNuDetMgr,"VetoNu",VP1JobConfigInfo::hasVetoNuGeometry()); } const ScintDD::TriggerDetectorManager * VP1DetInfo::triggerDetMgr() { return Imp::cachedRetrieve(Imp::m_triggerDetMgr,"Trigger",VP1JobConfigInfo::hasTriggerGeometry()); } const ScintDD::PreshowerDetectorManager * VP1DetInfo::preshowerDetMgr() { return Imp::cachedRetrieve(Imp::m_preshowerDetMgr,"Preshower",VP1JobConfigInfo::hasPreshowerGeometry()); } @@ -156,6 +163,7 @@ const FaserDetectorID * VP1DetInfo::faserIDHelper() { return Imp::cachedRetrieve const EmulsionID * VP1DetInfo::emulsionIDHelper() { return Imp::cachedRetrieve(Imp::m_emulsionIDHelper,"EmulsionID",VP1JobConfigInfo::hasEmulsionGeometry()); } const VetoID * VP1DetInfo::vetoIDHelper() { return Imp::cachedRetrieve(Imp::m_vetoIDHelper,"VetoID",VP1JobConfigInfo::hasVetoGeometry()); } +const VetoNuID * VP1DetInfo::vetoNuIDHelper() { return Imp::cachedRetrieve(Imp::m_vetoNuIDHelper,"VetoNuID",VP1JobConfigInfo::hasVetoNuGeometry()); } const TriggerID * VP1DetInfo::triggerIDHelper() { return Imp::cachedRetrieve(Imp::m_triggerIDHelper,"TriggerID",VP1JobConfigInfo::hasTriggerGeometry()); } const PreshowerID * VP1DetInfo::preshowerIDHelper() { return Imp::cachedRetrieve(Imp::m_preshowerIDHelper,"PreshowerID",VP1JobConfigInfo::hasPreshowerGeometry()); } @@ -179,6 +187,8 @@ bool VP1DetInfo::isUnsafe( const Identifier& id ) { if (idhelper->is_scint(id)) { if (!VP1JobConfigInfo::hasVetoGeometry() && idhelper->is_veto(id)) return true; + if (!VP1JobConfigInfo::hasVetoNuGeometry() && idhelper->is_vetonu(id)) + return true; if (!VP1JobConfigInfo::hasTriggerGeometry() && idhelper->is_trigger(id)) return true; if (!VP1JobConfigInfo::hasPreshowerGeometry() && idhelper->is_preshower(id)) diff --git a/graphics/VTI12/VTI12Utils/src/VP1JobConfigInfo.cxx b/graphics/VTI12/VTI12Utils/src/VP1JobConfigInfo.cxx index 03a305c6851e984faa31a33eec57e41f11297177..bd325e0d306fb4c93cdc23b82683cf6ac5244e7a 100644 --- a/graphics/VTI12/VTI12Utils/src/VP1JobConfigInfo.cxx +++ b/graphics/VTI12/VTI12Utils/src/VP1JobConfigInfo.cxx @@ -37,6 +37,7 @@ public: static bool hasGeoModelExperiment; static bool hasEmulsionGeometry; static bool hasVetoGeometry; + static bool hasVetoNuGeometry; static bool hasTriggerGeometry; static bool hasPreshowerGeometry; static bool hasSCTGeometry; @@ -52,6 +53,7 @@ bool VP1JobConfigInfo::Imp::initialised = false; bool VP1JobConfigInfo::Imp::hasGeoModelExperiment = false; bool VP1JobConfigInfo::Imp::hasEmulsionGeometry = false; bool VP1JobConfigInfo::Imp::hasVetoGeometry = false; +bool VP1JobConfigInfo::Imp::hasVetoNuGeometry = false; bool VP1JobConfigInfo::Imp::hasTriggerGeometry = false; bool VP1JobConfigInfo::Imp::hasPreshowerGeometry = false; bool VP1JobConfigInfo::Imp::hasSCTGeometry = false; @@ -64,6 +66,7 @@ void VP1JobConfigInfo::Imp::turnOffAll() hasGeoModelExperiment = false; hasEmulsionGeometry = false; hasVetoGeometry = false; + hasVetoNuGeometry = false; hasTriggerGeometry = false; hasPreshowerGeometry = false; hasSCTGeometry = false; @@ -89,12 +92,15 @@ void VP1JobConfigInfo::Imp::ensureInit() VP1Msg::messageVerbose("VTI12JobConfigInfo => hasGeoModelExperiment = "+QString(hasGeoModelExperiment?"On":"Off")); VP1Msg::messageVerbose("VTI12JobConfigInfo => hasEmulsionGeometry = "+QString(hasEmulsionGeometry?"On":"Off")); VP1Msg::messageVerbose("VTI12JobConfigInfo => hasVetoGeometry = "+QString(hasVetoGeometry?"On":"Off")); + VP1Msg::messageVerbose("VTI12JobConfigInfo => hasVetoNuGeometry = "+QString(hasVetoNuGeometry?"On":"Off")); VP1Msg::messageVerbose("VTI12JobConfigInfo => hasTriggerGeometry = "+QString(hasTriggerGeometry?"On":"Off")); VP1Msg::messageVerbose("VTI12JobConfigInfo => hasPreshowerGeometry = "+QString(hasPreshowerGeometry?"On":"Off")); VP1Msg::messageVerbose("VTI12JobConfigInfo => hasSCTGeometry = "+QString(hasSCTGeometry?"On":"Off")); VP1Msg::messageVerbose("VTI12JobConfigInfo => hasEcalGeometry = "+QString(hasEcalGeometry?"On":"Off")); + VP1Msg::messageVerbose("VTI12JobConfigInfo => hasCavernInfraGeometry = "+QString(hasCavernInfraGeometry?"On":"Off")); + } } @@ -103,12 +109,14 @@ void VP1JobConfigInfo::Imp::ensureInit() bool VP1JobConfigInfo::hasGeoModelExperiment() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasGeoModelExperiment; } bool VP1JobConfigInfo::hasEmulsionGeometry() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasEmulsionGeometry; } bool VP1JobConfigInfo::hasVetoGeometry() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasVetoGeometry; } +bool VP1JobConfigInfo::hasVetoNuGeometry() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasVetoNuGeometry; } bool VP1JobConfigInfo::hasTriggerGeometry() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasTriggerGeometry; } bool VP1JobConfigInfo::hasPreshowerGeometry() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasPreshowerGeometry; } bool VP1JobConfigInfo::hasSCTGeometry() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasSCTGeometry; } bool VP1JobConfigInfo::hasEcalGeometry() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasEcalGeometry; } +bool VP1JobConfigInfo::hasCavernInfraGeometry() { if (!Imp::initialised) Imp::ensureInit(); return Imp::hasCavernInfraGeometry; } //____________________________________________________________________ bool VP1JobConfigInfo::Imp::actualInit( StoreGateSvc* detStore ) @@ -159,10 +167,12 @@ bool VP1JobConfigInfo::Imp::actualInit( StoreGateSvc* detStore ) VP1Msg::message( QString { name.c_str() } ); if ( !hasEmulsionGeometry && name=="Emulsion") hasEmulsionGeometry = true; if ( !hasVetoGeometry && name=="Veto") hasVetoGeometry = true; + if ( !hasVetoNuGeometry && name=="VetoNu") hasVetoNuGeometry = true; if ( !hasTriggerGeometry && name=="Trigger") hasTriggerGeometry = true; if ( !hasPreshowerGeometry && name=="Preshower") hasPreshowerGeometry = true; if ( !hasSCTGeometry && name=="SCT") hasSCTGeometry = true; if ( !hasEcalGeometry && name=="Ecal") hasEcalGeometry = true; + if ( !hasCavernInfraGeometry && name == "Trench") hasCavernInfraGeometry = true; //FIXME: Look for CavernInfra as well!!!