Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
EventValidationBaseAlgorithm.h
Go to the documentation of this file.
1
8#ifndef LAR_EVENT_VALIDATION_BASE_ALGORITHM_H
9#define LAR_EVENT_VALIDATION_BASE_ALGORITHM_H 1
10
11#include "Pandora/Algorithm.h"
12
14
15#ifdef MONITORING
16#include "PandoraMonitoringApi.h"
17#endif
18
19#include <map>
20
21namespace lar_content
22{
23
28{
29protected:
34
39
40protected:
124
133 virtual void FillValidationInfo(const pandora::MCParticleList *const pMCParticleList, const pandora::CaloHitList *const pCaloHitList,
134 const pandora::PfoList *const pPfoList, ValidationInfo &validationInfo) const = 0;
135
144 virtual void ProcessOutput(
145 const ValidationInfo &validationInfo, const bool useInterpretedMatching, const bool printToScreen, const bool fillTree) const = 0;
146
153 void InterpretMatching(const ValidationInfo &validationInfo, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const;
154
165 bool GetStrongestPfoMatch(const ValidationInfo &validationInfo, const pandora::MCParticleVector &mcPrimaryVector,
166 pandora::PfoSet &usedPfos, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const;
167
176 void GetRemainingPfoMatches(const ValidationInfo &validationInfo, const pandora::MCParticleVector &mcPrimaryVector,
177 const pandora::PfoSet &usedPfos, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const;
178
188 bool IsGoodMatch(const pandora::CaloHitList &trueHits, const pandora::CaloHitList &recoHits, const pandora::CaloHitList &sharedHits) const;
189
191
195
196 std::string m_treeName;
197
198private:
200
206 void PrintAllMatches(const ValidationInfo &validationInfo) const;
207
213 void PrintInterpretedMatches(const ValidationInfo &validationInfo) const;
214
220 void WriteInterpretedMatches(const ValidationInfo &validationInfo) const;
221
222 std::string m_caloHitListName;
224 std::string m_pfoListName;
225
229
234
235 std::string m_fileName;
236};
237
238//------------------------------------------------------------------------------------------------------------------------------------------
239//------------------------------------------------------------------------------------------------------------------------------------------
240
245
246//------------------------------------------------------------------------------------------------------------------------------------------
247
252
253//------------------------------------------------------------------------------------------------------------------------------------------
254
259
260//------------------------------------------------------------------------------------------------------------------------------------------
261
266
267//------------------------------------------------------------------------------------------------------------------------------------------
268
273
274//------------------------------------------------------------------------------------------------------------------------------------------
275
277{
278 m_allMCParticleToHitsMap = allMCParticleToHitsMap;
279}
280
281//------------------------------------------------------------------------------------------------------------------------------------------
282
284{
285 m_targetMCParticleToHitsMap = targetMCParticleToHitsMap;
286}
287
288//------------------------------------------------------------------------------------------------------------------------------------------
289
291{
292 m_pfoToHitsMap = pfoToHitsMap;
293}
294
295//------------------------------------------------------------------------------------------------------------------------------------------
296
298{
299 m_mcToPfoHitSharingMap = mcToPfoHitSharingMap;
300}
301
302//------------------------------------------------------------------------------------------------------------------------------------------
303
305 const LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap)
306{
307 m_interpretedMCToPfoHitSharingMap = interpretedMCToPfoHitSharingMap;
308}
309
310//------------------------------------------------------------------------------------------------------------------------------------------
311//------------------------------------------------------------------------------------------------------------------------------------------
312
313inline void EventValidationBaseAlgorithm::PrintAllMatches(const ValidationInfo &validationInfo) const
314{
315 return this->ProcessOutput(validationInfo, false, true, false);
316}
317
318//------------------------------------------------------------------------------------------------------------------------------------------
319
321{
322 return this->ProcessOutput(validationInfo, true, true, false);
323}
324
325//------------------------------------------------------------------------------------------------------------------------------------------
326
328{
329 return this->ProcessOutput(validationInfo, true, false, true);
330}
331
332} // namespace lar_content
333
334#endif // LAR_EVENT_VALIDATION_BASE_ALGORITHM_H
Header file for the algorithm class.
Header file for the lar monte carlo particle helper helper class.
void SetInterpretedMCToPfoHitSharingMap(const LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap)
Set the interpreted mc to pfo hit sharing map.
void SetAllMCParticleToHitsMap(const LArMCParticleHelper::MCContributionMap &allMCParticleToHitsMap)
Set the all mc particle to hits map.
const LArMCParticleHelper::MCParticleToPfoHitSharingMap & GetMCToPfoHitSharingMap() const
Get the mc to pfo hit sharing map.
LArMCParticleHelper::PfoContributionMap m_pfoToHitsMap
The pfo to hits map.
const LArMCParticleHelper::MCParticleToPfoHitSharingMap & GetInterpretedMCToPfoHitSharingMap() const
Get the interpreted mc to pfo hit sharing map.
const LArMCParticleHelper::MCContributionMap & GetTargetMCParticleToHitsMap() const
Get the target mc particle to hits map.
const LArMCParticleHelper::MCContributionMap & GetAllMCParticleToHitsMap() const
Get the all mc particle to hits map.
LArMCParticleHelper::MCParticleToPfoHitSharingMap m_interpretedMCToPfoHitSharingMap
The interpreted mc to pfo hit sharing map.
LArMCParticleHelper::MCParticleToPfoHitSharingMap m_mcToPfoHitSharingMap
The mc to pfo hit sharing map.
LArMCParticleHelper::MCContributionMap m_allMCParticleToHitsMap
The all mc particle to hits map.
void SetPfoToHitsMap(const LArMCParticleHelper::PfoContributionMap &pfoToHitsMap)
Set the pfo to hits map.
void SetTargetMCParticleToHitsMap(const LArMCParticleHelper::MCContributionMap &targetMCParticleToHitsMap)
Set the target mc particle to hits map.
const LArMCParticleHelper::PfoContributionMap & GetPfoToHitsMap() const
Get the pfo to hits map.
LArMCParticleHelper::MCContributionMap m_targetMCParticleToHitsMap
The target mc particle to hits map.
void SetMCToPfoHitSharingMap(const LArMCParticleHelper::MCParticleToPfoHitSharingMap &mcToPfoHitSharingMap)
Set the mc to pfo hit sharing map.
unsigned int m_matchingMinSharedHits
The minimum number of shared hits used in matching scheme.
bool m_useSmallPrimaries
Whether to consider matches to mc primaries with fewer than m_matchingMinPrimaryHits.
void PrintInterpretedMatches(const ValidationInfo &validationInfo) const
Print interpreted matching information to screen.
void InterpretMatching(const ValidationInfo &validationInfo, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const
Apply an interpretative matching procedure to the comprehensive matches in the provided validation in...
virtual void ProcessOutput(const ValidationInfo &validationInfo, const bool useInterpretedMatching, const bool printToScreen, const bool fillTree) const =0
Print matching information in a provided validation info object, and write information to tree if con...
bool m_printAllToScreen
Whether to print all/raw matching details to screen.
bool GetStrongestPfoMatch(const ValidationInfo &validationInfo, const pandora::MCParticleVector &mcPrimaryVector, pandora::PfoSet &usedPfos, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const
Get the strongest pfo match (most matched hits) between an available mc primary and an available pfo.
void WriteInterpretedMatches(const ValidationInfo &validationInfo) const
Write interpreted matching information to tree.
virtual void FillValidationInfo(const pandora::MCParticleList *const pMCParticleList, const pandora::CaloHitList *const pCaloHitList, const pandora::PfoList *const pPfoList, ValidationInfo &validationInfo) const =0
Fill the validation info containers.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
bool m_writeToTree
Whether to write all/raw matching details to tree.
bool m_printMatchingToScreen
Whether to print matching output to screen.
float m_matchingMinCompleteness
The minimum particle completeness to declare a match.
LArMCParticleHelper::PrimaryParameters m_primaryParameters
The mc particle primary selection parameters.
void GetRemainingPfoMatches(const ValidationInfo &validationInfo, const pandora::MCParticleVector &mcPrimaryVector, const pandora::PfoSet &usedPfos, LArMCParticleHelper::MCParticleToPfoHitSharingMap &interpretedMCToPfoHitSharingMap) const
Get the best matches for any pfos left-over after the strong matching procedure.
void PrintAllMatches(const ValidationInfo &validationInfo) const
Print all/raw matching information to screen.
std::string m_caloHitListName
Name of input calo hit list.
float m_matchingMinPurity
The minimum particle purity to declare a match.
std::string m_mcParticleListName
Name of input MC particle list.
bool IsGoodMatch(const pandora::CaloHitList &trueHits, const pandora::CaloHitList &recoHits, const pandora::CaloHitList &sharedHits) const
Whether a provided mc primary and pfo are deemed to be a good match.
pandora::StatusCode Run()
Run the algorithm.
std::unordered_map< const pandora::ParticleFlowObject *, pandora::CaloHitList > PfoContributionMap
std::unordered_map< const pandora::MCParticle *, pandora::CaloHitList > MCContributionMap
std::map< const pandora::MCParticle *, PfoToSharedHitsVector > MCParticleToPfoHitSharingMap
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
Definition Algorithm.h:21
MANAGED_CONTAINER< const MCParticle * > MCParticleList
std::unordered_set< const ParticleFlowObject * > PfoSet
MANAGED_CONTAINER< const CaloHit * > CaloHitList
std::vector< const MCParticle * > MCParticleVector
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList