/BxData

Class for looping template on Borexino data

Primary LanguageC

BxData

Usage

How to run

Format

./loop_template input.root output.root

Example

$ ./loop_template /storage/gpfs_data/borexino/dst-light/cycle_19/2018/dst-light_2018_Mar_11_c19.root test.root
Future output file: test.root
Analysing file: /storage/gpfs_data/borexino/dst-light/cycle_19/2018/dst-light_2018_Mar_11_c19.root
------------------------
0/484844
10000/484844
20000/484844
30000/484844
...
484844/484844
------------------------
Saving histos to file: test.root
...npmts
...npmts_norm
------------------------

Creates file test.root:

TFile**         test.root
 TFile*         test.root
   KEY: TH1D     npmts;1 npmts
   KEY: TH1D     npmts_norm;1    npmts_norm

How to use

The usage of bxdata.C is very simple:

    #include "bxdata.C"
    // BxData object
    BxData* bxdata = new BxData(fname);
    // loop over events and apply conditions
    bxdata->Loop();
    // save histograms
    bxdata->SaveHistos(outname);

Check out loop_template.C for more.

How to compile loop_template.C

Providing your path to Echidna/rootechidna.so, compile via:

g++ -Wall -O2 -o loop_template loop_template.C `root-config --cflags --glibs` /storage/gpfs_data/borexino/users/mredchuk/offline_RefVersions/offline_c19/Echidna/rootechidna.so;

Tip: add to your ~/.bashrc.custom:

bxcompile(){
	g++ -Wall -O2 -o ${1%.*} $1 `root-config --cflags --glibs` /storage/gpfs_data/borexino/users/mredchuk/offline_RefVersions/offline_c19/Echidna/rootechidna.so;
}

And do:

bxcompile loop_template.C

(do not forget source ~/.bashrc.custom)

Customize bxdata.C

  1. Provide path to your ```Echidna/events/BxEvent.hh`` file (line 8).
#include "/storage/gpfs_data/borexino/users/mredchuk/offline_RefVersions/offline_c19/Echidna/event/BxEvent.hh"
  1. Initialize histograms in the constructor BxData::BxData(string name) (line 30).
    // initialize histograms
    nhistos = 2;
    h[0] = new TH1D("npmts", "npmts", 2000, 0, 2000);
    h[1] = new TH1D("npmts_norm", "npmts_norm", 2000, 0, 2000);
  1. Edit function BxData::Loop() to add conditions, calculations and histogram filling.