8 #ifndef LAR_TEST_BEAM_COSMIC_RAY_TAGGING_TOOL_H 9 #define LAR_TEST_BEAM_COSMIC_RAY_TAGGING_TOOL_H 1 16 #include <unordered_map> 56 CRCandidate(
const pandora::Pandora &
pandora,
const pandora::ParticleFlowObject *
const pPfo,
const unsigned int sliceId);
58 const pandora::ParticleFlowObject *
const m_pPfo;
86 bool GetValid3DCluster(
const pandora::ParticleFlowObject *
const pPfo,
const pandora::Cluster *&pCluster3D)
const;
88 typedef std::unordered_map<const pandora::ParticleFlowObject *, pandora::PfoList>
PfoToPfoListMap;
96 void GetPfoAssociations(
const pandora::PfoList &parentCosmicRayPfos, PfoToPfoListMap &pfoAssociationMap)
const;
108 bool CheckAssociation(
const pandora::CartesianVector &endPoint1,
const pandora::CartesianVector &endDir1,
109 const pandora::CartesianVector &endPoint2,
const pandora::CartesianVector &endDir2)
const;
111 typedef std::unordered_map<const pandora::ParticleFlowObject *, unsigned int>
PfoToSliceIdMap;
120 void SliceEvent(
const pandora::PfoList &parentCosmicRayPfos,
const PfoToPfoListMap &pfoAssociationMap, PfoToSliceIdMap &pfoToSliceIdMap)
const;
129 void FillSlice(
const pandora::ParticleFlowObject *
const pPfo,
const PfoToPfoListMap &pfoAssociationMap, pandora::PfoList &slice)
const;
138 void GetCRCandidates(
const pandora::PfoList &parentCosmicRayPfos,
const PfoToSliceIdMap &pfoToSliceIdMap, CRCandidateList &candidates)
const;
140 typedef std::unordered_map<const pandora::ParticleFlowObject *, bool>
PfoToBoolMap;
148 void CheckIfOutOfTime(
const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap)
const;
156 void CheckIfTopToBottom(
const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap)
const;
164 void CheckIfTopEntering(
const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap)
const;
172 void CheckIfInVetoedTPC(
const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap)
const;
177 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
179 typedef std::pair<const ThreeDSlidingFitResult, const ThreeDSlidingFitResult>
SlidingFitPair;
210 #endif // #ifndef LAR_TETS_BEAM_COSMIC_RAY_TAGGING_TOOL_H bool m_canFit
If there are a sufficient number of 3D hits to perform a fitting.
float m_face_Xc
Cathode X face.
const pandora::ParticleFlowObject *const m_pPfo
Address of the candidate Pfo.
void GetCRCandidates(const pandora::PfoList &parentCosmicRayPfos, const PfoToSliceIdMap &pfoToSliceIdMap, CRCandidateList &candidates) const
Make a list of CRCandidates.
std::set< unsigned int > UIntSet
std::unordered_map< int, bool > IntBoolMap
CosmicRayTaggingBaseTool class.
float m_face_Zu
Upstream Z face.
std::unordered_map< const pandora::ParticleFlowObject *, bool > PfoToBoolMap
pandora::CartesianVector m_endPoint2
Second fitted end point in 3D.
float m_marginY
The minimum distance from a detector Y-face for a Pfo to be associated.
void FindAmbiguousPfos(const pandora::PfoList &parentCosmicRayPfos, pandora::PfoList &ambiguousPfos, const MasterAlgorithm *const pAlgorithm)
Find the list of ambiguous pfos (could represent cosmic-ray muons or neutrinos)
float m_angularUncertainty
The uncertainty in degrees for the angle of a Pfo.
double m_length
Straight line length of the linear fit.
void CheckIfInVetoedTPC(const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap) const
Check if each candidate has its highest value in one of the vetoed TPC volumes.
double m_curvature
Measure of the curvature of the track.
void SliceEvent(const pandora::PfoList &parentCosmicRayPfos, const PfoToPfoListMap &pfoAssociationMap, PfoToSliceIdMap &pfoToSliceIdMap) const
Break the event up into slices of associated Pfos.
CRCandidate(const pandora::Pandora &pandora, const pandora::ParticleFlowObject *const pPfo, const unsigned int sliceId)
Constructor.
bool GetValid3DCluster(const pandora::ParticleFlowObject *const pPfo, const pandora::Cluster *&pCluster3D) const
Get the 3D calo hit cluster associated with a given Pfo, and check if it has sufficient hits...
void GetPfoAssociations(const pandora::PfoList &parentCosmicRayPfos, PfoToPfoListMap &pfoAssociationMap) const
Get mapping between Pfos that are associated with each other by pointing.
std::list< CRCandidate > CRCandidateList
Header file for the master algorithm class.
unsigned int m_minimumHits
The minimum number of hits for a Pfo to be considered.
bool CheckAssociation(const pandora::CartesianVector &endPoint1, const pandora::CartesianVector &endDir1, const pandora::CartesianVector &endPoint2, const pandora::CartesianVector &endDir2) const
Check whethe two Pfo endpoints are associated by distance of closest approach.
float m_inTimeMargin
The maximum distance outside of the physical detector volume that a Pfo may be to still be considered...
pandora::StatusCode Initialize()
float m_face_Xa
Anode X face.
float m_face_Yb
Bottom Y face.
std::vector< pandora::PfoList > SliceList
Header file for the lar three dimensional sliding fit result class.
TestBeamCosmicRayTaggingTool class.
bool m_tagOutOfTime
Whether to tag all out-of-time particles as cosmic rays.
float m_inTimeMaxX0
The maximum pfo x0 (determined from shifted vertex) to allow pfo to still be considered in time...
void FillSlice(const pandora::ParticleFlowObject *const pPfo, const PfoToPfoListMap &pfoAssociationMap, pandora::PfoList &slice) const
Fill a slice iteratively using Pfo associations.
bool m_tagTopEntering
Whether to tag all top entering particles as cosmic rays.
float m_face_Zd
Downstream Z face.
unsigned int m_sliceId
Slice ID.
double m_theta
Direction made with vertical.
std::unordered_map< const pandora::ParticleFlowObject *, pandora::PfoList > PfoToPfoListMap
ThreeDSlidingFitResult class.
std::pair< const ThreeDSlidingFitResult, const ThreeDSlidingFitResult > SlidingFitPair
float m_maxAssociationDist
The maximum distance from endpoint to point of closest approach, typically a multiple of LAr radiatio...
pandora::CartesianVector m_endPoint1
First fitted end point in 3D.
TestBeamCosmicRayTaggingTool()
Default constructor.
bool m_tagInVetoedTPCs
Whether to tag all particles with their highest position in vetoed TPCs as cosmic rays...
std::unordered_map< const pandora::ParticleFlowObject *, unsigned int > PfoToSliceIdMap
void CalculateFitVariables(const ThreeDSlidingFitResult &slidingFitResult)
Calculate all variables which require a fit.
Class to encapsulate the logic required determine if a Pfo should or shouldn't be tagged as a cosmic ...
void CheckIfTopEntering(const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap) const
Check if each candidate enters from the top of the detector.
void CheckIfOutOfTime(const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap) const
Check if each candidate is "in time".
bool m_tagTopToBottom
Whether to tag all top-to-bottom particles as cosmic rays.
std::vector< unsigned int > m_vetoedTPCs
List of vetoed TPCs for tagging cosmic rays.
void CheckIfTopToBottom(const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap) const
Check if each candidate is "top to bottom".
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::unordered_map< const pandora::ParticleFlowObject *, SlidingFitPair > PfoToSlidingFitsMap
float m_face_Yt
Top Y face.
float m_positionalUncertainty
The uncertainty in cm for the position of Pfo endpoint in 3D.