Commit d1bc5d6d authored by Mark Hodgkinson's avatar Mark Hodgkinson
Browse files

A first version of validation code for pflow FlowElements (charged).

parent 035f41a6
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "PFChargedFlowElementValidationPlots.h"
PFChargedFlowElementValidationPlots::PFChargedFlowElementValidationPlots(PlotBase* pParent, std::string sDir, std::string sFlowElementContainerName) : PlotBase(pParent, sDir)
//m_PFOPlots(this,"",sPFOContainerName),
{}
void PFChargedFlowElementValidationPlots::fill(const xAOD::FlowElement& theFE, const xAOD::Vertex* theVertex ){
//m_PFOPlots.fill(thePFO);
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PFCHARGEDFLOWELEMENTVALIDATIONPLOTS_H
#define PFCHARGEDFLOWELEMENTVALIDATIONPLOTS_H
#include "TrkValHistUtils/PlotBase.h"
//#include "PFOHistUtils/PFOPlots.h"
#include "xAODPFlow/FlowElement.h"
#include "xAODTracking/Vertex.h"
class PFChargedFlowElementValidationPlots : public PlotBase {
public:
/** Standard Constructor */
PFChargedFlowElementValidationPlots(PlotBase* pParent, std::string sDir, std::string sPFOContainerName);
/** fill the histograms up */
void fill(const xAOD::FlowElement& theFE, const xAOD::Vertex* theVertex);
private:
/** 4-vector and charge histograms */
//PFO::PFOPlots m_PFOPlots;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "PhysValFlowElement.h"
#include "xAODPFlow/FlowElementContainer.h"
PhysValFlowElement::PhysValFlowElement (const std::string& type, const std::string& name, const IInterface* parent ) : ManagedMonitorToolBase( type, name, parent ) {
}
PhysValFlowElement::~PhysValFlowElement() {}
StatusCode PhysValFlowElement::initialize(){
ATH_CHECK(ManagedMonitorToolBase::initialize());
ATH_CHECK(m_PFFlowElementContainerHandleKey.initialize());
return StatusCode::SUCCESS;
}
StatusCode PhysValFlowElement::bookHistograms(){
std::string theName = "PFlow/"+m_PFFlowElementContainerHandleKey.key();
std::vector<HistData> hists;
m_PFChargedFlowElementValidationPlots.reset(new PFChargedFlowElementValidationPlots(0,theName, theName));
m_PFChargedFlowElementValidationPlots->setDetailLevel(100);
m_PFChargedFlowElementValidationPlots->initialize();
hists = m_PFChargedFlowElementValidationPlots->retrieveBookedHistograms();
for (auto hist : hists) {
ATH_CHECK(regHist(hist.first,hist.second,all));
}
return StatusCode::SUCCESS;
}
StatusCode PhysValFlowElement::fillHistograms(){
SG::ReadHandle<xAOD::FlowElementContainer> PFlowElementContainerReadHandle(m_PFFlowElementContainerHandleKey);
if(!PFlowElementContainerReadHandle.isValid()){
ATH_MSG_WARNING("Invalid ReadHandle for xAOD::FlowElementContainer with key: " << PFlowElementContainerReadHandle.key());
return StatusCode::SUCCESS;
}
for (auto theFE : *PFlowElementContainerReadHandle){
if(theFE){
m_PFChargedFlowElementValidationPlots->fill(*theFE, nullptr);
}
else ATH_MSG_WARNING("Invalid pointer to xAOD::FlowElement");
}
return StatusCode::SUCCESS;
}
StatusCode PhysValFlowElement::procHistograms(){
return StatusCode::SUCCESS;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PHYSVALFLOWELEMENT_H
#define PHYSVALFLOWELEMENT_H
#include "PFChargedFlowElementValidationPlots.h"
#include "AthenaMonitoring/ManagedMonitorToolBase.h"
#include <string>
#include "xAODPFlow/FlowElementContainer.h"
#include "StoreGate/ReadHandleKey.h"
class PhysValFlowElement : public ManagedMonitorToolBase {
public:
/** Standard Constructor */
PhysValFlowElement (const std::string& type, const std::string& name, const IInterface* parent );
/** Standard Destructor */
virtual ~PhysValFlowElement();
/** Standard AlgTool Functions */
virtual StatusCode initialize();
virtual StatusCode bookHistograms();
virtual StatusCode fillHistograms();
virtual StatusCode procHistograms();
private:
/** ReadHandle to retrieve xAOD::PFOContainer */
SG::ReadHandleKey<xAOD::FlowElementContainer> m_PFFlowElementContainerHandleKey{this,"FlowElementContainerName","JetETMissChargedFlowElements","ReadHandleKey for the FlowElement container"};
/** Pointer to class that deals with histograms for charged FlowElements */
std::unique_ptr<PFChargedFlowElementValidationPlots> m_PFChargedFlowElementValidationPlots;
};
#endif
#include "../PhysValFlowElement.h"
#include "../PhysValPFO.h"
#include "../PhysValCluster.h"
DECLARE_COMPONENT( PhysValFlowElement )
DECLARE_COMPONENT( PhysValPFO )
DECLARE_COMPONENT( PhysValCluster )
Supports Markdown
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