APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
april_content::APRILShowerProfilePlugin Class Reference

APRILShowerProfilePlugin class. More...

#include <ShowerProfilePlugin.h>

Inheritance diagram for april_content::APRILShowerProfilePlugin:

Classes

class  ShowerPeakObject
 ShowerPeakObject class. More...
 
class  ShowerProfileEntry
 ShowerProfileEntry class. More...
 

Public Member Functions

 APRILShowerProfilePlugin ()
 Default constructor.
 
void CalculateShowerStartLayer (const pandora::Cluster *const pCluster, unsigned int &showerStartLayer) const
 
void CalculateLongitudinalProfile (const pandora::Cluster *const pCluster, float &profileStart, float &profileDiscrepancy) const
 
void CalculateTransverseProfile (const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, ShowerPeakList &showerPeakList) const
 
void CalculateTransverseProfile (const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, ShowerPeakList &showerPeakList, const bool inclusiveMode) const
 
void CalculateTrackBasedTransverseProfile (const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, const pandora::Track *const pMinTrack, const pandora::TrackVector &trackVector, ShowerPeakList &showerPeakListPhoton, ShowerPeakList &showerPeakListNonPhoton) const
 

Private Types

typedef std::pair< int, int > TwoDBin
 The two dimensional bin typedef.
 
typedef std::vector< TwoDBinTwoDBinVector
 The two dimensional bin vector typedef.
 
typedef std::vector
< ShowerProfileEntry
ShowerProfile
 The shower profile typedef.
 
typedef std::vector
< ShowerProfile
TwoDShowerProfile
 The two dimensional shower profile typedef.
 
typedef std::vector
< ShowerPeakObject
ShowerPeakObjectVector
 The shower peak object vector.
 

Private Member Functions

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 profile, for clusters without tracks. More...
 
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 profile, for clusters close to tracks. More...
 
void CreateEmptyTwoDShowerProfile (TwoDShowerProfile &showerProfile) const
 Calculate empty 2D shower profile. More...
 
void InitialiseTransverseProfile (const pandora::Cluster *const pCluster, const unsigned int maxPseudoLayer, TwoDShowerProfile &showerProfile) const
 Initialise 2D shower profile for clusters not close to tracks. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
float GetCellLengthScale (const pandora::Cluster *const pCluster) const
 Get cell length scale. More...
 
void MaskLowHeightRegions (TwoDShowerProfile &showerProfile) const
 Mark region with low height unavailable. More...
 
