8#ifndef PANDORA_INTERNAL_H
9#define PANDORA_INTERNAL_H 1
20#include <unordered_map>
21#include <unordered_set>
36class EnergyCorrectionPlugin;
37class ExternalParameters;
41class LArTransformationPlugin;
44class OrderedCaloHitList;
46class ParticleIdPlugin;
48class PseudoLayerPlugin;
49class ShowerProfilePlugin;
59#define PANDORA_REGISTER_ALGORITHM(a, b) \
61 const pandora::StatusCode statusCode(PandoraApi::RegisterAlgorithmFactory(pandora, a, new b)); \
62 if (pandora::STATUS_CODE_SUCCESS != statusCode) \
66#define PANDORA_REGISTER_ALGORITHM_TOOL(a, b) \
68 const pandora::StatusCode statusCode(PandoraApi::RegisterAlgorithmToolFactory(pandora, a, new b)); \
69 if (pandora::STATUS_CODE_SUCCESS != statusCode) \
73#define PANDORA_REGISTER_ENERGY_CORRECTION(a, b, c) \
75 const pandora::StatusCode statusCode(PandoraApi::RegisterEnergyCorrectionPlugin(pandora, a, b, new c)); \
76 if (pandora::STATUS_CODE_SUCCESS != statusCode) \
80#define PANDORA_REGISTER_PARTICLE_ID(a, b) \
82 const pandora::StatusCode statusCode(PandoraApi::RegisterParticleIdPlugin(pandora, a, new b)); \
83 if (pandora::STATUS_CODE_SUCCESS != statusCode) \
93 std::istringstream iss(s);
94 return !(iss >> t).fail();
101 std::istringstream iss(s);
102 iss >> std::hex >> address;
103 t =
reinterpret_cast<const void*
>(address);
113 std::ostringstream oss;
115 if ((oss << t).fail())
124 const uintptr_t address(
reinterpret_cast<uintptr_t
>(t));
134 const std::streamsize ss(std::cout.precision());
135 std::ostringstream oss;
137 if ((oss << std::setprecision(precision) << t << std::setprecision(ss)).fail())
146 const uintptr_t address(
reinterpret_cast<uintptr_t
>(t));
160 bool operator()(
const T *lhs,
const T *rhs)
const;
168 return (*lhs < *rhs);
212 template <
class InputIterator>
213 MyList(InputIterator first, InputIterator last);
258 template <
class InputIterator>
266 template <
class Compare>
267 void sort (Compare comp);
274 unsigned int size()
const;
303 m_theList(rhs.m_theList)
318template <
class InputIterator>
320 m_theList(first, last)
344 return m_theList.begin();
352 return m_theList.end();
360 if (m_theList.end() != std::find(m_theList.begin(), m_theList.end(), val))
362 std::cout <<
"push_back duplicate, in file: " << __FILE__ <<
" line#: " << __LINE__ << std::endl;
366 m_theList.push_back(val);
374 return m_theList.erase(position);
380template <
class InputIterator>
383 for (InputIterator iter = first; iter != last; ++iter)
385 if (m_theList.end() != std::find(m_theList.begin(), m_theList.end(), *iter))
387 std::cout <<
"insert duplicate, in file: " << __FILE__ <<
" line#: " << __LINE__ << std::endl;
392 m_theList.insert(position, first, last);
398template <
class Compare>
401 m_theList.sort(comp);
409 return m_theList.size();
417 return m_theList.empty();
431#define MANAGED_CONTAINER std::list
439typedef MANAGED_CONTAINER<const ParticleFlowObject *>
PfoList;
450typedef std::vector<const ParticleFlowObject *>
PfoVector;
461typedef std::unordered_set<const ParticleFlowObject *>
PfoSet;
483typedef std::map<unsigned int, const LArTPC *>
LArTPCMap;
Wrapper around std::list.
TheList::const_iterator iterator
iterator erase(const_iterator position)
erase
const_iterator begin() const
begin
unsigned int size() const
size
void sort(Compare comp)
sort
void operator=(const MyList &rhs)
operator=
TheList m_theList
The list.
const_iterator end() const
end
MyList()
Default constructor.
void push_back(const value_type &val)
push_back
void insert(const_iterator position, InputIterator first, InputIterator last)
insert
TheList::const_iterator const_iterator
TheList::value_type value_type
Enable ordering of pointers based on properties of target objects.
bool operator()(const T *lhs, const T *rhs) const
ObjectCreationHelper< CaloHitParameters, CaloHitMetadata, pandora::CaloHit > CaloHit
ObjectCreationHelper< ClusterParameters, ClusterMetadata, pandora::Cluster > Cluster
ObjectCreationHelper< ParticleFlowObjectCreation, ParticleFlowObjectMetadata, pandora::ParticleFlowObject > ParticleFlowObject
ObjectCreationHelper< MCParticleParameters, ObjectMetadata, pandora::MCParticle > MCParticle
ObjectCreationHelper< TrackParameters, ObjectMetadata, pandora::Track > Track
ObjectCreationHelper< VertexParameters, VertexMetadata, pandora::Vertex > Vertex
std::unordered_set< const MCParticle * > MCParticleSet
std::vector< const LArTPC * > LArTPCVector
MANAGED_CONTAINER< const LArTPC * > LArTPCList
std::vector< const SubDetector * > SubDetectorVector
MANAGED_CONTAINER< const MCParticle * > MCParticleList
std::vector< const CaloHit * > CaloHitVector
std::unordered_set< const LArTPC * > LArTPCSet
std::unordered_set< const SubDetector * > SubDetectorSet
std::vector< const DetectorGap * > DetectorGapVector
MANAGED_CONTAINER< const ParticleFlowObject * > ParticleFlowObjectList
std::vector< const Cluster * > ClusterVector
bool StringToType(const std::string &s, T &t)
std::unordered_set< const ParticleFlowObject * > PfoSet
std::unordered_map< const MCParticle *, float > MCParticleWeightMap
std::unordered_set< const Track * > TrackSet
MANAGED_CONTAINER< const Cluster * > ClusterList
std::vector< const ParticleFlowObject * > PfoVector
std::vector< std::string > StringVector
std::vector< int > IntVector
std::vector< CartesianVector > CartesianPointVector
MANAGED_CONTAINER< const SubDetector * > SubDetectorList
std::vector< const ParticleFlowObject * > ParticleFlowObjectVector
std::vector< AlgorithmTool * > AlgorithmToolVector
std::unordered_set< const CaloHit * > CaloHitSet
std::unordered_map< Uid, const MCParticle * > UidToMCParticleMap
std::map< unsigned int, const LArTPC * > LArTPCMap
std::set< std::string > StringSet
std::unordered_set< const Vertex * > VertexSet
std::string TypeToStringPrecision(const T &t, const unsigned int precision=12)
std::vector< const Track * > TrackVector
std::unordered_map< const Cluster *, const Track * > ClusterToTrackMap
std::unordered_set< const Cluster * > ClusterSet
std::map< std::string, const SubDetector * > SubDetectorMap
MANAGED_CONTAINER< const DetectorGap * > DetectorGapList
std::unordered_set< const DetectorGap * > DetectorGapSet
MANAGED_CONTAINER< const CaloHit * > CaloHitList
std::vector< TrackState > TrackStateVector
MANAGED_CONTAINER< const Track * > TrackList
std::vector< float > FloatVector
std::string TypeToString(const T &t)
std::vector< const MCParticle * > MCParticleVector
std::unordered_map< const Track *, const Cluster * > TrackToClusterMap
MANAGED_CONTAINER< const Vertex * > VertexList
std::map< std::string, float > PropertiesMap
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList
std::unordered_map< Uid, MCParticleWeightMap > UidToMCParticleWeightMap
std::vector< const Vertex * > VertexVector
std::unordered_set< const ParticleFlowObject * > ParticleFlowObjectSet