]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Full set of updated misalignment macros (Raffaele)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Feb 2007 08:25:02 +0000 (08:25 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Feb 2007 08:25:02 +0000 (08:25 +0000)
31 files changed:
EMCAL/MakeEMCALFullMisAlignment.C
EMCAL/MakeEMCALResMisAlignment.C
EMCAL/MakeEMCALZeroMisAlignment.C [new file with mode: 0644]
FMD/MakeFMDZeroMisAlignment.C [new file with mode: 0644]
HMPID/MakeHMPIDZeroMisAlignment.C [new file with mode: 0644]
ITS/MakeITSFullMisAlignment.C
ITS/MakeITSResMisAlignment.C
ITS/MakeITSZeroMisAlignment.C [new file with mode: 0644]
MUON/MakeMUONZeroMisAlignment.C [new file with mode: 0644]
PHOS/MakePHOSZeroMisAlignment.C [new file with mode: 0644]
PMD/MakePMDFullMisAlignment.C
PMD/MakePMDResMisAlignment.C
PMD/MakePMDZeroMisAlignment.C [new file with mode: 0644]
T0/MakeT0FullMisAlignment.C
T0/MakeT0ResMisAlignment.C
T0/MakeT0ZeroMisAlignment.C [new file with mode: 0644]
TOF/MakeTOFFullMisAlignment.C
TOF/MakeTOFResMisAlignment.C
TOF/MakeTOFZeroMisAlignment.C
TPC/MakeTPCFullMisAlignment.C
TPC/MakeTPCResMisAlignment.C
TPC/MakeTPCZeroMisAlignment.C [new file with mode: 0644]
TRD/MakeTRDFullMisAlignment.C
TRD/MakeTRDResMisAlignment.C
TRD/MakeTRDZeroMisAlignment.C [new file with mode: 0644]
VZERO/MakeVZEROFullMisAlignment.C
VZERO/MakeVZEROResMisAlignment.C
VZERO/MakeVZEROZeroMisAlignment.C [new file with mode: 0644]
ZDC/MakeZDCZeroMisAlignment.C [new file with mode: 0644]
macros/MakeAllDETsResMisAlignment.C
macros/MakeAllDETsZeroMisAlignment.C [new file with mode: 0644]

index ca502270552025c1ce9056b563ffabdba90a68ef..563cf1600e482fef4cdc366711851d653b87d264 100644 (file)
@@ -17,15 +17,16 @@ void MakeEMCALFullMisAlignment(){
   // null shifts and rotations
 
   const TString basepath = "EMCAL/FullSupermodule";
+  const TString hbasepath = "EMCAL/HalfSupermodule";
   TString pathstr;
 
   Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
   AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
   UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex); //dummy volume identity
   Int_t i;
+  Int_t j=0;
 
   for(i=0; i<10; i++){
-
     dx = rnd->Gaus(0.,sigmatr);
     dy = rnd->Gaus(0.,sigmatr);
     dz = rnd->Gaus(0.,sigmatr);
@@ -35,7 +36,19 @@ void MakeEMCALFullMisAlignment(){
     pathstr=basepath;
     pathstr+=(i+1);
     cout<<pathstr<<"  "<<dx<<"  "<<dy<<"  "<<dz<<"  "<<dpsi<<"  "<<dtheta<<"  "<<dphi<<"\n";
-    new(alobj[i]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+    new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+  }
+
+  for(i=0; i<2; i++){
+    dx = rnd->Gaus(0.,sigmatr);
+    dy = rnd->Gaus(0.,sigmatr);
+    dz = rnd->Gaus(0.,sigmatr);
+    dpsi = rnd->Gaus(0.,sigmarot);
+    dtheta = rnd->Gaus(0.,sigmarot);
+    dphi = rnd->Gaus(0.,sigmarot);
+    pathstr=hbasepath;
+    pathstr+=(i+1);
+    new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
   }
 
   if(!gSystem->Getenv("$TOCDB")){
index 7fe39f1786b8c7a0aba107ec7529d5505d204f27..8f16e8efe727cc7465a1f1fc0dcbefccd760faa9 100644 (file)
@@ -12,6 +12,7 @@ void MakeEMCALResMisAlignment(){
   Double_t dx, dy, dz, dpsi, dtheta, dphi;
 
   const TString basepath = "EMCAL/FullSupermodule";
+  const TString hbasepath = "EMCAL/HalfSupermodule";
   TString pathstr;
 
   Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
@@ -19,6 +20,7 @@ void MakeEMCALResMisAlignment(){
   UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
 
   Int_t i;
+  Int_t j=0;
 
   // RS = local
   // sigma translation = 1mm
@@ -26,6 +28,7 @@ void MakeEMCALResMisAlignment(){
   TRandom *rnd   = new TRandom(4321);
   Double_t sigmatr = 0.1; // max shift in cm w.r.t. local RS
   Double_t sigmarot = 0.1; // max rot in degrees w.r.t. local RS
+
   for(i=0; i<10; i++){
     dx = rnd->Gaus(0.,sigmatr);
     dy = rnd->Gaus(0.,sigmatr);
@@ -35,7 +38,19 @@ void MakeEMCALResMisAlignment(){
     dphi = rnd->Gaus(0.,sigmarot);
     pathstr=basepath;
     pathstr+=(i+1);
-    new(alobj[i]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+    new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
+  }
+
+  for(i=0; i<2; i++){
+    dx = rnd->Gaus(0.,sigmatr);
+    dy = rnd->Gaus(0.,sigmatr);
+    dz = rnd->Gaus(0.,sigmatr);
+    dpsi = rnd->Gaus(0.,sigmarot);
+    dtheta = rnd->Gaus(0.,sigmarot);
+    dphi = rnd->Gaus(0.,sigmarot);
+    pathstr=hbasepath;
+    pathstr+=(i+1);
+    new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
   }
 
   if(!gSystem->Getenv("$TOCDB")){
diff --git a/EMCAL/MakeEMCALZeroMisAlignment.C b/EMCAL/MakeEMCALZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..5e9d194
--- /dev/null
@@ -0,0 +1,60 @@
+void MakeEMCALZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for EMCAL
+  //
+  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
+
+  AliAlignObjAngles a;
+
+  Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
+
+  const TString fbasepath = "EMCAL/FullSupermodule";
+  const TString hbasepath = "EMCAL/HalfSupermodule";
+  TString pathstr;
+
+  Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
+  AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+  UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+  Int_t i;
+  Int_t j=0;
+
+  for(i=0; i<10; i++){
+    pathstr=fbasepath;
+    pathstr+=(i+1);
+    new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  }
+
+  for(i=0; i<2; i++){
+    pathstr=hbasepath;
+    pathstr+=(i+1);
+    new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  }
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("EMCALzeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    f.cd();
+    f.WriteObject(array,"EMCALAlignObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    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);
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
diff --git a/FMD/MakeFMDZeroMisAlignment.C b/FMD/MakeFMDZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..db21d2d
--- /dev/null
@@ -0,0 +1,26 @@
+void MakeFMDZeroMisAlignment()
+{
+  // Create TClonesArray of zero-misalignment objects for FMD
+  //
+  if(!gGeoManager) TGeoManager::Import("geometry.root");
+  
+  gSystem->Load("libFMDutil.so");
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    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);
+  }
+
+  // fRunMax should be changed in the constructor
+
+  faker.SetSensorDisplacement(0., 0., 0., 0., 0., 0.);
+  faker.SetSensorRotation(0., 0., 0., 0., 0., 0.);
+  faker.SetHalfDisplacement(0., 0., 0., 0., 0., 0.);
+  faker.SetHalfRotation(0., 0., 0., 0., 0., 0.);
+  faker.Exec();
+
+
+}
diff --git a/HMPID/MakeHMPIDZeroMisAlignment.C b/HMPID/MakeHMPIDZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..981ecad
--- /dev/null
@@ -0,0 +1,38 @@
+void MakeHMPIDZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for HMPID
+  //
+  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 =  AliAlignObj::kHMPID;
+  for (Int_t iCh = 0; iCh < 7; iCh++) {
+    new((*pCA)[iCh]) AliAlignObjMatrix(AliAlignObj::SymName(idHMPID,iCh),AliAlignObj::LayerToVolUID(idHMPID,iCh),dX,dY,dZ,dPsi,dTheta,dPhi,kTRUE);
+  }
+
+//   pCA->Print();
+  
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("HMPIDzeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    f.cd();
+    f.WriteObject(pCA,"HMPIDAlignObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    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);
+    storage->Put(pCA,id,pMeta);
+  }
+  
+  pCA->Delete();
+}
index acd3010fb7030ad5eba5a3439034f49b32d58375..cf64e03ee2790cc9fa59bbd82f5d03eb71592898 100644 (file)
@@ -27,6 +27,8 @@ void MakeITSFullMisAlignment(){
 
   Int_t j = 0;
   new(alobj[j++]) AliAlignObjAngles("ITS", 0, dx, dy, globalZ, dpsi, dtheta, dphi, kTRUE);
+  AliAlignObjAngles* its_alobj = (AliAlignObjAngles*) array->UncheckedAt(0);
+  its_alobj->ApplyToGeometry();
 
   for ( Int_t l = AliAlignObj::kSPD1; l <= AliAlignObj::kSSD2; l++) {
     
index bd647bac63053604bc96555998232993a7d90737..891777c664556d9cf88e010d884ae2c3c312792c 100644 (file)
@@ -25,8 +25,10 @@ void MakeITSResMisAlignment(){
 
   Int_t j = 0;
 
-  new(alobj[j]) AliAlignObjAngles("ITS", 0, dx, dy, globalZ, dpsi, dtheta, dphi, kTRUE);
-  j++;
+  new(alobj[j++]) AliAlignObjAngles("ITS", 0, dx, dy, globalZ, dpsi, dtheta, dphi, kTRUE);
+  AliAlignObjAngles* its_alobj = (AliAlignObjAngles*) array->UncheckedAt(0);
+  its_alobj->ApplyToGeometry();
+
 
   for ( Int_t l = AliAlignObj::kSPD1; l <= AliAlignObj::kSSD2; l++) {
     
diff --git a/ITS/MakeITSZeroMisAlignment.C b/ITS/MakeITSZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..af0360b
--- /dev/null
@@ -0,0 +1,80 @@
+void MakeITSZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for ITS
+  //
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",4000);
+  TClonesArray &alobj = *array;
+   
+  if(!gGeoManager) TGeoManager::Import("geometry.root");
+  // needed for the constructors with local coordinates not to fail
+
+  AliAlignObjAngles a;
+
+  Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0., globalZ=0.;
+  AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer; 
+
+  Int_t j = 0;
+
+  new(alobj[j]) AliAlignObjAngles("ITS", 0, dx, dy, globalZ, dpsi, dtheta, dphi, kTRUE);
+  j++;
+
+  for ( Int_t l = AliAlignObj::kSPD1; l <= AliAlignObj::kSSD2; l++) {
+    
+    printf("%i modules in layer %i\n", AliAlignObj::LayerSize(l), l);
+    for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(l); iModule++) {
+
+      iLayer = AliAlignObj::kInvalidLayer; 
+
+      switch (l) {
+      case 1: {
+       iLayer = AliAlignObj::kSPD1;
+      }; break;
+      case 2: {
+       iLayer = AliAlignObj::kSPD2;
+      }; break;
+      case 3: {
+       iLayer = AliAlignObj::kSDD1;
+      }; break;
+      case 4: {
+       iLayer = AliAlignObj::kSDD2;
+      }; break;
+      case 5: {
+       iLayer = AliAlignObj::kSSD1;
+      }; break;
+      case 6: {
+       iLayer = AliAlignObj::kSSD2;
+      }; break;
+      default: Printf("Wrong layer index in ITS (%d) !",l);
+      };
+      UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
+      const char *symname = AliAlignObj::SymName(volid);
+
+      new(alobj[j]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+      j++;
+
+    }
+  }
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("ITSzeroMisalignment.root","RECREATE");
+    if(!f) {cerr<<"cannot open file for output\n";}
+    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);
+    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);
+    storage->Put(array,id, md);
+  }
+
+  array->Delete();
+
+}
+
+
diff --git a/MUON/MakeMUONZeroMisAlignment.C b/MUON/MakeMUONZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..6f4c924
--- /dev/null
@@ -0,0 +1,73 @@
+void MakeMUONZeroMisAlignment(Bool_t volpaths = false,
+                             Bool_t transforms = false, 
+                             Bool_t svmaps = false)
+// Macro for generating the geometry data files:
+// (volpath.dat, transform.dat, svmap.dat)
+// and local CDB storage with zero, residual and full misalignment
+//
+// The generated files do not replace the existing ones
+// but have different names (with extension ".out").
+//
+//  Author: I. Hrivnacova, IPN Orsay
+//
+{
+  // Initialize
+  gAlice->Init("$ALICE_ROOT/MUON/Config.C");
+  cout << "Init done " << endl;
+
+  // Get MUON detector
+  AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON");
+  if (!muon) {
+    AliFatal("MUON detector not defined.");
+    return 0;
+  }  
+
+  // Get geometry builder
+  AliMUONGeometryBuilder* builder = muon ->GetGeometryBuilder();
+  
+  if (volpaths) {
+    cout << "Generating volpath file ..." << endl;
+    builder->GetTransformer()->WriteVolumePaths("volpath.dat.out");
+  }  
+
+  if (transforms) {
+    cout << "Generating transformation file ..." << endl;
+    builder->GetTransformer()->WriteTransformations("transform.dat.out");
+  }  
+
+  if (svmaps) {
+    cout << "Generating svmaps file ..." << endl;
+    builder->WriteSVMaps();
+  }  
+
+  cout << "Generating residual misalignment data in  MUON/ZeroMisAlignCDB/Data..." << endl;
+  
+  AliMUONGeometryMisAligner misAligner(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
+  AliMUONGeometryTransformer* newTransform 
+    = misAligner.MisAlign(builder->GetTransformer(), true);
+  TClonesArray* array = newTransform->GetMisAlignmentData();
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // Create a File to store the alignment data
+    TFile f("MUONresidualMisalignment.root","RECREATE");
+    if(!f) {cerr<<"cannot open file for output\n";}
+    
+    f.cd();
+    f.WriteObject(array,"MUONAlignObjs ","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdbManager = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdbManager->GetStorage(Storage);
+    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); 
+    storage->Put(array, id, cdbData);
+  }
+  
+  delete newTransform;
+}   
+
diff --git a/PHOS/MakePHOSZeroMisAlignment.C b/PHOS/MakePHOSZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..fb87b20
--- /dev/null
@@ -0,0 +1,66 @@
+void MakePHOSZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for PHOS
+  //
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",11);
+  TClonesArray &alobj = *array;
+   
+  AliAlignObjAngles a;
+
+  Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
+
+  Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
+  AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+  UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+  // Alignment for 5 PHOS modules
+  new(alobj[0]) AliAlignObjAngles("PHOS/Module1",
+        volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  new(alobj[1]) AliAlignObjAngles("PHOS/Module2",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  new(alobj[2]) AliAlignObjAngles("PHOS/Module3",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  new(alobj[3]) AliAlignObjAngles("PHOS/Module4",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  new(alobj[4]) AliAlignObjAngles("PHOS/Module5",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+
+  // Alignment for PHOS cradle
+  new(alobj[5]) AliAlignObjAngles("PHOS/Cradle0",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  new(alobj[6]) AliAlignObjAngles("PHOS/Cradle1",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+
+  // Alignment for cradle wheels
+  new(alobj[7])  AliAlignObjAngles("PHOS/Wheel0",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  new(alobj[8])  AliAlignObjAngles("PHOS/Wheel1",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  new(alobj[9])  AliAlignObjAngles("PHOS/Wheel2",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  new(alobj[10]) AliAlignObjAngles("PHOS/Wheel3",
+       volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("PHOSzeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    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);
+    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);
+    storage->Put(array,id, md);
+  }
+
+  array->Delete();
+
+}
index 62becb6713313fe9ab62f667c050418fb01cc6d6..36bcd6a38bbf38fa0665f9ab4b88318fc4c05e0e 100644 (file)
@@ -42,10 +42,10 @@ void MakePMDFullMisAlignment(){
   Float_t max_rot=0.1;
 
   TString path;
-  const char *Sector1="/ALIC_1/EPM1_1"; 
-  const char *Sector2="/ALIC_1/EPM2_1"; 
-  const char *Sector3="/ALIC_1/EPM3_1"; 
-  const char *Sector4="/ALIC_1/EPM4_1"; 
+  const char *Sector1="PMD/Sector1"; 
+  const char *Sector2="PMD/Sector2"; 
+  const char *Sector3="PMD/Sector3"; 
+  const char *Sector4="PMD/Sector4"; 
   
   
   //Sectors 1 and 4
index fcc8ad5d3187f80cba65aef0228b1371967f6cee..06bc9add6c8496bbb359790f53117f6fee210fed 100644 (file)
@@ -41,10 +41,10 @@ void MakePMDResMisAlignment(){
   Float_t max_rot=0.1;
 
   TString path;
-  const char *Sector1="/ALIC_1/EPM1_1"; 
-  const char *Sector2="/ALIC_1/EPM2_1"; 
-  const char *Sector3="/ALIC_1/EPM3_1"; 
-  const char *Sector4="/ALIC_1/EPM4_1"; 
+  const char *Sector1="PMD/Sector1"; 
+  const char *Sector2="PMD/Sector2";
+  const char *Sector3="PMD/Sector3"; 
+  const char *Sector4="PMD/Sector4"; 
   
   
   //Sectors 1 and 4
diff --git a/PMD/MakePMDZeroMisAlignment.C b/PMD/MakePMDZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..93d4f0d
--- /dev/null
@@ -0,0 +1,79 @@
+void MakePMDZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for PMD
+  //
+  // Macro to randomly displace the 4 sectors of the PMD
+  // in each plane. Each sector (to be misaligned) 
+  // of PMD houses the following :
+  // (a) 6 modules of preshower plane
+  // (b) 6 modules of veto plane
+  // (c) The FEE boards on back plane of each module
+  // (d) 6 modules of convertor plates
+  // The clustering is done module-wise
+  // The actual amount displacement will be provided
+  // by the survey data and has to be converted into
+  // displacement in x,y,z,theta, phi and psi 
+  
+  
+  // Now specify the path of the module to be misaligned
+  // as followed in the PMD geant
+  
+  /*
+     _____________
+    |    |        |
+    | 1  |   3    |
+    |    |________|
+    |____|___|    |
+    |        | 2  |
+    |   4    |    |
+    |________|____|
+    
+    // Misalignment Matrix is expected to be
+    // same for sectors 1 and 4 
+    // and for the sectors 2 and 3
+    // As these will be mounted on the same
+    // Steel plate 
+ */
+  
+  if(!gGeoManager) TGeoManager::Import("geometry.root");
+  // needed for the constructors with local coordinates not to fail
+
+  //Create a TClonesArray of Align Object to store displacement Angles
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+  TClonesArray &alobj = *array;
+  
+  AliAlignObjAngles o;
+  
+  Int_t iIndex=0; //  let all modules have index=0 in a layer with no LUT
+  AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+  UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+  Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
+  Int_t i, j=0;
+
+  for(i=1; i<=4; i++){
+    TString snSector(Form("PMD/Sector%d",i));
+    new(alobj[j++]) AliAlignObjAngles(snSector.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  }
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // Create a File to store the alignment data
+    TFile f("PMDzeroMisalignment.root","RECREATE");
+    if(!f) {cerr<<"cannot open file for output\n";}
+    
+    f.cd();
+    f.WriteObject(array,"PMDAlignObjs ","kSingleKey");
+    f.Close();
+  }else{
+  // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    AliCDBMetaData* md = new AliCDBMetaData();
+    md->SetResponsible("");
+    md->SetComment("Zero misalignment for PMD");
+    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+    AliCDBId id("PMD/Align/Data",0,9999999);
+    storage->Put(array,id,md);
+  }
+  array->Delete();
+
+}
index 0adebfb58eec48676f4878a091833bb4b688adb0..67b08cddeca9245247866838fd64cb170e5f4860 100644 (file)
@@ -1,7 +1,7 @@
 void MakeT0FullMisAlignment(){
   // Create TClonesArray of full misalignment objects for T0
   //
-  TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",30);
   TClonesArray &alobj = *array;
 
   if(!gGeoManager) TGeoManager::Import("geometry.root");
@@ -10,38 +10,35 @@ void MakeT0FullMisAlignment(){
 
   Double_t dx, dy, dz, dpsi, dtheta, dphi;
   TRandom *rnd   = new TRandom(4321);
-  Double_t sigmatr = 0.05; // max shift in cm w.r.t. RS
-  Double_t sigmarot = 0.3; // max rot in degrees w.r.t. RS
+  Double_t sigmatr = 0.05; // sigma for shifts in cm
+  Double_t sigmarot = 0.3; // sigma for tilts in degrees
 
-  // null shifts and rotations
+  TString symName, sn;
 
-  const char *T0right="/ALIC_1/0STR_1";
-  const char *T0left="/ALIC_1/0STL_1";
-
-  Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
+  Int_t iIndex=0;
   AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
   UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
 
-  dx = rnd->Gaus(0.,sigmatr);
-  dy = rnd->Gaus(0.,sigmatr);
-  dz = rnd->Gaus(0.,sigmatr);
-  dpsi = rnd->Gaus(0.,sigmarot);
-  dtheta = rnd->Gaus(0.,sigmarot);
-  dphi = rnd->Gaus(0.,sigmarot);
-  cout<<dx<<"  "<<dy<<"  "<<dz<<"  "<<dpsi<<"  "<<dtheta<<"  "<<dphi<<"\n";
-  new(alobj[0]) AliAlignObjAngles(T0right, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
-  dx = rnd->Gaus(0.,sigmatr);
-  dy = rnd->Gaus(0.,sigmatr);
-  dz = rnd->Gaus(0.,sigmatr);
-  dpsi = rnd->Gaus(0.,sigmarot);
-  dtheta = rnd->Gaus(0.,sigmarot);
-  dphi = rnd->Gaus(0.,sigmarot);
-  cout<<dx<<"  "<<dy<<"  "<<dz<<"  "<<dpsi<<"  "<<dtheta<<"  "<<dphi<<"\n";
-  new(alobj[1]) AliAlignObjAngles(T0left, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
-
-  // just save in a file you will send me
-  // or you will put in your afs public dir ...
-
+  Int_t j=0;
+  for (Int_t imod=0; imod<24; imod++){
+    if (imod < 12){
+      sn="T0/C/PMT";
+    }else{
+      sn="T0/A/PMT";
+    }
+    symName = sn;
+    symName += imod+1;
+    
+    dx = rnd->Gaus(0.,sigmatr);
+    dy = rnd->Gaus(0.,sigmatr);
+    dz = rnd->Gaus(0.,sigmatr);
+    dpsi = rnd->Gaus(0.,sigmarot);
+    dtheta = rnd->Gaus(0.,sigmarot);
+    dphi = rnd->Gaus(0.,sigmarot);
+    
+    new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  }
+  
   if(!gSystem->Getenv("$TOCDB")){
     // save on file
     TFile f("T0fullMisalignment.root","RECREATE");
@@ -52,7 +49,6 @@ void MakeT0FullMisAlignment(){
   }else{
     // save in CDB storage
     const char* Storage = gSystem->Getenv("$STORAGE");
-    // save in CDB storage
     AliCDBManager* cdb = AliCDBManager::Instance();
     AliCDBStorage* storage = cdb->GetStorage(Storage);
     AliCDBMetaData* md = new AliCDBMetaData();
index c86428ba8f6be779762d18713eeb923a21614856..49c4f62c7cb206ab9577afa373afed6b6e37141a 100644 (file)
@@ -1,7 +1,7 @@
 void MakeT0ResMisAlignment(){
   // Create TClonesArray of residual misalignment objects for T0
   //
-  TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",30);
   TClonesArray &alobj = *array;
 
   if(!gGeoManager) TGeoManager::Import("geometry.root");
@@ -14,30 +14,32 @@ void MakeT0ResMisAlignment(){
   Double_t sigmatr = 0.05; // max shift in cm
   Double_t sigmarot = 0.3; // max rot in degrees
 
-  const char *T0right="/ALIC_1/0STR_1";
-  const char *T0left="/ALIC_1/0STL_1";
+  TString symName, sn;
 
   Int_t iIndex=0;
   AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
   UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
 
-  dx = rnd->Gaus(0.,sigmatr);
-  dy = rnd->Gaus(0.,sigmatr);
-  dz = rnd->Gaus(0.,sigmatr);
-  dpsi = rnd->Gaus(0.,sigmarot);
-  dtheta = rnd->Gaus(0.,sigmarot);
-  dphi = rnd->Gaus(0.,sigmarot);
-  cout<<dx<<"  "<<dy<<"  "<<dz<<"  "<<dpsi<<"  "<<dtheta<<"  "<<dphi<<"\n";
-  new(alobj[0]) AliAlignObjAngles(T0right, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
-  dx = rnd->Gaus(0.,sigmatr);
-  dy = rnd->Gaus(0.,sigmatr);
-  dz = rnd->Gaus(0.,sigmatr);
-  dpsi = rnd->Gaus(0.,sigmarot);
-  dtheta = rnd->Gaus(0.,sigmarot);
-  dphi = rnd->Gaus(0.,sigmarot);
-  cout<<dx<<"  "<<dy<<"  "<<dz<<"  "<<dpsi<<"  "<<dtheta<<"  "<<dphi<<"\n";
-  new(alobj[1]) AliAlignObjAngles(T0left, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
-
+  Int_t j=0;
+  for (Int_t imod=0; imod<24; imod++){
+    if (imod < 12){
+      sn="T0/C/PMT";
+    }else{
+      sn="T0/A/PMT";
+    }
+    symName = sn;
+    symName += imod+1;
+    
+    dx = rnd->Gaus(0.,sigmatr);
+    dy = rnd->Gaus(0.,sigmatr);
+    dz = rnd->Gaus(0.,sigmatr);
+    dpsi = rnd->Gaus(0.,sigmarot);
+    dtheta = rnd->Gaus(0.,sigmarot);
+    dphi = rnd->Gaus(0.,sigmarot);
+    
+    new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  }
+  
   if(!gSystem->Getenv("$TOCDB")){
     // save on file
     TFile f("T0residualMisalignment.root","RECREATE");
diff --git a/T0/MakeT0ZeroMisAlignment.C b/T0/MakeT0ZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..c684c56
--- /dev/null
@@ -0,0 +1,54 @@
+void MakeT0ZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for T0
+  //
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+  TClonesArray &alobj = *array;
+
+  AliAlignObjAngles a;
+
+  Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
+
+  TString symName, sn;
+
+  Int_t iIndex=0;
+  AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+  UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+  Int_t j=0;
+  for (Int_t imod=0; imod<24; imod++)
+    {
+      if (imod < 12){
+       sn="T0/C/PMT";
+      }else{
+       sn="T0/A/PMT";
+      }
+      symName = sn;
+      symName += imod+1;
+
+      new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+    }
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("T0zeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    f.cd();
+    f.WriteObject(array,"T0ZeroObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    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);
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
index 85d71fde69b8f35b301b9f2855c7ff901127c213..dae74df76ab77847123bd0d2f377dbd12084580c 100644 (file)
 void MakeTOFFullMisAlignment(){
   // Create TClonesArray of full misalignment objects for TOF
   // 
-  TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
   TClonesArray &alobj = *array;
    
-  if(!gGeoManager) TGeoManager::Import("geometry.root"); //needed for
-  // the constructors with local coordinates not to fail
+  if(!gGeoManager) TGeoManager::Import("/home/rgrosso/Prove/AliRoot/geometry.root");
 
   AliAlignObjAngles a;
-
-  Int_t nSMTOF = 18;
+  Double_t sfdpsi=0.,sfdtheta=0.,sfdphi=0.;
   Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
   AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
-  UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+  UShort_t dvoluid = AliAlignObj::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]) AliAlignObjAngles(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++){
+    AliAlignObjAngles* smobj = (AliAlignObjAngles*)array->UncheckedAt(k);
+    if(!smobj->ApplyToGeometry()){
+      cout<<"application of object "<<k<<" failed!"<<endl;
+      return;
+    }
+  }
+  gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO.root");
+  gGeoManager=0x0;
+  TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO.root");
+
+  // TOF part !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  Int_t nSMTOF = 18;
   Int_t i;
-  Int_t j=0;
-  Double_t dx, dy, dz, dpsi, dtheta, dphi;
+  Int_t j=18;
+  Double_t tofdx, tofdy, tofdz, 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++) {
-    Char_t  path[100];
-    sprintf(path,"TOF/sm%02d",i);
-    dx = rnd->Gaus(0.,sigmatr);
-    dy = 0;
-    dz = rnd->Gaus(0.,sigmatr);
+    TString symname(Form("TOF/sm%02d",i));
+    tofdx = rnd->Gaus(0.,sigmatr);
+    tofdy = 0;
+    tofdz = rnd->Gaus(0.,sigmatr);
     dpsi = 0;
     dtheta = rnd->Gaus(0.,sigmarot);
     dphi = 0.;
-    new(alobj[j]) AliAlignObjAngles(path, volid, dx, dy, dz, dpsi, dtheta, dphi,kFALSE);
-    alobj[j]->Print();
-    j++;
+    new(alobj[j++]) AliAlignObjAngles(symname.Data(), dvoluid, tofdx, tofdy, tofdz, dpsi, dtheta, dphi, kFALSE);
+  }
+  for(Int_t k=18; k<36; k++){
+    AliAlignObjAngles* smobj = (AliAlignObjAngles*)array->UncheckedAt(k);
+    if(!smobj->ApplyToGeometry()){
+      cout<<"application of object "<<k<<" failed!"<<endl;
+      return;
+    }
+  }
+  gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_tofSM.root");
+
+
+  gGeoManager=0x0;
+  TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_tofSM.root");
+  // tof strips as in residual
+  AliAlignObj::ELayerID idTOF = AliAlignObj::kTOF;
+
+  Double_t sdx=0.; 
+  Double_t sdy=0.; 
+  Double_t sdz=0.;
+  Double_t sdpsi, sdtheta, sdphi;
+  TRandom *rnds   = new TRandom(4357);
+  sigmatr = 0.1; // max shift in cm w.r.t. local ideal RS
+
+  for(i=0; i<AliAlignObj::LayerSize(idTOF); i++) {
+    sdx = 0;
+    sdy = rnds->Gaus(0.,sigmatr);
+    sdz = rnds->Gaus(0.,sigmatr);
+    sdpsi = 0.;
+    sdtheta = 0.;
+    sdphi = 0.;
+    new(alobj[j++]) AliAlignObjAngles(AliAlignObj::SymName(idTOF,i), AliAlignObj::LayerToVolUID(idTOF,i), sdx, sdy, sdz, sdpsi, sdtheta, sdphi, kFALSE);
   }
 
   if(!gSystem->Getenv("$TOCDB")){
@@ -49,7 +171,7 @@ void MakeTOFFullMisAlignment(){
     AliCDBStorage* storage = cdb->GetStorage(Storage);
     AliCDBMetaData* md = new AliCDBMetaData();
     md->SetResponsible("Silvia Arcelli");
-    md->SetComment("Full misalignment for TOF");
+    md->SetComment("Full misalignment for TOF and FRAME");
     md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
     AliCDBId id("TOF/Align/Data",0,9999999);
     storage->Put(array,id,md);
index 5197d24208cbe83e0ab6f5c6d83f21b652a87e26..9205201f46cb9c0e39763480ebddb439ba0889c3 100644 (file)
@@ -4,7 +4,7 @@ void MakeTOFResMisAlignment(){
   TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
   TClonesArray &alobj = *array;
    
-  if(!gGeoManager) TGeoManager::Import("geometry.root");
+  if(!gGeoManager) TGeoManager::Import("/home/rgrosso/Prove/AliRoot/geometry.root");
   // needed for the constructors with local coordinates not to fail
 
   AliAlignObjAngles a;
index 05b0df51a1e22b18e4e54a3aa9155250e960d56d..c7e8fe0b204841c6786a7db02092aca13856369d 100644 (file)
@@ -1,7 +1,6 @@
 void MakeTOFZeroMisAlignment(){
-
   // Create TClonesArray of zero misalignment objects for TOF
-
+  //
   TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
   TClonesArray &alobj = *array;
    
@@ -16,22 +15,28 @@ void MakeTOFZeroMisAlignment(){
   Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
 
   for(i=0; i<AliAlignObj::LayerSize(idTOF); i++) {
-    //  cout << " TOF symname : " << AliAlignObj::SymName(idTOF,i) << endl;
-    new(alobj[j++]) AliAlignObjAngles(AliAlignObj::SymName(idTOF,i), 
-    AliAlignObj::LayerToVolUID(idTOF,i), 
-    dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+    new(alobj[j++]) AliAlignObjAngles(AliAlignObj::SymName(idTOF,i), AliAlignObj::LayerToVolUID(idTOF,i), dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
   }
 
-  // save in CDB storage
-  const char* Storage = "local://$ALICE_ROOT";
-  AliCDBManager* cdb = AliCDBManager::Instance();
-  AliCDBStorage* storage = cdb->GetStorage(Storage);
-  AliCDBMetaData* md = new AliCDBMetaData();
-  md->SetResponsible("Silvia Arcelli");
-  md->SetComment("Zero misalignment for TOF");
-  md->SetAliRootVersion("HEAD");
-  AliCDBId id("TOF/Align/Data",0,9999999);
-  storage->Put(array,id,md);
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("TOFzeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    f.cd();
+    f.WriteObject(array,"TOFAlignObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    AliCDBMetaData* md = new AliCDBMetaData();
+    md->SetResponsible("Silvia Arcelli");
+    md->SetComment("Zero misalignment for TOF");
+    md->SetAliRootVersion("HEAD");
+    AliCDBId id("TOF/Align/Data",0,9999999);
+    storage->Put(array,id,md);
+  }
 
   array->Delete();
 
index db6c149b57e5ae304e69749e742c7ad4055810b0..84a7c9a5562470e74871e444f55604c241e2d39c 100644 (file)
@@ -10,25 +10,27 @@ void MakeTPCFullMisAlignment(){
   TRandom *rnd   = new TRandom(4357);
   AliAlignObjAngles o;
   Int_t j = 0;
+  Double_t dx, dy, dz, dpsi, dtheta, dphi;
+
   // RS = local
-  // sigma translation = 1mm
-  // sigma rotation = 1mrad
+  // sigma translation = 0.1 mm
+  // sigma rotation = 0.1 mrad
   Float_t sigmatr=0.01;
-  Float_t sigmarot = 0.06;
+  Float_t sigmarot = 0.006;
+
   for (Int_t iLayer = AliAlignObj::kTPC1; iLayer <= AliAlignObj::kTPC2; iLayer++) {
     for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
 
-      Double_t dx = (rnd->Uniform()-0.5)*sigmatr;
-      Double_t dy = (rnd->Uniform()-0.5)*sigmatr;
-      Double_t dz = (rnd->Uniform()-0.5)*sigmatr;
-      Double_t dpsi = (rnd->Uniform()-0.5)*sigmarot;
-      Double_t dtheta = (rnd->Uniform()-0.5)*sigmarot;
-      Double_t dphi = (rnd->Uniform()-0.5)*sigmarot;
+      dx = (rnd->Uniform()-0.5)*sigmatr;
+      dy = (rnd->Uniform()-0.5)*sigmatr;
+      dz = (rnd->Uniform()-0.5)*sigmatr;
+      dpsi = (rnd->Uniform()-0.5)*sigmarot;
+      dtheta = (rnd->Uniform()-0.5)*sigmarot;
+      dphi = (rnd->Uniform()-0.5)*sigmarot;
 
       UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
       const char *symname = AliAlignObj::SymName(volid);
-      new(alobj[j]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
-      j++;
+      new(alobj[j++]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
     }
   }
 
index 658fb17bfa154e7f008462044714b0beeb610d52..3b1d7ffea615a73dd4f8a2fa19c4ca25b5fd0004 100644 (file)
@@ -13,10 +13,10 @@ void MakeTPCResMisAlignment(){
   Int_t j = 0;
 
   // RS = local
-  // sigma translation = 0.1mm
-  // sigma rotation = 1mrad
+  // sigma translation = 0.1 mm
+  // sigma rotation = 0.1 mrad
   Float_t sigmatr=0.01;
-  Float_t sigmarot = 0.06;
+  Float_t sigmarot = 0.006;
   for (Int_t iLayer = AliAlignObj::kTPC1; iLayer <= AliAlignObj::kTPC2; iLayer++) {
     for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
 
diff --git a/TPC/MakeTPCZeroMisAlignment.C b/TPC/MakeTPCZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..6e63c9c
--- /dev/null
@@ -0,0 +1,49 @@
+void MakeTPCZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for TPC
+  //
+  if(!gGeoManager) TGeoManager::Import("geometry.root");
+  // needed for the constructors with local coordinates not to fail
+
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
+  TClonesArray &alobj = *array;
+  
+  AliAlignObjAngles o;
+  Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
+  Int_t j = 0;
+
+  // RS = local
+  for (Int_t iLayer = AliAlignObj::kTPC1; iLayer <= AliAlignObj::kTPC2; iLayer++) {
+    for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
+
+      UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
+      const char *symname = AliAlignObj::SymName(volid);
+      new(alobj[j]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+      j++;
+    }
+  }
+
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("TPCzeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    f.cd();
+    f.WriteObject(array,"TPCAlignObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    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);
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
index 5fc6403e83d4b1772bd95db9c9dc9d2f36b67d28..0c146e1308b79096b3fac0f516b6c1899ce06fb5 100644 (file)
@@ -4,15 +4,21 @@ void MakeTRDFullMisAlignment(){
   TClonesArray *array = new TClonesArray("AliAlignObjAngles",1000);
   TClonesArray &alobj = *array;
    
-  if(!gGeoManager) TGeoManager::Import("geometry.root");
-  // needed for the constructors with local coordinates not to fail
-
   AliAlignObjAngles a;
 
+  // sigmas for the supermodules
+  Double_t smdx=0.3; // 3 mm
+  Double_t smdy=0.3; // 3 mm
+  Double_t smdz=0.3; // 3 mm
+  Double_t smrx=0.4/1000/TMath::Pi()*180; // 0.4 mrad
+  Double_t smry=2.0/1000/TMath::Pi()*180; // 2 mrad
+  Double_t smrz=0.4/1000/TMath::Pi()*180; // 0.4 mrad
+
+
   // sigmas for the chambers
-  Double_t chdx=1; // 1 cm
-  Double_t chdy=1; // 1 cm
-  Double_t chdz=1; // 1 cm
+  Double_t chdx=0.1; // 1 mm
+  Double_t chdy=0.1; // 1 mm
+  Double_t chdz=0.1; // 1 mm
   Double_t chrx=1.0/1000/TMath::Pi()*180; // 1 mrad
   Double_t chry=1.0/1000/TMath::Pi()*180; // 1 mrad
   Double_t chrz=0.7/1000/TMath::Pi()*180; // 0.7 mrad
@@ -22,14 +28,42 @@ void MakeTRDFullMisAlignment(){
   Int_t j=0;
   TRandom *ran = new TRandom(4357);
   UShort_t volid;
-  const char *path;
+  const char *symname;
+
+  TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/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));
+    ran->Rannor(dx,rx);
+    ran->Rannor(dy,ry);
+    ran->Rannor(dz,rz);
+    dx*=smdx;
+    dy*=smdy;
+    dz*=smdz;
+    rx*=smrx;
+    ry*=smry;
+    rz*=smrz;
+    new(alobj[j++]) AliAlignObjAngles(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kFALSE);
+  }
+
+  for(Int_t k=0; k<18; k++){
+    AliAlignObjAngles* smobj = (AliAlignObjAngles*)array->UncheckedAt(k);
+    if(!smobj->ApplyToGeometry()){
+      cout<<"application of object "<<k<<" failed!"<<endl;
+      return;
+    }
+  }
+  gGeoManager->Export("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_trdSM.root");
+  gGeoManager=0x0;
+  TGeoManager::Import("/home/rgrosso/MacroAllineamento010207/geom_misalBSEGMO_trdSM.root");
   // create the chambers' alignment objects
+  ran = new TRandom(4357);
   for (Int_t iLayer = AliAlignObj::kTRD1; iLayer <= AliAlignObj::kTRD6; iLayer++) {
     for (Int_t iModule = 0; iModule < AliAlignObj::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;
index 507fe5bf4c2b2b3c214157d87e88330caf1eba01..a5a38c0f3b69eceaf3fa724fd2f1bde567e67345 100644 (file)
@@ -10,9 +10,9 @@ void MakeTRDResMisAlignment(){
   AliAlignObjAngles a;
 
   // sigmas for the chambers
-  Double_t chdx=0.02; // 200 microns
-  Double_t chdy=0.03; // 300 microns
-  Double_t chdz=0.07; // 700 microns
+  Double_t chdx=0.002; // 20 microns
+  Double_t chdy=0.003; // 30 microns
+  Double_t chdz=0.007; // 70 microns
   Double_t chrx=0.3/1000/TMath::Pi()*180; // 0.3 mrad
   Double_t chry=0.3/1000/TMath::Pi()*180; // 0.3 mrad
   Double_t chrz=0.1/1000/TMath::Pi()*180; // 0.1 mrad
diff --git a/TRD/MakeTRDZeroMisAlignment.C b/TRD/MakeTRDZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..c1112e5
--- /dev/null
@@ -0,0 +1,51 @@
+void MakeTRDZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for TRD
+  //
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",1000);
+  TClonesArray &alobj = *array;
+   
+  if(!gGeoManager) TGeoManager::Import("geometry.root");
+  // needed for the constructors with local coordinates not to fail
+
+  AliAlignObjAngles a;
+
+  Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
+
+  Int_t j=0;
+  UShort_t volid;
+  const char *symname;
+
+  // create the chambers' alignment objects
+  for (Int_t iLayer = AliAlignObj::kTRD1; iLayer <= AliAlignObj::kTRD6; iLayer++) {
+    for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
+      volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
+      symname = AliAlignObj::SymName(volid);
+      new(alobj[j++]) AliAlignObjAngles(symname,volid,dx,dy,dz,rx,ry,rz,kTRUE);
+    }
+  }
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("TRDzeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    f.cd();
+    f.WriteObject(array,"TRDAlignObjs","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    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);
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
+
index cf1d6832776a26676cfbede1d1a5a50819e4fdae..d5c649faf52a7371fb0ca7ba790fd851bb22f6d2 100644 (file)
@@ -11,13 +11,13 @@ void MakeVZEROFullMisAlignment(){
 
   Double_t dx, dy, dz, dpsi, dtheta, dphi;
   TRandom *rnd   = new TRandom(4321);
-  Double_t sigmatr = 0.1; // max shift in cm w.r.t. RS
-  Double_t sigmarot = 0.5; // max rot in degrees w.r.t. RS
+  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="/ALIC_1/VZERO_1/V0RI_1";
-  const char *V0left="/ALIC_1/VZERO_1/V0LE_1";
+  const char *V0right="VZERO/V0C";
+  const char *V0left="VZERO/V0A";
 
   Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
   AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
index 672993111c0f1c76716f435e3abd1b8cb75707ca..3ffa15292ffa35ff25cc98c622618f2b77e2b829 100644 (file)
@@ -14,8 +14,8 @@ void MakeVZEROResMisAlignment(){
   Double_t sigmatr = 0.1; // max shift in cm
   Double_t sigmarot = 0.5; // max rot in degrees
 
-  const char *V0right="/ALIC_1/VZERO_1/V0RI_1";
-  const char *V0left="/ALIC_1/VZERO_1/V0LE_1";
+  const char *V0right="VZERO/V0C";
+  const char *V0left="VZERO/V0A";
 
   Int_t iIndex=0;
   AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
diff --git a/VZERO/MakeVZEROZeroMisAlignment.C b/VZERO/MakeVZEROZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..c8f537d
--- /dev/null
@@ -0,0 +1,46 @@
+void MakeVZEROZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for VZERO
+  //
+  if(!gGeoManager) TGeoManager::Import("geometry.root");
+  // needed for the constructors with local coordinates not to fail
+
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+  TClonesArray &alobj = *array;
+
+  AliAlignObjAngles a;
+
+  Double_t dx, dy, dz, dpsi, dtheta, dphi;
+
+  Int_t iIndex=0;
+  AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+  UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+  TString V0right("VZERO/V0C");
+  new(alobj[0]) AliAlignObjAngles(V0right.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
+  TString V0left("VZERO/V0A");
+  new(alobj[1]) AliAlignObjAngles(V0left.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // save on file
+    TFile f("V0zeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    f.cd();
+    f.WriteObject(array,"V0ZeroAlObjs ","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    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);
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
diff --git a/ZDC/MakeZDCZeroMisAlignment.C b/ZDC/MakeZDCZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..2e27bba
--- /dev/null
@@ -0,0 +1,48 @@
+void MakeZDCZeroMisAlignment(){
+  // Create TClonesArray of zero misalignment objects for ZDC
+  // 
+  if(!gGeoManager) TGeoManager::Import("geometry.root");
+  // needed for the constructors with local coordinates not to fail
+
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
+  TClonesArray &alobj = *array;
+
+  AliAlignObjAngles a;
+
+  Double_t dx=0., dy=0., dz=0.;
+  Double_t dpsi=0., dtheta=0., dphi=0.;
+
+  const char *ZDCn="ZDC/NeutronZDC";
+  const char *ZDCp="ZDC/ProtonZDC";
+
+  UShort_t iIndex=0;
+  AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
+  UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
+
+  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);
+
+  if(!gSystem->Getenv("$TOCDB")){
+    // save in file
+    TFile f("ZDCzeroMisalignment.root","RECREATE");
+    if(!f) cerr<<"cannot open file for output\n";
+    f.cd();
+    f.WriteObject(array,"ZDCZeroAlObjs ","kSingleKey");
+    f.Close();
+  }else{
+    // save in CDB storage
+    const char* Storage = gSystem->Getenv("$STORAGE");
+    AliCDBManager* cdb = AliCDBManager::Instance();
+    AliCDBStorage* storage = cdb->GetStorage(Storage);
+    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);
+    storage->Put(array,id,md);
+  }
+
+  array->Delete();
+
+}
+
index 35218af2bf4fdc6b43899cb336f8b88b4b58c1d8..261f801895bdc2068ac4cbdddd28273f76e2cc50 100644 (file)
@@ -25,7 +25,7 @@ void MakeAllDETsResMisAlignment(Char_t* CDBstorage = "local://$HOME/Residual"){
     TGeoManager::Import("geometry.root");
   }
 
-  TString dets="EMCAL,FMD,ITS,MUON,PHOS,PMD,HMPID,T0,TOF,TPC,TRD,VZERO,ZDC";
+  TString dets="EMCAL,FMD,HMPID,ITS,MUON,PHOS,PMD,T0,TOF,TPC,TRD,VZERO,ZDC";
   TObjArray *detArray = dets.Tokenize(',');
   TIter iter(detArray);
   TObjString *ostr;
diff --git a/macros/MakeAllDETsZeroMisAlignment.C b/macros/MakeAllDETsZeroMisAlignment.C
new file mode 100644 (file)
index 0000000..6982939
--- /dev/null
@@ -0,0 +1,43 @@
+void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/Zero"){
+  // 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 
+  //
+  TString strStorage(CDBstorage);
+  if(strStorage.IsNull()){
+    gSystem->Setenv("$TOCDB","kFALSE");
+  }else{  
+    gSystem->Setenv("$TOCDB","kTRUE");
+    gSystem->Setenv("$STORAGE",strStorage.Data());
+    gSystem->Setenv("$ARVERSION","v4-04-Release");
+  }
+
+  // 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");
+  }
+
+  TString dets="EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
+  TObjArray *detArray = dets.Tokenize(',');
+  TIter iter(detArray);
+  TObjString *ostr;
+  TString exec_det_macro;
+
+  while((ostr = (TObjString*) iter.Next())){
+    TString str(ostr->String());
+    exec_det_macro="aliroot -b -q $ALICE_ROOT/";
+    exec_det_macro+=str;
+    exec_det_macro+="/Make";
+    exec_det_macro+=str;
+    exec_det_macro+="ZeroMisAlignment.C";
+    
+    gSystem->Exec(exec_det_macro.Data());
+  }
+
+  return;
+}