StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DrawEPD.C
1 class StEpdGeom;
2 
3 void DrawEPD(){
4 
5  gSystem->Load("StEpdUtil");
6  StEpdGeom* geo = new StEpdGeom();
7 
8  TCanvas* cEast = new TCanvas("EastCan","EastCan",600,600);
9  cEast->Draw();
10  TH2D* hEast = new TH2D("East","East",500,-100,100,500,-100,100);
11  hEast->Draw();
12 
13  Short_t EW=-1; // East Side
14  Double_t x[6];
15  Double_t y[6];
16  Int_t nCorners;
17  for (Short_t PP=1; PP<=12; PP++){
18  for (Short_t TT=1; TT<=31; TT++){
19 
20  // Example of StEpdGeom::GetCorners
21  geo->GetCorners(PP,TT,EW,&nCorners,x,y);
22  x[nCorners]=x[0]; y[nCorners]=y[0]; // closes the polyline
23  TPolyLine* pline = new TPolyLine(nCorners+1,x,y);
24  pline->Draw();
25 
26  // Example of StEpdGeom::RandomPointOnTile
27  if ((PP*TT)%2==1){
28  for (Int_t nPoint=0; nPoint<300; nPoint++){
29  TVector3 point = geo->RandomPointOnTile(PP,TT,EW);
30  hEast->Fill(point.X(),point.Y());
31  }
32  }
33 
34  // Example of StEpdGeom::TileCenter and StEpdGeom::Row
35  if ((PP%2==0)&&(TT%2==0)){
36  Double_t xcent = geo->TileCenter(PP,TT,EW).X();
37  Double_t ycent = geo->TileCenter(PP,TT,EW).Y();
38  TText* lab = new TText(xcent,ycent,Form("Row %d",geo->Row(PP,TT,EW)));
39  lab->SetTextAlign(22); lab->SetTextSize(0.01); lab->SetTextColor(2);
40  lab->Draw();
41  }
42 
43  }
44  }
45 }
46 
47 
Definition: T.h:18