ROOT logo
//-*- Mode: C++ -*-
// $Id: makeConfigurationObjectVZEROReconstruction.C$
/**
 * @file makeConfigurationObjectVZEROReconstruction.C
 * @brief Creation of HLT component configuration objects in OCDB
 *
 * <pre>
 * Usage: aliroot -b -q makeConfigurationObjectVZEROReconstruction.C'("param", "uri", runMin, runMax)'
 * </pre>
 *
 * Create an OCDB entry with a TObjString containing param for the 
 * VZERO reconstruction.
 *
 * Parameters: <br>
 * - param (opt)    string to be stored in the TObjSting, default empty
 * - uri   (opt)    the OCDB URI, default $ALICE_ROOT   
 * - runMin (opt)   default 0
 * - runMax (opt)   default 999999999
 * 
 * Current Param : 
 *  - ""  <pre> aliroot -b -q makeConfigurationObjectVZEROReconstruction.C </pre>
 *
 * @author Jochen Thaeder <jochen@thaeder.de>
 * @ingroup alihlt_vzero
 */
void makeConfigurationObjectVZEROReconstruction(const Char_t* param="", const Char_t* cdbUri=NULL,
				      Int_t runMin=0, Int_t runMax=AliCDBRunRange::Infinity()) {

  // --------------------------------------
  // -- Setup CDB
  // --------------------------------------

  AliCDBManager* man = AliCDBManager::Instance();
  if (!man) {
    cerr << "Error : Can not get AliCDBManager" << end;
    exit;
  }

  TString storage;
  if (!man->IsDefaultStorageSet()) {
    if ( cdbUri ) {
      storage = cdbUri;
      if ( storage.Contains("://") == 0 ) {
	storage = "local://"; 
	storage += cdbUri;
      }
    } 
    else {
      storage="local://$ALICE_ROOT/OCDB";
    }
    man->SetDefaultStorage(storage);
  } 
  else {
    storage = man->GetDefaultStorage()->GetURI();
  }

  TString path("HLT/ConfigVZERO/VZEROReconstruction");

  // --------------------------------------
  // -- Create Config Object
  // --------------------------------------

  // here is the actual content of the configuration object
  TObjString configParam=param;

  TObject *configObj = static_cast<TObject*>(&configParam);
  // --------------------------------------
  // -- Fill Object
  // --------------------------------------
  
  if ( !configObj ) {
    cerr << "Error : No configuration object created" << endl;
    return;
  }
    
  AliCDBPath cdbPath(path);
  AliCDBId   cdbId(cdbPath, runMin, runMax);
  AliCDBMetaData cdbMetaData;
  man->Put(configObj, cdbId, &cdbMetaData);

  printf("Adding %s type OCDB object to %s [%d,%d] in %s \n",
	 configObj->ClassName(), 
	 path.Data(),
	 runMin, runMax, storage.Data());
}

 makeConfigurationObjectVZEROReconstruction.C:1
 makeConfigurationObjectVZEROReconstruction.C:2
 makeConfigurationObjectVZEROReconstruction.C:3
 makeConfigurationObjectVZEROReconstruction.C:4
 makeConfigurationObjectVZEROReconstruction.C:5
 makeConfigurationObjectVZEROReconstruction.C:6
 makeConfigurationObjectVZEROReconstruction.C:7
 makeConfigurationObjectVZEROReconstruction.C:8
 makeConfigurationObjectVZEROReconstruction.C:9
 makeConfigurationObjectVZEROReconstruction.C:10
 makeConfigurationObjectVZEROReconstruction.C:11
 makeConfigurationObjectVZEROReconstruction.C:12
 makeConfigurationObjectVZEROReconstruction.C:13
 makeConfigurationObjectVZEROReconstruction.C:14
 makeConfigurationObjectVZEROReconstruction.C:15
 makeConfigurationObjectVZEROReconstruction.C:16
 makeConfigurationObjectVZEROReconstruction.C:17
 makeConfigurationObjectVZEROReconstruction.C:18
 makeConfigurationObjectVZEROReconstruction.C:19
 makeConfigurationObjectVZEROReconstruction.C:20
 makeConfigurationObjectVZEROReconstruction.C:21
 makeConfigurationObjectVZEROReconstruction.C:22
 makeConfigurationObjectVZEROReconstruction.C:23
 makeConfigurationObjectVZEROReconstruction.C:24
 makeConfigurationObjectVZEROReconstruction.C:25
 makeConfigurationObjectVZEROReconstruction.C:26
 makeConfigurationObjectVZEROReconstruction.C:27
 makeConfigurationObjectVZEROReconstruction.C:28
 makeConfigurationObjectVZEROReconstruction.C:29
 makeConfigurationObjectVZEROReconstruction.C:30
 makeConfigurationObjectVZEROReconstruction.C:31
 makeConfigurationObjectVZEROReconstruction.C:32
 makeConfigurationObjectVZEROReconstruction.C:33
 makeConfigurationObjectVZEROReconstruction.C:34
 makeConfigurationObjectVZEROReconstruction.C:35
 makeConfigurationObjectVZEROReconstruction.C:36
 makeConfigurationObjectVZEROReconstruction.C:37
 makeConfigurationObjectVZEROReconstruction.C:38
 makeConfigurationObjectVZEROReconstruction.C:39
 makeConfigurationObjectVZEROReconstruction.C:40
 makeConfigurationObjectVZEROReconstruction.C:41
 makeConfigurationObjectVZEROReconstruction.C:42
 makeConfigurationObjectVZEROReconstruction.C:43
 makeConfigurationObjectVZEROReconstruction.C:44
 makeConfigurationObjectVZEROReconstruction.C:45
 makeConfigurationObjectVZEROReconstruction.C:46
 makeConfigurationObjectVZEROReconstruction.C:47
 makeConfigurationObjectVZEROReconstruction.C:48
 makeConfigurationObjectVZEROReconstruction.C:49
 makeConfigurationObjectVZEROReconstruction.C:50
 makeConfigurationObjectVZEROReconstruction.C:51
 makeConfigurationObjectVZEROReconstruction.C:52
 makeConfigurationObjectVZEROReconstruction.C:53
 makeConfigurationObjectVZEROReconstruction.C:54
 makeConfigurationObjectVZEROReconstruction.C:55
 makeConfigurationObjectVZEROReconstruction.C:56
 makeConfigurationObjectVZEROReconstruction.C:57
 makeConfigurationObjectVZEROReconstruction.C:58
 makeConfigurationObjectVZEROReconstruction.C:59
 makeConfigurationObjectVZEROReconstruction.C:60
 makeConfigurationObjectVZEROReconstruction.C:61
 makeConfigurationObjectVZEROReconstruction.C:62
 makeConfigurationObjectVZEROReconstruction.C:63
 makeConfigurationObjectVZEROReconstruction.C:64
 makeConfigurationObjectVZEROReconstruction.C:65
 makeConfigurationObjectVZEROReconstruction.C:66
 makeConfigurationObjectVZEROReconstruction.C:67
 makeConfigurationObjectVZEROReconstruction.C:68
 makeConfigurationObjectVZEROReconstruction.C:69
 makeConfigurationObjectVZEROReconstruction.C:70
 makeConfigurationObjectVZEROReconstruction.C:71
 makeConfigurationObjectVZEROReconstruction.C:72
 makeConfigurationObjectVZEROReconstruction.C:73
 makeConfigurationObjectVZEROReconstruction.C:74
 makeConfigurationObjectVZEROReconstruction.C:75
 makeConfigurationObjectVZEROReconstruction.C:76
 makeConfigurationObjectVZEROReconstruction.C:77
 makeConfigurationObjectVZEROReconstruction.C:78
 makeConfigurationObjectVZEROReconstruction.C:79
 makeConfigurationObjectVZEROReconstruction.C:80
 makeConfigurationObjectVZEROReconstruction.C:81
 makeConfigurationObjectVZEROReconstruction.C:82
 makeConfigurationObjectVZEROReconstruction.C:83
 makeConfigurationObjectVZEROReconstruction.C:84
 makeConfigurationObjectVZEROReconstruction.C:85
 makeConfigurationObjectVZEROReconstruction.C:86
 makeConfigurationObjectVZEROReconstruction.C:87