Hello all-
I am working with the geometry library to produce a detector model that I would like to export in GDML format for simulation in Geant4. I have a couple of questions about the GDML output and the geometry definition. I’m using ROOT 6.04/00.
At the end of this message is a short (but complete) function that produces output illustrating my questions.
This code attempts to create a silicon solid state detector that has a single active detector pixel embedded into a larger silicon crystal. If I have understood the documentation in TGeoVolume correctly (https://root.cern.ch/root/html/TGeoVolume.html), declaring the active volume and adding it as a daughter of the crystal volume is acceptable and will not create an overlapping volume problem. This should effectively create a single piece of silicon with two regions that I can look at separately: the pixel region and the framing region around it. Ultimately I will want to retrieve the amount of energy deposited in each region by simulated events.
My first question is, is my understanding about placing daughter volumes correct?
Second, when I do this, the resulting GDML file does not name the any of the physvols. When Geant loads this it gives a default name of _PV. This is okay, but creates confusion if I use multiple instances of a logical volume, for example if I wanted to create multiple pixels of the same shape inside the parent silicon volume. I could go through the GDML file and manually name every daughter volume, but I’m wondering if there is a better way. There is additional confusion if I create multiple instances of the parent volume as now any name assigned to the daughter volumes would be replicated!
The alternative is to have a completely flat description in which every volume is independently added to the top volume. To do this I would also have to create cutouts of the pixel volumes in the parent silicon.
I would appreciate any advice/tips/suggestions/insights/better ways that anyone might be able to offer.
Thank you,
–Chad
TGeoVolume * minEx(void){
// load and initialize the geometry library
gSystem->Load("libGeom");
new TGeoManager("world", "simulation world");
// define materials
TGeoElementTable * etbl = gGeoManager->GetElementTable();
TGeoMaterial * vac_mat = new TGeoMaterial("Vacuum", 1, 1, 1.0e-25);
TGeoMaterial * si_mat = new TGeoMaterial("Silicon", etbl->FindElement("Silicon"), 2.33);
TGeoMedium * Vacuum = new TGeoMedium("Vacuum", 1, vac_mat);
TGeoMedium * Silicon = new TGeoMedium("Silicon", 1, si_mat);
// create the world
TGeoVolume * top = gGeoManager->MakeBox("Top_s", Vacuum, 10., 10., 10.);
top->SetName("Top");
gGeoManager->SetTopVolume(top);
// detector parameters
double D4_th(0.015); // thickness of silicon detector
double D4_w(0.7); // width of pixel active area
double D4_h(1.12); // height of pixel active area
double D4_ws(1.1); // width of silicon crystal
double D4_hs(1.52); // width of silicon crystal
// define the detector solids
// TGeoBBox name dx/2 dy/2 dz/2
TGeoBBox * D4Active_s = new TGeoBBox("D4Active_s", D4_th/2, D4_w/2, D4_h/2);
TGeoBBox * D4SiliconMain_s = new TGeoBBox("D4SiliconMain_s", D4_th/2, D4_ws/2, D4_hs/2);
// define the logical volumes
TGeoVolume * D4Active = new TGeoVolume("D4Active", D4Active_s, Silicon);
TGeoVolume * D4Detector = new TGeoVolume("D4Detector", D4SiliconMain_s, Silicon);
// add the active region to the main detector crystal
D4Detector->AddNode(D4Active, 1);
// add the detector to the world
top->AddNode(D4Detector, 1);
// close up the geometry
gGeoManager->CloseGeometry();
// export the geometry to GDML
gGeoManager->Export("Example.gdml");
// return the world volume
return top;
}
Partial GDML output:
<structure>
<volume name="D4Active">
<materialref ref="Silicon"/>
<solidref ref="D4Active_s"/>
</volume>
<volume name="D4Detector">
<materialref ref="Silicon"/>
<solidref ref="D4SiliconMain_s"/>
<physvol>
<volumeref ref="D4Active"/>
<positionref ref="D4Active_1inD4Detectorpos"/>
</physvol>
</volume>
<volume name="Top">
<materialref ref="Vacuum"/>
<solidref ref="Top_s"/>
<physvol>
<volumeref ref="D4Detector"/>
<positionref ref="D4Detector_1inToppos"/>
</physvol>
</volume>
</structure>