APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
APRILContentApi.h
Go to the documentation of this file.
1 /*
3  *
4  * APRILContentApi.h header template automatically generated by a class generator
5  * Creation date : mar. avr. 28 2015
6  *
7  * This file is part of APRILContent libraries.
8  *
9  * APRILContent is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  * based upon these libraries are permitted. Any copy of these libraries
14  * must include this copyright notice.
15  *
16  * APRILContent is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with APRILContent. If not, see <http://www.gnu.org/licenses/>.
23  *
24  * @author Remi Ete
25  * @copyright CNRS , IPNL
26  */
27 
28 
29 #ifndef APRILCONTENTAPI_H
30 #define APRILCONTENTAPI_H
31 
32 #include "Api/PandoraContentApi.h"
34 #include "Objects/Cluster.h"
35 #include "APRILObjects/Cluster.h"
37 
38 namespace april_content { class CaloHit; class Connector; }
39 
40 // logging macro
41 #define APRIL_LOG( message ) if( PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo() ) std::cout << message
42 
43 
48 {
49 public:
53  class CaloHitMetadata : public PandoraContentApi::CaloHit::Metadata
54  {
55  public:
56  pandora::InputFloat m_surroundingEnergy;
57  pandora::InputFloat m_density;
58  };
59 
67  static pandora::StatusCode AlterMetadata(const pandora::Algorithm &algorithm, const april_content::CaloHit *const pCaloHit, const CaloHitMetadata &caloHitMetadata);
68 
69 public:
70  // Connector related Api
71 
80  static bool IsConnected(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2);
81 
91  static bool IsConnected(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2, april_content::ConnectorDirection direction);
92 
100  static pandora::StatusCode FindConnector(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2, const april_content::Connector *&pConnector);
101 
110  static pandora::StatusCode FindConnector(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2, april_content::ConnectorDirection direction,
111  const april_content::Connector *&pConnector);
112 
120  static bool HasAnyConnection(const april_content::CaloHit *const pCaloHit);
121 
129  static const april_content::ConnectorList &GetConnectorList(const april_content::CaloHit *const pCaloHit);
130 
139  static const april_content::ConnectorList &GetConnectorList(const april_content::CaloHit *const pCaloHit, april_content::ConnectorDirection direction);
140 
148  static bool IsSeed(const april_content::CaloHit *const pCaloHit);
149 
157  static bool IsLeaf(const april_content::CaloHit *const pCaloHit);
158 
167  static pandora::StatusCode Connect(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2,
168  april_content::ConnectorDirection direction, float referenceLength = 1.f, unsigned int creationStage = -1);
169 
179  static pandora::StatusCode Connect(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2,
180  april_content::ConnectorDirection direction, const april_content::Connector *&pConnector, float referenceLength = 1.f,
181  unsigned int creationStage = -1);
182 
189  static pandora::StatusCode RemoveConnectionBetween(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2);
190 
196  static pandora::StatusCode RemoveAndDeleteConnector(const april_content::Connector *const pConnector);
197 
203  static pandora::StatusCode RemoveAndDeleteAllConnections(const april_content::CaloHit *const pCaloHit);
204 
205  // calo hit related Api
206 
214  static pandora::StatusCode Tag(const april_content::CaloHit *const pCaloHit, april_content::HitTag tag, bool value);
215 
224  static bool IsTagged(const april_content::CaloHit *const pCaloHit, april_content::HitTag tag);
225 
231  static pandora::StatusCode ResetTags(const april_content::CaloHit *const pCaloHit);
232 
241  static pandora::StatusCode InitializeReclustering(const pandora::Algorithm &algorithm, const pandora::TrackList &inputTrackList,
242  const pandora::ClusterList &inputClusterList, std::string &originalClustersListName);
243 
252  static pandora::StatusCode RunReclusteringAlgorithm(const pandora::Algorithm &algorithm, const std::string &clusteringAlgorithmName,
253  const pandora::ClusterList *&pNewClusterList, std::string &newClusterListName);
254 
261  static pandora::StatusCode PostRunReclusteringAlgorithm(const pandora::Algorithm &algorithm, const std::string &clusterListName);
262 
269  static pandora::StatusCode EndReclustering(const pandora::Algorithm &algorithm, const std::string &selectedClusterListName);
270 
271  static pandora::StatusCode Create(const pandora::Algorithm &algorithm,
272  PandoraContentApi::Cluster::Parameters clusterParameters, const pandora::Cluster *&pCluster);
273 
274  static pandora::StatusCode CreateAPRILCluster(const pandora::Algorithm &algorithm,
275  PandoraContentApi::Cluster::Parameters clusterParameters, const pandora::Cluster *&pCluster);
276 
277  static pandora::StatusCode AddToCluster(const pandora::Algorithm &algorithm,
278  const pandora::Cluster *const pCluster, const pandora::CaloHitList *const pCaloHitList);
279 
280  static pandora::StatusCode MergeAndDeleteClusters(const pandora::Algorithm &algorithm,
281  const pandora::Cluster *const pClusterToEnlarge, const pandora::Cluster *pClusterToDelete);
282 
283  static pandora::StatusCode RemoveFromCluster(const pandora::Algorithm &algorithm,
284  const pandora::Cluster *const pCluster, const pandora::CaloHit *const pCaloHit);
285 
286  static pandora::StatusCode RemoveConnector(const april_content::Connector *const pConnector);
287 
295  template <typename T>
296  static T *Modifiable(const T *const pT);
297 
298 private:
305 };
306 
307 
308 #endif // APRILCONTENTAPI_H
static pandora::StatusCode ResetTags(const april_content::CaloHit *const pCaloHit)
Reset the calo hit tags.
Definition: APRILContentApi.cc:224
static pandora::StatusCode PostRunReclusteringAlgorithm(const pandora::Algorithm &algorithm, const std::string &clusterListName)
Function to call just after a re-clustering algorithm and potential association algorithms.
Definition: APRILContentApi.cc:273
Connector class.
Definition: Connector.h:44
static bool IsSeed(const april_content::CaloHit *const pCaloHit)
Whether the calo hit is a seed calo hit in the tree.
Definition: APRILContentApi.cc:108
static bool IsConnected(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2)
Whether the two calo hits are connected (backward or forward directions)
Definition: APRILContentApi.cc:58
ClusterFactory class.
Definition: ObjectFactories.h:126
CaloHit class.
Definition: CaloHit.h:52
static bool IsLeaf(const april_content::CaloHit *const pCaloHit)
Whether the calo hit is a leaf calo hit in the tree.
Definition: APRILContentApi.cc:115
static pandora::StatusCode AlterMetadata(const pandora::Algorithm &algorithm, const april_content::CaloHit *const pCaloHit, const CaloHitMetadata &caloHitMetadata)
Alter calo hit meta data.
Definition: APRILContentApi.cc:39
HitTag
HitTag enumerator.
Definition: APRILInputTypes.h:67
static pandora::StatusCode Tag(const april_content::CaloHit *const pCaloHit, april_content::HitTag tag, bool value)
Set the calo hit tag.
Definition: APRILContentApi.cc:209
static pandora::StatusCode RemoveConnectionBetween(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2)
Remove and delete the connection between the two calo hits.
Definition: APRILContentApi.cc:149
static pandora::StatusCode RemoveAndDeleteAllConnections(const april_content::CaloHit *const pCaloHit)
Remove and delete all the connections of the calo hit.
Definition: APRILContentApi.cc:185
static pandora::StatusCode EndReclustering(const pandora::Algorithm &algorithm, const std::string &selectedClusterListName)
End the re-clustering procedure.
Definition: APRILContentApi.cc:296
static april_content::ClusterFactory m_clusterFactory
Remove the connection. Destructor not called, the connector responsibility is forwarded to the caller...
Definition: APRILContentApi.h:304
static T * Modifiable(const T *const pT)
Alter the object (const_cast&lt;T*&gt;) for internal modification through the API.
Definition: APRILContentApi.cc:409
static bool HasAnyConnection(const april_content::CaloHit *const pCaloHit)
Whether the calo hit has at least one connection.
Definition: APRILContentApi.cc:87
static pandora::StatusCode Connect(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2, april_content::ConnectorDirection direction, float referenceLength=1.f, unsigned int creationStage=-1)
Connect the two calo hits in a given direction.
Definition: APRILContentApi.cc:122
CaloHitMetadata class.
Definition: APRILContentApi.h:53
static bool IsTagged(const april_content::CaloHit *const pCaloHit, april_content::HitTag tag)
Whether the calo hit has been tagged.
Definition: APRILContentApi.cc:217
ConnectorDirection
ConnectorDirection enumerator.
Definition: APRILInputTypes.h:56
static pandora::StatusCode RemoveAndDeleteConnector(const april_content::Connector *const pConnector)
Remove the connection between the two calo hits and delete the connector.
Definition: APRILContentApi.cc:175
static pandora::StatusCode FindConnector(const april_content::CaloHit *const pCaloHit1, const april_content::CaloHit *const pCaloHit2, const april_content::Connector *&pConnector)
Find a connector that links the two calo hits.
Definition: APRILContentApi.cc:72
APRILContentApi class.
Definition: APRILContentApi.h:47
static pandora::StatusCode RunReclusteringAlgorithm(const pandora::Algorithm &algorithm, const std::string &clusteringAlgorithmName, const pandora::ClusterList *&pNewClusterList, std::string &newClusterListName)
Run a re-clustering algorithm. Must be called only to run a clustering algorithm in a re-clustering p...
Definition: APRILContentApi.cc:263
static const april_content::ConnectorList & GetConnectorList(const april_content::CaloHit *const pCaloHit)
Get the global connector list (backward and forward) of the calo hit.
Definition: APRILContentApi.cc:94
static pandora::StatusCode InitializeReclustering(const pandora::Algorithm &algorithm, const pandora::TrackList &inputTrackList, const pandora::ClusterList &inputClusterList, std::string &originalClustersListName)
Initialize APRIL re-clustering. Save calo hit meta data and create a new one for each calo hit...
Definition: APRILContentApi.cc:236