#ifndef TPIDManager_hxx_seen #define TPIDManager_hxx_seen #include #include #include #include #include #include #include typedef std::map ProbMap; typedef std::map LikeMap; typedef std::map PriorMap; typedef std::map SortedProbMap; class IPIDManager { public: virtual ~IPIDManager() {}; /// Get a pointer to the singleton instance . static IPIDManager& Get(void); // compute probabilities const ProbMap& GetProbabilityMap(const COMET::IHandle pid, const PriorMap& priors); const SortedProbMap& GetSortedProbabilityMap(const COMET::IHandle pid, const PriorMap& priors); const ProbMap& GetProbabilityMap(const COMET::IHandle pid); const SortedProbMap& GetSortedProbabilityMap(const COMET::IHandle pid); double GetProbability(const COMET::IHandle pid, COMET::IReconPID::ParticleId id); const LikeMap& GetLikelihoodMap(const COMET::IHandle pid); bool MergePIDInfo(COMET::IHandle object1, COMET::IHandle object2, COMET::IHandle PID3); void GetPIDWeightsFromIDatums(COMET::IHandle pid, double w[]); void SavePIDWeightsInIDatums(double w[], COMET::IHandle pid); void CopyPIDWeightsFromIDatums( COMET::IHandle object1, COMET::IHandle object2); void DumpPIDWeightsFromIDatums(COMET::IHandle PID); void AddPIDHypothesis(COMET::IReconPID::ParticleId hyp); std::string GetPIDHypothesisForIDatum(COMET::IReconPID::ParticleId hyp); void CopyPIDInfo(COMET::IHandle PID1, COMET::IHandle PID2); void DumpProbabilities(const COMET::IHandle pid); void DumpProbabilities(const COMET::IHandle pid, const PriorMap& priors); void AddPIDDetector(COMET::IReconBase::StateBits det); bool CheckPIDDetector(COMET::IHandle object); void SetVerbosity(int verb){_verb=verb;} int GetVerbosity() const {return _verb;} private: IPIDManager(); IPIDManager(const IPIDManager& man); IPIDManager& operator=(const IPIDManager& man); /// The static pointer to the singleton instance. static IPIDManager* fTPIDManager; // the likelihood map for the last processed PID LikeMap fLikes; // the probability map for the last processed PID ProbMap fProbs; // the probability map for the last processed PID using priors ProbMap fPriorProbs; // the sorted probability map for the last processed PID SortedProbMap fSortedProbs; // the sorted probability map for the last processed PID using priors SortedProbMap fSortedPriorProbs; // the last processed PID COMET::IReconPID* fLastPID; // is the last probability already computed bool fComputedProbs; // vector of detectors used in combined PID std::vector< COMET::IReconBase::StateBits> fPidDetectors; int _verb; // vector of particle hypotheses used in combined PID std::vector< COMET::IReconPID::ParticleId> fPidHypotheses; }; namespace COMET{ IPIDManager& pman(); }; #endif