TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
- // needed for the constructors with local coordinates not to fail
-
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
AliAlignObjAngles a;
Double_t dx, dy, dz, dpsi, dtheta, dphi;
new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
+ const char* macroname = "MakeEMCALFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("EMCALfullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "EMCALfullMisalignment.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,"T0FullObjs ","kSingleKey");
+ f.WriteObject(array,"EMCALAlignObjs","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("Jennifer Clay");
md->SetComment("Full misalignment for EMCAL");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("EMCAL/Align/Data",0,9999999);
+ AliCDBId id("EMCAL/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
- // needed for the constructors with local coordinates not to fail
-
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
AliAlignObjAngles a;
Double_t dx, dy, dz, dpsi, dtheta, dphi;
new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
+ const char* macroname = "MakeEMCALResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("EMCALresidualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "EMCALresidualMisalignment.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,"T0ResidualObjs ","kSingleKey");
+ f.WriteObject(array,"EMCALAlignObjs","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("Jennifer Clay");
md->SetComment("Residual misalignment for EMCAL, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("EMCAL/Align/Data",0,9999999);
+ AliCDBId id("EMCAL/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
- // needed for the constructors with local coordinates not to fail
-
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
AliAlignObjAngles a;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
+ const char* macroname = "MakeEMCALZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("EMCALzeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "EMCALzeroMisalignment.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,"EMCALAlignObjs","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("Jennifer Clay");
md->SetComment("Zero misalignment for EMCAL");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("EMCAL/Align/Data",0,9999999);
+ AliCDBId id("EMCAL/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
void MakeFMDFullMisAlignment(){
// Create TClonesArray of full misalignment objects for FMD
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
gSystem->Load("libFMDutil.so");
{
// Create TClonesArray of residual misalignment objects for FMD
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
gSystem->Load("libFMDutil.so");
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
{
// Create TClonesArray of zero-misalignment objects for FMD
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
gSystem->Load("libFMDutil.so");
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
}
// pCA->Print();
-
+
+ const char* macroname = "MakeHMPIDResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("HMPIDfullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "HMPIDresidualMisalignment.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(pCA,"HMPIDAlignObjs","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 *pMeta= new AliCDBMetaData();
pMeta->SetResponsible("HMPID Expert");
pMeta->SetComment("Full alignment objects for HMPID produced with sigmaTrans=1mm and sigmaRot=1mrad");
pMeta->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("HMPID/Align/Data",0,9999999);
+ AliCDBId id("HMPID/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(pCA,id,pMeta);
}
// pCA->Print();
+ const char* macroname = "MakeHMPIDResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("HMPIDresidualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "HMPIDresidualMisalignment.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(pCA,"HMPIDAlignObjs","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 *pMeta= new AliCDBMetaData();
pMeta->SetResponsible("HMPID Expert");
pMeta->SetComment("Residual alignment objects for HMPID produced with sigmaTrans=1mm and sigmaRot=1mrad");
pMeta->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("HMPID/Align/Data",0,9999999);
+ AliCDBId id("HMPID/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(pCA,id,pMeta);
}
}
// pCA->Print();
-
+ const char* macroname = "MakeHMPIDZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("HMPIDzeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "HMPIDzeroMisalignment.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(pCA,"HMPIDAlignObjs","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 *pMeta= new AliCDBMetaData();
pMeta->SetResponsible("HMPID Expert");
pMeta->SetComment("Zero alignment objects for HMPID");
pMeta->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("HMPID/Align/Data",0,9999999);
+ AliCDBId id("HMPID/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(pCA,id,pMeta);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",4000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
Double_t globalZ = 0.015; // in cm, = 150 microns
}
}
+ const char* macroname = "MakeITSFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("ITSfullMisalignment.root","RECREATE");
- if(!f) {cerr<<"cannot open file for output\n";}
+ const char* filename = "ITSfullMisalignment.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,"ITSAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliCDBManager *CDB = AliCDBManager::Instance();
- AliCDBStorage* storage = CDB->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData *md= new AliCDBMetaData();
md->SetResponsible("Ludovic Gaudichet");
md->SetComment("Alignment objects with actual ITS misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("ITS/Align/Data",0,9999999);
+ AliCDBId id("ITS/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id, md);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",4000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
Double_t globalZ = 0.005; // in cm, = 50 microns
}
}
+ const char* macroname = "MakeITSResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("ITSresidualMisalignment.root","RECREATE");
- if(!f) {cerr<<"cannot open file for output\n";}
+ const char* filename = "ITSresidualMisalignment.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,"ITSAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliCDBManager *CDB = AliCDBManager::Instance();
- AliCDBStorage* storage = CDB->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData *md= new AliCDBMetaData();
md->SetResponsible("Ludovic Gaudichet");
md->SetComment("Alignment objects with actual ITS misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("ITS/Align/Data",0,9999999);
+ AliCDBId id("ITS/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id, md);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",4000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
AliAlignObjAngles a;
}
}
+ const char* macroname = "MakeITSZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("ITSzeroMisalignment.root","RECREATE");
- if(!f) {cerr<<"cannot open file for output\n";}
+ const char* filename = "ITSzeroMisalignment.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,"ITSAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliCDBManager *CDB = AliCDBManager::Instance();
- AliCDBStorage* storage = CDB->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData *md= new AliCDBMetaData();
md->SetResponsible("Ludovic Gaudichet");
md->SetComment("Alignment objects with zero ITS misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("ITS/Align/Data",0,9999999);
+ AliCDBId id("ITS/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id, md);
}
void MakeMUONFullMisAlignment()
{
// Load geometry, if not yet loaded,
- if ( ! AliGeomManager::GetGeometry() )
- AliGeomManager::LoadGeometry("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
AliMUONGeometryTransformer transformer;
transformer.LoadGeometryData();
= misAligner.MisAlign(&transformer, true);
const TClonesArray* array = newTransform->GetMisAlignmentData();
+ const char* macroname = "MakeMUONFullMisAlignment.C";
if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
- cout << "Generating full misalignment data in a file" << endl;
-
- // Create a File to store the alignment data
- TFile f("MUONfullMisalignment.root","RECREATE");
- if ( !f.IsOpen() ) {
- cerr << "cannot open file for output" << endl;
+ const char* filename = "MUONfullMisalignment.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,"MUONAlignObjs ","kSingleKey");
+ f.WriteObject(array,"MUONAlignObjs","kSingleKey");
f.Close();
}
else {
- cout << "Generating full misalignment data in CDB" << endl;
-
- // save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
-
- AliCDBManager* cdbManager = AliCDBManager::Instance();
- AliCDBStorage* storage = cdbManager->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData* cdbData = new AliCDBMetaData();
cdbData->SetResponsible("Dimuon Offline project");
cdbData->SetComment("MUON alignment objects with full misalignment");
cdbData->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("MUON/Align/Data", 0, 9999999);
+ AliCDBId id("MUON/Align/Data", 0, AliCDBRunRange::Infinity());
storage->Put(const_cast<TClonesArray*>(array), id, cdbData);
}
delete newTransform;
void MakeMUONResMisAlignment()
{
// Load geometry, if not yet loaded,
- if ( ! AliGeomManager::GetGeometry() )
- AliGeomManager::LoadGeometry("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
AliMUONGeometryTransformer transformer;
transformer.LoadGeometryData();
= misAligner.MisAlign(&transformer, true);
const TClonesArray* array = newTransform->GetMisAlignmentData();
+ const char* macroname = "MakeMUONResMisAlignment.C";
if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
- cout << "Generating residual misalignment data in a file" << endl;
-
- // Create a File to store the alignment data
- TFile f("MUONresidualMisalignment.root","RECREATE");
- if( !f.IsOpen() ) {
- cerr << "cannot open file for output" << endl;
+ const char* filename = "MUONresidualMisalignment.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,"MUONAlignObjs ","kSingleKey");
+ f.WriteObject(array,"MUONAlignObjs","kSingleKey");
f.Close();
}
else {
- cout << "Generating residual misalignment data in CDB" << endl;
- // save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliCDBManager* cdbManager = AliCDBManager::Instance();
- AliCDBStorage* storage = cdbManager->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData* cdbData = new AliCDBMetaData();
cdbData->SetResponsible("Dimuon Offline project");
cdbData->SetComment("MUON alignment objects with residual misalignment");
cdbData->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("MUON/Align/Data", 0, 9999999);
+ AliCDBId id("MUON/Align/Data", 0, AliCDBRunRange::Infinity());
storage->Put(const_cast<TClonesArray*>(array), id, cdbData);
}
delete newTransform;
void MakeMUONZeroMisAlignment()
{
// Load geometry, if not yet loaded,
- if ( ! AliGeomManager::GetGeometry() )
- AliGeomManager::LoadGeometry("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
AliMUONGeometryTransformer transformer;
transformer.LoadGeometryData();
TClonesArray* array = transformer.CreateZeroAlignmentData();;
+ const char* macroname = "MakeMUONZeroMisAlignment.C";
if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
- // save in file
- cout << "Generating zero misalignment data in a file ..." << endl;
-
// Create a file to store the alignment data
- TFile f("MUONzeroMisalignment.root", "RECREATE");
- if( !f.IsOpen() ) {
- cerr<<"cannot open file for output\n";
+ const char* filename = "MUONZeroMisalignment.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,"MUONAlignObjs ","kSingleKey");
+ f.WriteObject(array,"MUONAlignObjs","kSingleKey");
f.Close();
- }
- else {
- cout << "Generating zero misalignment data in CDB ..." << endl;
-
+ } else {
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliCDBManager* cdbManager = AliCDBManager::Instance();
- AliCDBStorage* storage = cdbManager->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData* cdbData = new AliCDBMetaData();
cdbData->SetResponsible("Dimuon Offline project");
cdbData->SetComment("MUON alignment objects with zero misalignment");
cdbData->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("MUON/Align/Data", 0, 9999999);
+ AliCDBId id("MUON/Align/Data", 0, AliCDBRunRange::Infinity());
storage->Put(array, id, cdbData);
}
}
// ************************* 2nd step ***************
- if(!gSystem->Getenv("TOCDB")){
+ const char* macroname = "MakePHOSFullMisAlignment.C";
+ if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("PHOSfullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "PHOSfullMisalignment.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,"PHOSFullObjs ","kSingleKey");
+ f.WriteObject(array,"PHOSAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliCDBManager *CDB = AliCDBManager::Instance();
- AliCDBStorage* storage = CDB->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData *md= new AliCDBMetaData();
md->SetResponsible("Yuri Kharlov");
md->SetComment("Alignment objects for fully misaligned geometry");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("PHOS/Align/Data",0,9999999);
+ AliCDBId id("PHOS/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id, md);
}
AliPHOSSurvey geodesicData("phos_mod3_survey.txt");
geodesicData.CreateAliAlignObjAngles(alobj);
- if(!gSystem->Getenv("TOCDB")){
+ const char* macroname = "MakePHOSResMisAlignment.C";
+ if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("PHOSresidualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "PHOSresidualMisalignment.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,"PHOSResidualObjs ","kSingleKey");
+ f.WriteObject(array,"PHOSAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliCDBManager *CDB = AliCDBManager::Instance();
- AliCDBStorage* storage = CDB->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData *md= new AliCDBMetaData();
md->SetResponsible("Yuri Kharlov");
md->SetComment("Alignment objects for slightly misaligned geometry (residual misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("PHOS/Align/Data",0,9999999);
+ AliCDBId id("PHOS/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id, md);
}
AliPHOSSurvey geodesicData;
geodesicData.CreateNullObjects(alobj, phosGeom);
- if(!gSystem->Getenv("TOCDB")){
+ const char* macroname = "MakePHOSZeroMisAlignment.C";
+ if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("PHOSzeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "PHOSzeroMisalignment.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,"PHOSAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliCDBManager *CDB = AliCDBManager::Instance();
- AliCDBStorage* storage = CDB->GetStorage(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.Data());
+ if(!storage){
+ Error(macroname,"Unable to open storage %s\n",Storage.Data());
+ return;
+ }
AliCDBMetaData *md= new AliCDBMetaData();
md->SetResponsible("Yuri Kharlov");
md->SetComment("Zero misalignment objects");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("PHOS/Align/Data",0,9999999);
+ AliCDBId id("PHOS/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id, md);
}
// Steel plate
*/
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
Float_t max_trans=0.1;
new(alobj[2]) AliAlignObjAngles(Sector3, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
new(alobj[3]) AliAlignObjAngles(Sector4, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
+ const char* macroname = "MakePMDFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// Create a File to store the alignment data
- TFile f("PMDfullMisalignment.root","RECREATE");
- if(!f) {cerr<<"cannot open file for output\n";}
+ const char* filename = "PMDfullMisalignment.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,"PMDAlignObjs ","kSingleKey");
+ f.WriteObject(array,"PMDAlignObjs","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("");
md->SetComment("Full misalignment for PMD, produced with sigmatr=0.1 and sigmarot=0.1 in the local RS");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("PMD/Align/Data",0,9999999);
+ AliCDBId id("PMD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
// Steel plate
*/
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
Float_t max_trans=0.1;
new(alobj[2]) AliAlignObjAngles(Sector3, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
new(alobj[3]) AliAlignObjAngles(Sector4, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
+ const char* macroname = "MakePMDResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// Create a File to store the alignment data
- TFile f("PMDresidualMisalignment.root","RECREATE");
- if(!f) {cerr<<"cannot open file for output\n";}
-
+ const char* filename = "PMDresidualMisalignment.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,"PMDAlignObjs ","kSingleKey");
+ f.WriteObject(array,"PMDAlignObjs","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("");
md->SetComment("Residual misalignment for PMD, produced with sigmatr=0.1 and sigmarot=0.1 in the local RS");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("PMD/Align/Data",0,9999999);
+ AliCDBId id("PMD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
// Steel plate
*/
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
//Create a TClonesArray of Align Object to store displacement Angles
new(alobj[j++]) AliAlignObjAngles(snSector.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
+ const char* macroname = "MakePMDZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// Create a File to store the alignment data
- TFile f("PMDzeroMisalignment.root","RECREATE");
- if(!f) {cerr<<"cannot open file for output\n";}
-
+ const char* filename = "PMDzeroMisalignment.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,"PMDAlignObjs ","kSingleKey");
+ f.WriteObject(array,"PMDAlignObjs","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("");
md->SetComment("Zero misalignment for PMD");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("PMD/Align/Data",0,9999999);
+ AliCDBId id("PMD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
TClonesArray *array = new TClonesArray("AliAlignObjAngles",30);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
AliAlignObjAngles a;
new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- if(!gSystem->Getenv("$TOCDB")){
+ const char* macroname = "MakeT0FullMisAlignment.C";
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
- TFile f("T0fullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "T0fullMisalignment.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,"T0FullObjs ","kSingleKey");
- f.Close();
+ f.WriteObject(array,"T0AlignObjs","kSingleKey");
+ f.Close(); TFile f(filename,"RECREATE");
}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("Tomasz Malkiewicz");
md->SetComment("Full misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
- AliCDBId id("T0/Align/Data",0,9999999);
+ AliCDBId id("T0/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",30);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
AliAlignObjAngles a;
new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- if(!gSystem->Getenv("$TOCDB")){
+ const char* macroname = "MakeT0ResMisAlignment.C";
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
- TFile f("T0residualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "T0residualMisalignment.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,"T0ResidualObjs ","kSingleKey");
+ f.WriteObject(array,"T0AlignObjs","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("Tomasz Malkiewicz");
md->SetComment("Residual misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
- AliCDBId id("T0/Align/Data",0,9999999);
+ AliCDBId id("T0/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- if(!gSystem->Getenv("$TOCDB")){
+ const char* macroname = "MakeT0ZeroMisAlignment.C";
+ if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
// save on file
- TFile f("T0zeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "T0zeroMisalignment.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,"T0ZeroObjs","kSingleKey");
+ f.WriteObject(array,"T0AlignObjs","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("Tomasz Malkiewicz");
md->SetComment("Zero misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
- AliCDBId id("T0/Align/Data",0,9999999);
+ AliCDBId id("T0/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("/home/rgrosso/Prove/AliRoot/geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
AliAlignObjAngles a;
Double_t sfdpsi=0.,sfdtheta=0.,sfdphi=0.;
return;
}
}
- gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO.root");
- gGeoManager=0x0;
- TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO.root");
+ gGeoManager->Export("./geom_misalBSEGMO.root");
+
+ AliGeomManager::LoadGeometry("./geom_misalBSEGMO.root");
// TOF part !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Int_t nSMTOF = 18;
return;
}
}
- gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_tofSM.root");
-
+ gGeoManager->Export("./geom_misalBSEGMO_tofSM.root");
- gGeoManager=0x0;
- TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_tofSM.root");
+ AliGeomManager::LoadGeometry("./geom_misalBSEGMO_tofSM.root");
// tof strips as in residual
AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
new(alobj[j++]) AliAlignObjAngles(AliGeomManager::SymName(idTOF,i), AliGeomManager::LayerToVolUID(idTOF,i), sdx, sdy, sdz, sdpsi, sdtheta, sdphi, kFALSE);
}
+ const char* macroname = "MakeTOFFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("TOFfullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "TOFfullMisalignment.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,"TOFAlignObjs","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("Silvia Arcelli");
md->SetComment("Full misalignment for TOF and FRAME");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("TOF/Align/Data",0,9999999);
+ AliCDBId id("TOF/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
+ gGeoManager = 0x0;
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("/home/rgrosso/Prove/AliRoot/geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
AliAlignObjAngles a;
j++;
}
+ const char* macroname = "MakeTOFResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("TOFresidualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "TOFresidualMisalignment.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,"TOFAlignObjs","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("Silvia Arcelli");
md->SetComment("Residual misalignment for TOF, sigmatr=1mm in the local RS");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("TOF/Align/Data",0,9999999);
+ AliCDBId id("TOF/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
AliAlignObjAngles a;
new(alobj[j++]) AliAlignObjAngles(AliGeomManager::SymName(idTOF,i), AliGeomManager::LayerToVolUID(idTOF,i), dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
+ const char* macroname = "MakeTOFZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("TOFzeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "TOFzeroMisalignment.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,"TOFAlignObjs","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("Silvia Arcelli");
md->SetComment("Zero misalignment for TOF");
md->SetAliRootVersion("HEAD");
- AliCDBId id("TOF/Align/Data",0,9999999);
+ AliCDBId id("TOF/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
void MakeTPCFullMisAlignment(){
// Create TClonesArray of full misalignment objects for TPC
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
}
+ const char* macroname = "MakeTPCFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("TPCfullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "TPCfullMisalignment.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("Full misalignment for TPC, sigmatr=0.01 and sigmarot=0.6 in the local RS");
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);
}
void MakeTPCResMisAlignment(){
// Create TClonesArray of residual misalignment objects for TPC
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
}
+ const char* macroname = "MakeTPCResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("TPCresidualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "TPCresidualMisalignment.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("Residual misalignment for TPC, sigmatr=0.01 and sigmarot=0.6 in the local RS");
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);
}
void MakeTPCZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for TPC
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
}
+ const char* macroname = "MakeTPCZeroMisAlignment.C";
if( 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);
}
UShort_t volid;
const char *symname;
- TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO.root"); // geometry where the BSEGMO volumes have been misaligned
+ AliGeomManager::LoadGeometry("./geom_misalBSEGMO.root"); // geometry where the BSEGMO volumes have been misaligned
// create the supermodules' alignment objects
for (int i; i<18; i++) {
return;
}
}
- gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_trdSM.root");
- gGeoManager=0x0;
- TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_trdSM.root");
+ gGeoManager->Export("./geom_misalBSEGMO_trdSM.root");
+ AliGeomManager::LoadGeometry("./geom_misalBSEGMO_trdSM.root");
// create the chambers' alignment objects
ran = new TRandom(4357);
for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
}
}
+ const char* macroname = "MakeTRDFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("TRDfullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ 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
- 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("Dariusz Miskowiec");
md->SetComment("Full misalignment for TRD");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("TRD/Align/Data",0,9999999);
+ AliCDBId id("TRD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
-
+ gGeoManager = 0x0;
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",1000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
AliAlignObjAngles a;
}
}
+ const char* macroname = "MakeTRDResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("TRDresidualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ 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
- 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("Dariusz Miskowiec");
md->SetComment("Residual misalignment for TRD");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("TRD/Align/Data",0,9999999);
+ AliCDBId id("TRD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
TClonesArray *array = new TClonesArray("AliAlignObjAngles",1000);
TClonesArray &alobj = *array;
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
AliAlignObjAngles a;
}
}
+ const char* macroname = "MakeTRDZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("TRDzeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "TRDzeroMisalignment.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
- 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("Dariusz Miskowiec");
md->SetComment("Zero misalignment for TRD");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("TRD/Align/Data",0,9999999);
+ AliCDBId id("TRD/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
void MakeVZEROFullMisAlignment(){
// Create TClonesArray of full misalignment objects for VZERO
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
new(alobj[1]) AliAlignObjAngles(V0left, volid, dx, dy, dz, dpsi, dtheta,
dphi,kFALSE);
+ const char* macroname = "MakeVZEROFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("V0fullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "VZEROfullMisalignment.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,"V0FullObjs ","kSingleKey");
+ f.WriteObject(array,"VZEROAlignObjs","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("Brigitte Cheynis");
md->SetComment("Alignment objects for V0 full misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("VZERO/Align/Data",0,9999999);
+ AliCDBId id("VZERO/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
void MakeVZEROResMisAlignment(){
// Create TClonesArray of residual misalignment objects for VZERO
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
dphi = rnd->Gaus(0.,sigmarot);
new(alobj[1]) AliAlignObjAngles(V0left, volid, dx, dy, dz, dpsi, dtheta, dphi,kFALSE);
+ const char* macroname = "MakeVZEROResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("V0residualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "VZEROresidualMisalignment.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,"V0ResidualObjs ","kSingleKey");
+ f.WriteObject(array,"VZEROAlignObjs","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("Brigitte Cheynis");
md->SetComment("Alignment objects for V0 residual misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("VZERO/Align/Data",0,9999999);
+ AliCDBId id("VZERO/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
void MakeVZEROZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for VZERO
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
TString V0left("VZERO/V0A");
new(alobj[1]) AliAlignObjAngles(V0left.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
+ const char* macroname = "MakeVZEROZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
- TFile f("V0zeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "VZEROzeroMisalignment.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,"V0ZeroAlObjs ","kSingleKey");
+ f.WriteObject(array,"VZEROAlignObjs","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("Brigitte Cheynis");
md->SetComment("Alignment objects for V0 zero-misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("VZERO/Align/Data",0,9999999);
+ AliCDBId id("VZERO/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
void MakeZDCFullMisAlignment(){
// Create TClonesArray of full misalignment objects for ZDC
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
new(alobj[0]) AliAlignObjAngles(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjAngles(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
+ const char* macroname = "MakeZDCFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save in file
- TFile f("ZDCfullMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "ZDCfullMisalignment.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,"ZDCFullObjs ","kSingleKey");
+ f.WriteObject(array,"ZDCAlignObjs","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("Chiara Oppedisano");
md->SetComment("Alignment objects for ZDC full misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("ZDC/Align/Data",0,9999999);
+ AliCDBId id("ZDC/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
void MakeZDCResMisAlignment(){
// Create TClonesArray of residual misalignment objects for ZDC
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
new(alobj[0]) AliAlignObjAngles(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjAngles(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
+ const char* macroname = "MakeZDCResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save in file
- TFile f("ZDCresidualMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "ZDCresidualMisalignment.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,"ZDCResidualObjs ","kSingleKey");
+ f.WriteObject(array,"ZDCAlignObjs","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("Chiara Oppedisano");
md->SetComment("Alignment objects for ZDC residual misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("ZDC/Align/Data",0,9999999);
+ AliCDBId id("ZDC/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
void MakeZDCZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for ZDC
//
- if(!gGeoManager) TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
+ }
// needed for the constructors with local coordinates not to fail
TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
new(alobj[0]) AliAlignObjAngles(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjAngles(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
+ const char* macroname = "MakeZDCZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save in file
- TFile f("ZDCzeroMisalignment.root","RECREATE");
- if(!f) cerr<<"cannot open file for output\n";
+ const char* filename = "ZDCzeroMisalignment.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,"ZDCZeroAlObjs ","kSingleKey");
+ f.WriteObject(array,"ZDCAlignObjs","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("Chiara Oppedisano");
md->SetComment("Alignment objects for ZDC zero misalignment");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- AliCDBId id("ZDC/Align/Data",0,9999999);
+ AliCDBId id("ZDC/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
gSystem->Setenv("ARVERSION","v4-05-08");
}
- // if not already present, create geometry file needed by those detectors
- // producing their objects in the local RS
- if(gSystem->AccessPathName("./geometry.root")){
- gAlice->Init();
- gGeoManager->Export("geometry.root");
- }else{
- TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
}
TString dets = "EMCAL,FMD,ITS,MUON,PHOS,PMD,HMPID,T0,TOF,TPC,TRD,VZERO,ZDC";
gSystem->Setenv("ARVERSION","v4-05-08");
}
- // if not already present, create geometry file needed by those detectors
- // producing their objects in the local RS
- if(gSystem->AccessPathName("./geometry.root")){
- gAlice->Init();
- gGeoManager->Export("geometry.root");
- }else{
- TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
}
TString dets="EMCAL,FMD,HMPID,ITS,MUON,PHOS,PMD,T0,TOF,TPC,TRD,VZERO,ZDC";
gSystem->Setenv("ARVERSION","v4-05-08");
}
- // if not already present, create geometry file needed by those detectors
- // producing their objects in the local RS
- if(gSystem->AccessPathName("./geometry.root")){
- gAlice->Init();
- gGeoManager->Export("geometry.root");
- }else{
- TGeoManager::Import("geometry.root");
+ if(!AliGeomManager::GetGeometry()){
+ if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetRun(0);
+ AliGeomManager::LoadGeometry();
}
+
TString dets="EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
TObjArray *detArray = dets.Tokenize(',');
TIter iter(detArray);