Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
Validation.h
Go to the documentation of this file.
1
8#ifndef NEW_LAR_VALIDATION_H
9#define NEW_LAR_VALIDATION_H 1
10
11#include <limits>
12
13typedef std::vector<int> IntVector;
14typedef std::vector<float> FloatVector;
15
41
42//------------------------------------------------------------------------------------------------------------------------------------------
43
48{
49public:
54
62 SimpleThreeVector(const float x, const float y, const float z);
63
64 float m_x;
65 float m_y;
66 float m_z;
67};
68
69typedef std::vector<SimpleThreeVector> SimpleThreeVectorList;
70
78
86
87//------------------------------------------------------------------------------------------------------------------------------------------
88
128
129typedef std::vector<SimpleMCPrimary> SimpleMCPrimaryList;
130
131//------------------------------------------------------------------------------------------------------------------------------------------
132
172
173typedef std::vector<SimpleMCTarget> SimpleMCTargetList;
174
175//------------------------------------------------------------------------------------------------------------------------------------------
176
194
195typedef std::vector<SimpleMCEvent> SimpleMCEventList;
196
197//------------------------------------------------------------------------------------------------------------------------------------------
198
218
226std::string ToString(const ExpectedPrimary expectedPrimary);
227
228//------------------------------------------------------------------------------------------------------------------------------------------
229
234{
401
409std::string ToString(const InteractionType interactionType);
410
411//------------------------------------------------------------------------------------------------------------------------------------------
412
417{
418public:
423
424 unsigned int m_nTotal;
425 unsigned int m_nMatch0;
426 unsigned int m_nMatch1;
427 unsigned int m_nMatch2;
428 unsigned int m_nMatch3Plus;
429 unsigned int m_correctId;
430};
431
432typedef std::map<ExpectedPrimary, CountingDetails> CountingMap;
433typedef std::map<InteractionType, CountingMap> InteractionCountingMap;
434
435//------------------------------------------------------------------------------------------------------------------------------------------
436
457
458typedef std::map<ExpectedPrimary, PrimaryResult> PrimaryResultMap;
459
460//------------------------------------------------------------------------------------------------------------------------------------------
461
480
481typedef std::vector<TargetResult> TargetResultList; // ATTN Not terribly efficient, but that's not the main aim here
482typedef std::map<InteractionType, TargetResultList> InteractionTargetResultMap;
483
484//------------------------------------------------------------------------------------------------------------------------------------------
485
486class TH1F;
487
504
505typedef std::map<InteractionType, TargetHistogramCollection> InteractionTargetHistogramMap;
506
507//------------------------------------------------------------------------------------------------------------------------------------------
508
527
528typedef std::map<ExpectedPrimary, PrimaryHistogramCollection> PrimaryHistogramMap;
529typedef std::map<InteractionType, PrimaryHistogramMap> InteractionPrimaryHistogramMap;
530
531//------------------------------------------------------------------------------------------------------------------------------------------
532
539void Validation(const std::string &inputFiles, const Parameters &parameters = Parameters());
540
551int ReadNextEvent(TChain *const pTChain, const int iEntry, SimpleMCEvent &simpleMCEvent, const Parameters &parameters);
552
559void DisplaySimpleMCEventMatches(const SimpleMCEvent &simpleMCEvent, const Parameters &parameters);
560
569void CountPfoMatches(const SimpleMCEvent &simpleMCEvent, const Parameters &parameters, InteractionCountingMap &interactionCountingMap,
570 InteractionTargetResultMap &interactionTargetResultMap);
571
580bool PassFiducialCut(const SimpleMCTarget &simpleMCTarget, const Parameters &parameters);
581
589bool PassUbooneFiducialCut(const SimpleMCTarget &simpleMCTarget);
590
598bool PassSBNDFiducialCut(const SimpleMCTarget &simpleMCTarget);
599
609ExpectedPrimary GetExpectedPrimary(const SimpleMCPrimary &simpleMCPrimary, const SimpleMCPrimaryList &simpleMCPrimaryList);
610
619bool IsGoodParticleIdMatch(const SimpleMCPrimary &simpleMCPrimary, const int bestMatchPfoPdgCode);
620
627void DisplayInteractionCountingMap(const InteractionCountingMap &interactionCountingMap, const Parameters &parameters);
628
635void AnalyseInteractionTargetResultMap(const InteractionTargetResultMap &interactionTargetResultMap, const Parameters &parameters);
636
644void FillTargetHistogramCollection(const std::string &histPrefix, const TargetResult &targetResult, TargetHistogramCollection &targetHistogramCollection);
645
654void FillPrimaryHistogramCollection(const std::string &histPrefix, const Parameters &parameters, const PrimaryResult &primaryResult, PrimaryHistogramCollection &primaryHistogramCollection);
655
661void ProcessHistogramCollections(const InteractionPrimaryHistogramMap &interactionPrimaryHistogramMap);
662
663//------------------------------------------------------------------------------------------------------------------------------------------
664//------------------------------------------------------------------------------------------------------------------------------------------
665
667 m_displayMatchedEvents(true),
668 m_skipEvents(0),
669 m_nEventsToProcess(std::numeric_limits<int>::max()),
670 m_applyUbooneFiducialCut(false),
671 m_applySBNDFiducialCut(false),
672 m_correctTrackShowerId(false),
673 m_vertexXCorrection(0.495694f),
674 m_histogramOutput(false),
675 m_testBeamMode(false),
676 m_triggeredBeamOnly(true)
677{
678}
679
680//------------------------------------------------------------------------------------------------------------------------------------------
681//------------------------------------------------------------------------------------------------------------------------------------------
682
684 m_x(-std::numeric_limits<float>::max()),
685 m_y(-std::numeric_limits<float>::max()),
686 m_z(-std::numeric_limits<float>::max())
687{
688}
689
690//------------------------------------------------------------------------------------------------------------------------------------------
691
692SimpleThreeVector::SimpleThreeVector(const float x, const float y, const float z) :
693 m_x(x),
694 m_y(y),
695 m_z(z)
696{
697}
698
699//------------------------------------------------------------------------------------------------------------------------------------------
700
702{
703 return SimpleThreeVector(lhs.m_x - rhs.m_x, lhs.m_y - rhs.m_y, lhs.m_z - rhs.m_z);
704}
705
706//------------------------------------------------------------------------------------------------------------------------------------------
707
709{
710 return SimpleThreeVector(lhs.m_x + rhs.m_x, lhs.m_y + rhs.m_y, lhs.m_z + rhs.m_z);
711}
712
713//------------------------------------------------------------------------------------------------------------------------------------------
714//------------------------------------------------------------------------------------------------------------------------------------------
715
717 m_primaryId(-1),
718 m_pdgCode(0),
719 m_energy(0.f),
720 m_momentum(0.f, 0.f, 0.f),
721 m_vertex(-1.f, -1.f, -1.f),
722 m_endpoint(-1.f, -1.f, -1.f),
723 m_nMCHitsTotal(0),
724 m_nMCHitsU(0),
725 m_nMCHitsV(0),
726 m_nMCHitsW(0),
727 m_nPrimaryMatchedPfos(0),
728 m_nPrimaryMatchedNuPfos(0),
729 m_nPrimaryMatchedCRPfos(0),
730 m_bestMatchPfoId(-1),
731 m_bestMatchPfoPdgCode(0),
732 m_bestMatchPfoIsRecoNu(0),
733 m_bestMatchPfoRecoNuId(-1),
734 m_bestMatchPfoIsTestBeam(0),
735 m_bestMatchPfoNHitsTotal(0),
736 m_bestMatchPfoNHitsU(0),
737 m_bestMatchPfoNHitsV(0),
738 m_bestMatchPfoNHitsW(0),
739 m_bestMatchPfoNSharedHitsTotal(0),
740 m_bestMatchPfoNSharedHitsU(0),
741 m_bestMatchPfoNSharedHitsV(0),
742 m_bestMatchPfoNSharedHitsW(0)
743{
744}
745
746//------------------------------------------------------------------------------------------------------------------------------------------
747//------------------------------------------------------------------------------------------------------------------------------------------
748
750 m_interactionType(OTHER_INTERACTION),
751 m_mcNuanceCode(0),
752 m_isNeutrino(false),
753 m_isBeamParticle(false),
754 m_isCosmicRay(false),
755 m_targetVertex(0.f, 0.f, 0.f),
756 m_recoVertex(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max()),
757 m_isCorrectNu(false),
758 m_isCorrectTB(false),
759 m_isCorrectCR(false),
760 m_isFakeNu(false),
761 m_isFakeCR(false),
762 m_isSplitNu(false),
763 m_isSplitCR(false),
764 m_isLost(false),
765 m_nTargetMatches(0),
766 m_nTargetNuMatches(0),
767 m_nTargetCRMatches(0),
768 m_nTargetGoodNuMatches(0),
769 m_nTargetNuSplits(0),
770 m_nTargetNuLosses(0),
771 m_nTargetPrimaries(0)
772{
773}
774
775//------------------------------------------------------------------------------------------------------------------------------------------
776//------------------------------------------------------------------------------------------------------------------------------------------
777
779 m_fileIdentifier(-1),
780 m_eventNumber(0),
781 m_nMCTargets(0)
782{
783}
784
785//------------------------------------------------------------------------------------------------------------------------------------------
786//------------------------------------------------------------------------------------------------------------------------------------------
787
789 m_nTotal(0),
790 m_nMatch0(0),
791 m_nMatch1(0),
792 m_nMatch2(0),
793 m_nMatch3Plus(0),
794 m_correctId(0)
795{
796}
797
798//------------------------------------------------------------------------------------------------------------------------------------------
799//------------------------------------------------------------------------------------------------------------------------------------------
800
802 m_nPfoMatches(0),
803 m_nMCHitsTotal(0),
804 m_nBestMatchSharedHitsTotal(0),
805 m_nBestMatchRecoHitsTotal(0),
806 m_bestMatchCompleteness(0.f),
807 m_bestMatchPurity(0.f),
808 m_isCorrectParticleId(false),
809 m_trueMomentum(-1.f)
810{
811}
812
813//------------------------------------------------------------------------------------------------------------------------------------------
814//------------------------------------------------------------------------------------------------------------------------------------------
815
817 m_fileIdentifier(-1),
818 m_eventNumber(-1),
819 m_isCorrect(false),
820 m_hasRecoVertex(false),
821 m_vertexOffset(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max())
822{
823}
824
825//------------------------------------------------------------------------------------------------------------------------------------------
826//------------------------------------------------------------------------------------------------------------------------------------------
827
829 m_hHitsAll(nullptr),
830 m_hHitsEfficiency(nullptr),
831 m_hMomentumAll(nullptr),
832 m_hMomentumEfficiency(nullptr),
833 m_hCompleteness(nullptr),
834 m_hPurity(nullptr)
835{
836}
837
838//------------------------------------------------------------------------------------------------------------------------------------------
839//------------------------------------------------------------------------------------------------------------------------------------------
840
842 m_hVtxDeltaX(nullptr),
843 m_hVtxDeltaY(nullptr),
844 m_hVtxDeltaZ(nullptr),
845 m_hVtxDeltaR(nullptr)
846{
847}
848
849#endif // #ifndef NEW_LAR_VALIDATION_H
bool PassSBNDFiducialCut(const SimpleMCTarget &simpleMCTarget)
Whether a simple mc event passes sbnd fiducial cut, applied to target vertices.
Definition Validation.C:415
std::map< InteractionType, PrimaryHistogramMap > InteractionPrimaryHistogramMap
Definition Validation.h:529
std::map< ExpectedPrimary, CountingDetails > CountingMap
Definition Validation.h:432
bool IsGoodParticleIdMatch(const SimpleMCPrimary &simpleMCPrimary, const int bestMatchPfoPdgCode)
Whether a provided mc primary and best matched pfo are deemed to have a good particle id match.
Definition Validation.C:469
SimpleThreeVector operator-(const SimpleThreeVector &lhs, const SimpleThreeVector &rhs)
Simple three vector subtraction operator.
Definition Validation.h:701
std::vector< SimpleMCEvent > SimpleMCEventList
Definition Validation.h:195
std::map< ExpectedPrimary, PrimaryHistogramCollection > PrimaryHistogramMap
Definition Validation.h:528
SimpleThreeVector operator+(const SimpleThreeVector &lhs, const SimpleThreeVector &rhs)
Simple three vector addition operator.
Definition Validation.h:708
std::vector< SimpleThreeVector > SimpleThreeVectorList
Definition Validation.h:69
std::map< InteractionType, CountingMap > InteractionCountingMap
Definition Validation.h:433
std::map< ExpectedPrimary, PrimaryResult > PrimaryResultMap
Definition Validation.h:458
void DisplayInteractionCountingMap(const InteractionCountingMap &interactionCountingMap, const Parameters &parameters)
Print details to screen for a provided interaction type to counting map.
Definition Validation.C:484
std::map< InteractionType, TargetResultList > InteractionTargetResultMap
Definition Validation.h:482
void CountPfoMatches(const SimpleMCEvent &simpleMCEvent, const Parameters &parameters, InteractionCountingMap &interactionCountingMap, InteractionTargetResultMap &interactionTargetResultMap)
CountPfoMatches Relies on fact that primary list is sorted by number of true good hits.
Definition Validation.C:311
std::vector< TargetResult > TargetResultList
Definition Validation.h:481
int ReadNextEvent(TChain *const pTChain, const int iEntry, SimpleMCEvent &simpleMCEvent, const Parameters &parameters)
Read the next event from the chain.
Definition Validation.C:55
std::vector< float > FloatVector
Definition Validation.h:14
ExpectedPrimary GetExpectedPrimary(const SimpleMCPrimary &simpleMCPrimary, const SimpleMCPrimaryList &simpleMCPrimaryList)
Work out which of the primary particles (expected for a given interaction types) corresponds to the p...
Definition Validation.C:433
bool PassUbooneFiducialCut(const SimpleMCTarget &simpleMCTarget)
Whether a simple mc event passes uboone fiducial cut, applied to target vertices.
Definition Validation.C:398
bool PassFiducialCut(const SimpleMCTarget &simpleMCTarget, const Parameters &parameters)
Whether a simple mc event passes the relevant fiducial cut, applied to target vertices.
Definition Validation.C:382
void DisplaySimpleMCEventMatches(const SimpleMCEvent &simpleMCEvent, const Parameters &parameters)
Print matching details to screen for a simple mc event.
Definition Validation.C:212
InteractionType
InteractionType enum.
Definition Validation.h:234
@ NCRES_P_P_P_P_PIMINUS
Definition Validation.h:315
@ CCRES_E_P_P_P_P_P_PIZERO
Definition Validation.h:299
@ NCRES_P_PIPLUS
Definition Validation.h:306
@ CCRES_MU_P_P_P_PIPLUS
Definition Validation.h:261
@ CCRES_MU_P
Definition Validation.h:253
@ CCDIS_MU_P_P_P_P
Definition Validation.h:333
@ CCRES_E_PIPLUS
Definition Validation.h:282
@ CCDIS_MU_P_PIZERO
Definition Validation.h:348
@ COSMIC_RAY_P
Definition Validation.h:385
@ NCDIS_P_P
Definition Validation.h:354
@ NCQEL_P_P
Definition Validation.h:248
@ CCDIS_MU_PIZERO
Definition Validation.h:347
@ CCRES_MU_P_P_P
Definition Validation.h:255
@ NCDIS_PIZERO
Definition Validation.h:376
@ BEAM_PARTICLE_E
Definition Validation.h:391
@ CCDIS_MU_PHOTON
Definition Validation.h:341
@ NCRES_P_PIMINUS
Definition Validation.h:312
@ CCQEL_E_P_P_P
Definition Validation.h:244
@ CCRES_E_P_P
Definition Validation.h:278
@ CCRES_E_PIZERO
Definition Validation.h:294
@ BEAM_PARTICLE_KAON_MINUS
Definition Validation.h:396
@ NCDIS_P_P_P_P_PIZERO
Definition Validation.h:380
@ NCQEL_P
Definition Validation.h:247
@ CCQEL_MU_P
Definition Validation.h:236
@ CCRES_MU_P_PIPLUS
Definition Validation.h:259
@ CCQEL_MU_P_P_P
Definition Validation.h:238
@ NCQEL_P_P_P_P_P
Definition Validation.h:251
@ CCDIS_MU_P_P_P_PIPLUS
Definition Validation.h:338
@ CCRES_E_P_P_P_P_P_PIPLUS
Definition Validation.h:287
@ CCRES_MU_P_P_P_PHOTON
Definition Validation.h:267
@ CCRES_MU_P_P_P_P_PIPLUS
Definition Validation.h:262
@ CCDIS_MU_P_P_P_PIZERO
Definition Validation.h:350
@ NCDIS_PIPLUS
Definition Validation.h:358
@ CCDIS_MU
Definition Validation.h:329
@ NCRES_P_P_P_P_PIPLUS
Definition Validation.h:309
@ CCRES_E_P_P_PIZERO
Definition Validation.h:296
@ CCRES_MU_P_PHOTON
Definition Validation.h:265
@ NCDIS_P_P_PIPLUS
Definition Validation.h:360
@ CCDIS_MU_P_P_PIZERO
Definition Validation.h:349
@ CCDIS_MU_P_P_P_P_PIPLUS
Definition Validation.h:339
@ NCDIS_P_P_P_P
Definition Validation.h:356
@ CCDIS_MU_P_PIPLUS
Definition Validation.h:336
@ CCDIS_MU_P_P_PHOTON
Definition Validation.h:343
@ BEAM_PARTICLE_PI_MINUS
Definition Validation.h:394
@ CCRES_MU_P_P_P_PIZERO
Definition Validation.h:273
@ CCRES_E_P_PIPLUS
Definition Validation.h:283
@ NCDIS_P_PHOTON
Definition Validation.h:371
@ NCRES_P_P_P_P_P_PHOTON
Definition Validation.h:322
@ BEAM_PARTICLE_MU
Definition Validation.h:389
@ NCRES_P_P_P
Definition Validation.h:302
@ CCRES_E_P_P_P_PIZERO
Definition Validation.h:297
@ CCRES_E_P_PIZERO
Definition Validation.h:295
@ NCDIS_P_P_P_PIMINUS
Definition Validation.h:367
@ COSMIC_RAY_PHOTON
Definition Validation.h:387
@ BEAM_PARTICLE_KAON_PLUS
Definition Validation.h:395
@ CCRES_MU_P_P_P_P_P_PHOTON
Definition Validation.h:269
@ CCDIS_MU_P
Definition Validation.h:330
@ CCRES_MU_PHOTON
Definition Validation.h:264
@ BEAM_PARTICLE_P
Definition Validation.h:390
@ CCDIS_MU_P_P_P_P_P_PIPLUS
Definition Validation.h:340
@ NCDIS_PHOTON
Definition Validation.h:370
@ CCQEL_MU_P_P_P_P_P
Definition Validation.h:240
@ CCQEL_E_P_P_P_P_P
Definition Validation.h:246
@ NCDIS_P_P_P_P_PIPLUS
Definition Validation.h:362
@ NCDIS_P
Definition Validation.h:353
@ CCRES_MU_PIZERO
Definition Validation.h:270
@ NCRES_P
Definition Validation.h:300
@ NCDIS_P_P_P_P_P_PIZERO
Definition Validation.h:381
@ CCDIS_MU_P_P_P
Definition Validation.h:332
@ CCRES_MU_P_P
Definition Validation.h:254
@ CCDIS_MU_P_PHOTON
Definition Validation.h:342
@ NCDIS_P_P_P_P_P_PHOTON
Definition Validation.h:375
@ CCRES_MU_P_P_P_P_P_PIPLUS
Definition Validation.h:263
@ CCDIS_MU_P_P_P_P_PHOTON
Definition Validation.h:345
@ NCRES_P_P_PIMINUS
Definition Validation.h:313
@ CCRES_E_P_P_P_P_P_PHOTON
Definition Validation.h:293
@ COSMIC_RAY_E
Definition Validation.h:386
@ NCQEL_P_P_P_P
Definition Validation.h:250
@ CCRES_MU_PIPLUS
Definition Validation.h:258
@ CCRES_MU_P_P_PIZERO
Definition Validation.h:272
@ CCRES_E_P_P_PIPLUS
Definition Validation.h:284
@ NCDIS_P_P_P_P_PIMINUS
Definition Validation.h:368
@ NCRES_P_P_PIPLUS
Definition Validation.h:307
@ NCRES_P_P_P_PIMINUS
Definition Validation.h:314
@ CCRES_MU_P_P_P_P
Definition Validation.h:256
@ NCRES_PIMINUS
Definition Validation.h:311
@ NCRES_P_P_P_P
Definition Validation.h:303
@ NCRES_PIZERO
Definition Validation.h:323
@ NCRES_P_P_P_P_P
Definition Validation.h:304
@ NCDIS_P_P_P_P_P
Definition Validation.h:357
@ CCRES_MU_P_P_P_P_P_PIZERO
Definition Validation.h:275
@ CCRES_MU
Definition Validation.h:252
@ CCRES_E_P_P_P
Definition Validation.h:279
@ NCRES_P_P
Definition Validation.h:301
@ CCQEL_MU_P_P_P_P
Definition Validation.h:239
@ CCDIS_MU_P_P_P_PHOTON
Definition Validation.h:344
@ CCRES_E_P_P_P_P_PHOTON
Definition Validation.h:292
@ NCDIS_P_P_P_P_PHOTON
Definition Validation.h:374
@ NCRES_P_P_P_P_PHOTON
Definition Validation.h:321
@ NCRES_PIPLUS
Definition Validation.h:305
@ NCDIS_P_P_P_PHOTON
Definition Validation.h:373
@ CCRES_E_P_P_P_PIPLUS
Definition Validation.h:285
@ CCRES_MU_P_P_P_P_PHOTON
Definition Validation.h:268
@ NCDIS_P_PIPLUS
Definition Validation.h:359
@ NCCOH
Definition Validation.h:383
@ NCRES_P_P_P_P_P_PIPLUS
Definition Validation.h:310
@ NCRES_P_PHOTON
Definition Validation.h:318
@ NCRES_P_P_PHOTON
Definition Validation.h:319
@ CCDIS_MU_P_P
Definition Validation.h:331
@ CCQEL_MU
Definition Validation.h:235
@ NCDIS_P_PIMINUS
Definition Validation.h:365
@ NCDIS_P_P_P_P_P_PIMINUS
Definition Validation.h:369
@ CCDIS_MU_P_P_PIPLUS
Definition Validation.h:337
@ CCDIS_MU_P_P_P_P_P_PIZERO
Definition Validation.h:352
@ NCDIS_P_P_PHOTON
Definition Validation.h:372
@ NCRES_P_P_P_PHOTON
Definition Validation.h:320
@ NCRES_P_P_P_PIZERO
Definition Validation.h:326
@ CCRES_MU_P_PIZERO
Definition Validation.h:271
@ BEAM_PARTICLE_OTHER
Definition Validation.h:397
@ NCRES_P_P_P_P_P_PIZERO
Definition Validation.h:328
@ CCRES_E_P_P_P_P_PIPLUS
Definition Validation.h:286
@ CCRES_MU_P_P_PIPLUS
Definition Validation.h:260
@ CCQEL_E
Definition Validation.h:241
@ NCDIS_P_P_PIMINUS
Definition Validation.h:366
@ NCDIS_P_P_P_PIPLUS
Definition Validation.h:361
@ BEAM_PARTICLE_PHOTON
Definition Validation.h:392
@ NCRES_PHOTON
Definition Validation.h:317
@ CCRES_MU_P_P_P_P_P
Definition Validation.h:257
@ CCQEL_E_P
Definition Validation.h:242
@ NCDIS_P_P_P_PIZERO
Definition Validation.h:379
@ CCDIS_MU_P_P_P_P_P
Definition Validation.h:334
@ CCRES_E_P_PHOTON
Definition Validation.h:289
@ CCQEL_E_P_P_P_P
Definition Validation.h:245
@ CCRES_MU_P_P_P_P_PIZERO
Definition Validation.h:274
@ CCDIS_MU_P_P_P_P_PIZERO
Definition Validation.h:351
@ NCRES_P_P_P_P_P_PIMINUS
Definition Validation.h:316
@ NCRES_P_PIZERO
Definition Validation.h:324
@ CCQEL_MU_P_P
Definition Validation.h:237
@ NCRES_P_P_P_PIPLUS
Definition Validation.h:308
@ CCDIS_MU_PIPLUS
Definition Validation.h:335
@ CCDIS_MU_P_P_P_P_P_PHOTON
Definition Validation.h:346
@ NCQEL_P_P_P
Definition Validation.h:249
@ CCRES_E_P_P_P_P_PIZERO
Definition Validation.h:298
@ ALL_INTERACTIONS
Definition Validation.h:399
@ OTHER_INTERACTION
Definition Validation.h:398
@ BEAM_PARTICLE_PI_PLUS
Definition Validation.h:393
@ NCRES_P_P_P_P_PIZERO
Definition Validation.h:327
@ CCRES_E_P_P_PHOTON
Definition Validation.h:290
@ CCRES_E_P_P_P_PHOTON
Definition Validation.h:291
@ NCDIS_P_P_PIZERO
Definition Validation.h:378
@ CCQEL_E_P_P
Definition Validation.h:243
@ NCDIS_P_P_P_P_P_PIPLUS
Definition Validation.h:363
@ NCDIS_P_P_P
Definition Validation.h:355
@ CCRES_MU_P_P_PHOTON
Definition Validation.h:266
@ CCRES_E_P_P_P_P_P
Definition Validation.h:281
@ CCRES_E
Definition Validation.h:276
@ COSMIC_RAY_OTHER
Definition Validation.h:388
@ NCDIS_P_PIZERO
Definition Validation.h:377
@ CCCOH
Definition Validation.h:382
@ CCRES_E_P_P_P_P
Definition Validation.h:280
@ NCRES_P_P_PIZERO
Definition Validation.h:325
@ COSMIC_RAY_MU
Definition Validation.h:384
@ NCDIS_PIMINUS
Definition Validation.h:364
@ CCRES_E_PHOTON
Definition Validation.h:288
@ CCRES_E_P
Definition Validation.h:277
std::vector< int > IntVector
Definition Validation.h:13
ExpectedPrimary
ExpectedPrimary enum.
Definition Validation.h:203
@ NEUTRON
Definition Validation.h:213
@ PHOTON2
Definition Validation.h:215
@ PROTON4
Definition Validation.h:209
@ PROTON5
Definition Validation.h:210
@ PROTON3
Definition Validation.h:208
@ PHOTON1
Definition Validation.h:214
@ PROTON1
Definition Validation.h:206
@ ELECTRON
Definition Validation.h:205
@ PIMINUS
Definition Validation.h:212
@ PIPLUS
Definition Validation.h:211
@ PROTON2
Definition Validation.h:207
@ OTHER_PRIMARY
Definition Validation.h:216
@ MUON
Definition Validation.h:204
void FillTargetHistogramCollection(const std::string &histPrefix, const TargetResult &targetResult, TargetHistogramCollection &targetHistogramCollection)
Fill histograms in the provided target histogram collection, using information in the provided target...
Definition Validation.C:613
std::vector< SimpleMCPrimary > SimpleMCPrimaryList
Definition Validation.h:129
void ProcessHistogramCollections(const InteractionPrimaryHistogramMap &interactionPrimaryHistogramMap)
Process histograms stored in the provided map e.g. calculating final efficiencies,...
Definition Validation.C:729
std::map< InteractionType, TargetHistogramCollection > InteractionTargetHistogramMap
Definition Validation.h:505
void FillPrimaryHistogramCollection(const std::string &histPrefix, const Parameters &parameters, const PrimaryResult &primaryResult, PrimaryHistogramCollection &primaryHistogramCollection)
Fill histograms in the provided histogram collection, using information in the provided primary resul...
Definition Validation.C:655
std::vector< SimpleMCTarget > SimpleMCTargetList
Definition Validation.h:173
void Validation(const std::string &inputFiles, const Parameters &parameters=Parameters())
Validation - Main entry point for analysis.
Definition Validation.C:18
void AnalyseInteractionTargetResultMap(const InteractionTargetResultMap &interactionTargetResultMap, const Parameters &parameters)
Opportunity to fill histograms, perform post-processing of information collected in main loop over nt...
Definition Validation.C:533
std::string ToString(const ExpectedPrimary expectedPrimary)
Get a string representation of an interaction type.
Definition Validation.C:769
CountingDetails class.
Definition Validation.h:417
unsigned int m_nTotal
The total number of occurences.
Definition Validation.h:424
unsigned int m_correctId
The number of times the mc primary particle id was correct.
Definition Validation.h:429
unsigned int m_nMatch0
The number of times the mc primary has 0 pfo matches.
Definition Validation.h:425
unsigned int m_nMatch2
The number of times the mc primary has 2 pfo matches.
Definition Validation.h:427
unsigned int m_nMatch3Plus
The number of times the mc primary has 3 or more pfo matches.
Definition Validation.h:428
CountingDetails()
Default constructor.
Definition Validation.h:788
unsigned int m_nMatch1
The number of times the mc primary has 1 pfo matches.
Definition Validation.h:426
Parameters class.
Definition Validation.h:20
bool m_applyUbooneFiducialCut
Whether to apply uboone fiducial volume cut to true neutrino vertex position.
Definition Validation.h:30
bool m_triggeredBeamOnly
Whether to only consider triggered beam particles.
Definition Validation.h:36
std::string m_eventFileName
File name to which to write list of correct events.
Definition Validation.h:39
std::string m_histPrefix
Histogram name prefix.
Definition Validation.h:37
float m_vertexXCorrection
The vertex x correction, added to reported mc neutrino endpoint x value, in cm.
Definition Validation.h:33
std::string m_mapFileName
File name to which to write output ascii tables, etc.
Definition Validation.h:38
int m_nEventsToProcess
The number of events to process.
Definition Validation.h:29
bool m_displayMatchedEvents
Whether to display matching results for individual events.
Definition Validation.h:27
bool m_testBeamMode
Whether running in test beam mode.
Definition Validation.h:35
int m_skipEvents
The number of events to skip.
Definition Validation.h:28
bool m_histogramOutput
Whether to produce output histograms.
Definition Validation.h:34
bool m_correctTrackShowerId
Whether to demand that pfos are correctly flagged as tracks or showers.
Definition Validation.h:32
bool m_applySBNDFiducialCut
Whether to apply sbnd fiducial volume cut to true neutrino vertex position.
Definition Validation.h:31
Parameters()
Default constructor.
Definition Validation.h:666
PrimaryHistogramCollection class.
Definition Validation.h:513
TH1F * m_hMomentumAll
The number of primaries vs momentum histogram.
Definition Validation.h:522
TH1F * m_hHitsEfficiency
The primary efficiency vs number of hits histogram.
Definition Validation.h:521
PrimaryHistogramCollection()
Default constructor.
Definition Validation.h:828
TH1F * m_hPurity
The primary (best match) purity histogram.
Definition Validation.h:525
TH1F * m_hMomentumEfficiency
The primary efficiency vs momentum histogram.
Definition Validation.h:523
TH1F * m_hHitsAll
The number of primaries vs number of hits histogram.
Definition Validation.h:520
TH1F * m_hCompleteness
The primary (best match) completeness histogram.
Definition Validation.h:524
PrimaryResult class.
Definition Validation.h:441
PrimaryResult()
Default constructor.
Definition Validation.h:801
bool m_isCorrectParticleId
Whether the best matched pfo has the correct particle id.
Definition Validation.h:454
unsigned int m_nPfoMatches
The total number of pfo matches for a given primary.
Definition Validation.h:448
unsigned int m_nMCHitsTotal
The number of hits in the mc primary.
Definition Validation.h:449
unsigned int m_nBestMatchRecoHitsTotal
The number of hits in the best matched pfo.
Definition Validation.h:451
float m_bestMatchPurity
The purity of the best matched pfo.
Definition Validation.h:453
float m_trueMomentum
The true momentum of the mc primary.
Definition Validation.h:455
float m_bestMatchCompleteness
The completeness of the best matched pfo.
Definition Validation.h:452
unsigned int m_nBestMatchSharedHitsTotal
The number of hits shared by the mc primary and the best matched pfo.
Definition Validation.h:450
SimpleMCEvent class.
Definition Validation.h:181
int m_eventNumber
The event number.
Definition Validation.h:189
int m_fileIdentifier
The file identifier.
Definition Validation.h:188
SimpleMCTargetList m_mcTargetList
The list of mc targets.
Definition Validation.h:192
int m_nMCTargets
The number of mc targets.
Definition Validation.h:191
SimpleMCEvent()
Constructor.
Definition Validation.h:778
SimpleMCPrimary class.
Definition Validation.h:93
SimpleThreeVector m_momentum
The momentum.
Definition Validation.h:103
int m_nMCHitsV
The number of v mc hits.
Definition Validation.h:108
int m_pdgCode
The pdg code.
Definition Validation.h:101
SimpleMCPrimary()
Constructor.
Definition Validation.h:716
int m_bestMatchPfoIsTestBeam
Whether best match pfo is reconstructed as a test beam particle.
Definition Validation.h:118
int m_bestMatchPfoNHitsW
The best match pfo number of w pfo hits.
Definition Validation.h:122
int m_primaryId
The identifier.
Definition Validation.h:100
int m_bestMatchPfoNSharedHitsW
The best match pfo number of w matched hits.
Definition Validation.h:126
int m_bestMatchPfoIsRecoNu
Whether best match pfo is reconstructed as part of a neutrino hierarchy.
Definition Validation.h:116
int m_bestMatchPfoRecoNuId
The identifier of the associated reco neutrino (if part of a neutrino hierarchy)
Definition Validation.h:117
int m_nPrimaryMatchedPfos
The number of matched pfos.
Definition Validation.h:111
int m_bestMatchPfoNSharedHitsU
The best match pfo number of u matched hits.
Definition Validation.h:124
int m_bestMatchPfoNHitsTotal
The best match pfo total number of pfo hits.
Definition Validation.h:119
int m_nMCHitsTotal
The total number of mc hits.
Definition Validation.h:106
SimpleThreeVector m_vertex
The vertex.
Definition Validation.h:104
int m_bestMatchPfoNHitsU
The best match pfo number of u pfo hits.
Definition Validation.h:120
int m_nMCHitsU
The number of u mc hits.
Definition Validation.h:107
int m_bestMatchPfoNHitsV
The best match pfo number of v pfo hits.
Definition Validation.h:121
SimpleThreeVector m_endpoint
The endpoint.
Definition Validation.h:105
int m_bestMatchPfoId
The best match pfo identifier.
Definition Validation.h:114
int m_bestMatchPfoNSharedHitsV
The best match pfo number of v matched hits.
Definition Validation.h:125
int m_nPrimaryMatchedCRPfos
The number of matched cr pfos.
Definition Validation.h:113
float m_energy
The energy.
Definition Validation.h:102
int m_nMCHitsW
The number of w mc hits.
Definition Validation.h:109
int m_bestMatchPfoPdgCode
The best match pfo pdg code.
Definition Validation.h:115
int m_nPrimaryMatchedNuPfos
The number of matched nu pfos.
Definition Validation.h:112
int m_bestMatchPfoNSharedHitsTotal
The best match pfo total number of matched hits.
Definition Validation.h:123
SimpleMCTarget class.
Definition Validation.h:137
int m_isCosmicRay
Whether the target is a cosmic ray.
Definition Validation.h:148
int m_isFakeCR
Whether the target was reconstructed as a fake cosmic ray.
Definition Validation.h:157
SimpleMCTarget()
Constructor.
Definition Validation.h:749
int m_isNeutrino
Whether the target is a neutrino.
Definition Validation.h:146
int m_nTargetNuMatches
The number of neutrino pfo matches to the target.
Definition Validation.h:163
int m_isLost
Whether the target was lost (not reconstructed)
Definition Validation.h:160
int m_nTargetGoodNuMatches
The number of good neutrino pfo matches to the target (all from same parent neutrino)
Definition Validation.h:165
int m_isFakeNu
Whether the target was reconstructed as a fake neutrino.
Definition Validation.h:156
SimpleMCPrimaryList m_mcPrimaryList
The list of mc primaries.
Definition Validation.h:170
int m_nTargetNuLosses
The number of neutrino primaries with no matches.
Definition Validation.h:167
int m_isCorrectNu
Whether the target was correctly reconstructed as a neutrino.
Definition Validation.h:153
int m_interactionType
The target interaction type.
Definition Validation.h:144
int m_nTargetPrimaries
The number of target mc primaries.
Definition Validation.h:169
int m_isCorrectTB
Whether the target was correctly reconstructed as a beam particle.
Definition Validation.h:154
int m_nTargetMatches
The number of pfo matches to the target.
Definition Validation.h:162
int m_nTargetCRMatches
The number of cosmic ray pfo matches to the target.
Definition Validation.h:164
SimpleThreeVector m_targetVertex
The target vertex position.
Definition Validation.h:150
int m_nTargetNuSplits
The number of split neutrino pfo matches to the target (from different parent neutrinos)
Definition Validation.h:166
int m_isSplitNu
Whether the target was reconstructed as a split neutrino.
Definition Validation.h:158
int m_isCorrectCR
Whether the target was correctly reconstructed as a cosmic ray.
Definition Validation.h:155
SimpleThreeVector m_recoVertex
The reco vertex position, if available.
Definition Validation.h:151
int m_mcNuanceCode
The target nuance code.
Definition Validation.h:145
int m_isBeamParticle
Whether the target is a beam particle.
Definition Validation.h:147
int m_isSplitCR
Whether the target was reconstructed as a split cosmic ray.
Definition Validation.h:159
SimpleThreeVector class.
Definition Validation.h:48
float m_x
The x value.
Definition Validation.h:64
float m_y
The y value.
Definition Validation.h:65
float m_z
The z value.
Definition Validation.h:66
SimpleThreeVector()
Default constructor.
Definition Validation.h:683
TargetHistogramCollection class.
Definition Validation.h:492
TargetHistogramCollection()
Default constructor.
Definition Validation.h:841
TH1F * m_hVtxDeltaY
The vtx delta y histogram.
Definition Validation.h:500
TH1F * m_hVtxDeltaX
The vtx delta x histogram.
Definition Validation.h:499
TH1F * m_hVtxDeltaR
The vtx delta r histogram.
Definition Validation.h:502
TH1F * m_hVtxDeltaZ
The vtx delta z histogram.
Definition Validation.h:501
TargetResult class.
Definition Validation.h:466
bool m_hasRecoVertex
Whether a reco vertex is matched to the target.
Definition Validation.h:476
TargetResult()
Default constructor.
Definition Validation.h:816
bool m_isCorrect
Whether the target is reconstructed correctly.
Definition Validation.h:475
PrimaryResultMap m_primaryResultMap
The primary result map.
Definition Validation.h:478
int m_fileIdentifier
The file identifier.
Definition Validation.h:473
int m_eventNumber
The event number.
Definition Validation.h:474
SimpleThreeVector m_vertexOffset
The offset between the reco and true target vertices.
Definition Validation.h:477