//*-- AUTHOR Rainer Schicker //*-- modified: 18/12/2001 by Ilse Koenig //*-- modified: 06/03/2000 by Ilse Koenig //*-- created : 18/02/00 //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // HStartCalPar // // Container class for Start calibration parameters // ///////////////////////////////////////////////////////////// using namespace std; #include "hstartcalpar.h" #include "hades.h" #include "hruntimedb.h" #include "hspectrometer.h" #include "hstartdetector.h" #include "hpario.h" #include "hdetpario.h" #include #include ClassImp(HStartCalPar) ClassImp(HStartCalParMod) ClassImp(HStartCalParChan) void HStartCalParChan::Streamer(TBuffer &R__b) { // Stream an object of class HStartCalParChan. UInt_t R__s, R__c; if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { } TObject::Streamer(R__b); if(R__v==1){ R__b >> slope; R__b >> offset; } else{ R__b >> slope; R__b >> offset; R__b >> slopeL; R__b >> slopeR; R__b >> slopeM; R__b >> vGroup; R__b >> posOffset; } R__b.CheckByteCount(R__s, R__c, HStartCalParChan::IsA()); } else { R__c = R__b.WriteVersion(HStartCalParChan::IsA(), kTRUE); TObject::Streamer(R__b); R__b << slope; R__b << offset; R__b << slopeL; R__b << slopeR; R__b << slopeM; R__b << vGroup; R__b << posOffset; R__b.SetByteCount(R__c, kTRUE); } } HStartCalParMod::HStartCalParMod(Int_t n) { // constructor creates an array of pointers of type // HStartCalParChan array = new TObjArray(n); for(Int_t i=0 ; iAddAt( new HStartCalParChan(),i); } HStartCalParMod::~HStartCalParMod() { // destructor array->Delete(); delete array; } HStartCalPar::HStartCalPar(const Char_t* name,const Char_t* title, const Char_t* context) : HParSet(name,title,context) { // constructor creates an array of pointers of type HStartCalParMod strcpy(detName,"Start"); HStartDetector* det = (HStartDetector*)gHades->getSetup()->getDetector("Start"); 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 HStartCalParMod(nComp),i); else array->AddAt( new HStartCalParMod(0),i); } } HStartCalPar::~HStartCalPar() { // destructor array->Delete(); delete array; } Bool_t HStartCalPar::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 HStartCalPar::write(HParIo* output) { // writes the container to an output HDetParIo* out=output->getDetParIo("HStartParIo"); if (out) return out->write(this); return -1; } void HStartCalPar::clear() { // clears the container for(Int_t i=0;i