void FindRawPeaksInTwoDShowerProfile (TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
 Find raw peaks in 2D profile, based on local maxima. More...
 
void AssociateUnavailableBinsToPeaks (const TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
 Associate unavailable bins to peaks, using TwoDShowerProfile, for inclusive modes. More...
 
void AssociateBinsToPeaks (const TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
 Associate bins to peaks, using TwoDShowerProfile. More...
 
void AssociateBinsToPeaks (const TwoDBinVector &twoDBinVector, ShowerPeakObjectVector &showerPeakObjectVector) const
 Associate bins to peaks, using TwoDBinVector. More...
 
void ApplyQualityCutPeakNBin (ShowerPeakObjectVector &showerPeakObjectVector, TwoDBinVector &twoDBinVector) const
 Apply quality cuts to peaks. More...
 
bool PassQualityCutPeakNBin (const ShowerPeakObject &showerPeakObject) const
 True for passing the quality cuts for minimum number of bins. More...
 
void MarkPeaksCloseToTracks (const TwoDBinVector &trackProjectionVector, ShowerPeakObjectVector &showerPeakObjectVector) const
 Mark bins close to tracks not photon candidate. More...
 
void MatchPeaksInTwoSlices (const ShowerPeakObjectVector &showerPeakObjectVectorFirst, ShowerPeakObjectVector &showerPeakObjectVectorNext) const
 Mark bins shifted too much between slices not photon candidate. More...
 
void ProcessShowerProfile (TwoDShowerProfile &showerProfile, ShowerPeakObjectVector &showerPeakObjectVector) const
 Process the quality cuts and association of bins to peaks. More...
 
void ConvertBinsToShowerLists (const TwoDShowerProfile &showerProfile, const ShowerPeakObjectVector &showerPeakObjectVector, ShowerPeakList &showerPeakListPhoton, ShowerPeakList &showerPeakListNonPhoton, const bool inclusiveMode) const
 Convert 2D bins to shower lists. More...
 
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. More...
 
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. More...
 
bool IsPeak (TwoDShowerProfile &showerProfile, const int uBin, const int vBin) const
 True if the peak is a local maxima. More...
 
bool Check8NeighbourFull (TwoDShowerProfile &showerProfile, const int uBin, const int vBin) const
 True if the peak is a local maxima implementaion. More...
 
bool Check8NeighbourFast (TwoDShowerProfile &showerProfile, const int uBin, const int vBin) const
 True if the peak is a local maxima implementaion, fast. More...
 
float CalculatePeakFindingMetric (const float distance, const float energy) const
 Calculate the metric for peak association. More...
 
void CalculateBestPeakUsingMetric (ShowerPeakObjectVector &showerPeakObjectVector, const int uBin, const int vBin, ShowerPeakObject *&bestShowerPeakObject) const
 Find the best shower peak to associate bins. More...
 
bool HasPhotonCandidate (const ShowerPeakObjectVector &showerPeakObjectVector) const
 True for showerPeakObjectVector contains photon candiates. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Static Private Member Functions

static bool SortShowerPeakListByEnergy (const ShowerPeak &lhs, const ShowerPeak &rhs)
 Sort shower peak list by desending energy. More...
 

Private Attributes

float m_showerStartMipFraction
 Max layer mip-fraction to declare layer as shower-like.
 
unsigned int m_showerStartNonMipLayers
 Number of successive shower-like layers to identify shower start.
 
float m_longProfileBinWidth
 Bin width used to construct longitudinal profile, units radiation lengths.
 
unsigned int m_longProfileNBins
 Number of bins used to construct longitudinal profile.
 
float m_longProfileMinCosAngle
 Min angular correction used to adjust radiation length measures.
 
float m_longProfileCriticalEnergy
 Critical energy, used to calculate argument for gamma function.
 
float m_longProfileParameter0
 Parameter0, used to calculate argument for gamma function.
 
float m_longProfileParameter1
 Parameter1, used to calculate argument for gamma function.
 
float m_longProfileMaxDifference
 Max difference between current and best longitudinal profile comparisons.
 
int m_transProfileNBins
 Number of bins used to construct transverse profile.
 
float m_transProfilePeakThreshold
 Minimum energy for a bin to consider.
 
unsigned int m_transProfilePeakFindingMetric
 The metric for peak association.
 
unsigned int m_transProfileMinNBinsCut
 The minimum number for bins of a substantial peak.
 
unsigned int m_transProfileTrackNearbyNSlices
 The number of slices to analyse the EM shower.
 
float m_transProfileMinTrackToPeakCut
 The minimum 2D distance of a track to the peak postion.
 
float m_transProfileMinDisTrackMatch
 The maximum allowed shift of 2D distance of the peak position through the slices.
 

Detailed Description

APRILShowerProfilePlugin class.

Member Function Documentation

void april_content::APRILShowerProfilePlugin::ApplyQualityCutPeakNBin ( ShowerPeakObjectVector showerPeakObjectVector,
TwoDBinVector twoDBinVector 
) const
private

Apply quality cuts to peaks.

Parameters
showerPeakObjectVectorthe 2D peak object to modify
twoDBinVectorthe discared two dimensional bins to receive
void april_content::APRILShowerProfilePlugin::AssociateBinsToPeaks ( const TwoDShowerProfile showerProfile,
ShowerPeakObjectVector showerPeakObjectVector 
) const
private

Associate bins to peaks, using TwoDShowerProfile.

Parameters
showerProfiletwo dimensional shower profile to consider
showerPeakObjectVectorthe 2D peak object to receive
void april_content::APRILShowerProfilePlugin::AssociateBinsToPeaks ( const TwoDBinVector twoDBinVector,
ShowerPeakObjectVector showerPeakObjectVector 
) const
private

Associate bins to peaks, using TwoDBinVector.

Parameters
twoDBinVectortwo dimensional bins
showerPeakObjectVectorthe 2D peak object to receive
void april_content::APRILShowerProfilePlugin::AssociateUnavailableBinsToPeaks ( const TwoDShowerProfile showerProfile,
ShowerPeakObjectVector showerPeakObjectVector 
) const
private

Associate unavailable bins to peaks, using TwoDShowerProfile, for inclusive modes.

Parameters
showerProfiletwo dimensional shower profile to consider
showerPeakObjectVectorthe 2D peak object to receive
void april_content::APRILShowerProfilePlugin::CalculateBestPeakUsingMetric ( ShowerPeakObjectVector showerPeakObjectVector,
const int  uBin,
const int  vBin,
ShowerPeakObject *&  bestShowerPeakObject 
) const
private

Find the best shower peak to associate bins.

Parameters
showerPeakObjectVectorshower peak obejct vectors for all peaks
uBinposition of bin
vBinposition of bin
bestShowerPeakObjectaddress of best peak object to receive
float april_content::APRILShowerProfilePlugin::CalculatePeakFindingMetric ( const float  distance,
const float  energy 
) const
private

Calculate the metric for peak association.

Parameters
distancethe distance to the peak
energyenergy of the peak
Returns
the metric for peak association
void april_content::APRILShowerProfilePlugin::CalculateProjectionAxes ( const pandora::Cluster *const  pCluster,
pandora::CartesianVector &  innerLayerCentroid,
pandora::CartesianVector &  uAxis,
pandora::CartesianVector &  vAxis,
const pandora::Track *const  pMinTrack = NULL 
) const
private

Find axes of projection.

Parameters
pClusterthe address of the cluster
innerLayerCentroidthe inner layer centroid to receive
uAxisu axis to receive
vAxisv axis to receive
pMinTrackthe closest track to the shower profile to speed up calculation
void april_content::APRILShowerProfilePlugin::CalculateTracklessTransverseShowers ( const pandora::Cluster *const  pCluster,
const unsigned int  maxPseudoLayer,
TwoDShowerProfile showerProfile,
ShowerPeakObjectVector showerPeakObjectVector 
) const
private

Calculate transverse shower peak objects for a cluster and get the list of peaks identified in the profile, for clusters without tracks.

Parameters
pClusterthe address of the cluster
maxPseudoLayerthe maximum pseudo layer to consider
showerProfiletwo dimensional shower profile to consider
showerPeakObjectVectorto receive the shower peak objects
void april_content::APRILShowerProfilePlugin::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
private

Calculate transverse shower peak objects for a cluster and get the list of peaks identified in the profile, for clusters close to tracks.

Parameters
pClusterthe address of the cluster
maxPseudoLayerthe maximum pseudo layer to consider
pMinTrackthe closest track to the shower profile to speed up calculation
trackVectorthe vector of tracks to speed up calculation
showerProfiletwo dimensional shower profile to consider
showerPeakObjectVectorto receive the shower peak objects
trackProjectionVectorthe 2D positions of track projections to receive and speed up subsequent calculation
bool april_content::APRILShowerProfilePlugin::Check8NeighbourFast ( TwoDShowerProfile showerProfile,
const int  uBin,
const int  vBin 
) const
private

True if the peak is a local maxima implementaion, fast.

Parameters
showerProfilethe 2D shower profile to modify
uBinprojection in u direction
vBinprojection in v direction
Returns
True if the peak is a local maxima
bool april_content::APRILShowerProfilePlugin::Check8NeighbourFull ( TwoDShowerProfile showerProfile,
const int  uBin,
const int  vBin 
) const
private

True if the peak is a local maxima implementaion.

Parameters
showerProfilethe 2D shower profile to modify
uBinprojection in u direction
vBinprojection in v direction
Returns
True if the peak is a local maxima
void april_content::APRILShowerProfilePlugin::ConvertBinsToShowerLists ( const TwoDShowerProfile showerProfile,
const ShowerPeakObjectVector showerPeakObjectVector,
ShowerPeakList &  showerPeakListPhoton,
ShowerPeakList &  showerPeakListNonPhoton,
const bool  inclusiveMode 
) const
private

Convert 2D bins to shower lists.

Parameters
showerProfilethe 2D shower profile to consider
showerPeakObjectVectorthe 2D peak object vector to consider
showerPeakListPhotonshower peak list of photon candidates
showerPeakListNonPhotonshower peak list of non photon candidates
inclusiveModeinclusive mode to add all calo hits to peaks
void april_content::APRILShowerProfilePlugin::CreateEmptyTwoDShowerProfile ( TwoDShowerProfile showerProfile) const
private

Calculate empty 2D shower profile.

Parameters
showerProfiletwo dimensional shower profile to receive
void april_content::APRILShowerProfilePlugin::FindBoundaryBins ( const int  uBin,
const int  vBin,
const int  uEdgeLow,
const int  uEdgeHigh,
const int  vEdgeLow,
const int  vEdgeHigh,
int &  uEdgeBin,
int &  vEdgeBin 
) const
private

Find the cloest boundary bin for a point outside the square.

Parameters
uBinu bin
vBinv bin
uEdgeLowu bin low edge
uEdgeHighu bin high edge
vEdgeLowv bin low edge
vEdgeHighv bin high edge
uEdgeBincloest edge u bin
vEdgeBincloest edge v bin
void april_content::APRILShowerProfilePlugin::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
private

Find projection of a 3D point.

Parameters
hitPositionthe 3D position
innerLayerCentroidthe inner layer centroid to consider
uAxisu axis to consider
vAxisv axis to consider
nOffsetBinsthe number of offset bins
cellLengthScalecell length scale
uBinprojection in u direction
vBinprojection in v direction
void april_content::APRILShowerProfilePlugin::FindRawPeaksInTwoDShowerProfile ( TwoDShowerProfile showerProfile,
ShowerPeakObjectVector showerPeakObjectVector 
) const
private

Find raw peaks in 2D profile, based on local maxima.

Parameters
showerProfiletwo dimensional shower profile to consider
showerPeakObjectVectorthe 2D peak object to receive
void april_content::APRILShowerProfilePlugin::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
private

Find all tracks projections on 2D shower profile.

Parameters
pClusterthe address of the cluster
trackVectorthe vector of address of all tracks
innerLayerCentroidthe inner layer centroid to consider
uAxisu axis to consider
vAxisv axis to consider
trackProjectionVectorthe 2D positions of track projections to receive and speed up subsequent calculation
float april_content::APRILShowerProfilePlugin::GetCellLengthScale ( const pandora::Cluster *const  pCluster) const
private

Get cell length scale.

Parameters
pClusterthe address of the cluster
Returns
Cell length scale
bool april_content::APRILShowerProfilePlugin::HasPhotonCandidate ( const ShowerPeakObjectVector showerPeakObjectVector) const
private

True for showerPeakObjectVector contains photon candiates.

Parameters
showerPeakObjectVectorshower peak obejct vectors for all peaks
Returns
True for showerPeakObjectVector contains photon candiates
void april_content::APRILShowerProfilePlugin::InitialiseTransverseProfile ( const pandora::Cluster *const  pCluster,
const unsigned int  maxPseudoLayer,
TwoDShowerProfile showerProfile 
) const
private

Initialise 2D shower profile for clusters not close to tracks.

Parameters
pClusterthe address of the cluster
maxPseudoLayerthe maximum pseudo layer to consider
showerProfiletwo dimensional shower profile to consider
void april_content::APRILShowerProfilePlugin::InitialiseTransverseProfileWithTracks ( const pandora::Cluster *const  pCluster,
const unsigned int  maxPseudoLayer,
const pandora::Track *const  pMinTrack,
const pandora::TrackVector &  trackVector,
TwoDShowerProfile showerProfile,
TwoDBinVector trackProjectionVector 
) const
private

Initialise 2D shower profile for clusters close to tracks.

Parameters
pClusterthe address of the cluster
maxPseudoLayerthe maximum pseudo layer to consider
pMinTrackthe closest track to the shower profile to speed up calculation
trackVectorthe vector of tracks to speed up calculation
showerProfiletwo dimensional shower profile to consider
trackProjectionVectorthe 2D positions of track projections to receive and speed up subsequent calculation
void april_content::APRILShowerProfilePlugin::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
private

Initialise 2D shower profile implementation given porject axes.

Parameters
pClusterthe address of the cluster
maxPseudoLayerthe maximum pseudo layer to consider
innerLayerCentroidthe inner layer centroid to consider
uAxisu axis to consider
vAxisv axis to consider
showerProfiletwo dimensional shower profile to receive
bool april_content::APRILShowerProfilePlugin::IsPeak ( TwoDShowerProfile showerProfile,
const int  uBin,
const int  vBin 
) const
private

True if the peak is a local maxima.

Parameters
showerProfilethe 2D shower profile to modify
uBinprojection in u direction
vBinprojection in v direction
Returns
True if the peak is a local maxima
void april_content::APRILShowerProfilePlugin::MarkPeaksCloseToTracks ( const TwoDBinVector trackProjectionVector,
ShowerPeakObjectVector showerPeakObjectVector 
) const
private

Mark bins close to tracks not photon candidate.

Parameters
trackProjectionVectorthe all track projections in the 2D plane
showerPeakObjectVectorthe 2D peak object vector to modify
void april_content::APRILShowerProfilePlugin::MaskLowHeightRegions ( TwoDShowerProfile showerProfile) const
private

Mark region with low height unavailable.

Parameters
showerProfiletwo dimensional shower profile to consider
void april_content::APRILShowerProfilePlugin::MatchPeaksInTwoSlices ( const ShowerPeakObjectVector showerPeakObjectVectorFirst,
ShowerPeakObjectVector showerPeakObjectVectorNext 
) const
private

Mark bins shifted too much between slices not photon candidate.

Parameters
showerPeakObjectVectorFirstthe 2D peak object vector from previous slice
showerPeakObjectVectorNextthe 2D peak object vector from next slice to modify
bool april_content::APRILShowerProfilePlugin::PassQualityCutPeakNBin ( const ShowerPeakObject showerPeakObject) const
private

True for passing the quality cuts for minimum number of bins.

Parameters
showerPeakObjectthe 2D peak object to consider
Returns
True for passing the quality cuts for minimum number of bins
void april_content::APRILShowerProfilePlugin::ProcessShowerProfile ( TwoDShowerProfile showerProfile,
ShowerPeakObjectVector showerPeakObjectVector 
) const
private

Process the quality cuts and association of bins to peaks.

Parameters
showerProfilethe 2D shower profile to modify
showerPeakObjectVectorthe 2D peak object vector to modify
bool april_content::APRILShowerProfilePlugin::SortShowerPeakListByEnergy ( const ShowerPeak &  lhs,
const ShowerPeak &  rhs 
)
staticprivate

Sort shower peak list by desending energy.

Parameters
lhsfirst shower peak for comparison
rhssecond shower peak for comparison
Returns
boolean

The documentation for this class was generated from the following files: