How to call specific objects from a GDML file?

Hi everyone,
I am a relatively new user. For the first time, I am trying to implement a geometry with GDML. I am able to import the GDML geometry. There are multiple objects in that geometry including my sensor. Now I would like to tell Geant4 which of these objects is the sensor. I cannot find any reference guide or anything for how to use GDML. All I find is how to load the whole geometry into Geant4 which is pretty easy and it works just fine.

I already have a working simulation where I was creating the geometry inside Geant4. I have a class that handles the detector (response, output, etc.). So, I just hand over the physical volume that I create in Geant4 to that class. Now I want to hand over the physical volume from the GDML file to that class instead, but I don’t know how.

Any information or reference to some sort of reference guide for GDML in Geant4 would help. Thank you!

In order to “mark” your sensor as a sensitive detector you need to add to your GDML extra information (called auxiliary):

  <volume name="Boxvol" >
     <auxiliary auxtype="SensDet" auxvalue="Tracker"/>

It adds extra (user) information to your volumes. Thanks to that, if you add few lines of code to how you now parse the detector, you can pass additional information, e.g. which volume is sensitive. Have a look at examples/extended/persistency/gdml/G04 and in particular at G04DetectorConstruction to see how to parse auxiliary information and add sensitive detectors.

Thank you, Anna! Sorry for the late response.