ROOT logo
#include "KStrip.h"
#include "KMesh.h"
ClassImp(KStrip)
//////////////////////////////////////////////////////////////////////////
//                                                                      //
// KStrip                                                               //
//                                                                      //
// Class for description of silicon microstrip detector                 //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


KStrip::KStrip(Float_t x1, Float_t x2, Float_t x3, Int_t x4, Float_t x5)
{
   //Constructor:K
   // Float_t x1;  Strip Pitch
   // Float_t x2;  Strip Width
   // Int_t x3;    Number of strips
   // Float_t x4;  Detector thickness

  Pitch=x1;
  Width=x2;
  Depth=x3;
  NoStrips=x4;
  CellY=x5;
}




void KStrip::SetUpVolume(Int_t numy,Float_t *Ybins, Int_t numx, Float_t *Xbins)
{
  Float_t Zbins=0;
  nx=numx;
  ny=numy;

  CellX=Pitch*NoStrips;

  EG=new TH3I("EG","EG",nx,Xbins,ny,Ybins,1,&Zbins);
  EG->GetXaxis()->SetTitle("x [#mum]");
  EG->GetYaxis()->SetTitle("y [#mum]");

  DM=new TH3I("DM","DM",nx,Xbins,ny,Ybins,1,&Zbins);
  DM->GetXaxis()->SetTitle("x [#mum]");
  DM->GetYaxis()->SetTitle("y [#mum]");
}

void KStrip::SetUpVolume(Float_t StS,Float_t StE,Int_t Num)
{
KMesh Ym(CellY);
Float_t *Ybins=new Float_t [1000];
ny=Ym.GetBins(Num,StS,StE,Ybins);

Int_t i,j;
CellX=Pitch*NoStrips;
nx=(Int_t)(CellX/StS);

 Float_t *Xbins=new Float_t[nx+1];
Float_t Zbins;
 Zbins=1;
 Ybins[0]=0;
 Xbins[0]=0;

 // for(Int_t j=1;j<=ny;j++) 
 // if(j*St1<=Yb) Ybins[j]=Ybins[j-1]+St1; else Ybins[j]=Ybins[j-1]+St2;
 for(Int_t i=1;i<=nx;i++) Xbins[i]= Xbins[i-1]+StS;

  EG=new TH3I("EG","EG",nx,Xbins,ny,Ybins,1,&Zbins);
  EG->GetXaxis()->SetTitle("x [#mum]");
  EG->GetYaxis()->SetTitle("y [#mum]");

  DM=new TH3I("DM","DM",nx,Xbins,ny,Ybins,1,&Zbins);
  DM->GetXaxis()->SetTitle("x [#mum]");
  DM->GetYaxis()->SetTitle("y [#mum]");

  delete Xbins;
  delete Ybins;


}

void KStrip::SetUpVolume(Float_t St1,Float_t St2)
{
CellX=Pitch*NoStrips;
nx=(Int_t)(CellX/St1);
ny=(Int_t)(CellY/St2);
  EG=new TH3I("EG","EG",nx,0,CellX,ny,0,CellY,1,0,1);
  EG->GetXaxis()->SetTitle("x [#mum]");
  EG->GetYaxis()->SetTitle("y [#mum]");

  DM=new TH3I("DM","DM",nx,0,CellX,ny,0,CellY,1,0,1);
  DM->GetXaxis()->SetTitle("x [#mum]");
  DM->GetYaxis()->SetTitle("y [#mum]");

}


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


void KStrip::SetUpElectrodes(Int_t rs)
{
Float_t sc,sr,sl;
Int_t i,j,k;
 // Setup default ramo strip
 if(rs>=0) RamoStrip=rs; else
 if(rs==-1) RamoStrip=NoStrips/2; else RamoStrip=-2;
//Back plane metalization
 for(i=1;i<=nx;i++) EG->SetBinContent(i,1,1,2);
//DC Strips
 for(i=0;i<NoStrips;i++)
   {
     sc=(i+1)*(CellX/NoStrips)-(Pitch/2.);
     sl=sc-(Width/2.);
     sr=sc+(Width/2.);
    
     for(k=EG->GetXaxis()->FindBin(sl);k<=EG->GetXaxis()->FindBin(sr);k++) 
       {
	 for(j=EG->GetYaxis()->FindBin(CellY-Depth);j<=ny;j++)
	 if(i==RamoStrip || RamoStrip==-2) 
	   EG->SetBinContent(k,j,1,16385); 
	   else
	   EG->SetBinContent(k,j,1,1); 
       }
   }

 //Setup default track
  enp[0]=((Float_t)NoStrips)/2*Pitch; enp[1]=1;     enp[2]=0.5;
  exp[0]=((Float_t)NoStrips)/2*Pitch; exp[1]=CellY; exp[2]=0.5;
  
}

 KStrip.cxx:1
 KStrip.cxx:2
 KStrip.cxx:3
 KStrip.cxx:4
 KStrip.cxx:5
 KStrip.cxx:6
 KStrip.cxx:7
 KStrip.cxx:8
 KStrip.cxx:9
 KStrip.cxx:10
 KStrip.cxx:11
 KStrip.cxx:12
 KStrip.cxx:13
 KStrip.cxx:14
 KStrip.cxx:15
 KStrip.cxx:16
 KStrip.cxx:17
 KStrip.cxx:18
 KStrip.cxx:19
 KStrip.cxx:20
 KStrip.cxx:21
 KStrip.cxx:22
 KStrip.cxx:23
 KStrip.cxx:24
 KStrip.cxx:25
 KStrip.cxx:26
 KStrip.cxx:27
 KStrip.cxx:28
 KStrip.cxx:29
 KStrip.cxx:30
 KStrip.cxx:31
 KStrip.cxx:32
 KStrip.cxx:33
 KStrip.cxx:34
 KStrip.cxx:35
 KStrip.cxx:36
 KStrip.cxx:37
 KStrip.cxx:38
 KStrip.cxx:39
 KStrip.cxx:40
 KStrip.cxx:41
 KStrip.cxx:42
 KStrip.cxx:43
 KStrip.cxx:44
 KStrip.cxx:45
 KStrip.cxx:46
 KStrip.cxx:47
 KStrip.cxx:48
 KStrip.cxx:49
 KStrip.cxx:50
 KStrip.cxx:51
 KStrip.cxx:52
 KStrip.cxx:53
 KStrip.cxx:54
 KStrip.cxx:55
 KStrip.cxx:56
 KStrip.cxx:57
 KStrip.cxx:58
 KStrip.cxx:59
 KStrip.cxx:60
 KStrip.cxx:61
 KStrip.cxx:62
 KStrip.cxx:63
 KStrip.cxx:64
 KStrip.cxx:65
 KStrip.cxx:66
 KStrip.cxx:67
 KStrip.cxx:68
 KStrip.cxx:69
 KStrip.cxx:70
 KStrip.cxx:71
 KStrip.cxx:72
 KStrip.cxx:73
 KStrip.cxx:74
 KStrip.cxx:75
 KStrip.cxx:76
 KStrip.cxx:77
 KStrip.cxx:78
 KStrip.cxx:79
 KStrip.cxx:80
 KStrip.cxx:81
 KStrip.cxx:82
 KStrip.cxx:83
 KStrip.cxx:84
 KStrip.cxx:85
 KStrip.cxx:86
 KStrip.cxx:87
 KStrip.cxx:88
 KStrip.cxx:89
 KStrip.cxx:90
 KStrip.cxx:91
 KStrip.cxx:92
 KStrip.cxx:93
 KStrip.cxx:94
 KStrip.cxx:95
 KStrip.cxx:96
 KStrip.cxx:97
 KStrip.cxx:98
 KStrip.cxx:99
 KStrip.cxx:100
 KStrip.cxx:101
 KStrip.cxx:102
 KStrip.cxx:103
 KStrip.cxx:104
 KStrip.cxx:105
 KStrip.cxx:106
 KStrip.cxx:107
 KStrip.cxx:108
 KStrip.cxx:109
 KStrip.cxx:110
 KStrip.cxx:111
 KStrip.cxx:112
 KStrip.cxx:113
 KStrip.cxx:114
 KStrip.cxx:115
 KStrip.cxx:116
 KStrip.cxx:117
 KStrip.cxx:118
 KStrip.cxx:119
 KStrip.cxx:120
 KStrip.cxx:121
 KStrip.cxx:122
 KStrip.cxx:123
 KStrip.cxx:124
 KStrip.cxx:125
 KStrip.cxx:126
 KStrip.cxx:127
 KStrip.cxx:128
 KStrip.cxx:129
 KStrip.cxx:130
 KStrip.cxx:131
 KStrip.cxx:132
 KStrip.cxx:133
 KStrip.cxx:134
 KStrip.cxx:135
 KStrip.cxx:136