Back to index

CRich2.C

 
//----------------------------------------------------------------------------- 
//  $Header: /cool/project/RCS/CRich2.C,v 2.4 1996/10/17 15:40:07 messer Exp $ 
// 
//  COOL Program Library   
//  Copyright (C) CERES collaboration, 1996 
// 
//  Implementation of class CRich2. 
// 
//----------------------------------------------------------------------------- 
#include <iostream.h> 
#include "CRich2Setup.h" 
#include "CRich2.h"  
  
 
CRich2::CRich2(const char* setupFile)  
{ 
   // 
   //  Initialize members inherited from CDetector 
   // 
   id = Rich2;  
   name = "Rich2";   
    
   // 
   //  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 = CRich2::setup = new CRich2Setup; 
    
   if (setupFile == 0) { 
      CString setupName = CString(C_DEFAULT_SETUP_PATH)+ 
         CString(C_SETUPFILE_RICH2); 
      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_RICH2); 
   readModulesFromFile(modName.data()); 
    
   // 
   //  Read the default huffman table 
   // 
   CString tabName = CString(C_DEFAULT_SETUP_PATH)+ 
      CString(C_HUFFMAN_TABLE_RICH2); 
   readHuffmanTableFromFile(tabName.data()); 
    
   // 
   //  create ringmask for hough transformation 
   //         
   houghMask = ringMaskWidth1(setup->getAsymptoticRadius()); 
} 
 
CRich2::~CRich2() { delete setup; } 
 
CRich2::CRich2(const CRich2 &) {} 
 
CRich2 & CRich2::operator = (const CRich2 &) { return *this; } 
 
 

Back to index