Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Refactoring of anaUltraScurve.py and additional output distributions #75

Merged
merged 42 commits into from
Mar 28, 2018

Conversation

bdorney
Copy link
Contributor

@bdorney bdorney commented Mar 23, 2018

Description

Refactoring of anaUltraScurve.py with updates/additions to supporting tools.

All distributions created will now be in fC. The output TFile will have relevant s-curve parameters stored in fC. The default behavior is to use the vfat2 VCAL to fC conversion that has been hard coded for some time. The user can supply an external text file which specifies the conversion between the CAL DAC (either vfat2 or vfat3) to fC using the --calFile argument. The expected format of this file is shown as:

vfatN/I:slope/F:intercept/F
0   0.2692  -2.629748
1   0.238106    -2.65316
2   0.2532  -2.193826
3   0.276783    -2.477547
...
5   1.000000    0.000000    
...
...

If one prefers to stick in terms of DAC units simply supply a slope of 1.0 with an intercept of 0.0 as in the above example (e.g. a chip where the calibration is not known or was not possible).

The fitting class ScanDataFitter is now also capable of working with quantities in terms of fC but the default behavior of this class will be in DAC units to preserve compatibility with trimChamber.py. Supplying additional arguments at construction (as is done now in anaUltraScurve.py) will enable the fitter to parse input information, and return output results, in terms of fC.

Additionally a series of new distributions have been added:

  1. ScurveMeanSummary.png, shows the distribution of s-curve mean positions (after fitting) for all VFATs in the standard grid layout,
  2. ScurveWidthSummary.png, shows the distribution of s-curve width positions (after fitting) for all VFATs in the standard grid layout.
  3. scurves_vfatX, a TCanvas for VFATX showing all 1D scurves on the same TPad for a given vfat (as shown by the VFAT3 production team in a recent DAQ meeting)
  4. scurvesNoMaskedChan_vfatX, as item 3 but omitting curves from masked channels.
  5. canvScurveFits_vfatX, as item 4 but instead here the fitted TF1 objects are plotted.

Additionally the TObjects used in items 1 & 2 are also stored in the output TFile in a TDirectory VFATX where X is the VFAT position. Items 3-5 are available in the output TFile but are not stored as images in the output directory.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context

Originally wanted to add a few distributions to the analysis routine but the code was pretty hacked together and it was unclear where certain things defined or what units they were in (e.g. DAC units or fC).

Address comments about unnecessary sub-process calls that were brought up here

How Has This Been Tested?

Extensive analysis and testing.

Screenshots (if appropriate):

Example TFile output structure now (note the TTree structure has not changed):
screen shot 2018-03-23 at 20 37 19

Summary.png:
screen shot 2018-03-23 at 20 38 30

PrunedSummary.png:
screen shot 2018-03-23 at 20 39 11

fitSumnmary.png:
screen shot 2018-03-23 at 20 39 42

ScurveMeanSummary.png:
screen shot 2018-03-23 at 20 44 06

ScurveWidthSummary.png:
screen shot 2018-03-23 at 20 44 44

TCanvas scurves_vfat0:
screen shot 2018-03-23 at 20 45 39

TCanvas scurvesNoMaskedChan_vfat0
screen shot 2018-03-23 at 20 45 55

TCanvas canvScurveFits_vfat0
screen shot 2018-03-23 at 20 46 10

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Brian Dorney added 30 commits March 22, 2018 11:30
…ore from the scanFuncs parameter and be less ambiguous
…f SaveSummary out of main in anaUltraScurve.py
@bdorney
Copy link
Contributor Author

bdorney commented Mar 26, 2018

Will also correctly assign error bars for scurve plots using the:

  • TH1::SetBinContent(), and
  • TH1::SetBinError()

methods; therefore partially resolving #61 for the case of anaUltraScurve.py.

@bdorney bdorney merged commit 75ca966 into cms-gem-daq-project:develop Mar 28, 2018
@bdorney bdorney deleted the feature_refactoringSCurve branch March 28, 2018 12:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant