Project
Loading...
Searching...
No Matches
TOFDiagnosticCalibrator.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13#include "Framework/Logger.h"
16#include "CCDB/CcdbApi.h"
17
18namespace o2
19{
20namespace tof
21{
22
24
25//----------------------------------------------------------
27{
28 mccdbInfoVector.clear();
29 mDiagnosticVector.clear();
30}
31//----------------------------------------------------------
33{
34 const Diagnostic* diag = slot.getContainer();
35
36 if (diag->getFrequencyROW() < mMinROwin) {
37 return false;
38 }
39
40 return true;
41}
42//----------------------------------------------------------
44{
45 Diagnostic* diag = slot.getContainer();
46 LOG(info) << "Finalizing slot";
47 diag->print();
48 std::map<std::string, std::string> md;
49 if (mRunNumber > -1) {
50 md["runNumber"] = std::to_string(mRunNumber);
51 }
52
53 auto clName = o2::utils::MemFileHelper::getClassName(*diag);
54 auto flName = o2::ccdb::CcdbApi::generateFileName(clName);
55
56 uint64_t startingMS = slot.getStartTimeMS() - 10000; // start 10 seconds before
57 uint64_t stoppingMS = slot.getEndTimeMS() + 600000; // stop 10 minutes after
58 mccdbInfoVector.emplace_back("TOF/Calib/Diagnostic", clName, flName, md, startingMS, stoppingMS);
59 mDiagnosticVector.emplace_back(*diag);
60}
61
62//----------------------------------------------------------
63Slot& TOFDiagnosticCalibrator::emplaceNewSlot(bool front, TFType tstart, TFType tend)
64{
65 auto& cont = getSlots();
66 auto& slot = front ? cont.emplace_front(tstart, tend) : cont.emplace_back(tstart, tend);
67 slot.setContainer(std::make_unique<Diagnostic>());
68 return slot;
69}
70
71} // end namespace tof
72} // end namespace o2
Utils and constants for calibration and related workflows.
long getStartTimeMS() const
Definition TimeSlot.h:50
long getEndTimeMS() const
Definition TimeSlot.h:51
const Container * getContainer() const
Definition TimeSlot.h:53
static std::string generateFileName(const std::string &inp)
Definition CcdbApi.cxx:824
Diagnostic class for TOF.
Definition Diagnostic.h:32
uint32_t getFrequencyROW() const
Definition Diagnostic.h:38
void print(bool longFormat=false) const
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) final
bool hasEnoughData(const Slot &slot) const final
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52
static std::string getClassName(const T &obj)
get the class name of the object
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"