diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/CMakeLists.txt b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..dad09c983fc2506e5681f6d1f199c31a1b9ff560 --- /dev/null +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/CMakeLists.txt @@ -0,0 +1,50 @@ +################################################################################ +# Package: MuonTrackMonitoring +################################################################################ + +# Declare the package name: +atlas_subdir( MuonTrackMonitoring ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Control/AthenaMonitoring + Control/StoreGate + DetectorDescription/GeoPrimitives + Event/EventPrimitives + Event/FourMomUtils + Event/xAOD/xAODEventInfo + Event/xAOD/xAODMuon + Event/xAOD/xAODTracking + GaudiKernel + MuonSpectrometer/MuonIdHelpers + MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData + MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools + MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces + MuonSpectrometer/MuonValidation/MuonHistogramming/MuonHistUtils + PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools + PhysicsAnalysis/MuonID/MuonSelectorTools + Tracking/TrkEvent/TrkEventPrimitives + Tracking/TrkEvent/TrkParameters + Tracking/TrkEvent/TrkTrack + Tracking/TrkTools/TrkToolInterfaces + Tracking/TrkValidation/TrkValHistUtils + Trigger/TrigConfiguration/TrigConfL1Data + PRIVATE + Tracking/TrkEvent/TrkMeasurementBase + Tracking/TrkEvent/TrkMultiComponentStateOnSurface ) + +# External dependencies: +find_package( Eigen ) +find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 ) + +# Component(s) in the package: +atlas_add_component( MuonTrackMonitoring + src/*.cxx + src/components/*.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} AthenaMonitoringLib StoreGateLib SGtests GeoPrimitives EventPrimitives FourMomUtils xAODEventInfo xAODMuon xAODTracking GaudiKernel MuonIdHelpersLib MuonPrepRawData MuonRecHelperToolsLib MuonRecToolInterfaces MuonHistUtils MuonResonanceToolsLib MuonSelectorToolsLib TrkEventPrimitives TrkParameters TrkTrack TrkToolInterfaces TrkValHistUtils TrigConfL1Data TrkMeasurementBase TrkMultiComponentStateOnSurface ) + +# Install files from the package: +atlas_install_headers( MuonTrackMonitoring ) +atlas_install_joboptions( share/*.py ) + diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/MuonGenericTracksMon.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/MuonGenericTracksMon.h index 016a272d99e37cd1e2572d9f3516db1f756f8698..5e55a16872ccad1285304f7c10ad5fbe30acbcb3 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/MuonGenericTracksMon.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/MuonGenericTracksMon.h @@ -110,7 +110,7 @@ class MuonGenericTracksMon : public ManagedMonitorToolBase //std::vector<RecoMuonPlots*> m_oRecoMuonForwPlots; //std::vector<RecoMuonPlots*> m_oRecoMuonCaloPlots; std::vector<RecoPhysPlots*> m_oRecoPhysPlots; - std::vector<RecoVertexPlots*> m_oRecoVertexPlots; + std::vector<RecoVertexPlots*> m_oRecoVertexPlots; protected: @@ -146,9 +146,9 @@ class MuonGenericTracksMon : public ManagedMonitorToolBase // Handle for the trig decision tool ToolHandle<Trig::ITrigDecisionTool> m_trigDecTool; // ToolHandle idHelper - ToolHandle<Trk::IResidualPullCalculator> m_pullCalculator; //<! tool to calculate residuals and pulls - ToolHandle<Muon::MuonEDMHelperTool> m_helperTool; - ToolHandle<Muon::MuonIdHelperTool> m_idHelperTool; + //ToolHandle<Trk::IResidualPullCalculator> m_pullCalculator; //<! tool to calculate residuals and pulls + //ToolHandle<Muon::MuonEDMHelperTool> m_helperTool; + //ToolHandle<Muon::MuonIdHelperTool> m_idHelperTool; ToolHandle<Muon::IMuonHitSummaryTool> m_muonHitSummaryTool; // MCP muon quality tool ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoLumiPlots.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoLumiPlots.h index 1d75bff1f692af43f14a44267ce49ab8288f6bd8..78abd65787499b5cbcbd7aae0bca0fde27455af9 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoLumiPlots.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoLumiPlots.h @@ -34,20 +34,20 @@ class RecoLumiPlots:public PlotBase { TH1* m_hNMuon_LB_1D; TH1* m_hNResonance_LB_1D; - TH1* m_hNSegment_Inst_1D; - TH1* m_hNMuonTrack_Inst_1D; - TH1* m_hNMuon_Inst_1D; - TH1* m_hNResonance_Inst_1D; + // TH1* m_hNSegment_Inst_1D; + // TH1* m_hNMuonTrack_Inst_1D; + // TH1* m_hNMuon_Inst_1D; + // TH1* m_hNResonance_Inst_1D; - TH1* m_hNSegment_IntLumi_1D; - TH1* m_hNMuonTrack_IntLumi_1D; - TH1* m_hNMuon_IntLumi_1D; - TH1* m_hNResonance_IntLumi_1D; + // TH1* m_hNSegment_IntLumi_1D; + // TH1* m_hNMuonTrack_IntLumi_1D; + // TH1* m_hNMuon_IntLumi_1D; + // TH1* m_hNResonance_IntLumi_1D; - TH1* m_hNSegment_LB_BA_1D; - TH1* m_hNSegment_LB_BC_1D; - TH1* m_hNSegment_LB_EA_1D; - TH1* m_hNSegment_LB_EC_1D; + // TH1* m_hNSegment_LB_BA_1D; + // TH1* m_hNSegment_LB_BC_1D; + // TH1* m_hNSegment_LB_EA_1D; + // TH1* m_hNSegment_LB_EC_1D; // Set 2D hists for development @@ -56,20 +56,20 @@ class RecoLumiPlots:public PlotBase { TH2* m_hNMuon_LB; TH2* m_hNResonance_LB; - TH2* m_hNSegment_Inst; - TH2* m_hNMuonTrack_Inst; - TH2* m_hNMuon_Inst; - TH2* m_hNResonance_Inst; + // TH2* m_hNSegment_Inst; + // TH2* m_hNMuonTrack_Inst; + // TH2* m_hNMuon_Inst; + // TH2* m_hNResonance_Inst; - TH2* m_hNSegment_IntLumi; - TH2* m_hNMuonTrack_IntLumi; - TH2* m_hNMuon_IntLumi; - TH2* m_hNResonance_IntLumi; + // TH2* m_hNSegment_IntLumi; + // TH2* m_hNMuonTrack_IntLumi; + // TH2* m_hNMuon_IntLumi; + // TH2* m_hNResonance_IntLumi; - TH2* m_hNSegment_LB_BA; - TH2* m_hNSegment_LB_BC; - TH2* m_hNSegment_LB_EA; - TH2* m_hNSegment_LB_EC; + // TH2* m_hNSegment_LB_BA; + // TH2* m_hNSegment_LB_BC; + // TH2* m_hNSegment_LB_EA; + // TH2* m_hNSegment_LB_EC; //for locating Z and Jpsi diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonPlots.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonPlots.h index 8a8554cbc3e97a9bebac4b1c38cdcbc80dac2c9b..e114a712f18fec78942fdd97d7c6a1182ae046f7 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonPlots.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonPlots.h @@ -18,10 +18,11 @@ #include "xAODMuon/Muon.h" #include "xAODMuon/MuonContainer.h" +#include "xAODTracking/TrackingPrimitives.h" class RecoMuonPlots:public PlotBase { public: - RecoMuonPlots(PlotBase* pParent, std::string sDir); + RecoMuonPlots(PlotBase* pParent, std::string sDir, bool detail=false); void fill(const xAOD::Muon& mu); void fill(const xAOD::Muon& mu, xAOD::Muon::Quality my_quality); @@ -30,25 +31,41 @@ class RecoMuonPlots:public PlotBase { Muon::RecoInfoPlots m_oMuRecoInfoPlots; Trk::ImpactPlots m_oImpactPlots; Muon::MomentumPullPlots m_oMomentumPullPlots; - Trk::MSHitPlots m_oMSHitPlots; - Muon::MuonHitSummaryPlots m_oMuonHitSummaryPlots; - Muon::MuonIsolationPlots m_oMuonIsolationPlots; - Muon::MuonParamPlots m_oMuonParamPlots; + //Trk::MSHitPlots m_oMSHitPlots; + //Muon::MuonHitSummaryPlots m_oMuonHitSummaryPlots; + //Muon::MuonIsolationPlots m_oMuonIsolationPlots; + //Muon::MuonParamPlots m_oMuonParamPlots; //extra monitoring plots - Trk::ParamPlots m_oAllPlots_tight; - Trk::ParamPlots m_oAllPlots_medium; - Trk::ParamPlots m_oAllPlots_loose; - Trk::ParamPlots m_oAllPlots_veryloose; + //Trk::ParamPlots m_oAllPlots_tight; + //Trk::ParamPlots m_oAllPlots_medium; + //Trk::ParamPlots m_oAllPlots_loose; + //Trk::ParamPlots m_oAllPlots_veryloose; //extra monitoring efficiency plots; filled in post processing + TH2* m_origin_eta_phi; TH2* m_eff_tight; TH2* m_eff_medium; - TH2* m_eff_loose; - TH2* m_eff_veryloose; + TH2* m_tight_eta_phi; + TH2* m_medium_eta_phi; + //TH2* m_eff_loose; + //TH2* m_eff_veryloose; TH1* m_pt_broad; TH2* m_eta_phi_broad; + //extra monitoring efficiency plots, normalized in post processing + TH2* m_eff_nPrec; + TH2* m_eff_nPhi; + TH2* m_eff_nTrigEta; + TH2* m_eff_ndof; + TH2* m_eff_chi2; + TH2* m_ID_eff_ndof; + TH2* m_ID_eff_chi2; + TH2* m_MS_eff_ndof; + TH2* m_MS_eff_chi2; + + bool Detail; + private: void initializePlots(); }; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonSegmentPlots.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonSegmentPlots.h index 45e54d09a00c6568f5bc1341dceec7b931bdceb0..bb504298bbeaf5a6cce7ff13e4342a5f51ebbaef 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonSegmentPlots.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonSegmentPlots.h @@ -7,6 +7,7 @@ #include "TrkValHistUtils/PlotBase.h" #include "MuonHistUtils/MuonSegmentPlots.h" +#include "MuonHistUtils/MuonSegmentSlimPlots.h" #include "xAODMuon/Muon.h" #include "xAODMuon/MuonContainer.h" @@ -22,7 +23,7 @@ namespace Muon { class RecoMuonSegmentPlots:public PlotBase { public: - RecoMuonSegmentPlots(PlotBase* pParent, std::string sDir); + RecoMuonSegmentPlots(PlotBase* pParent, std::string sDir, bool detail=false); //fill methods void fill(const xAOD::MuonContainer& muContainer); @@ -31,10 +32,11 @@ class RecoMuonSegmentPlots:public PlotBase { void fill(const xAOD::MuonSegment& muonSeg); //generic plots from MuonHistUtils - Muon::MuonSegmentPlots m_oMuonSegmentPlots; + Muon::MuonSegmentPlots *m_oMuonSegmentPlots; + Muon::MuonSegmentSlimPlots *m_oMuonSegmentSlimPlots; //Monitoring justification plots - + bool Detail; private: diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonTrackPlots.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonTrackPlots.h index ee58f0c572ef1803e691f6b77be614fd5e18b8a2..bd136b4b0d2f950784ffe529af51846dd56e8c95 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonTrackPlots.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoMuonTrackPlots.h @@ -34,23 +34,23 @@ class RecoMuonTrackPlots:public PlotBase { Trk::ParamPlots m_oAllPlots; Trk::ImpactPlots m_oImpactPlots; Trk::RecoInfoPlots m_oTrkRecoInfoPlots; - Trk::MSHitPlots m_oMSHitPlots; + //Trk::MSHitPlots m_oMSHitPlots; - Muon::MuonHitResidualPlots m_oResidualPlots_Global; - Muon::MuonHitResidualPlots m_oResidualPlots_MDT; - Muon::MuonHitResidualPlots m_oResidualPlots_RPC_eta; - Muon::MuonHitResidualPlots m_oResidualPlots_RPC_phi; - Muon::MuonHitResidualPlots m_oResidualPlots_TGC_wire; - Muon::MuonHitResidualPlots m_oResidualPlots_TGC_strip; - Muon::MuonHitResidualPlots m_oResidualPlots_CSC_eta; - Muon::MuonHitResidualPlots m_oResidualPlots_CSC_phi; + // Muon::MuonHitResidualPlots m_oResidualPlots_Global; + // Muon::MuonHitResidualPlots m_oResidualPlots_MDT; + // Muon::MuonHitResidualPlots m_oResidualPlots_RPC_eta; + // Muon::MuonHitResidualPlots m_oResidualPlots_RPC_phi; + // Muon::MuonHitResidualPlots m_oResidualPlots_TGC_wire; + // Muon::MuonHitResidualPlots m_oResidualPlots_TGC_strip; + // Muon::MuonHitResidualPlots m_oResidualPlots_CSC_eta; + // Muon::MuonHitResidualPlots m_oResidualPlots_CSC_phi; TH1* m_pt_broad; TH2* m_eta_phi_broad; - ToolHandle<Trk::IResidualPullCalculator> m_pullCalculator; - ToolHandle<Muon::MuonIdHelperTool> m_idHelperTool; - ToolHandle<Muon::MuonEDMHelperTool> m_helperTool; + //ToolHandle<Trk::IResidualPullCalculator> m_pullCalculator; + //ToolHandle<Muon::MuonIdHelperTool> m_idHelperTool; + //ToolHandle<Muon::MuonEDMHelperTool> m_helperTool; //fill methods void fill(const xAOD::Muon& mu, int component); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoPhysPlots.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoPhysPlots.h index 3f4c7a776ee4c34bc02f6a0613500ed95e3a46a4..effc089b25488233053b8100167efa45e1024419 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoPhysPlots.h +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/MuonTrackMonitoring/RecoPhysPlots.h @@ -26,13 +26,13 @@ class RecoPhysPlots:public PlotBase { TH1* m_occupancy; TH1* m_2occupancy; - TH2* m_Efficiency; - TH2* m_EffNumerator; - TH2* m_EffDenominator; + // TH2* m_Efficiency; + // TH2* m_EffNumerator; + // TH2* m_EffDenominator; - TH1* m_Efficiency_eta; - TH1* m_EffNumerator_eta; - TH1* m_EffDenominator_eta; + // TH1* m_Efficiency_eta; + // TH1* m_EffNumerator_eta; + // TH1* m_EffDenominator_eta; TH1* m_M_Mean; TH1* m_M_Sigma; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackDQA_options.py b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackDQA_options.py index 731f92a2491f8c1fb0fed540bc20bd6a57ee108b..ec9cca4d8e6c01ebd0b685c4fd4b00264f96eef0 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackDQA_options.py +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/share/MuonTrackDQA_options.py @@ -6,7 +6,7 @@ muTrackMonMan = AthenaMonManager(name="MuonTrackMonManager", FileKey = DQMonFlags.monManFileKey(), Environment = DQMonFlags.monManEnvironment(), DataType = DQMonFlags.monManDataType(), - OutputLevel = muonOutputLevel) + OutputLevel = WARNING) from RecExConfig.RecFlags import rec as recFlags from MuonRecExample import MuonRecTools diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonGenericTracksMon.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonGenericTracksMon.cxx index 1afa1b54e936a081fad89f0940d3e36600dcf889..beb5c6af12644050c701e7dc263b1209dea200d6 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonGenericTracksMon.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/MuonGenericTracksMon.cxx @@ -14,17 +14,15 @@ // ============================================================================== #include "MuonTrackMonitoring/MuonGenericTracksMon.h" - #include "MuonIdHelpers/MuonStationIndex.h" #include "xAODEventInfo/EventInfo.h" - #include "TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.h" #include "TrkMultiComponentStateOnSurface/MultiComponentState.h" #include "TrkEventPrimitives/ResidualPull.h" #include "TrkMeasurementBase/MeasurementBase.h" #include "TrkTrack/TrackStateOnSurface.h" #include "TrkTrack/TrackCollection.h" - +//include Root dependencies #include <TH1F.h> #include <TH2F.h> #include <TMath.h> @@ -38,9 +36,7 @@ MuonGenericTracksMon::MuonGenericTracksMon( const std::string & type, const std: m_inst_lumi_bcid(0.0), m_inst_lumi_lb(0.0), m_current_lb(-1), - m_hNEvent(NULL), - m_oRecoLumiPlots(0), m_oRecoMuonSegmentPlots(0), m_oRecoMuonMSTrackPlots(0), @@ -61,13 +57,12 @@ MuonGenericTracksMon::MuonGenericTracksMon( const std::string & type, const std: m_isMC(false) { - m_pullCalculator = ToolHandle<Trk::IResidualPullCalculator>("Trk::ResidualPullCalculator/ResidualPullCalculator"); + //m_pullCalculator = ToolHandle<Trk::IResidualPullCalculator>("Trk::ResidualPullCalculator/ResidualPullCalculator"); declareProperty("UseTriggerVector", m_useTrigger); declareProperty("MuonTriggerChainName", m_MuonTriggerChainName); declareProperty("Muon_Trigger_Items", m_muon_triggers); declareProperty("TriggerDecisionTool", m_trigDecTool); - declareProperty("MuonCollection", m_muonsName = "Muons"); declareProperty("MuonSegmentCollection", m_muonSegmentsName = "MuonSegments"); declareProperty("MuonTrackCollection", m_muonTracksName = "MuonSpectrometerTrackParticles"); @@ -86,9 +81,7 @@ StatusCode MuonGenericTracksMon::initialize() { StatusCode sc = ManagedMonitorToolBase::initialize(); if(!sc.isSuccess()) return sc; - sc = setupTools(); - return sc; } @@ -97,7 +90,6 @@ StatusCode MuonGenericTracksMon::initialize() StatusCode MuonGenericTracksMon::bookHistograms() //======================================================================================// { - ATH_MSG_DEBUG("In bookHistograms()"); if(!(m_environment == AthenaMonManager::tier0 || @@ -156,7 +148,7 @@ StatusCode MuonGenericTracksMon::bookHistograms() dirpath = m_MuonTriggerChainName + "Segments/" + sources[SOURCE::CONTAINER]; MonGroup mongroup_segments(this, rootpath + dirpath, run, attr); - m_oRecoMuonSegmentPlots.push_back(new RecoMuonSegmentPlots(0, dirpath)); + m_oRecoMuonSegmentPlots.push_back(new RecoMuonSegmentPlots(0, dirpath, true)); bookInMongroup(*m_oRecoMuonSegmentPlots[2], mongroup_segments, sources[SOURCE::CONTAINER]).ignore(); //book MS tracks dirpath = m_MuonTriggerChainName + "TracksMS/" + sources[SOURCE::CONTAINER]; @@ -166,12 +158,12 @@ StatusCode MuonGenericTracksMon::bookHistograms() //book muons dirpath = m_MuonTriggerChainName + "Muons/" + sources[SOURCE::CBMUONS]; MonGroup mongroup_mutracks(this, rootpath + dirpath, run, attr); - m_oRecoMuonPlots.push_back(new RecoMuonPlots(0, dirpath)); + m_oRecoMuonPlots.push_back(new RecoMuonPlots(0, dirpath, true)); bookInMongroup(*m_oRecoMuonPlots[0], mongroup_mutracks, sources[SOURCE::CBMUONS], "").ignore(); dirpath = m_MuonTriggerChainName + "Muons/" + sources[SOURCE::NONCBMUONS]; MonGroup mongroup_mutracks2(this, rootpath + dirpath, run, attr); - m_oRecoMuonPlots.push_back(new RecoMuonPlots(0, dirpath)); + m_oRecoMuonPlots.push_back(new RecoMuonPlots(0, dirpath, false)); bookInMongroup(*m_oRecoMuonPlots[1], mongroup_mutracks2, sources[SOURCE::NONCBMUONS], "NonCB").ignore(); //book id tracks dirpath = m_MuonTriggerChainName + "TracksID/" + sources[SOURCE::CBMUONS]; @@ -195,9 +187,9 @@ StatusCode MuonGenericTracksMon::bookHistograms() bookInMongroup(*m_oRecoMuonMETrackPlots[1], mongroup_metracks2, sources[SOURCE::NONCBMUONS], "ME").ignore(); dirpath = m_MuonTriggerChainName + "MSVertices/"; - MonGroup mongroup_msvertices(this, rootpath + dirpath, run, attr); - m_oRecoVertexPlots.push_back(new RecoVertexPlots(0, dirpath)); - bookInMongroup(*m_oRecoVertexPlots[0], mongroup_msvertices, sources[SOURCE::CONTAINER]).ignore(); + MonGroup mongroup_msvertices(this, rootpath + dirpath, run, attr); + m_oRecoVertexPlots.push_back(new RecoVertexPlots(0, dirpath)); + bookInMongroup(*m_oRecoVertexPlots[0], mongroup_msvertices, sources[SOURCE::CONTAINER]).ignore(); } else{ @@ -210,26 +202,28 @@ StatusCode MuonGenericTracksMon::bookHistograms() dirpath = "Segments/" + sources[i]; MonGroup mongroup_segments(this, rootpath + dirpath, run, attr); - m_oRecoMuonSegmentPlots.push_back(new RecoMuonSegmentPlots(0, dirpath)); + if(i == SOURCE::CBMUONS || i == SOURCE::CONTAINER) m_oRecoMuonSegmentPlots.push_back(new RecoMuonSegmentPlots(0, dirpath, true)); + else m_oRecoMuonSegmentPlots.push_back(new RecoMuonSegmentPlots(0, dirpath, false)); bookInMongroup(*m_oRecoMuonSegmentPlots[i], mongroup_segments, sources[i]).ignore(); if(i > SOURCE::CBMUONS){//for MS tracks, only do not CB muons, since it overlaps with ME - dirpath = "TracksMS/" + sources[i]; - MonGroup mongroup_mstracks(this, rootpath + dirpath, run, attr); - m_oRecoMuonMSTrackPlots.push_back(new RecoMuonTrackPlots(0, dirpath)); - bookInMongroup(*m_oRecoMuonMSTrackPlots[i - 3], mongroup_mstracks, sources[i], "MS").ignore(); + dirpath = "TracksMS/" + sources[i]; + MonGroup mongroup_mstracks(this, rootpath + dirpath, run, attr); + m_oRecoMuonMSTrackPlots.push_back(new RecoMuonTrackPlots(0, dirpath)); + bookInMongroup(*m_oRecoMuonMSTrackPlots[i - 3], mongroup_mstracks, sources[i], "MS").ignore(); } if(i != SOURCE::CONTAINER){//for IDME tracks and Muon, do not do container dirpath = "Muons/" + sources[i]; MonGroup mongroup_mutracks(this, rootpath + dirpath, run, attr); - m_oRecoMuonPlots.push_back(new RecoMuonPlots(0, dirpath)); + if(i > SOURCE::CBMUONS) m_oRecoMuonPlots.push_back(new RecoMuonPlots(0, dirpath, false)); + else m_oRecoMuonPlots.push_back(new RecoMuonPlots(0, dirpath, true)); bookInMongroup(*m_oRecoMuonPlots[i], mongroup_mutracks, sources[i], "").ignore(); - dirpath = "TracksME/" + sources[i]; - MonGroup mongroup_metracks(this, rootpath + dirpath, run, attr); - m_oRecoMuonMETrackPlots.push_back(new RecoMuonTrackPlots(0, dirpath)); - bookInMongroup(*m_oRecoMuonMETrackPlots[i], mongroup_metracks, sources[i], "ME").ignore(); + dirpath = "TracksME/" + sources[i]; + MonGroup mongroup_metracks(this, rootpath + dirpath, run, attr); + m_oRecoMuonMETrackPlots.push_back(new RecoMuonTrackPlots(0, dirpath)); + bookInMongroup(*m_oRecoMuonMETrackPlots[i], mongroup_metracks, sources[i], "ME").ignore(); dirpath = "TracksID/" + sources[i]; MonGroup mongroup_idtracks(this, rootpath + dirpath, run, attr); @@ -238,16 +232,16 @@ StatusCode MuonGenericTracksMon::bookHistograms() } if(i == SOURCE::Z){ - dirpath = rootpath + "/MuonTrkPhys/" + sources[i]; - MonGroup mongroup_Zsignal(this, dirpath, run, attr); - m_oRecoPhysPlots.push_back(new RecoPhysPlots(0, "", sources[i]));//the naming for res is slightly diff - bookInMongroup(*m_oRecoPhysPlots[i], mongroup_Zsignal, sources[i]).ignore(); + dirpath = rootpath + "/MuonTrkPhys/" + sources[i]; + MonGroup mongroup_Zsignal(this, dirpath, run, attr); + m_oRecoPhysPlots.push_back(new RecoPhysPlots(0, "", sources[i]));//the naming for res is slightly diff + bookInMongroup(*m_oRecoPhysPlots[i], mongroup_Zsignal, sources[i]).ignore(); } if(i == SOURCE::JPSI){ - dirpath = rootpath + "/MuonTrkPhys/" + sources[i]; - MonGroup mongroup_Jpsisignal(this, dirpath, run, attr); - m_oRecoPhysPlots.push_back(new RecoPhysPlots(0, "", sources[i]));//the naming for res is slightly diff - bookInMongroup(*m_oRecoPhysPlots[i], mongroup_Jpsisignal, sources[i]).ignore(); + dirpath = rootpath + "/MuonTrkPhys/" + sources[i]; + MonGroup mongroup_Jpsisignal(this, dirpath, run, attr); + m_oRecoPhysPlots.push_back(new RecoPhysPlots(0, "", sources[i]));//the naming for res is slightly diff + bookInMongroup(*m_oRecoPhysPlots[i], mongroup_Jpsisignal, sources[i]).ignore(); } }//end of loopoing over different sources }//end of different trigger situations @@ -299,13 +293,13 @@ StatusCode MuonGenericTracksMon::bookInMongroup(PlotBase& valPlots, MonGroup& mo // rebin and/or change the axis range label // move rebin of all 2D eta_phi plots to post processing - if (sHistName.EndsWith("_eta_phi")){ + if (sHistName.Contains("_eta_phi")){ hist.first->GetXaxis()->SetTitle("#eta"); hist.first->GetYaxis()->SetTitle("#phi"); } else if (sHistName.EndsWith("_eta_pt")){ - hist.first->GetXaxis()->SetTitle("p_{T} [GeV]"); - hist.first->GetYaxis()->SetTitle("#eta"); + hist.first->GetYaxis()->SetTitle("p_{T} [GeV]"); + hist.first->GetXaxis()->SetTitle("#eta"); } else if (sHistName.EndsWith("_eta")){ hist.first->RebinX(2); @@ -317,17 +311,17 @@ StatusCode MuonGenericTracksMon::bookInMongroup(PlotBase& valPlots, MonGroup& mo } else if (sHistName.EndsWith("_pt")){ hist.first->RebinX(2); - hist.first->GetXaxis()->SetRangeUser(0, 100);//consider repace with SetLimits(0, 100) + hist.first->GetXaxis()->SetLimits(0, 100);//consider repace with SetLimits(0, 100) hist.first->GetXaxis()->SetTitle("p_{T} [GeV]"); } else if (sHistName.EndsWith("_ddpt")){ hist.first->RebinX(3); } - else if (sHistName.Contains("_z0")){ - hist.first->GetXaxis()->SetRangeUser(-50, 50); + else if (sHistName.EndsWith("_z0")){ + hist.first->RebinX(2); } - else if (sHistName.Contains("_d0")){ - hist.first->GetXaxis()->SetRangeUser(-0.2, 0.2); + else if (sHistName.EndsWith("_d0")){ + hist.first->RebinX(2); } // for ID track hits, special treatment @@ -425,13 +419,6 @@ StatusCode MuonGenericTracksMon::fillHistograms() // return StatusCode::RECOVERABLE; // } // ATH_MSG_WARNING ("MS container size: " << tracksMS->size() << " ME container size: " << METracks->size()); - // select muons from Jpsi & Z - auto muons_jpsi = m_JpsimumuResonanceSelectionTool->selectMuons(Muons, m_isMC, CP::SystematicSet()); - auto muons_Z = m_ZmumuResonanceSelectionTool->selectMuons(Muons, m_isMC, CP::SystematicSet()); - - // find J/psi & Z candidates - auto resonances_jpsi = m_JpsimumuResonancePairingTool->buildPairs(muons_jpsi); - auto resonances_Z = m_ZmumuResonancePairingTool->buildPairs(muons_Z); // fill the histograms if (m_MuonTriggerChainName != ""){ @@ -467,6 +454,13 @@ StatusCode MuonGenericTracksMon::fillHistograms() } } else{ + // select muons from Jpsi & Z + auto muons_jpsi = m_JpsimumuResonanceSelectionTool->selectMuons(Muons, m_isMC, CP::SystematicSet()); + auto muons_Z = m_ZmumuResonanceSelectionTool->selectMuons(Muons, m_isMC, CP::SystematicSet()); + + // find J/psi & Z candidates + auto resonances_jpsi = m_JpsimumuResonancePairingTool->buildPairs(muons_jpsi); + auto resonances_Z = m_ZmumuResonancePairingTool->buildPairs(muons_Z); // plot luminosity related plots plot_lumi(resonances_Z, resonances_jpsi, Muons, tracksMS, MuonSegments); @@ -510,13 +504,13 @@ StatusCode MuonGenericTracksMon::fillHistograms() { plot_track(*track, SOURCE::CONTAINER - 3); } + //clean the resonance candidates + for (const xAOD::Muon* muon : muons_jpsi.first) delete muon; + for (const xAOD::Muon* muon : muons_jpsi.second) delete muon; + for (const xAOD::Muon* muon : muons_Z.first) delete muon; + for (const xAOD::Muon* muon : muons_Z.second) delete muon; }//end of different trigger situations //finish all the plotting - for (const xAOD::Muon* muon : muons_jpsi.first) delete muon; - for (const xAOD::Muon* muon : muons_jpsi.second) delete muon; - for (const xAOD::Muon* muon : muons_Z.first) delete muon; - for (const xAOD::Muon* muon : muons_Z.second) delete muon; - return StatusCode::SUCCESS; } @@ -680,26 +674,26 @@ StatusCode MuonGenericTracksMon::setupTools() ATH_MSG_DEBUG( "Defined detector service" ); - sc = m_pullCalculator.retrieve(); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Can't retrieve " << m_pullCalculator ); - return sc; - } - ATH_MSG_DEBUG( " Found the " << m_pullCalculator ); + // sc = m_pullCalculator.retrieve(); + // if (sc.isFailure()) { + // ATH_MSG_ERROR( "Can't retrieve " << m_pullCalculator ); + // return sc; + // } + // ATH_MSG_DEBUG( " Found the " << m_pullCalculator ); - sc = m_helperTool.retrieve(); - if (!sc.isSuccess()){ - ATH_MSG_FATAL( "Could not get " << m_helperTool ); - return sc; - } - ATH_MSG_DEBUG( "Retrieved " << m_helperTool ); + // sc = m_helperTool.retrieve(); + // if (!sc.isSuccess()){ + // ATH_MSG_FATAL( "Could not get " << m_helperTool ); + // return sc; + // } + // ATH_MSG_DEBUG( "Retrieved " << m_helperTool ); - sc = m_muonHitSummaryTool.retrieve(); - if (!sc.isSuccess()){ - ATH_MSG_FATAL( "Could not get " << m_muonHitSummaryTool ); - return sc; - } - ATH_MSG_DEBUG( "Retrieved " << m_muonHitSummaryTool ); + // sc = m_muonHitSummaryTool.retrieve(); + // if (!sc.isSuccess()){ + // ATH_MSG_FATAL( "Could not get " << m_muonHitSummaryTool ); + // return sc; + // } + // ATH_MSG_DEBUG( "Retrieved " << m_muonHitSummaryTool ); sc = m_ZmumuResonanceSelectionTool.retrieve(); if (!sc.isSuccess()){ diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoLumiPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoLumiPlots.cxx index 69b142b840ea44f20ded72e9bb685f04e584c65c..91c00d7827cdfeec5bf550d6efe0cd9b6336f54e 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoLumiPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoLumiPlots.cxx @@ -11,20 +11,20 @@ RecoLumiPlots::RecoLumiPlots(PlotBase* pParent, std::string sDir, std::string re m_hNMuon_LB_1D(NULL), m_hNResonance_LB_1D(NULL), - m_hNSegment_Inst_1D(NULL), - m_hNMuonTrack_Inst_1D(NULL), - m_hNMuon_Inst_1D(NULL), - m_hNResonance_Inst_1D(NULL), - - m_hNSegment_IntLumi_1D(NULL), - m_hNMuonTrack_IntLumi_1D(NULL), - m_hNMuon_IntLumi_1D(NULL), - m_hNResonance_IntLumi_1D(NULL), - - m_hNSegment_LB_BA_1D(NULL), - m_hNSegment_LB_BC_1D(NULL), - m_hNSegment_LB_EA_1D(NULL), - m_hNSegment_LB_EC_1D(NULL), + // m_hNSegment_Inst_1D(NULL), + // m_hNMuonTrack_Inst_1D(NULL), + // m_hNMuon_Inst_1D(NULL), + // m_hNResonance_Inst_1D(NULL), + + // m_hNSegment_IntLumi_1D(NULL), + // m_hNMuonTrack_IntLumi_1D(NULL), + // m_hNMuon_IntLumi_1D(NULL), + // m_hNResonance_IntLumi_1D(NULL), + + // m_hNSegment_LB_BA_1D(NULL), + // m_hNSegment_LB_BC_1D(NULL), + // m_hNSegment_LB_EA_1D(NULL), + // m_hNSegment_LB_EC_1D(NULL), //book the usual 2D hists m_hNSegment_LB(NULL), @@ -32,20 +32,20 @@ RecoLumiPlots::RecoLumiPlots(PlotBase* pParent, std::string sDir, std::string re m_hNMuon_LB(NULL), m_hNResonance_LB(NULL), - m_hNSegment_Inst(NULL), - m_hNMuonTrack_Inst(NULL), - m_hNMuon_Inst(NULL), - m_hNResonance_Inst(NULL), + // m_hNSegment_Inst(NULL), + // m_hNMuonTrack_Inst(NULL), + // m_hNMuon_Inst(NULL), + // m_hNResonance_Inst(NULL), - m_hNSegment_IntLumi(NULL), - m_hNMuonTrack_IntLumi(NULL), - m_hNMuon_IntLumi(NULL), - m_hNResonance_IntLumi(NULL), + // m_hNSegment_IntLumi(NULL), + // m_hNMuonTrack_IntLumi(NULL), + // m_hNMuon_IntLumi(NULL), + // m_hNResonance_IntLumi(NULL), - m_hNSegment_LB_BA(NULL), - m_hNSegment_LB_BC(NULL), - m_hNSegment_LB_EA(NULL), - m_hNSegment_LB_EC(NULL), + // m_hNSegment_LB_BA(NULL), + // m_hNSegment_LB_BC(NULL), + // m_hNSegment_LB_EA(NULL), + // m_hNSegment_LB_EC(NULL), type(recObj), name("other") @@ -66,126 +66,138 @@ void RecoLumiPlots::initializePlots() else {name = "other";} //Make sure the 1D hists has the same dimension as the 2D! - m_hNSegment_LB = Book2D("nSegment_LB_2D", "Number of Muon Segments Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 100, 0.5, 101.5); - m_hNMuonTrack_LB = Book2D("nMuonTrack_LB_2D", "Number of Muon MS Tracks Per LumiBlock;LumiBlock;Number of Tracks", 1600, -0.5, 1599.5, 21, 0.5, 21.5); - if (name != "other") m_hNMuon_LB = Book2D("nMuon_LB_2D", "Number of Muons Per LumiBlock;LumiBlock;Nmuons", 1600, -0.5, 1599.5, 21, 0.5, 21.5); - if (name == "Z" || name == "J/#psi"){m_hNResonance_LB = Book2D("n" + type + "_LB_2D", "Number of " + name + " Per LumiBlock;LumiBlock;Number of " + name, 1600, -0.5, 1599.5, 5, 0.5, 5.5);} - - m_hNSegment_Inst = Book2D("nSegment_Inst_2D", "Number of Muon Segments vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Nsegments", 150, -0.5, 10.5, 100, 0.5, 101.5); - m_hNMuonTrack_Inst = Book2D("nMuonTrack_Inst_2D", "Number of Muon MS Tracks vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Ntracks", 150, -0.5, 10.5, 21, 0.5, 21.5); - if (name != "other") m_hNMuon_Inst = Book2D("nMuon_Inst_2D", "Number of Muons vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Nmuons", 150, -0.5, 10.5, 21, 0.5, 21.5); - if (name == "Z" || name == "J/#psi"){m_hNResonance_Inst = Book2D("n" + type + "_Inst_2D", "Number of " + name + " vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};N " + name, 150, -0.5, 10.5, 5, 0.5, 5.5);} - - m_hNSegment_IntLumi = Book2D("nSegment_IntLumi_2D", "Number of Muon Segments vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Nsegments", 600, -0.5, 5999.5, 100, 0.5, 101.5); - m_hNMuonTrack_IntLumi = Book2D("nMuonTrack_IntLumi_2D", "Number of Muon MS Tracks vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Ntracks", 600, -0.5, 5999.5, 21, 0.5, 21.5); - if (name != "other") m_hNMuon_IntLumi = Book2D("nMuon_IntLumi_2D", "Number of Muons vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Nmuons", 600, -0.5, 5999.5, 21, 0.5, 21.5); - if (name == "Z" || name == "J/#psi"){m_hNResonance_IntLumi = Book2D("n" + type + "_IntLumi_2D", "Number of " + name + " vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};N " + name, 600, -0.5, 5999.5, 5, 0.5, 5.5);} - - m_hNSegment_LB_BA = Book2D("nSegment_LB_BA_2D", "Number of Muon Segments in Barrel A side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 80, 0.5, 81.5); - m_hNSegment_LB_BC = Book2D("nSegment_LB_BC_2D", "Number of Muon Segments in Barrel C side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 80, 0.5, 81.5); - m_hNSegment_LB_EA = Book2D("nSegment_LB_EA_2D", "Number of Muon Segments in Endcap A side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 80, 0.5, 81.5); - m_hNSegment_LB_EC = Book2D("nSegment_LB_EC_2D", "Number of Muon Segments in Endcap C side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 80, 0.5, 81.5); + if (name == "other"){ + m_hNSegment_LB = Book2D("nSegment_LB_2D", "Number of Muon Segments Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 100, 0.5, 101.5); + m_hNMuonTrack_LB = Book2D("nMuonTrack_LB_2D", "Number of Muon MS Tracks Per LumiBlock;LumiBlock;Number of Tracks", 1600, -0.5, 1599.5, 21, 0.5, 21.5); + m_hNSegment_LB_1D = Book1D("nSegment_LB", "Number of Muon Segments Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); + m_hNMuonTrack_LB_1D = Book1D("nMuonTrack_LB", "Number of Muon MS Tracks Per LumiBlock;LumiBlock;Number of Tracks", 1600, -0.5, 1599.5); + } + else if (name == "CBMuons"){ + m_hNMuon_LB = Book2D("nMuon_LB_2D", "Number of Muons Per LumiBlock;LumiBlock;Nmuons", 1600, -0.5, 1599.5, 21, 0.5, 21.5); + m_hNMuon_LB_1D = Book1D("nMuon_LB", "Number of Muons Per LumiBlock;LumiBlock;Nmuons", 1600, -0.5, 1599.5); + } + else if (name == "NonCBMuons"){ + m_hNMuon_LB = Book2D("nMuon_LB_2D", "Number of non-CB Muons Per LumiBlock;LumiBlock;Nmuons", 1600, -0.5, 1599.5, 21, 0.5, 21.5); + m_hNMuon_LB_1D = Book1D("nMuon_LB", "Number of non-CB Muons Per LumiBlock;LumiBlock;Nmuons", 1600, -0.5, 1599.5); + } + else if (name == "Z" || name == "J/#psi"){ + m_hNResonance_LB = Book2D("n" + type + "_LB_2D", "Number of " + name + " Per LumiBlock;LumiBlock;Number of " + name, 1600, -0.5, 1599.5, 5, 0.5, 5.5); + m_hNResonance_LB_1D = Book1D("n" + type + "_LB", "Number of " + name + " Per LumiBlock;LumiBlock;Number of " + name, 1600, -0.5, 1599.5); + } + + // m_hNSegment_Inst = Book2D("nSegment_Inst_2D", "Number of Muon Segments vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Nsegments", 150, -0.5, 10.5, 100, 0.5, 101.5); + // m_hNMuonTrack_Inst = Book2D("nMuonTrack_Inst_2D", "Number of Muon MS Tracks vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Ntracks", 150, -0.5, 10.5, 21, 0.5, 21.5); + // if (name != "other") m_hNMuon_Inst = Book2D("nMuon_Inst_2D", "Number of Muons vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Nmuons", 150, -0.5, 10.5, 21, 0.5, 21.5); + // if (name == "Z" || name == "J/#psi"){m_hNResonance_Inst = Book2D("n" + type + "_Inst_2D", "Number of " + name + " vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};N " + name, 150, -0.5, 10.5, 5, 0.5, 5.5);} + + // m_hNSegment_IntLumi = Book2D("nSegment_IntLumi_2D", "Number of Muon Segments vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Nsegments", 600, -0.5, 5999.5, 100, 0.5, 101.5); + // m_hNMuonTrack_IntLumi = Book2D("nMuonTrack_IntLumi_2D", "Number of Muon MS Tracks vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Ntracks", 600, -0.5, 5999.5, 21, 0.5, 21.5); + // if (name != "other") m_hNMuon_IntLumi = Book2D("nMuon_IntLumi_2D", "Number of Muons vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Nmuons", 600, -0.5, 5999.5, 21, 0.5, 21.5); + // if (name == "Z" || name == "J/#psi"){m_hNResonance_IntLumi = Book2D("n" + type + "_IntLumi_2D", "Number of " + name + " vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};N " + name, 600, -0.5, 5999.5, 5, 0.5, 5.5);} + + // m_hNSegment_LB_BA = Book2D("nSegment_LB_BA_2D", "Number of Muon Segments in Barrel A side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 80, 0.5, 81.5); + // m_hNSegment_LB_BC = Book2D("nSegment_LB_BC_2D", "Number of Muon Segments in Barrel C side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 80, 0.5, 81.5); + // m_hNSegment_LB_EA = Book2D("nSegment_LB_EA_2D", "Number of Muon Segments in Endcap A side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 80, 0.5, 81.5); + // m_hNSegment_LB_EC = Book2D("nSegment_LB_EC_2D", "Number of Muon Segments in Endcap C side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5, 80, 0.5, 81.5); //book the 1D hists for webdisplay - m_hNSegment_LB_1D = Book1D("nSegment_LB", "Number of Muon Segments Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); - m_hNMuonTrack_LB_1D = Book1D("nMuonTrack_LB", "Number of Muon MS Tracks Per LumiBlock;LumiBlock;Number of Tracks", 1600, -0.5, 1599.5); - if (name != "other") m_hNMuon_LB_1D = Book1D("nMuon_LB", "Number of Muons Per LumiBlock;LumiBlock;Nmuons", 1600, -0.5, 1599.5); - if (name == "Z" || name == "J/#psi"){m_hNResonance_LB_1D = Book1D("n" + type + "_LB", "Number of " + name + " Per LumiBlock;LumiBlock;Number of " + name, 1600, -0.5, 1599.5);} - - m_hNSegment_Inst_1D = Book1D("nSegment_Inst", "Number of Muon Segments vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Nsegments", 150, -0.5, 10.5); - m_hNMuonTrack_Inst_1D = Book1D("nMuonTrack_Inst", "Number of Muon MS Tracks vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Ntracks", 150, -0.5, 10.5); - if (name != "other") m_hNMuon_Inst_1D = Book1D("nMuon_Inst", "Number of Muons vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Nmuons", 150, -0.5, 10.5); - if (name == "Z" || name == "J/#psi"){m_hNResonance_Inst_1D = Book1D("n" + type + "_Inst", "Number of " + name + " vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};N " + name, 150, -0.5, 10.5);} - - m_hNSegment_IntLumi_1D = Book1D("nSegment_IntLumi", "Number of Muon Segments vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Nsegments", 500, -0.5, 1000.5); - m_hNMuonTrack_IntLumi_1D = Book1D("nMuonTrack_IntLumi", "Number of Muon MS Tracks vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Ntracks", 500, -0.5, 1000.5); - if (name != "other") m_hNMuon_IntLumi_1D = Book1D("nMuon_IntLumi", "Number of Muons vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Nmuons", 500, -0.5, 1000.5); - if (name == "Z" || name == "J/#psi"){m_hNResonance_IntLumi_1D = Book1D("n" + type + "_IntLumi", "Number of " + name + " vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};N " + name, 500, -0.5, 1000.5);} - - m_hNSegment_LB_BA_1D = Book1D("nSegment_LB_BA", "Number of Muon Segments in Barrel A side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); - m_hNSegment_LB_BC_1D = Book1D("nSegment_LB_BC", "Number of Muon Segments in Barrel C side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); - m_hNSegment_LB_EA_1D = Book1D("nSegment_LB_EA", "Number of Muon Segments in Endcap A side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); - m_hNSegment_LB_EC_1D = Book1D("nSegment_LB_EC", "Number of Muon Segments in Endcap C side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); + + // m_hNSegment_Inst_1D = Book1D("nSegment_Inst", "Number of Muon Segments vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Nsegments", 150, -0.5, 10.5); + // m_hNMuonTrack_Inst_1D = Book1D("nMuonTrack_Inst", "Number of Muon MS Tracks vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Ntracks", 150, -0.5, 10.5); + // if (name != "other") m_hNMuon_Inst_1D = Book1D("nMuon_Inst", "Number of Muons vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};Nmuons", 150, -0.5, 10.5); + // if (name == "Z" || name == "J/#psi"){m_hNResonance_Inst_1D = Book1D("n" + type + "_Inst", "Number of " + name + " vs Instant Lumi per BCID;Instant Lumi per BCID, 10^{30}cm^{-2}s^{-1};N " + name, 150, -0.5, 10.5);} + + // m_hNSegment_IntLumi_1D = Book1D("nSegment_IntLumi", "Number of Muon Segments vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Nsegments", 500, -0.5, 1000.5); + // m_hNMuonTrack_IntLumi_1D = Book1D("nMuonTrack_IntLumi", "Number of Muon MS Tracks vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Ntracks", 500, -0.5, 1000.5); + // if (name != "other") m_hNMuon_IntLumi_1D = Book1D("nMuon_IntLumi", "Number of Muons vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};Nmuons", 500, -0.5, 1000.5); + // if (name == "Z" || name == "J/#psi"){m_hNResonance_IntLumi_1D = Book1D("n" + type + "_IntLumi", "Number of " + name + " vs Average Inst Lumi per Sec;Average Inst Lumi per Sec, 10^{30}cm^{-2}s^{-1};N " + name, 500, -0.5, 1000.5);} + + // m_hNSegment_LB_BA_1D = Book1D("nSegment_LB_BA", "Number of Muon Segments in Barrel A side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); + // m_hNSegment_LB_BC_1D = Book1D("nSegment_LB_BC", "Number of Muon Segments in Barrel C side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); + // m_hNSegment_LB_EA_1D = Book1D("nSegment_LB_EA", "Number of Muon Segments in Endcap A side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); + // m_hNSegment_LB_EC_1D = Book1D("nSegment_LB_EC", "Number of Muon Segments in Endcap C side Per LumiBlock;LumiBlock;Number of Segments", 1600, -0.5, 1599.5); } //fill Segment related lb plots void RecoLumiPlots::fill(const xAOD::MuonSegmentContainer* MuonSegments, int m_current_lb, float m_inst_lumi_bcid, float m_inst_lumi_lb) { - m_hNSegment_LB->Fill(m_current_lb, MuonSegments->size()); - if (m_inst_lumi_bcid > 0) m_hNSegment_Inst->Fill(m_inst_lumi_bcid, MuonSegments->size()); - if (m_inst_lumi_lb > 0) m_hNSegment_IntLumi->Fill(m_inst_lumi_lb, MuonSegments->size()); - int m_NsegBA = 0; - int m_NsegBC = 0; - int m_NsegEA = 0; - int m_NsegEC = 0; - - for (const auto museg : *MuonSegments) { - if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegBA++; - if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegBC++; - if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegEA++; - if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegEC++; - } - m_hNSegment_LB_BA->Fill(m_current_lb, m_NsegBA); - m_hNSegment_LB_BC->Fill(m_current_lb, m_NsegBC); - m_hNSegment_LB_EA->Fill(m_current_lb, m_NsegEA); - m_hNSegment_LB_EC->Fill(m_current_lb, m_NsegEC); + m_hNSegment_LB->Fill(m_current_lb, MuonSegments->size() + m_inst_lumi_bcid - m_inst_lumi_bcid + m_inst_lumi_lb - m_inst_lumi_lb); + // if (m_inst_lumi_bcid > 0) m_hNSegment_Inst->Fill(m_inst_lumi_bcid, MuonSegments->size()); + // if (m_inst_lumi_lb > 0) m_hNSegment_IntLumi->Fill(m_inst_lumi_lb, MuonSegments->size()); + + // int m_NsegBA = 0; + // int m_NsegBC = 0; + // int m_NsegEA = 0; + // int m_NsegEC = 0; + // for (const auto museg : *MuonSegments) { + // if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegBA++; + // if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegBC++; + // if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegEA++; + // if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegEC++; + // } + // m_hNSegment_LB_BA->Fill(m_current_lb, m_NsegBA); + // m_hNSegment_LB_BC->Fill(m_current_lb, m_NsegBC); + // m_hNSegment_LB_EA->Fill(m_current_lb, m_NsegEA); + // m_hNSegment_LB_EC->Fill(m_current_lb, m_NsegEC); } //fill Track related plots void RecoLumiPlots::fill(const xAOD::TrackParticleContainer* MSTracks, int m_current_lb, float m_inst_lumi_bcid, float m_inst_lumi_lb){ - m_hNMuonTrack_LB->Fill(m_current_lb, MSTracks->size()); - if (m_inst_lumi_bcid > 0) m_hNMuonTrack_Inst->Fill(m_inst_lumi_bcid, MSTracks->size()); - if (m_inst_lumi_lb > 0) m_hNMuonTrack_IntLumi->Fill(m_inst_lumi_lb, MSTracks->size()); + m_hNMuonTrack_LB->Fill(m_current_lb, MSTracks->size() + m_inst_lumi_bcid - m_inst_lumi_bcid + m_inst_lumi_lb - m_inst_lumi_lb); + //if (m_inst_lumi_bcid > 0) m_hNMuonTrack_Inst->Fill(m_inst_lumi_bcid, MSTracks->size()); + //if (m_inst_lumi_lb > 0) m_hNMuonTrack_IntLumi->Fill(m_inst_lumi_lb, MSTracks->size()); } //fill CB muon related plots void RecoLumiPlots::fill_CB(const xAOD::MuonContainer* Muons, int m_current_lb, float m_inst_lumi_bcid, float m_inst_lumi_lb){ + + int m_NMuIDco = 0; - int m_NTrkIDco = 0; - int m_NSegIDco = 0; - int m_NsegBA = 0; - int m_NsegBC = 0; - int m_NsegEA = 0; - int m_NsegEC = 0; + //int m_NTrkIDco = 0; + //int m_NSegIDco = 0; + // int m_NsegBA = 0; + // int m_NsegBC = 0; + // int m_NsegEA = 0; + // int m_NsegEC = 0; for(const auto mu : *Muons) { //do a muon quality cut: 0 tight, 1 medium, 2 loss if(mu->muonType() == xAOD::Muon::Combined){m_NMuIDco++;} //check the muon related segments - const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments = mu->muonSegmentLinks(); - for(const auto Mu_Segment : Mu_Segments){ - const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; - if(Mu_seg.isValid()){ - m_NSegIDco++; - const xAOD::MuonSegment* museg = *Mu_seg; - if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegBA++; - if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegBC++; - if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegEA++; - if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegEC++; - } - } - //check muon related tracks - ElementLink<xAOD::TrackParticleContainer> Mu_MStrack = mu->muonSpectrometerTrackParticleLink(); - if(Mu_MStrack.isValid()){ - m_NTrkIDco++; - } + // const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments = mu->muonSegmentLinks(); + // for(const auto Mu_Segment : Mu_Segments){ + // const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; + // if(Mu_seg.isValid()){ + // m_NSegIDco++; + // // const xAOD::MuonSegment* museg = *Mu_seg; + // // if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegBA++; + // // if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegBC++; + // // if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegEA++; + // // if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegEC++; + // } + // } + // //check muon related tracks + // ElementLink<xAOD::TrackParticleContainer> Mu_MStrack = mu->muonSpectrometerTrackParticleLink(); + // if(Mu_MStrack.isValid()){ + // m_NTrkIDco++; + // } } //only do this for combined muons - m_hNMuon_LB->Fill(m_current_lb, m_NMuIDco); - if (m_inst_lumi_bcid > 0) m_hNMuon_Inst->Fill(m_inst_lumi_bcid, m_NMuIDco); - if (m_inst_lumi_lb > 0) m_hNMuon_IntLumi->Fill(m_inst_lumi_lb, m_NMuIDco); - m_hNMuonTrack_LB->Fill(m_current_lb, m_NTrkIDco); - if (m_inst_lumi_bcid > 0) m_hNMuonTrack_Inst->Fill(m_inst_lumi_bcid, m_NTrkIDco); - if (m_inst_lumi_lb > 0) m_hNMuonTrack_IntLumi->Fill(m_inst_lumi_lb, m_NTrkIDco); - m_hNSegment_LB->Fill(m_current_lb, m_NSegIDco); - if (m_inst_lumi_bcid > 0) m_hNSegment_Inst->Fill(m_inst_lumi_bcid, m_NSegIDco); - if (m_inst_lumi_lb > 0) m_hNSegment_IntLumi->Fill(m_inst_lumi_lb, m_NSegIDco); - m_hNSegment_LB_BA->Fill(m_current_lb, m_NsegBA); - m_hNSegment_LB_BC->Fill(m_current_lb, m_NsegBC); - m_hNSegment_LB_EA->Fill(m_current_lb, m_NsegEA); - m_hNSegment_LB_EC->Fill(m_current_lb, m_NsegEC); + m_hNMuon_LB->Fill(m_current_lb, m_NMuIDco + m_inst_lumi_bcid - m_inst_lumi_bcid + m_inst_lumi_lb - m_inst_lumi_lb); + //if (m_inst_lumi_bcid > 0) m_hNMuon_Inst->Fill(m_inst_lumi_bcid, m_NMuIDco); + //if (m_inst_lumi_lb > 0) m_hNMuon_IntLumi->Fill(m_inst_lumi_lb, m_NMuIDco); + //m_hNMuonTrack_LB->Fill(m_current_lb, m_NTrkIDco); + //if (m_inst_lumi_bcid > 0) m_hNMuonTrack_Inst->Fill(m_inst_lumi_bcid, m_NTrkIDco); + //if (m_inst_lumi_lb > 0) m_hNMuonTrack_IntLumi->Fill(m_inst_lumi_lb, m_NTrkIDco); + //m_hNSegment_LB->Fill(m_current_lb, m_NSegIDco); + //if (m_inst_lumi_bcid > 0) m_hNSegment_Inst->Fill(m_inst_lumi_bcid, m_NSegIDco); + //if (m_inst_lumi_lb > 0) m_hNSegment_IntLumi->Fill(m_inst_lumi_lb, m_NSegIDco); + // m_hNSegment_LB_BA->Fill(m_current_lb, m_NsegBA); + // m_hNSegment_LB_BC->Fill(m_current_lb, m_NsegBC); + // m_hNSegment_LB_EA->Fill(m_current_lb, m_NsegEA); + // m_hNSegment_LB_EC->Fill(m_current_lb, m_NsegEC); } @@ -193,49 +205,49 @@ void RecoLumiPlots::fill_CB(const xAOD::MuonContainer* Muons, int m_current_lb, void RecoLumiPlots::fill_Other(const xAOD::MuonContainer* Muons, int m_current_lb, float m_inst_lumi_bcid, float m_inst_lumi_lb){ int m_NMuIDco = 0; - int m_NTrkIDco = 0; - int m_NSegIDco = 0; - int m_NsegBA = 0; - int m_NsegBC = 0; - int m_NsegEA = 0; - int m_NsegEC = 0; + // int m_NTrkIDco = 0; + // int m_NSegIDco = 0; + // int m_NsegBA = 0; + // int m_NsegBC = 0; + // int m_NsegEA = 0; + // int m_NsegEC = 0; for(const auto mu : *Muons) { //do a muon quality cut: 0 tight, 1 medium, 2 loss if(mu->muonType() != xAOD::Muon::Combined){m_NMuIDco++;} //check the muon related segments - const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments = mu->muonSegmentLinks(); - for(const auto Mu_Segment : Mu_Segments){ - const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; - if(Mu_seg.isValid()){ - m_NSegIDco++; - const xAOD::MuonSegment* museg = *Mu_seg; - if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegBA++; - if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegBC++; - if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegEA++; - if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegEC++; - } - } - //check muon related tracks - ElementLink<xAOD::TrackParticleContainer> Mu_MStrack = mu->muonSpectrometerTrackParticleLink(); - if(Mu_MStrack.isValid()){ - m_NTrkIDco++; - } + // const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments = mu->muonSegmentLinks(); + // for(const auto Mu_Segment : Mu_Segments){ + // const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; + // if(Mu_seg.isValid()){ + // m_NSegIDco++; + // // const xAOD::MuonSegment* museg = *Mu_seg; + // // if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegBA++; + // // if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegBC++; + // // if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegEA++; + // // if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegEC++; + // } + // } + // //check muon related tracks + // ElementLink<xAOD::TrackParticleContainer> Mu_MStrack = mu->muonSpectrometerTrackParticleLink(); + // if(Mu_MStrack.isValid()){ + // m_NTrkIDco++; + // } } //only do this for combined muons - m_hNMuon_LB->Fill(m_current_lb, m_NMuIDco); - if (m_inst_lumi_bcid > 0) m_hNMuon_Inst->Fill(m_inst_lumi_bcid, m_NMuIDco); - if (m_inst_lumi_lb > 0) m_hNMuon_IntLumi->Fill(m_inst_lumi_lb, m_NMuIDco); - m_hNMuonTrack_LB->Fill(m_current_lb, m_NTrkIDco); - if (m_inst_lumi_bcid > 0) m_hNMuonTrack_Inst->Fill(m_inst_lumi_bcid, m_NTrkIDco); - if (m_inst_lumi_lb > 0) m_hNMuonTrack_IntLumi->Fill(m_inst_lumi_lb, m_NTrkIDco); - m_hNSegment_LB->Fill(m_current_lb, m_NSegIDco); - if (m_inst_lumi_bcid > 0) m_hNSegment_Inst->Fill(m_inst_lumi_bcid, m_NSegIDco); - if (m_inst_lumi_lb > 0) m_hNSegment_IntLumi->Fill(m_inst_lumi_lb, m_NSegIDco); - m_hNSegment_LB_BA->Fill(m_current_lb, m_NsegBA); - m_hNSegment_LB_BC->Fill(m_current_lb, m_NsegBC); - m_hNSegment_LB_EA->Fill(m_current_lb, m_NsegEA); - m_hNSegment_LB_EC->Fill(m_current_lb, m_NsegEC); + m_hNMuon_LB->Fill(m_current_lb, m_NMuIDco + m_inst_lumi_bcid - m_inst_lumi_bcid + m_inst_lumi_lb - m_inst_lumi_lb); + // if (m_inst_lumi_bcid > 0) m_hNMuon_Inst->Fill(m_inst_lumi_bcid, m_NMuIDco); + // if (m_inst_lumi_lb > 0) m_hNMuon_IntLumi->Fill(m_inst_lumi_lb, m_NMuIDco); + // m_hNMuonTrack_LB->Fill(m_current_lb, m_NTrkIDco); + // if (m_inst_lumi_bcid > 0) m_hNMuonTrack_Inst->Fill(m_inst_lumi_bcid, m_NTrkIDco); + // if (m_inst_lumi_lb > 0) m_hNMuonTrack_IntLumi->Fill(m_inst_lumi_lb, m_NTrkIDco); + // m_hNSegment_LB->Fill(m_current_lb, m_NSegIDco); + // if (m_inst_lumi_bcid > 0) m_hNSegment_Inst->Fill(m_inst_lumi_bcid, m_NSegIDco); + // if (m_inst_lumi_lb > 0) m_hNSegment_IntLumi->Fill(m_inst_lumi_lb, m_NSegIDco); + // m_hNSegment_LB_BA->Fill(m_current_lb, m_NsegBA); + // m_hNSegment_LB_BC->Fill(m_current_lb, m_NsegBC); + // m_hNSegment_LB_EA->Fill(m_current_lb, m_NsegEA); + // m_hNSegment_LB_EC->Fill(m_current_lb, m_NsegEC); } @@ -244,70 +256,70 @@ void RecoLumiPlots::fill(std::vector<std::pair<const xAOD::Muon*, const xAOD::Mu int m_Nresonance = resonances.size(); //only do this for combined muons - m_hNResonance_LB->Fill(m_current_lb, m_Nresonance); - if (m_inst_lumi_bcid != 0) m_hNResonance_Inst->Fill(m_inst_lumi_bcid, m_Nresonance); - if (m_inst_lumi_lb != 0) m_hNResonance_IntLumi->Fill(m_inst_lumi_lb, m_Nresonance); - - - int m_NMuIDco = 0; - int m_NTrkIDco = 0; - int m_NSegIDco = 0; - int m_NsegBA = 0; - int m_NsegBC = 0; - int m_NsegEA = 0; - int m_NsegEC = 0; - for (auto resonance: resonances) - { - - if(resonance.first->muonType() == xAOD::Muon::Combined){m_NMuIDco++;} - if(resonance.second->muonType() == xAOD::Muon::Combined){m_NMuIDco++;} - //do a muon quality cut: 0 tight, 1 medium, 2 loss - //check the muon related segments - const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments_first = resonance.first->muonSegmentLinks(); - for(const auto Mu_Segment : Mu_Segments_first){ - const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; - if(Mu_seg.isValid()){ - m_NSegIDco++; - } - } - //check muon related tracks - ElementLink<xAOD::TrackParticleContainer> Mu_MStrack_first = resonance.first->muonSpectrometerTrackParticleLink(); - if(Mu_MStrack_first.isValid()){ - m_NTrkIDco++; - } - //do a muon quality cut: 0 tight, 1 medium, 2 loss - //check the muon related segments - const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments_second = resonance.second->muonSegmentLinks(); - for(const auto Mu_Segment : Mu_Segments_second){ - const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; - if(Mu_seg.isValid()){ - m_NSegIDco++; - const xAOD::MuonSegment* museg = *Mu_seg; - if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegBA++; - if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegBC++; - if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegEA++; - if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegEC++; - } - } - //check muon related tracks - ElementLink<xAOD::TrackParticleContainer> Mu_MStrack_second= resonance.second->muonSpectrometerTrackParticleLink(); - if(Mu_MStrack_second.isValid()){ - m_NTrkIDco++; - } - } + m_hNResonance_LB->Fill(m_current_lb, m_Nresonance + m_inst_lumi_bcid - m_inst_lumi_bcid + m_inst_lumi_lb - m_inst_lumi_lb);//playing really dumb here + //if (m_inst_lumi_bcid != 0) m_hNResonance_Inst->Fill(m_inst_lumi_bcid, m_Nresonance); + //if (m_inst_lumi_lb != 0) m_hNResonance_IntLumi->Fill(m_inst_lumi_lb, m_Nresonance); + + + // int m_NMuIDco = 0; + // int m_NTrkIDco = 0; + // int m_NSegIDco = 0; + // int m_NsegBA = 0; + // int m_NsegBC = 0; + // int m_NsegEA = 0; + // int m_NsegEC = 0; + // for (auto resonance: resonances) + // { + + // if(resonance.first->muonType() == xAOD::Muon::Combined){m_NMuIDco++;} + // if(resonance.second->muonType() == xAOD::Muon::Combined){m_NMuIDco++;} + // //do a muon quality cut: 0 tight, 1 medium, 2 loss + // //check the muon related segments + // const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments_first = resonance.first->muonSegmentLinks(); + // for(const auto Mu_Segment : Mu_Segments_first){ + // const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; + // if(Mu_seg.isValid()){ + // m_NSegIDco++; + // } + // } + // //check muon related tracks + // ElementLink<xAOD::TrackParticleContainer> Mu_MStrack_first = resonance.first->muonSpectrometerTrackParticleLink(); + // if(Mu_MStrack_first.isValid()){ + // m_NTrkIDco++; + // } + // //do a muon quality cut: 0 tight, 1 medium, 2 loss + // //check the muon related segments + // const std::vector<ElementLink<DataVector<xAOD::MuonSegment_v1>>> Mu_Segments_second = resonance.second->muonSegmentLinks(); + // for(const auto Mu_Segment : Mu_Segments_second){ + // const ElementLink<DataVector<xAOD::MuonSegment_v1>> Mu_seg = Mu_Segment; + // if(Mu_seg.isValid()){ + // m_NSegIDco++; + // // const xAOD::MuonSegment* museg = *Mu_seg; + // // if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegBA++; + // // if ((museg->chamberIndex() < Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegBC++; + // // if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() > 0)) m_NsegEA++; + // // if ((museg->chamberIndex() >= Muon::MuonStationIndex::BEE) && (museg->z() < 0)) m_NsegEC++; + // } + // } + // //check muon related tracks + // ElementLink<xAOD::TrackParticleContainer> Mu_MStrack_second = resonance.second->muonSpectrometerTrackParticleLink(); + // if(Mu_MStrack_second.isValid()){ + // m_NTrkIDco++; + // } + // } //only do this for combined muons - m_hNMuon_LB->Fill(m_current_lb, m_NMuIDco); - if (m_inst_lumi_bcid > 0) m_hNMuon_Inst->Fill(m_inst_lumi_bcid, m_NMuIDco); - if (m_inst_lumi_lb > 0) m_hNMuon_IntLumi->Fill(m_inst_lumi_lb, m_NMuIDco); - m_hNMuonTrack_LB->Fill(m_current_lb, m_NTrkIDco); - if (m_inst_lumi_bcid > 0) m_hNMuonTrack_Inst->Fill(m_inst_lumi_bcid, m_NTrkIDco); - if (m_inst_lumi_lb > 0) m_hNMuonTrack_IntLumi->Fill(m_inst_lumi_lb, m_NTrkIDco); - m_hNSegment_LB->Fill(m_current_lb, m_NSegIDco); - if (m_inst_lumi_bcid > 0) m_hNSegment_Inst->Fill(m_inst_lumi_bcid, m_NSegIDco); - if (m_inst_lumi_lb > 0) m_hNSegment_IntLumi->Fill(m_inst_lumi_lb, m_NSegIDco); - m_hNSegment_LB_BA->Fill(m_current_lb, m_NsegBA); - m_hNSegment_LB_BC->Fill(m_current_lb, m_NsegBC); - m_hNSegment_LB_EA->Fill(m_current_lb, m_NsegEA); - m_hNSegment_LB_EC->Fill(m_current_lb, m_NsegEC); + // m_hNMuon_LB->Fill(m_current_lb, m_NMuIDco); + // if (m_inst_lumi_bcid > 0) m_hNMuon_Inst->Fill(m_inst_lumi_bcid, m_NMuIDco); + // if (m_inst_lumi_lb > 0) m_hNMuon_IntLumi->Fill(m_inst_lumi_lb, m_NMuIDco); + // m_hNMuonTrack_LB->Fill(m_current_lb, m_NTrkIDco); + // if (m_inst_lumi_bcid > 0) m_hNMuonTrack_Inst->Fill(m_inst_lumi_bcid, m_NTrkIDco); + // if (m_inst_lumi_lb > 0) m_hNMuonTrack_IntLumi->Fill(m_inst_lumi_lb, m_NTrkIDco); + // m_hNSegment_LB->Fill(m_current_lb, m_NSegIDco); + // if (m_inst_lumi_bcid > 0) m_hNSegment_Inst->Fill(m_inst_lumi_bcid, m_NSegIDco); + // if (m_inst_lumi_lb > 0) m_hNSegment_IntLumi->Fill(m_inst_lumi_lb, m_NSegIDco); + // m_hNSegment_LB_BA->Fill(m_current_lb, m_NsegBA); + // m_hNSegment_LB_BC->Fill(m_current_lb, m_NsegBC); + // m_hNSegment_LB_EA->Fill(m_current_lb, m_NsegEA); + // m_hNSegment_LB_EC->Fill(m_current_lb, m_NsegEC); } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonIDTrackPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonIDTrackPlots.cxx index 3c9695435dae047859313b51cc0a5e9bef75d0de..97b7cfb918920fcc0d6a8c3bc6a05d63bed53ea5 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonIDTrackPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonIDTrackPlots.cxx @@ -15,8 +15,8 @@ m_eta_phi_broad(NULL) void RecoMuonIDTrackPlots::initializePlots(){ //booking histograms - m_pt_broad = Book1D("_pt_broad", "High p_{T} Distribution", 140, 100, 1500); - m_eta_phi_broad = Book2D("_eta_phi_broad", "High p_{T} Muon #eta #phi Distribution;;#eta;#phi", 128, -3.2, 3.2, 128, -3.2, 3.2); + m_pt_broad = Book1D("_pt_broad", "High p_{T} Distribution", 70, 100, 1500); + m_eta_phi_broad = Book2D("_eta_phi_broad", "High p_{T} Muon #eta #phi Distribution;;#eta;#phi", 52, -2.6, 2.6, 64, -3.2, 3.2); } //when the plot function called with a Muon Container diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonPlots.cxx index 7f39ace0f899f3439de4a5f4af79dfcfb3aeca17..bbbc03058c35fe2e29f3ba0f87a31f4360d4ab6b 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonPlots.cxx @@ -7,57 +7,87 @@ typedef ElementLink< xAOD::TrackParticleContainer > TrackLink; typedef ElementLink< xAOD::MuonContainer > MuonLink; -RecoMuonPlots::RecoMuonPlots(PlotBase* pParent, std::string sDir):PlotBase(pParent, sDir) +RecoMuonPlots::RecoMuonPlots(PlotBase* pParent, std::string sDir, bool detail):PlotBase(pParent, sDir) , m_oAllPlots(this, "/", "Reco Muon") , m_oMuRecoInfoPlots(this, "/") , m_oImpactPlots(this, "/") , m_oMomentumPullPlots(this, "/") -, m_oMSHitPlots(this,"/") -, m_oMuonHitSummaryPlots(this,"/") -, m_oMuonIsolationPlots(this,"/") -, m_oMuonParamPlots(this,"/") -, m_oAllPlots_tight(this, "/Tight/", "Tight") -, m_oAllPlots_medium(this, "/Medium/", "Medium") -, m_oAllPlots_loose(this, "/Loose/", "Loose") -, m_oAllPlots_veryloose(this, "/Veryloose/", "Veryloose") +//, m_oMSHitPlots(this,"/") +//, m_oMuonHitSummaryPlots(this,"/") +//, m_oMuonIsolationPlots(this,"/") +//, m_oMuonParamPlots(this,"/") +//, m_oAllPlots_tight(this, "/Tight/", "Tight") +//, m_oAllPlots_medium(this, "/Medium/", "Medium") +//, m_oAllPlots_loose(this, "/Loose/", "Loose") +//, m_oAllPlots_veryloose(this, "/Veryloose/", "Veryloose") +, m_origin_eta_phi(NULL) , m_eff_tight(NULL) , m_eff_medium(NULL) -, m_eff_loose(NULL) -, m_eff_veryloose(NULL) +, m_tight_eta_phi(NULL) +, m_medium_eta_phi(NULL) +//, m_eff_loose(NULL) +//, m_eff_veryloose(NULL) , m_pt_broad(NULL) , m_eta_phi_broad(NULL) -{} +, m_eff_nPrec(NULL) +, m_eff_nPhi(NULL) +, m_eff_nTrigEta(NULL) +, m_eff_ndof(NULL) +, m_eff_chi2(NULL) +, m_ID_eff_ndof(NULL) +, m_ID_eff_chi2(NULL) +, m_MS_eff_ndof(NULL) +, m_MS_eff_chi2(NULL) +{ + Detail = detail; +} void RecoMuonPlots::initializePlots(){ //be very careful here, bin size is the same as the defult value std::vector<HistData> hists = m_oAllPlots.retrieveBookedHistograms(); // HistData -> std::pair<TH1*, std::string> - int xbins = 128; - int ybins = 128; - float xmin = -3.2; - float xmax = 3.2; + int xbins = 52; + int ybins = 64; + float xmin = -2.6; + float xmax = 2.6; float ymin = -3.2; float ymax = 3.2; - for (auto hist: hists) { - TString sHistName = hist.first->GetName(); - TString sHistTitle = hist.first->GetTitle(); - //change the axis get label - if (sHistName.Contains("_eta_phi")){ - xmin = hist.first->GetXaxis()->GetXmin(); - xmax = hist.first->GetXaxis()->GetXmax(); - ymin = hist.first->GetYaxis()->GetXmin(); - ymax = hist.first->GetYaxis()->GetXmax(); - xbins = hist.first->GetXaxis()->GetNbins(); - ybins = hist.first->GetXaxis()->GetNbins(); - } - } + // for (auto hist: hists) { + // TString sHistName = hist.first->GetName(); + // TString sHistTitle = hist.first->GetTitle(); + // //change the axis get label + // if (sHistName.Contains("_eta_phi")){ + // xmin = hist.first->GetXaxis()->GetXmin(); + // xmax = hist.first->GetXaxis()->GetXmax(); + // ymin = hist.first->GetYaxis()->GetXmin(); + // ymax = hist.first->GetYaxis()->GetXmax(); + // xbins = hist.first->GetXaxis()->GetNbins(); + // ybins = hist.first->GetXaxis()->GetNbins(); + // } + // } + //now register! - m_eff_tight = Book2D("_Tight_eff", "Tight Quality Efficiency;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + m_origin_eta_phi= Book2D("_Origin_eta_phi", "Original Distribution;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + m_eff_tight = Book2D("_Tight_eff", "Tight Quality Efficiency;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); m_eff_medium = Book2D("_Medium_eff", "Medium Quality Efficiency;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); - m_eff_loose = Book2D("_Loose_eff", "Loose Quality Efficiency;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); - m_eff_veryloose = Book2D("_Veryloose_eff", "Very Loose Quality Efficiency;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); - m_pt_broad = Book1D("_pt_broad", "High p_{T} Distribution;p_{T} [GeV]", 140, 100, 1500); - m_eta_phi_broad = Book2D("_eta_phi_broad", "High p_{T} Muon #eta #phi Distribution;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + m_tight_eta_phi = Book2D("_Tight_eta_phi", "Tight Muon #eta #phi Distribution;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + m_medium_eta_phi = Book2D("_Medium_eta_phi", "Medium Muon #eta #phi Distribution;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + //m_eff_loose = Book2D("_Loose_eff", "Loose Quality Efficiency;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + //m_eff_veryloose = Book2D("_Veryloose_eff", "Very Loose Quality Efficiency;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + if (Detail){ + m_pt_broad = Book1D("_pt_broad", "High p_{T} Distribution;p_{T} [GeV]", 70, 100, 1500); + m_eta_phi_broad = Book2D("_eta_phi_broad", "High p_{T} Muon #eta #phi Distribution;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + + m_eff_nPrec = Book2D("_eff_nPrec", "average number of Precision Layers;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + m_eff_nPhi = Book2D("_eff_nPhi", "average number of Phi Layers;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + m_eff_nTrigEta = Book2D("_eff_nTrigEta","average number of Trigger Eta Layers;#eta;#phi", xbins, xmin, xmax, ybins, ymin, ymax); + m_eff_ndof = Book2D("_eff_ndof", "average number of hits;#eta;#phi",xbins, xmin, xmax, ybins, ymin, ymax); + m_eff_chi2 = Book2D("_eff_chi2", "average #chi^{2} per DOF;#eta;#phi",xbins, xmin, xmax, ybins, ymin, ymax); + m_ID_eff_ndof = Book2D("_ID_eff_ndof", "ID track average number of hits;#eta;#phi",xbins, xmin, xmax, ybins, ymin, ymax); + m_ID_eff_chi2 = Book2D("_ID_eff_chi2", "ID track average #chi^{2} per DOF;#eta;#phi",xbins, xmin, xmax, ybins, ymin, ymax); + m_MS_eff_ndof = Book2D("_MS_eff_ndof", "MS track average number of hits;#eta;#phi",xbins, xmin, xmax, ybins, ymin, ymax); + m_MS_eff_chi2 = Book2D("_MS_eff_chi2", "MS track average #chi^{2} per DOF;#eta;#phi",xbins, xmin, xmax, ybins, ymin, ymax); + } } void RecoMuonPlots::fill(const xAOD::Muon& mu){ @@ -65,25 +95,63 @@ void RecoMuonPlots::fill(const xAOD::Muon& mu){ m_oAllPlots.fill(mu); m_oMuRecoInfoPlots.fill(mu); m_oMomentumPullPlots.fill(mu); - m_oMuonHitSummaryPlots.fill(mu); - m_oMuonIsolationPlots.fill(mu); - m_oMuonParamPlots.fill(mu); - if (mu.pt()/1000.0 > 100) {//ony for high pt muons - m_pt_broad->Fill(mu.pt()/1000.0); - m_eta_phi_broad->Fill(mu.eta(), mu.phi()); - } + //m_oMuonHitSummaryPlots.fill(mu); + //m_oMuonIsolationPlots.fill(mu); + //m_oMuonParamPlots.fill(mu); - // tracking related plots const xAOD::TrackParticle* primaryTrk = mu.trackParticle(xAOD::Muon::Primary); + // tracking related plots if (!primaryTrk) return; m_oImpactPlots.fill(*primaryTrk); - m_oMSHitPlots.fill(*primaryTrk); + //m_oMSHitPlots.fill(*primaryTrk); + } void RecoMuonPlots::fill(const xAOD::Muon& mu, xAOD::Muon::Quality my_quality){ + + //always fill the origin plot + m_origin_eta_phi->Fill(mu.eta(), mu.phi()); + //General Plots; inclusive - if (my_quality <= xAOD::Muon::Tight) m_oAllPlots_tight.fill(mu); - if (my_quality <= xAOD::Muon::Medium) m_oAllPlots_medium.fill(mu); - if (my_quality <= xAOD::Muon::Loose) m_oAllPlots_loose.fill(mu); - if (my_quality <= xAOD::Muon::VeryLoose) m_oAllPlots_veryloose.fill(mu); + if (my_quality <= xAOD::Muon::Tight) m_tight_eta_phi->Fill(mu.eta(), mu.phi()); + if (my_quality <= xAOD::Muon::Medium) m_medium_eta_phi->Fill(mu.eta(), mu.phi()); + //if (my_quality <= xAOD::Muon::Loose) m_oAllPlots_loose.fill(mu); + //if (my_quality <= xAOD::Muon::VeryLoose) m_oAllPlots_veryloose.fill(mu); + + if(!Detail) return; + if (mu.pt()/1000.0 > 100) {//ony for high pt muons + m_pt_broad->Fill(mu.pt()/1000.0); + m_eta_phi_broad->Fill(mu.eta(), mu.phi()); + } + const xAOD::TrackParticle* primaryTrk = mu.trackParticle(xAOD::Muon::Primary); + const xAOD::TrackParticle* inDetTrk = mu.trackParticle(xAOD::Muon::InnerDetectorTrackParticle); + int correctEnum = (int) xAOD::Muon::MuonSpectrometerTrackParticle; + if (mu.isAvailable< ElementLink<xAOD::TrackParticleContainer> >("extrapolatedMuonSpectrometerTrackParticleLink") && (mu.auxdata< ElementLink<xAOD::TrackParticleContainer> >("extrapolatedMuonSpectrometerTrackParticleLink")).isValid()) correctEnum+=2; //check correct numbering in Muon.h + const xAOD::TrackParticle* msExtrapTrk = mu.trackParticle((xAOD::Muon::TrackParticleType) correctEnum); + + //fill the ndof and chi2 as eta phi map; to calculate efficiencies in post processing + //if necessary, can use a quality cut here + if (primaryTrk) { + m_eff_ndof->Fill(primaryTrk->eta(), primaryTrk->phi(), primaryTrk->numberDoF()); + m_eff_chi2->Fill(primaryTrk->eta(), primaryTrk->phi(), primaryTrk->chiSquared()/(primaryTrk->numberDoF() * 1.0)); + } + if (inDetTrk) { + m_ID_eff_ndof->Fill(inDetTrk->eta(), inDetTrk->phi(), inDetTrk->numberDoF()); + m_ID_eff_chi2->Fill(inDetTrk->eta(), inDetTrk->phi(), inDetTrk->chiSquared()/(inDetTrk->numberDoF() * 1.0)); + } + if (msExtrapTrk) { + m_MS_eff_ndof->Fill(msExtrapTrk->eta(), msExtrapTrk->phi(), msExtrapTrk->numberDoF()); + m_MS_eff_chi2->Fill(msExtrapTrk->eta(), msExtrapTrk->phi(), msExtrapTrk->chiSquared()/(msExtrapTrk->numberDoF() * 1.0)); + } + + uint8_t hitval_numberOfPrecisionLayers = 0; + if (!primaryTrk->summaryValue(hitval_numberOfPrecisionLayers, xAOD::numberOfPrecisionLayers)) return; + m_eff_nPrec->Fill(mu.eta(), mu.phi(), hitval_numberOfPrecisionLayers); + uint8_t hitval_numberOfPhiLayers = 0; + if (!primaryTrk->summaryValue(hitval_numberOfPhiLayers, xAOD::numberOfPhiLayers)) return; + m_eff_nPhi->Fill(mu.eta(), mu.phi(), hitval_numberOfPhiLayers); + uint8_t hitval_numberOfTriggerEtaLayers = 0; + if (!primaryTrk->summaryValue(hitval_numberOfTriggerEtaLayers, xAOD::numberOfTriggerEtaLayers)) return; + m_eff_nTrigEta->Fill(mu.eta(), mu.phi(), hitval_numberOfTriggerEtaLayers); + } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonSegmentPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonSegmentPlots.cxx index aa49bfd286a252e9d21266554d6d2a8f20e2856c..dd5e91b47ea9e4e1526dea22625f44275b069e6c 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonSegmentPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonSegmentPlots.cxx @@ -6,10 +6,15 @@ #include "MuonIdHelpers/MuonStationIndex.h" -RecoMuonSegmentPlots::RecoMuonSegmentPlots(PlotBase* pParent, std::string sDir):PlotBase(pParent, sDir) - , m_oMuonSegmentPlots(this,"/") +RecoMuonSegmentPlots::RecoMuonSegmentPlots(PlotBase* pParent, std::string sDir, bool detail):PlotBase(pParent, sDir) + , m_oMuonSegmentPlots(NULL) + , m_oMuonSegmentSlimPlots(NULL) //declare the histograms -{} +{ + Detail = detail; + if(Detail) m_oMuonSegmentPlots = new Muon::MuonSegmentPlots(this,"/"); + else m_oMuonSegmentSlimPlots = new Muon::MuonSegmentSlimPlots(this,"/"); +} //when the plot function called with a Muon Container //loop through each muon, get the corresponding link and fill it @@ -50,7 +55,8 @@ void RecoMuonSegmentPlots::fill(const std::vector<ElementLink<DataVector<xAOD::M void RecoMuonSegmentPlots::fill(const xAOD::MuonSegment& muonSeg) { //General Plots - m_oMuonSegmentPlots.fill(muonSeg); + if (Detail) m_oMuonSegmentPlots->fill(muonSeg); + else m_oMuonSegmentSlimPlots->fill(muonSeg); } void RecoMuonSegmentPlots::initializePlots() diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonTrackPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonTrackPlots.cxx index 115ec26f9e0a5602a9e2291b0a16f1c9c4d3ed4c..95cc6968bd8f5f5e1c6593fb690c0b2e56e171a2 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonTrackPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoMuonTrackPlots.cxx @@ -8,24 +8,24 @@ RecoMuonTrackPlots::RecoMuonTrackPlots(PlotBase* pParent, std::string sDir):Plot m_oAllPlots(this, "/", "Reco Muon"), m_oImpactPlots(this, "/"), m_oTrkRecoInfoPlots(this, "/"), -m_oMSHitPlots(this,"/"), -m_oResidualPlots_Global(this, "/Global/", ""), -m_oResidualPlots_MDT(this, "/MDT/", ""), -m_oResidualPlots_RPC_eta(this, "/RPC/", "eta"), -m_oResidualPlots_RPC_phi(this, "/RPC/", "phi"), -m_oResidualPlots_TGC_wire(this, "/TGC/", "wire"), -m_oResidualPlots_TGC_strip(this, "/TGC/", "strip"), -m_oResidualPlots_CSC_eta(this, "/CSC/", "eta"), -m_oResidualPlots_CSC_phi(this, "/CSC/", "phi"), +// m_oMSHitPlots(this,"/"), +// m_oResidualPlots_Global(this, "/Global/", ""), +// m_oResidualPlots_MDT(this, "/MDT/", ""), +// m_oResidualPlots_RPC_eta(this, "/RPC/", "eta"), +// m_oResidualPlots_RPC_phi(this, "/RPC/", "phi"), +// m_oResidualPlots_TGC_wire(this, "/TGC/", "wire"), +// m_oResidualPlots_TGC_strip(this, "/TGC/", "strip"), +// m_oResidualPlots_CSC_eta(this, "/CSC/", "eta"), +// m_oResidualPlots_CSC_phi(this, "/CSC/", "phi"), m_pt_broad(NULL), -m_eta_phi_broad(NULL), -m_pullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator") +m_eta_phi_broad(NULL) +//m_pullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator") {} void RecoMuonTrackPlots::initializePlots(){ //booking histograms - m_pt_broad = Book1D("_pt_broad", "High p_{T} Distribution", 140, 100, 1500); - m_eta_phi_broad = Book2D("_eta_phi_broad", "High p_{T} Muon #eta #phi Distribution;;#eta;#phi", 128, -3.2, 3.2, 128, -3.2, 3.2); + m_pt_broad = Book1D("_pt_broad", "High p_{T} Distribution", 70, 100, 1500); + m_eta_phi_broad = Book2D("_eta_phi_broad", "High p_{T} Muon #eta #phi Distribution;#eta;#phi", 52, -2.6, 2.6, 64, -3.2, 3.2); } //when the plot function called with a Muon Container @@ -40,7 +40,7 @@ void RecoMuonTrackPlots::fill(const xAOD::Muon& mu, int component){ if(Mu_MStrack.isValid()){ //std::cout<<"Plot base test MS track"<<std::endl; const xAOD::TrackParticle* trk = *Mu_MStrack; - fill(*trk); + fill(*trk); } } @@ -61,66 +61,66 @@ void RecoMuonTrackPlots::fill(const xAOD::TrackParticle& muTP){ m_oAllPlots.fill(muTP); m_oImpactPlots.fill(muTP); m_oTrkRecoInfoPlots.fill(muTP); - m_oMSHitPlots.fill(muTP); + //m_oMSHitPlots.fill(muTP); if (muTP.pt()/1000.0 > 100) {//ony for high pt muons m_pt_broad->Fill(muTP.pt()/1000.0); m_eta_phi_broad->Fill(muTP.eta(), muTP.phi()); } - const Trk::Track* track = muTP.track(); //@@@ NUMEROUS FPE WARNINGS!!! - if (!track) return; + // const Trk::Track* track = muTP.track(); //@@@ NUMEROUS FPE WARNINGS!!! + // if (!track) return; - const DataVector< const Trk::TrackStateOnSurface>* trackSoS=track->trackStateOnSurfaces(); - if (!trackSoS) return; + // const DataVector< const Trk::TrackStateOnSurface>* trackSoS=track->trackStateOnSurfaces(); + // if (!trackSoS) return; - for (const auto stateOnSurface: *trackSoS) { + // for (const auto stateOnSurface: *trackSoS) { - if (!stateOnSurface) continue; + // if (!stateOnSurface) continue; - if (stateOnSurface->type(Trk::TrackStateOnSurface::Outlier)) continue; + // if (stateOnSurface->type(Trk::TrackStateOnSurface::Outlier)) continue; - const Trk::MeasurementBase* meas = stateOnSurface->measurementOnTrack(); - if (!meas) continue; + // const Trk::MeasurementBase* meas = stateOnSurface->measurementOnTrack(); + // if (!meas) continue; - Identifier id = m_helperTool->getIdentifier(*meas); - if (!id.is_valid()) continue; + // Identifier id = m_helperTool->getIdentifier(*meas); + // if (!id.is_valid()) continue; - const Trk::TrackParameters* trackParameters = stateOnSurface->trackParameters(); - if (!trackParameters) continue; + // const Trk::TrackParameters* trackParameters = stateOnSurface->trackParameters(); + // if (!trackParameters) continue; - const Trk::ResidualPull* resPull = m_pullCalculator->residualPull(meas, trackParameters, Trk::ResidualPull::Unbiased); - if (!resPull) continue; + // const Trk::ResidualPull* resPull = m_pullCalculator->residualPull(meas, trackParameters, Trk::ResidualPull::Unbiased); + // if (!resPull) continue; - const Muon::MuonStationIndex::TechnologyIndex techid = m_idHelperTool->technologyIndex(id); - const int stationPhi = m_idHelperTool->sector(id); //1-16, odd=large, even=small - const bool measuresPhi = m_idHelperTool->measuresPhi(id); + // const Muon::MuonStationIndex::TechnologyIndex techid = m_idHelperTool->technologyIndex(id); + // const int stationPhi = m_idHelperTool->sector(id); //1-16, odd=large, even=small + // const bool measuresPhi = m_idHelperTool->measuresPhi(id); - m_oResidualPlots_Global.fill(*resPull,stationPhi); + // m_oResidualPlots_Global.fill(*resPull,stationPhi); - if (techid==Muon::MuonStationIndex::MDT) { - m_oResidualPlots_MDT.fill(*resPull,stationPhi); - } - else if (techid==Muon::MuonStationIndex::RPC){ - if (measuresPhi) - m_oResidualPlots_RPC_phi.fill(*resPull,stationPhi); - else - m_oResidualPlots_RPC_eta.fill(*resPull,stationPhi); - } - else if (techid==Muon::MuonStationIndex::TGC){ - if (measuresPhi) - m_oResidualPlots_TGC_strip.fill(*resPull,stationPhi); - else - m_oResidualPlots_TGC_wire.fill(*resPull,stationPhi); - } - else if (techid==Muon::MuonStationIndex::CSCI){ //it's CSCI, not CSC!!! - if (measuresPhi) - m_oResidualPlots_CSC_phi.fill(*resPull,stationPhi); - else - m_oResidualPlots_CSC_eta.fill(*resPull,stationPhi); - } - delete resPull; - } + // if (techid==Muon::MuonStationIndex::MDT) { + // m_oResidualPlots_MDT.fill(*resPull,stationPhi); + // } + // else if (techid==Muon::MuonStationIndex::RPC){ + // if (measuresPhi) + // m_oResidualPlots_RPC_phi.fill(*resPull,stationPhi); + // else + // m_oResidualPlots_RPC_eta.fill(*resPull,stationPhi); + // } + // else if (techid==Muon::MuonStationIndex::TGC){ + // if (measuresPhi) + // m_oResidualPlots_TGC_strip.fill(*resPull,stationPhi); + // else + // m_oResidualPlots_TGC_wire.fill(*resPull,stationPhi); + // } + // else if (techid==Muon::MuonStationIndex::CSCI){ //it's CSCI, not CSC!!! + // if (measuresPhi) + // m_oResidualPlots_CSC_phi.fill(*resPull,stationPhi); + // else + // m_oResidualPlots_CSC_eta.fill(*resPull,stationPhi); + // } + // delete resPull; + // } } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoPhysPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoPhysPlots.cxx index 7e497fb694c3fd9b142a0e18e76243630a42a290..66871a698b2de3468180119ff558ecd69569c99d 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoPhysPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoPhysPlots.cxx @@ -9,12 +9,12 @@ RecoPhysPlots::RecoPhysPlots(PlotBase *pParent, std::string sDir, std::string re m_Mass(0), m_occupancy(0), m_2occupancy(0), - m_Efficiency(0), - m_EffNumerator(0), - m_EffDenominator(0), - m_Efficiency_eta(0), - m_EffNumerator_eta(0), - m_EffDenominator_eta(0), + // m_Efficiency(0), + // m_EffNumerator(0), + // m_EffDenominator(0), + // m_Efficiency_eta(0), + // m_EffNumerator_eta(0), + // m_EffDenominator_eta(0), m_M_Mean(0), m_M_Sigma(0), m_M_EA_EA(0), @@ -68,14 +68,14 @@ void RecoPhysPlots::initializePlots(){ //resonance two muon distribution m_occupancy = Book1D("m_"+type+"_occupancy", "m_occupancy: M_{"+name+"} Track Occupancy;;N_{#mu}", 8, 0.0, 8.0); m_2occupancy = Book1D("m_"+type+"_2occupancy", "m_2occupancy: M_{"+name+"} Two Track Occupancy;;N_{#mu}", 16, 0.5, 16.5); - //for resonance efficiency calculations - m_Efficiency = Book2D("m_"+type+"_Efficiency", "m_Efficiency: M_{"+name+"} Efficiency", 8, 0.0, 8.0, 16, 1.0, 17.0); - m_EffNumerator = Book2D("m_"+type+"_EffNumerator", "m_EffNumerator: M_Efficiency Numerator", 8, 0.0, 8.0, 16, 1.0, 17.0); - m_EffDenominator = Book2D("m_"+type+"_EffDenominator", "m_EffDenominator: M_Efficiency Denominator", 8, 0.0, 8.0, 16, 1.0, 17.0); - //for resonance efficiency calculations in eta bins, 1D plots - m_Efficiency_eta = Book1D("m_"+type+"_Efficiency_eta", "m_Efficiency_eta: M_{"+name+"} Efficiency;#eta", 20, -2.5, 2.5); - m_EffNumerator_eta = Book1D("m_"+type+"_EffNumerator_eta", "m_EffNumerator_eta: M_Efficiency Numerator;#eta", 20, -2.5, 2.5); - m_EffDenominator_eta = Book1D("m_"+type+"_EffDenominator_eta", "m_EffDenominator_eta: M_Efficiency Denominator;#eta", 20, -2.5, 2.5); + // //for resonance efficiency calculations + // m_Efficiency = Book2D("m_"+type+"_Efficiency", "m_Efficiency: M_{"+name+"} Efficiency", 8, 0.0, 8.0, 16, 1.0, 17.0); + // m_EffNumerator = Book2D("m_"+type+"_EffNumerator", "m_EffNumerator: M_Efficiency Numerator", 8, 0.0, 8.0, 16, 1.0, 17.0); + // m_EffDenominator = Book2D("m_"+type+"_EffDenominator", "m_EffDenominator: M_Efficiency Denominator", 8, 0.0, 8.0, 16, 1.0, 17.0); + // //for resonance efficiency calculations in eta bins, 1D plots + // m_Efficiency_eta = Book1D("m_"+type+"_Efficiency_eta", "m_Efficiency_eta: M_{"+name+"} Efficiency;#eta", 20, -2.5, 2.5); + // m_EffNumerator_eta = Book1D("m_"+type+"_EffNumerator_eta", "m_EffNumerator_eta: M_Efficiency Numerator;#eta", 20, -2.5, 2.5); + // m_EffDenominator_eta = Book1D("m_"+type+"_EffDenominator_eta", "m_EffDenominator_eta: M_Efficiency Denominator;#eta", 20, -2.5, 2.5); //resonance mass distribution in each mass range m_M_EA_EA = Book1D("m_"+type+"_M_EA_EA", "m_M_EA_EAM_{"+name+"} EA_{+} - EA_{-}; M_{"+name+"}[GeV];", nBins, minBin, maxBin); m_M_EA_BA = Book1D("m_"+type+"_M_EA_BA", "m_M_EA_BAM_{"+name+"} EA_{+} - BA_{-}; M_{"+name+"}[GeV];", nBins, minBin, maxBin); @@ -103,12 +103,12 @@ void RecoPhysPlots::initializePlots(){ LabelCombinedEtaRegions(m_2occupancy->GetXaxis()); LabelLargeEtaRegions(m_occupancy->GetXaxis()); - LabelLargeEtaRegions(m_EffNumerator->GetXaxis()); - LabelSectorAxis(m_EffDenominator->GetYaxis()); - LabelLargeEtaRegions(m_EffNumerator->GetXaxis()); - LabelSectorAxis(m_EffDenominator->GetYaxis()); - LabelLargeEtaRegions(m_Efficiency->GetXaxis()); - LabelSectorAxis(m_Efficiency->GetYaxis()); + // LabelLargeEtaRegions(m_EffNumerator->GetXaxis()); + // LabelSectorAxis(m_EffDenominator->GetYaxis()); + // LabelLargeEtaRegions(m_EffNumerator->GetXaxis()); + // LabelSectorAxis(m_EffDenominator->GetYaxis()); + // LabelLargeEtaRegions(m_Efficiency->GetXaxis()); + // LabelSectorAxis(m_Efficiency->GetYaxis()); } void RecoPhysPlots::fill(std::vector<std::pair<const xAOD::Muon*, const xAOD::Muon*> > mumucandidates){ @@ -153,17 +153,17 @@ void RecoPhysPlots::fill(const float eta_mu_plus, const float eta_mu_minus, cons void RecoPhysPlots::finalizeRecoPlots(){ - for(int bin = 1; bin < m_Efficiency->GetXaxis()->GetNbins(); bin++){ - if(m_EffDenominator->GetBinContent(bin) > 0){ - m_Efficiency->SetBinContent(bin, (m_EffNumerator->GetBinContent(bin)) / (m_EffDenominator->GetBinContent(bin))); - } - } + // for(int bin = 1; bin < m_Efficiency->GetXaxis()->GetNbins(); bin++){ + // if(m_EffDenominator->GetBinContent(bin) > 0){ + // m_Efficiency->SetBinContent(bin, (m_EffNumerator->GetBinContent(bin)) / (m_EffDenominator->GetBinContent(bin))); + // } + // } - for(int bin = 1; bin < m_Efficiency_eta->GetXaxis()->GetNbins(); bin++){ - if(m_EffDenominator_eta->GetBinContent(bin) > 0){ - m_Efficiency_eta->SetBinContent(bin, (m_EffNumerator_eta->GetBinContent(bin)) / (m_EffDenominator_eta->GetBinContent(bin))); - } - } + // for(int bin = 1; bin < m_Efficiency_eta->GetXaxis()->GetNbins(); bin++){ + // if(m_EffDenominator_eta->GetBinContent(bin) > 0){ + // m_Efficiency_eta->SetBinContent(bin, (m_EffNumerator_eta->GetBinContent(bin)) / (m_EffDenominator_eta->GetBinContent(bin))); + // } + // } SetResultsBin( 1, m_M_EC_EC); SetResultsBin( 2, m_M_EC_BC); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoVertexPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoVertexPlots.cxx index 8bb38d02c62662271aead3bddd0b8cbe91920575..c836af8b7baa26d5b2605443bc1c1a64bb8fe16f 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoVertexPlots.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonTrackMonitoring/src/RecoVertexPlots.cxx @@ -20,7 +20,7 @@ void RecoVertexPlots::initializePlots(){ m_nTGC = Book1D("m_MSVx_nTGC", "m MSVx nTGC: M MSVx TGC Hits;;N_{TGC}", 100, 0.0, 1000.); m_nTracklets = Book1D("m_MSVx_nTracklets", "MSVx nTracklets: M MSVx Number of Tracklets; N_{trackletS}", 20, 0.0, 20.); - m_VertexEtaPhi = Book2D("m_VertexEtaPhi", "Vertex Eta Phi: M MSVx #eta vs. #phi; #eta; #phi", 64, -3.2, 3.2, 64, -3.2, 3.2); + m_VertexEtaPhi = Book2D("m_VertexEtaPhi", "Vertex Eta Phi: M MSVx #eta vs. #phi; #eta; #phi", 25, -2.5, 25, 32, -3.2, 3.2); }