]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSsegmentationSPD.cxx
Added option TGeo in the constructor in order to initialize some parameters directly...
[u/mrichter/AliRoot.git] / ITS / AliITSsegmentationSPD.cxx
index 2a92057c636693256a6930d004ed9edd38685ca6..2956ffef1f9d70b261c6b0fe688b8f5549eaaa5b 100644 (file)
@@ -13,6 +13,9 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+#include <TGeoManager.h>
+#include <TGeoVolume.h>
+#include <TGeoBBox.h>
 #include "AliITSsegmentationSPD.h"
 //#include "AliITSgeom.h"
 //////////////////////////////////////////////////////
@@ -23,7 +26,7 @@
 ClassImp(AliITSsegmentationSPD)
 
 //_____________________________________________________________________________
-  AliITSsegmentationSPD::AliITSsegmentationSPD(): AliITSsegmentation(),
+  AliITSsegmentationSPD::AliITSsegmentationSPD(Option_t *opt): AliITSsegmentation(),
 fNpx(0),
 fNpz(0){
   // Default constructor
@@ -31,6 +34,35 @@ fNpz(0){
     fCellSizeX[k] = 0.;
     fCellSizeZ[k] = 0.;
   }
+
+  if(strstr(opt,"TGeo")){
+    if(!gGeoManager){
+      AliError("Geometry is not initialized\n");
+      return;
+    }
+    TGeoVolume *v=NULL;
+    v = gGeoManager->GetVolume("ITSSPDlay1-sensor");
+    if(!v){
+      AliWarning("TGeo volume ITSSPDlay1-sensor not found (hint: use v11Hybrid geometry)\n Using hardwired default values");
+      SetDetSize(12800,69600,200); 
+    }
+    else {
+      TGeoBBox *s=(TGeoBBox*)v->GetShape();
+      SetDetSize(s->GetDX()*20000.,s->GetDZ()*20000.,s->GetDY()*20000.);
+    }
+    Float_t bx[256],bz[280];
+    Int_t i;
+    SetNPads(256,160);  // Number of Bins in x and z
+    for(i=000;i<256;i++) bx[i] =  50.0; // in x all are 50 microns.
+    for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
+    for(i=160;i<280;i++) bz[i] =   0.0; // Outside of detector.
+    bz[ 31] = bz[ 32] = 625.0; // first chip boundry
+    bz[ 63] = bz[ 64] = 625.0; // first chip boundry
+    bz[ 95] = bz[ 96] = 625.0; // first chip boundry
+    bz[127] = bz[128] = 625.0; // first chip boundry
+    bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
+    SetBinSize(bx,bz); // Based on AliITSgeomSPD for now.
+  }
 }
 
 //_____________________________________________________________________________