本文整理汇总了C++中AliCDBMetaData类的典型用法代码示例。如果您正苦于以下问题:C++ AliCDBMetaData类的具体用法?C++ AliCDBMetaData怎么用?C++ AliCDBMetaData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AliCDBMetaData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OccupancyAscii2OCDB
void OccupancyAscii2OCDB(Int_t runNumber,
TObjArray& filenames,
const char* ocdbpath,
const char* comment)
{
AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
AliCDBManager::Instance()->SetRun(runNumber);
AliCDBManager::Instance()->SetSpecificStorage("MUON/Calib/OccupancyMap",ocdbpath);
AliMpCDB::LoadAll();
AliMUON2DMap occupancy(kTRUE);
TObjString* str;
TIter next(&filenames);
while ( ( str = static_cast<TObjString*>(next()) ) )
{
TString data;
ReadOccupancyFile(str->String().Data(),data);
AliMUONTrackerIO::DecodeOccupancy(data.Data(),occupancy);
}
if (occupancy.GetSize())
{
AliCDBId id("MUON/Calib/OccupancyMap",runNumber,runNumber);
AliCDBMetaData metaData;
metaData.SetBeamPeriod(0);
metaData.SetResponsible("MUON TRK");
metaData.SetComment(comment);
AliCDBManager::Instance()->Put(&occupancy,id,&metaData);
}
}
示例2: MakeCDBEntryTriggerMask
MakeCDBEntryTriggerMask(Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity())
{
UInt_t triggerMask[72];
for (Int_t i = 0; i < 72; i++)
triggerMask[i] = 0xffffff;
/* create object */
AliTOFTriggerMask *obj = new AliTOFTriggerMask();
obj->SetTriggerMaskArray(triggerMask);
/* create cdb info */
AliCDBId id("TRIGGER/TOF/TriggerMask", startRun, endRun);
AliCDBMetaData *md = new AliCDBMetaData();
md->SetResponsible("Roberto Preghenella");
md->SetComment("TOF Trigger Mask");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
md->SetBeamPeriod(0);
/* put object in cdb */
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->GetDefaultStorage()->Put(obj, id, md);
}
示例3: 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());
}
示例4: MakeLHCClockPhaseEntry
void MakeLHCClockPhaseEntry(const char *cdbStorage = "local://$ALICE_ROOT/OCDB")
{
// Example macro to put in OCDB the default (=0) LHC-clock phase
// It is valid fro runs from 0 to inf
// The timestamp range is also inf (we store the first and last value for
// each beam)
AliCDBManager *man = AliCDBManager::Instance();
man->SetDefaultStorage(cdbStorage);
AliLHCClockPhase phaseObj;
phaseObj.AddPhaseB1DP(0,0.);
phaseObj.AddPhaseB2DP(0,0.);
phaseObj.AddPhaseB1DP(2147483647,0.);
phaseObj.AddPhaseB2DP(2147483647,0.);
AliCDBMetaData* metadata = new AliCDBMetaData();
metadata->SetResponsible("Cvetan Cheshkov");
metadata->SetComment("Default LHC-clock phase object");
AliCDBId id("GRP/Calib/LHCClockPhase",0,AliCDBRunRange::Infinity());
man->Put(&phaseObj,id,metadata);
return;
}
示例5: MakeQAThresholdsEntry
void MakeQAThresholdsEntry(const char* storageUri="local://$ALICE_ROOT/../AliRoot/OCDB", Int_t firstRun=0, Int_t lastRun=999999999)
{
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage(storageUri);
// QAThresholds
TObjArray* qaThrArray = new TObjArray();
for (Int_t idet = 0; idet < AliDAQ::kNDetectors; idet++){
TString detName = AliDAQ::OnlineName(idet);
if (detName == "TRI" || detName == "HLT" || detName == "TST") continue; // skipping TRI, HLT, TST since they do not produce QAThresholds
Printf("Processing QAThreshold for detector %s",detName.Data());
TString inFile(gSystem->ExpandPathName("$ALICE_ROOT/../AliRoot/GRP/ShuttleInput/"));
inFile += "run000168322_";
inFile += detName;
inFile += "_DQM_QAThresholds";
Printf("Opening QAThreshold file %s", inFile.Data());
TFile dqmFile(inFile.Data(),"READ");
if (dqmFile.IsOpen()) {
AliQAThresholds* qaThr = dynamic_cast<AliQAThresholds*>(dqmFile.Get(detName.Data()));
if (qaThr){
Int_t qaThrId = qaThr->GetDetectorId();
if (qaThrId != idet){
Printf("ERROR: Expecting QA threshold for detector %s, but found that for detector %s, skipping",detName.Data(), AliDAQ::OnlineName(qaThrId));
continue;
}
else{
qaThrArray->AddAtAndExpand(qaThr, qaThrId);
}
}
else {
Printf("ERROR: No QAThresholds object found in the file for detector %s, skipping",detName.Data());
continue;
}
}
else {
Printf("ERROR: Can't open QAThreshold file for detector %s, skipping",detName.Data());
continue;
}
}
if (qaThrArray->GetEntries() > 0){
AliCDBMetaData md;
md.SetResponsible("Barthélémy von Haller");
md.SetComment("QA Threshold TObjArray");
AliCDBId id("GRP/Calib/QAThresholds", firstRun, lastRun);
cdb->Put(qaThrArray, id, &md);
}
else{
Printf("No valid QAThresholds entries found, storing nothing in the OCDB");
}
}
示例6: WriteDCSAliasMap
void WriteDCSAliasMap()
{
// This writes the output from CreateDCSAliasMap to a CDB file
TMap* dcsAliasMap = CreateDCSAliasMap();
AliCDBMetaData metaData;
metaData.SetBeamPeriod(0);
metaData.SetResponsible("Responsible person");
metaData.SetComment("Test object for TestPreprocessor.C");
AliCDBId id("DET/DCS/Data", 0, 0);
// look into AliTestShuttle's CDB main folder
AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
->Put(dcsAliasMap, id, &metaData);
}
示例7: MakeCDBEntryCTPLatency
MakeCDBEntryCTPLatency(Float_t value = 0., Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity())
{
/* create object */
AliTOFCTPLatency *obj = new AliTOFCTPLatency();
obj->SetCTPLatency(value);
/* create cdb info */
AliCDBId id("TOF/Calib/CTPLatency", startRun, endRun);
AliCDBMetaData *md = new AliCDBMetaData();
md->SetResponsible("Roberto Preghenella");
md->SetComment("CTPLatency (ps)");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
md->SetBeamPeriod(0);
/* put object in cdb */
AliCDBManager *cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->GetDefaultStorage()->Put(obj, id, md);
}
示例8: 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);
}
示例9: 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());
}
}
示例10: MakeADLightYieldsEntry
void MakeADLightYieldsEntry(const char *outputCDB = "local://$ALICE_ROOT/../AliRoot/OCDB")
{
AliCDBManager *man = AliCDBManager::Instance();
man->SetDefaultStorage(outputCDB);
// Creation of the light yields OCDB object
const Double_t lightYieldCorr[18] = {0.0,
2.2e-4,2.2e-4,2.2e-4,2.2e-4, 2.2e-4,2.2e-4,2.2e-4,2.2e-4,
2.4e-4,2.4e-4,2.6e-4,2.6e-4, 2.4e-4,2.4e-4,2.6e-4,2.6e-4,
0.0};
TH1F *yields = new TH1F("ADLightYields", "AD Light Yields", 16, -0.5, 15.5);
yields->SetContent(lightYieldCorr);
AliCDBMetaData *md = new AliCDBMetaData(); // metaData describing the object
md->SetResponsible("Michal Broz");
md->SetBeamPeriod(0);
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
md->SetComment("Light Yields channel by channel");
md->PrintMetaData();
AliCDBId id("AD/Calib/LightYields", 0, AliCDBRunRange::Infinity());
man->Put(yields, id, md);
delete md;
}
示例11: MakeMFTZeroMisAlignment
void MakeMFTZeroMisAlignment(TString Storage = "alien://folder=/alice/cern.ch/user/a/auras/OCDB/") {
// Create TClonesArray of zero misalignment objects for MFT
const char* macroname = "MakeMFTZeroMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
Int_t iIndex=0;
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
TString MFT("MFT");
new (alobj[0]) AliAlignObjParams(MFT.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
// save in CDB storage
if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
return;
}
Info(macroname,"Saving alignment objects in CDB storage %s", Storage.Data());
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
if(!storage){
Error(macroname,"Unable to open storage %s\n",Storage.Data());
return;
}
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Antonio Uras");
md->SetComment("Alignment objects for MFT zero-misalignment");
md->SetAliRootVersion(gROOT->GetVersion());
AliCDBId id("MFT/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
array->Delete();
}
示例12: SetOCDBFromRun1
///
/// Main method
///
/// \param year: year to set geometry and run range
/// \param printAll: verbosity checks
///
void SetOCDBFromRun1(Int_t year = 2010, Bool_t printAll = kFALSE)
{
TGrid::Connect("alien://");
Int_t run = 182325; //2012
if(year == 2010) run = 134908;
if(year == 2011) run = 159582;
AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorage("raw://");
man->SetRun(run);
AliCDBStorage *storage = man->GetDefaultStorage();
// Instantiate EMCAL geometry for the first time
AliEMCALGeometry * geom;
if (year == 2010) geom = AliEMCALGeometry::GetInstance("EMCAL_FIRSTYEARV1"); // 2010
else geom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1"); // 2011-2012-2013
//else geom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1_DCAL_8SM"); // Run2
const Int_t nSM = geom->GetNumberOfSuperModules();
// Get the final OCDB object
AliEMCALCalibData* cparam = (AliEMCALCalibData*) (storage->Get("EMCAL/Calib/Data", run)->GetObject());
// Access OCDB file with the first version of the calibration
TString first = "Run177115_999999999_v2_s0.root";
if(year==2010) first = "Run113461_999999999_v3_s0.root";
if(year==2011) first = "Run144484_999999999_v3_s0.root";
TFile * f = TFile::Open(Form("alien:///alice/data/%d/OCDB/EMCAL/Calib/Data/%s",year,first.Data()),"READ");
AliCDBEntry * cdb = (AliCDBEntry*) f->Get("AliCDBEntry");
AliEMCALCalibData* cparam1 = (AliEMCALCalibData*) cdb->GetObject();
// New OCDB container
AliEMCALCalibData *cparamnew=new AliEMCALCalibData("EMCAL");
// Do the comparison
Float_t param = -1;
Float_t param1 = -1;
Int_t iCol = -1, iRow = -1, iSM =-1, iMod = -1,iIphi =-1,iIeta = -1;
for(Int_t i=0;i < nSM*24*48; i++)
{
//printf("AbsID %d\n",i);
geom->GetCellIndex(i,iSM,iMod,iIphi,iIeta);
geom->GetCellPhiEtaIndexInSModule(iSM,iMod, iIphi, iIeta,iRow,iCol);
Float_t param = -1;
if( cparam ) param = cparam ->GetADCchannel(iSM,iCol,iRow);
Float_t param1 = -1;
if( cparam1 ) param1 = cparam1->GetADCchannel(iSM,iCol,iRow);
if (printAll)
printf("ID %d, col %d, row %d, sm %d final %1.4f, first %1.4f\n",
i,iCol,iRow,iSM,param, param1);
cparamnew->SetADCchannel (iSM,iCol,iRow,param );
cparamnew->SetADCchannelOnline(iSM,iCol,iRow,param1);
}
// Create OCDB File
AliCDBMetaData md;
md.SetComment("Calibration after calibration with pi0, store also first online calibration");
md.SetBeamPeriod(0);
md.SetResponsible("Gustavo Conesa");
md.SetAliRootVersion(gSystem->Getenv("ARVERSION"));
// Careful, select here the first run where this calibration is valid
Int_t firstRun = 172439; // 2012-13
if(year == 2010) firstRun = 113461;
if(year == 2011) firstRun = 144484;
AliCDBId id("EMCAL/Calib/Data",firstRun,AliCDBRunRange::Infinity()); // create in EMCAL/Calib/Data DBFolder
AliCDBManager* man2 = AliCDBManager::Instance();
AliCDBStorage* loc = man2->GetStorage(Form("local://%d",year));
loc->Put(cparamnew, id, &md);
}
示例13: MakeTRDFullMisAlignment
//.........这里部分代码省略.........
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;
new((*array)[j++]) AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kFALSE);
}
// apply supermodules' alignment objects
Int_t smCounter=0;
for(Int_t iSect=0; iSect<18; iSect++){
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
AliAlignObjParams* smobj =
(AliAlignObjParams*)array->UncheckedAt(smCounter++);
if(!smobj->ApplyToGeometry()){
Fatal(macroname,Form("application of full misalignment object for sector %d failed!",iSect));
return;
}
}
// create the chambers' alignment objects
ran = new TRandom(4357);
Int_t chId;
for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
chId=-1;
for (Int_t iSect = 0; iSect < 18; iSect++){
for (Int_t iCh = 0; iCh < 5; iCh++) {
dx = AliMathBase::TruncatedGaus(0.0,chdx,cutChdx);
dy = AliMathBase::TruncatedGaus(0.0,chdy,cutChdy);
dz = AliMathBase::TruncatedGaus(0.0,chdz,cutChdz);
rx = gRandom->Rndm() * 2.0*chrx - chrx;
ry = gRandom->Rndm() * 2.0*chry - chry;
rz = gRandom->Rndm() * 2.0*chrz - chrz;
chId++;
if ((iSect==13 || iSect==14 || iSect==15) && iCh==2) continue;
volid = AliGeomManager::LayerToVolUID(iLayer,chId);
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
symname = AliGeomManager::SymName(volid);
new((*array)[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
}
}
}
if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "TRDfullMisalignment.root";
TFile f(filename,"RECREATE");
if(!f){
Error(macroname,"cannot open file for output\n");
return;
}
Info(macroname,"Saving alignment objects to the file %s", filename);
f.cd();
f.WriteObject(array,"TRDAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
Info(macroname,"Saving alignment objects in CDB storage %s",
Storage.Data());
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Dariusz Miskowiec");
md->SetComment("Full misalignment for TRD");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
AliCDBId id("TRD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
}
示例14: MakeCosmicTriggersEntry
Bool_t MakeCosmicTriggersEntry(const char *fileName, const char* cdbUri)
{
const char* macroname = "MakeCosmicTriggersEntry.C";
if (gSystem->AccessPathName(fileName)) {
Error(macroname,Form("file (%s) not found", fileName));
return kFALSE;
}
ifstream *file = new ifstream(fileName);
if (!*file) {
Error(macroname,Form("Error opening file (%s) !",fileName));
file->close();
delete file;
return kFALSE;
}
THashTable *table = new THashTable();
table->SetName("List of defined cosmic triggers");
TString strLine;
while (strLine.ReadLine(*file)) {
if (strLine.BeginsWith("#")) continue;
strLine.ReplaceAll(" ","");
strLine.ReplaceAll("\t","");
if (strLine.IsNull()) continue;
TObjString *obj = new TObjString(strLine.Data());
table->Add(obj);
}
file->close();
delete file;
// create OCDB storage
TString Storage(cdbUri);
if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
return kFALSE;
}
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
if(!storage){
Error(macroname,"Unable to open storage %s\n",Storage.Data());
return kFALSE;
}
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("Federico Antinori");
md->SetComment("List of the defined cosmic triggers. It is used in order to steer the reconstruction, namely in the selection of the proper event specie. It is maintained and updated by the trigger coordinator.");
// Get root and AliRoot versions and set them in the metadata
const char* rootv = gROOT->GetVersion();
TString av(ALIROOT_VERSION);
TString revnum(ALIROOT_REVISION);
av+=" - revision: ";
av+=revnum;
md->SetAliRootVersion(av.Data());
AliCDBId id("GRP/Calib/CosmicTriggers",0,AliCDBRunRange::Infinity());
Info(macroname,"Saving the list of defined cosmic triggers in the OCDB storage \"%s\"",Storage.Data());
storage->Put(table,id,md);
table->Delete();
delete table;
return kTRUE;
}
示例15: SetCC
//------------------------------------------------------------------------
void SetCC(Int_t flag=0)
{
// Writing calibration coefficients into the Calibration DB
// Arguments:
// flag=0: all calibration coefficients are equal
// flag=1: decalibration coefficients
// flag=2: calibration coefficients equal to inverse decalibration ones
// Author: Boris Polishchuk (Boris.Polichtchouk at cern.ch)
TString DBFolder;
Int_t firstRun = 0;
Int_t lastRun = 0;
Int_t beamPeriod = 1;
char* objFormat = "";
AliPHOSCalibData* cdb = 0;
if (flag == 0) {
// Ideal calibration with all channels at nominal value 0.005
DBFolder ="local://InitCalibDB";
firstRun = 0;
lastRun = AliCDBRunRange::Infinity();
objFormat = "PHOS ideal pedestals and ADC gain factors (5x64x56)";
cdb = new AliPHOSCalibData();
cdb->CreateNew();
}
else if (flag == 1) {
// Full decalibration is +-10% of the nominal value
DBFolder ="local://FullDecalibDB";
firstRun = 0;
lastRun = AliCDBRunRange::Infinity();
objFormat = "PHOS fully decalibrated calibration coefficients (5x64x56)";
cdb = new AliPHOSCalibData();
cdb->RandomEmc(0.045,0.055);
cdb->RandomCpv(0.0008,0.0016);
}
else if (flag == 2) {
// Residual decalibration is +-1% of the nominal value
DBFolder ="local://ResidualCalibDB";
firstRun = 0;
lastRun = AliCDBRunRange::Infinity();
objFormat = "PHOS residual calibration coefficients (5x64x56)";
cdb = new AliPHOSCalibData();
cdb->RandomEmc(0.00495,0.00505);
cdb->RandomCpv(0.00115,0.00125);
}
//Store calibration data into database
AliCDBMetaData md;
md.SetComment(objFormat);
md.SetBeamPeriod(beamPeriod);
md.SetResponsible("Boris Polichtchouk");
AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
if(gSystem->Getenv("STORAGE")){
cout << "Setting specific storage" << endl;
AliCDBManager::Instance()->SetSpecificStorage("PHOS/*",DBFolder.Data());
}
cdb->WriteEmc(firstRun,lastRun,&md);
cdb->WriteCpv(firstRun,lastRun,&md);
cdb->WriteEmcBadChannelsMap(firstRun,lastRun,&md);
}