Good Morning Holly,

Assuming you have access to the org.lcsim.geometry.Detector the following will give you the position of the front of the crystal.

 

               HPSEcal3 ecal = (HPSEcal3) detector.getSubdetector("Ecal");

                HPSEcalDetectorElement detElement = (HPSEcalDetectorElement) ecal.getDetectorElement();

                EcalCrystal crystal = detElement.getCrystal(ix, iy);

                Hep3Vector pos = crystal.getPositionFront();

 

If you need the center of the crystal I would suggest that you add that method to the EcalCrystal class.

Let me know if you encounter any difficulties or have any further questions,

Norman

 

From: [log in to unmask] [mailto:[log in to unmask]] On Behalf Of Holly Vance
Sent: Tuesday, December 01, 2015 8:33 AM
To: hps-software
Subject: Another geometry question

 

Hi,

 

In addition to my previous e-mail, I would like to access the x,y vales (mm) of certain crystals (I would like to avoid hard-coding coordinates). I 've done this previously in clustering by using a hit (CalorimeterHit) and then getting the geometry: 

IGeometryInfo geom = hit.getDetectorElement().getGeometry();

        double[] pos = geom.transformLocalToGlobal(VecOp.add(geom.transformGlobalToLocal(geom.getPosition()), (Hep3Vector) new BasicHep3Vector(0, 0, -1 * ((Trd) geom.getLogicalVolume().getSolid()).getZHalfLength()))).v();

Is there a way to do this without using a CalorimeterHit? Perhaps just using a crystal index like ix,iy?

 

Thanks,

Holly 

 


Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1



Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1