APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
TrackClusterAssociationMVAAlgorithm.h
Go to the documentation of this file.
1 /*
3  *
4  * TrackClusterAssociationMVAAlgorithm.h header template automatically generated by a class generator
5  * Creation date : jeu. avr. 9 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 TRACKCLUSTERASSOCIATIONMVAALGORITHM_H
30 #define TRACKCLUSTERASSOCIATIONMVAALGORITHM_H
31 
32 #include "Pandora/Algorithm.h"
33 
34 #include "TMVA/Reader.h"
35 #include "TMVA/MethodCuts.h"
36 
37 namespace april_content
38 {
39 
43 class TrackClusterAssociationMVAAlgorithm : public pandora::Algorithm
44 {
45  public:
49  class Factory : public pandora::AlgorithmFactory
50  {
51  public:
52  pandora::Algorithm *CreateAlgorithm() const;
53  };
54 
55 private:
56  pandora::StatusCode Run();
57  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
58 
63  {
64  const pandora::Cluster *m_pCluster;
65  float m_chi2;
66  float m_trackClusterAngle;
67  float m_distanceToHelix;
68  float m_compatibility;
69  };
70 
71  typedef std::vector<AssociationConstraints> AssociationConstraintsVector;
72  typedef std::map<const pandora::Track*, AssociationConstraintsVector> AssociationConstraintsMap;
73  typedef std::map<const pandora::Track*, const pandora::Cluster*> AssociationMap;
74  typedef std::map<const pandora::Cluster*, const pandora::Track*> MultiAssociationMap;
75 
82  pandora::StatusCode ExtractAssociationLists(pandora::ClusterList &clusterList, pandora::TrackList &trackList);
83 
91  pandora::StatusCode BuildPossibleAssociations(const pandora::ClusterList &clusterList, const pandora::TrackList &trackList,
92  AssociationMap &associationMap);
93 
99  pandora::StatusCode PerformAssociations(const AssociationMap &associationMap);
100 
104  pandora::StatusCode ComputeInnerCentroid(const pandora::Cluster *const pCluster, const pandora::Track *const pTrack, pandora::CartesianVector &innerCentroid) const;
105 
112  bool PassesInitialCuts(const pandora::Cluster *const pCluster, const pandora::Track *const pTrack) const;
113 
114  float MVADeteriminAssociation(const pandora::Cluster* const pCluster, const pandora::Track* const pTrack) const;
115 
123  pandora::StatusCode CalculateAssociationConstraints(const pandora::Cluster *const pCluster, const pandora::Track *const pTrack, AssociationConstraints &constraints);
124 
130  bool FitConstraints(const AssociationConstraints &constraints) const;
131 
135  static bool SortByBestCompatibility(const AssociationConstraints &lhs, const AssociationConstraints &rhs);
136 
137 private:
140 
143 
146 
147  bool m_usePhotonClusters;
148 
149  static TMVA::Reader* m_reader;
150 };
151 
152 //------------------------------------------------------------------------------------------------------------------------------------------
153 
154 inline pandora::Algorithm *TrackClusterAssociationMVAAlgorithm::Factory::CreateAlgorithm() const
155 {
157 }
158 
159 }
160 
161 #endif // TRACKCLUSTERASSOCIATIONMVAALGORITHM_H
AssociationConstraints struct.
Definition: TrackClusterAssociationMVAAlgorithm.h:62
float m_maxDistanceToHelix
The maximum distance between a track helix and the cluster inner centroid.
Definition: TrackClusterAssociationMVAAlgorithm.h:141
bool m_allowMultiAssociations
Whether to allow multi track associations for a single cluster.
Definition: TrackClusterAssociationMVAAlgorithm.h:144
bool PassesInitialCuts(const pandora::Cluster *const pCluster, const pandora::Track *const pTrack) const
Whether the track-cluster pair passes simple cuts for a possible association.
Definition: TrackClusterAssociationMVAAlgorithm.cc:529
pandora::StatusCode BuildPossibleAssociations(const pandora::ClusterList &clusterList, const pandora::TrackList &trackList, AssociationMap &associationMap)
Build the possible track-cluster associations.
Definition: TrackClusterAssociationMVAAlgorithm.cc:310
TrackClusterAssociationMVAAlgorithm class.
Definition: TrackClusterAssociationMVAAlgorithm.h:43
Factory class for instantiating algorithm.
Definition: TrackClusterAssociationMVAAlgorithm.h:49
pandora::StatusCode CalculateAssociationConstraints(const pandora::Cluster *const pCluster, const pandora::Track *const pTrack, AssociationConstraints &constraints)
Calculate the track-cluster association constraints for a possible association.
Definition: TrackClusterAssociationMVAAlgorithm.cc:634
bool m_useEnergyCompatibility
Whether to use energy information for association.
Definition: TrackClusterAssociationMVAAlgorithm.h:145
unsigned int m_nFirstClusterPseudoLayer
The number of cluster pseudo layers for the inner centroid evaluation.
Definition: TrackClusterAssociationMVAAlgorithm.h:139
unsigned int m_maxClusterInnerPseudoLayer
The maximum cluster inner pseudo layer cut.
Definition: TrackClusterAssociationMVAAlgorithm.h:138
static bool SortByBestCompatibility(const AssociationConstraints &lhs, const AssociationConstraints &rhs)
Sort association constraints by compatibility (std::sort)
Definition: TrackClusterAssociationMVAAlgorithm.cc:698
pandora::StatusCode PerformAssociations(const AssociationMap &associationMap)
Perform the track-cluster association.
Definition: TrackClusterAssociationMVAAlgorithm.cc:443
bool FitConstraints(const AssociationConstraints &constraints) const
Whether the set of constraints passes the final cuts for an association.
Definition: TrackClusterAssociationMVAAlgorithm.cc:685
float m_maxTrackClusterAngle
The maximum angle between the track projection and the cluster inner centroid.
Definition: TrackClusterAssociationMVAAlgorithm.h:142
pandora::StatusCode ExtractAssociationLists(pandora::ClusterList &clusterList, pandora::TrackList &trackList)
Extract the cluster and track lists eligible for track-cluster associations.
Definition: TrackClusterAssociationMVAAlgorithm.cc:147