Print

Print


This util method should do that

EcalChannel channel = EcalConditionsUtil.findChannel(IIdentifierHelper helper, long cellId);

where 

helper = subdetector.getDetectorElement().getIdentifierHelper();

There should be a few examples of it in the code.

Or you can call

EcalChannelCollection.findGeometric(hit.getCellID());

if you have the EcalChannelCollection cached.
________________________________________
From: [log in to unmask] <[log in to unmask]> on behalf of Nathan Baltzell <[log in to unmask]>
Sent: Sunday, January 11, 2015 3:09 PM
To: hps-software
Subject: hit channel_id

If I have a RawCalorimeterHit object, and I want the corresponding channel’s unique
channel_id from the database.  I came up with this that seems to work (in that it looks
like it’s always between 0 and 441, but I didn’t check it any more than that):

findChannel(hit.getCellID()).getCalibration().getChannelId()

Does anyone know if it is correct?

-Nathan
########################################################################
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