Commit 7025c8f3 authored by Scott Snyder's avatar Scott Snyder Committed by Graeme Stewart
Browse files

Fix checkreq warnings. (JetRecTools-00-03-03)

parent 6d3ecfcd
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// JetDetailedTrackSelectorTool.h
#ifndef JetDetailedTrackSelectorTool_H
#define JetDetailedTrackSelectorTool_H
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include "TrkToolInterfaces/ITrackSelectorTool.h"
#include "xAODTracking/TrackParticle.h"
#include "xAODTracking/TrackParticle.h"
#include "xAODTracking/VertexFwd.h"
/**
* @brief TrackSelector that pases all tracks.
*
* Replacement for InDetDetailedTrackSelectorTool that does
* not use track propagation and so does not require magnetic
* field or any other Athena-specific service.
*
* @author David Adams
*/
namespace Trk {
class Track;
class TrackParticleBase;
class Vertex;
}
class JetDetailedTrackSelectorTool : virtual public Trk::ITrackSelectorTool, public AthAlgTool {
public:
StatusCode initialize();
StatusCode finalize();
JetDetailedTrackSelectorTool(const std::string& t, const std::string& n, const IInterface* p);
~JetDetailedTrackSelectorTool();
bool decision(const Trk::Track& track,const Trk::Vertex* vertex) const;
bool decision(const Trk::TrackParticleBase& track,const Trk::Vertex* vertex) const;
bool decision(const xAOD::TrackParticle& track,const xAOD::Vertex* vertex) const;
};
#endif
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef JETRECTOOLS_JETTRACKSELECTIONTOOL_H
#define JETRECTOOLS_JETTRACKSELECTIONTOOL_H
#include "AsgTools/AsgTool.h"
#include "JetInterface/IJetExecuteTool.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "TrkToolInterfaces/ITrackSelectorTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "AthContainers/ConstDataVector.h"
class JetTrackSelectionTool
: public asg::AsgTool,
virtual public IJetExecuteTool {
ASG_TOOL_CLASS(JetTrackSelectionTool, IJetExecuteTool)
public:
JetTrackSelectionTool(const std::string &name);
virtual StatusCode initialize() ;
virtual int execute() const ;
void selectTracks(const xAOD::TrackParticleContainer& inCont, ConstDataVector<xAOD::TrackParticleContainer>& outCont) const;
void selectTracks(const xAOD::TrackParticleContainer& inCont, std::vector<const xAOD::TrackParticle*> outCont) const;
protected:
template<class T>
void selectionLoop(const xAOD::TrackParticleContainer& inCont, T& outCont) const;
ToolHandle<Trk::ITrackSelectorTool> m_selector;
float m_ptMin;
float m_etaMin, m_etaMax;
std::string m_inputContainer;
std::string m_outputContainer;
};
#endif
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef JETMOMENTTOOLS_MISSINGCALOCELLLISTTOOL_H
#define JETMOMENTTOOLS_MISSINGCALOCELLLISTTOOL_H 1
///////////////////////////////////////////////////////////////////
/// MissingCellListTool.h
/// Header file for class MissingCellListTool
/// Author: P.A. Delsart
/// \class MissingCellListTool
/// Builds a missing/bad calo cell map to be used by JetBadChanCorrTool
///
/// MissingCellListTool is an IJetExecuteTool which builds and record
/// a list of calo cell. This list is also a special geometrical map
/// which allow to efficiently retrieve all cells around a given (eta,phi) direction.
///
/// Some options govern wich cells enter the list : typically permanently disconnected
/// cells, "bad cells" in the sens of CaloCell::badcell(), or user given cells.
///
///////////////////////////////////////////////////////////////////
// STL includes
#include <string>
#include <list>
// FrameWork includes
//#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/ToolHandle.h"
//include "CaloEvent/CaloCell.h"
#include "CaloIdentifier/CaloCell_ID.h"
#include "TileConditions/TileCablingSvc.h"
#include "CxxUtils/unordered_set.h"
#include "JetUtils/TiledEtaPhiMap.h"
#include "AsgTools/CLASS_DEF.h"
#include "AsgTools/AsgTool.h"
#include "JetInterface/IJetExecuteTool.h"
// Forward declaration
class CaloCell;
class CaloDetDescrManager;
class ITileBadChanTool ;
class ILArBadChanTool;
namespace SG {
template<>
struct hash<Identifier> {
size_t operator()(Identifier id) const {return static_cast<size_t>(id.get_identifier32().get_compact());}
};
}
namespace jet {
///////////////////////////////////////////////////
/// \class CellPosition representation of a cell position for the geometric map
/// of missing/bad cells
///////////////////////////////////////////////////
struct CellPosition {
typedef CaloCell_ID::CaloSample CaloSample;
CellPosition(){};
CellPosition(double eta, double phi): m_eta(eta),m_phi(phi),m_sampling(),m_id(){};
CellPosition(double eta, double phi, Identifier id, CaloSample samp): m_eta(eta),m_phi(phi), m_sampling(samp),m_id(id){};
double x()const {return m_eta;}
double y()const {return m_phi;}
void setX(double x){m_eta=x;}
void setY(double x){m_phi=x;}
double eta()const {return m_eta;}
double phi()const {return m_phi;}
CaloSample sampling() const {return m_sampling;}
// define a distance.
struct DR2 {
double operator()(const CellPosition &p1,const CellPosition &p2) const {
return JetTiledMap::utils::DR2(p1.x(),p1.y(), p2.x(), p2.y() );
}
};
double m_eta,m_phi;
CaloSample m_sampling;
Identifier m_id;
};
typedef SG::unordered_set<Identifier> cellset_t;
class CaloCellFastMap : public JetTiledMap::TiledEtaPhiMap<CellPosition> {
public:
virtual ~CaloCellFastMap() {}
std::vector<CellPosition> cellsInDeltaR(double eta,double phi, double r) const {
CellPosition p(eta,phi,Identifier(), (CellPosition::CaloSample) 0);
return pointsInDr( p , r);
}
const cellset_t & cells() const {return m_allCells;}
cellset_t & cells() {return m_allCells;}
protected:
cellset_t m_allCells;
};
}
CLASS_DEF( jet::CaloCellFastMap , 35228686 , 1 )
class MissingCellListTool
: public asg::AsgTool,
virtual public IJetExecuteTool
//virtual public IIncidentListener // allows to detect begining of events
{
ASG_TOOL_CLASS(MissingCellListTool, IJetExecuteTool)
public:
// Copy constructor:
/// Default constructor:
MissingCellListTool(const std::string& name);
/// Destructor:
virtual ~MissingCellListTool();
// Athena algtool's Hooks
virtual StatusCode initialize();
virtual StatusCode finalize();
// Interface implementation
// virtual StatusCode prepareCellList();
// virtual const_iterator begin() ;
// virtual const_iterator end() ;
// virtual size_t size() ;
// virtual const list_t & missingCellList() {return m_missingCells;};
// virtual const list_t & extendedList() {return m_badandmissingCells;};
virtual int execute() const;
// /// returns all bad cells within r of (eta,phi).
// std::vector<CellPosition> cellsInDeltaR(double eta,double phi, double r);
// /// Implementation of IIncidentListener::handle
// virtual void handle(const Incident&);
///////////////////////////////////////////////////////////////////
// PRIVATE data:
///////////////////////////////////////////////////////////////////
private:
const CaloDetDescrManager * m_caloDDM;
typedef std::vector<unsigned int> cellidvec_t;
cellidvec_t m_userRemovedCells;
cellidvec_t m_userAddedCells;
double m_rmax;
bool m_needSetup;
bool m_addBadCells;
bool m_addCellFromTool;
unsigned int m_larMaskBit;
unsigned int m_tileMaskBit;
ServiceHandle<TileCablingSvc> m_tileCabling;
ToolHandle<ITileBadChanTool> m_tileTool;
ToolHandle<ILArBadChanTool> m_larTool;
std::string m_missingCellMapName;
};
// I/O operators
//////////////////////
///////////////////////////////////////////////////////////////////
// Inline methods:
///////////////////////////////////////////////////////////////////
#endif //> !JETMOMENTTOOLS_BADCALOCELLLISTTOOL_H
// DoxygenDocumentation
/*! @class MissingCellListTool
@brief Builds a missing/bad calo cell map to be used by JetBadChanCorrTool
MissingCellListTool is an IJetExecuteTool which builds and record
a list of calo cell. This list is also a special geometrical map
which allow to efficiently retrieve all cells around a given (eta,phi) direction.
Some options govern wich cells enter the list : typically permanently disconnected
cells, "bad cells" in the sens of CaloCell::badcell(), or user given cells.
<b>Properties:</b>
<table style="text-align: left; width: 80%;" border="1">
<tr><td> <b>Name</b> </td> <td><b>Type</b> </td> <td><b>Default</b> </td> <td><b>Description</b></td></tr>
<tr><td>UpdateEvery </td> <td> </td> <td>True </td> <td>frequency of updating the bad cell list, once or event by event</td></tr>
<tr><td>AddBadCell </td> <td> </td> <td>True </td> <td>add cells of container in case badcell()=true</td></tr>
<tr><td>AddCellList </td> <td> </td> <td>True </td> <td>add cells given by property</td></tr>
<tr><td>RemoveCellList </td> <td> </td> <td>True </td> <td>remove cells given by property</td></tr>
<tr><td>AddCellFromTool </td> <td> </td> <td>False </td> <td>add bad cells from bad channel tools</td></tr>
<tr><td>LArMaskBit </td> <td> </td> <td>( 1<< 0 | 1<< 2 | 1<<16 | 1<<8 | 1<<11 | 1<<14 | 1<<19 ) </td> <td>deadReadout | deadPhys | missingFEB | highNoiseHG | highNoiseMG | highNoiseLG | sporadicBurstNoise</td></tr>
<tr><td>TileMaskBit </td> <td> </td> <td>( 1<< 0 ) </td> <td>dead</td></tr>
<tr><td>DeltaRmax </td> <td> </td> <td>1.0 </td> <td>Max cone size in which cells will be searched</td></tr>
</table>
*/
// emacs : this file is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef JETRECTOOLS_PFLOWPSEUDOJETGETTER_H
#define JETRECTOOLS_PFLOWPSEUDOJETGETTER_H
////////////////////////////////////////////
/// \class PFlowPseudoJetGetter
///
/// Specialized PseudoJetGetter for TrackParticle
/// The only thing done here is to specialize the templated append method and
/// define a property for the TrackVertexAssociation
/// \author P-A Delsart
//////////////////////////////////////////////////
#include "JetRec/PseudoJetGetter.h"
#include "AsgTools/ToolHandle.h"
#include "PFlowUtils/IRetrievePFOTool.h"
namespace jet{
class TrackVertexAssociation;
}
namespace PFlowPJHelper {
class PseudoJetFiller;
}
class PFlowPseudoJetGetter : public PseudoJetGetter {
ASG_TOOL_CLASS(PFlowPseudoJetGetter, IPseudoJetGetter)
public:
friend class PFlowPJHelper::PseudoJetFiller;
PFlowPseudoJetGetter(const std::string &name);
virtual int appendTo(PseudoJetVector& psjs, const LabelIndex* pli) const;
protected:
virtual jet::IConstituentUserInfo*
buildCUI(const xAOD::IParticle* ppar, jet::IConstituentUserInfo::Index idx,
const LabelIndex* pli) const {return PseudoJetGetter::buildCUI(ppar,idx,pli);}
ToolHandle<CP::IRetrievePFOTool> m_retrievePFOTool; /// Retrieval tool
bool m_inputIsEM; /// If true EM clusters are used for neutral PFOs.
bool m_calibrate; /// If true, EM PFOs are calibrated to LC.
};
#endif
// emacs : this file is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef JETRECTOOLS_TRACKPSEUDOJETGETTER_H
#define JETRECTOOLS_TRACKPSEUDOJETGETTER_H
////////////////////////////////////////////
/// \class TrackPseudoJetGetter
///
/// Specialized PseudoJetGetter for TrackParticle
/// The only thing done here is to specialize the templated append method and
/// define a property for the TrackVertexAssociation
/// \author P-A Delsart
//////////////////////////////////////////////////
#include "JetRec/PseudoJetGetter.h"
#include "xAODTracking/TrackParticleContainer.h"
namespace jet{
class TrackVertexAssociation;
}
class TrackPseudoJetGetter : public PseudoJetGetter {
ASG_TOOL_CLASS(TrackPseudoJetGetter, IPseudoJetGetter)
public:
TrackPseudoJetGetter(const std::string &name);
virtual int appendTo(PseudoJetVector& psjs, const LabelIndex* pli) const;
protected:
virtual jet::IConstituentUserInfo* buildCUI(const xAOD::IParticle* p, jet::IConstituentUserInfo::Index id, const LabelIndex* pli) const ;
std::string m_trkVtxAssocName;
mutable const jet::TrackVertexAssociation* m_trkVtxAssoc;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef JETRECTOOLS_TRACKVERTEXASSOCIATIONTOOL_H
#define JETRECTOOLS_TRACKVERTEXASSOCIATIONTOOL_H
#include "AsgTools/AsgTool.h"
#include "JetInterface/IJetExecuteTool.h"
#include "JetEDM/TrackVertexAssociation.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "xAODTracking/VertexContainer.h"
#include <string>
class TrackVertexAssociationTool : virtual public asg::AsgTool,
virtual public IJetExecuteTool
{
ASG_TOOL_CLASS(TrackVertexAssociationTool,IJetExecuteTool)
public:
TrackVertexAssociationTool(const std::string & t);
// Constuct a TrackVertexAssociation object
const jet::TrackVertexAssociation* buildTrackVertexAssociation(const xAOD::TrackParticleContainer*, const xAOD::VertexContainer*) const;
// Retrieve necessary inputs, call building function, store result in evtStore
int execute() const;
private:
// Configurable parameters
std::string m_trackContainer;
std::string m_vertexContainer;
std::string m_tvaStoreName;
float m_transDistMax;
float m_longDistMax;
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// JetDetailedTrackSelectorTool.cxx
#include "JetRecTools/JetDetailedTrackSelectorTool.h"
JetDetailedTrackSelectorTool::
JetDetailedTrackSelectorTool(const std::string& t, const std::string& n, const IInterface* p)
: AthAlgTool(t,n,p) {
declareInterface<ITrackSelectorTool>(this);
}
JetDetailedTrackSelectorTool::~JetDetailedTrackSelectorTool() { }
StatusCode JetDetailedTrackSelectorTool::initialize() {
return StatusCode::SUCCESS;
}
StatusCode JetDetailedTrackSelectorTool::finalize() {
return StatusCode::SUCCESS;
}
bool JetDetailedTrackSelectorTool::decision(const Trk::Track&, const Trk::Vertex*) const {
return true;
}
bool JetDetailedTrackSelectorTool::decision(const Trk::TrackParticleBase&, const Trk::Vertex*) const {
return true;
}
bool JetDetailedTrackSelectorTool::decision(const xAOD::TrackParticle&,const xAOD::Vertex*) const {
return true;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "JetRecTools/JetTrackSelectionTool.h"
JetTrackSelectionTool::JetTrackSelectionTool(const std::string &name):
asg::AsgTool(name)
, m_selector("InDetDetailedTrackSelectorTool/TrackSelectorForJets")
, m_ptMin(500)
, m_etaMin(-5)
, m_etaMax(5)
, m_inputContainer("InDetTrackParticle")
, m_outputContainer("InDetTrackParticle")
{
declareProperty("Selector",m_selector);
declareProperty("PtMin",m_ptMin= 500);
declareProperty("EtaMin",m_etaMin= -5);
declareProperty("EtaMax",m_etaMax= 5);
declareProperty("InputContainer",m_inputContainer);
declareProperty("OutputContainer",m_outputContainer);
}
StatusCode JetTrackSelectionTool::initialize() {
StatusCode sc = m_selector.retrieve();
if (sc.isFailure()) {ATH_MSG_ERROR("Can't retrieve ITrackSelectorTool "<< m_selector.name() ); return sc;}
return StatusCode::SUCCESS;
}
int JetTrackSelectionTool::execute() const {
ATH_MSG_DEBUG(" execute() ... ");
const xAOD::TrackParticleContainer* inCont;
StatusCode sc = evtStore()->retrieve(inCont,m_inputContainer);
if( sc.isFailure() ) {ATH_MSG_ERROR("Can't retrieve input track container "<< m_inputContainer); return 1;}
ConstDataVector< xAOD::TrackParticleContainer> *outCont = new ConstDataVector< xAOD::TrackParticleContainer> (SG::VIEW_ELEMENTS);
selectTracks( *inCont, *outCont);
ATH_MSG_DEBUG(" in size = "<< inCont->size() << " outSize="<< outCont->size());
sc = evtStore()->record( outCont, m_outputContainer);
if( sc.isFailure() ) {ATH_MSG_ERROR("Can't record output track container "<< m_outputContainer); return 1;}
return 0;
}
template<class T>
void JetTrackSelectionTool::selectionLoop(const xAOD::TrackParticleContainer& inCont, T& outCont) const {
outCont.reserve(inCont.size());
for( const xAOD::TrackParticle* trk : inCont) {
if( (trk->pt() > m_ptMin) &&
(trk->eta() > m_etaMin) &&
(trk->eta() < m_etaMax) &&
(m_selector->decision( *trk ) ) ) outCont.push_back(trk) ;
}
}
void JetTrackSelectionTool::selectTracks(const xAOD::TrackParticleContainer& inCont, ConstDataVector<xAOD::TrackParticleContainer>& outCont) const {
selectionLoop(inCont, outCont);
}
void JetTrackSelectionTool::selectTracks(const xAOD::TrackParticleContainer& inCont, std::vector<const xAOD::TrackParticle*> outCont) const {
selectionLoop(inCont, outCont);
}
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// MissingCellListTool.cxx
// Implementation file for class MissingCellListTool
// Author: S.Binet<binet@cern.ch>
///////////////////////////////////////////////////////////////////
// JetMomentTools includes
#include "JetRecTools/MissingCellListTool.h"
// STL includes
// FrameWork includes