This README for DAQ and ROOT macros used in EDIT2013 NEU course.
- Author : Shota TAKAHASHI
- Created : 2013/03/12
- Modified : 2013/03/12
- How to obtain samples
- What's inside
- How to take data
- Save data
- Overwrite data
- Change ADC channels
- Install CAMAC driver
- How to make plots
- Chang branch descriptor
- How to use USB
Just download "sample.zip" and expand it in any place you want.
- daq/ --- DAQ programs
- data/ --- data
- macros/ --- ROOT macros
- plots/ --- save plots here if neccessary
DAQ programs are in "daq/" directory. Move to this directory first. Then execute program named "adc" or "multiadc". You need to specify NEVENT (event number) and OFN (output filename) as arguments. Output file is created in space-separated-text format.
$ cd daq
$ ./adc NEVENT OFN (additional info).
If you run without any argument, usage will be printed.
$ ./adc
# (--> usage will be printed)
You can also set additional arguments if you want, like below
$ ./adc NEVENT OFN MPPC_ID BIAS_VOLTAGE
It is REALLY important to name data with easy-to-remember-and-handle convention. (If you named "test1.txt", "test2.txt", ... and so on, you will get depressed when you came back to check data next week.)
My favorite way is to separate data by day (it depends on purpose, though).
I prefer OFN to be named like "../data/YMD/ANYTHING%03d.txt", where
- YMD --- date (YYYYMMDD format)
- ANYTHING --- any words you want
- %03d --- run number, this makes easy to use ROOT macros below.
DAQ program has non-overwriting feature to prevent ACCIDENTAL overwriting.
If you want to overwrite, remove the file before running DAQ.
$ ./adc 100 SAME_NAMED_FILE
--> Error: 'SAME_NAMED_FILE' already exists.
$ rm SAME_NAMED_FILE
$ ./adc 100 SAME_NAMED_FILE
Number of ADCs and its channels are defined as variable(array) named "ModId" and "ChId" in adc.cc(multiadc.cc). Modify these numbers and re-compile.
$ emacs adc.cc
$ ...(edit adc.cc)
$ make
If you restarted PC for some reason, you need to install CAMAC driver before excecuting DAQ. (You need superuser privilege)
We use "camdrv" for CAMAC driver. The driver is is /opt/hep/kinoko/drv/camdrv/.
$ cd /opt/hep/kinoko/drv/camdrv
$ sudo make install # (ask password to lecturer)
$ sudo dmesg
ROOT macro demos are in "macors" directory. Move to this directory first. Start ROOT CINT and load MACRO. Then execute samples as below.
IMPORTANT NOTICE
These are just simple demos. I encourage you to look into the codes and improve it, or make your own. ( If you know ROOT, you can do it =D )
The function "histText" is defined to return TH1D*.
You need to create TH1D* and draw histogram.
$ root
root[] > .L mppcTest.C
root[] > TH1D *h1 = histText("h1", "../data/20130305/mppctest001.txt")
root[] > h1->Draw()
The function "histText" is defined to return TCanvas*.
You need to create TCanvas*. (Canvas will be drawn automatically)
$ root
root[] > .L adcCalibration.C
root[] > TCanvas *c1 = histText(32)
You don't need to load tracker.C, just type
$ root tracker.C
or, in case you want to start from certain run number,
$ 'root tracker.C(3)'
All macros use method "TTree::ReadFile(FILENAME, BRANCH_DESCRIPTOR)" to create TTree from text file. If you changed orders or number of columns of output text format, modify BRANCH_DESCRIPTOR as needed.
Unfortunately, PCs used in EDIT2013 does not mount USB automatically. So please mount USB manually.
$ dmesg
$ su
$ sudo mount /dev/sdc1 /mnt/usb # or /media/usb
$ ls /mnt/usb
$ ... (sudo rsync or cp files)
$ sudo umount /mnt/usb