This repository has been archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add python config class for ecal detector map
- Loading branch information
1 parent
1b14002
commit 71c1c29
Showing
2 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Conditions object providers for a mapping between ecal electronics IDs and detector IDs""" | ||
|
||
from LDMX.Framework import ldmxcfg | ||
|
||
class EcalDetectorMap(ldmxcfg.ConditionsObjectProvider) : | ||
"""The COP that maps between Electronic and Detector IDs. | ||
The mapping is defined in three 'tiers'. | ||
1. cell - Each cell of a module has specific ROC elink and channel | ||
2. motherboard - Each module has a specific ROC elink and polarfire | ||
3. layer - Each layer has specific daq optical link | ||
So three CSV tables are necessary for providing this mapping. | ||
We can't have multiple different detector maps during a single | ||
run, so this class is meant to be a singleton. | ||
Attributes | ||
---------- | ||
__instance : EcalDetectorMap | ||
Singleton instance of this object | ||
""" | ||
|
||
__instance = None | ||
|
||
def get() : | ||
"""Get the single instance of the EcalDetectorMap | ||
Returns | ||
------- | ||
EcalDetectorMap | ||
Single instance of the provider | ||
""" | ||
return EcalGeometryProvider.__instance | ||
|
||
def __init__(self, cell_map, motherboard_map, layer_map) : | ||
if EcalDetectorMap.__instance != None : | ||
raise Exception('EcalDetectorMap is a singleton class and should only be created once. You can retrieve the single instance with EcalDetectorMap.get()') | ||
else: | ||
# the name needs to match the conditions object name in EcalDetectorMap.h | ||
super().__init__("EcalDetectorMap","ecal::EcalDetectorMapLoader","Ecal") | ||
self.cell_map = cell_map | ||
self.motherboard_map = motherboard_map | ||
self.layer_map = layer_map | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters