-
-//_____________________________________________________________________________
-void AliTRD::BuildGeometry()
-{
- //
- // Create the ROOT TNode geometry for the TRD
- //
-
- TNode *node, *top;
- TPGON *pgon;
-
- Float_t rmin, rmax;
- Float_t zmax1, zmax2;
-
- Int_t iPlan;
-
- const Int_t kColorTRD = 46;
-
- // Find the top node alice
- top = gAlice->GetGeometry()->GetNode("alice");
-
- if (fDisplayType == 0) {
-
- pgon = new TPGON("S_TRD","TRD","void",0,360,AliTRDgeometry::Nsect(),4);
- rmin = AliTRDgeometry::Rmin();
- rmax = AliTRDgeometry::Rmax();
- pgon->DefineSection(0,-AliTRDgeometry::Zmax1(),rmax,rmax);
- pgon->DefineSection(1,-AliTRDgeometry::Zmax2(),rmin,rmax);
- pgon->DefineSection(2, AliTRDgeometry::Zmax2(),rmin,rmax);
- pgon->DefineSection(3, AliTRDgeometry::Zmax1(),rmax,rmax);
- top->cd();
- node = new TNode("TRD","TRD","S_TRD",0,0,0,"");
- node->SetLineColor(kColorTRD);
- fNodes->Add(node);
-
- }
- else if (fDisplayType == 1) {
-
- Char_t name[7];
-
- Float_t slope = (AliTRDgeometry::Zmax1() - AliTRDgeometry::Zmax2())
- / (AliTRDgeometry::Rmax() - AliTRDgeometry::Rmin());
-
- rmin = AliTRDgeometry::Rmin() + AliTRDgeometry::CraHght();
- rmax = rmin + AliTRDgeometry::CdrHght();
-
- Float_t thickness = rmin - AliTRDgeometry::Rmin();
- zmax2 = AliTRDgeometry::Zmax2() + slope * thickness;
- zmax1 = zmax2 + slope * AliTRDgeometry::DrThick();
-
- for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
-
- sprintf(name,"S_TR1%d",iPlan);
- pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4);
- pgon->DefineSection(0,-zmax1,rmax,rmax);
- pgon->DefineSection(1,-zmax2,rmin,rmax);
- pgon->DefineSection(2, zmax2,rmin,rmax);
- pgon->DefineSection(3, zmax1,rmax,rmax);
- top->cd();
- node = new TNode("TRD","TRD",name,0,0,0,"");
- node->SetLineColor(kColorTRD);
- fNodes->Add(node);
-
- Float_t height = AliTRDgeometry::Cheight() + AliTRDgeometry::Cspace();
- rmin = rmin + height;
- rmax = rmax + height;
- zmax1 = zmax1 + slope * height;
- zmax2 = zmax2 + slope * height;
-
- }
-
- thickness += AliTRDgeometry::DrThick();
- rmin = AliTRDgeometry::Rmin() + thickness;
- rmax = rmin + AliTRDgeometry::AmThick();
- zmax2 = AliTRDgeometry::Zmax2() + slope * thickness;
- zmax1 = zmax2 + slope * AliTRDgeometry::AmThick();
-
- for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) {
-
- sprintf(name,"S_TR2%d",iPlan);
- pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4);
- pgon->DefineSection(0,-zmax1,rmax,rmax);
- pgon->DefineSection(1,-zmax2,rmin,rmax);
- pgon->DefineSection(2, zmax2,rmin,rmax);
- pgon->DefineSection(3, zmax1,rmax,rmax);
- top->cd();
- node = new TNode("TRD","TRD",name,0,0,0,"");
- node->SetLineColor(kColorTRD);
- fNodes->Add(node);
-
- Float_t height = AliTRDgeometry::Cheight() + AliTRDgeometry::Cspace();
- rmin = rmin + height;
- rmax = rmax + height;
- zmax1 = zmax1 + slope * height;
- zmax2 = zmax2 + slope * height;
-
- }
-
- }
-
-}