2020#include " CCDB/BasicCCDBManager.h"
2121#include " DataFormatsTOF/CalibLHCphaseTOF.h"
2222#include " DataFormatsTOF/CalibTimeSlewingParamTOF.h"
23+ #include " TOFBase/Geo.h"
24+ #include " DataFormatsTOF/Diagnostic.h"
2325
2426namespace o2
2527{
@@ -35,9 +37,10 @@ class CalibTOFapi
3537 using CcdbApi = o2::ccdb::CcdbApi;
3638
3739 public:
38- CalibTOFapi () = default ;
40+ void resetDia ();
41+ CalibTOFapi ();
3942 CalibTOFapi (const std::string url);
40- CalibTOFapi (long timestamp, o2::dataformats::CalibLHCphaseTOF* phase, o2::dataformats::CalibTimeSlewingParamTOF* slew) : mTimeStamp (timestamp), mLHCphase (phase), mSlewParam (slew) {}
43+ CalibTOFapi (long timestamp, o2::dataformats::CalibLHCphaseTOF* phase, o2::dataformats::CalibTimeSlewingParamTOF* slew) : mTimeStamp (timestamp), mLHCphase (phase), mSlewParam (slew) { CalibTOFapi (); }
4144 ~CalibTOFapi () = default ;
4245 void setTimeStamp (long t)
4346 {
@@ -50,6 +53,7 @@ class CalibTOFapi
5053 }
5154 void readLHCphase ();
5255 void readTimeSlewingParam ();
56+ void readDiagnosticFrequencies ();
5357 void writeLHCphase (LhcPhase* phase, std::map<std::string, std::string> metadataLHCphase, uint64_t minTimeSTamp, uint64_t maxTimeStamp);
5458 void writeTimeSlewingParam (SlewParam* param, std::map<std::string, std::string> metadataChannelCalib, uint64_t minTimeSTamp, uint64_t maxTimeStamp = 0 );
5559 float getTimeCalibration (int ich, float tot);
@@ -61,10 +65,27 @@ class CalibTOFapi
6165 SlewParam& getSlewParamObj () { return *mSlewParam ; }
6266 LhcPhase* getLhcPhase () { return mLHCphase ; }
6367
68+ int getNoisyThreshold () const { return mNoisyThreshold ; }
69+ void setNoisyThreshold (int val) { mNoisyThreshold = val; }
70+ float getEmptyTOFProb () const { return mEmptyTOF ; }
71+ const float * getEmptyCratesProb () const { return mEmptyCrateProb ; }
72+ const std::vector<std::pair<int , float >>& getNoisyProb () const { return mNoisy ; }
73+ const std::vector<std::pair<int , float >>& getTRMerrorProb () const { return mTRMerrorProb ; }
74+ const std::vector<int >& getTRMmask () const { return mTRMmask ; }
75+
6476 private:
6577 long mTimeStamp ; // /< timeStamp for queries
6678 LhcPhase* mLHCphase = nullptr ; // /< object for LHC phase
6779 SlewParam* mSlewParam = nullptr ; // /< object for timeslewing (containing info also for offset and problematic)
80+ Diagnostic* mDiaFreq = nullptr ; // /< object for Diagnostic Frequency
81+
82+ // info from diagnostic
83+ int mNoisyThreshold = 1 ; // /< threshold to be noisy
84+ float mEmptyTOF = 0 ; // /< probability to have TOF fully empty
85+ float mEmptyCrateProb [Geo::kNCrate ]; // /< probability to have an empty crate in the current readout window
86+ std::vector<std::pair<int , float >> mNoisy ; // /< probTRMerror
87+ std::vector<std::pair<int , float >> mTRMerrorProb ; // /< probTRMerror
88+ std::vector<int > mTRMmask ; // /< mask error for TRM
6889
6990 ClassDefNV (CalibTOFapi, 1 );
7091};
0 commit comments