void view(const char *what = "GFOIL", Int_t vislevel = 0, const char *opt = "ogl", Bool_t topVisible=kFALSE) { // load libraries and open the TGeo manager gSystem->Load("libGeom"); if (gGeoManager) delete gGeoManager; gGeoManager = new TGeoManager("ITS", "Simple ITS geometry"); // initialize the ITS materials Int_t medOffset = 0, matOffset = 0; AliITSv11GeometrySPD *spd = new AliITSv11GeometrySPD; spd->CreateSPDCentralMaterials(medOffset, matOffset); // create a dummy volume TGeoVolume *top = 0; // define some dummy size variables Double_t length, width, thickness; // check the option TString str(what); str.ToUpper(); if (str.Contains("LADDER")) { top = spd->CreateLadder(1, length, width, thickness); cout << endl << endl << "--- SIZES ---" << endl << endl; cout << "LENGTH (mm) = " << length * 10.0 << endl; cout << "WIDTH (mm) = " << width * 10.0 << endl; cout << "THICKNESS (mm) = " << thickness * 10.0 << endl << endl; } else if (str.Contains("GFOILK")) { top = spd->CreateGroundingFoilSingle(kTRUE, length, width, thickness); cout << endl << endl << "--- SIZES ---" << endl << endl; cout << "LENGTH (mm) = " << length * 10.0 << endl; cout << "WIDTH (mm) = " << width * 10.0 << endl; cout << "THICKNESS (mm) = " << thickness * 10.0 << endl << endl; } else if (str.Contains("GFOILA")) { top = spd->CreateGroundingFoilSingle(kTRUE, length, width, thickness); cout << endl << endl << "--- SIZES ---" << endl << endl; cout << "LENGTH (mm) = " << length * 10.0 << endl; cout << "WIDTH (mm) = " << width * 10.0 << endl; cout << "THICKNESS (mm) = " << thickness * 10.0 << endl << endl; } else if (str.Contains("GFOIL")) { top = spd->CreateGroundingFoil(thickness); cout << endl << endl << "--- SIZES ---" << endl << endl; cout << "THICKNESS (mm) = " << thickness * 10.0 << endl << endl; } else if (str.Contains("MCMBASE")) { top = spd->CreateMCMBase(); } else if (str.Contains("MCMCAP")) { top = spd->CreateMCMCoverBorder(); } else if (str.Contains("STAVEB")) { Double_t a, b, c; top = spd->CreateStaveBase(1, a, b, c); } else if (str.Contains("STAVE")) { Double_t a; top = spd->CreateStave(1, a); } else if (str.Contains("BUS")) { Double_t a; top = spd->CreatePixelBusAndExtensions(kTRUE); } else if (str.Contains("SECTOR")) { Double_t a, b; TGeoMedium *vacuum = gGeoManager->GetMedium("VACUUM"); TGeoVolume *top = gGeoManager->MakeBox("TOP", vacuum, 20., 20., 50.); //top = spd->SectorPlusStaves(top, a, b); top = spd->CarbonFiberSector(top, a, b); } else if (str.Contains("SPD")) { Double_t a, b; TGeoMedium *vacuum = gGeoManager->GetMedium("VACUUM"); TGeoVolume *top = gGeoManager->MakeBox("TOP", vacuum, 50., 50., 50.); top = spd->SPDSector(top); } else { cerr << "Invalid option" << endl; return; } // set top properties top->SetLineColor(kCyan); top->SetTransparency(20); gGeoManager->SetTopVolume(top); gGeoManager->SetTopVisible(topVisible); // close the geometry project environment gGeoManager->CloseGeometry(); gGeoManager->CheckOverlaps(0.00001); gGeoManager->PrintOverlaps(); // draw gGeoManager->SetVisLevel(vislevel); top->Draw(opt); }