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


C++ AliCDBEntry类代码示例

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


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

示例1: RecoParamWithTPCDistortions

Bool_t
RecoParamWithTPCDistortions(AliCDBManager *man) {

  // check methods exist
  if (!AliRecoParam::Class()->GetMethodAny("SuggestRunEventSpecie"))
    return kFALSE;
  if (!AliTPCRecoParam::Class()->GetMethodAny("GetUseCorrectionMap"))
    return kFALSE;
  
  // get event specie from GRP
  AliCDBEntry *grpe = man->Get("GRP/GRP/Data");
  if (!grpe) return kFALSE;
  AliGRPObject *grp = (AliGRPObject *)grpe->GetObject();
  AliRecoParam::EventSpecie_t evs = AliRecoParam::SuggestRunEventSpecie(grp->GetRunType(),
									grp->GetBeamType(),
									grp->GetLHCState());

  // get TPC RecoParam for event specie
  AliCDBEntry *pare = man->Get("TPC/Calib/RecoParam");
  if (!pare) return kFALSE;
  TObjArray *parl = (TObjArray *)pare->GetObject();
  AliTPCRecoParam *par = NULL;
  for (Int_t i = parl->GetEntriesFast(); i--;) {
    AliTPCRecoParam *p = (AliTPCRecoParam *)parl->UncheckedAt(i);
    if (!p || !(p->GetEventSpecie() & evs)) continue;
    par = p;
    break;
  }
  // check if use correction map
  if (!par->GetUseCorrectionMap())
    return kFALSE;

  return kTRUE;
  
}
开发者ID:alisw,项目名称:AliDPG,代码行数:35,代码来源:OCDBConfig.C

示例2: GetTimeRange

//_________________________________________________________________________________________________
void GetTimeRange(Int_t runNumber, time_t& start, time_t& end)
{
  AliCDBManager::Instance()->SetRun(runNumber);

  AliCDBEntry* e = AliCDBManager::Instance()->Get("GRP/GRP/Data");

  AliGRPObject* grp = static_cast<AliGRPObject*>(e->GetObject());

  start = grp->GetTimeStart();
  end = grp->GetTimeEnd();

  TDatime dstart(start);
  TDatime dend(end);

  dstart.Set(dstart.GetYear(),dstart.GetMonth(),dstart.GetDay(),dstart.GetHour(),0,0);
  dend.Set(dend.GetYear(),dend.GetMonth(),dend.GetDay(),dend.GetHour()+1,0,0);
  
  std::cout << TDatime(start).AsString() << std::endl;
  std::cout << TDatime(end).AsString() << std::endl;

  std::cout << dstart.AsString() << std::endl;
  std::cout << dend.AsString() << std::endl;

  start = dstart.Convert(kFALSE);
  end = dend.Convert(kFALSE);
}
开发者ID:aphecetche,项目名称:acode,代码行数:27,代码来源:OccupancyInTimeBins.C

示例3: PrintAlignment

void
PrintAlignment()
{
  AliCDBManager* cdb   = AliCDBManager::Instance();
  cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  AliCDBEntry*   align = cdb->Get("FMD/Align/Data");
  if (!align) {
    Error("PrintAlignment","didn't alignment data from CDB");
    return;
  }
  
  TClonesArray* array = dynamic_cast<TClonesArray*>(align->GetObject());
  if (!array) {
    Warning("PrintAlignement", "Invalid align data from CDB");
    return;
  }
  Int_t nAlign = array->GetEntries();
  for (Int_t i = 0; i < nAlign; i++) {
    AliAlignObjParams* a = static_cast<AliAlignObjParams*>(array->At(i));
    Double_t ang[3];
    Double_t trans[3];
    a->GetAngles(ang);
    a->GetTranslation(trans);
    std::cout << a->GetVolPath() << "\n" 
	      << "  translation: "
	      << "(" << std::setw(12) << trans[0] 
	      << "," << std::setw(12) << trans[1] 
	      << "," << std::setw(12) << trans[2] << ")\n"
	      << "  rotation:    "
	      << "(" << std::setw(12) << ang[0] 
	      << "," << std::setw(12) << ang[1] 
	      << "," << std::setw(12) << ang[2]  << ")" << std::endl;
    // a->Print();
  }
}
开发者ID:alisw,项目名称:AliRoot,代码行数:35,代码来源:PrintAlignment.C

