Updated treatment for SDD ladder mounted with reverse orientation (M. Sitta, F. Prino)
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 13:27:58 +0000 (13:27 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 13:27:58 +0000 (13:27 +0000)
ITS/AliITStrackerMI.cxx
ITS/AliITSv11GeometrySDD.cxx
ITS/AliITSv11GeometrySDD.h
ITS/AliITSv11Hybrid.cxx

index 7419775..899c800 100644 (file)
@@ -1911,8 +1911,15 @@ FindDetectorIndex(Double_t phi, Double_t z) const {
   // this correction is OK only from AliITSv11Hybrid onwards
   if (GetR()>12. && GetR()<20.) { // SDD inner
     if(np==2) { // 3rd ladder
-      nz = (fNdetectors-1) - nz;
-    } 
+      Double_t posMod252[3];
+      AliITSgeomTGeo::GetTranslation(252,posMod252);
+      // check the Z coordinate of Mod 252: if negative 
+      // (old SDD geometry in AliITSv11Hybrid)
+      // the swap of numeration whould be applied
+      if(posMod252[2]<0.){
+       nz = (fNdetectors-1) - nz;
+      } 
+    }
   }
   //printf("ndet %d phi %f z %f  np %d nz %d\n",fNdetectors,phi,z,np,nz);
 
index 0dcc775..4047f4d 100755 (executable)
@@ -1223,6 +1223,7 @@ void AliITSv11GeometrySDD::Layer3(TGeoVolume *moth) {
 
   TGeoVolumeAssembly *lay3Ladder    = CreateLadder(3);
   TGeoVolumeAssembly *lay3Detectors = CreateDetectorsAssembly(3);
+  TGeoVolumeAssembly *lay3Ladd2Det  = CreateDetectorsAssemblyLadd2();
   //TGeoVolume *lay3Detectors = CreateDetectors(3);
   TGeoTube *virtualLayer3Shape = new TGeoTube("ITSsddLayer3Shape",
                                     fgkLay3Rmin,fgkLay3Rmax,fgkLay3Length*0.5);
@@ -1269,14 +1270,14 @@ void AliITSv11GeometrySDD::Layer3(TGeoVolume *moth) {
     if (iLadd%2 != 0) minRadiusDetBox = fgkLay3DetLongRadius;
     minRadiusDetBox += detectorsThick/2;
     TGeoCombiTrans *ctDet;
+    ctDet = CreateCombiTrans(rotName, minRadiusDetBox,
+                            0, ladderPhi, kTRUE);
+
     if (iLadd != 2)
-      ctDet = CreateCombiTrans(rotName, minRadiusDetBox,
-                              0, ladderPhi, kTRUE);
+      virtualLayer3->AddNode(lay3Detectors, iLadd, ctDet);
     else
-      ctDet = CreateCombiTrans(rotName, minRadiusDetBox,
-                              0, ladderPhi, kFALSE);
+      virtualLayer3->AddNode(lay3Ladd2Det , iLadd, ctDet);
 
-    virtualLayer3->AddNode(lay3Detectors, iLadd, ctDet);
     ///////////////////////////////////////////////////
   }
 
@@ -5290,6 +5291,49 @@ TGeoVolumeAssembly *AliITSv11GeometrySDD::CreateDetectorsAssembly(Int_t iLay) {
 
 
 //________________________________________________________________________
+TGeoVolumeAssembly *AliITSv11GeometrySDD::CreateDetectorsAssemblyLadd2() {
+//
+// return a box volume containing the detectors
+// Special case for Layer 3 Ladder 2 which is rotated (cannot simply
+// rotate the standard volume, because the module numbering would be wrong)
+// M.Sitta 25 Nov 2009
+//
+  
+  Int_t    nDetectors   = fgkLay3Ndet;
+  Double_t *sensorZPos  = fLay3sensorZPos;
+  TGeoVolume *sensorSDD = fSDDsensor3;
+
+  char name[30];
+  sprintf(name,"ITSsddDetBoxLadd2");
+  
+  TGeoVolumeAssembly  *virtualDet = new TGeoVolumeAssembly("ITSsddLadd");
+
+  for (Int_t i=0; i<nDetectors; i++) {
+    Double_t localZ = (-1.)*sensorZPos[nDetectors-1-i];
+    Double_t localY = fgkLadWaferSep/2+fgkWaferThickness/2;
+    if (i%2==0) localY = -localY;
+    sprintf(name, "ITSsddLayLadd2SensorPos%i", i);
+    if (i >= nDetectors/2) {
+      TGeoTranslation *sensorPos = new TGeoTranslation(0,localY,localZ);
+      sensorPos->SetName(name);
+      virtualDet->AddNode(sensorSDD, i, sensorPos);
+    }
+    else {
+      TGeoRotation *rotSensor = new TGeoRotation("",0, 180, 180);
+      TGeoCombiTrans *sensorPos = new TGeoCombiTrans(0,localY,
+                                                    localZ, rotSensor);
+      sensorPos->SetName(name);
+      virtualDet->AddNode(sensorSDD, i, sensorPos);
+    };
+  }
+  
+  if(GetDebug(1)) virtualDet->CheckOverlaps(0.01);
+  return virtualDet;
+}
+
+
+//________________________________________________________________________
 Int_t AliITSv11GeometrySDD::ExportSensorGeometry(AliITSgeom *geom, Int_t iLaySDD,
                                                 Int_t startMod) {
 //
index d982f15..a18564d 100755 (executable)
@@ -80,6 +80,7 @@ class AliITSv11GeometrySDD : public AliITSv11Geometry {
 
   virtual TGeoVolumeAssembly*  CreateLadder(Int_t iLay);
   virtual TGeoVolumeAssembly*  CreateDetectorsAssembly(Int_t iLay);
+  virtual TGeoVolumeAssembly*  CreateDetectorsAssemblyLadd2();
   virtual TGeoVolume*          CreateLadderSegment(Int_t iLay, Int_t iSeg);
   virtual TGeoVolumeAssembly*  CreateEndLadder(Int_t iLay);
   virtual TGeoVolumeAssembly*  CreateEndLadderCards(Int_t iLay);
index fe19fdb..4524629 100644 (file)
@@ -695,11 +695,7 @@ void AliITSv11Hybrid::AddAlignableVolumes() const{
          AliFatal(Form("Unable to set alignable entry 2! %s :: %s",
                    strEntryName2.Data(),sensor.Data()));
 
-       if(c1 != 2) { 
        SetT2Lmatrix(modUID, 0, kFALSE, c2>=3);
-                 } else {// for ladder 2, mounted with a pi rot around y
-         SetT2Lmatrix(modUID, 0, kFALSE, c2<3);
-         }
       }
     }