//_HADES_CLASS_DESCRIPTION ////////////////////////////////////////////////////////////////// // HiTofDetector // // class for detector iTof ////////////////////////////////////////////////////////////////// #include "hitofdetector.h" #include "hitofdef.h" #include "hades.h" #include "hpario.h" #include "hdetpario.h" #include "hparasciifileio.h" #include "hparrootfileio.h" #include "hitofparrootfileio.h" #include "hitofparasciifileio.h" #include "hcategory.h" #include "hmatrixcategory.h" #include "hlinearcategory.h" #include #include "TClass.h" #include "TArrayI.h" ClassImp(HiTofDetector) HiTofDetector::HiTofDetector() { // constructor fName = "iTof"; maxSectors = 6; maxModules = 1; maxComponents = 3; modules = new TArrayI(maxModules*maxSectors); } HiTofDetector::~HiTofDetector() { // destructor if (modules) delete modules; modules=0; } Bool_t HiTofDetector::init(void) { // nothing to be done return kTRUE; } void HiTofDetector::activateParIo(HParIo* io) { // activates the input/output class for the parameters // needed by the iTof if (strcmp(io->IsA()->GetName(),"HParOraIo")==0) { io->setDetParIo("HiTofParIo"); return; } if (strcmp(io->IsA()->GetName(),"HParRootFileIo")==0) { HiTofParRootFileIo* p=new HiTofParRootFileIo(((HParRootFileIo*)io)->getParRootFile()); io->setDetParIo(p); } if (strcmp(io->IsA()->GetName(),"HParAsciiFileIo")==0) { HiTofParAsciiFileIo* p=new HiTofParAsciiFileIo(((HParAsciiFileIo*)io)->getFile()); io->setDetParIo(p); } } Bool_t HiTofDetector::write(HParIo* output) { // writes the iTof setup to output HDetParIo* out=output->getDetParIo("HiTofParIo"); if (out) return out->write(this); return kFALSE; } HCategory* HiTofDetector::buildLinearCategory(const Text_t* className) { HLinearCategory* category = new HLinearCategory(className,18); // 6x1x3 cells return category; } HCategory* HiTofDetector::buildMatrixCategory(const Text_t* className, Float_t fill) { Int_t ind[3] = {6,1,3}; HMatrixCategory* category = new HMatrixCategory(className,3,ind,fill); return category; } HCategory* HiTofDetector::buildCategory(Cat_t cat) { // builds the default categories switch (cat) { case catiTofRaw : return buildMatrixCategory("HiTofRaw",1.0); case catiTofCal : return buildMatrixCategory("HiTofCal",1.0); default : return NULL; } }