本文整理汇总了C++中AliCDBManager::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ AliCDBManager::Get方法的具体用法?C++ AliCDBManager::Get怎么用?C++ AliCDBManager::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliCDBManager
的用法示例。
在下文中一共展示了AliCDBManager::Get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Error
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();
}
}
示例2: 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());
}
示例3: 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(§or2);
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(§or1);
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();
}
}
示例4:
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;
}
示例5: readCDB
//_____________________________________________________________________________
void readCDB (TObject *task1, Int_t runNumber) {
Float_t zero_timecdb[24]={0};
Float_t *timecdb = zero_timecdb;
Float_t cfdvalue[24][5];
for(Int_t i=0; i<24; i++)
for (Int_t i0=0; i0<5; i0++)
cfdvalue[i][i0] = 0;
Float_t zero_shiftcdb[4]={0};
Float_t *shiftcdb = zero_shiftcdb;
AliT0CalibOffsetChannelsTask *mytask = (AliT0CalibOffsetChannelsTask*)task1;
AliCDBManager* man = AliCDBManager::Instance();
AliCDBEntry *entry = AliCDBManager::Instance()->Get("GRP/CTP/CTPtiming");
if (!entry) ::Fatal("AddTaskT0Calib", "CTP timing parameters are not found in OCDB !");
AliCTPTimeParams *ctpParams = (AliCTPTimeParams*)entry->GetObject();
Float_t l1Delay = (Float_t)ctpParams->GetDelayL1L0()*25.0;
AliCDBEntry *entry1 = AliCDBManager::Instance()->Get("GRP/CTP/TimeAlign");
if (!entry1) ::Fatal("AddTaskT0Calib", "CTP time-alignment is not found in OCDB !");
AliCTPTimeParams *ctpTimeAlign = (AliCTPTimeParams*)entry1->GetObject();
l1Delay += ((Float_t)ctpTimeAlign->GetDelayL1L0()*25.0);
AliCDBEntry *entry4 = AliCDBManager::Instance()->Get("GRP/Calib/LHCClockPhase");
if (!entry4) ::Fatal("AddTaskT0Calib", "LHC clock-phase shift is not found in OCDB !");
AliLHCClockPhase *phase = (AliLHCClockPhase*)entry4->GetObject();
Float_t fGRPdelays = l1Delay - phase->GetMeanPhase();
AliCDBEntry* entryGRP = AliCDBManager::Instance()->Get("GRP/GRP/Data");
AliGRPObject* grpData = dynamic_cast<AliGRPObject*>(entryGRP->GetObject());
if (!grpData) {
::Error("AddTaskT0Calib","Failed to get GRP data for run %d",runNumber);
return;
}
TString LHCperiod = grpData->GetLHCPeriod();
Bool_t isLHC10b = LHCperiod.Contains("LHC10b");
Bool_t isLHC10c = LHCperiod.Contains("LHC10c");
// AliCDBEntry* entryGRP = AliCDBManager::Instance()->Get("GRP/GRP/Data");
// AliGRPObject* grpData = dynamic_cast<AliGRPObject*>(entryGRP->GetObject());
UInt_t timeStart = grpData->GetTimeStart();
UInt_t timeEnd = grpData->GetTimeEnd();
mytask->SetStartEndTime(timeStart,timeEnd);
cout<<"T0 start time "<<timeStart<<" end time "<<timeEnd<<endl;
::Info("AddTaskT0Calib","LHCperiod:%s ---> isLHC10b:%d isLHC10c:%d",
LHCperiod.Data(),(Int_t)isLHC10b, (Int_t)isLHC10c);
if(isLHC10b || isLHC10c) mytask-> SetRefPMT(12,2);
AliCDBEntry *entryCalib0 = man->Get("T0/Calib/Latency");
if(!entryCalib0) {
::Error("AddTastT0Calib","Cannot find any AliCDBEntry for [Calib, Latency]!");
return;
}
AliT0CalibLatency *calibda=(AliT0CalibLatency*)entryCalib0->GetObject();
Float_t fLatencyL1 = calibda->GetLatencyL1();
Float_t fLatencyHPTDC = calibda->GetLatencyHPTDC();
AliCDBEntry *entryCalib1 = man->Get("T0/Calib/TimeDelay");
if(!entryCalib1) {
::Error("AddTaskT0Calib","Cannot find any AliCDBEntry for [Calib, TimeDelay]!");
return;
}
else
{
AliT0CalibTimeEq *clb = (AliT0CalibTimeEq*)entryCalib1->GetObject();
timecdb = clb->GetTimeEq();
for(Int_t i=0; i<24; i++)
for (Int_t i0=0; i0<5; i0++){
cfdvalue[i][i0] = clb->GetCFDvalue(i, i0);
}
}
for (Int_t i=0; i<24; i++) {
Float_t cfdmean = cfdvalue[i][0];
if( cfdvalue[i][0] < 500 || cfdvalue[i][0] > 50000) cfdmean = ( 1000.*fLatencyHPTDC - 1000.*fLatencyL1 + 1000.*fGRPdelays)/24.4;
mytask->SetCFDvalue(i, cfdmean);
mytask->SetTimeEq(i, timecdb[i]);
}
AliCDBEntry *entryCalib2 = man->Get("T0/Calib/TimeAdjust");
if(!entryCalib2) {
::Error("AddTaskT0Calib","Cannot find any AliCDBEntry for [Calib, TimeAdjust]!");
}
else
{
AliT0CalibSeasonTimeShift *clb1 = (AliT0CalibSeasonTimeShift*)entryCalib2->GetObject();
shiftcdb = clb1->GetT0Means();
}
for (Int_t i=0; i<4; i++) mytask->SetT0Means(i,shiftcdb[i]);
}
示例6: MakeTRDFullMisAlignment
void MakeTRDFullMisAlignment(){
// Create TClonesArray of full misalignment objects for TRD
// Expects to read objects for FRAME
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",1000);
const char* macroname = "MakeTRDFullMisAlignment.C";
// Activate CDB storage and load geometry from CDB
AliCDBManager* cdb = AliCDBManager::Instance();
if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->SetRun(0);
AliCDBStorage* storage;
TString Storage;
if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
Storage = gSystem->Getenv("STORAGE");
if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
return;
}
storage = cdb->GetStorage(Storage.Data());
if(!storage){
Error(macroname,"Unable to open storage %s\n",Storage.Data());
return;
}
AliCDBPath path("GRP","Geometry","Data");
AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
if(!entry) Fatal(macroname,"Could not get the specified CDB entry!");
entry->SetOwner(0);
TGeoManager* geom = (TGeoManager*) entry->GetObject();
AliGeomManager::SetGeometry(geom);
}else{
AliGeomManager::LoadGeometry(); //load geom from default CDB storage
}
// load FRAME full misalignment objects (if needed, the macro
// for FRAME has to be ran in advance) and apply them to geometry
AliCDBPath fpath("GRP","Align","Data");
AliCDBEntry *eFrame;
if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
Info(macroname,"Loading FRAME alignment objects from CDB storage %s",
Storage.Data());
eFrame = storage->Get(fpath.GetPath(),cdb->GetRun());
}else{
eFrame = cdb->Get(fpath.GetPath());
}
if(!eFrame) Fatal(macroname,"Could not get the specified CDB entry!");
TClonesArray* arFrame = (TClonesArray*) eFrame->GetObject();
arFrame->Sort();
Int_t nvols = arFrame->GetEntriesFast();
Bool_t flag = kTRUE;
for(Int_t j=0; j<nvols; j++)
{
AliAlignObj* alobj = (AliAlignObj*) arFrame->UncheckedAt(j);
if (alobj->ApplyToGeometry() == kFALSE) flag = kFALSE;
}
if(!flag) Fatal(macroname,"Error in the application of FRAME objects");
// Sigmas for the chambers
Double_t smdx = 0.3; // 3 mm
Double_t smdy = 0.3; // 3 mm
Double_t smdz = 0.3; // 3 mm
Double_t smrx = 0.4 / 1000.0 / TMath::Pi()*180; // 0.4 mrad
Double_t smry = 2.0 / 1000.0 / TMath::Pi()*180; // 2.0 mrad
Double_t smrz = 0.4 / 1000.0 / TMath::Pi()*180; // 0.4 mrad
// Truncation for the chambers
Double_t cutSmdx = 3.0 * smdx;
Double_t cutSmdy = 3.0 * smdy;
Double_t cutSmdz = 3.0 * smdz;
// Sigmas for the chambers
Double_t chdx = 0.05; // 0.5 mm
Double_t chdy = 0.1; // 1.0 mm
Double_t chdz = 0.007; // 70 microns
Double_t chrx = 0.0005 / 1000.0 / TMath::Pi()*180; // 0 mrad
Double_t chry = 0.0005 / 1000.0 / TMath::Pi()*180; // 0 mrad
Double_t chrz = 0.3 / 1000.0 / TMath::Pi()*180; // 0.3 mrad
// Truncation for the chambers
Double_t cutChdx = 1.0 * chdx;
Double_t cutChdy = 1.0 * chdy;
Double_t cutChdz = 0.14 * chdz;
Int_t sActive[18]={1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1};
Double_t dx,dy,dz,rx,ry,rz;
Int_t j=0;
UShort_t volid;
const char *symname;
// create the supermodules' alignment objects
for (int iSect; iSect<18; iSect++) {
TString sm_symname(Form("TRD/sm%02d",iSect));
dx = AliMathBase::TruncatedGaus(0.0,smdx,cutSmdx);
dy = AliMathBase::TruncatedGaus(0.0,smdy,cutSmdy);
dz = AliMathBase::TruncatedGaus(0.0,smdz,cutSmdz);
rx = gRandom->Rndm() * 2.0*smrx - smrx;
ry = gRandom->Rndm() * 2.0*smry - smry;
rz = gRandom->Rndm() * 2.0*smrz - smrz;
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
//.........这里部分代码省略.........
示例7: CopyCDB
//.........这里部分代码省略.........
allowedObjects += " GRP/Calib/MeanVertexSPD";
allowedObjects += " GRP/CTP/Aliases";
allowedObjects += " MUON/Calib/GlobalTriggerCrateConfig";
allowedObjects += " MUON/Calib/LocalTriggerBoardMasks";
allowedObjects += " MUON/Calib/MappingData";
allowedObjects += " MUON/Calib/RegionalTriggerConfig";
allowedObjects += " MUON/Calib/TriggerLut";
allowedObjects += " MUON/Calib/Config";
allowedObjects += " MUON/Calib/Gains";
allowedObjects += " MUON/Calib/GlobalTriggerCrateConfig";
allowedObjects += " MUON/Calib/HV";
allowedObjects += " MUON/Calib/LocalTriggerBoardMasks";
allowedObjects += " MUON/Calib/MappingRunData";
allowedObjects += " MUON/Calib/Neighbours";
allowedObjects += " MUON/Calib/OccupancyMap";
allowedObjects += " MUON/Calib/Pedestals";
allowedObjects += " MUON/Calib/RecoParam";
allowedObjects += " MUON/Calib/RegionalTriggerConfig";
allowedObjects += " MUON/Calib/RejectList";
allowedObjects += " MUON/Calib/TriggerDCS";
allowedObjects += " MUON/Calib/TriggerEfficiency";
allowedObjects += " MUON/Calib/TriggerLut";
allowedObjects += " MUON/Calib/MappingData";
allowedObjects += " MUON/Align/Data";
allowedObjects += " GRP/Align/Data";
allowedObjects += " ITS/Align/Data";
allowedObjects += " VZERO/Align/Data";
allowedObjects += " FMD/Align/Data";
allowedObjects += " T0/Align/Data";
allowedObjects += " TPC/Align/Data";
allowedObjects += " TRD/Align/Data";
allowedObjects += " TOF/Align/Data";
allowedObjects += " ACORDE/Align/Data";
allowedObjects += " HLT/Calib/esdLayout";
allowedObjects += " HLT/Calib/RecoParam";
allowedObjects += " HLT/Calib/StreamerInfo";
allowedObjects += " PHOS/Align/Data";
allowedObjects += " EMCAL/Align/Data";
allowedObjects += " HMPID/Align/Data";
allowedObjects += " ZDC/Align/Data";
allowedObjects += " PMD/Align/Data";
allowedObjects += " GRP/Calib/MeanVertexTPC";
allowedObjects += " GRP/Calib/CosmicTriggers";
allowedObjects += " GRP/Calib/LHCClockPhase";
allowedObjects += " GRP/CTP/CTPtiming";
allowedObjects += " GRP/CTP/TimeAlign";
allowedObjects += " GRP/Calib/RecoParam";
allowedObjects += " GRP/CTP/Aliases";
allowedObjects += " ITS/Calib/RecoParam";
allowedObjects += " ITS/Calib/SPDNoisy";
allowedObjects += " ITS/Calib/SPDDead";
allowedObjects += " ITS/Calib/SPDSparseDead";
allowedObjects += " ITS/Calib/CalibSDD";
allowedObjects += " ITS/Calib/RespSDD";
allowedObjects += " ITS/Calib/DriftSpeedSDD";
allowedObjects += " ITS/Calib/DDLMapSDD";
allowedObjects += " ITS/Calib/MapsTimeSDD";
allowedObjects += " ITS/Calib/NoiseSSD";
allowedObjects += " ITS/Calib/GainSSD";
allowedObjects += " ITS/Calib/BadChannelsSSD";
allowedObjects += " ITS/Calib/SPDFOEfficiency";
allowedObjects += " ITS/Calib/SPDFONoise";
allowedObjects += " TRIGGER/SPD/PITConditions";
allowedObjects += " AD/Align/Data";
*/
AliCDBManager* cdb = AliCDBManager::Instance();
// determine dynamically the current year
TString fromUri(fromURI);
cdb->SetDefaultStorage(fromUri.Data());
cdb->SetRun(runnr);
cdb->SetDrain(toURI);
TString toUri(toURI);
AliCDBStorage *defaultStorage = cdb->GetDefaultStorage();
defaultStorage->QueryCDB(runnr);
TObjArray* allIdsForRun = defaultStorage->GetQueryCDBList();
TIter next(allIdsForRun);
AliCDBId* id = 0;
while ((id = dynamic_cast<AliCDBId*>(next())))
{
TString path(id->GetPath());
if ( !allowedObjects.Contains(path.Data() ) ) continue;
cdb->Get(path,cdb->GetRun());
}
}
示例8: retreiveCalibrationData
Int_t retreiveCalibrationData(Int_t fRunNumber)
{
AliCDBManager * man = AliCDBManager::Instance() ;
man->SetDefaultStorage("raw://") ;
//man->SetDefaultStorage("local://$ALICE_ROOT/OCDB") ;
man->SetRun(fRunNumber) ;
AliCDBEntry * bmEntry = man->Get("PHOS/Calib/EmcBadChannels/") ;
// Get the BCM for PHOS
phosBcm = (AliPHOSEmcBadChannelsMap*)bmEntry->GetObject();
if (!phosBcm)
{
std::cerr << "ERROR: Could not get the bad channel map for PHOS" << std::endl;
}
else
{
Int_t *tmpList = new Int_t[phosBcm->GetNumOfBadChannels()];
phosBcm->BadChannelIds(tmpList);
badChannels.resize(0);
for(Int_t n = 0; n < phosBcm->GetNumOfBadChannels(); n++)
{
badChannels.push_back(tmpList[n]);
}
}
// Get the gains for PHOS
AliCDBPath path("PHOS","Calib","EmcGainPedestals");
if (path.GetPath())
{
AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path);
if (pEntry)
{
phosCalibData = (AliPHOSEmcCalibData*)pEntry->GetObject();
if (!phosCalibData)
{
std::cerr << "ERROR: Could not get calibration data for PHOS" << std::endl;
return -1;
}
}
else
{
std::cerr << "ERROR: Could not get CDB entry for PHOS calib data" << std::endl;
return -1;
}
}
AliCDBPath geompath("GRP","Geometry","Data");
TGeoManager *geoManager = 0;
if(path.GetPath())
{
// HLTInfo("configure from entry %s", path.GetPath());
AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(geompath/*,GetRunNo()*/);
if (pEntry)
{
if(geoUtils)
{
delete geoUtils;
geoUtils = 0;
}
if(!geoManager) geoManager = (TGeoManager*) pEntry->GetObject();
if(geoManager)
{
geoUtils = new AliPHOSGeoUtils("PHOS", "noCPV");
geom = new AliPHOSGeometry("PHOS", "noCPV");
}
else
{
std::cerr << "can not get gGeoManager from OCDB" << std::endl;
}
}
else
{
std::cerr << "can not fetch object " << path.GetPath().Data() << " from OCDB" << std::endl;
}
}
AliCDBPath recoPath("PHOS", "Calib", "RecoParam");
if(recoPath.GetPath())
{
// HLTInfo("configure from entry %s", path.GetPath());
AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(recoPath/*,GetRunNo()*/);
if (pEntry)
{
TObjArray *paramArray = dynamic_cast<TObjArray*>(pEntry->GetObject());
if(paramArray)
{
recoParam = dynamic_cast<AliPHOSRecoParam*>((paramArray)->At(0));
}
if(!recoParam)
{
std::cerr << "can not fetch object reconstruction parameters from " << recoPath.GetPath().Data() << std::endl;;
return -1;
}
}
else
{
std::cerr << "can not fetch object " << recoPath.GetPath().Data() << " from OCDB" << std::endl;
//.........这里部分代码省略.........
示例9: MakeSnapshot
void MakeSnapshot(Int_t run, const char* defStorage, TMap* specStorages, const char* snapshotFileName)
{
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage(defStorage);
cdb->SetRun(run);
TIter iter(specStorages->GetTable());
TPair *pair = 0;
while((pair = dynamic_cast<TPair*> (iter.Next()))){
TObjString* caltype = dynamic_cast<TObjString*> (pair->Key());
TObjString* specstor= dynamic_cast<TObjString*> (pair->Value());
if (caltype && specstor)
//TString calType = caltype->GetString();
//TString specStor = specstor->GetString();
//cdb->SetSpecificStorage(calType.Data(),specStor.Data());
cdb->SetSpecificStorage(caltype->GetString().Data(),specstor->GetString().Data());
else
//AliFatal("Error reading info for specific storage")
Printf("Error reading info for specific storage");
}
// ********************************** GRP ******************************************
cdb->Get("GRP/CTP/Config");
cdb->Get("GRP/Calib/LHCClockPhase");
cdb->Get("GRP/GRP/Data");
cdb->Get("GRP/Align/Data");
cdb->Get("GRP/Calib/MeanVertexSPD");
cdb->Get("GRP/Calib/MeanVertex");
cdb->Get("GRP/Calib/MeanVertexTPC");
cdb->Get("GRP/Calib/CosmicTriggers");
cdb->Get("GRP/CTP/Scalers");
cdb->Get("GRP/CTP/CTPtiming");
cdb->Get("GRP/CTP/TimeAlign");
cdb->Get("GRP/GRP/LHCData");
cdb->Get("GRP/Calib/RecoParam");
// ********************************** ALL ******************************************
TString detStr = ("ITS TPC TRD TOF PHOS HMPID EMCAL MUON ZDC PMD T0 VZERO");
//TString detStr = ("ITS MUON TPC");
TObjArray *arr = detStr.Tokenize(' ');
for (Int_t iDet=0; iDet<arr->GetEntries(); iDet++) {
TObjString *detOStr = dynamic_cast<TObjString*>(arr->At(iDet));
AliCDBManager::Instance()->GetAll(Form("%s/Calib/*",detOStr->GetString().Data()));
AliCDBManager::Instance()->Get(Form("%s/Align/Data",detOStr->GetString().Data()));
}
// ******************************** TRIGGER ****************************************
// Temporary fix - one has to define the correct policy in order
// to load the trigger OCDB entries only for the detectors that
// in the trigger or that are needed in order to put correct
// information in ESD
AliCDBManager::Instance()->GetAll("TRIGGER/*/*");
// ********************************** HLT ******************************************
// cdb->Get("HLT/ConfigHLT/esdLayout");
// cdb->Get("HLT/Calib/StreamerInfo");
TMap* entriesMap = const_cast<TMap*>(cdb->GetEntryCache());
Printf("\nentriesMap has %d entries!\n", entriesMap->GetEntries());
TList* entriesList = const_cast<TList*>(cdb->GetRetrievedIds());
Printf("\nentriesList has %d entries!\n", entriesList->GetEntries());
//TString filename(TString::Format("CDBsnapshot_Run%d.root",run));
TString filename(snapshotFileName);
TFile *f = new TFile(filename.Data(),"recreate");
f->cd();
f->WriteObject(entriesMap,"entriesMap");
f->WriteObject(entriesList,"entriesList");
f->Close();
entriesMap->SetOwnerKeyValue(kFALSE,kFALSE);
entriesList->SetOwner(kFALSE);
}
示例10: sim
void sim() {
Int_t nev = -1;
Int_t run = 0;
Int_t nskip = 0;
const char *fname;
// char fnaneopt[1024];
const char *esdname;
const char *trgname;
const char *embrun;
const char *runtype;
const char *fnameopt;
if (gSystem->Getenv("DC_RUN")) {
run = atoi(gSystem->Getenv("DC_RUN"));
}
if (gSystem->Getenv("DC_RAWFILE")) {
fname = gSystem->Getenv("DC_RAWFILE");
} else {
printf("DC_RAWFILE is not set and is needed!!!");
return;
}
if (gSystem->Getenv("DC_ESDFILE")) {
esdname = gSystem->Getenv("DC_ESDFILE");
} else {
printf("DC_ESDFILE is not set and is needed!!!");
return;
}
if (gSystem->Getenv("DC_NEVENTS")) {
nev = atoi(gSystem->Getenv("DC_NEVENTS"));
// gSystem->Exec("echo ${DC_NEVENTS} > ${DC_NEVENTS}_${DC_NEVENTS}_0_${DC_NEVENTS}.stat"); // moved after selection!
}
if (gSystem->Getenv("DC_EEVENT")) {
nskip = atoi(gSystem->Getenv("DC_EEVENT"));
}
if (gSystem->Getenv("DC_TRGNAME")) {
trgname = gSystem->Getenv("DC_TRGNAME");
printf("Looking for %s\n",trgname);
} else {
printf("DC_TRGNAME not set, will embedd in all events!!!");
return;
}
if (gSystem->Getenv("CONFIG_EMBEDDING")) {
embrun = gSystem->Getenv("CONFIG_EMBEDDING");
} else {
printf("CONFIG_EMBEDDING is not set and is needed");
return;
}
if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
runtype = gSystem->Getenv("CONFIG_RUN_TYPE");
} else {
printf("CONFIG_RUN_TYPE is not set and is needed");
return;
}
TString sfname(fname);
printf("sim.C: running in %s mode on run %d for %d events and skipping %d esd events\n",embrun,run,nev,nskip);
printf("sim.C: rawfile %s and esdfile %s \n",sfname.Data(),esdname);
AliSimulation simulator;
// BACKGROUND: Convert raw data to SDigits
if (!(strcmp(embrun,"kBackground"))){
AliCDBManager *cdbm = AliCDBManager::Instance();
cdbm->SetDefaultStorage("alien://Folder=/alice/data/2011/OCDB");
cdbm->SetRun(run);
AliGRPManager grpM;
grpM.ReadGRPEntry();
grpM.SetMagField();
printf("Field is locked now. It cannot be changed in Config.C\n");
simulator.SetMakeSDigits("MUON ITS");
// only physics events
sfname += "?EventType=7";
// select one trigger ...
if (trgname){
AliCDBEntry *grp_ctp = cdbm->Get("GRP/CTP/Config",run);
AliTriggerConfiguration *trg_conf = (AliTriggerConfiguration *)grp_ctp->GetObject();
trg_conf->Print();
TObjArray trg_masks = trg_conf->GetClasses(); // Reference!!!
std::vector<unsigned char> triggerconfs;
for(Int_t iobj = 0; iobj < trg_masks.GetEntriesFast(); iobj++){
AliTriggerClass *trg_class = (AliTriggerClass*)trg_masks.UncheckedAt(iobj);
AliTriggerCluster *trg_clust = (AliTriggerCluster *)trg_class->GetCluster();
// printf("%s %s \n",trg_class->GetName(),trgname);
if(TString(trg_class->GetName()).Contains(trgname)){
printf("We will embed into events containing this trigger name(mask): %s(%d)\n",trg_class->GetName(),trg_class->GetMask());
char triggerbuf[256];
sprintf(triggerbuf, "?Trigger=%d", trg_class->GetMask());
sfname += triggerbuf;
// triggerconfs.push_back(trg_class->GetMask());
}
}
// Int_t itrg = 0;
// printf("Number of Trigger Clusters including MUON: %d\n", (Int_t)triggerconfs.size());
// for(std::vector<unsigned char>::iterator it = triggerconfs.begin(); it < triggerconfs.end(); it++)
//.........这里部分代码省略.........