ROOT logo
#include "K3D.h"


ClassImp(K3D)
//////////////////////////////////////////////////////////////////////////
//                                                                      //
// K3D                                                                  //
//                                                                      //
// Description of the 3D detector.                                      //
// The geometry of the                                                  //
// is defined by                                                        //
// dasdasd                                                              //
//////////////////////////////////////////////////////////////////////////

K3D::~K3D()
{
    delete PosD; 
    delete PosX; 
    delete PosY;
    delete PosR;
    delete PosW;
}

K3D::K3D(Int_t x1, Float_t x, Float_t y, Float_t z)
{
  Col=x1;
  PosD=new Float_t [Col];
  PosX=new Float_t [Col];
  PosY=new Float_t [Col];
  PosR=new Float_t [Col];
  PosW=new Short_t [Col];
  PosM=new Short_t [Col];

  for(Int_t i=0;i<Col;i++) 
    {PosD[i]=0; PosX[i]=0; PosY[i]=0; PosR[i]=0; PosW[i]=0; PosM[i]=0;}

  CellZ=z;
  CellX=x;
  CellY=y;
}

void K3D::SetUpColumn(Int_t n, Float_t posX, Float_t posY, Float_t R, Float_t Depth, Short_t Wei,Short_t Mat)
{
  PosD[n]=Depth;
  PosR[n]=R;
  PosX[n]=posX;
  PosY[n]=posY;
  PosW[n]=Wei;
  PosM[n]=Mat;
}


void K3D::SetUpVolume(Float_t St1, Float_t St2)
{
  nx=(int)(CellX/St1);
  ny=(int)(CellY/St1);
  nz=(int)(CellZ/St2);
  
 EG=new TH3I("EG","EG",nx,0,CellX,ny,0,CellY,nz,0,CellZ);
  EG->GetXaxis()->SetTitle("x [#mum]");
  EG->GetYaxis()->SetTitle("y [#mum]");
  EG->GetZaxis()->SetTitle("z [#mum]");

  GetGrid(EG,1);
}

void K3D::SetUpElectrodes(Int_t back)
{
  Float_t Pos[3],L=0;
  Int_t i,j,k;
  if(back)
    {
    for(k=1;k<=nz;k++)
     for(j=1;j<=ny;j++)
      for(i=1;i<=nx;i++)
	if(k==1) EG->SetBinContent(i,j,k,2); 	
	      else 
	         EG->SetBinContent(i,j,k,0); 
    }

  for(Int_t i=0;i<Col;i++)
    {
      Pos[0]=PosX[i];
      Pos[1]=PosY[i];
      Pos[2]=PosD[i]>=0?Pos[2]=PosD[i]/2.:(2*CellZ+PosD[i])/2.; 
      L=TMath::Abs(PosD[i]/2.); 
      ElCylinder(Pos,PosR[i],L,3,PosW[i],PosM[i]);
    }

}

void K3D::SetUpMaterial(Int_t mat)
{
 for(int i=1;i<=nx;i++)
   for(int j=1;j<=ny;j++)
     for(int k=1;k<=nz;k++) DM->SetBinContent(i,j,k,mat);
}


 K3D.cxx:1
 K3D.cxx:2
 K3D.cxx:3
 K3D.cxx:4
 K3D.cxx:5
 K3D.cxx:6
 K3D.cxx:7
 K3D.cxx:8
 K3D.cxx:9
 K3D.cxx:10
 K3D.cxx:11
 K3D.cxx:12
 K3D.cxx:13
 K3D.cxx:14
 K3D.cxx:15
 K3D.cxx:16
 K3D.cxx:17
 K3D.cxx:18
 K3D.cxx:19
 K3D.cxx:20
 K3D.cxx:21
 K3D.cxx:22
 K3D.cxx:23
 K3D.cxx:24
 K3D.cxx:25
 K3D.cxx:26
 K3D.cxx:27
 K3D.cxx:28
 K3D.cxx:29
 K3D.cxx:30
 K3D.cxx:31
 K3D.cxx:32
 K3D.cxx:33
 K3D.cxx:34
 K3D.cxx:35
 K3D.cxx:36
 K3D.cxx:37
 K3D.cxx:38
 K3D.cxx:39
 K3D.cxx:40
 K3D.cxx:41
 K3D.cxx:42
 K3D.cxx:43
 K3D.cxx:44
 K3D.cxx:45
 K3D.cxx:46
 K3D.cxx:47
 K3D.cxx:48
 K3D.cxx:49
 K3D.cxx:50
 K3D.cxx:51
 K3D.cxx:52
 K3D.cxx:53
 K3D.cxx:54
 K3D.cxx:55
 K3D.cxx:56
 K3D.cxx:57
 K3D.cxx:58
 K3D.cxx:59
 K3D.cxx:60
 K3D.cxx:61
 K3D.cxx:62
 K3D.cxx:63
 K3D.cxx:64
 K3D.cxx:65
 K3D.cxx:66
 K3D.cxx:67
 K3D.cxx:68
 K3D.cxx:69
 K3D.cxx:70
 K3D.cxx:71
 K3D.cxx:72
 K3D.cxx:73
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