Search/Navigation:
Related:
SLAC/EPP
/HPS Public
Jefferson Lab/Hall B
/HPS Run Wiki
S30XL-LESA/LDMX
...
Before the conditions can be accessed, the DatabaseConditionsManager must be created and initialized correctly, which should happen automatically if you are running a command line job or using the monitoring application.
The Assuming that the conditions system has been setup properly beforehand, the ECAL channel conditions can be accessed in user code in the following way.
Code Block | ||||
---|---|---|---|---|
| ||||
// Get ECAL conditions. EcalConditions ecalConditions = ConditionsManager.defaultInstance().getCachedConditions(EcalConditions.class, TableConstants.ECAL_CONDITIONS).getCachedData(); // Get the list of EcalChannel objects. EcalChannelCollection channels = ecalConditions.getChannelCollection(); |
The channel mapping is modeled by the EcalChannel class which has the unique channel ID plus the associated geometric and DAQ information.
Once retrieved from the conditions system, a channel object can be used to get the conditions constants associated with a single crystal.
Code Block | ||
---|---|---|
| ||
EcalChannelConstants channelConstants = ecalConditions.getChannelConstants(anEcalChannelObject); |
Channels may be looked up in the collection using several different search methods.
Code Block | ||
---|---|---|
| ||
// Find a channel by its encoded geometric ID e.g. from an LCIO hit object like CalorimeterHit.
CalorimeterHit hit = ...;
EcalChannel channel = channels.findGeomtric(hit.getCellID());
// Find a channel by its unique channel ID. This finds channel #1.
EcalChannel channel = channels.findChannel(1);
// Find a channel by its DAQ information. This looks up the crystal connected to crate 1, slot 20 and channel 12 on the DAQ.
EcalChannel channel = channels.findChannel(new DaqId(new int [] { 1, 20, 12 } )); |
There are several other ways of looking up channels not listed here. Please refer to the source code for EcalChannel for complete details.
...