#include "TGeoManager.h" #include "TGeoMaterial.h" #include "TGeoMedium.h" #include "TGeoVolume.h" #include "TGeoMatrix.h" void active_target_geometry_pixeled() { TGeoManager *manager = new TGeoManager("manager", "Active Target Geometry"); //manager->SetDefaultUnits(kG4Units); //esto no sirve!!?? //materials TGeoMaterial *Vacuum = new TGeoMaterial("Vacuum", 0, 0, 0); TGeoMaterial *Si = new TGeoMaterial("Si", 28.085, 14, 2.3290); //media TGeoMedium *Air = new TGeoMedium("Air", 0, Vacuum); TGeoMedium *MAPSmedium = new TGeoMedium("MAPSmedium", 1, Si); TGeoVolume *top = manager->MakeBox("Top", Air, 100, 100, 200); //units in mm manager->SetTopVolume(top); //MAPSpixel Double_t xPixel = 0.02924, yPixel = 0.02688, zPixel = 0.1; TGeoVolume *volumePixel = manager->MakeBox("volumePixel", MAPSmedium, xPixel/2., yPixel/2., zPixel/2.); Int_t numberPlanes = 20; Double_t distBetweenPlanes = 8.; Int_t numPixels = 1024; for(int k = 0; k < numberPlanes; k++){ for (int i = 0; i < numPixels; i++){ for (int j = 0; j < numPixels; j++){ top->AddNode(volumePixel, i*10000+j, new TGeoTranslation(xPixel*(0.5-512+j), yPixel*(512-0.5-i), k*distBetweenPlanes)); } } } manager->CloseGeometry(); top->Draw("ogl"); }