Overwatch Subsystem (Detector) Package (overwatch.processing.detectors)

See also the full reference on the plugin and trending systems. The available modules are listed below.

overwatch.processing.detectors.EMC

EMC detector specific functionality.

The EMCal has a wide variety of monitoring functions, taking broad advantage of the Overwatch detector plug-in system. These functions allow for enhanced data extraction, as well as improved presentation.

overwatch.processing.detectors.EMC.addEnergyAxisToPatches(subsystem, hist, processingOptions, **kwargs)[source]

Processing function to add an additional axis to patch ADC amplitude spectra showing the conversion from ADC counts to energy.

This function should apply for histograms in which the name matches the rules {EMCal,DCal}(Max)PatchAmp. It creates a new TGaxis that shows the ADC to Energy conversion. It then draws it on selected histogram at the top of the plot.

Note

This function implicitly assumes that there is already a canvas created. Since the histogramContainer already contains a canvas, this is a reasonable assumption. It is explicitly noted because the dependence is only implicit.

Note

The ownership of TGaxis is given to ROOT to ensure that it continues to exist outside of the function scope.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current canvas is modified.

overwatch.processing.detectors.EMC.addTRUGrid(subsystem, hist)[source]

Add a grid of lines representing the TRU regions.

By making this grid available, it becomes extremely easy to identify and localized problems that depend on a particular TRU. The grid is drawn on the current canvas.

Note

This function implicitly assumes that there is already a canvas created. Since the histogramContainer already contains a canvas, this is a reasonable assumption. It is explicitly noted because the dependence is only implicit.

Warning

The grid is created by allocating a large number of TLine objects which are owned by ROOT, but not by python. Although this hasn’t been observed to be a problem, this could in principle lead to memory problems.

Parameters:
Returns:

None. The current canvas is modified.

