#include <stdio.h>
#include "htofinodetector.h"
#include "tofinodef.h"
#include "hades.h"
#include "hpario.h"
#include "hdetpario.h"
#include "hparasciifileio.h"
#include "hparrootfileio.h"
#include "htofinoparhadasciifileio.h"
#include "htofinoparrootfileio.h"
#include "htofinoparasciifileio.h"
#include "htofinogeompar.h"
#include "hcategory.h"
#include "hmatrixcategory.h"
#include "hlinearcategory.h"
#include "TClass.h"
#include "TArrayI.h"
ClassImp(HTofinoDetector)
HTofinoDetector::HTofinoDetector() {
fName="Tofino";
maxSectors=6;
maxModules=1;
maxComponents=4;
modules= new TArrayI(maxModules*maxSectors);
}
HTofinoDetector::~HTofinoDetector() {
if (modules) delete modules;
modules=0;
}
Bool_t HTofinoDetector::init(void) {
return kTRUE;
}
void HTofinoDetector::activateParIo(HParIo* io) {
if (strcmp(io->IsA()->GetName(),"HParOraIo")==0) {
io->setDetParIo("HTofinoParIo");
return;
}
if (strcmp(io->IsA()->GetName(),"HParRootFileIo")==0) {
HTofinoParRootFileIo* p=new HTofinoParRootFileIo(((HParRootFileIo*)io)
->getParRootFile());
io->setDetParIo(p);
}
if (strcmp(io->IsA()->GetName(),"HParHadAsciiFileIo")==0) {
HTofinoParHadAsciiFileIo* p=
new HTofinoParHadAsciiFileIo(((HParHadAsciiFileIo*)io)->getHadAscii());
io->setDetParIo(p);
}
if (strcmp(io->IsA()->GetName(),"HParAsciiFileIo")==0) {
HTofinoParAsciiFileIo* p=new HTofinoParAsciiFileIo(((HParAsciiFileIo*)io)
->getFile());
io->setDetParIo(p);
}
}
Bool_t HTofinoDetector::write(HParIo* output) {
HDetParIo* out=output->getDetParIo("HTofinoParIo");
if (out) return out->write(this);
return kFALSE;
}
HCategory* HTofinoDetector::buildLinearCategory(const Text_t* className) {
HLinearCategory* category = new HLinearCategory(className,24);
return category;
}
HCategory* HTofinoDetector::buildMatrixCategory(const Text_t* className, Float_t fill) {
Int_t ind[3] = {6,1,4};
HMatrixCategory* category = new HMatrixCategory(className,3,ind,fill);
return category;
}
HCategory* HTofinoDetector::buildCategory(Cat_t cat) {
switch (cat) {
case catTofinoRaw : return buildMatrixCategory("HTofinoRaw",1.0);
case catTofinoCal : return buildMatrixCategory("HTofinoCal",1.0);
default : return NULL;
}
}
Last change: Sat May 22 13:16:39 2010
Last generated: 2010-05-22 13:16
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.