From fa37a2ddbd0c4b4a54b3147b072e706e908d7de6 Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Fri, 9 Mar 2012 14:16:38 -0500 Subject: [PATCH] Start of Hall C crate map class --- src/HallC_LinkDef.h | 1 + src/THcCrateMap.cxx | 46 +++++++++++++++++++++++++++++++++++++++++++++ src/THcCrateMap.h | 41 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 src/THcCrateMap.cxx create mode 100644 src/THcCrateMap.h diff --git a/src/HallC_LinkDef.h b/src/HallC_LinkDef.h index ef0afab..1adde52 100644 --- a/src/HallC_LinkDef.h +++ b/src/HallC_LinkDef.h @@ -8,5 +8,6 @@ #pragma link C++ class THcInterface+; #pragma link C++ class THcParmList+; +#pragma link C++ class THcCrateMap+; #endif diff --git a/src/THcCrateMap.cxx b/src/THcCrateMap.cxx new file mode 100644 index 0000000..2546770 --- /dev/null +++ b/src/THcCrateMap.cxx @@ -0,0 +1,46 @@ +///////////////////////////////////////////////////////////////////// +// +// THcCrateMap +// Layout, or "map", of DAQ Crates. +// +// THaCrateMap contains info on how the DAQ crates +// are arranged in Hall A, i.e whether slots are +// fastbus or vme, what the module types are, and +// what header info to expect. Probably nobody needs +// to know about this except the author, and at present +// an object of this class is a private member of the decoder. +// +// author Robert Michaels (rom@jlab.org) +// author Stephen Wood (saw@jlab.org) +// +///////////////////////////////////////////////////////////////////// + + +#include "THcCrateMap.h" + +#include "TError.h" + +using namespace std; + +THcCrateMap::THcCrateMap( const char* db_filename ) +{ + // Need to do something different since we are going to read + // a Hall C style map file. + + // Construct uninitialized crate map. The argument is the name of + // the database file to use for initialization + + if( !db_filename || !*db_filename ) { + ::Warning( "THcCrateMap", "Undefined database file name, " + "using default \"db_cratemap.dat\"" ); + db_filename = "cratemap"; + } + // Why does this give an error? Can't I use a private + // member of the class I inherit from? + fMapfileName = db_filename; + +} + + + +ClassImp(THcCrateMap) diff --git a/src/THcCrateMap.h b/src/THcCrateMap.h new file mode 100644 index 0000000..e286323 --- /dev/null +++ b/src/THcCrateMap.h @@ -0,0 +1,41 @@ +#ifndef THcCrateMap_ +#define THcCrateMap_ + +///////////////////////////////////////////////////////////////////// +// +// THcCrateMap +// Layout, or "map", of DAQ Crates. +// +// Inheriting from THaCrateMap +// +// THcCrateMap contains info on how the DAQ crates +// are arranged in Hall A, i.e whether slots are +// fastbus or vme, what the module types are, and +// what header info to expect. Probably nobody needs +// to know about this except the author, and at present +// an object of this class is a private member of the decoder. +// +// author Robert Michaels (rom@jlab.org) +// author Stephen Wood (saw@jlab.org) +// +///////////////////////////////////////////////////////////////////// + + +#include "THaCrateMap.h" + +class THcCrateMap : public THaCrateMap { + + public: + + THcCrateMap( const char* db = "cratemap" ); // Construct uninitialized + + private: + + TString fMapfileName; + + protected: + ClassDef(THcCrateMap,0) // Crate map + + +}; +#endif -- GitLab