itk:extracting_channels_from_root_files
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
itk:extracting_channels_from_root_files [2016/09/15 18:16] – mbeydler | itk:extracting_channels_from_root_files [2016/09/15 20:04] (current) – mbeydler | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Extracting channels from ROOT files ====== | ====== Extracting channels from ROOT files ====== | ||
- | Overview: | + | Overview: |
- | Instructions: | + | Instructions: |
+ | * Download the package using the command | ||
+ | <code bash> | ||
+ | wget https:// | ||
+ | </ | ||
+ | * Once you have the package, make sure that you have already installed ROOT or can open the ROOT file from your test. | ||
+ | * Open the script '' | ||
+ | * Input your ROOT file that contains the histogram from the test, the name of the histogram, and the maximum number of hits possible in all of the channels. | ||
+ | * Save script. | ||
+ | * Run script using '' | ||
+ | * The information will be printed to the command line. | ||
Script: | Script: | ||
+ | <code python> #This script allows the user to see the specific ouput for specific pixels on different electronic tests | ||
+ | from ROOT import * | ||
- | '' | + | |
- | < | + | |
- | from ROOT import * | + | |
+ | maxValBin = 50 #This is the corresponding maximum hits for the analog test. | ||
- | #The user must input the root file, histogram, and the maximum number for bin content | + | |
- | fileName = "" | + | test = TFile.Open(fileName) |
- | histogramName = "" | + | h = test.Get(histogramName) |
- | maxValBin = 50 | + | h.Draw(" |
- | + | for i in range(1, h.GetNbinsX()): | |
- | #Do not modify the rest of the code, it should work given what the user has place above. | + | for j in range(1, h.GetNbinsY()): |
- | test = TFile.Open(fileName) | + | binContent = h.GetBinContent(i, |
- | h = test.Get(histogramName) | + | if binContent < maxValBin: |
- | h.Draw(" | + | print " |
- | + | print "Pixel column (x): ", i | |
- | for i in range(1, h.GetNbinsX()): | + | print "Pixel row (y): ", j |
- | for j in range(1, h.GetNbinsY()): | + | print " |
- | binContent = h.GetBinContent(i, | + | print " |
- | if binContent < maxValBin: | + | |
- | print " | + | |
- | print "Pixel column (x): ", i | + | |
- | print "Pixel row (y): ", j | + | |
- | print " | + | |
- | print " | + | |
- | + | ||
- | </ | + | |
- | '' | + |
itk/extracting_channels_from_root_files.1473963378.txt.gz · Last modified: 2016/09/15 18:16 by mbeydler