![]() |
LArSoft
v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
|
TestBeamCosmicRayTaggingTool class. More...
#include "TestBeamCosmicRayTaggingTool.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 | |
TestBeamCosmicRayTaggingTool () | |
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 each 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 | CheckIfOutOfTime (const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap) const |
Check if each candidate is "in time". More... | |
void | CheckIfTopToBottom (const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap) const |
Check if each candidate is "top to bottom". More... | |
void | CheckIfTopEntering (const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap) const |
Check if each candidate enters from the top of the detector. More... | |
void | CheckIfInVetoedTPC (const CRCandidateList &candidates, PfoToBoolMap &pfoToIsCosmicRayMap) const |
Check if each candidate has its highest value in one of the vetoed TPC volumes. More... | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Private Attributes | |
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... | |
bool | m_tagTopEntering |
Whether to tag all top entering particles as cosmic rays. More... | |
bool | m_tagTopToBottom |
Whether to tag all top-to-bottom particles as cosmic rays. More... | |
bool | m_tagOutOfTime |
Whether to tag all out-of-time particles as cosmic rays. More... | |
bool | m_tagInVetoedTPCs |
Whether to tag all particles with their highest position in vetoed TPCs as cosmic rays. More... | |
std::vector< unsigned int > | m_vetoedTPCs |
List of vetoed TPCs for tagging cosmic rays. 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... | |
TestBeamCosmicRayTaggingTool class.
Definition at line 24 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 76 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 175 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 140 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 88 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 111 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 180 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 181 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 179 of file TestBeamCosmicRayTaggingTool.h.
|
private |
Definition at line 174 of file TestBeamCosmicRayTaggingTool.h.
lar_content::TestBeamCosmicRayTaggingTool::TestBeamCosmicRayTaggingTool | ( | ) |
Default constructor.
Definition at line 23 of file TestBeamCosmicRayTaggingTool.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 207 of file TestBeamCosmicRayTaggingTool.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 has its highest value in one of the vetoed TPC volumes.
candidates | input list of candidates |
pfoToIsCosmicRayMap | output mapping between candidates Pfos and if they are in the vetoed TPCs |
Definition at line 454 of file TestBeamCosmicRayTaggingTool.cc.
References lar_content::LArPfoHelper::GetCaloHits(), lar_content::LArCaloHit::GetLArTPCVolumeId(), and m_vetoedTPCs.
Referenced by FindAmbiguousPfos().
|
private |
Check if each candidate is "in time".
candidates | input list of candidates |
pfoToIsCosmicRayMap | output mapping between candidates Pfos and if they are in time |
Definition at line 328 of file TestBeamCosmicRayTaggingTool.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 enters from the top of the detector.
candidates | input list of candidates |
pfoToIsCosmicRayMap | output mapping between candidates Pfos and if they are top entering |
Definition at line 439 of file TestBeamCosmicRayTaggingTool.cc.
References m_face_Yt, and m_marginY.
Referenced by FindAmbiguousPfos().
|
private |
Check if each candidate is "top to bottom".
candidates | input list of candidates |
pfoToIsCosmicRayMap | output mapping between candidates Pfos and if they are top to bottom |
Definition at line 421 of file TestBeamCosmicRayTaggingTool.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 296 of file TestBeamCosmicRayTaggingTool.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 53 of file TestBeamCosmicRayTaggingTool.cc.
References CheckIfInVetoedTPC(), CheckIfOutOfTime(), CheckIfTopEntering(), CheckIfTopToBottom(), GetCRCandidates(), GetPfoAssociations(), m_face_Xa, m_face_Xc, m_face_Yb, m_face_Yt, m_face_Zd, m_face_Zu, m_tagInVetoedTPCs, m_tagOutOfTime, m_tagTopEntering, m_tagTopToBottom, and SliceEvent().
|
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 314 of file TestBeamCosmicRayTaggingTool.cc.
References lar_content::LArPfoHelper::IsFinalState().
Referenced by FindAmbiguousPfos().
|
private |
Get mapping between Pfos that are associated with each other by pointing.
parentCosmicRayPfos | input list of Pfos |
pfoAssociationsMap | to receive the output mapping between associated Pfos |
Definition at line 144 of file TestBeamCosmicRayTaggingTool.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 128 of file TestBeamCosmicRayTaggingTool.cc.
References lar_content::LArPfoHelper::GetThreeDClusterList(), and m_minimumHits.
Referenced by GetPfoAssociations().
StatusCode lar_content::TestBeamCosmicRayTaggingTool::Initialize | ( | ) |
Definition at line 46 of file TestBeamCosmicRayTaggingTool.cc.
|
private |
Definition at line 551 of file TestBeamCosmicRayTaggingTool.cc.
References m_angularUncertainty, m_inTimeMargin, m_inTimeMaxX0, m_marginY, m_maxAssociationDist, m_minimumHits, m_positionalUncertainty, m_tagInVetoedTPCs, m_tagOutOfTime, m_tagTopEntering, m_tagTopToBottom, and m_vetoedTPCs.
|
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 256 of file TestBeamCosmicRayTaggingTool.cc.
References FillSlice().
Referenced by FindAmbiguousPfos().
|
private |
The uncertainty in degrees for the angle of a Pfo.
Definition at line 183 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), and ReadSettings().
|
private |
Anode X face.
Definition at line 200 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfOutOfTime(), and FindAmbiguousPfos().
|
private |
Cathode X face.
Definition at line 201 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfOutOfTime(), and FindAmbiguousPfos().
|
private |
Bottom Y face.
Definition at line 202 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfTopToBottom(), and FindAmbiguousPfos().
|
private |
Top Y face.
Definition at line 203 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), CheckIfTopEntering(), CheckIfTopToBottom(), and FindAmbiguousPfos().
|
private |
Downstream Z face.
Definition at line 205 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), and FindAmbiguousPfos().
|
private |
Upstream Z face.
Definition at line 204 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), 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 189 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckIfOutOfTime(), and ReadSettings().
|
private |
The maximum pfo x0 (determined from shifted vertex) to allow pfo to still be considered in time.
Definition at line 190 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckIfOutOfTime(), and ReadSettings().
|
private |
The minimum distance from a detector Y-face for a Pfo to be associated.
Definition at line 191 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckIfTopEntering(), CheckIfTopToBottom(), and ReadSettings().
|
private |
The maximum distance from endpoint to point of closest approach, typically a multiple of LAr radiation length.
Definition at line 185 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), and ReadSettings().
|
private |
The minimum number of hits for a Pfo to be considered.
Definition at line 187 of file TestBeamCosmicRayTaggingTool.h.
Referenced by GetValid3DCluster(), and ReadSettings().
|
private |
The uncertainty in cm for the position of Pfo endpoint in 3D.
Definition at line 184 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckAssociation(), and ReadSettings().
|
private |
Whether to tag all particles with their highest position in vetoed TPCs as cosmic rays.
Definition at line 197 of file TestBeamCosmicRayTaggingTool.h.
Referenced by FindAmbiguousPfos(), and ReadSettings().
|
private |
Whether to tag all out-of-time particles as cosmic rays.
Definition at line 195 of file TestBeamCosmicRayTaggingTool.h.
Referenced by FindAmbiguousPfos(), and ReadSettings().
|
private |
Whether to tag all top entering particles as cosmic rays.
Definition at line 193 of file TestBeamCosmicRayTaggingTool.h.
Referenced by FindAmbiguousPfos(), and ReadSettings().
|
private |
Whether to tag all top-to-bottom particles as cosmic rays.
Definition at line 194 of file TestBeamCosmicRayTaggingTool.h.
Referenced by FindAmbiguousPfos(), and ReadSettings().
|
private |
List of vetoed TPCs for tagging cosmic rays.
Definition at line 198 of file TestBeamCosmicRayTaggingTool.h.
Referenced by CheckIfInVetoedTPC(), and ReadSettings().