FANDOM


Compile root files on Windows:Edit

  • add VC2010 bin directory (e.g. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin) to PATH
  • run "vcvars32" at the start of each session before entering ROOT
  • enjoy the gain in performance

Interacting with the git repoEdit

If you've not already downloaded the DAQ files, you'll need to clone the git repository:

git clone https://bitbucket.org/psi13/daq.git

Before you start work again, quickly run this from the folder you cloned the repository into; it updates your version to the latest version online:

git pull

When you want to run one of the ROOT files, cd into its directory and run root

Overview of ROOT files and what they doEdit

If you clone the DAQ git repo, you'll find a folder ROOTScripts. Inside are

  • EventViewer
  • makehist

Both scripts use a configuration file pointing to the directory containing the raw binary data files; if you haven't used them before, they will ask you the path to your data files directory.

EventViewer allows you to replay events and view the signal traces.

Usage: Change into ./EventViewer/ directory. Load root. Load the programme in compiled mode with .L EventViewer.cpp+. Call EventViewer with EventViewer(run #), eg EventViewer(330). Cycle through events pressing <Enter>, type s to save that plot as a ROOT file in your datafiles directory, t to skip to a particular event, and b to exit.

This is useful for data quality control and diagnozing questionable behaviour in the integrator.

makehist makes histograms and ROOT files for analysis from the binary data files spat out from the DAQ process. It then saves the histogram inside a ROOT file in your data files directory.

To load it, change into the makehist directory and load root. Load makehist.cpp in compiled mode: .L makehist.cpp+. Call using makehist(run #) etc.

Usage: We added a nice wee help text, you'll find it by calling makehist() with no arguments in the brackets.

Function structure: makehist(run #, nbins, channelsToDisplay, # of pedestalSamples, onlyGoodEvents)

Only the run number is a required argument. If your config file points to the correct directory, makehist will find the .bin file and produce a ROOT tree in the same directory with the same name except .root as a file extension. It's not that interesting though so don't bother opening it.

ChannelsToDisplay has to be a string with containing the channel number(s): for example "01246", or "1". OnlyGoodEvents cleans the histogram of rejected events, defaults to off (0) though. Turn it on with 1. We hope to improve the data analysis portion of makehist to be able to glean at least something from bad or ugly events to utilize all our data. Nevertheless, typically we get ~85% good data.

Next it takes that ROOT file and reads it back in, integrates the signal, removes a pedestal based on the number of samples you tell it (using EventViewer will convince you it's wise to keep the number small), and combines them all into one histogram, saving this histogram to the data files directory as makehist_runnum_timestamp.root.

Under Windows there is also a .exe version which you can run and it asks for the run number and parameters.

Examples:

  • Display energy histogram for run #555: makehist(555).
  • Display histogram for channel 3 of run #520 with 200 bins: makehist(520, 200, "3").
  • Display histogram for channels 0, 4, and 6 of run #123, 1000 bins, 40 pedestal samples: makehist(123, 1000, "046", 40).

The binning size can be changed afterwards because the the *.analysis.root contains all integrated signals and not just the histogram data.

Event CategorizationEdit

makehist and EventViewer automatically detect if events are of questionable quality. There are three loosely-defined categories:

  • Good
  • Bad
  • Ugly

corresponding to how well the event passed the quality checks. If an event fails any test in the following category, it is at least that questionable:

Bad

  • Check if the pedestal from the first n samples is within a set region of the pedestal from the last n samples.
  • Check if the signal is clipped.
  • Check if the values made to make the pedestal fluctuate too much.

Ugly

  • Integrated value of event is less than zero.

If all are passed, the event is "good".

Structure of the ROOT files/TreesEdit

two ROOT files are generated:

  • .root
  • .analysis.root

the first contains all raw data whereas the second one contains a TTree with the following branches:

  • Ch*_Integral: Integrated signals with subtracted pedestal. One of our area units = 1.35 pVs
  • Ch*_Maximum: Maximum of the signal, WITHOUT pedestal subtraction. 16380 = saturated signal!!!
  • Ch*_Pedestal: Pedestal value which was calculated from the mean of the first x samples
  • Ch*_SingalStart: Sample number, where the signal exceeds the pedestal by 10%
  • Ch*_PedestalSTDDEV: Standard deviation of the samples used for pedestal subtraction. Should be << 10
  • Ch*_PedestalDiff: Difference between pedestal at the beginning and the end
  • Ch*_PedestalMaxVariation: Maximum difference of the samples in the pedestal subtraction range to the Ch*_Pedestal value.

The Ch*_SignalStart can be used for a offline coincidence check. Keep in mind, that the number of presamples may vary!


This makes no sense?!1/?1?Edit

Contact/blame Matt & Pirmin if anything isn't clear to you.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.