//
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
+ const char* macroname = "MakeEMCALFullMisAlignment.C";
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
- AliAlignObjParams a;
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
Double_t dx, dy, dz, dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(4321);
new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- const char* macroname = "MakeEMCALFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "EMCALfullMisalignment.root";
f.Close();
}else{
// save in CDB 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("Jennifer Clay");
md->SetComment("Full misalignment for EMCAL");
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
+ const char* macroname = "MakeEMCALResMisAlignment.C";
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
- AliAlignObjParams a;
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
Double_t dx, dy, dz, dpsi, dtheta, dphi;
new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- const char* macroname = "MakeEMCALResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "EMCALresidualMisalignment.root";
f.Close();
}else{
// save in CDB 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("Jennifer Clay");
md->SetComment("Residual misalignment for EMCAL, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
-
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
- AliAlignObjParams a;
+ const char* macroname = "MakeEMCALZeroMisAlignment.C";
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
}
- const char* macroname = "MakeEMCALZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "EMCALzeroMisalignment.root";
void MakeFMDFullMisAlignment(){
// Create TClonesArray of full misalignment objects for FMD
//
- 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
+ const char* macroname = "MakeFMDFullMisAlignment.C";
+
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ TString Storage;
+
+ if( 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;
+ }
+ AliCDBStorage* 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
+ }
gSystem->Load("libFMDutil.so");
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDfullMisalignment.root");
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage);
+ AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage.Data());
}
// fRunMax should be changed in the constructor
{
// Create TClonesArray of residual misalignment objects for FMD
//
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
+ const char* macroname = "MakeFMDResMisAlignment.C";
+
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ TString Storage;
+
+ if( 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;
+ }
+ AliCDBStorage* 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
+ }
gSystem->Load("libFMDutil.so");
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDresidualMisalignment.root");
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage);
+ AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage.Data());
}
// fRunMax should be changed in the constructor
{
// Create TClonesArray of zero-misalignment objects for FMD
//
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
+ const char* macroname = "MakeFMDZeroMisAlignment.C";
+
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ TString Storage;
+
+ if( 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;
+ }
+ AliCDBStorage* 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
+ }
gSystem->Load("libFMDutil.so");
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root","FMDAlignObjs.root");
}else{
// save in CDB storage
- const char* Storage = gSystem->Getenv("STORAGE");
- AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage);
+ AliFMDAlignFaker faker(AliFMDAlignFaker::kAll, "geometry.root", Storage.Data());
}
// fRunMax should be changed in the constructor
TRandom *pRnd = new TRandom(4357);
- AliAlignObjMatrix o;
-
Int_t idHMPID = AliGeomManager::kHMPID;
for (Int_t iCh = 0; iCh < 7; iCh++) {
dX = (pRnd->Uniform()-0.5)*sigmaTrans; dY = (pRnd->Uniform()-0.5)*sigmaTrans; dZ = (pRnd->Uniform()-0.5)*sigmaTrans;
TRandom *pRnd = new TRandom(4357);
- AliAlignObjMatrix o;
-
Int_t idHMPID = AliGeomManager::kHMPID;
for (Int_t iCh = 0; iCh < 7; iCh++) {
dX = (pRnd->Uniform()-0.5)*sigmaTrans; dY = (pRnd->Uniform()-0.5)*sigmaTrans; dZ = (pRnd->Uniform()-0.5)*sigmaTrans;
//
TClonesArray *pCA = new TClonesArray("AliAlignObjMatrix",10);
- AliAlignObjMatrix o;
-
Double_t dX=0.,dY=0.,dZ=0.,dPsi=0.,dTheta=0.,dPhi=0.;
Int_t idHMPID = AliGeomManager::kHMPID;
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",4000);
TClonesArray &alobj = *array;
+ const char* macroname = "MakeITSFullMisAlignment.C";
- 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
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
Double_t globalZ = 0.015; // in cm, = 150 microns
Double_t mecanicalPrec = 0.0020;
TRandom *rnd = new TRandom(65416087);
- AliAlignObjParams a;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
}
}
- const char* macroname = "MakeITSFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "ITSfullMisalignment.root";
f.Close();
}else{
// save in CDB 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");
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",4000);
TClonesArray &alobj = *array;
+ const char* macroname = "MakeITSResMisAlignment.C";
- 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
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
Double_t globalZ = 0.005; // in cm, = 50 microns
Double_t resFact = 0.7;
Double_t ssdZ = 0.010;
TRandom *rnd = new TRandom(65416087);
- AliAlignObjParams a;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
}
}
- const char* macroname = "MakeITSResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "ITSresidualMisalignment.root";
f.Close();
}else{
// save in CDB 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");
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",4000);
TClonesArray &alobj = *array;
-
- 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
+ const char* macroname = "MakeITSZeroMisAlignment.C";
- AliAlignObjParams a;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0., globalZ=0.;
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
}
}
- const char* macroname = "MakeITSZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "ITSzeroMisalignment.root";
void MakeMUONFullMisAlignment()
{
- // Load geometry, if not yet loaded,
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
+ const char* macroname = "MakeMUONFullMisAlignment.C";
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
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") ) {
+ // Save in file
const char* filename = "MUONfullMisalignment.root";
TFile f(filename,"RECREATE");
if(!f){
f.Close();
}
else {
- 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;
- }
+ // Save in CDB storage
AliCDBMetaData* cdbData = new AliCDBMetaData();
cdbData->SetResponsible("Dimuon Offline project");
cdbData->SetComment("MUON alignment objects with full misalignment");
void MakeMUONResMisAlignment()
{
- // Load geometry, if not yet loaded,
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
+ const char* macroname = "MakeMUONResMisAlignment.C";
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
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") ) {
+ // Save in file
const char* filename = "MUONresidualMisalignment.root";
TFile f(filename,"RECREATE");
if(!f){
f.cd();
f.WriteObject(array,"MUONAlignObjs","kSingleKey");
f.Close();
- }
- else {
- 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;
- }
+ } else {
+ // Save in CDB storage
AliCDBMetaData* cdbData = new AliCDBMetaData();
cdbData->SetResponsible("Dimuon Offline project");
cdbData->SetComment("MUON alignment objects with residual misalignment");
void MakeMUONZeroMisAlignment()
{
- // Load geometry, if not yet loaded,
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
+ const char* macroname = "MakeMUONZeroMisAlignment.C";
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
AliMUONGeometryTransformer transformer;
transformer.LoadGeometryData();
TClonesArray* array = transformer.CreateZeroAlignmentData();;
- const char* macroname = "MakeMUONZeroMisAlignment.C";
if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
// Create a file to store the alignment data
const char* filename = "MUONZeroMisalignment.root";
f.Close();
} else {
// save in CDB 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");
void MakePHOSZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for PHOS
//
+ const char* macroname = "MakePHOSZeroMisAlignment.C";
const AliPHOSGeometry *phosGeom = AliPHOSGeometry::GetInstance("IHEP", "IHEP");
if (!phosGeom) {
Error("MakePHOSFullMisAlignment", "Cannot obtain AliPHOSGeometry singleton\n");
AliPHOSSurvey geodesicData;
geodesicData.CreateNullObjects(alobj, phosGeom);
- const char* macroname = "MakePHOSZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "PHOSzeroMisalignment.root";
// Steel plate
*/
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
+ const char* macroname = "MakePMDFullMisAlignment.C";
+
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
}
- // needed for the constructors with local coordinates not to fail
Float_t max_trans=0.1;
Float_t max_rot=0.1;
- TString path;
const char *Sector1="PMD/Sector1";
const char *Sector2="PMD/Sector2";
const char *Sector3="PMD/Sector3";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams o;
-
Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
new(alobj[2]) AliAlignObjParams(Sector3, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
new(alobj[3]) AliAlignObjParams(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
const char* filename = "PMDfullMisalignment.root";
f.Close();
}else{
// save in CDB 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("");
md->SetComment("Full misalignment for PMD, produced with sigmatr=0.1 and sigmarot=0.1 in the local RS");
// Steel plate
*/
- 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
+ const char* macroname = "MakePMDResMisAlignment.C";
+
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
Float_t max_trans=0.1;
Float_t max_rot=0.1;
- TString path;
const char *Sector1="PMD/Sector1";
const char *Sector2="PMD/Sector2";
const char *Sector3="PMD/Sector3";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams o;
-
Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
new(alobj[2]) AliAlignObjParams(Sector3, volid, dx23, dy23, dz23, dpsi23, dtheta23, dphi23, kFALSE);
new(alobj[3]) AliAlignObjParams(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
const char* filename = "PMDresidualMisalignment.root";
f.Close();
}else{
// save in CDB 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("");
md->SetComment("Residual misalignment for PMD, produced with sigmatr=0.1 and sigmarot=0.1 in the local RS");
// As these will be mounted on the same
// Steel plate
*/
-
- 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
+
+ const char* macroname = "MakePMDZeroMisAlignment.C";
//Create a TClonesArray of Align Object to store displacement Angles
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams o;
-
Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
new(alobj[j++]) AliAlignObjParams(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
const char* filename = "PMDzeroMisalignment.root";
TClonesArray *array = new TClonesArray("AliAlignObjParams",30);
TClonesArray &alobj = *array;
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
- }
-
- AliAlignObjParams a;
-
Double_t dx, dy, dz, dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(4321);
Double_t sigmatr = 0.05; // sigma for shifts in cm
TClonesArray *array = new TClonesArray("AliAlignObjParams",30);
TClonesArray &alobj = *array;
- 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
-
- AliAlignObjParams a;
-
Double_t dx, dy, dz, dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(4321);
Double_t sigmatr = 0.05; // max shift in cm
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams a;
-
Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
TString symName, sn;
void MakeTOFFullMisAlignment(){
// Create TClonesArray of full misalignment objects for TOF
+ // Expects to read objects for FRAME
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",2000);
- TClonesArray &alobj = *array;
-
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
+ const char* macroname = "MakeTOFFullMisAlignment.C";
+
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
+
+ // load FRAME full misalignment objects (if needed, the macro
+ // for FRAME has to be run in advance) and apply them to geometry
+ Info(macroname,"Loading FRAME alignment objects from CDB storage %s",
+ Storage.Data());
+ AliCDBPath fpath("GRP","Align","Data");
+ if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ AliCDBEntry *eFrame = storage->Get(fpath.GetPath(),cdb->GetRun());
+ if(!entry) 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 alignment objects");
+ }else{
+ AliCDBEntry *eFrame = cdb->Get(fpath.GetPath());
+ if(!entry) 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 alignment objects");
}
- AliAlignObjParams a;
- Double_t sfdpsi=0.,sfdtheta=0.,sfdphi=0.;
+ //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
- // FRAME part !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- const char* basepath ="ALIC_1/B077_1/BSEGMO";
- TString segmpath;
-
- // for dead weight !!!! carefull: in mm
- ifstream dw_file("/home/rgrosso/MacroAllineamento010207/disp_deadweight.txt", ios::in);
- if(!dw_file) {cerr<<"cannot open dead weight file for input\n"; return;}
- TArrayD dwdx(36);
- TArrayD dwdy(36);
- TArrayD dwdz(36);
- TArrayD dwdrot(36);
- // for additional load
- ifstream orig_file("/home/rgrosso/MacroAllineamento010207/disp_full.txt", ios::in);
-// ifstream orig_file("disp_full_nohmpid.txt", ios::in);
- if(!orig_file) {cerr<<"cannot open file for input\n"; return;}
- TArrayD adx(36);
- TArrayD ady(36);
- TArrayD adz(36);
- TArrayD adrot(36);
- // avarage displacements
- Double_t mean_dx[18];
- Double_t mean_dy[18];
- Double_t idx[18];
- Double_t idy[18];
- Double_t newx[18];
- Double_t newy[18];
-
- string buffer;
- Int_t point;
- Double_t dx,dy,dz,drot;
-
- // fill in from file the array for dead weight deformations
- dw_file>>point>>dx>>dy>>dz>>drot;
- dwdx.AddAt(dx,point-1);dwdy.AddAt(dy,point-1);dwdz.AddAt(dz,point-1);dwdrot.AddAt(drot,point-1);
- while(getline(dw_file,buffer))
- {
- dw_file>>point>>dx>>dy>>dz>>drot;
- dwdx.AddAt(dx,point-1);dwdy.AddAt(dy,point-1);dwdz.AddAt(dz,point-1);dwdrot.AddAt(drot,point-1);
- }
-
- // fill in from file the array for remaining load deformations
- orig_file>>point>>dx>>dy>>dz>>drot;
- adx.AddAt(dx,point-1);ady.AddAt(dy,point-1);adz.AddAt(dz,point-1);adrot.AddAt(drot,point-1);
- while(getline(orig_file,buffer))
- {
- orig_file>>point>>dx>>dy>>dz>>drot;
- adx.AddAt(dx,point-1);ady.AddAt(dy,point-1);adz.AddAt(dz,point-1);adrot.AddAt(drot,point-1);
- }
-
- //calculate the displacement of the center of the sm neglecting rotations,
- //thus as average of the four surrounding point for dw + other load
- // Prepare also to plot with respect to ideal circle.
- Double_t cx=0.5; //just for plotting
- Double_t cy=0.5;
- Double_t rr=0.3;
- Double_t kk = TMath::Pi()*20./180.;
- Double_t scale = 100./4000.;
- TPolyMarker* iddu = new TPolyMarker(18,newx,newy);
- TPolyMarker* disp = new TPolyMarker(18,newx,newy);
-
- Int_t sm,outc,outclw; //outer number counterclock and clockwise
- for(sm=0; sm<18; sm++){
- outc=5-sm;
- if(outc<1) outc+=18;
- outclw=outc-1;
- if(outclw<1) outclw+=18;
- mean_dx[sm]=0.125*(adx[outc-1]+adx[outclw-1]+adx[outc+18-1]+adx[outclw+18-1]+dwdx[outc-1]+dwdx[outclw-1]+dwdx[outc+18-1]+dwdx[outclw+18-1]);
- mean_dy[sm]=0.125*(ady[outc-1]+ady[outclw-1]+ady[outc+18-1]+ady[outclw+18-1]+dwdy[outc-1]+dwdy[outclw-1]+dwdy[outc+18-1]+dwdy[outclw+18-1]);
- idx[sm]=cx+rr*TMath::Sin(sm*kk);
- idy[sm]=cy+rr*TMath::Cos(sm*kk);
- newx[sm]=idx[sm]+scale*mean_dx[sm];
- newy[sm]=idy[sm]+scale*mean_dy[sm];
- iddu->SetPoint(sm,idx[sm],idy[sm]);
- disp->SetPoint(sm,newx[sm],newy[sm]);
-
- segmpath=basepath;
- segmpath+=sm;
- segmpath+="_1";
- cout<<segmpath.Data()<<" "<<dvoluid<<" "<<mean_dx[sm]*0.1<<" "<<mean_dy[sm]*0.1<<" "<<dz<<" "<<sfdpsi<<" "<<sfdtheta<<" "<<sfdphi<<endl;
- new(alobj[sm]) AliAlignObjParams(segmpath.Data(), dvoluid, mean_dx[sm]*0.1,
- mean_dy[sm]*0.1, dz, sfdpsi, sfdtheta, sfdphi, kTRUE);
- }
-
- for(Int_t k=0; k<18; k++){
- AliAlignObjParams* smobj = (AliAlignObjParams*)array->UncheckedAt(k);
- if(!smobj->ApplyToGeometry()){
- cout<<"application of object "<<k<<" failed!"<<endl;
- return;
- }
- }
- gGeoManager->Export("./geom_misalBSEGMO.root");
-
- AliGeomManager::LoadGeometry("./geom_misalBSEGMO.root");
-
- // TOF part !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Int_t nSMTOF = 18;
- Int_t i;
- Int_t j=18;
- Double_t tofdx, tofdy, tofdz, dpsi, dtheta, dphi;
+ Int_t j=0;
+ Double_t smdx, smdy, smdz, dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(2345);
Double_t sigmatr = 0.4; // max shift in cm w.r.t. local ideal RS
Double_t sigmarot = 0.06; // max rot in deg w.r.t. local ideal RS (~ 1 mrad)
- for(i=0; i<18; i++) {
+ for(Int_t i=0; i<nSMTOF; i++) {
TString symname(Form("TOF/sm%02d",i));
- tofdx = rnd->Gaus(0.,sigmatr);
- tofdy = rnd->Gaus(0.,sigmatr);
- tofdz =0;
+ smdx = rnd->Gaus(0.,sigmatr);
+ smdy = rnd->Gaus(0.,sigmatr);
+ smdz =0;
dpsi = 0.;
dtheta = rnd->Gaus(0.,sigmarot);
dphi = 0.;
- new(alobj[j++]) AliAlignObjParams(symname.Data(), dvoluid, tofdx, tofdy, tofdz, dpsi, dtheta, dphi, kFALSE);
+ new((*array)[j++]) AliAlignObjParams(symname.Data(), dvoluid, smdx, smdy, smdz, dpsi, dtheta, dphi, kFALSE);
}
- for(Int_t k=18; k<36; k++){
- AliAlignObjParams* smobj = (AliAlignObjParams*)array->UncheckedAt(k);
+ // Apply objects for TOF supermodules
+ for(Int_t i=0; i<nSMTOF; i++){
+ AliAlignObjParams* smobj = (AliAlignObjParams*)array->UncheckedAt(i);
if(!smobj->ApplyToGeometry()){
- cout<<"application of object "<<k<<" failed!"<<endl;
+ cout<<"application of object "<<i<<" failed!"<<endl;
return;
}
}
- gGeoManager->Export("./geom_misalBSEGMO_tofSM.root");
- AliGeomManager::LoadGeometry("./geom_misalBSEGMO_tofSM.root");
- // tof strips as in residual
+ //Produce objects for TOF strips (same sigmas as for residual misalignment)
AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
Double_t sdx=0.;
sdpsi = 0.;
sdtheta = 0.;
sdphi = 0.;
- new(alobj[j++]) AliAlignObjParams(AliGeomManager::SymName(idTOF,i), AliGeomManager::LayerToVolUID(idTOF,i), sdx, sdy, sdz, sdpsi, sdtheta, sdphi, kFALSE);
+ new((*array)[j++]) AliAlignObjParams(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
+ // save in file
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);
+ Info(macroname,"Saving alignment objects in file %s", filename);
f.cd();
f.WriteObject(array,"TOFAlignObjs","kSingleKey");
f.Close();
}else{
// save in CDB 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("Silvia Arcelli");
- md->SetComment("Full misalignment for TOF and FRAME");
+ md->SetComment("Full misalignment for TOF");
md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
AliCDBId id("TOF/Align/Data",0,AliCDBRunRange::Infinity());
storage->Put(array,id,md);
}
array->Delete();
- gGeoManager = 0x0;
}
TClonesArray *array = new TClonesArray("AliAlignObjParams",2000);
TClonesArray &alobj = *array;
- 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
+ const char* macroname = "MakeTOFResMisAlignment.C";
- AliAlignObjParams a;
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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::ELayerID idTOF = AliGeomManager::kTOF;
Int_t i;
Double_t dz=0.;
Double_t dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(4357);
- Double_t sigmatr = 0.1; // max shift in cm w.r.t. local ideal RS
+ Double_t sigmatr = 0.1; // sigma (in cm) for shift w.r.t. local ideal RS
for(i=0; i<AliGeomManager::LayerSize(idTOF); i++) {
dx = 0;
j++;
}
- const char* macroname = "MakeTOFResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "TOFresidualMisalignment.root";
f.Close();
}else{
// save in CDB 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("Silvia Arcelli");
md->SetComment("Residual misalignment for TOF, sigmatr=1mm in the local RS");
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",2000);
TClonesArray &alobj = *array;
-
- 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
-
- AliAlignObjParams a;
+ const char* macroname = "MakeTOFZeroMisAlignment.C";
+
AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
Int_t i;
Int_t j=0;
new(alobj[j++]) AliAlignObjParams(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
const char* filename = "TOFzeroMisalignment.root";
void MakeTPCFullMisAlignment(){
// Create TClonesArray of full misalignment objects for TPC
//
- 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
-
+ const char* macroname = "MakeTPCFullMisAlignment.C";
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
+
TClonesArray *array = new TClonesArray("AliAlignObjParams",100);
TClonesArray &alobj = *array;
TRandom *rnd = new TRandom(4357);
- AliAlignObjParams o;
Int_t j = 0;
Double_t dx, dy, dz, dpsi, dtheta, dphi;
}
}
-
- const char* macroname = "MakeTPCFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "TPCfullMisalignment.root";
f.Close();
}else{
// save in CDB 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("Marian Ivanov");
md->SetComment("Full misalignment for TPC, sigmatr=0.01 and sigmarot=0.6 in the local RS");
void MakeTPCResMisAlignment(){
// Create TClonesArray of residual misalignment objects for TPC
//
- 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
+ const char* macroname = "MakeTPCResMisAlignment.C";
+
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
TClonesArray *array = new TClonesArray("AliAlignObjParams",100);
TClonesArray &alobj = *array;
TRandom *rnd = new TRandom(4357);
- AliAlignObjParams o;
Double_t dx, dy, dz, dpsi, dtheta, dphi;
Int_t j = 0;
}
}
-
- const char* macroname = "MakeTPCResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "TPCresidualMisalignment.root";
f.Close();
}else{
// save in CDB 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("Marian Ivanov");
md->SetComment("Residual misalignment for TPC, sigmatr=0.01 and sigmarot=0.6 in the local RS");
void MakeTPCZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for TPC
//
- 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
+ const char* macroname = "MakeTPCZeroMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",100);
TClonesArray &alobj = *array;
- AliAlignObjParams o;
Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
Int_t j = 0;
}
}
-
- const char* macroname = "MakeTPCZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "TPCzeroMisalignment.root";
void MakeTRDFullMisAlignment(){
// Create TClonesArray of full misalignment objects for TRD
+ // Expects to read objects for FRAME
//
TClonesArray *array = new TClonesArray("AliAlignObjParams",1000);
- TClonesArray &alobj = *array;
-
- AliAlignObjParams a;
+ 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");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
+
+ // load FRAME full misalignment objects (if needed, the macro
+ // for FRAME has to be ran in advance) and apply them to geometry
+ Info(macroname,"Loading FRAME alignment objects from CDB storage %s",
+ Storage.Data());
+ AliCDBPath fpath("GRP","Align","Data");
+ if( gSystem->Getenv("TOCDB") == TString("kTRUE") ){
+ AliCDBEntry *eFrame = storage->Get(fpath.GetPath(),cdb->GetRun());
+ if(!entry) 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");
+ }else{
+ AliCDBEntry *eFrame = cdb->Get(fpath.GetPath());
+ if(!entry) 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 supermodules
Double_t smdx=0.3; // 3 mm
Double_t smdy=0.3; // 3 mm
UShort_t volid;
const char *symname;
- AliGeomManager::LoadGeometry("./geom_misalBSEGMO.root"); // geometry where the BSEGMO volumes have been misaligned
-
// create the supermodules' alignment objects
for (int i; i<18; i++) {
TString sm_symname(Form("TRD/sm%02d",i));
rx*=smrx;
ry*=smry;
rz*=smrz;
- new(alobj[j++]) AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kFALSE);
+ new((*array)[j++]) AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kFALSE);
}
for(Int_t k=0; k<18; k++){
return;
}
}
- 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++) {
rz*=chrz;
volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
symname = AliGeomManager::SymName(volid);
- new(alobj[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
+ new((*array)[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
}
}
- const char* macroname = "MakeTRDFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "TRDfullMisalignment.root";
f.Close();
}else{
// save in CDB 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("Dariusz Miskowiec");
md->SetComment("Full misalignment for TRD");
}
array->Delete();
- gGeoManager = 0x0;
}
void MakeTRDResMisAlignment(){
// Create TClonesArray of residual misalignment objects for TRD
//
+ const char* macroname = "MakeTRDResMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",1000);
TClonesArray &alobj = *array;
- 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
-
- AliAlignObjParams a;
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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 chry=0.3/1000/TMath::Pi()*180; // 0.3 mrad
Double_t chrz=0.1/1000/TMath::Pi()*180; // 0.1 mrad
- Double_t dx,dy,dz,rx,ry,rz;
+ Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
Int_t j=0;
TRandom *ran = new TRandom(4357);
UShort_t volid;
- const char *path;
+ const char* symname;
+ // create the supermodules' alignment objects
+ for (int i; i<18; i++) {
+ TString sm_symname(Form("TRD/sm%02d",i));
+ new((*array)[j++])
+ AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kTRUE);
+ }
+
// create the chambers' alignment objects
for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
- ran.Rannor(dx,rx);
- ran.Rannor(dy,ry);
- ran.Rannor(dz,rz);
+ ran->Rannor(dx,rx);
+ ran->Rannor(dy,ry);
+ ran->Rannor(dz,rz);
dx*=chdx;
dy*=chdy;
dz*=chdz;
}
}
- const char* macroname = "MakeTRDResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "TRDresidualMisalignment.root";
f.Close();
}else{
// save in CDB 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("Dariusz Miskowiec");
md->SetComment("Residual misalignment for TRD");
void MakeTRDZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for TRD
//
+ const char* macroname = "MakeTRDZeroMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",1000);
TClonesArray &alobj = *array;
- 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
-
- AliAlignObjParams a;
Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
UShort_t volid;
const char *symname;
- // create the chambers' alignment objects
+ // create the supermodules' alignment objects
+ for (int i; i<18; i++) {
+ TString sm_symname(Form("TRD/sm%02d",i));
+ new(alobj[j++]) AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kTRUE);
+ }
+
+ // create the chambers' alignment objects
for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
}
}
- const char* macroname = "MakeTRDZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "TRDzeroMisalignment.root";
void MakeVZEROFullMisAlignment(){
// Create TClonesArray of full misalignment objects for VZERO
//
- 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
+ const char* macroname = "MakeVZEROFullMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams a;
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
Double_t dx, dy, dz, dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(4321);
Double_t sigmatr = 0.1; // max shift in cm
Double_t sigmarot = 0.5; // max rot in degrees
- // null shifts and rotations
-
const char *V0right="VZERO/V0C";
const char *V0left="VZERO/V0A";
new(alobj[1]) AliAlignObjParams(V0left, volid, dx, dy, dz, dpsi, dtheta,
dphi,kFALSE);
- const char* macroname = "MakeVZEROFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "VZEROfullMisalignment.root";
f.Close();
}else{
// save in CDB 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("Brigitte Cheynis");
md->SetComment("Alignment objects for V0 full misalignment");
void MakeVZEROResMisAlignment(){
// Create TClonesArray of residual misalignment objects for VZERO
//
- 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
+ const char* macroname = "MakeVZEROResMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams a;
+ // Activate CDB storage and load geometry from CDB
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ cdb->SetRun(0);
+
+ AliCDBStorage* storage;
+
+ if( 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
+ }
Double_t dx, dy, dz, dpsi, dtheta, dphi;
TRandom *rnd = new TRandom(4321);
dphi = rnd->Gaus(0.,sigmarot);
new(alobj[1]) AliAlignObjParams(V0left, volid, dx, dy, dz, dpsi, dtheta, dphi,kFALSE);
- const char* macroname = "MakeVZEROResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "VZEROresidualMisalignment.root";
f.Close();
}else{
// save in CDB 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("Brigitte Cheynis");
md->SetComment("Alignment objects for V0 residual misalignment");
void MakeVZEROZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for VZERO
//
- 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
+ const char* macroname = "MakeVZEROZeroMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams a;
-
Double_t dx, dy, dz, dpsi, dtheta, dphi;
Int_t iIndex=0;
TString V0left("VZERO/V0A");
new(alobj[1]) AliAlignObjParams(V0left.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
- const char* macroname = "MakeVZEROZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save on file
const char* filename = "VZEROzeroMisalignment.root";
void MakeZDCFullMisAlignment(){
// Create TClonesArray of full misalignment objects for ZDC
//
- 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
+ const char* macroname = "MakeZDCFullMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams a;
-
Double_t dx=0., dy=2., dz=0.;
Double_t dpsi=0., dtheta=0., dphi=0.;
new(alobj[0]) AliAlignObjParams(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjParams(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
- const char* macroname = "MakeZDCFullMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save in file
const char* filename = "ZDCfullMisalignment.root";
void MakeZDCResMisAlignment(){
// Create TClonesArray of residual misalignment objects for ZDC
//
- 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
+ const char* macroname = "MakeZDCResMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams a;
-
Double_t dx=0., dy=0.05, dz=0.;
Double_t dpsi=0., dtheta=0., dphi=0.;
new(alobj[0]) AliAlignObjParams(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjParams(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
- const char* macroname = "MakeZDCResMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save in file
const char* filename = "ZDCresidualMisalignment.root";
void MakeZDCZeroMisAlignment(){
// Create TClonesArray of zero misalignment objects for ZDC
//
- 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
+ const char* macroname = "MakeZDCZeroMisAlignment.C";
TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
TClonesArray &alobj = *array;
- AliAlignObjParams a;
-
Double_t dx=0., dy=0., dz=0.;
Double_t dpsi=0., dtheta=0., dphi=0.;
new(alobj[0]) AliAlignObjParams(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
new(alobj[1]) AliAlignObjParams(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
- const char* macroname = "MakeZDCZeroMisAlignment.C";
if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
// save in file
const char* filename = "ZDCzeroMisalignment.root";
+const char* GetARversion();
+
void MakeAllDETsFullMisAlignment(Char_t* CDBstorage = "local://$HOME/Full"){
- // Make full misalignment objects for all detectors
+ // 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
// 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","v4-05-08");
+ gSystem->Setenv("ARVERSION",GetARversion());
}
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
+ // 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");
+ 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");
+ UpdateCDBIdealGeom(strStorage.Data());
+ // 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");
- TString dets = "EMCAL,FMD,ITS,MUON,PHOS,PMD,HMPID,T0,TOF,TPC,TRD,VZERO,ZDC";
- TObjArray *detArray = dets.Tokenize(',');
+ // run macros for sensitive modules
+ TString sModules="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;
return;
}
+
+const char* GetARversion(){
+ // Get AliRoot version from $ALICE_ROOT/CVS/Repository file
+ // It's the best we can do without a GetVersion() method
+ TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
+ Int_t size = fv->GetSize();
+ char *buf = new Char_t[size];
+ memset(buf, '\0', size);
+ fv->Seek(0);
+ const char* alirootv;
+ if ( fv->ReadBuffer(buf, size) ) {
+ Printf("Error reading AliRoot version from file to buffer!");
+ alirootv = "";
+ }
+ if(buf=="AliRoot"){
+ alirootv="HEAD";
+ }else{
+ alirootv = buf;
+ }
+ return alirootv;
+}
+const char* GetARversion();
+
void MakeAllDETsResMisAlignment(Char_t* CDBstorage = "local://$HOME/Residual"){
// Make residual misalignment objects for all detectors
// Pass different "CDBstorage" argument if needed (e.g. to fill
// in charge of producing the residual misalignment objects as
// $ALICE_ROOT/DET/MakeDETResidualMisAlignment.C
//
+ const char* macroname="MakeAllDETsResMisAlignment.C";
+
TString strStorage(CDBstorage);
if(strStorage.IsNull()){
gSystem->Setenv("TOCDB","kFALSE");
}else{
gSystem->Setenv("TOCDB","kTRUE");
gSystem->Setenv("STORAGE",strStorage.Data());
- gSystem->Setenv("ARVERSION","v4-05-08");
+ gSystem->Setenv("ARVERSION",GetARversion());
}
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
+ // 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");
+ 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");
+ UpdateCDBIdealGeom(strStorage.Data());
+ // 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/MakeSTRUCTResMisAlignment.C");
- TString dets="EMCAL,FMD,HMPID,ITS,MUON,PHOS,PMD,T0,TOF,TPC,TRD,VZERO,ZDC";
- TObjArray *detArray = dets.Tokenize(',');
+ // run macros for sensitive modules
+ TString sModules="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;
return;
}
+
+const char* GetARversion(){
+ // Get AliRoot version from $ALICE_ROOT/CVS/Repository file
+ // It's the best we can do without a GetVersion() method
+ TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
+ Int_t size = fv->GetSize();
+ char *buf = new Char_t[size];
+ memset(buf, '\0', size);
+ fv->Seek(0);
+ const char* alirootv;
+ if ( fv->ReadBuffer(buf, size) ) {
+ Printf("Error reading AliRoot version from file to buffer!");
+ alirootv = "";
+ }
+ if(buf=="AliRoot"){
+ alirootv="HEAD";
+ }else{
+ alirootv = buf;
+ }
+ return alirootv;
+}
-void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/Zero"){
+const char* GetARversion();
+
+void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$ALICE_ROOT"){
// Make zero 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
//
+ const char* macroname="MakeAllDETsZeroMisAlignment.C";
+
TString strStorage(CDBstorage);
if(strStorage.IsNull()){
gSystem->Setenv("TOCDB","kFALSE");
}else{
gSystem->Setenv("TOCDB","kTRUE");
gSystem->Setenv("STORAGE",strStorage.Data());
- gSystem->Setenv("ARVERSION","v4-05-08");
+ gSystem->Setenv("ARVERSION",GetARversion());
}
- if(!AliGeomManager::GetGeometry()){
- if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
- AliCDBManager::Instance()->SetRun(0);
- AliGeomManager::LoadGeometry();
+ // 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");
+ 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");
+ 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/MakeSTRUCTZeroMisAlignment.C");
-
- TString dets="EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
- TObjArray *detArray = dets.Tokenize(',');
+ // run macros for sensitive modules
+ TString sModules="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;
return;
}
+
+const char* GetARversion(){
+ // Get AliRoot version from $ALICE_ROOT/CVS/Repository file
+ // It's the best we can do without a GetVersion() method
+ TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
+ Int_t size = fv->GetSize();
+ char *buf = new Char_t[size];
+ memset(buf, '\0', size);
+ fv->Seek(0);
+ const char* alirootv;
+ if ( fv->ReadBuffer(buf, size) ) {
+ Printf("Error reading AliRoot version from file to buffer!");
+ alirootv = "";
+ }
+ if(buf=="AliRoot"){
+ alirootv="HEAD";
+ }else{
+ alirootv = buf;
+ }
+ return alirootv;
+}