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
32//----------------------------------------------------------
34{
35 Diagnostic* diag = slot.getContainer();
36 LOG(info) << "Finalizing slot";
37 diag->print();
38 std::map<std::string, std::string> md;
39 if (mRunNumber > -1) {
40 md["runNumber"] = std::to_string(mRunNumber);
41 }
42
43 auto clName = o2::utils::MemFileHelper::getClassName(*diag);
44 auto flName = o2::ccdb::CcdbApi::generateFileName(clName);
45
46 uint64_t startingMS = slot.getStartTimeMS() - 10000; // start 10 seconds before
47 uint64_t stoppingMS = slot.getEndTimeMS() + 600000; // stop 10 minutes after
48 mccdbInfoVector.emplace_back("TOF/Calib/Diagnostic", clName, flName, md, startingMS, stoppingMS);
49 mDiagnosticVector.emplace_back(*diag);
50}
51
52//----------------------------------------------------------
53Slot& TOFDiagnosticCalibrator::emplaceNewSlot(bool front, TFType tstart, TFType tend)
54{
55 auto& cont = getSlots();
56 auto& slot = front ? cont.emplace_front(tstart, tend) : cont.emplace_back(tstart, tend);
57 slot.setContainer(std::make_unique<Diagnostic>());
58 return slot;
59}
60
61} // end namespace tof
62} // 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:798
Diagnostic class for TOF.
Definition Diagnostic.h:32
void print(bool longFormat=false) const
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) 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"