// geometry for simulations of setup 1 // Bonn tracking station tests // DESY, June 2010 // Simone Bianco 12/10/2010 //pcbmvd { // 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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! const Double_t kDzPcb = 0.125; // 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= "CracowDeviceOnlyPcbBefore.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"); FairGeoMedium *CbmMediumPcb = Media->getMedium("pcbmvd"); Int_t nmed=geobuild->createMedium(CbmMediumAir); nmed=geobuild->createMedium(CbmMediumSilicon); nmed=geobuild->createMedium(CbmMediumPcb); TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom"); TGeoVolume *top = new TGeoVolumeAssembly("PcbBefore"); gGeoMan->SetTopVolume(top); // TGeoShape *Box = new TGeoBBox("PcbBefore", kDx, kDy, kDz); // TGeoVolume* BoxVol = new TGeoVolume("PcbBeforeVol",Box,gGeoMan->GetMedium("silicon")); TGeoShape *BoxPcb = new TGeoBBox("PcbBefore", kDx, kDy, kDzPcb); TGeoVolume* BoxVolPcb = new TGeoVolume("PcbBeforeVol",BoxPcb,gGeoMan->GetMedium("pcbmvd")); // TGeoTranslation* trt1 = new TGeoTranslation(0.,0.,kPos); TGeoTranslation* trtPcb = new TGeoTranslation(0.,0.,kPos-2*kDz-kDzPcb); TGeoRotation* dummyrot = new TGeoRotation(); // TGeoCombiTrans* trc1= new TGeoCombiTrans(*trt1,*dummyrot); // trc1->SetName("SensorTest"); // trc1->RegisterYourself(); TGeoCombiTrans* trc1Pcb= new TGeoCombiTrans(*trtPcb,*dummyrot); trc1Pcb->SetName("PcbTransl"); trc1Pcb->RegisterYourself(); TGeoVolumeAssembly* SubunitVol = new TGeoVolumeAssembly("Pcb"); //TGeoVolumeAssembly* SubunitDouble = new TGeoVolumeAssembly("CracowDevice"); //SubunitDouble->AddNode(BoxVol,0,trc1); TGeoVolumeAssembly* SubunitPassive = new TGeoVolumeAssembly("CracowPassivePcb"); SubunitPassive->AddNode(BoxVolPcb,0,trc1Pcb); //SubunitVol->AddNode(SubunitDouble,0,new TGeoCombiTrans()); SubunitVol->AddNode(SubunitPassive,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"); }