Skip to content

DCS config data format#6446

Merged
shahor02 merged 4 commits into
AliceO2Group:devfrom
chiarazampolli:DCSConfigDataFormat
Jun 28, 2021
Merged

DCS config data format#6446
shahor02 merged 4 commits into
AliceO2Group:devfrom
chiarazampolli:DCSConfigDataFormat

Conversation

@chiarazampolli
Copy link
Copy Markdown
Collaborator

@chiarazampolli chiarazampolli commented Jun 16, 2021

This is an example of data format to be used to fill the CCDB instance to store the calibration information to be used to configure detectors. Such object will be picked up by DCS, to be stored in Oracle and/or be used by the detectors (FEE or other).

See https://alice.its.cern.ch/jira/browse/O2-2341

E.g. for testing, run (compile first) the following:

#include "DataFormatsDCS/DCSConfigObject.h"
#include <iostream>
#include <TFile.h>

int test()
{
  o2::dcs::DCSconfigObject_t config;
  o2::dcs::addConfigItem(&config, "pippo", "pluto");
  o2::dcs::addConfigItem(&config, "pippo_float", 12.f);

  o2::dcs::printDCSConfig(config);

  TFile fout("myDCSConfig.root", "recreate");
  fout.WriteObjectAny(&config, "std::vector<char>", "DCSConfig");
  fout.Close();

  TFile fin("myDCSConfig.root", "read");
  o2::dcs::DCSconfigObject_t* config_r = (o2::dcs::DCSconfigObject_t*)fin.Get("DCSConfig");
  std::cout << "\nReading back" << std::endl;
  o2::dcs::printDCSConfig(*config_r);
  fin.Close();
  
  return 0;
}

@chiarazampolli chiarazampolli requested a review from a team as a code owner June 16, 2021 15:03
@chiarazampolli chiarazampolli changed the title Dcs config data format DCS config data format Jun 16, 2021
@aphecetche
Copy link
Copy Markdown
Collaborator

@chiarazampolli thanks for the PR. Any reason why you are passing the dcsconfig by pointer in addConfigItem ? Why not just addConfigItem(DCSconfigObject_t& configVector, std::string key, const T value) ? Would eliminate one possible error (calling the method with nullptr)

@chiarazampolli
Copy link
Copy Markdown
Collaborator Author

Hi @aphecetche ,

No reason, and now I don't remember if it was like this since initially I did it differently. Yours is a good suggestion, I will change accordingly, thanks!

Chiara

@chiarazampolli
Copy link
Copy Markdown
Collaborator Author

Hello,

macos errors does not seem related to my PR, unless i overlooked something. CI log is not present.

@shahor02 , do you think this PR can be merged?

Chiara

@shahor02 shahor02 merged commit 183579a into AliceO2Group:dev Jun 28, 2021
mcoquet642 pushed a commit to mcoquet642/AliceO2 that referenced this pull request Jul 4, 2021
* typedef for DCS configuration

using std::vector<char>

* Change delimiter, improve print

clang-format

Fix trailing space

* Update functions - do not use pointers

* update copyright
@chiarazampolli chiarazampolli deleted the DCSConfigDataFormat branch May 16, 2022 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants