CRich1.C
//-----------------------------------------------------------------------------
// $Header: /cool/project/RCS/CRich1.C,v 2.3 1996/10/17 15:39:27 messer Exp $
//
// COOL Program Library
// Copyright (C) CERES collaboration, 1996
//
// Implementation of class CRich1.
//
//-----------------------------------------------------------------------------
#include <iostream.h>
#include "CRich1.h"
#include "CRich1Setup.h"
CRich1::CRich1(const char* setupFile)
{
//
// Initialize members inherited from CDetector
//
id = Rich1;
name = "Rich1";
//
// May be I should comment on this:
// The reason for this massacre is that there exist nothing
// like virtual data member. Each of the defined setup pointers
// has is own scope. With other words there's an ambiguity
// which can only be resolved by either using always the proper
// scope operator or by hacking the code below. I know it looks
// somehow unusual but eases further programming.
//
CDetector::setup = CRichLikeDetector::setup
= CRich::setup = CRich1::setup = new CRich1Setup;
if (setupFile == 0) {
CString setupName = CString(C_DEFAULT_SETUP_PATH)+
CString(C_SETUPFILE_RICH1);
setup->read(setupName.data());
}
else
setup->read(setupFile);
//
// Set the proper size of the collections
//
pads.resize(setup->getNPads()+1, setup->getNPads()+1);
lookupItem.resize(setup->getNPads()+1, setup->getNPads()+1);
//
// Read the module map
//
CString modName = CString(C_DEFAULT_SETUP_PATH)+
CString(C_MODULEMAP_RICH1);
readModulesFromFile(modName.data());
//
// Read the default huffman table
//
CString tabName = CString(C_DEFAULT_SETUP_PATH)+
CString(C_HUFFMAN_TABLE_RICH1);
readHuffmanTableFromFile(tabName.data());
//
// create ringmask for hough transformation
//
houghMask = ringMaskWidth1(setup->getAsymptoticRadius());
}
CRich1::~CRich1() { delete setup; }
CRich1::CRich1(const CRich1 &) {}
CRich1 & CRich1::operator = (const CRich1 &) { return *this; }