当前位置: 首页>>代码示例>>C++>>正文


C++ AliCDBEntry::GetId方法代码示例

本文整理汇总了C++中AliCDBEntry::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ AliCDBEntry::GetId方法的具体用法?C++ AliCDBEntry::GetId怎么用?C++ AliCDBEntry::GetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AliCDBEntry的用法示例。


在下文中一共展示了AliCDBEntry::GetId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ChangeRunRange

Bool_t ChangeRunRange(const char* objectPath,
                      int run1=0, int run2=AliCDBRunRange::Infinity(),
                      const char* inputOCDB="alien://folder=/alice/data/2013/OCDB",
                      const char* outputOCDB="alien://folder=/alice/cern.ch/user/l/laphecet/OCDB2013") 
{
  AliCDBManager* man = AliCDBManager::Instance();
  
  man->SetDefaultStorage(inputOCDB);
  
  AliCDBEntry* e = man->Get(objectPath,AliCDBRunRange::Infinity());
  
  if (!e)
  {
    cout << Form("ERROR : could not get %s from %s",objectPath,inputOCDB) << endl;
    return kFALSE;
  }
  
  e->GetId().SetRunRange(run1,run2);
  
  AliCDBMetaData* md = e->GetMetaData();
  
  md->SetResponsible("L. Aphecetche and P. Pillot"); // to insure we have no $Id$ in the metadata fields (see https://savannah.cern.ch/bugs/?95527)
  
  man->SetDefaultStorage(outputOCDB);
 
  return man->Put(e->GetObject(),e->GetId(),e->GetMetaData());
}
开发者ID:aphecetche,项目名称:acode,代码行数:27,代码来源:ChangeRunRange.C

示例2: makeDecalibCDB

void makeDecalibCDB(Int_t firstRun, Int_t lastRun, Float_t decalib = 0.065)
{
  //Generates a random decalibration factors O(1)
  //to be applied in the anchor run simulations with raw:// .
  //If decalib<0, no decalibration generated, all factors=1.
  
  //Run range is [firstRun,lastRun] and gaussian sigma = decalib.
  //Author: Boris Polishchuk.
  
  AliCDBManager::Instance()->SetDefaultStorage("raw://");
  AliCDBManager::Instance()->SetRun(firstRun);

  TString emcPath("PHOS/Calib/EmcGainPedestals");
  AliCDBEntry* entryEmc = AliCDBManager::Instance()->Get(emcPath.Data(),-1);

  AliPHOSEmcCalibData* clb=0;

  if(entryEmc) clb = (AliPHOSEmcCalibData*)entryEmc->GetObject();
  else { printf("CDB entry not found. Exit.\n"); return; }
  
  if(!clb) { printf("Calibration parameters for PHOS EMC not found.\n"); return; }
  
  printf("\t\tEMC calibration object found: FirstRun=%d LastRun=%d Version=%d SubVersion=%d\n",
         entryEmc->GetId().GetFirstRun(), entryEmc->GetId().GetLastRun(),
         entryEmc->GetId().GetVersion(),entryEmc->GetId().GetSubVersion());
  
  
  TRandom rn;
  rn.SetSeed(0); //the seed is set to the current  machine clock

  Float_t adcChannelEmc;

  for(Int_t module=1; module<6; module++) {
    for(Int_t column=1; column<57; column++) {
      for(Int_t row=1; row<65; row++) {

	if(decalib<0.) adcChannelEmc = 1.;
	else
	  adcChannelEmc =rn.Gaus(1.,decalib);

        clb->SetADCchannelEmcDecalib(module,column,row,adcChannelEmc);
      }
    }
  }

  AliCDBManager::Instance()->SetDefaultStorage("local://./");
  AliCDBStorage* storage = AliCDBManager::Instance()->GetDefaultStorage();
  
  AliCDBMetaData *md = new AliCDBMetaData();
  AliCDBId id(emcPath.Data(),firstRun,lastRun);
  storage->Put(clb,id, md);

}
开发者ID:alisw,项目名称:AliRoot,代码行数:53,代码来源:makeDecalibCDB.C


注:本文中的AliCDBEntry::GetId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。