Notes
Outline
NSCL Data Acquisition System Tutorial
Data Taking in the Fast Lane.
Why not join daqlist?
http://mailman.nscl.msu.edu/mailman/listinfo
Disclaimer
System Block Diagram (Dataflow)
What is a “Front End”?
Readout Software
Tailoring Readout
skeleton.cpp – Event Readout
C/C++ programming
The Fast Track Introduction to C and C++.
C – Program is a bunch of functions
Variables must be declared before use:
Primitive data types:
Main Non-Primitive data types:
User Defined type-names
Statements: Expression
 (random order)
Flow of Control
Pointers 
Variables That are Addresses
Libraries
C has no I/O all I/O is done via library functions (see printf, fopen, fprintf etc. etc.).
C has a rich set of libraries for string manipulation
C has a rich set of mathematics libraries.
C’s library includes malloc()/free() which allocate/release memory (return/take pointers).
Principles of Object Oriented Programming
Defining And Declaring A Class
Implementing Member Functions
Constructing objects.
Readout and CAEN V775/V785/V792/V862 modules
These modules programmatically are identical.
These modules are actually hardware-wise identical:
QDC
Personality board e.g. Peak -> charge converter
Supported in the readout via a CAENcard class
Use them by constructing and manipulating CAENcard objects.
Constructing and Initializing Modules
Reading the Modules:
But What Will My Event Look Like?
For Each CAEN Module
SpecTcl
Tailoring SpecTcl for an Experiment
C++ Advanced course fast track
Inheritance and Polymorphism
Inheritance:
Polymorphism:
References:  Pointers in disguise.
The SpecTcl processing model.
Tailoring SpecTcl is:
Choosing a set of parameters to hold your data.
Writing  an (or a pipeline of) event processors to unpack the raw event into your parameters.
Writing setup scripts that define the parameters and spectra gates and their applications.
What’s an Event Processor:
Unpacking an array of CAEN modules.
Unpacking a module:
Cunpacker::OnBegin
CCAENUnpacker::Setup
Cunpacker::operator()
Unpacking our top level packet:
Unpacking a module
Unpacking channels via the map:
Registering our unpacker