Commit 9cd0bae4 authored by Carlo Varni's avatar Carlo Varni Committed by Adam Edward Barton
Browse files

ATR-20337: Adding Online and Offline Primary Vertex Keys in offline monitoring

parent 02a741f9
......@@ -86,7 +86,7 @@ HLTBjetMonTool::HLTBjetMonTool(const std::string & type, const std::string & nam
m_TriggerChainBjet_x{}, m_TriggerChainMujet_x{},
m_Chain2Dir{},
m_Shifter_jSplit{}, m_Expert_jSplit{}, m_Shifter_jUnSplit{}, m_Expert_jUnSplit{}, m_Shifter_mujet{},m_Expert_mujet{},
m_vertexContainerKey("PrimaryVertices"),
m_vertexContainerKey("HLT_EFHistoPrmVtx"),
m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"),
m_etCut(10.), m_sv1_infosource("SV1")
{
......
......@@ -19,13 +19,11 @@ TrigBjetMonitorAlgorithm::TrigBjetMonitorAlgorithm( const std::string& name, ISv
,m_doRandom(true)
,m_allChains{}
,m_muonContainerKey("Muons")
,m_vertexContainerKey("PrimaryVertices")
,m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool")
,m_doRun2(false)
{
declareProperty ("AllChains", m_allChains);
declareProperty("MuonContainerName",m_muonContainerKey);
declareProperty("VertexContainerName",m_vertexContainerKey);
declareProperty("doRun2",m_doRun2);
}
......@@ -35,7 +33,10 @@ TrigBjetMonitorAlgorithm::~TrigBjetMonitorAlgorithm() {}
StatusCode TrigBjetMonitorAlgorithm::initialize() {
ATH_CHECK( m_muonContainerKey.initialize() );
ATH_CHECK( m_vertexContainerKey.initialize() );
ATH_CHECK( m_offlineVertexContainerKey.initialize() );
ATH_CHECK( m_onlineVertexContainerKey.initialize() );
return AthMonitorAlgorithm::initialize();
}
......@@ -51,9 +52,9 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
auto OffyVtx = Monitored::Scalar<float>("Off_yVtx",0.0);
auto OffzVtx = Monitored::Scalar<float>("Off_zVtx",0.0);
SG::ReadHandle<xAOD::VertexContainer> offlinepv(m_vertexContainerKey, ctx);
SG::ReadHandle<xAOD::VertexContainer> offlinepv = SG::makeHandle( m_offlineVertexContainerKey, ctx );
if (! offlinepv.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain VertexContainer Collection with name "<< m_vertexContainerKey);
ATH_MSG_ERROR("evtStore() does not contain VertexContainer Collection with name "<< m_offlineVertexContainerKey);
return StatusCode::FAILURE;
}
ATH_MSG_DEBUG(" Size of the Off-line PV container: " << offlinepv->size() );
......@@ -281,7 +282,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
// bjet chains
if (bjetChain) {
// online PV
SG::ReadHandle<xAOD::VertexContainer> vtxContainer(m_vertexContainerKey, ctx);
SG::ReadHandle<xAOD::VertexContainer> vtxContainer = SG::makeHandle( m_onlineVertexContainerKey, ctx );
int nPV = 0;
for (const xAOD::Vertex* vtx : *vtxContainer) {
if (vtx->vertexType() == xAOD::VxType::PriVtx) {
......
......@@ -28,7 +28,8 @@ class TrigBjetMonitorAlgorithm : public AthMonitorAlgorithm {
// const std::vector<std::string> m_allChains;
std::vector<std::string> m_allChains;
SG::ReadHandleKey<xAOD::MuonContainer> m_muonContainerKey;
SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainerKey;
SG::ReadHandleKey<xAOD::VertexContainer> m_offlineVertexContainerKey {this,"OfflineVertexContainerName","PrimaryVertices","Key of offline primary vertexes"};
SG::ReadHandleKey<xAOD::VertexContainer> m_onlineVertexContainerKey {this,"OnlineVertexContainerName","HLT_EFHistoPrmVtx","Key of online bjet primary vertexes"};
//SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainerKey {this,"PriVtxKey","HLT_EFHistoPrmVtx","Key of bjet primary vertexes"}; // Tim Martin 170919
ToolHandle<Trig::TrigDecisionTool> m_trigDec; //!
bool m_doRun2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment