Skip to content

Commit

Permalink
-add classes to perform SPE fit directly
Browse files Browse the repository at this point in the history
at nominal voltage (config files)
-change SPE fit plotting matplotlib -> pyqtgraph
 to speed up the plots generation
  • Loading branch information
guillaume.grolleron committed Dec 1, 2023
1 parent d63767f commit 1a44d13
Show file tree
Hide file tree
Showing 11 changed files with 305 additions and 57 deletions.
27 changes: 20 additions & 7 deletions src/nectarchain/makers/calibration/gain/FlatFieldSPEMakers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
from ....data.management import DataManagement


__all__ = ["FlatFieldSPENominalNectarCAMCalibrationTool","FlatFieldSPENominalStdNectarCAMCalibrationTool","FlatFieldSPEHHVNectarCAMCalibrationTool","FlatFieldSPEHHVStdNectarCAMCalibrationTool","FlatFieldSPECombinedStdNectarCAMCalibrationTool"]


__all__ = ["FlatFieldSPEHHVNectarCAMCalibrationTool","FlatFieldSPEHHVStdNectarCAMCalibrationTool","FlatFieldSPECombinedStdNectarCAMCalibrationTool"]


class FlatFieldSPEHHVNectarCAMCalibrationTool(GainNectarCAMCalibrationTool):
class FlatFieldSPENominalNectarCAMCalibrationTool(GainNectarCAMCalibrationTool):
name = "FlatFieldSPEHHVNectarCAM"
componentsList = ComponentNameList(
NectarCAMComponent,
Expand Down Expand Up @@ -113,9 +111,15 @@ def _write_container(self, container : Container,index_component : int = 0) -> N
#else :
super()._write_container(container = container,index_component= index_component)

Check warning on line 112 in src/nectarchain/makers/calibration/gain/FlatFieldSPEMakers.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/makers/calibration/gain/FlatFieldSPEMakers.py#L112

Added line #L112 was not covered by tests

class FlatFieldSPEHHVNectarCAMCalibrationTool(FlatFieldSPENominalNectarCAMCalibrationTool):
name = "FlatFieldSPEHHVNectarCAM"
componentsList = ComponentNameList(
NectarCAMComponent,
default_value = ["FlatFieldSingleHHVSPENectarCAMComponent"],
help="List of Component names to be apply, the order will be respected"
).tag(config=True)


class FlatFieldSPEHHVStdNectarCAMCalibrationTool(FlatFieldSPEHHVNectarCAMCalibrationTool):
class FlatFieldSPEHHVStdNectarCAMCalibrationTool(FlatFieldSPENominalNectarCAMCalibrationTool):
name = "FlatFieldSPEHHVStdNectarCAM"
componentsList = ComponentNameList(
NectarCAMComponent,
Expand All @@ -124,7 +128,16 @@ class FlatFieldSPEHHVStdNectarCAMCalibrationTool(FlatFieldSPEHHVNectarCAMCalibra
).tag(config=True)


class FlatFieldSPECombinedStdNectarCAMCalibrationTool(FlatFieldSPEHHVNectarCAMCalibrationTool):
class FlatFieldSPENominalStdNectarCAMCalibrationTool(FlatFieldSPENominalNectarCAMCalibrationTool):
name = "FlatFieldSPENominalStdNectarCAM"
componentsList = ComponentNameList(
NectarCAMComponent,
default_value = ["FlatFieldSingleNominalSPEStdNectarCAMComponent"],
help="List of Component names to be apply, the order will be respected"
).tag(config=True)


class FlatFieldSPECombinedStdNectarCAMCalibrationTool(FlatFieldSPENominalNectarCAMCalibrationTool):
name = "FlatFieldCombinedStddNectarCAM"
componentsList = ComponentNameList(
NectarCAMComponent,
Expand Down
33 changes: 27 additions & 6 deletions src/nectarchain/makers/component/FlatFieldSPEComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
from .chargesComponent import ChargesComponent
from .gainComponent import GainNectarCAMComponent
from .chargesComponent import ChargesComponent
from .spe import SPEHHVStdalgorithm,SPEHHValgorithm,SPECombinedalgorithm
from .spe import SPEHHVStdalgorithm,SPEHHValgorithm,SPECombinedalgorithm,SPEnominalStdalgorithm,SPEnominalalgorithm
from ...utils import ComponentUtils

__all__ = ["FlatFieldSingleHHVSPENectarCAMComponent","FlatFieldSingleHHVSPEStdNectarCAMComponent","FlatFieldCombinedSPEStdNectarCAMComponent"]
__all__ = ["FlatFieldSingleNominalSPEStdNectarCAMComponent","FlatFieldSingleNominalSPENectarCAMComponent","FlatFieldSingleHHVSPENectarCAMComponent","FlatFieldSingleHHVSPEStdNectarCAMComponent","FlatFieldCombinedSPEStdNectarCAMComponent"]

class FlatFieldSingleHHVSPENectarCAMComponent(GainNectarCAMComponent):
SPEfitalgorithm = Unicode("SPEHHValgorithm",
class FlatFieldSingleNominalSPENectarCAMComponent(GainNectarCAMComponent):
SPEfitalgorithm = Unicode("SPEnominalalgorithm",
help = "The Spe fit method to be use",
read_only = True,
).tag(config = True)
Expand Down Expand Up @@ -129,9 +129,27 @@ def finish(self,*args,**kwargs) :



class FlatFieldSingleNominalSPEStdNectarCAMComponent(FlatFieldSingleNominalSPENectarCAMComponent):
SPEfitalgorithm = Unicode("SPEnominalStdalgorithm",
help = "The Spe fit method to be use",
read_only = True,
).tag(config = True)

SubComponents = copy.deepcopy(GainNectarCAMComponent.SubComponents)
SubComponents.default_value = ["ChargesComponent",f"{SPEfitalgorithm.default_value}"]
SubComponents.read_only = True

class FlatFieldSingleHHVSPENectarCAMComponent(FlatFieldSingleNominalSPENectarCAMComponent):
SPEfitalgorithm = Unicode("SPEHHValgorithm",
help = "The Spe fit method to be use",
read_only = True,
).tag(config = True)

SubComponents = copy.deepcopy(GainNectarCAMComponent.SubComponents)
SubComponents.default_value = ["ChargesComponent",f"{SPEfitalgorithm.default_value}"]
SubComponents.read_only = True

class FlatFieldSingleHHVSPEStdNectarCAMComponent(FlatFieldSingleHHVSPENectarCAMComponent):
class FlatFieldSingleHHVSPEStdNectarCAMComponent(FlatFieldSingleNominalSPENectarCAMComponent):
SPEfitalgorithm = Unicode("SPEHHVStdalgorithm",
help = "The Spe fit method to be use",
read_only = True,
Expand All @@ -142,7 +160,10 @@ class FlatFieldSingleHHVSPEStdNectarCAMComponent(FlatFieldSingleHHVSPENectarCAMC
SubComponents.read_only = True


class FlatFieldCombinedSPEStdNectarCAMComponent(FlatFieldSingleHHVSPEStdNectarCAMComponent) :



class FlatFieldCombinedSPEStdNectarCAMComponent(FlatFieldSingleNominalSPENectarCAMComponent) :
SPEfitalgorithm = Unicode("SPECombinedalgorithm",
help = "The Spe fit method to be use",
read_only = True,
Expand Down
2 changes: 2 additions & 0 deletions src/nectarchain/makers/component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"SPECombinedalgorithm",
"FlatFieldSingleHHVSPENectarCAMComponent",
"FlatFieldSingleHHVSPEStdNectarCAMComponent",
"FlatFieldSingleNominalSPENectarCAMComponent",
"FlatFieldSingleNominalSPEStdNectarCAMComponent",
"FlatFieldCombinedSPEStdNectarCAMComponent",
"ChargesComponent",
"WaveformsComponent",
Expand Down
32 changes: 32 additions & 0 deletions src/nectarchain/makers/component/spe/parameters_SPEnominal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
pedestalWidth : {
value : 50,
min : 1,
max : 150
},
luminosity : {
value : 1,
min : 0.01,
max : 5.0
},
pp : {
value : 0.45,
min : 0.2,
max : 0.8
},
resolution : {
value : 0.5,
min : 0.3,
max : 0.7
},
n : {
value : 0.697,
min : 0.5,
max : 0.9
},
mean : {
value : 50,
min : 10,
max : 200
}
}
32 changes: 32 additions & 0 deletions src/nectarchain/makers/component/spe/parameters_SPEnominalStd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
pedestalWidth : {
value : 50,
min : 1,
max : 150
},
luminosity : {
value : 1,
min : 0.01,
max : 5.0
},
pp : {
value : 0.45,
min : .NAN,
max : .NAN
},
resolution : {
value : 0.5,
min : 0.3,
max : 0.7
},
n : {
value : 0.697,
min : .NAN,
max : .NAN
},
mean : {
value : 50,
min : 10,
max : 200
}
}
Loading

0 comments on commit 1a44d13

Please sign in to comment.