3 * @file makeComponentConfigurationObject.C
4 * @brief Creation of HLT component configuration objects in OCDB
7 * Usage: aliroot -b -q makeComponentConfigurationObject.C'("path", "param", "uri", runmin, runmax)'
10 * Create an OCDB entry with a TObjString containing param.
11 * Many HLT components understand configuration strings containing
12 * arguments and parameters just like the command line arguments.
13 * This macro facilitates the creation of an appropriate object
14 * from a parameter string.
17 * - path path of the entry within the OCDB
18 * - param (opt) string to be stored in the TObjSting, default empty
19 * - uri (opt) the OCDB URI, default $ALICE_ROOT
20 * - runmin (opt) default 0
21 * - runmax (opt) default 999999999
23 * Note: The configuration procedure of an HLT component is not
24 * restricted to that scheme. The implementation is up to the
25 * developer and more complex objects are possible.
27 * @author Matthias.Richter@ift.uib.no
28 * @ingroup alihlt_tutorial
30 void makeComponentConfigurationObject(const char* path, const char* param="",
31 const char* cdbUri=NULL,
35 AliCDBManager* man = AliCDBManager::Instance();
37 cerr << "can not get AliCDBManager" << end;
41 if (!man->IsDefaultStorageSet()) {
44 if (storage.Contains("://")==0) {
45 storage="local://"; storage+=cdbUri;
48 storage="local://$ALICE_ROOT/OCDB";
50 man->SetDefaultStorage(storage);
52 storage = man->GetDefaultStorage()->GetURI();
55 // here is the actual content of the configuration object
57 AliCDBPath cdbPath(path);
58 AliCDBId cdbId(cdbPath, runmin, runmax);
59 AliCDBMetaData cdbMetaData;
60 man->Put(&obj, cdbId, &cdbMetaData);
61 cout << "adding TObjString type OCDB object " << path << " (" << (param[0]==0?"<empty>":param) << ") [" << runmin << "," << runmax << "] in " << storage << endl;
64 void makeComponentConfigurationObject()
66 cout << "===============================================================" << endl;
67 cout << "usage: aliroot -b -q -l makeComponentConfigurationObject.C'(\"path\", \"param\", \"uri\", rangemin, rangemax)'" << endl << endl;
68 cout << " path path of the entry within the OCDB" << endl;
69 cout << " param (opt) string to be stored in the TObjSting, default empty" << endl;
70 cout << " uri (opt) the OCDB URI, default $ALICE_ROOT/OCDB " << endl;
71 cout << " rangemin (opt) default 0" << endl;
72 cout << " rangemax (opt) default 999999999" << endl;
73 cout << "===============================================================" << endl;