StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DrawBbc.C
1 class StBbcGeom;
2 
3 void DrawBbc(){
4 
5  gSystem->Load("StEpdUtil");
6  StBbcGeom* Bgeo = new StBbcGeom();
7 
8 
9  TCanvas* cEast = new TCanvas("EastCan","EastCan",1000,1000);
10  cEast->Draw();
11  TH2D* hEast = new TH2D("East","East",500,-100,100,500,-100,100);
12  hEast->Draw();
13 
14 
15  for (short tileId=-18; tileId<0; tileId++){ // NOTE negative tileId because East Bbc
16  cout << "tileID = " << tileId << endl;
17  unsigned short tid = abs(tileId);
18  TVector3 cent = Bgeo->TileCenter(tid,0);
19 
20  // TVector3 cent = Bgeo->TileCenter(tileId);
21  cout << cent.X() << " " << cent.Y() << " " << cent.Z() << endl;
22 
23  TText* txt = new TText(cent.X(),cent.Y(),Form("%d",tileId));
24  txt->SetTextSize(.02);
25  txt->SetTextAlign(22);
26  txt->Draw();
27 
28  double x[7];
29  double y[7];
30  Bgeo->GetCorners(tileId,x,y);
31  x[6]=x[0]; y[6]=y[0];
32  TPolyLine* pline = new TPolyLine(7,x,y);
33  pline->SetLineColor(4);
34  pline->SetLineWidth(2);
35  pline->Draw();
36 
37 
38  unsigned short pmtNumber = Bgeo->PmtOfTile(tid);
39  TText* Ptxt = new TText(cent.X(),cent.Y()-5.0,Form("%d",pmtNumber));
40  Ptxt->SetTextSize(0.01);
41  Ptxt->SetTextColor(2);
42  Ptxt->Draw();
43 
44  }
45 
46 
47 }
48 
49 
50 
51 
unsigned short PmtOfTile(unsigned short tileNumber)
Definition: StBbcGeom.h:148
TVector3 TileCenter(short tileId)
Definition: StBbcGeom.cxx:107
void GetCorners(short tileId, double *x, double *y)
Definition: StBbcGeom.cxx:121