本文整理汇总了C++中AliCDBEntry::SetOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ AliCDBEntry::SetOwner方法的具体用法?C++ AliCDBEntry::SetOwner怎么用?C++ AliCDBEntry::SetOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AliCDBEntry
的用法示例。
在下文中一共展示了AliCDBEntry::SetOwner方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeTRDResMisAlignment
void MakeTRDResMisAlignment(){
// Create TClonesArray of residual misalignment objects for TRD
//
const char* macroname = "MakeTRDResMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",1000);
TClonesArray &alobj = *array;
// 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;
if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
TString 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
}
// sigmas for the chambers
Double_t chdx = 0.002; // 20 microns
Double_t chdy = 0.003; // 30 microns
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.1 / 1000.0 / TMath::Pi()*180; // 0.1 mrad
// Truncation for the chambers
Double_t cutChdx = 3.0 * chdx;
Double_t cutChdy = 3.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=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
Int_t j=0;
UShort_t volid;
const char* symname;
// create the supermodules' alignment objects
for (Int_t iSect=0; iSect<18; iSect++) {
TString sm_symname(Form("TRD/sm%02d",iSect));
if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
new((*array)[j++])
AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kTRUE);
}
// create the chambers' alignment objects
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(alobj[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
}
}
}
if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
// save on file
const char* filename = "TRDresidualMisalignment.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
//.........这里部分代码省略.........
示例2: MakeAllDETsFullMisAlignment
void MakeAllDETsFullMisAlignment(Char_t* CDBstorage = "local://$HOME/FullMisAlignment", Bool_t partialGeom=kFALSE){
// Make full misalignment objects for all detectors
// Pass different "CDBstorage" argument if needed (e.g. to fill
// conditions' data base on alien) or set it to null string to have
// the objects saved locally on file
// This macro defines the default name and place for the detector-macros
// in charge of producing the full misalignment objects as
// $ALICE_ROOT/DET/MakeDETFullMisAlignment.C
//
const char* macroname="MakeAllDETsFullMisAlignment.C";
TString strStorage(CDBstorage);
if(strStorage.IsNull()){
gSystem->Setenv("TOCDB","kFALSE");
}else{
gSystem->Setenv("TOCDB","kTRUE");
gSystem->Setenv("STORAGE",strStorage.Data());
gSystem->Setenv("ARVERSION",ALIROOT_VERSION);
}
if(partialGeom){
gSystem->Setenv("REALSETUP","kTRUE");
}else{
gSystem->Setenv("REALSETUP","kFALSE");
}
// Load geometry from CDB updating it if we are producing the
// alignment objects for the CDB
AliCDBManager* cdb = AliCDBManager::Instance();
if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
cdb->SetRun(0);
if(strStorage.IsNull()){ //if we produce the objects into a file
AliGeomManager::LoadGeometry(); //load geom from default CDB storage
}else{ // if we produce the objects in a CDB storage
// update geometry in it
Info(macroname,"Updating geometry in CDB storage %s",strStorage.Data());
gROOT->ProcessLine(".L $ALICE_ROOT/GRP/UpdateCDBIdealGeom.C");
if(partialGeom){
UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config_PDC06.C");
}else{
UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config.C");
}
// load the same geometry from given CDB storage
AliCDBPath path("GRP","Geometry","Data");
AliCDBStorage* storage = cdb->GetStorage(strStorage.Data());
AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
if(!entry) Fatal(macroname,"Couldn't load geometry data from CDB!");
entry->SetOwner(0);
TGeoManager* geom = (TGeoManager*) entry->GetObject();
if (!geom) Fatal(macroname,"Couldn't find TGeoManager in the specified CDB entry!");
AliGeomManager::SetGeometry(geom);
}
// run macro for non-sensitive modules
// (presently generates only FRAME alignment objects)
gSystem->Exec("aliroot -b -q $ALICE_ROOT/GRP/MakeSTRUCTFullMisAlignment.C");
// run macros for sensitive modules
TString sModules="ACORDE,EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
TObjArray *detArray = sModules.Tokenize(',');
TIter iter(detArray);
TObjString *ostr;
TString exec_det_macro;
while((ostr = (TObjString*) iter.Next())){
TString str(ostr->String());
exec_det_macro="aliroot -b -q $ALICE_ROOT/";
exec_det_macro+=str;
exec_det_macro+="/Make";
exec_det_macro+=str;
exec_det_macro+="FullMisAlignment.C";
gSystem->Exec(exec_det_macro.Data());
}
return;
}
示例3: MakeACORDEZeroMisAlignment
void MakeACORDEZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for ACORDE
//
const char* macroname = "MakeACORDEZeroMisAlignment.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;
//load geom from local file till ACORDE is not switched on by default in standard config-files
if( TString(gSystem->Getenv("TOCDB")) == TString("kTRUE") ){
TString 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
}
// AliGeomManager::LoadGeometry("geometry.root");
TClonesArray *array = new TClonesArray("AliAlignObjParams",64);
TClonesArray &alobj = *array;
TRandom *rnd = new TRandom(4321);
Int_t j = 0;
Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
// RS = local
// sigma translation
// sigma rotation
TString symname;
TString basename = "ACORDE/Array";
Int_t iIndex=0;
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
for (Int_t imod=0; imod<60; imod++){
symname = basename;
symname += imod;
new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz,dpsi, dtheta, dphi, kFALSE);
}
if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
const char* filename = "ACORDEZeroMisalignment.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,"ACORDEAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
AliCDBMetaData* md = new AliCDBMetaData();
md->SetResponsible("E. Cuautle & M. Rodriguez");
md->SetComment("Zero misalignment for ACORDE");
md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
AliCDBId id("ACORDE/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
}
示例4: 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;
//.........这里部分代码省略.........
示例5: MakeTOFResMisAlignment
void MakeTOFResMisAlignment() {
//
// Create TClonesArray of residual misalignment objects for TOF
//
const char* macroname = "MakeTOFResMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",2000);
TClonesArray &alobj = *array;
// 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
AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
Int_t j=0;
Int_t nSectors=18;
//Produce objects for TOF supermodules
Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t dvoluid = AliGeomManager::LayerToVolUID(iLayer,iIndex); //dummy vol id
Double_t smdx, smdy, smdz=0., dpsi=0., dtheta, dphi=0.;
for(Int_t isect=0; isect<nSectors; isect++) {
TString symname(Form("TOF/sm%02d",isect));
new(alobj[j++]) AliAlignObjParams(symname.Data(),
dvoluid,
smdx, smdy, smdz, dpsi, dtheta, dphi, kFALSE);
}
Int_t strId=-1;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
//TRandom *rnd = new TRandom(4357);
Double_t sigmatr = 0.1; // sigma (in cm) for shift w.r.t. local ideal RS
Int_t nstrA=15;
Int_t nstrB=19;
Int_t nstrC=19;
Int_t nStrips=nstrA+2*nstrB+2*nstrC;
Double_t cuty=0., cutz=0., cut=3*sigmatr;
for (Int_t isect = 0; isect < nSectors; isect++) {
for (Int_t istr = 1; istr <= nStrips; istr++) {
//dy = rnd->Gaus(0.,sigmatr);
//dz = rnd->Gaus(0.,sigmatr);
//strId++;
switch (istr) {
case 25:
case 29:
case 63:
case 67:
cuty = sigmatr*0.6;
dy = AliMathBase::TruncatedGaus(0., sigmatr, cut, cuty);
dz = AliMathBase::TruncatedGaus(0., sigmatr, cut);
strId++;
break;
/*
case 38:
cuty = sigmatr*2.5;
cutz = sigmatr*2.5;
dy = AliMathBase::TruncatedGaus(0., sigmatr, cut, cuty);
dz = AliMathBase::TruncatedGaus(0., sigmatr, cut, cutz);
strId++;
break;
case 54:
cuty = sigmatr*2.5;
cutz = sigmatr*2.5;
dy = AliMathBase::TruncatedGaus(0., sigmatr, cut, cuty);
dz = AliMathBase::TruncatedGaus(0., sigmatr, cutz, cut);
strId++;
break;
*/
//.........这里部分代码省略.........