//_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // HStartSelfCoPar // // Container class for Start selfcoincidence parameters // Adapted from hstartcalpar (by Rainer Schicker) // ///////////////////////////////////////////////////////////// using namespace std; #include "hstartselfcopar.h" #include "hades.h" #include "hruntimedb.h" #include "hspectrometer.h" #include "hstartdetector.h" #include "hpario.h" #include "hdetpario.h" #include #include ClassImp(HStartSelfCoPar) ClassImp(HStartSelfCoParMod) ClassImp(HStartSelfCoParChan) HStartSelfCoParMod::HStartSelfCoParMod(Int_t n) { // constructor creates an array of pointers of type // HStartSelfCoParChan array = new TObjArray(n); for(Int_t i=0 ; iAddAt( new HStartSelfCoParChan(),i); } HStartSelfCoParMod::~HStartSelfCoParMod() { // destructor array->Delete(); delete array; } HStartSelfCoPar::HStartSelfCoPar(const Char_t* name,const Char_t* title, const Char_t* context) : HParSet(name,title,context) { // constructor creates an array of pointers of type HStartSelfCoParMod strcpy(detName,"Start"); HDetector* det= gHades->getSetup()->getDetector("Start"); Int_t nMod=1; 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 HStartSelfCoParMod(nComp),i); else array->AddAt(new HStartSelfCoParMod(0),i); } } HStartSelfCoPar::~HStartSelfCoPar() { // destructor array->Delete(); delete array; } Bool_t HStartSelfCoPar::init(HParIo* inp,Int_t* set) { // intitializes the container from an input HDetParIo* input=inp->getDetParIo("HStartParIo"); if (input) return (input->init(this,set)); return kFALSE; } Int_t HStartSelfCoPar::write(HParIo* output) { // writes the container to an output HDetParIo* out=output->getDetParIo("HStartParIo"); if (out) return out->write(this); return -1; } void HStartSelfCoPar::clear() { // clears the container for(Int_t i=0;i