/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id$ */ //////////////////////////////////////////////////////////////////////// // 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(){ // 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){ // Standard Constructor. Set everthing to null. fShapeSPD = 0; fNbinx = 0; fNbinz = 0; fLowBinEdgeX = 0; fLowBinEdgeZ = 0; ReSetBins(dy,nx,bx,nz,bz); return; } //______________________________________________________________________ void AliITSgeomSPD::ReSetBins(Float_t dy,Int_t nx,Float_t *bx, Int_t nz,Float_t *bz){ // delets the contents of this and replaces it with the given values. Int_t i; Float_t dx = 0.0, dz = 0.0; // Compute size in x and z (based on bins). for(i=0;ifLowBinEdgeX) delete[] this->fLowBinEdgeX; // delete existing if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ; // delete existing SetNbinX(nx); SetNbinZ(nz); InitLowBinEdgeX(); InitLowBinEdgeZ(); fLowBinEdgeX[0] = -dx; 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; } //______________________________________________________________________ AliITSgeomSPD::~AliITSgeomSPD(){ // Destructor delete fShapeSPD; if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX; if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ; fShapeSPD = 0; fNbinx = 0; fNbinz = 0; fLowBinEdgeX = 0; fLowBinEdgeZ = 0; } //______________________________________________________________________ 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. Int_t i; if(xl=0||row=0||col 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" << " "; *os << setprecision(16) << GetDx() << " "; *os << setprecision(16) << GetDy() << " "; *os << setprecision(16) << GetDz() << " "; *os << fNbinx-1 << " " << fNbinz-1 << " "; for(i=0;iflags(fmt); return; } //______________________________________________________________________ void AliITSgeomSPD::Read(istream *is){ // Standard input format for this class Int_t i,j; Float_t dx,dy,dz; char shape[20]; for(i=0;i<20;i++) shape[i]='\0'; *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); *is >> i >> j; SetNbinX(i); SetNbinZ(j); InitLowBinEdgeX(); InitLowBinEdgeZ(); for(i=0;i> fLowBinEdgeX[i]; for(i=0;i> fLowBinEdgeZ[i]; return; } //---------------------------------------------------------------------- ostream &operator<<(ostream &os,AliITSgeomSPD &p){ //////////////////////////////////////////////////////////////////////// // Standard output streaming function. //////////////////////////////////////////////////////////////////////// p.Print(&os); return os; } //---------------------------------------------------------------------- istream &operator>>(istream &is,AliITSgeomSPD &r){ //////////////////////////////////////////////////////////////////////// // Standard input streaming function. //////////////////////////////////////////////////////////////////////// r.Read(&is); return is; } //===================================================================== ClassImp(AliITSgeomSPD300) AliITSgeomSPD300::AliITSgeomSPD300() : AliITSgeomSPD(){ //////////////////////////////////////////////////////////////////////// // default constructor, for ITS TDR geometry. This only consists of // a default constructor to construct the defalut TDR SPD detector geometry // 256 X 279 300 by 50 micron pixels. //////////////////////////////////////////////////////////////////////// const Float_t kdx=0.6400,kdy=0.0075,kdz=4.1900; // 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.0300; // cm; Standard pixel size in z direction. const Float_t kbinz1 = 0.0350; // cm; Edge pixel size in z direction. 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. for(i=0;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","SPD SI DET",dx,kdy,dz); // cout << "AliITSgeomSPD300 default creator called: end" << endl; } //---------------------------------------------------------------------- ostream &operator<<(ostream &os,AliITSgeomSPD300 &p){ //////////////////////////////////////////////////////////////////////// // Standard output streaming function. //////////////////////////////////////////////////////////////////////// p.Print(&os); return os; } //---------------------------------------------------------------------- istream &operator>>(istream &is,AliITSgeomSPD300 &r){ //////////////////////////////////////////////////////////////////////// // Standard input streaming function. //////////////////////////////////////////////////////////////////////// r.Read(&is); return is; } //===================================================================== ClassImp(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.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 = 160; // number of pixels along z direction. Int_t i; Float_t dx,dz,*binSizeX,*binSizeZ; SetNbinX(knbinx); // default number of bins in x. SetNbinZ(knbinz); // default number of bins in z. binSizeX = new Float_t[knbinx]; // array of bin sizes along x. 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. SetLowBinEdgeX(0,-dx); SetLowBinEdgeZ(0,-dz); for(i=0;i>(istream &is,AliITSgeomSPD425Short &r){ //////////////////////////////////////////////////////////////////////// // Standard input streaming function. //////////////////////////////////////////////////////////////////////// r.Read(&is); return is; } //====================================================================== ClassImp(AliITSgeomSPD425Long) AliITSgeomSPD425Long::AliITSgeomSPD425Long(){ //////////////////////////////////////////////////////////////////////// // 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). //////////////////////////////////////////////////////////////////////// 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 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 = 192; // number of pixels along z direction. Int_t i; Float_t dx,dz,*binSizeX,*binSizeZ; SetNbinX(knbinx); // default number of bins in x. SetNbinZ(knbinz); // default number of bins in z. binSizeX = new Float_t[knbinx]; // array of bin sizes along x. 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. SetLowBinEdgeX(0,-dx); SetLowBinEdgeZ(0,-dz); for(i=0;i>(istream &is,AliITSgeomSPD425Long &r){ //////////////////////////////////////////////////////////////////////// // Standard input streaming function. //////////////////////////////////////////////////////////////////////// r.Read(&is); return is; } //======================================================================