overwatch.processing.detectors.EMC.cellIDVsAmplitudeHighGain(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cell ID vs amplitude for high gain cells.

Set log x and z for a clearer visualization.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current canvas is modified.

overwatch.processing.detectors.EMC.cellIDVsAmplitudeLabels(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cell ID vs amplitude.

Here, we just set the axis labels.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist is modified.

overwatch.processing.detectors.EMC.cellIDVsTimeHighGain(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cell ID vs time for high gain cells.

Set log x and z for a clearer visualization.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current canvas is modified.

overwatch.processing.detectors.EMC.cellIDVsTimeLabels(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cell ID vs time.

Here, we just set the axis labels.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist is modified.

overwatch.processing.detectors.EMC.checkForEMCHistStack(subsystem, histName, skipList, selector)[source]

Check for and create histograms stacks from existing histograms.

This is a helper function for stacking histograms which plot the same quantity, but are plotted separately for the EMCal and DCal. It allows both to be plotted on the same canvas. It assumes that there will be corresponding EMCal and DCal histograms for a particular hist stack.

Note

By including “EMCal” in the selector string, we can ensure that this function will only create the stack when the EMCal hist comes up. If the DCal hist comes up first, we will skip over it and then it will be removed from subsystem.histsAvailable when the EMCal hist is processed and the hist stack is created.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • histName (str) – Name of the histogram currently being considered for inclusion in a histogram stack.
  • skipList (list) – List of histogram names which have already been handled and therefore should not be stored later in subsystem.histsAvailable.
  • selector (str) – Substring which should be used to identify histograms to add to a stack.
Returns:

True if the histogram was added to the histogram stack.

Return type:

bool

overwatch.processing.detectors.EMC.checkForOutliers(hist)[source]

Checks for outliers in the provided histogram.

Outliers are calculated by looking at the standard deviation. See: `hasSignalOutlier(..) for further information. This function is mainly a proof of concept, but could become more flexible with a bit more work.

Note

This function will add a large TLegend to the histogram which notes the mean and the number of outliers. It will also display the recalculated mean excluding the outlier(s). This TLegend is owned by ROOT.

Note

This function isn’t currently utilized by the EMC, but it is kept as proof of concept for more complex functionality.

Parameters:hist (TH1) – The histogram to be processed.
Returns:None. The current canvas is modified.
overwatch.processing.detectors.EMC.clusterEnergy(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cluster energy.

Set the axis labels and log y for a clearer visualization.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist and canvas are modified.

overwatch.processing.detectors.EMC.clusterEnergyVsNumberOfCells(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cluster energy vs number of cells per cluster.

We set the axis labels and set log x and z for a better representation.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist and canvas are modified.

overwatch.processing.detectors.EMC.clusterEnergyVsTime(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cluster energy vs time.

Set the axis labels.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist and canvas are modified.

overwatch.processing.detectors.EMC.clusterEtaVsPhi(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cluster eta vs phi.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None.

overwatch.processing.detectors.EMC.clusterInvariantMass(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cluster invariant mass.

Set axis labels.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist is modified.

overwatch.processing.detectors.EMC.clusterShape(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for cluster shape (M02 and M20).

Set the axis labels and log y for a clearer visualization.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist and canvas are modified.

overwatch.processing.detectors.EMC.createEMCHistogramGroups(subsystem)[source]

Create histogram groups for the EMCal subsystem.

This functions sorts the histograms into categories for better presentation based on their names. The names are determined by those specified for each hist in the subsystem component on the HLT. Assignments are made by the looking for substrings specified in the hist groups in the hist names. Note that each histogram will be categorized once, so the first entry will take all histograms which match. Thus, histograms should be ordered in such that the most inclusive are specified last.

Super module differentiated groups are handled first since they would otherwise populate in the more general histogram group corresponding to the same plot. Generally, hists are sorted as follows:

  • Trigger type: GA vs JE, low vs high threshold.
  • L0 trigger information.
  • Background (ie background subtraction information, luminosity, etc).
  • Fast OR information.
  • Other EMC information (number of events, etc).
  • Catch all others.

Note

Since the EMCal usually has a corresponding receiver and therefore a file source, we include a catch all group at the end. However, it is protected such that it will only be added for a particular run if there is actually an EMCal file. This avoids collecting a bunch of unrelated hists in the case that there isn’t a file.

Parameters:subsystem (subsystemContainer) – The subsystem for the current run.
Returns:None. Histogram groups are stored in histGroups list of the subsystemContainer.
overwatch.processing.detectors.EMC.createEMCHistogramStacks(subsystem)[source]

Create histogram stacks from the existing histograms in the EMCal subsystem.

Note that although this doesn’t necessarily have to be the case, we decided for this function to assume that histograms will only be assigned to one stack.

Note

This function is responsible for moving histogram containers from subsystem.histsInFile to subsystem.histsAvailable.

Parameters:subsystem (subsystemContainer) – The subsystem for the current run.
Returns:None. However, see the note above for the side effects.
overwatch.processing.detectors.EMC.edgePosOptions(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for patch edge positions histograms.

It scales the histogram by number of events as as appropriate based on the EMC processing options, as well as adding a TRU grid.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None.

overwatch.processing.detectors.EMC.fastOROptions(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for Fast OR based histograms.

FastOR histograms come in two variates:

  • 1D with cell ID vs amplitude.
  • 2D with cell amplitude vs row, column position.

For both histogram types, it scales the histogram by number of events as as appropriate based on the EMC processing options.

For the 1D histograms, it can look for hot channels based on a threshold set in the processing options. For any channels that are above this threshold, they cell IDs are stored in the histogramContainer. This allows for the information for be displayed in the web app for easy reference and action. For applying the threshold, it is strongly recommended to scale by the number of events (which is the default for the EMC subsystem, but can be modified during time slices). Note that the threshold values passed in from the web app are scaled down by 1e-3 due to the usually small number of counts exception in hot channels, as well as the difficulty in displaying such small numbers.

For the 2D histograms, it also adds a TRU grid.

Warning

The hot channel thresholds require further tuning. The current (Aug 2018) values are mostly set as a proof on concept.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None.

overwatch.processing.detectors.EMC.feeSMOptions(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for Front End Electronics (FEE) related histograms.

It sets the Z axis to log, as well as restricting the viewable range to more useful values.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None.

overwatch.processing.detectors.EMC.findFunctionsForEMCHistogram(subsystem, hist, **kwargs)[source]

Find processing functions for EMC histograms based on their names.

This plug-in function steers the histograms to the right set of processing functions. These functions will then be executed later when the histograms are actually processed. This function only executes when the subsystem is created at the start of each new run. By doing so, we can minimize inefficient string comparison each time we process a file in the same run.

The processing functions which are assigned here include those related to the processing of:

  • General EMC histogram options which require the underlying histogram and canvas.
  • General histograms which are split out by super module.
  • Front end electronics (FEE) oriented histograms.
  • Patch edge position oriented histogram.
  • Fast OR oriented histograms.
  • Patch ADC amplitude oriented histograms (both current and legacy).

See the particular functions for precisely which options are set.

Note

The rules to select each particular set of histograms have become fairly complicated due to the variation of histogram names depending on collision system, changing histograms over time, etc. Each group has a fairly detailed describe either through comments or the code itself. Due to this complexity, these selections should be modified with care!

Note

The histogram underlying the histogramContainer which is passed in is not yet available for this function. Only information which is stored directly in histogramContainer fields should be used when classifying them and assigning functions.

Parameters:
Returns:

None. The hist is modified.

overwatch.processing.detectors.EMC.generalClusterOptions(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for all cluster histograms.

Note

We only remove the cluster name prefix to ensure that the prefix is available to help classify it properly.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist and canvas are modified.

overwatch.processing.detectors.EMC.generalOptionsRequiringUnderlyingObjects(subsystem, hist, processingOptions, **kwargs)[source]

Processing function where general histograms options that require the underlying histogram and/or canvas are set.

The options specified include:

  • Showing histogram stats if running in debug mode.
  • Disabling display of the title for EMC histograms (the title is _not_ set to empty string to ensure that it is still available in the future).
  • Set logz for all TH2 histograms.

The canvas is also updated when we are finished to ensure that all options are applied successfully. This may not actually be required, but it also doesn’t hurt anything.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current histogram and canvas are modified.

overwatch.processing.detectors.EMC.getTrendingObjectInfo()[source]

Function create simple data objects - TrendingInfo, from which will be created TrendingObject.

Format of TrendingInfo constructor arguments: name - using in database to map name to trendingObject, must be unique desc - verbose description of trendingObject, it is displayed on generated histograms histogramNames - list of histogram names from which trendingObject depends trendingClass - concrete class of abstract class TrendingObject

It is possible to catch TrendingInfoException and continue without invalid object (for example when TrendingInfo have unavailable histogram [Not implemented in current version])
Returns:List of TrendingInfo objects
Return type:list
overwatch.processing.detectors.EMC.hasSignalOutlier(hist)[source]

Helper function to actually find the outlier from a signal histogram.

Find mean bin amplitude and standard deviation, remove outliers beyond a particular number of standard deviations, and then recalculate the mean and standard deviation. Works for both TH1 and TH2 (but note that it computes outlier based on bin content, which may not be desirable for TH1; in that case mean and std dev can easily be applied).

Note

This function isn’t currently utilized by the EMC, but it is kept as proof of concept for more complex functionality.

Parameters:hist (TH1) – The histogram to be processed.
Returns:
[nOutliers, mean, stdev, newMean, newStdev] where nOutliers (int) is the number of outliers,
mean (float) and stdev (float) are the mean and standard deviation, respectively, of the given histogram, and newMean (float) and newStdev (float) are the mean and standard deviation after excluding the outlier(s).
Return type:list
overwatch.processing.detectors.EMC.labelSupermodules(hist)[source]

Set of the title of each histogram which is broken out by super module (SM) to the SM number.

The super module is determined by extracting it out from the end of the histogram name. In particular, the name is expected to end in _SM10 for super module 10.

Parameters:hist (histogramContainer) – The histogram to be processed.
Returns:None. The current histogram and canvas are modified.
overwatch.processing.detectors.EMC.numberOfCellsPerCluster(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for the number of cells per cluster.

The y-axis should be plotted as log, and we set the axis labels.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist and canvas are modified.

overwatch.processing.detectors.EMC.numberOfClustersVsV0(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for number of clusters vs V0.

Set the axis range and labels, as well as log z for a clearer visualization.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist and canvas are modified.

overwatch.processing.detectors.EMC.patchAmpOptions(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for patch ADC amplitude spectra histograms.

This function supersedes properlyPlotPatchSpectra() and utilizes addEnergyAxisToPatches(). It plots the spectra on a log y axis and adds a grid for easier visualization. In the case of a histogram stack containing the EMCal and DCal plots, it is specifically equipped to:

  • Plot the EMCal as red and the DCal as blue.
  • Provide a legend.
  • Scale the histogram by number of events as as appropriate based on the processing options.
  • Add an additional x axis which converts the ADC counts of the patch spectra to energy, thereby displaying the spectra in a more familiar unit.
Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None.

overwatch.processing.detectors.EMC.properlyPlotPatchSpectra(subsystem, hist, processingOptions, **kwargs)[source]

Processing function to plot patch ADC amplitude spectra with logy and on a grid.

Since we are plotting spectra, a log y-axis is helpful for presentation. The grid also helps with readability. This function should apply for histograms in which the name matches the rules {EMCal,DCal}(Max)Patch{Energy,Amp}.

This function has been superseded by patchAmpOptions() but is kept for processing legacy histograms.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current canvas is modified.

overwatch.processing.detectors.EMC.setEMCHistogramOptions(subsystem)[source]

Set general EMCal histogram options.

In particular, these options should apply to all histograms, or at least a broad selection of them. The list of histograms are accessed through the histsAvailable field of the subsystemContainer. Canvas options and additional histogram specific options must be set later.

Here, we improve the presentation quality of the histograms by setting the pretty name to be presented without the shared name “EMC” prefix (which is contained in the first 12 characters), set any TH2 derived hists to draw with colz. We also set all histograms to be scaled by the number of events collected.

Note

The underlying hists are not yet available for this function. Only information which is stored directly in histogramContainer fields should be used.

Parameters:subsystem (subsystemContainer) – The subsystem for the current run.
Returns:None. Histogram groups are stored in appropriate field of the subsystemContainer.
overwatch.processing.detectors.EMC.smOptions(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for histograms which are broken out by super module (SM).

It scales the histogram by number of events as as appropriate based on the EMC processing options, as well as labeling each histogram by its SM number.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None.

overwatch.processing.detectors.EMC.sortSMsInPhysicalOrder(histList, sortKey)[source]

Sort the SMs according to their physical order in which they are constructed.

This is a helper function solely used for displaying EMCal and DCal hists in a particularly convenient order. The order is bottom-top, left-right. It is as follows

EMCal:
10 11
8  9
6  7
4  5
2  3
0  1

DCal:
18 19
16 17
14 15
12 13

This function will extract a prefix (sortKey) from the histogram names and then sort them according to the reminaing string. As an example,

>>> histList = ["prefix2", "prefix1"]
>>> sortKey = "prefix"
>>> histList = sortSMsInPhysicalOrder(histList = histList, sortKey = sortKey)
>>> histList
["prefix1", "prefix2"]

Initially, it sorts the hists into reverse order, and then it performs the SM oriented sort as described above. As a practical matter, this function will usually be called via `sortSMsInPhysicalOrder(histList = group.histList, sortKey = group.plotInGridSelectionPattern), taking advantage of the selection pattern stored in the group.

Note

Since the numbers on which we sort are in strings, the initial sort into reverse order is performed carefully, such that the output is 19, 18, …, (as expected), rather than 9, 8, 7, …, 19, 18, …, 10, 1.

Note

This function isn’t currently utilized by the EMC, but it is kept as proof of concept for more complex functionality.

Parameters:
  • histList (list) – List of histogram names which contain the sort key. The sort key will be used to sort them according to the proper EMCal order.
  • sortKey (str) – Substring to be removed from the histograms. The remaining str should then be the substring which will be used to sort the hists.
Returns:

Contains the histogram names sorted according to the scheme specified above.

Return type:

list

overwatch.processing.detectors.HLT

HLT subsystem specific functions.

These functions apply to histograms received specifically through the HLT subsystem receiver (ie. not every single histogram that is sent from the HLT to the various subsystem receivers).

This currently serves as a catch all for unsorted histograms. No processing functions are applied beyond basic modification of the presentation.

overwatch.processing.detectors.HLT.findFunctionsForHLTHistogram(subsystem, hist, **kwargs)[source]

Determine which processing functions to apply to which HLT histograms.

Functions should be added to the histogramContainer.functionsToApply list. This allows those functions to applied repeatedly without having to perform the lookup each time a run is processed.

Parameters:
Returns:

None

overwatch.processing.detectors.HLT.generalHLTOptions(subsystem, hist, processingOptions, **kwargs)[source]

Specify general HLT histogram options.

Parameters:
  • subsystem (subsystemContainer) – The subsystem being processed.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Implemented by the subsystem to note options used during standard processing. Keys are names of options, while values are the corresponding option values.
  • **kwargs (dict) – Reserved for future arguments.
Returns:

None

overwatch.processing.detectors.HLT.getTrendingObjectInfo()[source]

Function create simple data objects - TrendingInfo, from which will be created TrendingObject.

Format of TrendingInfo constructor arguments: name - using in database to map name to trendingObject, must be unique desc - verbose description of trendingObject, it is displayed on generated histograms histogramNames - list of histogram names from which trendingObject depends trendingClass - concrete class of abstract class TrendingObject

It is possible to catch TrendingInfoException and continue without invalid object (for example when TrendingInfo have unavailable histogram [Not implemented in current version])
Returns:List of TrendingInfo objects
Return type:list

overwatch.processing.detectors.TPC

TPC subsystem specific functionality.

The TPC has a variety of monitoring and trending functionality.

overwatch.processing.detectors.TPC.aSideProjectToXZ(subsystem, hist, processingOptions)[source]

Projection function to provide a TPC histogram onto the A side.

Particularly built to project the DCAz and DCAr vs Phi histograms onto each readout side. This function is a simple wrapper which specifies projecting onto the A side. The actual projection work is delegated to projectToXZ().

Parameters:
  • subsystem (subsystemContainer) – Subsystem which contains the projected histogram.
  • hist (histogramContainer) – Histogram container corresponding to the projected histogram. When this function is called, it contains the histogram to project from, so the hist to project from can be retrieved via hist.hist.
  • processingOptions (dict) – Dictionary of processing options for the given subsystem.
  • kwargs (dict) – Additional possible future arguments.
Returns:

The projected histogram

Return type:

ROOT.TH1

overwatch.processing.detectors.TPC.cSideProjectToXZ(subsystem, hist, processingOptions)[source]

Projection function to provide a TPC histogram onto the C side.

Particularly built to project the DCAz and DCAr vs Phi histograms onto each readout side. This function is a simple wrapper which specifies projecting onto the C side. The actual projection work is delegated to projectToXZ().

Parameters:
  • subsystem (subsystemContainer) – Subsystem which contains the projected histogram.
  • hist (histogramContainer) – Histogram container corresponding to the projected histogram. When this function is called, it contains the histogram to project from, so the hist to project from can be retrieved via hist.hist.
  • processingOptions (dict) – Dictionary of processing options for the given subsystem.
  • kwargs (dict) – Additional possible future arguments.
Returns:

The projected histogram

Return type:

ROOT.TH1

overwatch.processing.detectors.TPC.createAdditionalTPCHistograms(subsystem)[source]

Create new TPC histograms by defining new histogram containers and their projection functions.

New histogram containers for the given subsystem should be created here. The projection function which will be used to project from an existing histogram should also be assigned here. The actual histograms will be created later when the projection function is executed.

Here, we define a set of histograms related to:

  • The DCAr and DCAz vs phi for positive and negative tracks separately. In particular, we project those histograms to the A side and the C side to determine their performance at the readouts on each side.
  • The DCAz vs phi for all tracks. We restrict the eta and pt ranges. This is just as an example.
  • The eta, phi and pT projection histograms for positive and negative tracks.

Note

Older histograms has an additional “TPCQA ” in front of their names (ie. “TPCQA TPCQA/h_tpc_track_pos_recvertex_3_5_6”). The name was changed in the TPC HLT component. For simplicity, we only consider the current name (ie. without the extra “TPCQA “).

Parameters:subsystem (subsystemContainer) – Subsystem for which the additional histograms are to be created.
Returns:None. Newly created histograms are added to subsystemContainer.histsAvailable.
overwatch.processing.detectors.TPC.createTPCHistogramGroups(subsystem)[source]

Create histogram groups for the TPC subsystem.

This functions sorts the histograms into categories for better presentation based on their names. The names are determined by those specified for each hist in the subsystem component on the HLT. Assignments are made by the looking for substrings specified in the hist groups in the hist names. Note that each histogram will be categorized once, so the first entry will take all histograms which match. Thus, histograms should be ordered in such that the most inclusive are specified last.

Generally, hists are sorted as follows:

  • Cluster related histograms
  • Match tracking efficiency
  • Vertex position

However, as of August 2018, the above list isn’t comprehensive due to some difficulty in deciphering the histogram names! This can be resolved by a TPC expert.

Note

Since the TPC usually has a corresponding receiver and therefore a file source, we include a catch all group at the end. However, it is protected such that it will only be added for a particular run if there is actually an TPC file. This avoids collecting a bunch of unrelated hists in the case that there isn’t a file.

Parameters:subsystem (subsystemContainer) – The subsystem for the current run.
Returns:None. Histogram groups are stored in histGroups list of the subsystemContainer.
overwatch.processing.detectors.TPC.findFunctionsForTPCHistogram(subsystem, hist)[source]

Find processing functions for TPC histograms based on their names.

This plug-in function steers the histograms to the right set of processing functions. These functions will then be executed later when the histograms are actually processed. This function only executes when the subsystem is created at the start of each new run. By doing so, we can minimize inefficient string comparison each time we process a file in the same run.

The processing functions which are assigned here include those related to the processing of:

  • General TPC histogram options which require the underlying histogram and canvas.

Note

The histogram underlying the histogramContainer which is passed in is not yet available for this function. Only information which is stored directly in histogramContainer fields should be used when classifying them and assigning functions.

Parameters:
Returns:

None. The hist is modified.

overwatch.processing.detectors.TPC.generalOptions(subsystem, hist, processingOptions)[source]

Processing function where general histograms options that require the underlying histogram and/or canvas are set.

Currently, it ensures that the histogram title is always shown.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current histogram and canvas are modified.

overwatch.processing.detectors.TPC.getTrendingObjectInfo()[source]

Function create simple data objects - TrendingInfo, from which will be created TrendingObject.

Format of TrendingInfo constructor arguments: name - using in database to map name to trendingObject, must be unique desc - verbose description of trendingObject, it is displayed on generated histograms histogramNames - list of histogram names from which trendingObject depends trendingClass - concrete class of abstract class TrendingObject

It is possible to catch TrendingInfoException and continue without invalid object (for example when TrendingInfo have unavailable histogram [Not implemented in current version])
Returns:List of TrendingInfo objects
Return type:list
overwatch.processing.detectors.TPC.projectTo1D(subsystem, hist, processingOptions)[source]

Project a given TH3 histogram onto the Z or Y axis.

This function was built to get P_T or eta histograms for positive and negative tracks.

Parameters:
  • subsystem (subsystemContainer) – Subsystem which contains the projected histogram.
  • hist (histogramContainer) – Histogram container corresponding to the projected histogram. When this function is called, it contains the histogram to project from, so the hist to project from can be retrieved via hist.hist.
  • processingOptions (dict) – Dictionary of processing options for the given subsystem.
Returns:

The projected histogram

Return type:

ROOT.TH1

overwatch.processing.detectors.TPC.projectToXZ(subsystem, hist, processingOptions, aSide)[source]

Project a given TH3 histogram onto the XZ axis.

This function was particularly built for projecting DCAz and DCAr vs Phi TH3 histograms, where we expect the y axis to correspond to the eta direction. Given this convention, we can restrict the y axis to select objects which are on the A side or the C side of the TPC.

Parameters:
  • subsystem (subsystemContainer) – Subsystem which contains the projected histogram.
  • hist (histogramContainer) – Histogram container corresponding to the projected histogram. When this function is called, it contains the histogram to project from, so the hist to project from can be retrieved via hist.hist.
  • processingOptions (dict) – Dictionary of processing options for the given subsystem.
  • aSide (bool) – True if we should project to the A side. Otherwise, we will project to the C side.
Returns:

The projected histogram

Return type:

ROOT.TH1

overwatch.processing.detectors.TPC.projectToYZ(subsystem, hist, processingOptions)[source]

Project a given TH3 histogram onto the YZ axis.

This function was built to get an eta vs. phi histograms for positive and negative tracks.

Parameters:
  • subsystem (subsystemContainer) – Subsystem which contains the projected histogram.
  • hist (histogramContainer) – Histogram container corresponding to the projected histogram. When this function is called, it contains the histogram to project from, so the hist to project from can be retrieved via hist.hist.
  • processingOptions (dict) – Dictionary of processing options for the given subsystem.
Returns:

The projected histogram

Return type:

ROOT.TH2

overwatch.processing.detectors.TPC.ptSpectra(subsystem, hist, processingOptions, **kwargs)[source]

Processing function for pT spectra.

Set the y axis labels (x is already set) and log y for a clearer visualization.

Parameters:
  • subsystem (subsystemContainer) – The subsystem for the current run.
  • hist (histogramContainer) – The histogram being processed.
  • processingOptions (dict) – Processing options to be used in this function. It may be the same as the options specified in the subsystem, but it doesn’t need to be, such as in the case of processing for time slices.
  • **kwargs (dict) – Reserved for future use.
Returns:

None. The current hist and canvas are modified.

overwatch.processing.detectors.TPC.restrictInclusiveDCAzVsPhiPtEtaRangeAndProjectTo1D(subsystem, hist, processingOptions, **kwargs)[source]

Projection function to restrict the pt and eta ranges of the DCAz vs Phi inclusive histogram.

This function was built as an example, so the details may not be entirely correct or ideal.

Parameters:
  • subsystem (subsystemContainer) – Subsystem which contains the projected histogram.
  • hist (histogramContainer) – Histogram container corresponding to the projected histogram. When this function is called, it contains the histogram to project from, so the hist to project from can be retrieved via hist.hist.
  • processingOptions (dict) – Dictionary of processing options for the given subsystem.
  • kwargs (dict) – Additional possible future arguments.
Returns:

The projected histogram

Return type:

ROOT.TH1