X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSgeomSPD.cxx;h=f96f3926c7b77271dccb87e85be0ca63b688d983;hb=915c0469c2edef828173f083341bc7bf2d47ba01;hp=c2db4c536904ade3410227fd721ee69bd05132f3;hpb=8253cd9a5d0623cc12e3988805226c336ee99c0f;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSgeomSPD.cxx b/ITS/AliITSgeomSPD.cxx index c2db4c53690..f96f3926c7b 100644 --- a/ITS/AliITSgeomSPD.cxx +++ b/ITS/AliITSgeomSPD.cxx @@ -13,37 +13,53 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -*/ +/* $Id$ */ -#include -#include +//////////////////////////////////////////////////////////////////////// +// This class is for the Silicon Pixel Detector, SPD, specific geometry. +// It is being replaced by AliITSsegmentationSPD class. This file also +// constains classes derived from AliITSgeomSPD which do nothing but +// initilize this one with predefined values. +//////////////////////////////////////////////////////////////////////// + +#include #include +#include #include "AliITSgeomSPD.h" ClassImp(AliITSgeomSPD) -AliITSgeomSPD::AliITSgeomSPD(){ +AliITSgeomSPD::AliITSgeomSPD(): +TObject(), +fName(), +fTitle(), +fMat(), +fDx(0.0), +fDy(0.0), +fDz(0.0), +fNbinx(0), +fNbinz(0), +fLowBinEdgeX(0), +fLowBinEdgeZ(0){ // Default Constructor. Set everthing to null. - - fShapeSPD = 0; - fNbinx = 0; - fNbinz = 0; - fLowBinEdgeX = 0; - fLowBinEdgeZ = 0; } //______________________________________________________________________ AliITSgeomSPD::AliITSgeomSPD(Float_t dy,Int_t nx,Float_t *bx, - Int_t nz,Float_t *bz){ + Int_t nz,Float_t *bz): +TObject(), +fName(), +fTitle(), +fMat(), +fDx(0.0), +fDy(0.0), +fDz(0.0), +fNbinx(0), +fNbinz(0), +fLowBinEdgeX(0), +fLowBinEdgeZ(0){ // Standard Constructor. Set everthing to null. - fShapeSPD = 0; - fNbinx = 0; - fNbinz = 0; - fLowBinEdgeX = 0; - fLowBinEdgeZ = 0; ReSetBins(dy,nx,bx,nz,bz); return; } @@ -60,9 +76,10 @@ void AliITSgeomSPD::ReSetBins(Float_t dy,Int_t nx,Float_t *bx, dx *= 0.5; dz *= 0.5; - delete fShapeSPD; // delete existing shape - if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX; // delete existing - if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ; // delete existing + if(fLowBinEdgeX) delete[] fLowBinEdgeX; // delete existing + if(fLowBinEdgeZ) delete[] fLowBinEdgeZ; // delete existing + fLowBinEdgeX = 0; + fLowBinEdgeZ = 0; SetNbinX(nx); SetNbinZ(nz); @@ -72,47 +89,72 @@ void AliITSgeomSPD::ReSetBins(Float_t dy,Int_t nx,Float_t *bx, fLowBinEdgeZ[0] = -dz; for(i=0;ifShapeSPD = new TBRIK(*(source.fShapeSPD)); - if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX; - if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ; - this->fNbinx = source.fNbinx; - this->fNbinz = source.fNbinz; - this->InitLowBinEdgeX(); - this->InitLowBinEdgeZ(); - for(i=0;ifLowBinEdgeX[i] = source.fLowBinEdgeX[i]; - for(i=0;ifLowBinEdgeZ[i] = source.fLowBinEdgeZ[i]; - return *this; + this->~AliITSgeomSPD(); + new(this) AliITSgeomSPD(source); + return *this; } //______________________________________________________________________ AliITSgeomSPD::~AliITSgeomSPD(){ // Destructor - delete fShapeSPD; - if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX; - if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ; - fShapeSPD = 0; + if(fLowBinEdgeX) delete[] fLowBinEdgeX; + if(fLowBinEdgeZ) delete[] fLowBinEdgeZ; fNbinx = 0; fNbinz = 0; fLowBinEdgeX = 0; fLowBinEdgeZ = 0; } //______________________________________________________________________ +void AliITSgeomSPD::SetShape(const char *name,const char *title, + const char * /*mat*/,Float_t dx,Float_t dy,Float_t dz){ + // Delete any existing shape info and replace it with a new + // shape information. + // Inputs: + // char * name Name of the shape + // char * title Title of the shape + // char * mat Material name for the shape + // Float_t dx half width of the shape [cm] + // Float_t dy half thickness of the shape [cm] + // Float_t dz half length of the shape [cm] + // Outputs: + // none. + // Return: + // none. + + fName = name; + fTitle = title; + fDx = dx; + fDy = dy; + fDz = dz; + return; +} +//______________________________________________________________________ void AliITSgeomSPD::LToDet(Float_t xl,Float_t zl,Int_t &row,Int_t &col){ // Returns the row and column pixel numbers for a given local coordinate // system. If they are outside then it will return -1 or fNbinx/z. @@ -143,10 +185,22 @@ void AliITSgeomSPD::DetToL(Int_t row,Int_t col,Float_t &xl,Float_t &zl){ return; } //______________________________________________________________________ -void AliITSgeomSPD::Print(ostream *os){ +void AliITSgeomSPD::Print(ostream *os) const { // Standard output format for this class Int_t i; +#if defined __GNUC__ +#if __GNUC__ > 2 + ios::fmtflags fmt; +#else + Int_t fmt; +#endif +#else +#if defined __ICC || defined __ECC || defined __xlC__ ios::fmtflags fmt; +#else + Int_t fmt; +#endif +#endif fmt = os->setf(ios::scientific); // set scientific floating point output *os << "TBRIK" << " "; @@ -155,7 +209,7 @@ void AliITSgeomSPD::Print(ostream *os){ *os << setprecision(16) << GetDz() << " "; *os << fNbinx-1 << " " << fNbinz-1 << " "; for(i=0;iflags(fmt); return; @@ -171,8 +225,7 @@ void AliITSgeomSPD::Read(istream *is){ *is >> shape; if(strcmp(shape,"TBRIK")) Warning("::Read","Shape not a TBRIK"); *is >> dx >> dy >> dz; - if(fShapeSPD!=0) delete fShapeSPD; - SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,dy,dz); + SetShape("ActiveSPD","Active volume of SPD","",dx,dy,dz); *is >> i >> j; SetNbinX(i); SetNbinZ(j); @@ -202,27 +255,6 @@ istream &operator>>(istream &is,AliITSgeomSPD &r){ } //===================================================================== -/* -$Log$ -Revision 1.7 2000/10/02 16:32:35 barbera -Forward declaration added - -Revision 1.1.2.8 2000/10/02 15:52:05 barbera -Forward declaration added - -Revision 1.6 2000/07/10 16:07:18 fca -Release version of ITS code - -Revision 1.4 2000/06/10 20:34:37 nilsen -Fixed compilation warning with HP unix. - -Revision 1.3 2000/06/10 10:43:04 nilsen -Fixed bug in copy and operator =. - -*/ - -//#include "AliITSgeomSPD300.h" - ClassImp(AliITSgeomSPD300) AliITSgeomSPD300::AliITSgeomSPD300() : AliITSgeomSPD(){ @@ -243,8 +275,6 @@ const Int_t knbinz = 279; // number of pixels along z direction. Int_t i; Float_t dx=0.0,dz=0.0; -// cout << "AliITSgeomSPD300 default creator called: start" << endl; - SetNbinX(knbinx); // default number of bins in x. SetNbinZ(knbinz); // default number of bins in z. @@ -262,10 +292,9 @@ const Int_t knbinz = 279; // number of pixels along z direction. for(i=1;i1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) + Warning("Default Creator","Detector size may not be write."); + SetShape("ActiveSPD","Active volume of SPD","",dx,kdy,dz); } //---------------------------------------------------------------------- ostream &operator<<(ostream &os,AliITSgeomSPD300 &p){ @@ -286,48 +315,37 @@ istream &operator>>(istream &is,AliITSgeomSPD300 &r){ return is; } //===================================================================== -/* -$Log$ -Revision 1.7 2000/10/02 16:32:35 barbera -Forward declaration added - -Revision 1.1.2.8 2000/10/02 15:52:05 barbera -Forward declaration added - -Revision 1.6 2000/07/10 16:07:18 fca -Release version of ITS code - -Revision 1.4 2000/06/10 20:34:22 nilsen -Fixed compilation warning with HP unix. - -Revision 1.3 2000/06/10 10:42:49 nilsen -Fixed bug in copy and operator =. - - -*/ - -//#include "AliITSgeomSPD425Short.h" ClassImp(AliITSgeomSPD425Short) -AliITSgeomSPD425Short::AliITSgeomSPD425Short(){ +AliITSgeomSPD425Short::AliITSgeomSPD425Short() : AliITSgeomSPD(){ //////////////////////////////////////////////////////////////////////// // default constructor, for ITS post TDR geometry. This only consists of // a default constructor to construct the defalut post TDR SPD detector // geometry 256 X 197 425 by 50 micron pixels with interleaved 625 by 50 // micron pixels (large detector). +//////////////////////////////////////////////////////////////////////// +} +//---------------------------------------------------------------------- +AliITSgeomSPD425Short::AliITSgeomSPD425Short(Int_t npar,Float_t *par) : + AliITSgeomSPD(){ +//////////////////////////////////////////////////////////////////////// +// Standard constructor, for ITS post TDR geometry. This only consists of +// a default constructor to construct the defalut post TDR SPD detector +// geometry 256 X 197 425 by 50 micron pixels with interleaved 625 by 50 +// micron pixels (large detector). //////////////////////////////////////////////////////////////////////// - const Float_t kdx=0.6400,kdy=0.0075,kdz=4.2650; // cm; Standard pixel - // detector size is 2dx - // wide, 2dz long, and - // 2dy thick. Geant 3.12 - // units. + const Float_t kdx=0.6400/*,kdy=0.015*/,kdz=3.480; // cm; Standard pixel + // detector size is 2dx + // wide, 2dz long, and + // 2dy thick. Geant 3.12 + // units. const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction. const Int_t knbinx = 256; // number of pixels along x direction. const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction. const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction. - const Int_t knbinz = 163; // number of pixels along z direction. + const Int_t knbinz = 160; // number of pixels along z direction. Int_t i; Float_t dx,dz,*binSizeX,*binSizeZ; @@ -341,14 +359,14 @@ AliITSgeomSPD425Short::AliITSgeomSPD425Short(){ binSizeZ[ 31] = kbinz1; binSizeZ[ 32] = kbinz1; + binSizeZ[ 63] = kbinz1; binSizeZ[ 64] = kbinz1; - binSizeZ[ 65] = kbinz1; - binSizeZ[ 97] = kbinz1; - binSizeZ[ 98] = kbinz1; + binSizeZ[ 95] = kbinz1; + binSizeZ[ 96] = kbinz1; - binSizeZ[130] = kbinz1; - binSizeZ[131] = kbinz1; + binSizeZ[127] = kbinz1; + binSizeZ[128] = kbinz1; // correct detector size for bin size. dx = 0.0; @@ -358,9 +376,15 @@ AliITSgeomSPD425Short::AliITSgeomSPD425Short(){ for(i=0;i1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) + Warning("Default Creator","Detector size may not be write."); InitLowBinEdgeX(); // array of bin sizes along x. InitLowBinEdgeZ(); // array of bin sizes along x. @@ -389,28 +413,6 @@ istream &operator>>(istream &is,AliITSgeomSPD425Short &r){ } //====================================================================== -/* -$Log$ -Revision 1.7 2000/10/02 16:32:35 barbera -Forward declaration added - -Revision 1.1.2.8 2000/10/02 15:52:05 barbera -Forward declaration added - -Revision 1.6 2000/07/10 16:07:18 fca -Release version of ITS code - -Revision 1.4 2000/06/10 20:34:22 nilsen -Fixed compilation warning with HP unix. - -Revision 1.3 2000/06/10 10:42:49 nilsen -Fixed bug in copy and operator =. - - -*/ - -//#include "AliITSgeomSPD425Long.h" - ClassImp(AliITSgeomSPD425Long) AliITSgeomSPD425Long::AliITSgeomSPD425Long(){ @@ -430,7 +432,7 @@ AliITSgeomSPD425Long::AliITSgeomSPD425Long(){ const Int_t knbinx = 256; // number of pixels along x direction. const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction. const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction. - const Int_t knbinz = 196; // number of pixels along z direction. + const Int_t knbinz = 192; // number of pixels along z direction. Int_t i; Float_t dx,dz,*binSizeX,*binSizeZ; @@ -444,17 +446,17 @@ AliITSgeomSPD425Long::AliITSgeomSPD425Long(){ binSizeZ[ 31] = kbinz1; binSizeZ[ 32] = kbinz1; + binSizeZ[ 63] = kbinz1; binSizeZ[ 64] = kbinz1; - binSizeZ[ 65] = kbinz1; - binSizeZ[ 97] = kbinz1; - binSizeZ[ 98] = kbinz1; + binSizeZ[ 95] = kbinz1; + binSizeZ[ 96] = kbinz1; - binSizeZ[130] = kbinz1; - binSizeZ[131] = kbinz1; + binSizeZ[127] = kbinz1; + binSizeZ[128] = kbinz1; - binSizeZ[163] = kbinz1; - binSizeZ[164] = kbinz1; + binSizeZ[159] = kbinz1; + binSizeZ[160] = kbinz1; // correct detector size for bin size. dx = 0.0; @@ -464,9 +466,9 @@ AliITSgeomSPD425Long::AliITSgeomSPD425Long(){ for(i=0;i1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) + Warning("Default Creator","Detector size may not be write."); InitLowBinEdgeX(); // array of bin sizes along x. InitLowBinEdgeZ(); // array of bin sizes along x.