]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSsegmentationSSD.cxx
- AliITSInitGeometry.cxx (updated): fgkOldSSDcone changed from kTRUE to
[u/mrichter/AliRoot.git] / ITS / AliITSsegmentationSSD.cxx
index a6d03d6e6fb6ceb9707b9b72044b68e6a0b474f6..f935225f3e8802afda416e29b921b3908f68f0b1 100644 (file)
@@ -17,6 +17,9 @@
 
 #include <Riostream.h>
 #include <TMath.h>
+#include <TGeoManager.h>
+#include <TGeoVolume.h>
+#include <TGeoBBox.h>
 #include "AliITSsegmentationSSD.h"
 
 //////////////////////////////////////////////////////
@@ -31,7 +34,7 @@ const Float_t AliITSsegmentationSSD::fgkPitchDefault = 95.;
 const Int_t AliITSsegmentationSSD::fgkNstripsDefault = 768;
 
 ClassImp(AliITSsegmentationSSD)
-AliITSsegmentationSSD::AliITSsegmentationSSD(): AliITSsegmentation(),
+AliITSsegmentationSSD::AliITSsegmentationSSD(Option_t *opt): AliITSsegmentation(),
 fNstrips(0),
 fStereoP(0),
 fStereoN(0),
@@ -42,9 +45,29 @@ fStereoPl6(0),
 fStereoNl6(0),
 fLayer(0){
     // default constructor
+    SetDetSize(fgkDxDefault,fgkDzDefault,fgkDyDefault);
+    SetPadSize(fgkPitchDefault,0.);
+    SetNPads(fgkNstripsDefault,0);
+    SetAngles();
+  if(strstr(opt,"TGeo")){
+    if(!gGeoManager){
+      AliError("Geometry is not initialized\n");
+      return;
+    }
+    TGeoVolume *v=NULL;
+    v = gGeoManager->GetVolume("ITSssdSensitivL5");
+    if(!v){
+      AliWarning("TGeo volumeITSssdSensitivL5  not found (hint: use v11Hybrid geometry)\n Using hardwired default values"); 
+    }
+    else {
+      TGeoBBox *s=(TGeoBBox*)v->GetShape();
+      SetDetSize(s->GetDX()*20000.,s->GetDZ()*20000.,s->GetDY()*20000.);
+    }
+  }
 }
 //----------------------------------------------------------------------
 AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSgeom *geom):
+AliITSsegmentation(geom),
 fNstrips(0),
 fStereoP(0),
 fStereoN(0),
@@ -55,15 +78,11 @@ fStereoPl6(0),
 fStereoNl6(0),
 fLayer(0){
     // constuctor
-    fGeom = geom;
-    fCorr = 0;
     SetDetSize(fgkDxDefault,fgkDzDefault,fgkDyDefault);
     SetPadSize(fgkPitchDefault,0.);
     SetNPads(fgkNstripsDefault,0);
     SetAngles();
-    fLayer = 0;
 }
-
 //______________________________________________________________________
 void AliITSsegmentationSSD::Copy(TObject &obj) const {
   // protected method. copy this to obj
@@ -131,7 +150,7 @@ void AliITSsegmentationSSD::SetLayer(Int_t l){
   //set fLayer data member (only 5 or 6 are allowed)
     if (l==5) fLayer =5;
     if (l==6) fLayer =6;
-    if((l!=5) && (l!=6))Error("SetLayer","Layer can be 5 or 6, not %d",l);
+    if((l!=5) && (l!=6))AliError(Form("Layer can be 5 or 6, not %d",l));
 }
 //----------------------------------------------------------------------
 void AliITSsegmentationSSD::GetPadTxz(Float_t &x,Float_t &z) const{