From 3cf2bfec8d7f73a288cfe563e4f61c39291f1c93 Mon Sep 17 00:00:00 2001 From: Eric Torrence <eric.torrence@cern.ch> Date: Fri, 11 Nov 2022 08:07:08 +0100 Subject: [PATCH] Updates for new conditions global tag OFLCOND-FASER-03 --- .../Digitization/scripts/faserMDC_digi.py | 2 +- .../scripts/faserMDC_digi_merge.py | 2 +- .../Digitization/scripts/faser_digi.py | 2 +- .../Digitization/scripts/faser_digi_merge.py | 2 +- .../Generation/scripts/faserMDC_foresee.py | 2 +- .../scripts/faserMDC_particlegun.py | 2 +- .../Generation/scripts/faser_particlegun.py | 4 +- .../GeoModelTest/python/Faser03TestConfig.py | 2 +- .../Reconstruction/scripts/faserMDC_reco.py | 4 +- .../Reconstruction/scripts/faser_reco.py | 6 +- .../python/SimHitExampleConfig.py | 2 +- .../Simulation/scripts/faserMDC_simulate.py | 2 +- .../scripts/runTruthCnv.py | 2 +- Derviation/DerivationAlgs/share/runDerive.py | 2 +- .../DerivationAlgs/share/run_streaming.py | 2 +- .../python/FilterSearchConfig.py | 2 +- .../python/FlukaSearchConfig.py | 1 + README.md | 2 + Simulation/G4Faser/G4FaserAlg/CMakeLists.txt | 5 + .../test/G4FaserAlgConfigNew_Test.py | 2 +- .../FaserSCT_ConditionsData/README.md | 33 ++++ .../data/BField_Conditions_Update03.py | 158 ++++++++++++++++++ .../data/BField_DataConditions.py | 28 +++- .../share/NoisyStripFinderJob.py | 2 +- .../test/NoisyStripFinderDbg.py | 2 +- .../test/TI12TrackerSegmentFitDataDbg.py | 2 +- .../test/TrackerSegmentFitDbg.py | 4 +- .../FaserActsMaterialMapping_jobOptions.py | 2 +- .../test/FaserActsWriteTrackingGeometry.py | 2 +- .../Acts/FaserActsKalmanFilter/test/CKF2.py | 2 +- .../FaserActsKalmanFilter/test/TI12CKF2.py | 2 +- .../test/TI12KalmanFilter.py | 2 +- .../WaveformDigiAndRecoExample_jobOptions.py | 2 +- 33 files changed, 253 insertions(+), 38 deletions(-) create mode 100644 Tracker/TrackerConditions/FaserSCT_ConditionsData/README.md create mode 100755 Tracker/TrackerConditions/FaserSCT_ConditionsData/data/BField_Conditions_Update03.py diff --git a/Control/CalypsoExample/Digitization/scripts/faserMDC_digi.py b/Control/CalypsoExample/Digitization/scripts/faserMDC_digi.py index 1154edd8..4c7dba7e 100755 --- a/Control/CalypsoExample/Digitization/scripts/faserMDC_digi.py +++ b/Control/CalypsoExample/Digitization/scripts/faserMDC_digi.py @@ -81,7 +81,7 @@ elif runtype == "TestBeamMC" : # New TI12 geometry (ugh) elif runtype == "TI12MC": ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" else: print("Invalid run type found:", runtype) diff --git a/Control/CalypsoExample/Digitization/scripts/faserMDC_digi_merge.py b/Control/CalypsoExample/Digitization/scripts/faserMDC_digi_merge.py index a421cead..8ee8d6f7 100755 --- a/Control/CalypsoExample/Digitization/scripts/faserMDC_digi_merge.py +++ b/Control/CalypsoExample/Digitization/scripts/faserMDC_digi_merge.py @@ -154,7 +154,7 @@ elif runtype == "TestBeamMC" : # New TI12 geometry (ugh) elif runtype == "TI12MC": ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" else: print("Invalid run type found:", runtype) diff --git a/Control/CalypsoExample/Digitization/scripts/faser_digi.py b/Control/CalypsoExample/Digitization/scripts/faser_digi.py index 72f890a3..40fb1915 100755 --- a/Control/CalypsoExample/Digitization/scripts/faser_digi.py +++ b/Control/CalypsoExample/Digitization/scripts/faser_digi.py @@ -78,7 +78,7 @@ elif runtype == "TestBeamMC" : # New TI12 geometry (ugh) elif runtype == "TI12MC": ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" else: print("Invalid geometry type found:", runtype) diff --git a/Control/CalypsoExample/Digitization/scripts/faser_digi_merge.py b/Control/CalypsoExample/Digitization/scripts/faser_digi_merge.py index ea135db8..1be2af2d 100755 --- a/Control/CalypsoExample/Digitization/scripts/faser_digi_merge.py +++ b/Control/CalypsoExample/Digitization/scripts/faser_digi_merge.py @@ -168,7 +168,7 @@ elif runtype == "TestBeamMC" : # New TI12 geometry (ugh) elif runtype == "TI12MC": ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" else: print("Invalid run type found:", runtype) diff --git a/Control/CalypsoExample/Generation/scripts/faserMDC_foresee.py b/Control/CalypsoExample/Generation/scripts/faserMDC_foresee.py index f16b6a40..bec91103 100755 --- a/Control/CalypsoExample/Generation/scripts/faserMDC_foresee.py +++ b/Control/CalypsoExample/Generation/scripts/faserMDC_foresee.py @@ -76,7 +76,7 @@ if __name__ == '__main__': ConfigFlags.addFlag("Sim.Beam.yshift", 12.) ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Geometry set-up - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Conditions set-up + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Conditions set-up ConfigFlags.addFlag("Input.InitialTimeStamp", 0) # To avoid autoconfig ConfigFlags.GeoModel.Align.Dynamic = False diff --git a/Control/CalypsoExample/Generation/scripts/faserMDC_particlegun.py b/Control/CalypsoExample/Generation/scripts/faserMDC_particlegun.py index 98975a54..32d68b60 100755 --- a/Control/CalypsoExample/Generation/scripts/faserMDC_particlegun.py +++ b/Control/CalypsoExample/Generation/scripts/faserMDC_particlegun.py @@ -72,7 +72,7 @@ if __name__ == '__main__': ConfigFlags.addFlag("Sim.Beam.yshift", 0) ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Geometry set-up - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Conditions set-up + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Conditions set-up ConfigFlags.addFlag("Input.InitialTimeStamp", 0) # To avoid autoconfig ConfigFlags.GeoModel.Align.Dynamic = False diff --git a/Control/CalypsoExample/Generation/scripts/faser_particlegun.py b/Control/CalypsoExample/Generation/scripts/faser_particlegun.py index 6abdfdd4..cc1628ef 100755 --- a/Control/CalypsoExample/Generation/scripts/faser_particlegun.py +++ b/Control/CalypsoExample/Generation/scripts/faser_particlegun.py @@ -74,8 +74,8 @@ if __name__ == '__main__': if args.geom == "TI12MC": # 2022 TI12 geometry - ConfigFlags.GeoModel.FaserVersion = "FASERNU-02" # Geometry set-up - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Conditions set-up + ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Geometry set-up + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Conditions set-up # TI12 detectors detectors = ['Veto', 'VetoNu', 'Preshower', 'FaserSCT', 'Ecal', 'Trigger', 'Dipole', 'Emulsion', 'Trench'] diff --git a/Control/CalypsoExample/GeoModelTest/python/Faser03TestConfig.py b/Control/CalypsoExample/GeoModelTest/python/Faser03TestConfig.py index 70322eb1..bf562e1b 100644 --- a/Control/CalypsoExample/GeoModelTest/python/Faser03TestConfig.py +++ b/Control/CalypsoExample/GeoModelTest/python/Faser03TestConfig.py @@ -33,7 +33,7 @@ if __name__ == "__main__": # Flags for this job ConfigFlags.Input.isMC = True # Needed to bypass autoconfig - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # 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 diff --git a/Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py b/Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py index 6f5b224e..eddc43e2 100755 --- a/Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py +++ b/Control/CalypsoExample/Reconstruction/scripts/faserMDC_reco.py @@ -88,12 +88,12 @@ elif runtype == "TestBeamData" or runtype == "TestBeam2021": # New TI12 geometry (ugh) elif runtype == "TI12Data02": ConfigFlags.GeoModel.FaserVersion = "FASER-02" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Final 2022 TI12 geometry elif runtype == "TI12Data03": ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" else: print("Invalid run type found:", runtype) diff --git a/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py b/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py index 4e233bf4..fa86b883 100755 --- a/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py +++ b/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py @@ -119,12 +119,14 @@ elif runtype == "TestBeamData" or runtype == "TestBeamMC": # New TI12 geometry (ugh) elif runtype == "TI12Data02": ConfigFlags.GeoModel.FaserVersion = "FASER-02" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Final 2022 TI12 geometry elif runtype == "TI12Data03": ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + # ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" + # Use the updated field map + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" else: print("Invalid run type found:", runtype) diff --git a/Control/CalypsoExample/SimHitExample/python/SimHitExampleConfig.py b/Control/CalypsoExample/SimHitExample/python/SimHitExampleConfig.py index 5e71b860..aec94afc 100644 --- a/Control/CalypsoExample/SimHitExample/python/SimHitExampleConfig.py +++ b/Control/CalypsoExample/SimHitExample/python/SimHitExampleConfig.py @@ -32,7 +32,7 @@ if __name__ == "__main__": # Flags for this job ConfigFlags.Input.Files = ["my.HITS.pool.root"] # input file(s) ConfigFlags.Input.isMC = True # Needed to bypass autoconfig - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersion ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Default FASER geometry ConfigFlags.Detector.GeometryEmulsion = True ConfigFlags.Detector.GeometryTrench = True diff --git a/Control/CalypsoExample/Simulation/scripts/faserMDC_simulate.py b/Control/CalypsoExample/Simulation/scripts/faserMDC_simulate.py index 0fd9622d..1cdb6825 100755 --- a/Control/CalypsoExample/Simulation/scripts/faserMDC_simulate.py +++ b/Control/CalypsoExample/Simulation/scripts/faserMDC_simulate.py @@ -147,7 +147,7 @@ if __name__ == '__main__': ConfigFlags.addFlag("Sim.Beam.yshift", args.yshift) ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Geometry set-up - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Conditions set-up + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Conditions set-up ConfigFlags.addFlag("Input.InitialTimeStamp", 0) # To avoid autoconfig ConfigFlags.GeoModel.Align.Dynamic = False diff --git a/Control/CalypsoExample/xAODTruthConversion/scripts/runTruthCnv.py b/Control/CalypsoExample/xAODTruthConversion/scripts/runTruthCnv.py index b51b4d4b..5e63ecce 100644 --- a/Control/CalypsoExample/xAODTruthConversion/scripts/runTruthCnv.py +++ b/Control/CalypsoExample/xAODTruthConversion/scripts/runTruthCnv.py @@ -52,7 +52,7 @@ if __name__ == "__main__": # Flags for this job ConfigFlags.Input.isMC = True # Needed to bypass autoconfig - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersion ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Default FASER geometry ConfigFlags.Input.Files = ['my.HITS.pool.root'] ConfigFlags.Output.doWriteAOD = True diff --git a/Derviation/DerivationAlgs/share/runDerive.py b/Derviation/DerivationAlgs/share/runDerive.py index b8b22c18..019c6ad2 100644 --- a/Derviation/DerivationAlgs/share/runDerive.py +++ b/Derviation/DerivationAlgs/share/runDerive.py @@ -48,7 +48,7 @@ if __name__ == "__main__": #"/bundle/data/FASER/Ti12data/filter/r0008/007983/Faser-Physics-007983-TrigMask08-r0008-xAOD.root" ] - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersionS + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersionS ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now ConfigFlags.Input.ProjectName = "data21" # Needed to bypass autoconfig ConfigFlags.Input.isMC = False # Needed to bypass autoconfig diff --git a/Derviation/DerivationAlgs/share/run_streaming.py b/Derviation/DerivationAlgs/share/run_streaming.py index 3ebacb78..13fcf2d7 100644 --- a/Derviation/DerivationAlgs/share/run_streaming.py +++ b/Derviation/DerivationAlgs/share/run_streaming.py @@ -23,7 +23,7 @@ if __name__ == "__main__": "/eos/experiment/faser/rec/2022/p0008/007984/Faser-Physics-007984-00000-p0008-xAOD.root" ] - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersionS + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersionS ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now ConfigFlags.Input.ProjectName = "data21" # Needed to bypass autoconfig ConfigFlags.Input.isMC = False # Needed to bypass autoconfig diff --git a/PhysicsAnalysis/NeutrinoSearch/python/FilterSearchConfig.py b/PhysicsAnalysis/NeutrinoSearch/python/FilterSearchConfig.py index 9b76c14b..1bea526e 100644 --- a/PhysicsAnalysis/NeutrinoSearch/python/FilterSearchConfig.py +++ b/PhysicsAnalysis/NeutrinoSearch/python/FilterSearchConfig.py @@ -482,7 +482,7 @@ if __name__ == "__main__": ] - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersionS + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersionS ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now ConfigFlags.Input.ProjectName = "data21" # Needed to bypass autoconfig ConfigFlags.Input.isMC = False # Needed to bypass autoconfig diff --git a/PhysicsAnalysis/NeutrinoSearch/python/FlukaSearchConfig.py b/PhysicsAnalysis/NeutrinoSearch/python/FlukaSearchConfig.py index 4e196a37..b26b82df 100644 --- a/PhysicsAnalysis/NeutrinoSearch/python/FlukaSearchConfig.py +++ b/PhysicsAnalysis/NeutrinoSearch/python/FlukaSearchConfig.py @@ -92,6 +92,7 @@ if __name__ == "__main__": '/run/media/dcasper/Data/faser/fluka/210002/rec/r0008/FaserMC-MDC_Fluka_unit30_Pm_71m_m3750_v3-210002-00014-s0005-r0008-xAOD.root', '/run/media/dcasper/Data/faser/fluka/210002/rec/r0008/FaserMC-MDC_Fluka_unit30_Pm_71m_m3750_v3-210002-00015-s0005-r0008-xAOD.root' ] + # Update this for samples with new field map ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersionS ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now ConfigFlags.Input.ProjectName = "data21" # Needed to bypass autoconfig diff --git a/README.md b/README.md index 2d7e57ab..bcd917f0 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,8 @@ When compiling, CERN IT recommends using condor to submit batch jobs. The basics ** `ConfigFlags.GeoModel.FaserVersion = "FASERNU-03"` 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-03` enables the full FaserNu (IFT + emulsion) setup with updated (10Nov22) magnetic field map + ** `ConfigFlags.GeoModel.FaserVersion = "FASER-TB00"` and `ConfigFlags.IOVDb.GlobalTag = OFLCOND-FASER-TB00` enables the 2021 Test-beam setup. * 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/Simulation/G4Faser/G4FaserAlg/CMakeLists.txt b/Simulation/G4Faser/G4FaserAlg/CMakeLists.txt index 35042d81..979897a9 100644 --- a/Simulation/G4Faser/G4FaserAlg/CMakeLists.txt +++ b/Simulation/G4Faser/G4FaserAlg/CMakeLists.txt @@ -36,6 +36,11 @@ atlas_add_test( G4FaserAlgConfig_TestFaserNu PROPERTIES TIMEOUT 300 PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +atlas_add_test( G4FaserAlgConfig_TestFaserNu_NewField + SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/G4FaserAlgConfigNew_Test.py GeoModel.FaserVersion="'FASERNU-03'" IOVDb.GlobalTag="'OFLCOND-FASER-03'" Output.HITSFileName='faserNu.HITS.pool.root' + PROPERTIES TIMEOUT 300 + PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + atlas_add_test( G4FaserAlgConfig_TestTestbeam SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/G4FaserAlgConfigNew_Test.py GeoModel.FaserVersion="'FASER-TB00'" IOVDb.GlobalTag="'OFLCOND-FASER-TB00'" Output.HITSFileName='tb.HITS.pool.root' PROPERTIES TIMEOUT 300 diff --git a/Simulation/G4Faser/G4FaserAlg/test/G4FaserAlgConfigNew_Test.py b/Simulation/G4Faser/G4FaserAlg/test/G4FaserAlgConfigNew_Test.py index 998b40c2..d7ea3c3a 100755 --- a/Simulation/G4Faser/G4FaserAlg/test/G4FaserAlgConfigNew_Test.py +++ b/Simulation/G4Faser/G4FaserAlg/test/G4FaserAlgConfigNew_Test.py @@ -49,7 +49,7 @@ if __name__ == '__main__': ConfigFlags.addFlag("Sim.Beam.yshift", 0) ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Geometry set-up - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Conditions set-up + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Conditions set-up ConfigFlags.addFlag("Input.InitialTimeStamp", 0) # To avoid autoconfig ConfigFlags.GeoModel.Align.Dynamic = False # diff --git a/Tracker/TrackerConditions/FaserSCT_ConditionsData/README.md b/Tracker/TrackerConditions/FaserSCT_ConditionsData/README.md new file mode 100644 index 00000000..8025a4b1 --- /dev/null +++ b/Tracker/TrackerConditions/FaserSCT_ConditionsData/README.md @@ -0,0 +1,33 @@ +# FaserSCT_ConditionsData + +For more information on conditions in general, see [[https://twiki.cern.ch/twiki/bin/view/FASER/OfflineDatabases][OfflineDatabases]]. + +## Creating databases + +The scripts +``` +data/SCT_Conditions.py +data/BField_DataConditions.py +``` +were used to create the intial databases for MC (OFLP200) and data (CONDBR3). + +## Updating field map + +The following was used to update the magnetic field map on 10 Nov. 22: +``` +cp /cvmfs/faser.cern.ch/repo/sw/database/DBRelease/current/sqlite200/ALLP200.db . + +# This creates new field and scale entries with tag OFLCOND-FASER-03 in mysqlite.db +BField_Conditions_Update03.py + +# Now we need to merge this into the existing DB +AtlCoolCopy "sqlite://;schema=mysqlite.db;dbname=OFLP200" "sqlite://;schema=ALLP200.db;dbname=OFLP200" +AtlCoolCopy "sqlite://;schema=mysqlite.db;dbname=CONDBR3" "sqlite://;schema=ALLP200.db;dbname=CONDBR3" + +# For the MC instance, we also need to associate the existing /SCT and /Tracker tags +AtlCoolConsole.py "sqlite://;schema=ALLP200.db;dbname=OFLP200" +settag /SCT SCT-02 OFLCOND-FASER-03 +settag /Tracker TRACKER-02 OFLCOND-FASER-03 +``` + +After installing the new tags in ALLP200.db, we can test this locally by copying it to the data/sqlite200 subdirectory of the run directory, and eventually install it on cvmfs. diff --git a/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/BField_Conditions_Update03.py b/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/BField_Conditions_Update03.py new file mode 100755 index 00000000..8a99a5fb --- /dev/null +++ b/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/BField_Conditions_Update03.py @@ -0,0 +1,158 @@ +#!/bin/env python + +# This script was used to add a new tag for the BField to both +# the real data (CONDBR3) and MC (OFLP200) instances. +# This writes out to mysqlite.db which then needs to be merged +# with the production database using: +# AtlCoolCopy "sqlite://;schema=mysqlite.db;dbname=CONDBR3" "sqlite://;schema=ALLP200.db;dbname=CONDBR3" + +description = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header clid="1238547719" service_type="71" /></addrHeader><typeName>CondAttrListCollection</typeName>' + +descriptionDCS = '<timeStamp>time</timeStamp><addrHeader><address_header service_type="71" clid="1238547719" /></addrHeader><typeName>CondAttrListCollection</typeName><cache>600</cache>' + +descriptionAlign = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="256" clid="1170039409" /></addrHeader><typeName>AlignableTransformContainer</typeName>' + +import sys +from PyCool import cool, coral +from CoolConvUtilities.AtlCoolLib import forceOpen + +print('generating new field database') + +dbSvc = cool.DatabaseSvcFactory.databaseService() +connectString = 'sqlite://;schema=mysqlite.db;dbname=CONDBR3' + +# This should open or create as needed +try: + print(f'forceOpen({connectString})') + db = forceOpen( connectString ) +except Exception as e: + print(e) + print('Problem opening DB!') + sys.exit(1) + +# Hierarchy of new tag is: +# OFLCOND-FASER-02 : GLOBAL-03 : GLOBAL-BField-03 : GLOBAL-BField-Maps-03 + +# Create new tag +glob = db.createFolderSet("/GLOBAL") +glob_bfield = db.createFolderSet("/GLOBAL/BField") + +glob_bfield.createTagRelation("GLOBAL-03", "GLOBAL-BField-03") +glob.createTagRelation("OFLCOND-FASER-03", "GLOBAL-03") + +print("Created tag GLOBAL-BField-03 and associated to OFLCOND-FASER-03") + +mapSpec = cool.RecordSpecification() +mapSpec.extend( 'FieldType', cool.StorageType.String4k ) +mapSpec.extend( 'MapFileName', cool.StorageType.String4k ) + +mapFolderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, mapSpec) +mapFolder = db.createFolder('/GLOBAL/BField/Maps', mapFolderSpec, descriptionDCS, True ) + +# New entry +mapRecord = cool.Record(mapSpec) +mapRecord['FieldType'] = "GlobalMap" +mapRecord['MapFileName'] = "file:MagneticFieldMaps/FaserFieldTable_v2.root" + +mapFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, mapRecord, 1, "GLOBAL-BField-Maps-03", True ) +mapFolder.createTagRelation("GLOBAL-BField-03", "GLOBAL-BField-Maps-03") + +print("Created new entry in /GLOBAL/BField/Maps with tag GLOBAL-BField-Maps-03") + +# Also update the scale (since it sits in the same tag area) +scaleSpec = cool.RecordSpecification() +scaleSpec.extend( 'value', cool.StorageType.Float ) + +scaleRecord = cool.Record(scaleSpec) +scaleRecord['value'] = 1.0 + +scaleFolderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, scaleSpec) +scaleFolder = db.createFolder('/GLOBAL/BField/Scales', scaleFolderSpec, descriptionDCS, True ) + +# Channel names don't seem to be handled properly by Athena +scaleFolder.createChannel( 1, "Dipole_Scale" ) + +scaleFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, scaleRecord, 1, "GLOBAL-BField-Scale-03", True ) +scaleFolder.createTagRelation("GLOBAL-BField-03", "GLOBAL-BField-Scale-03") + +print("Created new entry in /GLOBAL/BField/Maps with tag GLOBAL-BField-Scale-03") + +# These are the only tags in the CONDBR3 instance, so we are done + +db.closeDatabase() + +# Now do it again for the MC instance + +connectString = 'sqlite://;schema=mysqlite.db;dbname=OFLP200' + +# This should open or create as needed +try: + print(f'forceOpen({connectString})') + db = forceOpen( connectString ) +except Exception as e: + print(e) + print('Problem opening DB!') + sys.exit(1) + +# Create new tag +glob = db.createFolderSet("/GLOBAL") +glob_bfield = db.createFolderSet("/GLOBAL/BField") + +glob_bfield.createTagRelation("GLOBAL-03", "GLOBAL-BField-03") +glob.createTagRelation("OFLCOND-FASER-03", "GLOBAL-03") + +print("Created tag GLOBAL-BField-03 and associated to OFLCOND-FASER-03") + +mapSpec = cool.RecordSpecification() +mapSpec.extend( 'FieldType', cool.StorageType.String4k ) +mapSpec.extend( 'MapFileName', cool.StorageType.String4k ) + +mapFolderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, mapSpec) +mapFolder = db.createFolder('/GLOBAL/BField/Maps', mapFolderSpec, descriptionDCS, True ) + +# New entry +mapRecord = cool.Record(mapSpec) +mapRecord['FieldType'] = "GlobalMap" +mapRecord['MapFileName'] = "file:MagneticFieldMaps/FaserFieldTable_v2.root" + +mapFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, mapRecord, 1, "GLOBAL-BField-Maps-03", True ) +mapFolder.createTagRelation("GLOBAL-BField-03", "GLOBAL-BField-Maps-03") + +print("Created new entry in /GLOBAL/BField/Maps with tag GLOBAL-BField-Maps-03") + +# Also update the scale (since it sits in the same tag area) +scaleSpec = cool.RecordSpecification() +scaleSpec.extend( 'value', cool.StorageType.Float ) + +scaleRecord = cool.Record(scaleSpec) +scaleRecord['value'] = 1.0 + +scaleFolderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, scaleSpec) +scaleFolder = db.createFolder('/GLOBAL/BField/Scales', scaleFolderSpec, descriptionDCS, True ) + +# Channel names don't seem to be handled properly by Athena +scaleFolder.createChannel( 1, "Dipole_Scale" ) + +scaleFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, scaleRecord, 1, "GLOBAL-BField-Scale-03", True ) +scaleFolder.createTagRelation("GLOBAL-BField-03", "GLOBAL-BField-Scale-03") + +print("Created new entry in /GLOBAL/BField/Maps with tag GLOBAL-BField-Scale-03") + +# Also make associations to /SCT and /TRACKER tags +#sct = db.createFolderSet("/SCT") +#sct.createTagRelation("OFLCOND-FASER-03", "SCT-02") +#tracker = db.createFolderSet("/Tracker") +#tracker.createTagRelation("OFLCOND-FASER-03", "TRACKER-02") +#print("Associated old tags for /SCT and /Tracker to OFLCOND-FASER-03") + +# This doesn't work. +# Instead, we need to go into AtlCoolConsole.py and +# set the association there. +# +# settag /SCT SCT-02 OFLCOND-FASER-03 +# settag /Tracker TRACKER-02 OFLCOND-FASER-03 +# +# Check that this worked: +# tracetags / OFLCOND-FASER-03 + +db.closeDatabase() diff --git a/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/BField_DataConditions.py b/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/BField_DataConditions.py index 94846ee8..9fb21099 100755 --- a/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/BField_DataConditions.py +++ b/Tracker/TrackerConditions/FaserSCT_ConditionsData/data/BField_DataConditions.py @@ -3,6 +3,10 @@ # Use this to add a field map to the CONDBR3 database for real data # Copied the result from the OFLP200 DB # Note that the testbeam turns off the field by setting scale = 0 + +# This file creates the DB from scratch +# To add new tags, look at BField_Conditions_Update03.py + description = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header clid="1238547719" service_type="71" /></addrHeader><typeName>CondAttrListCollection</typeName>' descriptionDCS = '<timeStamp>time</timeStamp><addrHeader><address_header service_type="71" clid="1238547719" /></addrHeader><typeName>CondAttrListCollection</typeName><cache>600</cache>' @@ -11,7 +15,7 @@ descriptionAlign = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header s import sys from PyCool import cool, coral -from CoolConvUtilities.AtlCoolLib import indirectOpen +from CoolConvUtilities.AtlCoolLib import forceOpen dbSvc = cool.DatabaseSvcFactory.databaseService() connectString = 'sqlite://;schema=ALLP200.db;dbname=CONDBR3' @@ -20,8 +24,9 @@ print('generating field database') #dbSvc.dropDatabase( connectString ) try: # Open existing instead? - print('Try indirectOpen') - db = indirectOpen( connectString, readOnly=False ) + # This actually should open or create as needed + print(f'Try forceOpen({connectString})') + db = forceOpen( connectString ) except Exception as e: print(e) print('Problem opening DB, create instead') @@ -36,6 +41,9 @@ glob.createTagRelation("OFLCOND-FASER-01", "GLOBAL-01") glob_bfield.createTagRelation("GLOBAL-02", "GLOBAL-BField-02") glob.createTagRelation("OFLCOND-FASER-02", "GLOBAL-02") +glob_bfield.createTagRelation("GLOBAL-03", "GLOBAL-BField-03") +glob.createTagRelation("OFLCOND-FASER-03", "GLOBAL-03") + glob_bfield.createTagRelation("GLOBAL-TB00", "GLOBAL-BField-TB00") glob.createTagRelation("OFLCOND-FASER-TB00", "GLOBAL-TB00") @@ -43,13 +51,13 @@ mapSpec = cool.RecordSpecification() mapSpec.extend( 'FieldType', cool.StorageType.String4k ) mapSpec.extend( 'MapFileName', cool.StorageType.String4k ) -mapRecord = cool.Record(mapSpec) -mapRecord['FieldType'] = "GlobalMap" -mapRecord['MapFileName'] = "file:MagneticFieldMaps/FaserFieldTable.root" - mapFolderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, mapSpec) mapFolder = db.createFolder('/GLOBAL/BField/Maps', mapFolderSpec, descriptionDCS, True ) +mapRecord = cool.Record(mapSpec) +mapRecord['FieldType'] = "GlobalMap" +mapRecord['MapFileName'] = "file:MagneticFieldMaps/FaserFieldTable_v101.root" + mapFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, mapRecord, 1, "GLOBAL-BField-Maps-01", True ) mapFolder.createTagRelation("GLOBAL-BField-01", "GLOBAL-BField-Maps-01") @@ -59,6 +67,12 @@ mapFolder.createTagRelation("GLOBAL-BField-02", "GLOBAL-BField-Maps-02") mapFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, mapRecord, 1, "GLOBAL-BField-Maps-TB00", True ) mapFolder.createTagRelation("GLOBAL-BField-TB00", "GLOBAL-BField-Maps-TB00") +# New record +mapRecord['MapFileName'] = "file:MagneticFieldMaps/FaserFieldTable_v2.root" + +mapFolder.storeObject( cool.ValidityKeyMin, cool.ValidityKeyMax, mapRecord, 1, "GLOBAL-BField-Maps-03", True ) +mapFolder.createTagRelation("GLOBAL-BField-03", "GLOBAL-BField-Maps-03") + scaleSpec = cool.RecordSpecification() scaleSpec.extend( 'value', cool.StorageType.Float ) diff --git a/Tracker/TrackerRecAlgs/NoisyStripFinder/share/NoisyStripFinderJob.py b/Tracker/TrackerRecAlgs/NoisyStripFinder/share/NoisyStripFinderJob.py index b6dc5c51..e8c30445 100755 --- a/Tracker/TrackerRecAlgs/NoisyStripFinder/share/NoisyStripFinderJob.py +++ b/Tracker/TrackerRecAlgs/NoisyStripFinder/share/NoisyStripFinderJob.py @@ -39,7 +39,7 @@ for filename in args.file: filelist.append(filename) ConfigFlags.Input.Files = args.file -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" #ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" ConfigFlags.IOVDb.DatabaseInstance = "CONDBR3" ConfigFlags.Input.ProjectName = "data22" diff --git a/Tracker/TrackerRecAlgs/NoisyStripFinder/test/NoisyStripFinderDbg.py b/Tracker/TrackerRecAlgs/NoisyStripFinder/test/NoisyStripFinderDbg.py index f1d2ef14..8b31e1b3 100755 --- a/Tracker/TrackerRecAlgs/NoisyStripFinder/test/NoisyStripFinderDbg.py +++ b/Tracker/TrackerRecAlgs/NoisyStripFinder/test/NoisyStripFinderDbg.py @@ -24,7 +24,7 @@ log.setLevel(DEBUG) Configurable.configurableRun3Behavior = True ConfigFlags.Input.Files = args.file -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" ConfigFlags.Input.ProjectName = "data21" ConfigFlags.Input.isMC = False diff --git a/Tracker/TrackerRecAlgs/TrackerData/test/TI12TrackerSegmentFitDataDbg.py b/Tracker/TrackerRecAlgs/TrackerData/test/TI12TrackerSegmentFitDataDbg.py index b20d313f..e69cdca1 100644 --- a/Tracker/TrackerRecAlgs/TrackerData/test/TI12TrackerSegmentFitDataDbg.py +++ b/Tracker/TrackerRecAlgs/TrackerData/test/TI12TrackerSegmentFitDataDbg.py @@ -22,7 +22,7 @@ Configurable.configurableRun3Behavior = True ConfigFlags.Input.Files = ['/home/tboeckh/tmp/Faser-Physics-006470-00093.raw_middleStation.SPs'] ConfigFlags.Output.ESDFileName = "TrackerSegmentFitData.ESD.pool.root" ConfigFlags.addFlag("Output.xAODFileName", f"TrackerSegmentFitData_xAOD.root") -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" ConfigFlags.Input.ProjectName = "data21" ConfigFlags.Input.isMC = False diff --git a/Tracker/TrackerRecAlgs/TrackerSegmentFit/test/TrackerSegmentFitDbg.py b/Tracker/TrackerRecAlgs/TrackerSegmentFit/test/TrackerSegmentFitDbg.py index 75c46def..7ca10a8b 100644 --- a/Tracker/TrackerRecAlgs/TrackerSegmentFit/test/TrackerSegmentFitDbg.py +++ b/Tracker/TrackerRecAlgs/TrackerSegmentFit/test/TrackerSegmentFitDbg.py @@ -29,7 +29,7 @@ ConfigFlags.Input.Files = [ '/eos/project-f/faser-commissioning/TI12Data/Run-005684/Faser-Physics-005684-00000.raw', ] ConfigFlags.Output.ESDFileName = "run005684-00000.ESD.pool.root" -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersion ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now ConfigFlags.Input.ProjectName = "data21" # Needed to bypass autoconfig ConfigFlags.Input.isMC = False # Needed to bypass autoconfig @@ -98,4 +98,4 @@ replicaSvc.UseGeomSQLite = True sc = acc.run(maxEvents=-1) # Success should be 0 -sys.exit(not sc.isSuccess()) \ No newline at end of file +sys.exit(not sc.isSuccess()) diff --git a/Tracking/Acts/FaserActsGeometry/python/FaserActsMaterialMapping_jobOptions.py b/Tracking/Acts/FaserActsGeometry/python/FaserActsMaterialMapping_jobOptions.py index 92c1b603..9a7e4995 100644 --- a/Tracking/Acts/FaserActsGeometry/python/FaserActsMaterialMapping_jobOptions.py +++ b/Tracking/Acts/FaserActsGeometry/python/FaserActsMaterialMapping_jobOptions.py @@ -61,7 +61,7 @@ if "__main__" == __name__: ConfigFlags.Input.isMC = True ConfigFlags.Beam.Type = "collisions" ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersion ConfigFlags.TrackingGeometry.MaterialSource = "geometry-maps.json" ConfigFlags.GeoModel.Align.Dynamic = False diff --git a/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py b/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py index ed998b3b..196a8609 100644 --- a/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py +++ b/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py @@ -19,7 +19,7 @@ Configurable.configurableRun3Behavior = True # Configure ConfigFlags.Input.Files = ["myevt4.HITS.pool.root"] #ConfigFlags.Output.RDOFileName = "myRDO_sp.pool.root" -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersion ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Always needed #ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" # Always needed # Workaround for bug/missing flag; unimportant otherwise diff --git a/Tracking/Acts/FaserActsKalmanFilter/test/CKF2.py b/Tracking/Acts/FaserActsKalmanFilter/test/CKF2.py index 27c50d9a..3d8e9e3f 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/test/CKF2.py +++ b/Tracking/Acts/FaserActsKalmanFilter/test/CKF2.py @@ -27,7 +27,7 @@ Configurable.configurableRun3Behavior = True ConfigFlags.Input.Files = args.file ConfigFlags.addFlag("Output.xAODFileName", f"CKF.xAOD.root") ConfigFlags.Output.ESDFileName = "CKF.ESD.pool.root" -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" ConfigFlags.GeoModel.FaserVersion = "FASERNU-03" ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Beam.NumberOfCollisions = 0. diff --git a/Tracking/Acts/FaserActsKalmanFilter/test/TI12CKF2.py b/Tracking/Acts/FaserActsKalmanFilter/test/TI12CKF2.py index cf63c3e4..37ac15b2 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/test/TI12CKF2.py +++ b/Tracking/Acts/FaserActsKalmanFilter/test/TI12CKF2.py @@ -30,7 +30,7 @@ Configurable.configurableRun3Behavior = True ConfigFlags.Input.Files = args.file ConfigFlags.Output.ESDFileName = "CKF.ESD.pool.root" ConfigFlags.addFlag("Output.xAODFileName", f"CKF.xAOD.root") -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" ConfigFlags.Input.ProjectName = "data22" ConfigFlags.Input.isMC = False diff --git a/Tracking/Acts/FaserActsKalmanFilter/test/TI12KalmanFilter.py b/Tracking/Acts/FaserActsKalmanFilter/test/TI12KalmanFilter.py index 11b7e421..ed4be62c 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/test/TI12KalmanFilter.py +++ b/Tracking/Acts/FaserActsKalmanFilter/test/TI12KalmanFilter.py @@ -24,7 +24,7 @@ Configurable.configurableRun3Behavior = True ConfigFlags.Input.Files = ['/home/tboeckh/tmp/Faser-Physics-006470-00093.raw_middleStation.SPs'] ConfigFlags.Output.ESDFileName = "MiddleStation-KalmanFilter.ESD.pool.root" ConfigFlags.Output.AODFileName = "MiddleStation-KalmanFilter.AOD.pool.root" -ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" ConfigFlags.Input.ProjectName = "data21" ConfigFlags.Input.isMC = False diff --git a/Waveform/WaveDigiTools/share/WaveformDigiAndRecoExample_jobOptions.py b/Waveform/WaveDigiTools/share/WaveformDigiAndRecoExample_jobOptions.py index 77903182..cbe15504 100644 --- a/Waveform/WaveDigiTools/share/WaveformDigiAndRecoExample_jobOptions.py +++ b/Waveform/WaveDigiTools/share/WaveformDigiAndRecoExample_jobOptions.py @@ -21,7 +21,7 @@ if __name__ == "__main__": log.setLevel(VERBOSE) - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-02" # Always needed; must match FaserVersion + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-03" # Always needed; must match FaserVersion ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now ConfigFlags.Input.ProjectName = "mc21" # Needed to bypass autoconfig ConfigFlags.Input.isMC = True # Needed to bypass autoconfig -- GitLab