From a5e51e90106b2779e3b23ffac0a00dd041812e3f Mon Sep 17 00:00:00 2001 From: masera Date: Thu, 6 Mar 2008 13:41:06 +0000 Subject: [PATCH] Method Init updated. Default initialization provided --- ITS/AliITSsegmentationSPD.cxx | 78 +++++++++++++++-------------------- 1 file changed, 34 insertions(+), 44 deletions(-) diff --git a/ITS/AliITSsegmentationSPD.cxx b/ITS/AliITSsegmentationSPD.cxx index 2956ffef1f9..626551ed1f6 100644 --- a/ITS/AliITSsegmentationSPD.cxx +++ b/ITS/AliITSsegmentationSPD.cxx @@ -13,6 +13,7 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ +/* $Id:$ */ #include #include #include @@ -30,41 +31,38 @@ ClassImp(AliITSsegmentationSPD) fNpx(0), fNpz(0){ // Default constructor - for(Int_t k=0; k<256; k++){ - fCellSizeX[k] = 0.; - fCellSizeZ[k] = 0.; - } + // Initialization to default values + Init(); + + // Initialization of detector dimensions from TGeo if(strstr(opt,"TGeo")){ if(!gGeoManager){ - AliError("Geometry is not initialized\n"); + AliError("Geometry is not initialized\n Using hardwired default values"); 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. } } +//______________________________________________________________________ +AliITSsegmentationSPD::AliITSsegmentationSPD(AliITSgeom *gm): +AliITSsegmentation(gm), +fNpx(0), +fNpz(0){ + // Constructor + fCorr=0; + Init(); +} + //_____________________________________________________________________________ Float_t AliITSsegmentationSPD::ColFromZ300(Float_t z) const { // Get column number for each z-coordinate taking into account the @@ -219,15 +217,7 @@ Float_t AliITSsegmentationSPD::ZpitchFromCol(Int_t col) const { } return pitchz; } -//______________________________________________________________________ -AliITSsegmentationSPD::AliITSsegmentationSPD(AliITSgeom *gm): -AliITSsegmentation(gm), -fNpx(0), -fNpz(0){ - // Constructor - fCorr=0; - Init(); -} + //______________________________________________________________________ void AliITSsegmentationSPD::Copy(TObject &obj) const { // protected method. copy this to obj @@ -289,24 +279,24 @@ void AliITSsegmentationSPD::Init300(){ //------------------------------ void AliITSsegmentationSPD::Init(){ -// Initialize infromation for 6 read out chip 425X50 micron pixel SPD -// detectors. This chip is 150 microns thick by 1.28 cm in x by 8.375 cm -// long. It has 256 50 micron pixels in x and 197 mostly 425 micron size -// pixels in z. The two pixels between each readout chip are 625 microns long. + // Initialize infromation for 6 read out chip 425X50 micron pixel SPD + // detectors. This chip is 150 microns thick by 1.28 cm in x by 8.375 cm + // long. It has 256 50 micron pixels in x and 197 mostly 425 micron size + // pixels in z. The two pixels between each readout chip are 625 microns long. - //const Float_t kconv=10000.; - Int_t i; - fNpx = 256; // The number of X pixel Cell same as in fCellSizeX array size - fNpz = 192; // The number of Z pixel Cell same as in fCellSizeZ array size - for(i=0;i