ADC 400F Handbuch Seite 13

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 74
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 12
Chapter 2. Setting up the software
__MYEVENTSEGMENT_H is not defined, and the #ifndef is true. This causes __MYEVENTSEGMENT_H
to be defined, which prevents subsequent inclusions from doing anything.
Ë Newer compilers define many of the standard classes, functions and constants inside of the std::
namespace. The spectrodaq.h header refers to these without explicitly qualifying them with the
namespace. If the std:: namespace exists, this directive asks the compiler to search it for
unqualified names (e.g cin could be resolved by std::cin).
Ì The class we are defining MyEventSegment implements the services of a base class called
CEventSegment. Anything that reads out a chunk of the experiment is an event segment and must
be derived from the CEventSegment base class.
Í By convention, events are segmented in to packets. A packet is a leading word count, followed by
an word that identifies the contents of the packet followed by the packet body. Packet identifiers are
maintained by Daniel Bazin, and the set of packet identifiers that have been currently assigned are
described at: http://groups.nscl.msu.edu/userinfo/daq/nscltags.html If you are creating a detector
system that will need its own tag contact <[email protected]> to get one assigned. The
m_MyPacket is member data for the class. It is a CDocumentedPacket. Documented packets do
the book-keeping associated with maintaining the packet structure as well as documenting their
presence in documentation records written at the beginning of the run.
Î The support software for the CAEN V685 ADC is itself a class: CAENcard. We will create an
object of this class in order to access the module. This pointer will be used to access the object and
hence the module.
Ï This line declares the constructor for MyEventSegment. A constructor is a function that is called
to initialize the data of an object when the object is being created (constructed).
Ð This line declares the destructor for MyEventSegment. A destructor is a function that is called
when an object of a class is being destroyed. Since we will be dynamically creating the CAENcard
pointed to by module, we must declare and implement a destructor to destroy that object when
objects of MyEventSegment are destroyed.
Ñ The Initialize member function is called whenever the run is about to become active. If
hardware or software requires initialization, it can be done here. This function will be called both
when a run is begun as well as when a run is resumed.
Ò The Clear member function is called when it is appropriate to clear any data that may have been
latched into the digitizers. This occurs at the beginning of a run and after each event is read out.
(10) The MaxSize member function is obsolete but must be defined and implemented for compatiblity
with older software. In the past this returned the maximum number of words the event segment
would add to the event. Now it is never called.
(11) The Read member function is called in response to a trigger. This member must read the part of the
event that is managed by this event segment.
We will also create an implementation file: MyEventSegment.cpp. This file will implement the member
functions that were defined by MyEventSegment.h above. The contents of this file are shown below:
8
Seitenansicht 12
1 2 ... 8 9 10 11 12 13 14 15 16 17 18 ... 73 74

Kommentare zu diesen Handbüchern

Keine Kommentare