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
12
#include "
TOFCalibration/TOFDiagnosticCalibrator.h
"
13
#include "
Framework/Logger.h
"
14
#include "
DetectorsCalibration/Utils.h
"
15
#include "
CommonUtils/MemFileHelper.h
"
16
#include "
CCDB/CcdbApi.h
"
17
18
namespace
o2
19
{
20
namespace
tof
21
{
22
23
using
Slot
=
o2::calibration::TimeSlot<o2::tof::Diagnostic>
;
24
25
//----------------------------------------------------------
26
void
TOFDiagnosticCalibrator::initOutput
()
27
{
28
mccdbInfoVector.clear();
29
mDiagnosticVector.clear();
30
}
31
32
//----------------------------------------------------------
33
void
TOFDiagnosticCalibrator::finalizeSlot
(
Slot
& slot)
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
//----------------------------------------------------------
53
Slot
&
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
CcdbApi.h
Utils.h
Utils and constants for calibration and related workflows.
Logger.h
MemFileHelper.h
TOFDiagnosticCalibrator.h
o2::calibration::TimeSlotCalibration< o2::tof::Diagnostic >::getSlots
auto & getSlots()
Definition
TimeSlotCalibration.h:217
o2::calibration::TimeSlot
Definition
TimeSlot.h:34
o2::calibration::TimeSlot::getStartTimeMS
long getStartTimeMS() const
Definition
TimeSlot.h:50
o2::calibration::TimeSlot::getEndTimeMS
long getEndTimeMS() const
Definition
TimeSlot.h:51
o2::calibration::TimeSlot::getContainer
const Container * getContainer() const
Definition
TimeSlot.h:53
o2::ccdb::CcdbApi::generateFileName
static std::string generateFileName(const std::string &inp)
Definition
CcdbApi.cxx:798
o2::tof::Diagnostic
Diagnostic class for TOF.
Definition
Diagnostic.h:32
o2::tof::Diagnostic::print
void print(bool longFormat=false) const
Definition
Diagnostic.cxx:62
o2::tof::TOFDiagnosticCalibrator::initOutput
void initOutput() final
Definition
TOFDiagnosticCalibrator.cxx:26
o2::tof::TOFDiagnosticCalibrator::emplaceNewSlot
Slot & emplaceNewSlot(bool front, TFType tstart, TFType tend) final
Definition
TOFDiagnosticCalibrator.cxx:53
o2::tof::TOFDiagnosticCalibrator::finalizeSlot
void finalizeSlot(Slot &slot) final
Definition
TOFDiagnosticCalibrator.cxx:33
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
std::to_string
std::string to_string(gsl::span< T, Size > span)
Definition
common.h:52
o2::utils::MemFileHelper::getClassName
static std::string getClassName(const T &obj)
get the class name of the object
Definition
MemFileHelper.h:39
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
Detectors
TOF
calibration
src
TOFDiagnosticCalibrator.cxx
Generated on Tue Feb 25 2025 23:16:26 for Project by
1.9.8