cms-gem-daq-project / gem-plotting-tools

Repository for GEM commissioning plotting tools
GNU General Public License v3.0
1 stars 26 forks source link

WIP: Create anaSbitReadout.py #161

Closed fraivone closed 5 years ago

fraivone commented 5 years ago

This script unpacks and plots data acquired with sbitReadout.py. The outputs are saved in inputfolder/sbitReadOut/

IMPORTANT

  1. the function getMapping in gempython/gemplotting/utils/anautilities needs to be modified. At the moment it works with VFAT2 map, in which channel number starts from 1. In order to use the script, I modified getMapping in my virtual environment as suggested here https://mattermost.web.cern.ch/cms-gem-daq/pl/y6r6cqn1rbfa7m38iwn1hb9t5e
  2. in the folder gempython/gemplotting/mapping/ there must be located the files named shortChannelMap_VFAT3-HV3b-V1_VFAT3-HV3b-V2.txt longChannelMap_VFAT3-HV3b-V1_VFAT3-HV3b-V2.txt, which are the outputs of Louis's pull request https://github.com/cms-gem-daq-project/gem-plotting-tools/pull/134/files#diff-5a657d72aa6d1b867b7000684423a4b1

    USAGE EXAMPLE

    anaSbitReadout -i folder_containing_sbitReadout_outputs/ -t short

    FURTHER DEVELOPMENTS

  3. Default GEBType is long, so the user may run the script without specifying it while working with a short GEB. This will cause a bad string <-> channel mapping
  4. The path to the .txt file with the channel <-> string mapping could be provided as input; it would be easier to use different mappings
  5. An option to mask noisy channel or whole vfat could be useful

    KNOWN ISSUES

    • While loading the .dat file, ROOT returns this warning:
      Warning in <TTree::ReadStream>: Couldn t read formatted data in "evtNum/i:sbitClusterData0/i:sbitClusterData1/i:sbitClusterData2/i:sbitClusterData3/i:sbitClusterData4/i:sbitClusterData5/i:sbitClusterData6/i:sbitClusterData7/i" for branch evtNum on line 1; ignoring line

      I think it's cause ROOT doesn't expect to find headers in the .dat files opened with the ReadFile function. At the moment I don't know which is the simplest way to solve this (changing sbitReadout.py? changing the .dat files in this script?).

    • the parser is imported from gempython/gemplotting/utils/anaoptions, so it contains more options than actually implemented. This is a problem for the consistency of the help menu. At the moment I don't know how to show only the used options in the help menu

Types of changes

Screenshots (if appropriate):

Example of output in case of a Cd109 source placed underneath VFAT7 immagine

Checklist:

bdorney commented 5 years ago

This file won't be built by the package right now since anaSbitReadout.py isn't in the list of files in the Makefile but anaSBit*.py is. Rename this file via:

git mv anaSbitReadout.py anaSBitReadout.py

this will then be automatically picked up by the Makefile.

bdorney commented 5 years ago

Why have you modified basically every function in anautilties.py? Additionally many of these changes are needless and unnecessary spacing changes? You're PR should only be modifying those files/functions that are actually related to the proposed feature implementation.

bdorney commented 5 years ago

Superceded by https://github.com/cms-gem-daq-project/gem-plotting-tools/pull/185