diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/BTagPlots.cxx b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/BTagPlots.cxx index a9a1213c3b4a3c3705e4486564e15af50a017aaa..b8ca1b4de8d9a81c4218965e60b7c87266ef939a 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/BTagPlots.cxx +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/BTagPlots.cxx @@ -16,10 +16,11 @@ void BTagPlots::initializePlots(){ n = Book1D("n", "Number of b jets from "+ m_sParticleType +"; n ;Events", 10, 0., 10); } - void BTagPlots::fill(const xAOD::BTagging* /*btag*/){ + void BTagPlots::fill(const xAOD::BTagging* /*btag*/, const xAOD::EventInfo* evt){ + std::cout << "filling b-tagging plots with BS weight: " << evt->beamSpotWeight(); } -void BTagPlots::fill(unsigned int nbtag){ - n->Fill(nbtag); + void BTagPlots::fill(unsigned int nbtag,const xAOD::EventInfo* evt){ + n->Fill(nbtag,evt->beamSpotWeight()); } } diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/BTagPlots.h b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/BTagPlots.h index 785f6336dcda4273ebe3cbbfd0a7b771eb9d6f70..6fa4e5e693988ac8e0061e48a4d834213a94b974 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/BTagPlots.h +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/BTagPlots.h @@ -8,14 +8,15 @@ #include "TrkValHistUtils/PlotBase.h" #include "CLHEP/Units/SystemOfUnits.h" #include "xAODBTagging/BTagging.h" +#include "xAODEventInfo/EventInfo.h" namespace PhysVal{ class BTagPlots:public PlotBase { public: BTagPlots(PlotBase* pParent, std::string sDir, std::string sParticleType); - void fill(const xAOD::BTagging* btag); - void fill(unsigned int nbtag); + void fill(const xAOD::BTagging* btag,const xAOD::EventInfo* evt); + void fill(unsigned int nbtag,const xAOD::EventInfo* evt); // Reco only information std::string m_sParticleType; diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx index 44ccc53dd52ffa905c0f14ab58557a96182ff13a..338999ac36b18bd6a8b2eb597111e0646ab42a19 100755 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.cxx @@ -27,11 +27,11 @@ void KinematicsPlots::initializePlots(){ lead_phi = Book1D("lead_phi", "#varphi of lead " + m_sParticleType +";#varphi;Events ",128 ,-3.2,3.2); } -void KinematicsPlots::fill(const xAOD::IParticle* part){ + void KinematicsPlots::fill(const xAOD::IParticle* part, const xAOD::EventInfo* evt){ - et->Fill(part->pt()/GeV); - eta->Fill(part->eta()); - phi->Fill(part->phi()); + et->Fill(part->pt()/GeV,evt->beamSpotWeight()); + eta->Fill(part->eta(),evt->beamSpotWeight()); + phi->Fill(part->phi(),evt->beamSpotWeight()); if (m_lead == nullptr) m_lead = part; @@ -42,13 +42,13 @@ void KinematicsPlots::fill(const xAOD::IParticle* part){ ++m_npart; } -void KinematicsPlots::fill(){ - n->Fill(m_npart); + void KinematicsPlots::fill(const xAOD::EventInfo* evt){ + n->Fill(m_npart,evt->beamSpotWeight()); if (m_lead != nullptr) { - lead_et->Fill(m_lead->pt()/GeV); - lead_eta->Fill(m_lead->eta()); - lead_phi->Fill(m_lead->phi()); + lead_et->Fill(m_lead->pt()/GeV,evt->beamSpotWeight()); + lead_eta->Fill(m_lead->eta(),evt->beamSpotWeight()); + lead_phi->Fill(m_lead->phi(),evt->beamSpotWeight()); } m_lead = nullptr; diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h index d09721c434b732ec35dbfd7073527434929c51b1..f763590541c159f227db35ec84d31f8bc82dc37a 100755 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/KinematicsPlots.h @@ -8,14 +8,15 @@ #include "TrkValHistUtils/PlotBase.h" #include "CLHEP/Units/SystemOfUnits.h" #include "xAODBase/IParticle.h" +#include "xAODEventInfo/EventInfo.h" namespace PhysVal{ class KinematicsPlots:public PlotBase { public: KinematicsPlots(PlotBase* pParent, std::string sDir, std::string sParticleType); - void fill(const xAOD::IParticle* part); - void fill(); + void fill(const xAOD::IParticle* part,const xAOD::EventInfo* evt); + void fill(const xAOD::EventInfo* evt); void initializeEvent(); diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/METPlots.cxx b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/METPlots.cxx index 430e9bb4162c76517d46495dd5f997cdb269f28b..55d51dd29d1d9a3b0b2e14314833ecad0385a774 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/METPlots.cxx +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/METPlots.cxx @@ -19,12 +19,12 @@ void METPlots::initializePlots(){ met_sumet = Book1D("SumEt", "MET " + m_sParticleType + " Ex; #Sum E_{t} ;Events", 100, 0., 2000); } -void METPlots::fill(const xAOD::MissingET* met){ - - met_ex->Fill(met->mpx()/GeV); - met_ey->Fill(met->mpy()/GeV); - met_et->Fill(met->met()/GeV); - met_sumet->Fill(met->sumet()/GeV); + void METPlots::fill(const xAOD::MissingET* met,const xAOD::EventInfo* evt){ + + met_ex->Fill(met->mpx()/GeV,evt->beamSpotWeight()); + met_ey->Fill(met->mpy()/GeV,evt->beamSpotWeight()); + met_et->Fill(met->met()/GeV,evt->beamSpotWeight()); + met_sumet->Fill(met->sumet()/GeV,evt->beamSpotWeight()); } } diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/METPlots.h b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/METPlots.h index 5b6ffe523b0e8bf2c072ab28b0533bbe919c4d4b..9e746cf7839f5051a7686712e25be9575424b9ba 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/METPlots.h +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/METPlots.h @@ -8,13 +8,14 @@ #include "TrkValHistUtils/PlotBase.h" #include "CLHEP/Units/SystemOfUnits.h" #include "xAODMissingET/MissingET.h" +#include "xAODEventInfo/EventInfo.h" namespace PhysVal{ class METPlots:public PlotBase { public: METPlots(PlotBase* pParent, std::string sDir, std::string sParticleType = "RefFinal"); - void fill(const xAOD::MissingET* met); + void fill(const xAOD::MissingET* met,const xAOD::EventInfo* evt); // Reco only information std::string m_sParticleType; diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/PhysValExample.cxx b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/PhysValExample.cxx index 0e5f79a9eca40468eb84cc22c7452c634365dd90..8414f6fba87ffe2f6c33b5a10fee31373d59e366 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/PhysValExample.cxx +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/PhysValExample.cxx @@ -126,6 +126,10 @@ namespace PhysVal { ATH_MSG_INFO ("Filling hists " << name() << "..."); if (m_detailLevel < 10) return StatusCode::SUCCESS; + + // event Info + const xAOD::EventInfo* event(0); + ATH_CHECK(evtStore()->retrieve(event, "EventInfo")); // Jets int nbtag(0); @@ -133,40 +137,40 @@ namespace PhysVal { const xAOD::JetContainer* jets(0); ATH_CHECK(evtStore()->retrieve(jets, m_jetName)); for (auto jet : *jets) { - m_jetPlots.fill(jet); + m_jetPlots.fill(jet,event); const xAOD::BTagging* btag = xAOD::BTaggingUtilities::getBTagging( *jet ); if (btag && btag->IP3D_loglikelihoodratio() > 1.2) ++nbtag; } - m_jetPlots.fill(); - m_btagPlots.fill(nbtag); + m_jetPlots.fill(event); + m_btagPlots.fill(nbtag,event); // Electrons m_elecPlots.initializeEvent(); const xAOD::ElectronContainer* electrons(0); ATH_CHECK(evtStore()->retrieve(electrons, m_elecName)); - for (auto elec : *electrons) m_elecPlots.fill(elec); - m_elecPlots.fill(); + for (auto elec : *electrons) m_elecPlots.fill(elec,event); + m_elecPlots.fill(event); // Photons m_photonPlots.initializeEvent(); const xAOD::PhotonContainer* photons(0); ATH_CHECK(evtStore()->retrieve(photons, m_photonName)); - for (auto photon : *photons) m_photonPlots.fill(photon); - m_photonPlots.fill(); + for (auto photon : *photons) m_photonPlots.fill(photon,event); + m_photonPlots.fill(event); // Muons m_muonPlots.initializeEvent(); const xAOD::MuonContainer* muons(0); ATH_CHECK(evtStore()->retrieve(muons, m_muonName)); - for (auto muon : *muons) m_muonPlots.fill(muon); - m_muonPlots.fill(); + for (auto muon : *muons) m_muonPlots.fill(muon,event); + m_muonPlots.fill(event); // Taus m_tauPlots.initializeEvent(); const xAOD::TauJetContainer* taus(0); ATH_CHECK(evtStore()->retrieve(taus, m_tauName)); - for (auto tau : *taus) m_tauPlots.fill(tau); - m_tauPlots.fill(); + for (auto tau : *taus) m_tauPlots.fill(tau,event); + m_tauPlots.fill(event); // Tracks/Vertices const xAOD::TrackParticleContainer* trks(0); @@ -174,12 +178,10 @@ namespace PhysVal { const xAOD::VertexContainer* vtxs(0); ATH_CHECK(evtStore()->retrieve(vtxs, m_vertexName)); - for (auto vtx : *vtxs) m_trkvtxPlots.fill(vtx); + for (auto vtx : *vtxs) m_trkvtxPlots.fill(vtx,event); - const xAOD::EventInfo* event(0); - ATH_CHECK(evtStore()->retrieve(event, "EventInfo")); - m_trkvtxPlots.fill(trks->size(), vtxs->size(), event->averageInteractionsPerCrossing()); + m_trkvtxPlots.fill(trks->size(), vtxs->size(), event->averageInteractionsPerCrossing(),event); const xAOD::MissingETContainer* met_container (0); ATH_CHECK(evtStore()->retrieve(met_container, m_metName)); @@ -188,13 +190,13 @@ namespace PhysVal { ATH_MSG_ERROR ("Couldn't retrieve MET Final"); return StatusCode::SUCCESS; } - m_metPlots.fill(met); + m_metPlots.fill(met,event); int i(0); for (auto name : m_timingNames) { float time; if (getTiming(name, time).isSuccess()) { - m_timingPlots[i]->Fill(time); + m_timingPlots[i]->Fill(time,event->beamSpotWeight()); } ++i; } diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/TrkAndVtxPlots.cxx b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/TrkAndVtxPlots.cxx index 11dfad4d021127dfa21283116076614629a36281..1d65a52ad0e6ee7c22ea76eb13a760dc11d1d3c3 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/TrkAndVtxPlots.cxx +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/TrkAndVtxPlots.cxx @@ -4,6 +4,8 @@ #include "TrkAndVtxPlots.h" + + using CLHEP::GeV; namespace PhysVal{ @@ -22,22 +24,23 @@ void TrkAndVtxPlots::initializePlots(){ mu = Book1D("mu", "Pileup; mu ;Events", 120, 0., 120); } -void TrkAndVtxPlots::fill(const xAOD::Vertex* vtx){ - - vtx_x->Fill(vtx->x()); - vtx_y->Fill(vtx->y()); - vtx_z->Fill(vtx->z()); + void TrkAndVtxPlots::fill(const xAOD::Vertex* vtx,const xAOD::EventInfo* evt){ + + vtx_x->Fill(vtx->x(),evt->beamSpotWeight()); + vtx_y->Fill(vtx->y(),evt->beamSpotWeight()); + vtx_z->Fill(vtx->z(),evt->beamSpotWeight()); } - void TrkAndVtxPlots::fill(const xAOD::TrackParticle* /*trk*/){ - + void TrkAndVtxPlots::fill(const xAOD::TrackParticle* /*trk*/, const xAOD::EventInfo* evt){ + std::cout << "filling TrackAndVertex plots with BS weight: " << evt->beamSpotWeight(); } - void TrkAndVtxPlots::fill(unsigned int ntrack, unsigned int nvertex, float pileup){ - ntrk->Fill(ntrack); - nvtx->Fill(nvertex); - mu->Fill(pileup); + void TrkAndVtxPlots::fill(unsigned int ntrack, unsigned int nvertex, float pileup,const xAOD::EventInfo* evt){ + + ntrk->Fill(ntrack,evt->beamSpotWeight()); + nvtx->Fill(nvertex,evt->beamSpotWeight()); + mu->Fill(pileup,evt->beamSpotWeight()); } } diff --git a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/TrkAndVtxPlots.h b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/TrkAndVtxPlots.h index d1c242bac374ada2c1171ae1e9dfd37a5334ea97..b3f2d4039dc88dd1729bafa3d652fb8b1f4ce09d 100644 --- a/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/TrkAndVtxPlots.h +++ b/PhysicsAnalysis/PhysicsValidation/PhysValMonitoring/src/TrkAndVtxPlots.h @@ -9,15 +9,16 @@ #include "CLHEP/Units/SystemOfUnits.h" #include "xAODTracking/TrackParticle.h" #include "xAODTracking/Vertex.h" +#include "xAODEventInfo/EventInfo.h" namespace PhysVal{ class TrkAndVtxPlots:public PlotBase { public: TrkAndVtxPlots(PlotBase* pParent, std::string sDir); - void fill(const xAOD::TrackParticle* trk); - void fill(const xAOD::Vertex* vtx); - void fill(unsigned int ntrack, unsigned int nvertex, float pileup = 0); + void fill(const xAOD::TrackParticle* trk,const xAOD::EventInfo* evt); + void fill(const xAOD::Vertex* vtx,const xAOD::EventInfo* evt); + void fill(unsigned int ntrack, unsigned int nvertex, float pileup = 0,const xAOD::EventInfo* evt=NULL); // Reco only information TH1* ntrk;