#include <Riostream.h>
#include <TMath.h>
+#include <TGeoManager.h>
+#include <TGeoVolume.h>
+#include <TGeoBBox.h>
#include "AliITSsegmentationSSD.h"
//////////////////////////////////////////////////////
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
}
//______________________________________________________________________
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);
}
//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{
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..
// 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,