示例4: SetEnergyFromGRP

Float_t
SetEnergyFromGRP()
{
  AliCDBEntry *cdbe = AliCDBManager::Instance()->Get("GRP/GRP/Data");
  AliGRPObject *grpd = dynamic_cast<AliGRPObject*>(cdbe->GetObject()); 
  return (grpd->GetBeamEnergy() * 2.);
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:7,代码来源:Config.C

示例5: DefaultSpecificStorage

void DefaultSpecificStorage(AliCDBManager *man, Int_t mode)
{

  AliCDBEntry *cdbe = man->Get("GRP/GRP/Data");
  if (!cdbe) return NULL;
  AliGRPObject *grp = (AliGRPObject *)cdbe->GetObject();
  TDatime date = grp->GetTimeStart();
  Int_t year = date.GetYear();

  const Char_t *Raw      = Form("alien://Folder=/alice/data/%d/OCDB", year);
  const Char_t *Ideal    = "alien://Folder=/alice/simulation/2008/v4-15-Release/Ideal/";
  const Char_t *Residual = "alien://Folder=/alice/simulation/2008/v4-15-Release/Residual/";
  const Char_t *Full     = "alien://Folder=/alice/simulation/2008/v4-15-Release/Full/";
  // for AD hack 
  const Char_t *Raw2015  = "alien://Folder=/alice/data/2015/OCDB";
  
  // DEFAULT SPECIFIC OBJECTS 
  const Char_t *SpecificStorageList[][3] = {
    // path                    sim       rec
    //
    // ITS
    "ITS/Align/Data",          Ideal,    Residual, // ok
    "ITS/Calib/SPDSparseDead", Full,     Residual, // ok ?
    // TPC
    "TPC/Calib/ClusterParam",  Ideal,    Residual, // ok!
    "TPC/Calib/RecoParam",     Residual, Residual, // ok!
    "TPC/Calib/TimeGain",      Ideal,    Residual, // ok!
    "TPC/Calib/Correction",    Ideal,    Residual, // ok!
    // MUON
    "MUON/Align/Data",         Full,     NULL,     // ok!
    // ZDC
    "ZDC/Align/Data",          Ideal,    Ideal,    // ok
    "ZDC/Calib/Pedestals",     Ideal,    Ideal     // added (11.12.2017)
  };
  const Int_t nSpecificStorages = sizeof(SpecificStorageList) / (3 * sizeof(Char_t *));

  // set specific storages
  for (Int_t isto = 0; isto < nSpecificStorages; isto++) {
    if (SpecificStorageList[isto][mode+1]) {
      printf("Setting specific storage: %s -> %s\n", SpecificStorageList[isto][0], SpecificStorageList[isto][mode+1]);
      man->SetSpecificStorage(SpecificStorageList[isto][0], SpecificStorageList[isto][mode+1]);
    }
  }

  // EXTRA SPECIFIC OBJECTS IF NO DISTORTIONS
  if (!RecoParamWithTPCDistortions(man)) {
    printf("Not using TPC distortions, need extra specific storages\n");
    NoDistortionSpecificStorage(man, mode);
  }
  
  // Run-1 settings
  if (year < 2015) {
    man->SetSpecificStorage("AD/Calib/QAParam", Raw2015);
    const Char_t *muonHack[2] = {Ideal, Residual};
    man->SetSpecificStorage("MUON/Align/Data", muonHack[mode]);
  }

}
开发者ID:alisw,项目名称:AliDPG,代码行数:58,代码来源:OCDBConfig.C

示例6: PatchCDB

void PatchCDB(const char* runlist, const char* runlist1400, const char* srcOCDBPath="alien://folder=/alice/data/2016/OCDB", const char* destOCDBPath="alien://folder=/alice/cern.ch/user/l/laphecet/OCDBCH3L")
{
    // function to patch the OCDB MUON/Calib/HV for the swap of CH3L Q2S1 and Q2S2
    // runlist = full list of runs where Chamber03Left/Quad2Sect1 has an HV problem (trips, too low, plus the 1400 V
    // below)
    // runlist1400 = list of runs where Chamber03Left/Quad2Sect1 was struggling at 1400 V
    // for the runs in runlist1400, the HV will be forced to zero for that sector
    // note that Chamber03Left/Quad2Sect1 = Chamber02Left/Quad1Sect0 in DCS alias world
     
  AliAnalysisTriggerScalers ts(runlist,srcOCDBPath);

  std::vector<int> vrunlist = ts.GetRunList();

  AliAnalysisTriggerScalers ts1400(runlist1400,srcOCDBPath);
  std::vector<int> vrunlist1400 = ts1400.GetRunList();

  AliCDBManager* man = AliCDBManager::Instance();

  TObjString sector2("MchHvLvLeft/Chamber02Left/Quad1Sect0.actual.vMon");
  TObjString sector1("MchHvLvLeft/Chamber02Left/Quad1Sect1.actual.vMon");

  for ( auto r : vrunlist )
  {
      man->SetDefaultStorage(srcOCDBPath);
      man->SetRun(r);
      std::cout << "Run " << r << std::endl;

      AliCDBEntry* entry = man->Get("MUON/Calib/HV");
      TMap* hvmap = static_cast<TMap*>(entry->GetObject()->Clone());

      TPair* p1 = hvmap->RemoveEntry(&sector2);

      if ( std::find(vrunlist1400.begin(),vrunlist1400.end(),r) != vrunlist1400.end() )
      {
        TObjArray* a1 = static_cast<TObjArray*>(p1->Value());
        AliDCSValue* first = static_cast<AliDCSValue*>(a1->First());
        AliDCSValue* last = static_cast<AliDCSValue*>(a1->Last());
        a1->Delete();
        a1->Add(new AliDCSValue(0.0f,first->GetTimeStamp()));
        a1->Add(new AliDCSValue(0.0f,last->GetTimeStamp()));
      }
      TPair* p2 = hvmap->RemoveEntry(&sector1);

      hvmap->Add(new TObjString(sector2),p2->Value());
      hvmap->Add(new TObjString(sector1),p1->Value());

      delete p1->Key();
      delete p2->Key();

      man->SetDefaultStorage(destOCDBPath);
      hvmap->SetUniqueID( hvmap->GetUniqueID() | ( 1 << 9 ) );
      AliMUONCDB::WriteToCDB(hvmap,"MUON/Calib/HV",r,r,"Patched for CH3L Quad2Sect1 vs 0 swapping","L. Aphecetche");
      man->ClearCache();
  }
}
开发者ID:aphecetche,项目名称:acode,代码行数:55,代码来源:PatchCDB.C

示例7: ReadDCSAliasMap

TMap* ReadDCSAliasMap()
{
  // Open a file that contains DCS input data
  // The CDB framework is used to open the file, this means the file is located
  // in $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB/<detector>/DCS/Data
  // The file contains an AliCDBEntry that contains a TMap with the DCS structure.
  // An explanation of the structure can be found in CreateDCSAliasMap()

  AliCDBEntry *entry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
  			->Get("DET/DCS/Data", 0);
  return dynamic_cast<TMap*> (entry->GetObject());
}
开发者ID:ktf,项目名称:AliRoot,代码行数:12,代码来源:ADTestPreprocessor.C

示例8: ReadCDBEntryTriggerMask

AliTOFTriggerMask *
ReadCDBEntryTriggerMask(Int_t run, const Char_t *defaultStorage = "raw://", const Char_t *specificStorage = NULL)
{
  AliCDBManager *cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage(defaultStorage);
  if (specificStorage)
    cdb->SetSpecificStorage("TRIGGER/TOF/TriggerMask", specificStorage);
  cdb->SetRun(run);
  AliCDBEntry *cdbe = cdb->Get("TRIGGER/TOF/TriggerMask");
  AliTOFTriggerMask *triggerMaskObj = (AliTOFTriggerMask *)cdbe->GetObject();

  return triggerMaskObj;
}
开发者ID:alisw,项目名称:AliRoot,代码行数:13,代码来源:ReadCDBEntryTriggerMask.C

示例9: AliTRDCheckPedestal

//__________________________________________________________
void AliTRDCheckPedestal(const Int_t runNr){
  // Establish grid connection
  if(!TGrid::Connect("alien://")){printf("F-No grid connection\n");return;}
  // Set the storage to the OCDB of this runNr. It will be like
  // alien://folder=/alice/data/2016/OCDB
  AliCDBManager *man = AliCDBManager::Instance();
  man->SetDefaultStorageFromRun(runNr);
  // We derive the reference storage from it
  const AliCDBStorage *stor =  man->GetDefaultStorage();
  TString folder = stor->GetBaseFolder();
  folder.ReplaceAll("OCDB","Reference");
  man->SetDefaultStorage(Form("alien://folder=%s",folder.Data()));
  // Set the run number
  man->SetRun(runNr);

  // We abuse the folder name to derive the year
  TString yearString(folder);
  yearString.ReplaceAll("/alice/data/","");
  yearString.ReplaceAll("/Reference/","");
  const Int_t year = yearString.Atoi();
  printf("W-Experimental: Derived year %d from storage folder\n",year);
  
  // The reference data is stored per Local Data Concentrator
  std::vector<Int_t> LDCvec = GetLDCVector(year);
  // Loop over LDCs
  for(std::vector<Int_t>::iterator LDCit = LDCvec.begin();LDCit!=LDCvec.end();LDCit++){
    const TString padstatus = Form("TRD/DAQData/PadStatus%d",*LDCit);
    AliCDBEntry *entry = AliCDBManager::Instance()->Get(padstatus.Data());
    AliTRDCalibPadStatus *calpadstatus = dynamic_cast<AliTRDCalibPadStatus *>(entry->GetObject());
    if(!calpadstatus){printf("E-Can not find %s in %s \n",padstatus.Data(),folder.Data());continue;}

    //Create the noise pad with the RMS values of each channel
    AliTRDCalPad *noisePad = calpadstatus->CreateCalPad();
    // LDC -> SM mapping
    std::vector<Int_t> SMvec = GetSMVector(year,*LDCit);
    for(std::vector<Int_t>::iterator SMit=SMvec.begin();SMit!=SMvec.end();SMit++){
      const TString padstatussm = Form("PadNoise-LDC%d-SM%02d",*LDCit,*SMit);
      TCanvas *cpadstatusm = new TCanvas(padstatussm.Data(),padstatussm.Data(),50,50,600,800);
      cpadstatusm->Divide(3,2);
      // Draw each layer (or here plane)
      const Float_t zRange[2]={0.,0.2};
      for(Int_t iLayer = 0;iLayer<6;iLayer++){
  	cpadstatusm->cd(iLayer+1);
	noisePad->MakeHisto2DSmPl(*SMit,iLayer,0,0,zRange[0],zRange[1],-1)->Draw("colz");
      }
      cpadstatusm->SaveAs(Form("%s.pdf",cpadstatusm->GetName()));
    } // Loop over SMs of this LDC
  } // End of loop over LDCs
} // End of void AliTRDcheckPedestal
开发者ID:alisw,项目名称:AliRoot,代码行数:50,代码来源:AliTRDCheckPedestal.C

示例10: pfocdbmaker

///
/// Main method
///
void pfocdbmaker()
{
  AliCDBEntry e;
  
  AliCaloRawAnalyzerPeakFinder *p = new  AliCaloRawAnalyzerPeakFinder();
  
  e.SetObject(p);
  
  TFile *f = new TFile("pfvectors.root", "recreate" );
  
  // Read in the Peak finder vecors from file
  p->Write();
  
  //  e.Write();
  
  f->Close();
}
开发者ID:alisw,项目名称:AliRoot,代码行数:20,代码来源:pfocdbmaker.C

示例11: ReadRecoParam

ReadRecoParam(const Int_t runNumber)
{
  // Read the array of PHOS recoparam objects from OCDB and
  // print its content to stdout

  AliCDBManager::Instance()->SetDefaultStorage("raw://");
  AliCDBManager::Instance()->SetRun(runNumber);

  AliCDBEntry* cdbEntry = AliCDBManager::Instance()->Get("PHOS/Calib/RecoParam");
  AliCDBMetaData *md = cdbEntry->GetMetaData();
  printf("Responsible: %s\n",md->GetResponsible());
  printf("MD Comment : %s\n",md->GetComment());
  TObjArray* arrayRecoParam = (TObjArray*)cdbEntry->GetObject();

  AliPHOSRecoParam *rp = 0;
  for (Int_t i=0; i<arrayRecoParam->GetEntries(); i++) {
    rp = (AliPHOSRecoParam*)arrayRecoParam->At(i);
    printf("Recoparam %d: event specie = %d\n",
	   i,rp->GetEventSpecie());

    printf("\tEMCClusteringThreshold = %g\n",rp->GetEMCClusteringThreshold());
    printf("\tEMCLocalMaxCut         = %g\n",rp->GetEMCLocalMaxCut());
    printf("\tEMCRawDigitThreshold   = %g\n",rp->GetEMCRawDigitThreshold());
    printf("\tEMCMinE                = %g\n",rp->GetEMCMinE());
    printf("\tEMCLogWeight           = %g\n",rp->GetEMCLogWeight());
    printf("\tEMCSampleQualityCut    = %g\n",rp->GetEMCSampleQualityCut());
    printf("\tEMCEcoreRadius         = %g\n",rp->GetEMCEcoreRadius());
    printf("\tEMCEcore2ESD           = %d\n",rp->EMCEcore2ESD());
    printf("\tEMCSubtractPedestals   = %d\n",rp->EMCSubtractPedestals());
    printf("\tEMCToUnfold            = %d\n",rp->EMCToUnfold());
    printf("\tEMCfitter version      = %s\n",rp->EMCFitterVersion());
    printf("\tEMCEnergyCorrectionOn  = %d\n",rp->GetEMCEnergyCorrectionOn());
    printf("\tGlobalAltroOffset      = %f\n",rp->GetGlobalAltroOffset());
    printf("\tGlobalAltroThreshold   = %d\n",rp->GetGlobalAltroThreshold());
    printf("\tTimeGateAmpThresh      = %g\n",rp->GetTimeGateAmpThresh());
    printf("\tTimeGateLow            = %g\n",rp->GetTimeGateLow());
    printf("\tTimeGateHigh           = %g\n",rp->GetTimeGateHigh());
    printf("\tNonlinearityCorrectionVersion = %s\n",rp->GetNonlinearityCorrectionVersion());
  }
}
开发者ID:alisw,项目名称:AliRoot,代码行数:40,代码来源:UpdateRecoParam.C

示例12: 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

示例13: UpdateRecoParam

UpdateRecoParam(const Int_t runNumber)
{
  // Read the array of PHOS recoparam objects from OCDB and update
  // EMC fitter version to "v4".
  // Write the updated object to OCDB.
  // Yuri Kharlov. 9.12.2011
  //
  /* $Id$ */

  AliCDBManager::Instance()->SetDefaultStorage("raw://");
  AliCDBManager::Instance()->SetRun(runNumber);

  AliCDBEntry* cdbEntry = AliCDBManager::Instance()->Get("PHOS/Calib/RecoParam");
  AliCDBMetaData *md = cdbEntry->GetMetaData();
  cout << "Responsible: " << md->GetResponsible() << endl;
  cout << "MD Comment : " << md->GetComment() << endl;
  TObjArray* arrayRecoParam = (TObjArray*)cdbEntry->GetObject();

  cout << "N recoparam = " << arrayRecoParam->GetEntries() << endl;

  AliPHOSRecoParam *rp = 0;
  for (Int_t i=0; i<arrayRecoParam->GetEntries(); i++) {
    rp = (AliPHOSRecoParam*)arrayRecoParam->At(i);
    printf("RP %d: event specie = %d, fitter version = %s\n",
	   i,rp->GetEventSpecie(),rp->EMCFitterVersion());
    rp->SetEMCFitterVersion("v4");
  }

  // Writing new recoparam to OCDB

  AliCDBManager* cdb = AliCDBManager::Instance();
  cdb->SetDefaultStorage("local://OCDB");

  AliCDBMetaData *md= new AliCDBMetaData();
  md->SetResponsible("Yuri Kharlov");
  md->SetComment("PHOS recoparameters: EMC fitter version is updated to v4");
  AliCDBId id("PHOS/Calib/RecoParam",167690,AliCDBRunRange::Infinity());
  cdb->Put(arrayRecoParam,id, md);

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

示例14: getT0RecoParam

void getT0RecoParam(Int_t run)
{
  
  // Read calibration coefficients into the Calibration DB
  // Arguments:
  AliCDBManager* man = AliCDBManager::Instance();
   man->SetDefaultStorage("raw://");
  //  man->SetDefaultStorage("local:///home/alla/alice/Jul14/OCDB/");
  man->SetRun(run);
  AliCDBEntry *entry = AliCDBManager::Instance()->Get("T0/Calib/RecoParam");
  AliT0RecoParam* recoParam = 0x0;
  cout<<" entry "<< entry<<endl;
  if(entry) {
    // load recoParam according OCDB content (single or array)
    //    if (!(recoParam = dynamic_cast<AliT0RecoParam*>(entry->GetObject()))) {
    
    TObjArray* recoParamArray = static_cast<TObjArray*>(entry->GetObject());     
    cout<<" TObjArray* recoParamArray "<<recoParamArray->GetEntriesFast()<<endl;
    for(Int_t ie = 0; ie < recoParamArray->GetEntriesFast()-1; ie++) {
      
      recoParam = static_cast<AliT0RecoParam*>(recoParamArray->UncheckedAt(ie));	
      cout<<ie<<endl;
      cout<<" eq "<<recoParam->GetEq()<<endl;
      //	 recoParam->Dump();
      cout<<" cfd range "<<recoParam->GetLow(300)<<" amplitude "<<recoParam->GetLow(200)<<" "<<recoParam->GetHigh(200)<<endl;
      
      for (int i=0; i<500; i++) 
	if( recoParam->GetLow(i) !=0) cout<<i<<" low "<<recoParam->GetLow(i)<<"   "<<endl;
      for (int i=0; i<500; i++) 
	if( recoParam->GetHigh(i) !=50000)  cout<<i<<" high "<<recoParam->GetHigh(i)<<endl;
      recoParam = 0x0;
    }
  }
  else 
    cout<<" no entry "<<endl;
  
  
}
开发者ID:alisw,项目名称:AliRoot,代码行数:38,代码来源:getT0RecoParam.C

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