LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
CosmicRayTaggingTool class. More...
#include "CosmicRayTaggingTool.h"
Classes | |
class | CRCandidate |
Class to encapsulate the logic required determine if a Pfo should or shouldn't be tagged as a cosmic ray. More... | |
Public Member Functions | |
CosmicRayTaggingTool () | |
Default constructor. More... | |
pandora::StatusCode | Initialize () |
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) More... | |
Private Types | |
typedef std::list< CRCandidate > | CRCandidateList |
typedef std::unordered_map< const pandora::ParticleFlowObject *, pandora::PfoList > | PfoToPfoListMap |
typedef std::unordered_map< const pandora::ParticleFlowObject *, unsigned int > | PfoToSliceIdMap |
typedef std::unordered_map< const pandora::ParticleFlowObject *, bool > | PfoToBoolMap |
typedef std::set< unsigned int > | UIntSet |
typedef std::unordered_map< int, bool > | IntBoolMap |
typedef std::pair< const ThreeDSlidingFitResult, const ThreeDSlidingFitResult > | SlidingFitPair |
typedef std::unordered_map< const pandora::ParticleFlowObject *, SlidingFitPair > | PfoToSlidingFitsMap |
typedef std::vector< pandora::PfoList > | SliceList |
Private Member Functions | |
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. More... | |
void | GetPfoAssociations (const pandora::PfoList &parentCosmicRayPfos, PfoToPfoListMap &pfoAssociationMap) const |
Get mapping between Pfos that are associated with it other by pointing. More... | |
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. More... | |
void | SliceEvent (const pandora::PfoList &parentCosmicRayPfos, const PfoToPfoListMap &pfoAssociationMap, PfoToSliceIdMap &pfoToSliceIdMap) const |
Break the event up into slices of associated Pfos. More... | |
void | FillSlice (const pandora::ParticleFlowObject *const pPfo, const PfoToPfoListMap &pfoAssociationMap, pandora::PfoList &slice) const |
Fill a slice iteratively using Pfo associations. More... | |
void | GetCRCandidates (const pandora::PfoList &parentCosmicRayPfos, const PfoToSliceIdMap &pfoToSliceIdMap, CRCandidateList &candidates) const |
Make a list of CRCandidates. More... | |
void | CheckIfInTime (const CRCandidateList &candidates, PfoToBoolMap &pfoToInTimeMap) const |
Check if each candidate is "in time". More... | |
void | CheckIfContained (const CRCandidateList &candidates, PfoToBoolMap &pfoToIsContainedMap) const |
Check if each candidate is "contained" (contained = no associations to Y or Z detector faces, but the Pfo could still enter or exit by and X-face) More... | |
void | CheckIfTopToBottom (const CRCandidateList &candidates, PfoToBoolMap &pfoToIsTopToBottomMap) const |
Check if each candidate is "top to bottom". More... | |
void | GetNeutrinoSlices (const CRCandidateList &candidates, const PfoToBoolMap &pfoToInTimeMap, const PfoToBoolMap &pfoToIsContainedMap, UIntSet &neutrinoSliceSet) const |
Get the slice indices which contain a likely neutrino Pfo. More... | |
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. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Private Attributes | |
std::string | m_cutMode |
Choose a set of cuts using a keyword - "cautious" = remove as few neutrinos as possible "nominal" = optimised to maximise CR removal whilst preserving neutrinos "aggressive" = remove CR muons and allow more neutrinos to be tagged. More... | |
float | m_angularUncertainty |
The uncertainty in degrees for the angle of a Pfo. More... | |
float | m_positionalUncertainty |
The uncertainty in cm for the position of Pfo endpoint in 3D. More... | |
float | m_maxAssociationDist |
The maximum distance from endpoint to point of closest approach, typically a multiple of LAr radiation length. More... | |
unsigned int | m_minimumHits |
The minimum number of hits for a Pfo to be considered. More... | |
float | m_inTimeMargin |
The maximum distance outside of the physical detector volume that a Pfo may be to still be considered in time. More... | |
float | m_inTimeMaxX0 |
The maximum pfo x0 (determined from shifted vertex) to allow pfo to still be considered in time. More... | |
float | m_marginY |
The minimum distance from a detector Y-face for a Pfo to be associated. More... | |
float | m_marginZ |
The minimum distance from a detector Z-face for a Pfo to be associated. More... | |
float | m_maxNeutrinoCosTheta |
The maximum cos(theta) that a Pfo can have to be classified as a likely neutrino. More... | |
float | m_minCosmicCosTheta |
The minimum cos(theta) that a Pfo can have to be classified as a likely CR muon. More... | |
float | m_maxCosmicCurvature |
The maximum curvature that a Pfo can have to be classified as a likely CR muon. More... | |
float | m_face_Xa |
Anode X face. More... | |
float | m_face_Xc |
Cathode X face. More... | |
float | m_face_Yb |
Bottom Y face. More... | |
float | m_face_Yt |
Top Y face. More... | |
float | m_face_Zu |
Upstream Z face. More... | |
float | m_face_Zd |
Downstream Z face. More... | |
CosmicRayTaggingTool class.
Definition at line 24 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 69 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 160 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 133 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 81 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 104 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 188 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 189 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 187 of file CosmicRayTaggingTool.h.
|
private |
Definition at line 159 of file CosmicRayTaggingTool.h.
lar_content::CosmicRayTaggingTool::CosmicRayTaggingTool | ( | ) |
Default constructor.
Definition at line 23 of file CosmicRayTaggingTool.cc.
|
private |
Check whethe two Pfo endpoints are associated by distance of closest approach.
endPoint1 | position vector of an endpoint of Pfo 1 |
endDir1 | direction vector of an endpoint of Pfo 1 |
endPoint2 | position vector of an endpoint of Pfo 2 |
endDir2 | direction vector of an endpoint of Pfos |
Definition at line 220 of file CosmicRayTaggingTool.cc.
References d, f, m_angularUncertainty, m_face_Xa, m_face_Xc, m_face_Yb, m_face_Yt, m_face_Zd, m_face_Zu, m_maxAssociationDist, m_positionalUncertainty, and n.
Referenced by GetPfoAssociations().
|
private |
Check if each candidate is "contained" (contained = no associations to Y or Z detector faces, but the Pfo could still enter or exit by and X-face)
candidates | input list of candidates |
pfoToIsContainedMap | output mapping between candidates Pfos and if they are contained |
Definition at line 430 of file CosmicRayTaggingTool.cc.
References m_face_Yb, m_face_Yt, m_face_Zd, m_face_Zu, m_marginY, and m_marginZ.
Referenced by FindAmbiguousPfos().
|
private |
Check if each candidate is "in time".
candidates | input list of candidates |
pfoToInTimeMap | output mapping between candidates Pfos and if they are in time |
Definition at line 339 of file CosmicRayTaggingTool.cc.
References lar_content::LArPfoHelper::GetCaloHits(), lar_content::LArCaloHit::GetLArTPCVolumeId(), lar_content::LArPfoHelper::GetVertex(), m_face_Xa, m_face_Xc, m_inTimeMargin, and m_inTimeMaxX0.
Referenced by FindAmbiguousPfos().
|
private |
Check if each candidate is "top to bottom".
candidates | input list of candidates |
pfoToIsTopToBottomMap | output mapping between candidates Pfos and if they are top to bottom |
Definition at line 455 of file CosmicRayTaggingTool.cc.
References m_face_Yb, m_face_Yt, and m_marginY.
Referenced by FindAmbiguousPfos().
|
private |
Fill a slice iteratively using Pfo associations.
pPfo | Pfo to add to the slice |
pfoAssociationMap | mapping between Pfos and other associated Pfos |
slice | the slice to add Pfos to |
Definition at line 308 of file CosmicRayTaggingTool.cc.
Referenced by SliceEvent().
|
virtual |
Find the list of ambiguous pfos (could represent cosmic-ray muons or neutrinos)
parentCosmicRayPfos | the list of parent cosmic-ray pfos |
ambiguousPfos | to receive the list of ambiguous pfos |
pAlgorithm | the address of this master algorithm |
Implements lar_content::CosmicRayTaggingBaseTool.
Definition at line 74 of file CosmicRayTaggingTool.cc.
References CheckIfContained(), CheckIfInTime(), CheckIfTopToBottom(), GetCRCandidates(), GetNeutrinoSlices(), GetPfoAssociations(), m_face_Xa, m_face_Xc, m_face_Yb, m_face_Yt, m_face_Zd, m_face_Zu, SliceEvent(), and TagCRMuons().
|
private |
Make a list of CRCandidates.
parentCosmicRayPfos | input list of Pfos |
pfoToSliceIdMap | input mapping between Pfos and their slice id |
candidates | to receive the output list of CRCandidates |
Definition at line 326 of file CosmicRayTaggingTool.cc.
References lar_content::LArPfoHelper::IsFinalState().
Referenced by FindAmbiguousPfos().
|
private |
Get the slice indices which contain a likely neutrino Pfo.
candidates | input list of candidates |
pfoToInTimeMap | input map between Pfo and if in time |
pfoToIsContainedMap | input map between Pfo and if contained |
neutrinoSliceSet | output set of slice indices containing a likely neutrino Pfo |
Definition at line 473 of file CosmicRayTaggingTool.cc.
References m_maxNeutrinoCosTheta.
Referenced by FindAmbiguousPfos().
|
private |
Get mapping between Pfos that are associated with it other by pointing.
parentCosmicRayPfos | input list of Pfos |
pfoAssociationsMap | to receive the output mapping between associated Pfos |
Definition at line 157 of file CosmicRayTaggingTool.cc.
References util::begin(), CheckAssociation(), lar_content::ThreeDSlidingFitResult::GetGlobalMaxLayerDirection(), lar_content::ThreeDSlidingFitResult::GetGlobalMinLayerDirection(), and GetValid3DCluster().
Referenced by FindAmbiguousPfos().
|
private |
Get the 3D calo hit cluster associated with a given Pfo, and check if it has sufficient hits.
pPfo | input Pfo |
pCluster3D | to receive the address of the 3D cluster |
Definition at line 141 of file CosmicRayTaggingTool.cc.
References lar_content::LArPfoHelper::GetThreeDClusterList(), and m_minimumHits.
Referenced by GetPfoAssociations().
StatusCode lar_content::CosmicRayTaggingTool::Initialize | ( | ) |
Definition at line 47 of file CosmicRayTaggingTool.cc.
References m_cutMode, m_maxCosmicCurvature, and m_minCosmicCosTheta.
|
private |
Definition at line 581 of file CosmicRayTaggingTool.cc.
References m_angularUncertainty, m_cutMode, m_inTimeMargin, m_inTimeMaxX0, m_marginY, m_marginZ, m_maxAssociationDist, m_maxCosmicCurvature, m_maxNeutrinoCosTheta, m_minCosmicCosTheta, m_minimumHits, and m_positionalUncertainty.
|
private |
Break the event up into slices of associated Pfos.
parentCosmicRayPfos | input list of Pfos |
pfoAssociationMap | mapping between Pfos and other associated Pfos |
pfoToSliceIdMap | to receive the mapping between Pfos and their slice ID |
Definition at line 269 of file CosmicRayTaggingTool.cc.
References FillSlice().
Referenced by FindAmbiguousPfos().
|
private |
Tag Pfos which are likely to be a CR muon.
candidates | input list of candidates |
pfoToInTimeMap | input map between Pfo and if in time |
pfoToIsTopToBottomMap | input mapping between candidate Pfos and if they are top to bottom |
neutrinoSliceSet | input set of slice indices containing a likely neutrino Pfo |
pfoToIsLikelyCRMuonMap | to receive the output mapping between Pfos and a boolean deciding if they are likely a CR muon |
Definition at line 502 of file CosmicRayTaggingTool.cc.
References m_maxCosmicCurvature, and m_minCosmicCosTheta.
Referenced by FindAmbiguousPfos().
|
private |
The uncertainty in degrees for the angle of a Pfo.
Definition at line 198 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), and ReadSettings().
|
private |
Choose a set of cuts using a keyword - "cautious" = remove as few neutrinos as possible "nominal" = optimised to maximise CR removal whilst preserving neutrinos "aggressive" = remove CR muons and allow more neutrinos to be tagged.
Definition at line 196 of file CosmicRayTaggingTool.h.
Referenced by Initialize(), and ReadSettings().
|
private |
Anode X face.
Definition at line 212 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfInTime(), and FindAmbiguousPfos().
|
private |
Cathode X face.
Definition at line 213 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfInTime(), and FindAmbiguousPfos().
|
private |
Bottom Y face.
Definition at line 214 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfContained(), CheckIfTopToBottom(), and FindAmbiguousPfos().
|
private |
Top Y face.
Definition at line 215 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfContained(), CheckIfTopToBottom(), and FindAmbiguousPfos().
|
private |
Downstream Z face.
Definition at line 217 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfContained(), and FindAmbiguousPfos().
|
private |
Upstream Z face.
Definition at line 216 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfContained(), and FindAmbiguousPfos().
|
private |
The maximum distance outside of the physical detector volume that a Pfo may be to still be considered in time.
Definition at line 204 of file CosmicRayTaggingTool.h.
Referenced by CheckIfInTime(), and ReadSettings().
|
private |
The maximum pfo x0 (determined from shifted vertex) to allow pfo to still be considered in time.
Definition at line 205 of file CosmicRayTaggingTool.h.
Referenced by CheckIfInTime(), and ReadSettings().
|
private |
The minimum distance from a detector Y-face for a Pfo to be associated.
Definition at line 206 of file CosmicRayTaggingTool.h.
Referenced by CheckIfContained(), CheckIfTopToBottom(), and ReadSettings().
|
private |
The minimum distance from a detector Z-face for a Pfo to be associated.
Definition at line 207 of file CosmicRayTaggingTool.h.
Referenced by CheckIfContained(), and ReadSettings().
|
private |
The maximum distance from endpoint to point of closest approach, typically a multiple of LAr radiation length.
Definition at line 200 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), and ReadSettings().
|
private |
The maximum curvature that a Pfo can have to be classified as a likely CR muon.
Definition at line 210 of file CosmicRayTaggingTool.h.
Referenced by Initialize(), ReadSettings(), and TagCRMuons().
|
private |
The maximum cos(theta) that a Pfo can have to be classified as a likely neutrino.
Definition at line 208 of file CosmicRayTaggingTool.h.
Referenced by GetNeutrinoSlices(), and ReadSettings().
|
private |
The minimum cos(theta) that a Pfo can have to be classified as a likely CR muon.
Definition at line 209 of file CosmicRayTaggingTool.h.
Referenced by Initialize(), ReadSettings(), and TagCRMuons().
|
private |
The minimum number of hits for a Pfo to be considered.
Definition at line 202 of file CosmicRayTaggingTool.h.
Referenced by GetValid3DCluster(), and ReadSettings().
|
private |
The uncertainty in cm for the position of Pfo endpoint in 3D.
Definition at line 199 of file CosmicRayTaggingTool.h.
Referenced by CheckAssociation(), and ReadSettings().