]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/MakeTRDResMisAlignment.C
revert changes done for adding ITS seeding to TRD to rev. 55962
[u/mrichter/AliRoot.git] / TRD / MakeTRDResMisAlignment.C
index 09a5df5735ba536f3de11c8cef4663601156cd37..830407f7c38e254660200de2575f1d4cab883498 100644 (file)
@@ -7,7 +7,7 @@ void MakeTRDResMisAlignment(){
    
   // Activate CDB storage and load geometry from CDB
   AliCDBManager* cdb = AliCDBManager::Instance();
-  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   cdb->SetRun(0);
   
   AliCDBStorage* storage;
@@ -29,30 +29,34 @@ void MakeTRDResMisAlignment(){
     entry->SetOwner(0);
     TGeoManager* geom = (TGeoManager*) entry->GetObject();
     AliGeomManager::SetGeometry(geom);
-  }else{
+  }
+  else {
     AliGeomManager::LoadGeometry(); //load geom from default CDB storage
   }    
 
   // sigmas for the chambers
-  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
+  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.0005 / 1000.0 / TMath::Pi()*180; // 0 mrad
+  Double_t chry    = 0.0005 / 1000.0 / TMath::Pi()*180; // 0 mrad
+  Double_t chrz    = 0.1    / 1000.0 / TMath::Pi()*180; // 0.1 mrad
+  // Truncation for the chambers
+  Double_t cutChdx = 3.0  * chdx;
+  Double_t cutChdy = 3.0  * chdy;
+  Double_t cutChdz = 0.14 * chdz;
 
-  Int_t sActive[18]={0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,1,0,0};
+  Int_t sActive[18]={1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1};
   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* symname; 
 
   // create the supermodules' alignment objects
   for (Int_t iSect=0; iSect<18; iSect++) {
     TString sm_symname(Form("TRD/sm%02d",iSect));
-    if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
+    if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
     new((*array)[j++])
       AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kTRUE);
   }
@@ -63,26 +67,23 @@ void MakeTRDResMisAlignment(){
     chId=-1;
     for (Int_t iSect = 0; iSect < 18; iSect++){
       for (Int_t iCh = 0; iCh < 5; iCh++) {
-      ran->Rannor(dx,rx);
-      ran->Rannor(dy,ry);
-      ran->Rannor(dz,rz);
-      dx*=chdx;
-      dy*=chdy;
-      dz*=chdz;
-      rx*=chrx;
-      ry*=chry;
-      rz*=chrz;
-      chId++;
-      if ((iSect==13 || iSect==14 || iSect==15) && iCh==2) continue;
-      volid = AliGeomManager::LayerToVolUID(iLayer,chId);
-      symname = AliGeomManager::SymName(volid);
-      if( (TString(gSystem->Getenv("PARTGEOM")) == TString("kTRUE")) && !sActive[iSect] ) continue;
-      new(alobj[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
+        dx = AliMathBase::TruncatedGaus(0.0,chdx,cutChdx); 
+        dy = AliMathBase::TruncatedGaus(0.0,chdy,cutChdy); 
+        dz = AliMathBase::TruncatedGaus(0.0,chdz,cutChdz); 
+        rx = gRandom->Rndm() * 2.0*chrx - chrx;
+        ry = gRandom->Rndm() * 2.0*chry - chry;
+        rz = gRandom->Rndm() * 2.0*chrz - chrz;
+        chId++;
+        if ((iSect==13 || iSect==14 || iSect==15) && iCh==2) continue;
+        volid = AliGeomManager::LayerToVolUID(iLayer,chId);
+        if( (TString(gSystem->Getenv("REALSETUP")) == TString("kTRUE")) && !sActive[iSect] ) continue;
+        symname = AliGeomManager::SymName(volid);
+        new(alobj[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kFALSE);
+      }
     }
   }
-  }
 
-  if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
+  if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
     // save on file
     const char* filename = "TRDresidualMisalignment.root";
     TFile f(filename,"RECREATE");
@@ -94,7 +95,8 @@ void MakeTRDResMisAlignment(){
     f.cd();
     f.WriteObject(array,"TRDAlignObjs","kSingleKey");
     f.Close();
-  }else{
+  }
+  else {
     // save in CDB storage
     AliCDBMetaData* md = new AliCDBMetaData();
     md->SetResponsible("Dariusz Miskowiec");