//*-- AUTHOR Bjoern Spruck //*-- created : 24.03.06 //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // // HHodoCalPar // // Container class for HODO calibration parameters // ///////////////////////////////////////////////////////////// using namespace std; #include "hhodocalpar.h" #include "hades.h" #include "hruntimedb.h" #include "hspectrometer.h" #include "hhododetector.h" #include "hpario.h" #include "hdetpario.h" #include #include ClassImp(HHodoCalPar) ClassImp(HHodoCalParMod) ClassImp(HHodoCalParChan) HHodoCalParMod::HHodoCalParMod(Int_t n) { // constructor creates an array of pointers of type // HHodoCalParChan array = new TObjArray(n); for(Int_t i=0 ; iAddAt( new HHodoCalParChan(),i); } HHodoCalParMod::~HHodoCalParMod() { // destructor array->Delete(); delete array; } HHodoCalPar::HHodoCalPar(const Char_t* name,const Char_t* title, const Char_t* context) : HParSet(name,title,context) { // constructor creates an array of pointers of type HHodoCalParMod strcpy(detName,"Hodo"); HHodoDetector* det = (HHodoDetector*)gHades->getSetup()->getDetector("Hodo"); Int_t nMod=det->getMaxModInSetup(); Int_t nComp=det->getMaxComponents(); array = new TObjArray(nMod); for (Int_t i = 0; i < nMod; i++) { if (det->getModule(-1,i)>0) array->AddAt( new HHodoCalParMod(nComp),i); else array->AddAt( new HHodoCalParMod(0),i); } } HHodoCalPar::~HHodoCalPar() { // destructor array->Delete(); delete array; } Bool_t HHodoCalPar::init(HParIo* inp,Int_t* set) { // intitializes the container from an input HDetParIo* input=inp->getDetParIo("HHodoParIo"); if (input) return (input->init(this,set)); return kFALSE; } Int_t HHodoCalPar::write(HParIo* output) { // writes the container to an output HDetParIo* out=output->getDetParIo("HHodoParIo"); if (out) return out->write(this); return -1; } void HHodoCalPar::clear() { // clears the container for(Int_t i=0;i