Back to index

See source file

CRichLikeDetector.h

 
//----------------------------------------------------------------------------- 
//  $Header: /asis/offline/ceres/cool/project/RCS/CRichLikeDetector.h,v 3.6 1997/07/16 15:11:46 messer Exp $ 
// 
//  COOL Program Library   
//  Copyright (C) CERES collaboration, 1996 
// 
//  Declarations for abstract CRichLikeDetector class. 
// 
//----------------------------------------------------------------------------- 
#ifndef CRICHLIKEDETECTOR_H 
#define CRICHLIKEDETECTOR_H 
 
#include "cool.h" 
#include "CDetector.h" 
#include "CCollection.h" 
#include "CPad.h" 
#include "CRichLikeHit.h" 
#include "CRichLikeLookupItem.h" 
#include "CModule.h" 
#include "CRichLikeSetup.h" 
#include "CRichLikeCluster.h" 
#include "CSortedList.h" 
#include "rw/tpordvec.h" 
 
class CMCServer; 
 
class CHuffmanCode  { 
public: 
   CHuffmanCode(); 
   CHuffmanCode(unsigned int, unsigned short); 
    
public: 
   unsigned int   lengthInBits; 
   unsigned short code; 
}; 
 
class CRichLikeDetector : public CDetector { 
public: 
   CRichLikeDetector(); 
   virtual ~CRichLikeDetector(); 
    
public: 
   virtual CBoolean unpack(CEventServer&);   		// unpacks detector incl. pedestals 
   virtual CBoolean readGainmapFromFile(const char*);   // only possible after xy lookup table is loaded 
   virtual CBoolean readModuleGainmapFromFile(const char*); // only possible after gain map was loaded 
    
   // 
   //  Standard analysis methods 
   // 
   virtual CBoolean makeCogAndClusterHits();		// make single photon hits    
   virtual CBoolean makeHitsFromClusters();		// alternative hit algorithm (obsolete) 
    
   // 
   // These functions are called from makeClustersAndDoCleanup() in a very special 
   // way. Never, ever call them seperatly, unless you want to debug something. 
   // Some of these are pure virtual and provided by Rich and PadChamber. 
   // 
   virtual CBoolean makeClusters(float = 5); 
   virtual CBoolean splitClusters(int = 5); 
    
   // 
   //  The following methods remove pads. The pads are not really removed 
   //  from the collection but rather their amplitude is set negative. 
   // 
   void killPads(int, int, int, int);        // kill area given by x1,y1,x2,y2 
   void killModule(int i);                   // kill all pads module   
    
   // 
   //  Methods to list summaries of created objects 
   // 
   virtual void printClusterSummary(); 
   virtual void printHitSummary(ostream& = cout); 
 
   // 
   //  Access functions 
   // 
   const CCollection<CPad>& getPads() const { return pads; } 
   const CCollection<CRichLikeLookupItem>& getLookupItem() const { return lookupItem; } 
   const CSortedList<CRichLikeHit>& getHits() const { return hits; } 
   const RWTPtrOrderedVector<CRichLikeCluster>& getClusters() const { return clusters; } 
   const RWTPtrOrderedVector<CModule>& getModules() const { return modules; } 
    
   // 
   //  Miscellaneous 
   // 
   double getAverageHitAmplitude();		// returns average hit amplitude 
    
   // 
   //  MC member functions 
   // 
   virtual CBoolean digitize(CMCServer&, CMCDigiMode = CMCResetMode); 
   virtual CBoolean makeHitsFromMC(CMCServer&); 
    
protected: 
   CBoolean unpackPedestals(CEventServer&); 
   CBoolean unpackXYLookupTable(CEventServer&); 
   CBoolean unpackHuffmanTable(CEventServer&); 
   CBoolean expandHuffmanTable(); 
   CBoolean readHuffmanTableFromFile(const char*); 
   CBoolean readModulesFromFile(const char*); 
   virtual  void markSensitiveArea() = 0;                 
   int      countNeighbours(CPad&, float = 0); 
   void     findCenterOfGravity(int, int, float&, float&, float&, float&, float&, CPad*&); 
   CRichLikeHit* findOneHit(const CPad*, int);  
    
protected: 
   CCollection<CPad>                     pads;       // pad list & array 
   CCollection<CRichLikeLookupItem>      lookupItem; // xy lookup table, pedestals and sigma 
   RWTPtrOrderedVector<CRichLikeCluster> clusters;   // cluster list 
   RWTPtrOrderedVector<CModule>          modules;    // xy lookup table, pedestals and sigma 
   CSortedList<CRichLikeHit>             hits;       // change for persistency... 
   CHuffmanCode *huffmanTable; 
   unsigned short *bigHuffmanTable; 
 
protected: 
   CRichLikeSetup *setup; 
}; 
 
#include "CMCServer.h" 
 
#endif /* CRICHLIKEDETECTOR_H */ 

Back to index

See source file