]>
Commit | Line | Data |
---|---|---|
816853ba | 1 | //-*- Mode: C++ -*- |
2 | // $Id: makeConfigurationObjectdNdPtAnalysis.C$ | |
3 | /** | |
4 | * @file makeConfigurationObjectdNdPtAnalysis.C | |
5 | * @brief Creation of HLT component configuration objects in OCDB | |
6 | * | |
7 | * <pre> | |
8 | * Usage: aliroot -b -q makeConfigurationObjectdNdPtAnalysis.C'("param", "uri", runMin, runMax)' | |
9 | * </pre> | |
10 | * | |
11 | * Create an OCDB entry with a TObjString containing param for the | |
12 | * ZDC reconstruction. | |
13 | * | |
14 | * Parameters: <br> | |
15 | * - param (opt) string to be stored in the TObjSting, default empty | |
16 | * - uri (opt) the OCDB URI, default $ALICE_ROOT | |
17 | * - runMin (opt) default 0 | |
18 | * - runMax (opt) default 999999999 | |
19 | * | |
20 | * Current Param : | |
21 | * - "" <pre> aliroot -b -q makeConfigurationObjectdNdPtAnalysis.C </pre> | |
22 | * | |
23 | * @author Chiara Oppedisano <Chiara.Oppedisano@to.infn.it> | |
24 | * Jochen Thaeder <jochen@thaeder.de> | |
ebf7a8e8 | 25 | * @ingroup alihlt_global |
816853ba | 26 | */ |
27 | void makeConfigurationObjectdNdPtAnalysis(const Char_t* param="-vertexZRange 20. -meanVertexXYZ 0. 0. 0. -meanVertexXYZSigma 1. 1. 10. -etaRange 0.9 -ptRange 0.15 1.e10 -maxDCAr 3.0 -maxDCAz 30.0 -maxDCAToVertexXY 3.0 -maxDCAToVertexZ 3.0 -requireSigmaToVertex 1", const Char_t* cdbUri=NULL, | |
28 | Int_t runMin=0, Int_t runMax=AliCDBRunRange::Infinity()) { | |
29 | ||
30 | // -------------------------------------- | |
31 | // -- Setup CDB | |
32 | // -------------------------------------- | |
33 | ||
34 | AliCDBManager* man = AliCDBManager::Instance(); | |
35 | if (!man) { | |
36 | cerr << "Error : Can not get AliCDBManager" << end; | |
37 | exit; | |
38 | } | |
39 | ||
40 | TString storage; | |
41 | if (!man->IsDefaultStorageSet()) { | |
42 | if ( cdbUri ) { | |
43 | storage = cdbUri; | |
44 | if ( storage.Contains("://") == 0 ) { | |
45 | storage = "local://"; | |
46 | storage += cdbUri; | |
47 | } | |
48 | } | |
49 | else { | |
50 | storage="local://$ALICE_ROOT/OCDB"; | |
51 | } | |
52 | man->SetDefaultStorage(storage); | |
53 | } | |
54 | else { | |
55 | storage = man->GetDefaultStorage()->GetURI(); | |
56 | } | |
57 | ||
58 | TString path("HLT/ConfigAnalysis/dNdPtAnalysis"); | |
59 | ||
60 | // -------------------------------------- | |
61 | // -- Create Config Object | |
62 | // -------------------------------------- | |
63 | ||
64 | // here is the actual content of the configuration object | |
65 | TObjString configParam=param; | |
66 | ||
67 | TObject *configObj = static_cast<TObject*>(&configParam); | |
68 | // -------------------------------------- | |
69 | // -- Fill Object | |
70 | // -------------------------------------- | |
71 | ||
72 | if ( !configObj ) { | |
73 | cerr << "Error : No configuration object created" << endl; | |
74 | return; | |
75 | } | |
76 | ||
77 | AliCDBPath cdbPath(path); | |
78 | AliCDBId cdbId(cdbPath, runMin, runMax); | |
79 | AliCDBMetaData cdbMetaData; | |
80 | man->Put(configObj, cdbId, &cdbMetaData); | |
81 | ||
82 | printf("Adding %s type OCDB object to %s [%d,%d] in %s \n", | |
83 | configObj->ClassName(), | |
84 | path.Data(), | |
85 | runMin, runMax, storage.Data()); | |
86 | } | |
87 |