]> 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 679d3ee087bfa9671cfc386760323f9a3a691996..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,21 +34,55 @@ 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),
+fPitch(0),
+fStereoPl5(0),
+fStereoNl5(0),
+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){
+AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSgeom *geom):
+AliITSsegmentation(geom),
+fNstrips(0),
+fStereoP(0),
+fStereoN(0),
+fPitch(0),
+fStereoPl5(0),
+fStereoNl5(0),
+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
@@ -75,7 +112,16 @@ AliITSsegmentationSSD& AliITSsegmentationSSD::operator=(
 }
 //______________________________________________________________________
 AliITSsegmentationSSD::AliITSsegmentationSSD(const AliITSsegmentationSSD &source):
-    AliITSsegmentation(source){
+    AliITSsegmentation(source),
+fNstrips(0),
+fStereoP(0),
+fStereoN(0),
+fPitch(0),
+fStereoPl5(0),
+fStereoNl5(0),
+fStereoPl6(0),
+fStereoNl6(0),
+fLayer(0){
     // copy constructor
   source.Copy(*this);
 }
@@ -104,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{
@@ -212,7 +258,7 @@ void AliITSsegmentationSSD::GetPadCxz(Int_t iP,Int_t iN,Float_t &x,Float_t &z) c
     return;   
 }
 //______________________________________________________________________
-void AliITSsegmentationSSD::LocalToDet(Float_t x,Float_t z,
+Bool_t AliITSsegmentationSSD::LocalToDet(Float_t x,Float_t z,
                                       Int_t &iP,Int_t &iN) const {
     // Transformation from Geant cm detector center local coordinates
     // to detector P and N side strip numbers..
@@ -247,7 +293,7 @@ void AliITSsegmentationSSD::LocalToDet(Float_t x,Float_t z,
     // Now for N side)
     iN = (Int_t) z;
     if(iN<0 || iN>=fNstrips) iN=-1; // strip number must be in range.
-    return;
+    return kTRUE;
 }
 //----------------------------------------------------------------------
 void AliITSsegmentationSSD::DetToLocal(Int_t ix,Int_t iPN,