]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/MakePHOSResMisAlignment.C
- Changed module names to be the same as the libraries names;
[u/mrichter/AliRoot.git] / PHOS / MakePHOSResMisAlignment.C
index f63b859fc91e601848b610eed5fcf44e1da4bbbf..16ecbdf24e8599e53ccac50205d6b9391ea16702 100644 (file)
@@ -1,14 +1,19 @@
 void MakePHOSResMisAlignment(){
   // Create TClonesArray of residual misalignment objects for PHOS
   //
-  TClonesArray *array = new TClonesArray("AliAlignObjAngles",11);
+  const AliPHOSGeometry *phosGeom = AliPHOSGeometry::GetInstance("IHEP", "IHEP");
+  if (!phosGeom) {
+    Error("MakePHOSFullMisAlignment", "Cannot obtain AliPHOSGeometry singleton\n");
+    return;
+  }
+
+  AliPHOSEMCAGeometry *emca = phosGeom->GetEMCAGeometry();
+  TClonesArray *array = new TClonesArray("AliAlignObjAngles", 16 + phosGeom->GetNModules() * 
+                                         emca->GetNStripX() * emca->GetNStripZ());
   TClonesArray &alobj = *array;
    
-  AliAlignObjAngles a;
-
   Double_t dpsi=0., dtheta=0., dphi=0.;
   Double_t displacement = 0.2;
-
   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);
@@ -56,8 +61,10 @@ void MakePHOSResMisAlignment(){
   new(alobj[i++]) AliAlignObjAngles("PHOS/Wheel3",
        volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
 
+  AliPHOSSurvey geodesicData("phos_mod3_survey.txt");
+  geodesicData.CreateAliAlignObjAngles(alobj);
 
-  if(!gSystem->Getenv("$TOCDB")){
+  if(!gSystem->Getenv("TOCDB")){
     // save on file
     TFile f("PHOSresidualMisalignment.root","RECREATE");
     if(!f) cerr<<"cannot open file for output\n";
@@ -66,13 +73,13 @@ void MakePHOSResMisAlignment(){
     f.Close();
   }else{
     // save in CDB storage
-    const char* Storage = gSystem->Getenv("$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("Alignment objects for slightly misaligned geometry (residual misalignment");
-    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+    md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
     AliCDBId id("PHOS/Align/Data",0,9999999);
     storage->Put(array,id, md);
   }