8 #ifndef APRIL_SHOWER_PROFILE_PLUGIN_H
9 #define APRIL_SHOWER_PROFILE_PLUGIN_H 1
13 namespace april_content
26 void CalculateShowerStartLayer(
const pandora::Cluster *
const pCluster,
unsigned int &showerStartLayer)
const;
27 void CalculateLongitudinalProfile(
const pandora::Cluster *
const pCluster,
float &profileStart,
float &profileDiscrepancy)
const;
28 void CalculateTransverseProfile(
const pandora::Cluster *
const pCluster,
const unsigned int maxPseudoLayer, ShowerPeakList &showerPeakList)
const;
29 void CalculateTransverseProfile(
const pandora::Cluster *
const pCluster,
const unsigned int maxPseudoLayer, ShowerPeakList &showerPeakList,
30 const bool inclusiveMode)
const;
31 void CalculateTrackBasedTransverseProfile(
const pandora::Cluster *
const pCluster,
const unsigned int maxPseudoLayer,
const pandora::Track *
const pMinTrack,
32 const pandora::TrackVector &trackVector, ShowerPeakList &showerPeakListPhoton, ShowerPeakList &showerPeakListNonPhoton)
const;
165 void CalculateProjectionAxes(
const pandora::Cluster *
const pCluster, pandora::CartesianVector &innerLayerCentroid, pandora::CartesianVector &uAxis,
166 pandora::CartesianVector &vAxis,
const pandora::Track *
const pMinTrack = NULL)
const;
178 void InitialiseTwoDShowerProfile(
const pandora::Cluster *
const pCluster,
const unsigned int maxPseudoLayer,
const pandora::CartesianVector &innerLayerCentroid,
179 const pandora::CartesianVector &uAxis,
const pandora::CartesianVector &vAxis,
TwoDShowerProfile &showerProfile)
const;
191 void FindTracksProjection(
const pandora::Cluster *
const pCluster,
const pandora::TrackVector &trackVector,
const pandora::CartesianVector &innerLayerCentroid,
192 const pandora::CartesianVector &uAxis,
const pandora::CartesianVector &vAxis,
TwoDBinVector &trackProjectionVector)
const;
293 ShowerPeakList &showerPeakListPhoton, ShowerPeakList &showerPeakListNonPhoton,
const bool inclusiveMode)
const;
307 void FindHitPositionProjection(
const pandora::CartesianVector &hitPosition,
const pandora::CartesianVector &innerLayerCentroid,
const pandora::CartesianVector &uAxis,
308 const pandora::CartesianVector &vAxis,
const int nOffsetBins,
const float cellLengthScale,
int &uBin,
int &vBin)
const;
322 void FindBoundaryBins(
const int uBin,
const int vBin,
const int uEdgeLow,
const int uEdgeHigh,
const int vEdgeLow,
const int vEdgeHigh,
int &uEdgeBin,
int &vEdgeBin)
const;
396 pandora::StatusCode ReadSettings(
const pandora::TiXmlHandle xmlHandle);
420 inline void APRILShowerProfilePlugin::CalculateTransverseProfile(
const pandora::Cluster *
const pCluster,
const unsigned int maxPseudoLayer, ShowerPeakList &showerPeakList)
const
422 return CalculateTransverseProfile(pCluster, maxPseudoLayer, showerPeakList,
false);
430 m_potentialPeak(true)
438 m_isPhotonCandidate(true),
void ConvertBinsToShowerLists(const TwoDShowerProfile &showerProfile, const ShowerPeakObjectVector &showerPeakObjectVector, ShowerPeakList &showerPeakListPhoton, ShowerPeakList &showerPeakListNonPhoton, const bool inclusiveMode) const
Convert 2D bins to shower lists.
Definition: ShowerProfilePlugin.cc:782
bool HasPhotonCandidate(const ShowerPeakObjectVector &showerPeakObjectVector) const
True for showerPeakObjectVector contains photon candiates.
Definition: ShowerProfilePlugin.cc:953
float m_longProfileCriticalEnergy
Critical energy, used to calculate argument for gamma function.
Definition: ShowerProfilePlugin.h:404
float CalculatePeakFindingMetric(const float distance, const float energy) const
Calculate the metric for peak association.
Definition: ShowerProfilePlugin.cc:903
ShowerPeakObject class.
Definition: ShowerProfilePlugin.h:59
float m_transProfileMinDisTrackMatch
The maximum allowed shift of 2D distance of the peak position through the slices. ...
Definition: ShowerProfilePlugin.h:415
int m_vBin
The u bin of the peak.
Definition: ShowerProfilePlugin.h:95
int GetPeakVBin() const
Get peak v bin.
Definition: ShowerProfilePlugin.h:462
void MatchPeaksInTwoSlices(const ShowerPeakObjectVector &showerPeakObjectVectorFirst, ShowerPeakObjectVector &showerPeakObjectVectorNext) const
Mark bins shifted too much between slices not photon candidate.
Definition: ShowerProfilePlugin.cc:692
bool m_isAvailable
Whether this is avaiable.
Definition: ShowerProfilePlugin.h:89
void CalculateTrackNearbyTransverseShowers(const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, const pandora::Track *const pMinTrack, const pandora::TrackVector &trackVector, TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector, TwoDBinVector &trackProjectionVector) const
Calculate transverse shower peak objects for a cluster and get the list of peaks identified in the pr...
Definition: ShowerProfilePlugin.cc:409
unsigned int m_showerStartNonMipLayers
Number of successive shower-like layers to identify shower start.
Definition: ShowerProfilePlugin.h:399
float GetPeakEnergy() const
Get peak energy.
Definition: ShowerProfilePlugin.h:448
void AssociateBinsToPeaks(const TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
Associate bins to peaks, using TwoDShowerProfile.
Definition: ShowerProfilePlugin.cc:608
void InitialiseTwoDShowerProfile(const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, const pandora::CartesianVector &innerLayerCentroid, const pandora::CartesianVector &uAxis, const pandora::CartesianVector &vAxis, TwoDShowerProfile &showerProfile) const
Initialise 2D shower profile implementation given porject axes.
Definition: ShowerProfilePlugin.cc:468
void MarkPeaksCloseToTracks(const TwoDBinVector &trackProjectionVector, ShowerPeakObjectVector &showerPeakObjectVector) const
Mark bins close to tracks not photon candidate.
Definition: ShowerProfilePlugin.cc:666
APRILShowerProfilePlugin class.
Definition: ShowerProfilePlugin.h:18
float m_longProfileParameter0
Parameter0, used to calculate argument for gamma function.
Definition: ShowerProfilePlugin.h:405
pandora::CaloHitList m_caloHitList
The list of calo hits associated with the shower profile entry.
Definition: ShowerProfilePlugin.h:48
bool PassQualityCutPeakNBin(const ShowerPeakObject &showerPeakObject) const
True for passing the quality cuts for minimum number of bins.
Definition: ShowerProfilePlugin.cc:659
std::vector< ShowerProfileEntry > ShowerProfile
The shower profile typedef.
Definition: ShowerProfilePlugin.h:98
void CalculateBestPeakUsingMetric(ShowerPeakObjectVector &showerPeakObjectVector, const int uBin, const int vBin, ShowerPeakObject *&bestShowerPeakObject) const
Find the best shower peak to associate bins.
Definition: ShowerProfilePlugin.cc:925
unsigned int m_transProfileMinNBinsCut
The minimum number for bins of a substantial peak.
Definition: ShowerProfilePlugin.h:412
void CalculateTracklessTransverseShowers(const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
Calculate transverse shower peak objects for a cluster and get the list of peaks identified in the pr...
Definition: ShowerProfilePlugin.cc:400
unsigned int m_transProfilePeakFindingMetric
The metric for peak association.
Definition: ShowerProfilePlugin.h:411
std::vector< TwoDBin > TwoDBinVector
The two dimensional bin vector typedef.
Definition: ShowerProfilePlugin.h:54
bool Check8NeighbourFast(TwoDShowerProfile &showerProfile, const int uBin, const int vBin) const
True if the peak is a local maxima implementaion, fast.
Definition: ShowerProfilePlugin.cc:876
Header file for the shower profile plugin class.
float GetCellLengthScale(const pandora::Cluster *const pCluster) const
Get cell length scale.
Definition: ShowerProfilePlugin.cc:532
void FindRawPeaksInTwoDShowerProfile(TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
Find raw peaks in 2D profile, based on local maxima.
Definition: ShowerProfilePlugin.cc:568
pandora::CaloHitList m_unusedCaloHitList
The list of calo hits unused for shower peak finding, needed for inclusive mode.
Definition: ShowerProfilePlugin.h:50
void CreateEmptyTwoDShowerProfile(TwoDShowerProfile &showerProfile) const
Calculate empty 2D shower profile.
Definition: ShowerProfilePlugin.cc:419
int GetPeakUBin() const
Get peak u bin.
Definition: ShowerProfilePlugin.h:455
void FindBoundaryBins(const int uBin, const int vBin, const int uEdgeLow, const int uEdgeHigh, const int vEdgeLow, const int vEdgeHigh, int &uEdgeBin, int &vEdgeBin) const
Find the cloest boundary bin for a point outside the square.
Definition: ShowerProfilePlugin.cc:749
void FindHitPositionProjection(const pandora::CartesianVector &hitPosition, const pandora::CartesianVector &innerLayerCentroid, const pandora::CartesianVector &uAxis, const pandora::CartesianVector &vAxis, const int nOffsetBins, const float cellLengthScale, int &uBin, int &vBin) const
Find projection of a 3D point.
Definition: ShowerProfilePlugin.cc:734
void InitialiseTransverseProfileWithTracks(const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, const pandora::Track *const pMinTrack, const pandora::TrackVector &trackVector, TwoDShowerProfile &showerProfile, TwoDBinVector &trackProjectionVector) const
Initialise 2D shower profile for clusters close to tracks.
Definition: ShowerProfilePlugin.cc:435
std::pair< int, int > TwoDBin
The two dimensional bin typedef.
Definition: ShowerProfilePlugin.h:53
int m_transProfileNBins
Number of bins used to construct transverse profile.
Definition: ShowerProfilePlugin.h:409
float m_longProfileBinWidth
Bin width used to construct longitudinal profile, units radiation lengths.
Definition: ShowerProfilePlugin.h:401
ShowerProfileEntry class.
Definition: ShowerProfilePlugin.h:38
float m_transProfilePeakThreshold
Minimum energy for a bin to consider.
Definition: ShowerProfilePlugin.h:410
float m_longProfileMinCosAngle
Min angular correction used to adjust radiation length measures.
Definition: ShowerProfilePlugin.h:403
unsigned int m_longProfileNBins
Number of bins used to construct longitudinal profile.
Definition: ShowerProfilePlugin.h:402
float m_longProfileMaxDifference
Max difference between current and best longitudinal profile comparisons.
Definition: ShowerProfilePlugin.h:407
std::vector< ShowerPeakObject > ShowerPeakObjectVector
The shower peak object vector.
Definition: ShowerProfilePlugin.h:100
bool m_isPhotonCandidate
Whether this is photon candidate.
Definition: ShowerProfilePlugin.h:90
void ApplyQualityCutPeakNBin(ShowerPeakObjectVector &showerPeakObjectVector, TwoDBinVector &twoDBinVector) const
Apply quality cuts to peaks.
Definition: ShowerProfilePlugin.cc:644
static bool SortShowerPeakListByEnergy(const ShowerPeak &lhs, const ShowerPeak &rhs)
Sort shower peak list by desending energy.
Definition: ShowerProfilePlugin.cc:968
void MaskLowHeightRegions(TwoDShowerProfile &showerProfile) const
Mark region with low height unavailable.
Definition: ShowerProfilePlugin.cc:551
bool m_potentialPeak
Whether the shower profile is a potential peak (to speed up looping)
Definition: ShowerProfilePlugin.h:49
float m_transProfileMinTrackToPeakCut
The minimum 2D distance of a track to the peak postion.
Definition: ShowerProfilePlugin.h:414
APRILShowerProfilePlugin()
Default constructor.
Definition: ShowerProfilePlugin.cc:19
float m_energy
The energy associated with the shower profile entry.
Definition: ShowerProfilePlugin.h:93
void AssociateUnavailableBinsToPeaks(const TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
Associate unavailable bins to peaks, using TwoDShowerProfile, for inclusive modes.
Definition: ShowerProfilePlugin.cc:587
float m_longProfileParameter1
Parameter1, used to calculate argument for gamma function.
Definition: ShowerProfilePlugin.h:406
std::vector< ShowerProfile > TwoDShowerProfile
The two dimensional shower profile typedef.
Definition: ShowerProfilePlugin.h:99
void FindTracksProjection(const pandora::Cluster *const pCluster, const pandora::TrackVector &trackVector, const pandora::CartesianVector &innerLayerCentroid, const pandora::CartesianVector &uAxis, const pandora::CartesianVector &vAxis, TwoDBinVector &trackProjectionVector) const
Find all tracks projections on 2D shower profile.
Definition: ShowerProfilePlugin.cc:510
void InitialiseTransverseProfile(const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, TwoDShowerProfile &showerProfile) const
Initialise 2D shower profile for clusters not close to tracks.
Definition: ShowerProfilePlugin.cc:426
TwoDBinVector m_associatedBins
The bins associated to this peak.
Definition: ShowerProfilePlugin.h:88
unsigned int m_transProfileTrackNearbyNSlices
The number of slices to analyse the EM shower.
Definition: ShowerProfilePlugin.h:413
int m_uBin
The u bin of the peak.
Definition: ShowerProfilePlugin.h:94
float m_showerStartMipFraction
Max layer mip-fraction to declare layer as shower-like.
Definition: ShowerProfilePlugin.h:398
bool Check8NeighbourFull(TwoDShowerProfile &showerProfile, const int uBin, const int vBin) const
True if the peak is a local maxima implementaion.
Definition: ShowerProfilePlugin.cc:847
bool IsPeak(TwoDShowerProfile &showerProfile, const int uBin, const int vBin) const
True if the peak is a local maxima.
Definition: ShowerProfilePlugin.cc:839
float m_energy
The energy associated with the shower profile entry.
Definition: ShowerProfilePlugin.h:47
ShowerProfileEntry()
Default constructor.
Definition: ShowerProfilePlugin.h:427
ShowerPeakObject(const float energy, const int uBin, const int vBin)
Default constructor.
Definition: ShowerProfilePlugin.h:436
void CalculateProjectionAxes(const pandora::Cluster *const pCluster, pandora::CartesianVector &innerLayerCentroid, pandora::CartesianVector &uAxis, pandora::CartesianVector &vAxis, const pandora::Track *const pMinTrack=NULL) const
Find axes of projection.
Definition: ShowerProfilePlugin.cc:446
void ProcessShowerProfile(TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
Process the quality cuts and association of bins to peaks.
Definition: ShowerProfilePlugin.cc:722
bool m_isAvailable
Whether shower profile entry is available (prevent double counting)
Definition: ShowerProfilePlugin.h:46