// geometry for simulations of setup 1 // Bonn tracking station tests // DESY, June 2010 // Simone Bianco 12/10/2010 { // Sizes of the detectors // Detectors defined as TGeoBBoxes, so the following kDx,kDy and kDz // are half of the real sizes of the boxes const Double_t kDx = 2.; // in cm!! const Double_t kDy = 2.; // in cm!! const Double_t kDz = 0.015; // in cm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Positions of the detector // Sensors displaced along z, laying on perpendicular xy plane, // there centered in (0,0) // 2 double sided sensors const Double_t kPos = 110.; // (cm) //################################################## gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); // Load this libraries gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libPndData"); gSystem->Load("libPassive"); TString outfile= "CracowDevice.root"; TFile* fi = new TFile(outfile,"RECREATE"); FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader"); FairGeoInterface *geoFace = geoLoad->getGeoInterface(); geoFace->setMediaFile("/disk/user/bianco/pandaroot/UP/trunk/geometry/media_pnd.geo"); geoFace->readMedia(); geoFace->print(); //################################################## FairGeoMedia *Media = geoFace->getMedia(); FairGeoBuilder *geobuild=geoLoad->getGeoBuilder(); FairGeoMedium *CbmMediumAir = Media->getMedium("air"); FairGeoMedium *CbmMediumSilicon = Media->getMedium("silicon"); Int_t nmed=geobuild->createMedium(CbmMediumAir); nmed=geobuild->createMedium(CbmMediumSilicon); TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom"); TGeoVolume *top = new TGeoVolumeAssembly("TrackingStation"); gGeoMan->SetTopVolume(top); TGeoShape *Box = new TGeoBBox("SensorActiveArea", kDx, kDy, kDz); TGeoVolume* BoxVol = new TGeoVolume("SensorActiveAreaOne",Box,gGeoMan->GetMedium("silicon")); TGeoTranslation* trt1 = new TGeoTranslation(0.,0.,kPos); TGeoRotation* dummyrot = new TGeoRotation(); TGeoCombiTrans* trc1= new TGeoCombiTrans(*trt1,*dummyrot); trc1->SetName("SensorTest"); trc1->RegisterYourself(); TGeoVolumeAssembly* SubunitVol = new TGeoVolumeAssembly("Cracow"); TGeoVolumeAssembly* SubunitDouble = new TGeoVolumeAssembly("CracowDevice"); SubunitDouble->AddNode(BoxVol,0,trc1); SubunitVol->AddNode(SubunitDouble,0,new TGeoCombiTrans()); top->AddNode(SubunitVol,0,new TGeoCombiTrans()); gGeoMan->CloseGeometry(); // gGeoMan->Export(outfile.Data()); top->Write(); fi->Close(); //gGeoManager->Export(outfile); top->Draw("ogl"); }