8 #ifndef LAR_COSMIC_RAY_TAGGING_TOOL_H 9 #define LAR_COSMIC_RAY_TAGGING_TOOL_H 1 15 #include <unordered_map> 48 CRCandidate(
const pandora::Pandora &
pandora,
const pandora::ParticleFlowObject *
const pPfo,
const unsigned int sliceId);
50 const pandora::ParticleFlowObject *
const m_pPfo;
78 bool GetValid3DCluster(
const pandora::ParticleFlowObject *
const pPfo,
const pandora::Cluster *&pCluster3D)
const;
80 typedef std::unordered_map<const pandora::ParticleFlowObject *, pandora::PfoList>
PfoToPfoListMap;
88 void GetPfoAssociations(
const pandora::PfoList &parentCosmicRayPfos, PfoToPfoListMap &pfoAssociationMap)
const;
100 bool CheckAssociation(
const pandora::CartesianVector &endPoint1,
const pandora::CartesianVector &endDir1,
101 const pandora::CartesianVector &endPoint2,
const pandora::CartesianVector &endDir2)
const;
103 typedef std::unordered_map<const pandora::ParticleFlowObject *, unsigned int>
PfoToSliceIdMap;
112 void SliceEvent(
const pandora::PfoList &parentCosmicRayPfos,
const PfoToPfoListMap &pfoAssociationMap, PfoToSliceIdMap &pfoToSliceIdMap)
const;
121 void FillSlice(
const pandora::ParticleFlowObject *
const pPfo,
const PfoToPfoListMap &pfoAssociationMap, pandora::PfoList &slice)
const;
130 void GetCRCandidates(
const pandora::PfoList &parentCosmicRayPfos,
const PfoToSliceIdMap &pfoToSliceIdMap, CRCandidateList &candidates)
const;
132 typedef std::unordered_map<const pandora::ParticleFlowObject *, bool>
PfoToBoolMap;
140 void CheckIfInTime(
const CRCandidateList &candidates, PfoToBoolMap &pfoToInTimeMap)
const;
148 void CheckIfContained(
const CRCandidateList &candidates, PfoToBoolMap &pfoToIsContainedMap)
const;
156 void CheckIfTopToBottom(
const CRCandidateList &candidates, PfoToBoolMap &pfoToIsTopToBottomMap)
const;
169 void GetNeutrinoSlices(
const CRCandidateList &candidates,
const PfoToBoolMap &pfoToInTimeMap,
const PfoToBoolMap &pfoToIsContainedMap,
170 UIntSet &neutrinoSliceSet)
const;
181 void TagCRMuons(
const CRCandidateList &candidates,
const PfoToBoolMap &pfoToInTimeMap,
const PfoToBoolMap &pfoToIsTopToBottomMap,
182 const UIntSet &neutrinoSliceSet, PfoToBoolMap &pfoToIsLikelyCRMuonMap)
const;
184 pandora::StatusCode
ReadSettings(
const pandora::TiXmlHandle xmlHandle);
186 typedef std::pair<const ThreeDSlidingFitResult, const ThreeDSlidingFitResult>
SlidingFitPair;
221 #endif // #ifndef LAR_COSMIC_RAY_TAGGING_TOOL_H std::unordered_map< const pandora::ParticleFlowObject *, pandora::PfoList > PfoToPfoListMap
std::unordered_map< const pandora::ParticleFlowObject *, bool > PfoToBoolMap
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_face_Yb
Bottom Y face.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void TagCRMuons(const CRCandidateList &candidates, const PfoToBoolMap &pfoToInTimeMap, const PfoToBoolMap &pfoToIsTopToBottomMap, const UIntSet &neutrinoSliceSet, PfoToBoolMap &pfoToIsLikelyCRMuonMap) const
Tag Pfos which are likely to be a CR muon.
std::unordered_map< const pandora::ParticleFlowObject *, unsigned int > PfoToSliceIdMap
float m_maxNeutrinoCosTheta
The maximum cos(theta) that a Pfo can have to be classified as a likely neutrino. ...
CosmicRayTaggingBaseTool class.
float m_face_Zu
Upstream Z face.
void SliceEvent(const pandora::PfoList &parentCosmicRayPfos, const PfoToPfoListMap &pfoAssociationMap, PfoToSliceIdMap &pfoToSliceIdMap) const
Break the event up into slices of associated Pfos.
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.
CosmicRayTaggingTool class.
float m_positionalUncertainty
The uncertainty in cm for the position of Pfo endpoint in 3D.
void CheckIfTopToBottom(const CRCandidateList &candidates, PfoToBoolMap &pfoToIsTopToBottomMap) const
Check if each candidate is "top to bottom".
double m_theta
Direction made with vertical.
bool m_canFit
If there are a sufficient number of 3D hits to perform a fitting.
Class to encapsulate the logic required determine if a Pfo should or shouldn't be tagged as a cosmic ...
void CheckIfContained(const CRCandidateList &candidates, PfoToBoolMap &pfoToIsContainedMap) const
Check if each candidate is "contained" (contained = no associations to Y or Z detector faces...
float m_angularUncertainty
The uncertainty in degrees for the angle of a Pfo.
CRCandidate(const pandora::Pandora &pandora, const pandora::ParticleFlowObject *const pPfo, const unsigned int sliceId)
Constructor.
void FillSlice(const pandora::ParticleFlowObject *const pPfo, const PfoToPfoListMap &pfoAssociationMap, pandora::PfoList &slice) const
Fill a slice iteratively using Pfo associations.
std::string m_cutMode
Choose a set of cuts using a keyword - "cautious" = remove as few neutrinos as possible "nominal" = o...
std::list< CRCandidate > CRCandidateList
double m_length
Straight line length of the linear fit.
float m_inTimeMaxX0
The maximum pfo x0 (determined from shifted vertex) to allow pfo to still be considered in time...
Header file for the master algorithm class.
float m_face_Yt
Top Y face.
void CheckIfInTime(const CRCandidateList &candidates, PfoToBoolMap &pfoToInTimeMap) const
Check if each candidate is "in time".
CosmicRayTaggingTool()
Default constructor.
pandora::CartesianVector m_endPoint2
Second fitted end point in 3D.
float m_inTimeMargin
The maximum distance outside of the physical detector volume that a Pfo may be to still be considered...
float m_face_Xa
Anode X face.
double m_curvature
Measure of the curvature of the track.
std::set< unsigned int > UIntSet
unsigned int m_sliceId
Slice ID.
void CalculateFitVariables(const ThreeDSlidingFitResult &slidingFitResult)
Calculate all variables which require a fit.
void GetPfoAssociations(const pandora::PfoList &parentCosmicRayPfos, PfoToPfoListMap &pfoAssociationMap) const
Get mapping between Pfos that are associated with it other by pointing.
pandora::StatusCode Initialize()
float m_minCosmicCosTheta
The minimum cos(theta) that a Pfo can have to be classified as a likely CR muon.
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...
Header file for the lar three dimensional sliding fit result class.
std::vector< pandora::PfoList > SliceList
std::unordered_map< int, bool > IntBoolMap
float m_marginZ
The minimum distance from a detector Z-face for a Pfo to be associated.
float m_marginY
The minimum distance from a detector Y-face for a Pfo to be associated.
float m_maxCosmicCurvature
The maximum curvature that a Pfo can have to be classified as a likely CR muon.
ThreeDSlidingFitResult class.
float m_face_Xc
Cathode X face.
float m_maxAssociationDist
The maximum distance from endpoint to point of closest approach, typically a multiple of LAr radiatio...
unsigned int m_minimumHits
The minimum number of hits for a Pfo to be considered.
float m_face_Zd
Downstream Z face.
std::unordered_map< const pandora::ParticleFlowObject *, SlidingFitPair > PfoToSlidingFitsMap
std::pair< const ThreeDSlidingFitResult, const ThreeDSlidingFitResult > SlidingFitPair
void GetCRCandidates(const pandora::PfoList &parentCosmicRayPfos, const PfoToSliceIdMap &pfoToSliceIdMap, CRCandidateList &candidates) const
Make a list of CRCandidates.
void GetNeutrinoSlices(const CRCandidateList &candidates, const PfoToBoolMap &pfoToInTimeMap, const PfoToBoolMap &pfoToIsContainedMap, UIntSet &neutrinoSliceSet) const
Get the slice indices which contain a likely neutrino Pfo.
pandora::CartesianVector m_endPoint1
First fitted end point in 3D.
const pandora::ParticleFlowObject *const m_pPfo
Address of the candidate Pfo.