APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
EnergyCorrectionPlugins.h
Go to the documentation of this file.
1 /*
3  *
4  * EnergyCorrectionPlugin.h header template automatically generated by a class generator
5  * Creation date : mar. nov. 17 2015
6  * Updated november 2023 by Tanguy Pasquier
7  *
8  * This file is part of APRILContent libraries.
9  *
10  * APRILContent is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  * based upon these libraries are permitted. Any copy of these libraries
15  * must include this copyright notice.
16  *
17  * APRILContent is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with APRILContent. If not, see <http://www.gnu.org/licenses/>.
24  *
25  * @author Remi Ete
26  * @copyright CNRS , IPNL
27  */
28 
29 
30 #ifndef APRIL_CONTENT_ENERGYCORRECTIONPLUGIN_H
31 #define APRIL_CONTENT_ENERGYCORRECTIONPLUGIN_H
32 
33 #include "Plugins/EnergyCorrectionsPlugin.h"
34 
35 namespace april_content
36 {
37 
41  class AnalogicEnergyFunction : public pandora::EnergyCorrectionPlugin
42  {
43  public:
48 
55  pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const;
56 
62  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
63 
64  private:
65  unsigned int m_ecalEnergyType;
66  unsigned int m_hcalEnergyType;
67  unsigned int m_muonEnergyType;
68  unsigned int m_otherEnergyType;
69  };
70 
71  //------------------------------------------------------------------------------------------------------------------------------------------
72  //------------------------------------------------------------------------------------------------------------------------------------------
73 
77  class SdhcalQuadraticEnergyFunction : public pandora::EnergyCorrectionPlugin
78  {
79  public:
84 
91  pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const;
92 
98  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
99 
100  private:
101 
102  pandora::FloatVector m_sdhcalThresholds;
103  pandora::FloatVector m_energyConstantParameters;
104  };
105 
106  //------------------------------------------------------------------------------------------------------------------------------------------
107  //------------------------------------------------------------------------------------------------------------------------------------------
108 
112  class BarrelGapEnergyFunction : public pandora::EnergyCorrectionPlugin
113  {
114  public:
119 
126  pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const;
127 
133  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
134 
135  private:
139  enum Approach
140  {
141  INNER_GAP_APPROACH = -1,
142  FAR_FROM_GAP = 0,
143  OUTER_GAP_APPROACH = 1
144  };
145 
149  bool IsNearbyGap(const pandora::CaloHit *const pCaloHit) const;
150 
154  Approach GetApproach(const pandora::CaloHit *const pCaloHit) const;
155 
156  private:
157  pandora::FloatVector m_ecalZGapPositions;
158  pandora::FloatVector m_hcalZGapPositions;
159 
160  float m_ecalDistanceToGap;
161  float m_hcalDistanceToGap;
162 
163  float m_ecalGapAlpha;
164  float m_ecalGapBeta;
165  float m_hcalGapAlpha;
166  float m_hcalGapBeta;
167  };
168 
169  //------------------------------------------------------------------------------------------------------------------------------------------
170  //------------------------------------------------------------------------------------------------------------------------------------------
171 
175  class ThetaNHitFunction : public pandora::EnergyCorrectionPlugin
176  {
177  public:
182 
189  pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const;
190 
196  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
197 
198  private:
202  float GetCosTheta(const pandora::Cluster *const pCluster) const;
203 
210  float GetCorrectedHitNumber(int nHit, float cosTheta) const;
211 
212 
213  private:
214  float m_lowEnergyCut;
215 
216  pandora::FloatVector m_sdhcalThresholds;
217  // pandora::FloatVector m_energyConstantParameter; ///< The energy constant parameters
218  };
219 
220  //------------------------------------------------------------------------------------------------------------------------------------------
221  //------------------------------------------------------------------------------------------------------------------------------------------
222 
226  class PhiNHitFunction : public pandora::EnergyCorrectionPlugin
227  {
228  public:
232  PhiNHitFunction();
233 
240  pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const;
241 
247  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
248 
249  private:
253  float GetCosPhi(const pandora::Cluster *const pCluster) const;
254 
261  float GetCorrectedHitNumber(int nHit, float cosPhi) const;
262 
263 
264  private:
265  float m_lowEnergyCut;
266 
267  pandora::FloatVector m_sdhcalThresholds;
268  // pandora::FloatVector m_energyConstantParameter; ///< The energy constant parameters
269  };
270 
271  //------------------------------------------------------------------------------------------------------------------------------------------
272  //------------------------------------------------------------------------------------------------------------------------------------------
273 
278  class CleanCluster : public pandora::EnergyCorrectionPlugin
279  {
280  public:
284  CleanCluster();
285 
286  pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const;
287 
288  private:
295  float GetHadronicEnergyInLayer(const pandora::OrderedCaloHitList &orderedCaloHitList, const unsigned int pseudoLayer) const;
296 
297  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
298 
302  };
303 
304 }
305 
306 #endif // APRIL_CONTENT_ENERGYCORRECTIONPLUGIN_H
float GetCorrectedHitNumber(int nHit, float cosPhi) const
Get the corrected number of hits.
Definition: EnergyCorrectionPlugins.cc:657
float GetCosPhi(const pandora::Cluster *const pCluster) const
Get cos phi with respect to x axis in the XY-plane.
Definition: EnergyCorrectionPlugins.cc:639
pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const
Make energy correction on this given cluster.
Definition: EnergyCorrectionPlugins.cc:132
pandora::FloatVector m_sdhcalThresholds
The sdhcal threshold values.
Definition: EnergyCorrectionPlugins.h:102
pandora::FloatVector m_energyConstantParameters
The energy constant parameters.
Definition: EnergyCorrectionPlugins.h:103
AnalogicEnergyFunction()
Default constructor.
Definition: EnergyCorrectionPlugins.cc:37
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from the xml handle.
Definition: EnergyCorrectionPlugins.cc:89
AnalogicEnergyFunction.
Definition: EnergyCorrectionPlugins.h:41
float GetHadronicEnergyInLayer(const pandora::OrderedCaloHitList &orderedCaloHitList, const unsigned int pseudoLayer) const
Get the sum of the hadronic energies of all calo hits in a specified layer of an ordered calo hit lis...
Definition: EnergyCorrectionPlugins.cc:767
float GetCorrectedHitNumber(int nHit, float cosTheta) const
Get the corrected number of hits.
Definition: EnergyCorrectionPlugins.cc:503
pandora::FloatVector m_sdhcalThresholds
The sdhcal threshold values.
Definition: EnergyCorrectionPlugins.h:267
SdhcalQuadraticEnergyFunction()
Default constructor.
Definition: EnergyCorrectionPlugins.cc:113
float GetCosTheta(const pandora::Cluster *const pCluster) const
Get cos theta with respect to z axis.
Definition: EnergyCorrectionPlugins.cc:493
Approach GetApproach(const pandora::CaloHit *const pCaloHit) const
Get the calo hit approach to barrel module gap.
CleanCluster()
Default constructor.
Definition: EnergyCorrectionPlugins.cc:692
pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const
Make energy correction on this given cluster.
Definition: EnergyCorrectionPlugins.cc:245
SdhcalQuadraticEnergyFunction class.
Definition: EnergyCorrectionPlugins.h:77
float m_minCleanHitEnergyFraction
Min fraction of cluster energy represented by hit to consider cleaning.
Definition: EnergyCorrectionPlugins.h:300
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from the xml handle.
Definition: EnergyCorrectionPlugins.cc:193
bool IsNearbyGap(const pandora::CaloHit *const pCaloHit) const
Whether the calo hit is near a detector gap.
Definition: EnergyCorrectionPlugins.cc:283
pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const
Make energy correction on this given cluster.
Definition: EnergyCorrectionPlugins.cc:354
pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const
Make energy correction on this given cluster.
Definition: EnergyCorrectionPlugins.cc:47
float m_minCleanHitEnergy
Min calo hit hadronic energy to consider cleaning hit/cluster.
Definition: EnergyCorrectionPlugins.h:299
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from the xml handle.
Definition: EnergyCorrectionPlugins.cc:665
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from the xml handle.
Definition: EnergyCorrectionPlugins.cc:511
PhiNHitFunction()
Default constructor.
Definition: EnergyCorrectionPlugins.cc:538
ThetaNHitFunction()
Default constructor.
Definition: EnergyCorrectionPlugins.cc:344
float m_minCleanCorrectedHitEnergy
Min value of new hit hadronic energy estimate after cleaning.
Definition: EnergyCorrectionPlugins.h:301
BarrelGapEnergyFunction()
Default constructor.
Definition: EnergyCorrectionPlugins.cc:233
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from the xml handle.
Definition: EnergyCorrectionPlugins.cc:312
ThetaNHitFunction class.
Definition: EnergyCorrectionPlugins.h:175
Approach
Approach enum.
Definition: EnergyCorrectionPlugins.h:139
CleanCluster class. Correct cluster energy by searching for constituent calo hits with anomalously hi...
Definition: EnergyCorrectionPlugins.h:278
BarrelGapEnergyFunction class.
Definition: EnergyCorrectionPlugins.h:112
PhiNHitFunction class.
Definition: EnergyCorrectionPlugins.h:226
pandora::FloatVector m_sdhcalThresholds
The sdhcal threshold values.
Definition: EnergyCorrectionPlugins.h:216
pandora::StatusCode MakeEnergyCorrections(const pandora::Cluster *const pCluster, float &correctedEnergy) const
Make energy correction on this given cluster.
Definition: EnergyCorrectionPlugins.cc:548