+ 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;i<knbinx;i++) dx += kbinx0; // Compute size x.
+ dx *= 0.5;
+ for(i=0;i<knbinz;i++) dz += kbinz0; // Compute size z.
+ dz += 2.0*(kbinz1-kbinz0);
+ dz *= 0.5;
+ InitLowBinEdgeX();
+ InitLowBinEdgeZ();
+ SetLowBinEdgeX(0,-dx); // Starting position X
+ for(i=0;i<knbinx;i++) SetLowBinEdgeX(i+1,GetBinLowEdgeX(i)+kbinx0);
+ SetLowBinEdgeZ(0,-dz); // Starting position z
+ SetLowBinEdgeZ(1,GetBinLowEdgeZ(0)+kbinz1);
+ for(i=1;i<knbinz;i++) SetLowBinEdgeZ(i+1,GetBinLowEdgeZ(i)+kbinz0);
+ SetLowBinEdgeZ(knbinz,GetBinLowEdgeZ(knbinz-1)+kbinz1);
+
+ if(TMath::Abs(dx-kdx)>1.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;i<knbinx;i++) binSizeX[i] = kbinx0; // default x bin size.
+ binSizeZ = new Float_t[knbinz]; // array of bin sizes along z.
+ for(i=0;i<knbinz;i++) binSizeZ[i] = kbinz0; // default z bin size.
+ binSizeZ[ 31] = kbinz1;
+ binSizeZ[ 32] = kbinz1;
+
+ binSizeZ[ 63] = kbinz1;
+ binSizeZ[ 64] = kbinz1;
+
+ binSizeZ[ 95] = kbinz1;
+ binSizeZ[ 96] = kbinz1;
+
+ binSizeZ[127] = kbinz1;
+ binSizeZ[128] = kbinz1;
+
+ // correct detector size for bin size.
+ dx = 0.0;
+ for(i=0;i<knbinx;i++) dx += binSizeX[i];
+ dx *= 0.5;
+ dz = 0.0;
+ for(i=0;i<knbinz;i++) dz += binSizeZ[i];
+ dz *= 0.5;
+
+ if(npar<3){
+ Error("AliITSgeomSPD425Short",
+ "npar=%d<3 array par must be at least [3] or larger",npar);
+ return;
+ } // end if
+ SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",
+ par[0],par[1],par[2]);
+ if(TMath::Abs(dx-kdx)>1.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<knbinx;i++) SetLowBinEdgeX(i+1,GetBinLowEdgeX(i)+binSizeX[i]);
+ for(i=0;i<knbinz;i++) SetLowBinEdgeZ(i+1,GetBinLowEdgeZ(i)+binSizeZ[i]);
+}
+//----------------------------------------------------------------------
+ostream &operator<<(ostream &os,AliITSgeomSPD425Short &p){
+////////////////////////////////////////////////////////////////////////
+// Standard output streaming function.
+////////////////////////////////////////////////////////////////////////
+
+ p.Print(&os);
+ return os;
+}
+//----------------------------------------------------------------------
+istream &operator>>(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;i<knbinx;i++) binSizeX[i] = kbinx0; // default x bin size.
+ binSizeZ = new Float_t[knbinz]; // array of bin sizes along z.
+ for(i=0;i<knbinz;i++) binSizeZ[i] = kbinz0; // default z bin size.
+ binSizeZ[ 31] = kbinz1;
+ binSizeZ[ 32] = kbinz1;
+
+ binSizeZ[ 63] = kbinz1;
+ binSizeZ[ 64] = kbinz1;
+
+ binSizeZ[ 95] = kbinz1;
+ binSizeZ[ 96] = kbinz1;
+
+ binSizeZ[127] = kbinz1;
+ binSizeZ[128] = kbinz1;
+
+ binSizeZ[159] = kbinz1;
+ binSizeZ[160] = kbinz1;
+
+ // correct detector size for bin size.
+ dx = 0.0;
+ for(i=0;i<knbinx;i++) dx += binSizeX[i];
+ dx *= 0.5;
+ dz = 0.0;
+ for(i=0;i<knbinz;i++) dz += binSizeZ[i];
+ dz *= 0.5;
+
+ SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
+ if(TMath::Abs(dx-kdx)>1.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<knbinx;i++) SetLowBinEdgeX(i+1,GetBinLowEdgeX(i)+binSizeX[i]);
+ for(i=0;i<knbinz;i++) SetLowBinEdgeZ(i+1,GetBinLowEdgeZ(i)+binSizeZ[i]);
+}
+//----------------------------------------------------------------------
+ostream &operator<<(ostream &os,AliITSgeomSPD425Long &p){
+////////////////////////////////////////////////////////////////////////
+// Standard output streaming function.
+////////////////////////////////////////////////////////////////////////
+
+ p.Print(&os);
+ return os;
+}
+//----------------------------------------------------------------------
+istream &operator>>(istream &is,AliITSgeomSPD425Long &r){
+////////////////////////////////////////////////////////////////////////
+// Standard input streaming function.
+////////////////////////////////////////////////////////////////////////