From 0fefcf29243a87bee76bc6bfd730a97cc5519d49 Mon Sep 17 00:00:00 2001 From: Nikola Dikic <nikola.dikic@cern.ch> Date: Wed, 11 Mar 2020 15:54:04 +0100 Subject: [PATCH] First ToF histogram --- .../python/Run3AFPExampleMonitorAlgorithm.py | 10 ++++++--- .../src/AFPSiLayerAlgorithm.cxx | 6 ++--- .../Run3AFPMonitoring/src/AFPToFAlgorithm.cxx | 22 ++++++++++++++++--- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py index 5ffb476a9537..a61a73ed56bf 100644 --- a/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py +++ b/ForwardDetectors/AFP/Run3AFPMonitoring/python/Run3AFPExampleMonitorAlgorithm.py @@ -72,8 +72,11 @@ def Run3AFPExampleMonitoringConfig(inputFlags): # Add a GMT for the other example monitor algorithm # anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer') - AFPGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits', path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') - AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits', path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits') + AFPGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits', path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nsihits') + AFPToFGroup.defineHistogram('lb', title='Luminosity Block;lb;total number of Hits', path='ToF',xbins=1000,xmin=-0.5,xmax=999.5,weight='ntofhits') + + AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF',xbins=3,xmin=-0.5,xmax=2.5) + AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF',xbins=3,xmin=-0.5,xmax=2.5) ### STEP 5 ### # Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1. @@ -124,7 +127,8 @@ if __name__=='__main__': from AthenaConfiguration.AllConfigFlags import ConfigFlags nightly = ''#/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00348618/data18_13TeV.00348618.physics_Main.recon.AOD.v220/' #file = 'data18_13TeV.00348618.physics_Main.recon.AOD.v220._lb0295._0009.1' - file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' + file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1' #ToF + #file = '/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000005.pool.root.1' #SiT #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.deriv.DAOD_STDM7.r10258_p3399_p4030/DAOD_STDM7.20036794._000007.pool.root.1' #/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.recon.AOD.r10258_p3412_r11501/AOD.18508508._000007.pool.root.1' #/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1' diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx index 26f0e22fc6f3..6fe12d88fefb 100644 --- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx +++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPSiLayerAlgorithm.cxx @@ -60,7 +60,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const auto testweight = Monitored::Scalar<float>("testweight",1.0); */ auto lb = Monitored::Scalar<int>("lb", 0); // Nikola - auto nhits = Monitored::Scalar<int>("nhits", 1); + auto nsihits = Monitored::Scalar<int>("nsihits", 1); /* // Two variables (value and passed) needed for TEfficiency @@ -149,8 +149,8 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const ATH_CHECK( afpHitContainer.initialize() ); - nhits = afpHitContainer->size(); - fill("AFPSiLayerTool", lb, nhits); + nsihits = afpHitContainer->size(); + fill("AFPSiLayerTool", lb, nsihits); auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola diff --git a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx index 64c10506fc34..dd3fffa51d83 100644 --- a/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx +++ b/ForwardDetectors/AFP/Run3AFPMonitoring/src/AFPToFAlgorithm.cxx @@ -49,7 +49,7 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const { // End auto lb = Monitored::Scalar<int>("lb", 0); // Nikola - auto nhits = Monitored::Scalar<int>("nhits", 1); + auto ntofhits = Monitored::Scalar<int>("ntofhits", 1); lb = GetEventInfo(ctx)->lumiBlock(); // Nikola @@ -72,8 +72,24 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const { ATH_CHECK( afpToFHitContainer.initialize() ); - nhits = afpToFHitContainer->size(); - fill("AFPToFTool", lb, nhits); + ntofhits = afpToFHitContainer->size(); + fill("AFPToFTool", lb, ntofhits); +/* TO BE researched: difference between trainID and barInTrainID + auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0); + auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0); + + for(const xAOD::AFPTofHit *hitsIts: *afpToFHitContainer) + { + if(hitsIts->isSideA()) + { + fill("AFPToFTool", numberOfHit_S0); + } + else if(hitsIts->isSideC()) + { + fill("AFPToFTool", numberOfHit_S3); + } + } +*/ /* auto pixelRowIDChip = Monitored::Scalar<int>("pixelRowIDChip", 0); // Nikola auto pixelColIDChip = Monitored::Scalar<int>("pixelColIDChip", 0); // Nikola -- GitLab