Berkeley Nuclear Data Software
Build

This folder should build independent of all other elements of the repos

Create a build folder outside of this directory call cmake from the build folder call make to compile the library ie from the top level of the repo

mkdir anaBuild
cd anaBuild
cmake ../analysis
make

should produce the following files libAnalysisLib.so libAnalysisLib.rootmap libAnalysisLib_rdict.pcm

To use the classes in root, these files need to be present in the directory that root is launched from or loaded using the relative diretory

CloverGainDriftAna

This class is setup to generate plots of clover gain vs wall clock time You will need files generated by the buildCloverWallTimeTree.exe in the DataProcessingAndAnalysis build.

Inspection

To check if the clover gain is stable.

  1. Launch root and create an object of the class
    root
    .L libAnalysisLib.so
    NSDAna::CloverGainDriftAna ana;
  2. Load the files you are interested in checking the gain drift over
ana.addFile("youFile1.root");
ana.addFile("youFile2.root");
.
.
.
ana.addFile("youFileN.root")
  1. Set the start and stop date of your experiement
    ana.setStartDate(year, month,day)
    ana.setStopDate(year, month,day)
  2. Build time vs amplitude histograms
    auto b = buildTimeHistory();
  3. Inspect the histograms for time drift
    b[n]->Draw("colz");
    where run should run from 0 to the total number of leaves This will draw a histogram to the canvas which you can zoom on or inspect slices of.

Obtaining corrections

If gain drift is observed the class can find gain correction factors for wall clock time chunks. It's set up by default to do this for 30 min time chunks.

To get gain correction factors

  1. Launch root and create an object of the class
    root
    CloverGainDriftAna ana;
  2. Load the files you are interested in checking the gain drift over
ana.addFile("youFile1.root");
ana.addFile("youFile2.root");
.
.
.
ana.addFile("youFileN.root")

Read the tree into memory

ana.readTreeIntoMemory()
  1. Get the gain correction factors and verify they are good. The getGainCorrectionFactor function will return the found gain difference between all time chunks and a specified time chunk. The specified chunk should be chosen near the calibration data which is being used to determine the gain calibrations. Chunk (an integer) is the nth 30 minute time chunk. For example. A chunk value of 0 means the first 30 time interval of the first file loaded. To run it
    auto gcFactors = ana.getGainCorrectoinFactors(detID,element,Chunk)
    this will print to screen a list of correction factors and wall clock times in 30 min units as time since epoch. For example, a wall clock time to 900,000 means 900,000 30 minute intervals since midnight January 1st 1970 (epoch time) or 900,000x30x60 = 1.62e9 seconds since epoch. This can be converted to a date and time using an online epoch converter.

These values need to be converted to a json object. An example of the conversion is in the repository at

misc/JSONConfigFiles/march2021GENESISConfigClover0Leaf0TCorrection.json

To check if the gain correction values produce the desired effect you can get a time corrected time vs amplitude histogram using the getCorrectedHist function ie