diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValFlags.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValFlags.py index a14c7296bb1c618bbb40947f606fff8f852627db..57c041715eebc5ccac8fe130428dd0ef3cdea940 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValFlags.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValFlags.py @@ -38,6 +38,8 @@ def createIDPVMConfigFlags(): icf.addFlag("doIDTIDE", False ) # for IDTIDE derivation icf.addFlag("doTechnicalEfficiency", False) # for enabling the filling of technical efficiency icf.addFlag("doPRW", False) - + icf.addFlag("doActs", False) + icf.addFlag("doHGTD", False) + return icf diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py index 9d524628b9238500725e9291b5324fcb49f1b99f..fd5de58118cb65b6450986b507ce2e64853e1e33 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/runIDPVM.py @@ -28,6 +28,7 @@ def GetCustomAthArgs(): IDPVMparser.add_argument("--doElectronMatchedTracks", help='run plots for tracks matched to true electrons', action='store_true', default=False) IDPVMparser.add_argument("--doTruthToRecoNtuple", help='output track-to-truth ntuple', action='store_true', default=False) IDPVMparser.add_argument("--doActs", help='run plots for acts collections', action='store_true', default=False) + IDPVMparser.add_argument("--doHGTD", help='run plots fof HGTD collections', action='store_true', default=False) IDPVMparser.add_argument("--disableDecoration", help='disable extra track and truth decoration if possible', action='store_true', default=False) IDPVMparser.add_argument("--hardScatterStrategy", help='Strategy to select the hard scatter. 0 = SumPt² 1 = SumPt , 2 = Sumptw, 3 = H->yy', choices=["0","1","2","3"], default="0") IDPVMparser.add_argument("--truthMinPt", help='minimum truth particle pT', type=float, default=None) @@ -93,7 +94,8 @@ flags.PhysVal.IDPVM.GRL = MyArgs.GRL flags.PhysVal.IDPVM.validateExtraTrackCollections = MyArgs.validateExtraTrackCollections flags.PhysVal.IDPVM.doTechnicalEfficiency = MyArgs.doTechnicalEfficiency flags.PhysVal.IDPVM.doPRW = MyArgs.doPRW -flags.PhysVal.doActs = MyArgs.doActs +flags.PhysVal.IDPVM.doActs = MyArgs.doActs +flags.PhysVal.IDPVM.doHGTD = MyArgs.doHGTD flags.Exec.SkipEvents = MyArgs.skipEvents flags.Exec.MaxEvents = MyArgs.maxEvents diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/dcube_IDPVMPlots_HGTD.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/dcube_IDPVMPlots_HGTD.xml new file mode 100644 index 0000000000000000000000000000000000000000..f541a575cbad432f2f35db153b728c8aed524c42 --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/dcube_IDPVMPlots_HGTD.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" ?> +<!-- + DCube configuration XML file = dcube_config.xml + auto-generated using DCube 4.6692016 ($Rev: 217525 $ $Date$) by Krzysztof Daniel Ciba (Krzysztof.Ciba@NOSPAMgmail.com) + on Tue, 07 Apr 2020 17:46:00 CEST + from Root reference file: IDPVM/PHYSVAL.root + Statistics tests: + "['KS', 'meany']" + Legend: + * KS - Kolmogorov-Smirnov test (default) + * chi2 - chi2 test + * bbb - bin-by-bin comparision + * meany - avg eff mean y [TProfiles only!] + * all - all above tests + Tweaks: + [1] remove or comment out (using HTML comments tags) histograms not relevant + to your analysis + [2] provide a new content to "ref_desc" and "mon_desc" tags to something + more meaningful + [3] and of course feel free to change attribute "tests" in each "hist" tag + [4] limits of p-value warning and failure can be set by changing attributes + in <plimit> tag + [5] if you want to make plots FOR EVERY histogram in your monitored file + change attribute "inclusive" in <mode> tag to "true" +--> +<dcube_client_config> + <dcube branch="*" cmtconfig="*" install="*" jobId="*" project="*"> + <!-- + ################################################### + DCubeClient for: + [1] branch: * + [2] install: * + [3] cmtconfig: * + [4] project: * + [5] jobId: * + [6] reference root file: /eos/home-n/npetters/www/dcube/IDPVM/PHYSVAL.root + [7] p-values limits FAIL = 0.750000 WARN = 0.950000 + ################################################### +--> + <reference file="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/InDetPhysValMonitoring/inputs/601237_ttbar_allhad_PU200_ITk_master_v1.RDO.root" /> + <ref_desc> + PUT YOUR REFERENCE DESCRIPTION HERE + </ref_desc> + <test_desc> + PUT YOUR TEST DESCRIPTION HERE + </test_desc> + <plimit fail="0.75" warn="0.95"/> + <TDirectory name="/"> + <TDirectory name="SquirrelPlots"> + <TDirectory name="Acts"> + <TDirectory name="HGTD_Clusters"> + <hist2D name="local_xy_left" plotopts="box" tests="KS" type="TH2F"/> + <hist2D name="local_xy_right" plotopts="box" tests="KS" type="TH2F"/> + <hist2D name="global_xy_left" plotopts="box" tests="KS" type="TH2F"/> + <hist2D name="global_xy_right" plotopts="box" tests="KS" type="TH2F"/> + <hist2D name="global_zr_left" plotopts="box" tests="KS" type="TH2F"/> + <hist2D name="global_zr_right" plotopts="box" tests="KS" type="TH2F"/> + <hist1D name="barrelEndcap" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="layer_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="layer_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="phi_module_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="phi_module_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="eta_module_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="eta_module_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="phi_index_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="phi_index_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="eta_index_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="eta_index_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="eta" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="local_x_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="local_x_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="local_y_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="local_y_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="local_t_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="local_t_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="localCovXX_left" plotopts="logy" tests="KS" type="TH1F"/> + <hist1D name="localCovXX_right" plotopts="logy" tests="KS" type="TH1F"/> + <hist1D name="localCovYY_left" plotopts="logy" tests="KS" type="TH1F"/> + <hist1D name="localCovYY_right" plotopts="logy" tests="KS" type="TH1F"/> + <hist1D name="localCovTT_left" plotopts="logy" tests="KS" type="TH1F"/> + <hist1D name="localCovTT_right" plotopts="logy" tests="KS" type="TH1F"/> + <hist1D name="global_x_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="global_x_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="global_y_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="global_y_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="global_z_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="global_z_right" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="global_r_left" plotopts="" tests="KS" type="TH1F"/> + <hist1D name="global_r_right" plotopts="" tests="KS" type="TH1F"/> + </TDirectory> + </TDirectory> + </TDirectory> + </TDirectory> + </dcube> +</dcube_client_config> diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/python/PhysValFlags.py b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/python/PhysValFlags.py index ec1b427bbf42065bccf085e7156c4fb8674acd0b..254e0d706934506256aa5d57a5097037e3f01ad8 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/python/PhysValFlags.py +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/python/PhysValFlags.py @@ -19,7 +19,6 @@ def createPhysValConfigFlags(): icf.addFlag("PhysVal.doPFlow", False) icf.addFlag("PhysVal.doMuon", False) icf.addFlag("PhysVal.doLRTMuon", False) - icf.addFlag("PhysVal.doActs", False) icf.addFlag("PhysVal.doLLPSecVtx", False) icf.addFlag("PhysVal.doLLPSecVtxLeptons", False) diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/python/PhysValMonitoringConfig.py b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/python/PhysValMonitoringConfig.py index 7d9bbc4adb51da83bc378f940a11c279f2a37da5..8634ef5305ad965bc5cbdb4083f71c94cbba7bdb 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/python/PhysValMonitoringConfig.py +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/python/PhysValMonitoringConfig.py @@ -84,7 +84,7 @@ def PhysValMonitoringCfg(flags, name="PhysValMonManager", tools=None, **kwargs): if flags.PhysVal.doLRTMuon: from MuonPhysValMonitoring.MuonPhysValConfig import PhysValLRTMuonCfg tools.append(acc.popToolsAndMerge(PhysValLRTMuonCfg(flags))) - if flags.PhysVal.doActs: + if flags.PhysVal.IDPVM.doActs: from ActsConfig.ActsAnalysisConfig import PhysValActsCfg tools.append(acc.popToolsAndMerge(PhysValActsCfg(flags))) if flags.PhysVal.doLLPSecVtx: diff --git a/Tracking/Acts/ActsConfig/python/ActsAnalysisConfig.py b/Tracking/Acts/ActsConfig/python/ActsAnalysisConfig.py index 9fce204233bf00e2c8efb7e579432038c73eda05..1033dc37a6d777f14263dc3cd6adf6e7b4d0933c 100644 --- a/Tracking/Acts/ActsConfig/python/ActsAnalysisConfig.py +++ b/Tracking/Acts/ActsConfig/python/ActsAnalysisConfig.py @@ -476,7 +476,8 @@ def ActsStripEstimatedTrackParamsAnalysisAlgCfg(flags, def PhysValActsCfg(flags, name: str = 'PhysValActs') -> ComponentAccumulator: acc = ComponentAccumulator() - acc.setPrivateTools(CompFactory.ActsTrk.PhysValTool(name=name)) + acc.setPrivateTools(CompFactory.ActsTrk.PhysValTool(name=name, + doHGTD=flags.PhysVal.IDPVM.doHGTD)) return acc def ActsSeedAnalysisCfg(flags): diff --git a/Tracking/Acts/ActsConfig/python/ActsPostIncludes.py b/Tracking/Acts/ActsConfig/python/ActsPostIncludes.py index 9708bd7f9151eb987e325b46391e42177c873f33..a969e65937ea92aa8f32ef44afee04107c036510 100644 --- a/Tracking/Acts/ActsConfig/python/ActsPostIncludes.py +++ b/Tracking/Acts/ActsConfig/python/ActsPostIncludes.py @@ -19,6 +19,14 @@ def PersistifyActsEDMCfg(flags) -> ComponentAccumulator: 'xAOD::StripClusterContainer#ITkStripClusters', 'xAOD::StripClusterAuxContainer#ITkStripClustersAux.' + strip_cluster_variables] + if flags.Reco.EnableHGTDExtension: + hgtd_cluster_shortlist = ['-hgtdClusterLink'] + + hgtd_cluster_variables = '.'.join(hgtd_cluster_shortlist) + + toAOD += ['xAOD::HGTDClusterContainer#HGTD_Clusters', + 'xAOD::HGTDClusterAuxContainer#HGTD_ClustersAux.' + hgtd_cluster_variables] + if flags.Acts.doITkConversion: toAOD += ['xAOD::StripClusterContainer#ITkConversionStripClusters', 'xAOD::StripClusterAuxContainer#ITkConversionStripClustersAux.' + strip_cluster_variables] diff --git a/Tracking/Acts/ActsConfig/test/ActsPersistifyEDM.sh b/Tracking/Acts/ActsConfig/test/ActsPersistifyEDM.sh index c9880268ca2a65a10b0d56b2f4cae70bce865dfe..e1ee0668e5d49c34ba715824e25f789a18370856 100755 --- a/Tracking/Acts/ActsConfig/test/ActsPersistifyEDM.sh +++ b/Tracking/Acts/ActsConfig/test/ActsPersistifyEDM.sh @@ -7,9 +7,9 @@ n_events=2 # Run reconstruction and produce AOD with persistified Acts EDM Reco_tf.py --CA \ - --preExec "flags.Exec.FPE=500;" "flags.Acts.EDM.PersistifyClusters=True;flags.Acts.EDM.PersistifySpacePoints=True;flags.Acts.EDM.PersistifyTracks=True;" \ + --preExec "flags.Exec.FPE=500;" "flags.Acts.EDM.PersistifyClusters=True;flags.Acts.EDM.PersistifySpacePoints=True;flags.Acts.EDM.PersistifyTracks=True;flags.Reco.EnableHGTDExtension=True;" \ --preInclude "InDetConfig.ConfigurationHelpers.OnlyTrackingPreInclude,ActsConfig.ActsCIFlags.actsWorkflowFlags" \ - --postInclude "ActsConfig.ActsPostIncludes.PersistifyActsEDMCfg" \ + --postInclude "HGTD_Config.HGTD_PrepRawDataFormationConfig.PadClusterizationCfg,InDetConfig.InDetPrepRawDataFormationConfig.HGTDInDetToXAODClusterConversionCfg,ActsConfig.ActsPostIncludes.PersistifyActsEDMCfg" \ --inputRDOFile ${input_rdo} \ --outputAODFile AOD.pool.root \ --maxEvents ${n_events} diff --git a/Tracking/Acts/ActsMonitoring/CMakeLists.txt b/Tracking/Acts/ActsMonitoring/CMakeLists.txt index be4b35fa23826acb22783996da152bc969939b0c..4af08523c6e154d05552152747b034902a13cefc 100644 --- a/Tracking/Acts/ActsMonitoring/CMakeLists.txt +++ b/Tracking/Acts/ActsMonitoring/CMakeLists.txt @@ -36,7 +36,8 @@ atlas_add_component( ActsMonitoring TrkValHistUtils xAODEventInfo xAODInDetMeasurement - xAODMeasurementBase ) + xAODMeasurementBase + HGTD_ReadoutGeometry ) atlas_install_scripts( test/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Tracking/Acts/ActsMonitoring/src/HgtdClusterValidationPlots.cxx b/Tracking/Acts/ActsMonitoring/src/HgtdClusterValidationPlots.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9e4abbaa018ef5d3ff3d393e6c5b831d225e522d --- /dev/null +++ b/Tracking/Acts/ActsMonitoring/src/HgtdClusterValidationPlots.cxx @@ -0,0 +1,149 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +#include "src/HgtdClusterValidationPlots.h" +#include "HGTD_ReadoutGeometry/HGTD_DetectorElement.h" +#include "TrkSurfaces/Surface.h" + +namespace ActsTrk { + + HgtdClusterValidationPlots::HgtdClusterValidationPlots(PlotBase* pParent, + const std::string& sDir) + : PlotBase(pParent, sDir) + { + m_barrelEndcap = Book1D("barrelEndcap", "HgtdCluster_barrelEndcap;Barrel-Endcap;Entries;", 5, -2, 3, false); + + m_layer_right = Book1D("layer_right", "HgtdCluster_layer_right;Layer;Entries;", 20, -10, 11, false); + m_layer_left = Book1D("layer_left", "HgtdCluster_layer_left;Layer;Entries;", 20, -10, 11, false); + + m_phi_module_right = Book1D("phi_module_right", "HgtdCluster_phi_module_right;Phi Module;Entries;", 100, 0, 300, false); + m_phi_module_left = Book1D("phi_module_left", "HgtdCluster_phi_module_left;Phi Module;Entries;", 100, 0, 300, false); + + m_eta_module_right = Book1D("eta_module_right", "HgtdCluster_eta_module_right;Eta Module;Entries;", 100, -10, 10, false); + m_eta_module_left = Book1D("eta_module_left", "HgtdCluster_eta_module_left;Eta Module;Entries;", 100, -10, 10, false); + + m_phi_index_right = Book1D("phi_index_right", "HgtdCluster_phi_index_right;Phi Index;Entries;", 100, -10, 10, false); + m_phi_index_left = Book1D("phi_index_left", "HgtdCluster_phi_index_left;Phi Index;Entries;", 100, -10, 10, false); + + m_eta_index_right = Book1D("eta_index_right", "HgtdCluster_eta_index_right;Eta Index;Entries;", 100, -10, 10, false); + m_eta_index_left = Book1D("eta_index_left", "HgtdCluster_eta_index_left;Eta Index;Entries;", 100, -10, 10, false); + + m_local_x_right = Book1D("local_x_right", "HgtdCluster_local_x_right;Local x [mm];Entries;", 100, -30, 30, false); + m_local_y_right = Book1D("local_y_right", "HgtdCluster_local_y_right;Local y [mm];Entries;", 100, -30, 30, false); + m_local_t_right = Book1D("local_t_right", "HgtdCluster_local_t_right;Local t [ns];Entries;", 30, 0, 50, false); + + m_localCovXX_right = Book1D("localCovXX_right", "HgtdCluster_localCovXX_right;Local Cov XX [mm2];Entries;", 100, 0, 0.5, false); + m_localCovYY_right = Book1D("localCovYY_right", "HgtdCluster_localCovYY_right;Local Cov YY [mm2];Entries;", 100, 0, 0.5, false); + m_localCovTT_right = Book1D("localCovTT_right", "HgtdCluster_localCovTT_right;Local Cov TT [ns2];Entries;", 100, 0, 0.2, false); + + m_local_xy_right = Book2D("local_xy_right", "HgtdCluster_local_xy_right;Local x [mm];Local y [mm];", 100, -30, 30, 100, -30, 30, false); + + m_local_x_left = Book1D("local_x_left", "HgtdCluster_local_x_left;Local x [mm];Entries;", 100, -30, 30, false); + m_local_y_left = Book1D("local_y_left", "HgtdCluster_local_y_left;Local y [mm];Entries;", 100, -30, 30, false); + m_local_t_left = Book1D("local_t_left", "HgtdCluster_local_t_left;Local t [ns];Entries;", 30, 0, 50, false); + + m_localCovXX_left = Book1D("localCovXX_left", "HgtdCluster_localCovXX_left;Local Cov XX [mm2];Entries;", 100, 0, 0.5, false); + m_localCovYY_left = Book1D("localCovYY_left", "HgtdCluster_localCovYY_left;Local Cov YY [mm2];Entries;", 100, 0, 0.5, false); + m_localCovTT_left = Book1D("localCovTT_left", "HgtdCluster_localCovTT_left;Local Cov TT [ns2];Entries;", 100, 0, 0.2, false); + + m_eta = Book1D("eta", "HgtdCluster_eta;Eta;Entries;", 100, -5, 5, false); + + m_global_x_left = Book1D("global_x_left", "HgtdCluster_global_x_left;Global x [mm];Entries;", 100, -1100, 1100, false); + m_global_x_right = Book1D("global_x_right", "HgtdCluster_global_x_right;Global x [mm];Entries;", 100, -1100, 1100, false); + + m_global_y_left = Book1D("global_y_left", "HgtdCluster_global_y_left;Global y [mm];Entries;", 100, -1100, 1100, false); + m_global_y_right = Book1D("global_y_right", "HgtdCluster_global_y_right;Global y [mm];Entries;", 100, -1100, 1100, false); + + m_global_z_left = Book1D("global_z_left", "HgtdCluster_global_z_left;Global z [mm];Entries;", 100, -4000, -3000, false); + m_global_z_right = Book1D("global_z_right", "HgtdCluster_global_z_right;Global z [mm];Entries;", 100, 3000, 4000, false); + + m_global_r_left = Book1D("global_r_left", "HgtdCluster_global_r_left;Global r [mm];Entries;", 100, 0, 900, false); + m_global_r_right = Book1D("global_r_right", "HgtdCluster_global_r_right;Global r [mm];Entries;", 100, 0, 900, false); + + m_local_xy_left = Book2D("local_xy_left", "HgtdCluster_local_xy_left;Local x [mm];Local y [mm];", 100, -30, 30, 100, -30, 30, false); + + m_global_xy_left = Book2D("global_xy_left", "HgtdCluster_global_xy_left;Global x [mm];Global y [mm];", 100, -1100, 1100, 100, -1100, 1100, false); + m_global_xy_right = Book2D("global_xy_right", "HgtdCluster_global_xy_right;Global x [mm];global y [mm];", 100, -1100, 1100, 100, -1100, 1100, false); + + m_global_zr_left = Book2D("global_zr_left", "HgtdCluster_global_zr_left;Global z [mm];Global r [mm];", 100, -4000, -3000, 100, 0, 900, false); + m_global_zr_right = Book2D("global_zr_right", "HgtdCluster_global_zr_right;Global z [mm];Global r [mm];", 100, 3000, 4000, 100, 0, 900, false); +} + + void HgtdClusterValidationPlots::fill(const xAOD::HGTDCluster* cluster, + const InDetDD::HGTD_DetectorElementCollection& hgtdElements, + float beamSpotWeight, + const HGTD_ID* hgtdID) + { + const Identifier& id = hgtdID->wafer_id(cluster->identifierHash()); + const auto *element = hgtdElements.getDetectorElement(hgtdID->wafer_hash(hgtdID->wafer_id(id))); + + const auto& local_position = cluster->template localPosition<3>(); + const auto& local_covariance = cluster->template localCovariance<3>(); + + // compute global position + const Amg::Transform3D& T = element->surface().transform(); + double Ax[3] = {T(0,0),T(1,0),T(2,0)}; + double Ay[3] = {T(0,1),T(1,1),T(2,1)}; + double R [3] = {T(0,3),T(1,3),T(2,3)}; + + Amg::Vector2D M; + M[0] = local_position(0,0); + M[1] = local_position(1,0); + Amg::Vector3D globalPos(M[0]*Ax[0]+M[1]*Ay[0]+R[0],M[0]*Ax[1]+M[1]*Ay[1]+R[1],M[0]*Ax[2]+M[1]*Ay[2]+R[2]); + + m_barrelEndcap->Fill(hgtdID->endcap(id)); + m_eta->Fill(globalPos.eta(), beamSpotWeight); + + // Divide in left and right endcaps + if (hgtdID->endcap(id) == -2) { + m_layer_left->Fill(hgtdID->layer(id), beamSpotWeight); + m_phi_module_left->Fill(hgtdID->phi_module(id), beamSpotWeight); + m_eta_module_left->Fill(hgtdID->eta_module(id), beamSpotWeight); + m_phi_index_left->Fill(hgtdID->phi_index(id), beamSpotWeight); + m_eta_index_left->Fill(hgtdID->eta_index(id), beamSpotWeight); + + m_local_x_left->Fill(local_position(0, 0), beamSpotWeight); + m_local_y_left->Fill(local_position(1, 0), beamSpotWeight); + m_local_t_left->Fill(local_position(2, 0), beamSpotWeight); + + m_localCovXX_left->Fill(local_covariance(0, 0), beamSpotWeight); + m_localCovYY_left->Fill(local_covariance(1, 1), beamSpotWeight); + m_localCovTT_left->Fill(local_covariance(2, 2), beamSpotWeight); + + m_global_x_left->Fill(globalPos.x(), beamSpotWeight); + m_global_y_left->Fill(globalPos.y(), beamSpotWeight); + m_global_z_left->Fill(globalPos.z(), beamSpotWeight); + m_global_r_left->Fill(std::sqrt(globalPos.x()*globalPos.x() + (globalPos.y()*globalPos.y())), beamSpotWeight); + + m_local_xy_left->Fill(local_position(0, 0), local_position(1, 0), beamSpotWeight); + m_global_xy_left->Fill(globalPos.x(), globalPos.y(), beamSpotWeight); + m_global_zr_left->Fill(globalPos.z(), std::sqrt(globalPos.x()*globalPos.x() + (globalPos.y()*globalPos.y())), beamSpotWeight); + } else if (hgtdID->endcap(id) == 2) { + m_layer_right->Fill(hgtdID->layer(id), beamSpotWeight); + m_phi_module_right->Fill(hgtdID->phi_module(id), beamSpotWeight); + m_eta_module_right->Fill(hgtdID->eta_module(id), beamSpotWeight); + m_phi_index_right->Fill(hgtdID->phi_index(id), beamSpotWeight); + m_eta_index_right->Fill(hgtdID->eta_index(id), beamSpotWeight); + + m_local_x_right->Fill(local_position(0, 0), beamSpotWeight); + m_local_y_right->Fill(local_position(1, 0), beamSpotWeight); + m_local_t_right->Fill(local_position(2, 0), beamSpotWeight); + + m_localCovXX_right->Fill(local_covariance(0, 0), beamSpotWeight); + m_localCovYY_right->Fill(local_covariance(1, 1), beamSpotWeight); + m_localCovTT_right->Fill(local_covariance(2, 2), beamSpotWeight); + + m_global_x_right->Fill(globalPos.x(), beamSpotWeight); + m_global_y_right->Fill(globalPos.y(), beamSpotWeight); + m_global_z_right->Fill(globalPos.z(), beamSpotWeight); + m_global_r_right->Fill(std::sqrt(globalPos.x()*globalPos.x() + (globalPos.y()*globalPos.y())), beamSpotWeight); + + m_local_xy_right->Fill(local_position(0, 0), local_position(1, 0), beamSpotWeight); + m_global_xy_right->Fill(globalPos.x(), globalPos.y(), beamSpotWeight); + m_global_zr_right->Fill(globalPos.z(), std::sqrt(globalPos.x()*globalPos.x() + (globalPos.y()*globalPos.y())), beamSpotWeight); + } + + } +} + diff --git a/Tracking/Acts/ActsMonitoring/src/HgtdClusterValidationPlots.h b/Tracking/Acts/ActsMonitoring/src/HgtdClusterValidationPlots.h new file mode 100644 index 0000000000000000000000000000000000000000..15b4ca966df26912d154526ba375919040167eaf --- /dev/null +++ b/Tracking/Acts/ActsMonitoring/src/HgtdClusterValidationPlots.h @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ACTS_HGTD_CLUSTER_VALIDATION_PLOTS_H +#define ACTS_HGTD_CLUSTER_VALIDATION_PLOTS_H + +#include "TrkValHistUtils/PlotBase.h" +#include "xAODInDetMeasurement/HGTDClusterContainer.h" +#include "HGTD_Identifier/HGTD_ID.h" +#include "HGTD_ReadoutGeometry/HGTD_DetectorElementCollection.h" + +namespace ActsTrk { + + class HgtdClusterValidationPlots : + public PlotBase { + public: + HgtdClusterValidationPlots(PlotBase* pParent, const std::string& sDir); + virtual ~HgtdClusterValidationPlots() = default; + + void fill(const xAOD::HGTDCluster* cluster, + const InDetDD::HGTD_DetectorElementCollection& hgtdElements, + float beamSpotWeight, + const HGTD_ID*); + + private: + TH1* m_barrelEndcap {}; + + TH1* m_layer_right {}; + TH1* m_layer_left {}; + + TH1* m_phi_module_right {}; + TH1* m_phi_module_left {}; + + TH1* m_eta_module_right {}; + TH1* m_eta_module_left {}; + + TH1* m_phi_index_right {}; + TH1* m_phi_index_left {}; + + TH1* m_eta_index_right {}; + TH1* m_eta_index_left {}; + + TH1* m_eta {}; + + TH1* m_local_x_right {}; + TH1* m_local_y_right {}; + TH1* m_local_t_right {}; + + TH1* m_localCovXX_right {}; + TH1* m_localCovYY_right {}; + TH1* m_localCovTT_right {}; + + TH2* m_local_xy_right {}; + TH2* m_global_xy_right {}; + TH2* m_global_zr_right {}; + + TH1* m_local_x_left {}; + TH1* m_local_y_left {}; + TH1* m_local_t_left {}; + + TH1* m_localCovXX_left {}; + TH1* m_localCovYY_left {}; + TH1* m_localCovTT_left {}; + + TH1* m_global_x_left {}; + TH1* m_global_y_left {}; + TH1* m_global_z_left {}; + TH1* m_global_r_left {}; + + TH1* m_global_x_right {}; + TH1* m_global_y_right {}; + TH1* m_global_z_right {}; + TH1* m_global_r_right {}; + + TH2* m_local_xy_left {}; + TH2* m_global_xy_left {}; + TH2* m_global_zr_left {}; + }; + +} + +#endif diff --git a/Tracking/Acts/ActsMonitoring/src/PhysValTool.cxx b/Tracking/Acts/ActsMonitoring/src/PhysValTool.cxx index 7196d2bad19d5ee30805d77fc6c17b008fc2bd06..18e3a88ac777ccf02b1f35b1865a471fc92db5f0 100644 --- a/Tracking/Acts/ActsMonitoring/src/PhysValTool.cxx +++ b/Tracking/Acts/ActsMonitoring/src/PhysValTool.cxx @@ -21,11 +21,14 @@ namespace ActsTrk { ATH_CHECK(m_pixelClusterContainerKey.initialize()); ATH_CHECK(m_stripClusterContainerKey.initialize()); - + ATH_CHECK(m_hgtdClusterContainerKey.initialize(m_doHGTD)); + ATH_CHECK(m_pixelSpacePointContainerKey.initialize()); ATH_CHECK(m_stripSpacePointContainerKey.initialize()); ATH_CHECK(m_stripOverlapSpacePointContainerKey.initialize()); + ATH_CHECK(m_HGTDDetEleCollKey.initialize(m_doHGTD)); + std::string folder = "SquirrelPlots/Acts"; m_pixelClusterValidationPlots = std::make_unique< ActsTrk::PixelClusterValidationPlots >(nullptr, @@ -55,9 +58,19 @@ namespace ActsTrk { folder.c_str(), m_stripOverlapSpacePointContainerKey.key().c_str()), "StripOverlap"); + + // Schedule HGTD objects + if (m_doHGTD) { + m_hgtdClusterValidationPlots = + std::make_unique< ActsTrk::HgtdClusterValidationPlots >(nullptr, + Form("%s/%s/", + folder.c_str(), + m_hgtdClusterContainerKey.key().c_str())); + } ATH_CHECK(detStore()->retrieve(m_pixelID, "PixelID")); ATH_CHECK(detStore()->retrieve(m_stripID, "SCT_ID")); + if (m_doHGTD) ATH_CHECK(detStore()->retrieve(m_hgtdID, "HGTD_ID")); return StatusCode::SUCCESS; } @@ -68,13 +81,39 @@ namespace ActsTrk { ATH_CHECK(bookCollection(m_pixelClusterValidationPlots.get())); ATH_CHECK(bookCollection(m_stripClusterValidationPlots.get())); - + if (m_doHGTD) ATH_CHECK(bookCollection(m_hgtdClusterValidationPlots.get())); + ATH_CHECK(bookCollection(m_pixelSpacePointValidationPlots.get())); ATH_CHECK(bookCollection(m_stripSpacePointValidationPlots.get())); ATH_CHECK(bookCollection(m_stripOverlapSpacePointValidationPlots.get())); return StatusCode::SUCCESS; } + + StatusCode PhysValTool::fillHgtd(const EventContext& ctx, + float beamSpotWeight) { + // Get collection + SG::ReadHandle< xAOD::HGTDClusterContainer > inputHgtdClusterContainer = SG::makeHandle( m_hgtdClusterContainerKey, ctx ); + if (not inputHgtdClusterContainer.isValid()) { + ATH_MSG_FATAL("xAOD::HGTDClusterContainer with key " << m_hgtdClusterContainerKey.key() << " is not available..."); + return StatusCode::FAILURE; + } + const xAOD::HGTDClusterContainer *hgtdClusterContainer = inputHgtdClusterContainer.cptr(); + + SG::ReadCondHandle<InDetDD::HGTD_DetectorElementCollection> hgtdDetEleHandle(m_HGTDDetEleCollKey, ctx); + const InDetDD::HGTD_DetectorElementCollection* hgtdElements(*hgtdDetEleHandle); + if (not hgtdDetEleHandle.isValid() or hgtdElements==nullptr) { + ATH_MSG_FATAL(m_HGTDDetEleCollKey.fullKey() << " is not available."); + return StatusCode::FAILURE; + } + + // Fill plots + for (const xAOD::HGTDCluster* cluster : *hgtdClusterContainer) { + m_hgtdClusterValidationPlots->fill(cluster, *hgtdElements, beamSpotWeight, m_hgtdID); + } + + return StatusCode::SUCCESS; + } StatusCode PhysValTool::fillHistograms() { @@ -150,6 +189,8 @@ namespace ActsTrk { m_stripOverlapSpacePointValidationPlots->fill(spacePoint, beamSpotWeight, m_stripID); } + if (m_doHGTD) ATH_CHECK(fillHgtd(ctx, beamSpotWeight)); + return StatusCode::SUCCESS; } @@ -158,6 +199,10 @@ namespace ActsTrk { ATH_MSG_DEBUG("Finalising hists for " << name() << "..."); m_pixelClusterValidationPlots->finalize(); m_stripClusterValidationPlots->finalize(); + if (m_doHGTD) m_hgtdClusterValidationPlots->finalize(); + m_pixelSpacePointValidationPlots->finalize(); + m_stripSpacePointValidationPlots->finalize(); + m_stripOverlapSpacePointValidationPlots->finalize(); return StatusCode::SUCCESS; } diff --git a/Tracking/Acts/ActsMonitoring/src/PhysValTool.h b/Tracking/Acts/ActsMonitoring/src/PhysValTool.h index 94411512f6a171cf6fefe5af17bda0e059c1e1cc..86bb893b3796322f25e77b1aecab6a5d929687ba 100644 --- a/Tracking/Acts/ActsMonitoring/src/PhysValTool.h +++ b/Tracking/Acts/ActsMonitoring/src/PhysValTool.h @@ -7,12 +7,15 @@ #include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "xAODInDetMeasurement/PixelClusterContainer.h" +#include "xAODInDetMeasurement/HGTDClusterContainer.h" #include "xAODEventInfo/EventInfo.h" #include "StoreGate/ReadHandleKey.h" #include "InDetIdentifier/PixelID.h" #include "InDetIdentifier/SCT_ID.h" +#include "HGTD_Identifier/HGTD_ID.h" #include "src/PixelClusterValidationPlots.h" #include "src/StripClusterValidationPlots.h" +#include "src/HgtdClusterValidationPlots.h" #include "src/PixelSpacePointValidationPlots.h" #include "src/StripSpacePointValidationPlots.h" @@ -36,6 +39,9 @@ namespace ActsTrk { template<typename external_collection_t> StatusCode bookCollection(external_collection_t*); + StatusCode fillHgtd(const EventContext& ctx, + float beamSpotWeight); + private: SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo {this, "EventInfo", "EventInfo", "Event info key"}; @@ -44,7 +50,9 @@ namespace ActsTrk { "Key of input pixel clusters"}; SG::ReadHandleKey< xAOD::StripClusterContainer > m_stripClusterContainerKey {this, "StripClusterContainerKey", "ITkStripClusters", "Key of input pixel clusters"}; - + SG::ReadHandleKey< xAOD::HGTDClusterContainer > m_hgtdClusterContainerKey {this, "HGTDClusterContainerKey", "HGTD_Clusters", + "Key of input hgtd clusters"}; + SG::ReadHandleKey< xAOD::SpacePointContainer > m_pixelSpacePointContainerKey {this, "PixelSpacePointContainerKey", "ITkPixelSpacePoints", "Key of input pixel space points"}; SG::ReadHandleKey< xAOD::SpacePointContainer > m_stripSpacePointContainerKey {this, "StripSpacePointContainerKey", "ITkStripSpacePoints", @@ -52,15 +60,22 @@ namespace ActsTrk { SG::ReadHandleKey< xAOD::SpacePointContainer > m_stripOverlapSpacePointContainerKey {this, "StripOverlapSpacePointContainerKey", "ITkStripOverlapSpacePoints", "Key of input strip overlap space points"}; + SG::ReadCondHandleKey<InDetDD::HGTD_DetectorElementCollection> m_HGTDDetEleCollKey {this, "HGTDDetEleCollKey", "HGTD_DetectorElementCollection", + "Key of HGTD_DetectorElementCollection for HGTD"}; + + Gaudi::Property<bool> m_doHGTD {this, "doHGTD", false, "Analyse HGTD collections"}; + std::unique_ptr< ActsTrk::PixelClusterValidationPlots > m_pixelClusterValidationPlots; std::unique_ptr< ActsTrk::StripClusterValidationPlots > m_stripClusterValidationPlots; - + std::unique_ptr< ActsTrk::HgtdClusterValidationPlots > m_hgtdClusterValidationPlots; + std::unique_ptr< ActsTrk::PixelSpacePointValidationPlots > m_pixelSpacePointValidationPlots; std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripSpacePointValidationPlots; std::unique_ptr< ActsTrk::StripSpacePointValidationPlots > m_stripOverlapSpacePointValidationPlots; - + const PixelID *m_pixelID {}; const SCT_ID *m_stripID {}; + const HGTD_ID *m_hgtdID {}; }; template<typename external_collection_t>