Online Histogram Monitoring Documentation

General information

There are two programs to create online histograms, the first one: sampler is called by the DAQ to create the plots online. The second one doOfflineHistoDrs4 can be called from the command line to recreate the histograms, or to create them for the pedestal events.

Both programs should be executed on pcdreamdaq2 for this reason there is a script in called doOfflineHisto that will ssh to pcdreamdaq2 set the correct enviroenment variables and call the program from there.

The source file for sampler is sampler.c; the source file for doOfflineHistoDrs4 is doOfflineHisto.c; both programs rely on dreammon.c. dreammon.c has 3 functions:

int dreammon_init(char * * argv, unsigned int run_nr, bool drs, int drs_setup, bool phys_h);

int dreammon_event(unsigned int doSingle, unsigned int events, unsigned int * buf, bool drs, int drs_setup);

int dreammon_sync(unsigned int i, bool drs, int drs_setup);

int dreammon_exit(unsigned int i, bool drs, int drs_setup);

The dreammon_init() initializes the monitoring histogram, dreammon_event() is called for every event and fills the histos, dreammon_sync() saves the histo to a file and is called about every 1000 events. dreammon_exit() is called in the end to free some memory.

Most of the parameters passed to the functions are obsolete and are ignored by the functions frown

In some cases the code to create the histograms for a specific class of devices has been moved to its own separate file. For instance dreammon_adc.h contains everything about the ADCs and dreammon.c calls the adc_init() adc_event() and adc_sync() functions. dreammon_adc.h should be splitted in dreammon_adc.c and dreammon_adc.h but I haven't had the time yet.

Someone, maybe you, should also take the time to move the TDC, OSC and DRS specific parts of dreammon.c and move them to their separate files.

Environment variables

Input binary files are searched in:

$DATADIR/data  $DATADIR/pedestal 

Input root files for pedestal subtraction are searched in:

$NTUPLEDIR/ 

Output files will be placed in:

$NTUPLEDIR/

How to change the ADC mapping

change the mapping.h file. For newdream channel: set the tower fiber and amp values by modifying or addinga a case to the switch statement and the code will generate the channel name. For Leakage, crystals and ancillary detectors you just need to set the name or the channel number. Once you do this everything should be saved in the correct folder of the monitoring file. If it does not work look at the adc_sync() function in dreammon_adc.c.

-- MicheleCascella - 15-Jul-2012

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2018-06-24 - MicheleCascella
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    DREAM All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback