Belle II Software light-2406-ragdoll
PayloadMetadata.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <string>
11#include <framework/database/IntervalOfValidity.h>
12
13namespace Belle2::Conditions {
17 explicit PayloadMetadata(const std::string& _name, bool _required = true): name{_name}, required{_required} {}
19 PayloadMetadata(const std::string& _name, const std::string& _globaltag, const std::string& _payloadUrl,
20 const std::string& _baseUrl, const std::string& _checksum, int firstExp, int firstRun, int finalExp, int finalRun,
21 int _revision): name(_name), globaltag(_globaltag), payloadUrl(_payloadUrl), baseUrl(_baseUrl), checksum(_checksum),
22 iov{firstExp, firstRun, finalExp, finalRun}, revision(_revision) {}
24 void update(const PayloadMetadata& other)
25 {
26 bool r{required};
27 (*this) = other;
28 required = r;
29 }
31 std::string name;
33 std::string globaltag{""};
35 std::string filename{""};
37 std::string payloadUrl{""};
39 std::string baseUrl{""};
41 std::string checksum{""};
45 size_t revision{0};
47 bool required{true};
48 };
49} // Belle2::Conditions namespace
A class that describes the interval of experiments/runs for which an object in the database is valid.
Simple struct to group all information necessary for a single payload.
IntervalOfValidity iov
the interval of validity
bool required
if true a missing payload will not trigger an error
std::string name
Name of the Payload.
std::string baseUrl
base url if download is necessary
void update(const PayloadMetadata &other)
Update information from another instance but keep the "required" flag untouched.
std::string globaltag
Name of the globaltag this payload was taken from.
PayloadMetadata(const std::string &_name, bool _required=true)
Constructor to request a payload with a given name and indicate whether non-existence is ok.
PayloadMetadata(const std::string &_name, const std::string &_globaltag, const std::string &_payloadUrl, const std::string &_baseUrl, const std::string &_checksum, int firstExp, int firstRun, int finalExp, int finalRun, int _revision)
Constructor for all the information which is usually obtained from providers.
std::string checksum
digest (checksum) of the payload
std::string payloadUrl
logical filename to the payload
std::string filename
full filename to the payload file
size_t revision
the revision of the payload