File indexing completed on 2025-12-10 10:18:06
0001 #pragma once
0002
0003 class TParticlePDG;
0004
0005 #include "Calibration.h"
0006 #include "Digitization.h"
0007
0008 namespace IRT2 {
0009
0010 struct ReconstructionFactoryPlots {
0011 ReconstructionFactoryPlots();
0012 ~ReconstructionFactoryPlots() {};
0013
0014
0015 TH1D *hnpe() const { return m_hnpe; };
0016
0017
0018 TH1D *hnhits() const { return m_hnhits; };
0019 TH1D *hccdftr() const { return m_hccdftr; };
0020 TH1D *hccdfev() const { return m_hccdfev; };
0021 TH1D *hdtph() const { return m_hdtph; };
0022 TH1D *hmatch() const { return m_hmatch; };
0023
0024 private:
0025 TH1D *m_hnpe, *m_hnhits, *m_hccdftr, *m_hccdfev, *m_hdtph, *m_hmatch;
0026 };
0027
0028 class ReconstructionFactory : public Digitization, public Calibration {
0029 public:
0030 ReconstructionFactory(const char *dfname = 0, const char *cfname = 0, const char *dname = 0);
0031 ReconstructionFactory(CherenkovDetectorCollection *geometry, CherenkovDetector *cdet, CherenkovEvent *event);
0032 virtual ~ReconstructionFactory() {};
0033
0034 void IgnoreTimingInChiSquare( void ) { m_UseTimingInChiSquare = false; };
0035 void IgnorePoissonTermInChiSquare( void ) { m_UsePoissonTermInChiSquare = false; };
0036 void SetSingleHitCCDFcut(double value) { m_SingleHitCCDFcut = value; };
0037 void RemoveAmbiguousHits( void ) { m_ResolveHitOwnership = false; };
0038
0039 int AddHypothesis(int pdg);
0040 int AddHypothesis(const char *pdg);
0041
0042
0043 void IgnoreMcTruthPhotonDirectionSeed( void ) { m_UseMcTruthPhotonDirectionSeed = false; };
0044
0045 CherenkovEvent *GetEvent(unsigned ev, bool calibration = false);
0046
0047 void SetQuietMode( void ) { m_VerboseMode = false; };
0048
0049
0050 void ProcessHits(ChargedParticle *mcparticle, std::vector<DigitizedHit> &hits, bool use_seed = false);
0051
0052 CherenkovRadiator *UseInRingImaging(const char *name) {
0053 if (!name) return 0;
0054
0055 auto *radiator = GetMyRICH()->GetRadiator(name);
0056 if (!radiator) return 0;
0057
0058 radiator->UseInRingImaging();
0059 return radiator;
0060 };
0061
0062 int VerifyEventStructure( void );
0063
0064 void InitializePlots( void ) { m_Plots = new ReconstructionFactoryPlots(); };
0065 ReconstructionFactoryPlots *Plots( void ) const { return m_Plots; };
0066 void DisplayStandardPlots(const char *cname, int wtopx, unsigned wtopy, unsigned wx, unsigned wy) const;
0067
0068 void SetHitCountCutoff(unsigned value) { m_HitCountCutoff = value; };
0069
0070 private:
0071 bool m_VerboseMode;
0072
0073
0074 bool m_UseTimingInChiSquare;
0075
0076
0077
0078 double m_SingleHitCCDFcut;
0079
0080
0081
0082 bool m_ResolveHitOwnership;
0083
0084
0085 bool m_UsePoissonTermInChiSquare;
0086
0087 bool m_UseMcTruthPhotonDirectionSeed;
0088
0089 std::vector<TParticlePDG*> m_Hypotheses;
0090
0091 ReconstructionFactoryPlots *m_Plots;
0092
0093 unsigned m_HitCountCutoff;
0094
0095 bool BeVerbose( void ) const { return m_VerboseMode; };
0096 void LaunchRingFinder(bool calibration);
0097 };
0098
0099 }