void MakeTPCZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for TPC
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
- // needed for the constructors with local coordinates not to fail
+ const char* macroname = "MakeTPCZeroMisAlignment.C";
- TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
+ TClonesArray *array = new TClonesArray("AliAlignObjParams",100);
TClonesArray &alobj = *array;
- AliAlignObjAngles o;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
Int_t j = 0;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
const char *symname = AliGeomManager::SymName(volid);
- new(alobj[j]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+ new(alobj[j]) AliAlignObjParams(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
j++;
}
}
-
- if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
- TFile f("TPCzeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "TPCzeroMisalignment.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,"TPCAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
+ 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;
+ }
+ Info(macroname,"Saving alignment objects in CDB storage %s",
+ Storage.Data());
AliCDBManager* cdb = AliCDBManager::Instance();
- AliCDBStorage* storage = cdb->GetStorage(Storage);
+ 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("Marian Ivanov");
md->SetComment("Zero misalignment for TPC");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("TPC/Align/Data",0,9999999);
+ AliCDBId id("TPC/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}