From db59e6f1ef704cc263f5c833f326be44c4bc5a87 Mon Sep 17 00:00:00 2001 From: Kate Whalen <kate.whalen@cern.ch> Date: Wed, 16 Dec 2020 18:41:41 +0000 Subject: [PATCH] ATLLONECAL-338 continuing L1Calo legacy PPM monitoring migration --- .../python/PprMonitorAlgorithm.py | 63 +++++--- .../src/PprMonitorAlgorithm.cxx | 150 +++++++++++++++++- .../src/PprMonitorAlgorithm.h | 7 +- 3 files changed, 190 insertions(+), 30 deletions(-) diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/python/PprMonitorAlgorithm.py b/Trigger/TrigT1/TrigT1CaloMonitoring/python/PprMonitorAlgorithm.py index b08a4acf744d..4aa674810cc2 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/python/PprMonitorAlgorithm.py +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/python/PprMonitorAlgorithm.py @@ -30,6 +30,9 @@ def PprMonitoringConfig(inputFlags): threshADC = 50 PprMonAlg.TT_ADC_HitMap_Thresh = threshADC # ADC cut for hit maps + sliceNo = 15 + PprMonAlg.SliceNo = sliceNo # Max number of timeslices in the readout + # Histogram paths mainDir = 'L1Calo' trigPath = 'PPM/' @@ -60,25 +63,25 @@ def PprMonitoringConfig(inputFlags): histPath = trigPath+'/LUT-CP/Distributions' # EM distributions - myGroup.defineHistogram('etaTT_EM;h_ppm_em_1d_tt_lutcp_Eta', title='EM LUT-CP: Distribution of peak in #eta; #eta', type='TH1F', path=histPath, xbins=etabins, cutmask='mask_EM_cpET_0_noPhi') + myGroup.defineHistogram('etaTT_EM;ppm_em_1d_tt_lutcp_Eta', title='EM LUT-CP: Distribution of peak in #eta; #eta', type='TH1F', path=histPath, xbins=etabins, cutmask='mask_EM_cpET_0_noPhi') - myGroup.defineHistogram('phiTT_1d_EM;h_ppm_em_1d_tt_lutcp_Phi', title='EM LUT-CP: Distribution of peak in #phi; #phi', type='TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d, cutmask='mask_EM_cpET_0_phiBins') + myGroup.defineHistogram('phiTT_1d_EM;ppm_em_1d_tt_lutcp_Phi', title='EM LUT-CP: Distribution of peak in #phi; #phi', type='TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d, cutmask='mask_EM_cpET_0_phiBins') - myGroup.defineHistogram('cpET_EM;h_ppm_em_1d_tt_lutcp_Et', title='EM LUT-CP: Distribution of peak; EM LUT peak [GeV/2]', type='TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange, cutmask='mask_EM_cpET_0_noPhi') + myGroup.defineHistogram('cpET_EM;ppm_em_1d_tt_lutcp_Et', title='EM LUT-CP: Distribution of peak; EM LUT peak [GeV/2]', type='TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange, cutmask='mask_EM_cpET_0_noPhi') # HAD distributions - myGroup.defineHistogram('etaTT_HAD;h_ppm_had_1d_tt_lutcp_Eta', title='HAD LUT-CP: Distribution of peak in #eta; #eta', type='TH1F', path=histPath, xbins=etabins, cutmask='mask_HAD_cpET_0_noPhi') + myGroup.defineHistogram('etaTT_HAD;ppm_had_1d_tt_lutcp_Eta', title='HAD LUT-CP: Distribution of peak in #eta; #eta', type='TH1F', path=histPath, xbins=etabins, cutmask='mask_HAD_cpET_0_noPhi') - myGroup.defineHistogram('phiTT_1d_HAD;h_ppm_had_1d_tt_lutcp_Phi', title='HAD LUT-CP: Distribution of peak in #phi; #phi', type='TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d, cutmask='mask_HAD_cpET_0_phiBins') + myGroup.defineHistogram('phiTT_1d_HAD;ppm_had_1d_tt_lutcp_Phi', title='HAD LUT-CP: Distribution of peak in #phi; #phi', type='TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d, cutmask='mask_HAD_cpET_0_phiBins') - myGroup.defineHistogram('cpET_HAD;h_ppm_had_1d_tt_lutcp_Et', title='HAD LUT-CP: Distribution of peak; HAD LUT peak [GeV/2]', type='TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange, cutmask='mask_HAD_cpET_0_noPhi') + myGroup.defineHistogram('cpET_HAD;ppm_had_1d_tt_lutcp_Et', title='HAD LUT-CP: Distribution of peak; HAD LUT peak [GeV/2]', type='TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange, cutmask='mask_HAD_cpET_0_noPhi') # Eta-phi maps histPath = trigPath+'/LUT-CP/EtaPhiMaps' - myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM,cpET_EM;h_ppm_em_2d_etaPhi_tt_lutcp_AverageEt', title='EM Average LUT-CP Et for Et > 5 GeV/2', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_cpET_5_phiBins') + myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM,cpET_EM;ppm_em_2d_etaPhi_tt_lutcp_AverageEt', title='EM Average LUT-CP Et for Et > 5 GeV/2', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_cpET_5_phiBins') - myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD,cpET_HAD;h_ppm_had_2d_etaPhi_tt_lutcp_AverageEt', title='HAD Average LUT-CP Et for Et > 5 GeV/2', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_cpET_5_phiBins') + myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD,cpET_HAD;ppm_had_2d_etaPhi_tt_lutcp_AverageEt', title='HAD Average LUT-CP Et for Et > 5 GeV/2', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_cpET_5_phiBins') ######################## @@ -87,25 +90,25 @@ def PprMonitoringConfig(inputFlags): histPath = trigPath+'/LUT-JEP/Distributions' # EM distributions - myGroup.defineHistogram('etaTT_EM;h_ppm_em_1d_tt_lutjep_Eta', title='EM LUT-JEP: Distribution of peak in #eta', type='TH1F', path=histPath, xbins=etabins, cutmask='mask_EM_jepET_0_noPhi') + myGroup.defineHistogram('etaTT_EM;ppm_em_1d_tt_lutjep_Eta', title='EM LUT-JEP: Distribution of peak in #eta', type='TH1F', path=histPath, xbins=etabins, cutmask='mask_EM_jepET_0_noPhi') - myGroup.defineHistogram('phiTT_1d_EM;h_ppm_em_1d_tt_lutjep_Phi', title='EM LUT-JEP: Distribution of peak in #phi; #phi', type='TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d, cutmask='mask_EM_jepET_0_phiBins') + myGroup.defineHistogram('phiTT_1d_EM;ppm_em_1d_tt_lutjep_Phi', title='EM LUT-JEP: Distribution of peak in #phi; #phi', type='TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d, cutmask='mask_EM_jepET_0_phiBins') - myGroup.defineHistogram('jepET_EM;h_ppm_em_1d_tt_lutjep_Et', title='EM LUT-JEP: Distribution of peak; EM LUT peak [GeV]', type='TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange, cutmask='mask_EM_jepET_0_noPhi') + myGroup.defineHistogram('jepET_EM;ppm_em_1d_tt_lutjep_Et', title='EM LUT-JEP: Distribution of peak; EM LUT peak [GeV]', type='TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange, cutmask='mask_EM_jepET_0_noPhi') # HAD distributions - myGroup.defineHistogram('etaTT_HAD;h_ppm_had_1d_tt_lutjep_Eta', title='HAD LUT-JEP: Distribution of peak in #eta', type='TH1F', path=histPath, xbins=etabins, cutmask='mask_HAD_jepET_0_noPhi') + myGroup.defineHistogram('etaTT_HAD;ppm_had_1d_tt_lutjep_Eta', title='HAD LUT-JEP: Distribution of peak in #eta', type='TH1F', path=histPath, xbins=etabins, cutmask='mask_HAD_jepET_0_noPhi') - myGroup.defineHistogram('phiTT_1d_HAD;h_ppm_had_1d_tt_lutjep_Phi', title='HAD LUT-JEP: Distribution of peak in #phi; #phi', type='TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d, cutmask='mask_HAD_jepET_0_phiBins') + myGroup.defineHistogram('phiTT_1d_HAD;ppm_had_1d_tt_lutjep_Phi', title='HAD LUT-JEP: Distribution of peak in #phi; #phi', type='TH1F', path=histPath, xbins=phibins, xmin=phimin, xmax=phimax_1d, cutmask='mask_HAD_jepET_0_phiBins') - myGroup.defineHistogram('jepET_HAD;h_ppm_had_1d_tt_lutjep_Et', title='HAD LUT-JEP: Distribution of peak; HAD LUT peak [GeV]', type='TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange, cutmask='mask_HAD_jepET_0_noPhi') + myGroup.defineHistogram('jepET_HAD;ppm_had_1d_tt_lutjep_Et', title='HAD LUT-JEP: Distribution of peak; HAD LUT peak [GeV]', type='TH1F', path=histPath, xbins=maxEnergyRange-1, xmin=1, xmax=maxEnergyRange, cutmask='mask_HAD_jepET_0_noPhi') # Eta-phi maps histPath = trigPath+'/LUT-JEP/EtaPhiMaps' - myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM,jepET_EM;h_ppm_em_2d_etaPhi_tt_lutjep_AverageEt', title='EM Average LUT-JEP Et for Et > 5 GeV', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_jepET_5_phiBins') + myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM,jepET_EM;ppm_em_2d_etaPhi_tt_lutjep_AverageEt', title='EM Average LUT-JEP Et for Et > 5 GeV', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_jepET_5_phiBins') - myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD,jepET_HAD;h_ppm_had_2d_etaPhi_tt_lutjep_AverageEt', title='HAD Average LUT-JEP Et for Et > 5 GeV', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_jepET_5_phiBins') + myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD,jepET_HAD;ppm_had_2d_etaPhi_tt_lutjep_AverageEt', title='HAD Average LUT-JEP Et for Et > 5 GeV', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_jepET_5_phiBins') #################### @@ -114,18 +117,36 @@ def PprMonitoringConfig(inputFlags): histPath = trigPath+'/ADC/EtaPhiMaps' # EM tower maps - myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM;h_ppm_em_2d_etaPhi_tt_adc_HitMap', title='#eta - #phi map of EM FADC > ' +str(threshADC)+ ' for triggered timeslice; Tower #eta; Tower #phi', type='TH2F', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_timeslice') + myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM;ppm_em_2d_etaPhi_tt_adc_HitMap', title='#eta - #phi map of EM FADC > ' +str(threshADC)+ ' for triggered timeslice; Tower #eta; Tower #phi', type='TH2F', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_timeslice') - myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM,emTT_ADC;h_ppm_em_2d_etaPhi_tt_adc_ProfileHitMap', title='#eta - #phi profile map of EM FADC > ' +str(threshADC)+ ' for triggered timeslice; Tower #eta; Tower #phi', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_timeslice') + myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM,emTT_ADC;ppm_em_2d_etaPhi_tt_adc_ProfileHitMap', title='#eta - #phi profile map of EM FADC > ' +str(threshADC)+ ' for triggered timeslice; Tower #eta; Tower #phi', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_timeslice') # HAD tower maps - myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD;h_ppm_had_2d_etaPhi_tt_adc_HitMap', title='#eta - #phi map of HAD FADC > ' +str(threshADC)+ ' for triggered timeslice; Tower #eta; Tower #phi', type='TH2F', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_timeslice') + myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD;ppm_had_2d_etaPhi_tt_adc_HitMap', title='#eta - #phi map of HAD FADC > ' +str(threshADC)+ ' for triggered timeslice; Tower #eta; Tower #phi', type='TH2F', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_timeslice') + + myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD,hadTT_ADC;ppm_had_2d_etaPhi_tt_adc_ProfileHitMap', title='#eta - #phi profile map of HAD FADC > ' +str(threshADC)+ ' for triggered timeslice; Tower #eta; Tower #phi', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_timeslice') + + + # Triggered time-slice + histPath = trigPath+'/ADC/Timeslices' + + myGroup.defineHistogram('adcPeak_EM;ppm_em_1d_tt_adc_TriggeredSlice', title='Number of the EM triggered slice; # Slice', type='TH1F', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo, cutmask='mask_EM_noDuplicates') - myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD,hadTT_ADC;h_ppm_had_2d_etaPhi_tt_adc_ProfileHitMap', title='#eta - #phi profile map of HAD FADC > ' +str(threshADC)+ ' for triggered timeslice; Tower #eta; Tower #phi', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_timeslice') + myGroup.defineHistogram('adcPeak_HAD;ppm_had_1d_tt_adc_TriggeredSlice', title='Number of the HAD triggered slice; # Slice', type='TH1F', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo, cutmask='mask_HAD_noDuplicates') - + myGroup.defineHistogram('maxADC_EM;ppm_em_1d_tt_adc_MaxTimeslice', title='EM distribution of maximum timeslice; slice', type='TH1D', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo, cutmask='mask_EM_maxSlice_noPhi') + + myGroup.defineHistogram('maxADC_HAD;ppm_had_1d_tt_adc_MaxTimeslice', title='HAD distribution of maximum timeslice; slice', type='TH1D', path=histPath, xbins=sliceNo, xmin=0, xmax=sliceNo, cutmask='mask_HAD_maxSlice_noPhi') + myGroup.defineHistogram('etaTT_EM,phiTT_2d_EM,maxADCPlus1_EM;ppm_em_2d_etaPhi_tt_adc_MaxTimeslice', title='Average maximum timeslice for EM signal (TS:1-15); Tower #eta; Tower #phi', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_EM_maxSlice') + + myGroup.defineHistogram('etaTT_HAD,phiTT_2d_HAD,maxADCPlus1_HAD;ppm_had_2d_etaPhi_tt_adc_MaxTimeslice', title='Average maximum timeslice for HAD signal (TS:1-15); Tower #eta; Tower #phi', type='TProfile2D', path=histPath, xbins=etabins, ybins=phibins, ymin=phimin, ymax=phimax_2d, cutmask='mask_HAD_maxSlice') + + + + # Finish up + acc = helper.result() result.merge(acc) return result diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/src/PprMonitorAlgorithm.cxx b/Trigger/TrigT1/TrigT1CaloMonitoring/src/PprMonitorAlgorithm.cxx index 831506ae8185..93028892344e 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/src/PprMonitorAlgorithm.cxx +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/src/PprMonitorAlgorithm.cxx @@ -88,6 +88,12 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const auto jepET_EM = Monitored::Collection("jepET_EM", vecMonTT_EM, []( const auto &emTower ){return emTower.jepET;}); variables.push_back(jepET_EM); + auto maxADC_EM = Monitored::Collection("maxADC_EM", vecMonTT_EM, []( const auto &emTower ){return emTower.maxADC;}); + variables.push_back(maxADC_EM); + + auto adcPeak_EM = Monitored::Collection("adcPeak_EM", vecMonTT_EM, []( const auto &emTower ){return emTower.tower->adcPeak();}); + variables.push_back(adcPeak_EM); + // HAD towers auto etaTT_HAD = Monitored::Collection("etaTT_HAD", vecMonTT_HAD, []( const auto &hadTower ){return hadTower.tower->eta();}); variables.push_back(etaTT_HAD); @@ -103,9 +109,19 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const auto jepET_HAD = Monitored::Collection("jepET_HAD", vecMonTT_HAD, []( const auto &hadTower ){return hadTower.jepET;}); variables.push_back(jepET_HAD); + + auto maxADC_HAD = Monitored::Collection("maxADC_HAD", vecMonTT_HAD, []( const auto &hadTower ){return hadTower.maxADC;}); + variables.push_back(maxADC_HAD); + + auto adcPeak_HAD = Monitored::Collection("adcPeak_HAD", vecMonTT_HAD, []( const auto &hadTower ){return hadTower.tower->adcPeak();}); + variables.push_back(adcPeak_HAD); + // Cutmasks (EM) + std::vector<int> vec_EM_noDuplicates = {}; std::vector<int> vec_EM_timeslice = {}; + std::vector<int> vec_EM_maxSlice = {}; + std::vector<int> vec_EM_maxSlice_noDuplicates = {}; std::vector<int> vec_EM_cpET_0 = {}; // includes "duplicate" towers for phi maps std::vector<int> vec_EM_cpET_0_noDuplicates = {}; // no duplicates: for plots not binned in phi std::vector<int> vec_EM_cpET_5 = {}; @@ -118,6 +134,9 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const // Weights std::vector<int> vec_EM_ADC = {}; + // For average ADC plots + std::vector<double> vec_EM_maxADCPlus1 = {}; + for (auto& emTower : vecMonTT_EM) { @@ -129,6 +148,7 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const ATH_MSG_DEBUG("cpET: " << cpET << " jepET: " << jepET); // Fill the cutmasks for EM LUT-CP and LUT-JEP energy distributions + vec_EM_noDuplicates.push_back(!isDuplicate); vec_EM_cpET_0.push_back(cpET > 0); // For phi distributions / maps vec_EM_cpET_0_noDuplicates.push_back((cpET > 0) && !isDuplicate); // For plots not binned in phi vec_EM_cpET_5.push_back(cpET > 5); @@ -155,12 +175,21 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const vec_EM_timeslice.push_back(0); vec_EM_ADC.push_back(0); } - ATH_MSG_DEBUG(" mask: " << vec_EM_timeslice.back()); - + + // -------- Timing of FADC signal -------- + + double max = emTower.maxADC; + vec_EM_maxSlice.push_back(max >= 0.); + vec_EM_maxSlice_noDuplicates.push_back((max >= 0.) && !isDuplicate); + vec_EM_maxADCPlus1.push_back(max + 1.); + } // End loop over vector of EM towers // Cutmasks (HAD) + std::vector<int> vec_HAD_noDuplicates = {}; std::vector<int> vec_HAD_timeslice = {}; + std::vector<int> vec_HAD_maxSlice = {}; + std::vector<int> vec_HAD_maxSlice_noDuplicates = {}; std::vector<int> vec_HAD_cpET_0 = {}; // includes "duplicate" towers for phi maps std::vector<int> vec_HAD_cpET_0_noDuplicates = {}; // no duplicates: for plots not binned in phi std::vector<int> vec_HAD_cpET_5 = {}; @@ -174,6 +203,9 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const // HAD weights std::vector<int> vec_HAD_ADC = {}; + // For average ADC plots + std::vector<double> vec_HAD_maxADCPlus1 = {}; + for (auto& hadTower : vecMonTT_HAD) { // -------- LUT -------- @@ -184,6 +216,7 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const if (cpET > 0) ATH_MSG_DEBUG("HAD tower cpET: " << cpET << " jepET: " << jepET); // Fill the cutmasks for HAD LUT-CP and LUT-JEP energy distributions + vec_HAD_noDuplicates.push_back(!isDuplicate); vec_HAD_cpET_0.push_back(cpET > 0); // For phi distributions / maps vec_HAD_cpET_0_noDuplicates.push_back((cpET > 0) && !isDuplicate); // For plots not binned in phi vec_HAD_cpET_5.push_back(cpET > 5); @@ -211,13 +244,37 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const } ATH_MSG_DEBUG(" mask: " << vec_HAD_timeslice.back()); + // -------- Timing of FADC signal -------- + + double max = hadTower.maxADC; + vec_HAD_maxSlice.push_back(max >= 0.); + vec_HAD_maxSlice_noDuplicates.push_back((max >= 0.) && !isDuplicate); + vec_HAD_maxADCPlus1.push_back(max + 1.); + } // End loop over vector of HAD towers + + // Define additional monitored variables (EM) + auto maxADCPlus1_EM = Monitored::Collection("maxADCPlus1_EM", vec_EM_maxADCPlus1); + variables.push_back(maxADCPlus1_EM); + + // Define additional monitored variables (HAD) + auto maxADCPlus1_HAD = Monitored::Collection("maxADCPlus1_HAD", vec_HAD_maxADCPlus1); + variables.push_back(maxADCPlus1_HAD); // Define the cutmasks (EM) + auto mask_EM_noDuplicates = Monitored::Collection("mask_EM_noDuplicates", vec_EM_noDuplicates); + variables.push_back(mask_EM_noDuplicates); + auto mask_EM_timeslice = Monitored::Collection("mask_EM_timeslice", vec_EM_timeslice); variables.push_back(mask_EM_timeslice); - + + auto mask_EM_maxSlice = Monitored::Collection("mask_EM_maxSlice", vec_EM_maxSlice); + variables.push_back(mask_EM_maxSlice); + + auto mask_EM_maxSlice_noPhi = Monitored::Collection("mask_EM_maxSlice_noPhi", vec_EM_maxSlice_noDuplicates); + variables.push_back(mask_EM_maxSlice_noPhi); + auto emTT_ADC = Monitored::Collection("emTT_ADC", vec_EM_ADC); variables.push_back(emTT_ADC); @@ -247,9 +304,18 @@ StatusCode PprMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const // Define the cutmasks (HAD) + auto mask_HAD_noDuplicates = Monitored::Collection("mask_HAD_noDuplicates", vec_HAD_noDuplicates); + variables.push_back(mask_HAD_noDuplicates); + auto mask_HAD_timeslice = Monitored::Collection("mask_HAD_timeslice", vec_HAD_timeslice); variables.push_back(mask_HAD_timeslice); + auto mask_HAD_maxSlice = Monitored::Collection("mask_HAD_maxSlice", vec_HAD_maxSlice); + variables.push_back(mask_HAD_maxSlice); + + auto mask_HAD_maxSlice_noPhi = Monitored::Collection("mask_HAD_maxSlice_noPhi", vec_HAD_maxSlice_noDuplicates); + variables.push_back(mask_HAD_maxSlice_noPhi); + auto hadTT_ADC = Monitored::Collection("hadTT_ADC", vec_HAD_ADC); variables.push_back(hadTT_ADC); @@ -288,17 +354,25 @@ StatusCode PprMonitorAlgorithm::fillPPMTowerEtaPhi( const xAOD::TriggerTower_v2* std::vector<MonitorTT> &vecMonTT_HAD, std::vector<MonitorTT> &vecMonTT) const { - + // Geometry const int layer = tt->layer(); // 0 = EM, 1 = HAD const double eta = tt->eta(); const double absEta = std::fabs(eta); const double phi = tt->phi(); double phiMod = phi * m_phiScaleTT; + + // LUT JEP int jepET = 0; const std::vector<uint_least8_t> jepETvec = tt->lut_jep(); if (jepETvec.size() > 0) jepET = tt->jepET(); + + // To remove duplicates when filling multiple bins in phi bool isDuplicate = false; + // ADC timeslice + const std::vector<short unsigned int> &ADC( tt->adc() ); + double max = recTime(ADC, m_EMFADCCut); + // Offsets for filling multiple phi bins depending on TT granularity in eta std::vector<double> offset32 = {1.5, 0.5, -0.5, -1.5}; std::vector<double> offset25 = {0.5, -0.5}; @@ -318,12 +392,13 @@ StatusCode PprMonitorAlgorithm::fillPPMTowerEtaPhi( const xAOD::TriggerTower_v2* monTT.jepET = jepET; if(i != 0) isDuplicate = true; monTT.isDuplicate = isDuplicate; - + monTT.maxADC = max; + vecMonTT.push_back(monTT); if (layer == 0) vecMonTT_EM.push_back(monTT); if (layer == 1) vecMonTT_HAD.push_back(monTT); - ATH_MSG_DEBUG("layer: " << layer << " eta: " << eta << " phi: " << phi << " scaled phi: " << monTT.phiScaled << " 1d phi: " << phi1d << " duplicate: " << monTT.isDuplicate); + ATH_MSG_DEBUG("layer: " << layer << " eta: " << eta << " phi: " << phi << " scaled phi: " << monTT.phiScaled << " 1d phi: " << phi1d << " max: " << max << " duplicate: " << monTT.isDuplicate); } } else if (absEta > 2.5) { @@ -337,11 +412,12 @@ StatusCode PprMonitorAlgorithm::fillPPMTowerEtaPhi( const xAOD::TriggerTower_v2* monTT.jepET = jepET; if(i != 0) isDuplicate = true; monTT.isDuplicate = isDuplicate; + monTT.maxADC = max; vecMonTT.push_back(monTT); if (layer == 0) vecMonTT_EM.push_back(monTT); if (layer == 1) vecMonTT_HAD.push_back(monTT); - ATH_MSG_DEBUG("layer: " << layer << " eta: " << eta << " phi: " << phi << " scaled phi: " << monTT.phiScaled << " 1d phi: " << phi1d << " duplicate: " << monTT.isDuplicate); + ATH_MSG_DEBUG("layer: " << layer << " eta: " << eta << " phi: " << phi << " scaled phi: " << monTT.phiScaled << " 1d phi: " << phi1d << " max: " << max << " duplicate: " << monTT.isDuplicate); } } else { @@ -352,11 +428,69 @@ StatusCode PprMonitorAlgorithm::fillPPMTowerEtaPhi( const xAOD::TriggerTower_v2* monTT.phi1d = phi; monTT.jepET = jepET; monTT.isDuplicate = false; + monTT.maxADC = max; + vecMonTT.push_back(monTT); if (layer == 0) vecMonTT_EM.push_back(monTT); if (layer == 1) vecMonTT_HAD.push_back(monTT); - ATH_MSG_DEBUG("layer: " << layer << " eta: " << eta << " phi: " << phi << " scaled phi: " << monTT.phiScaled << " 1d phi: " << phi1d << " duplicate: " << monTT.isDuplicate); + ATH_MSG_DEBUG("layer: " << layer << " eta: " << eta << " phi: " << phi << " scaled phi: " << monTT.phiScaled << " 1d phi: " << phi1d << " max: " << max << " duplicate: " << monTT.isDuplicate); } return StatusCode::SUCCESS; } + +double PprMonitorAlgorithm::recTime(const std::vector<short unsigned int> &vFADC, int cut) const { + + int max = -1; + const int slices = vFADC.size(); + if (slices > 0) { + max = 0.; + int maxAdc = vFADC[0]; + for (int sl = 1; sl < slices; ++sl) { + if (vFADC[sl] > maxAdc) { + maxAdc = vFADC[sl]; + max = sl; + } else if (vFADC[sl] == maxAdc) + max = -1; + } + if (maxAdc == 0) + max = -1; + } + if (max >= 0) { + int slbeg = max - 2; + if (slbeg < 0) + slbeg = 0; + int slend = max + 3; + if (slend > slices) + slend = slices; + int sum = 0; + int min = 999999; + for (int sl = slbeg; sl < slend; ++sl) { + int val = vFADC[sl]; + if (val < m_TT_ADC_Pedestal) + val = m_TT_ADC_Pedestal; + sum += val; + if (val < min) + min = val; + } + sum -= (slend - slbeg) * min; + if (sum <= cut) + max = -1; + } + + return double(max); +} + + + + + + + + + + + + + + diff --git a/Trigger/TrigT1/TrigT1CaloMonitoring/src/PprMonitorAlgorithm.h b/Trigger/TrigT1/TrigT1CaloMonitoring/src/PprMonitorAlgorithm.h index 8e2d10fc6acc..1e387d67de80 100644 --- a/Trigger/TrigT1/TrigT1CaloMonitoring/src/PprMonitorAlgorithm.h +++ b/Trigger/TrigT1/TrigT1CaloMonitoring/src/PprMonitorAlgorithm.h @@ -21,6 +21,7 @@ public:PprMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ); double phi1d; /// phi for 1d phi distributions (taking into account granularity in eta) int jepET; bool isDuplicate; /// Bookkeeping of multiple bins in phi for a given eta bin in the forward region + double maxADC; /// max ADC timeslice }; @@ -35,7 +36,9 @@ private: /// Properties Gaudi::Property<double> m_phiScaleTT{this, "phiScaleTT", 32./M_PI, "Scale factor to convert trigger tower phi to integer binning"}; Gaudi::Property<int> m_TT_ADC_HitMap_Thresh{this, "TT_ADC_HitMap_Thresh", 50, "ADC cut for hit maps"}; - + Gaudi::Property<int> m_SliceNo{this, "SliceNo", 15, "Number of possible time slices in the readout"}; + Gaudi::Property<int> m_EMFADCCut{this, "EMFADCCut", 40, "EM FADC cut for signal"}; + Gaudi::Property<int> m_TT_ADC_Pedestal{this, "ADCPedestal", 32, "Nominal pedestal value"}; /// Helper functions StatusCode fillPPMTowerEtaPhi( const xAOD::TriggerTower_v2* tt, @@ -43,5 +46,7 @@ private: std::vector<MonitorTT> &vecMonTT_HAD, std::vector<MonitorTT> &vecMonTT) const; + double recTime(const std::vector<short unsigned int> &vFADC, int cut) const; + }; #endif -- GitLab