#include "TString.h" #include "hemccalibraterpar.h" #include "hpario.h" #include "hdetpario.h" #include "hparamlist.h" using namespace std; //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////////////////// // // HEmcCalibraterPar: // Container for the EMC calibrater parameters // // (Condition Style) // ///////////////////////////////////////////////////////////////////////// #include "TBuffer.h" ClassImp(HEmcCalibraterPar) HEmcCalibraterPar::HEmcCalibraterPar(const char* name,const char* title,const char* context) : HParCond(name,title,context) { // constructor clear(); } void HEmcCalibraterPar::clear(void) { // clears the container fMatchWindowMin = 0.F; fMatchWindowMax = 0.F; fAcceptWindowMin = -10000.F; fAcceptWindowMax = +10000.F; } void HEmcCalibraterPar::setMatchWindow(Float_t min, Float_t max) { // sets the parameters fMatchWindowMin = min; fMatchWindowMax = max; } void HEmcCalibraterPar::setAcceptWindow(Float_t min, Float_t max) { // sets the parameters fAcceptWindowMin = min; fAcceptWindowMax = max; } void HEmcCalibraterPar::putParams(HParamList* l) { // puts all parameters to the parameter list, which is used by the io if (!l) return; TArrayF fMatchWindow; fMatchWindow.Set(2); fMatchWindow[0] = fMatchWindowMin; fMatchWindow[1] = fMatchWindowMax; TArrayF fAcceptWindow; fAcceptWindow.Set(2); fAcceptWindow[0] = fAcceptWindowMin; fAcceptWindow[1] = fAcceptWindowMax; l->add("fMatchWindow", fMatchWindow); l->add("fAcceptWindow", fAcceptWindow); } Bool_t HEmcCalibraterPar::getParams(HParamList* l) { // gets all parameters from the parameter list, which is used by the io if (!l) return kFALSE; TArrayF fMatchWindow; if (!(l->fill("fMatchWindow", &fMatchWindow))) return kFALSE; if (fMatchWindow.GetSize() != 2) { Error("HEmcCalibraterPar::getParams(HParamList* l)", "Array size of fMatchWindow=%d does not fit to %d", fMatchWindow.GetSize(), 2); return kFALSE; } fMatchWindowMin = fMatchWindow[0]; fMatchWindowMax = fMatchWindow[1]; TArrayF fAcceptWindow; if (!(l->fill("fAcceptWindow", &fAcceptWindow))) return kFALSE; if (fAcceptWindow.GetSize() != 2) { Error("HEmcCalibraterPar::getParams(HParamList* l)", "Array size of fAcceptWindow=%d does not fit to %d", fAcceptWindow.GetSize(), 2); return kFALSE; } fAcceptWindowMin = fAcceptWindow[0]; fAcceptWindowMax = fAcceptWindow[1]; return kTRUE; } void HEmcCalibraterPar::Streamer(TBuffer &R__b) { // Stream an object of class HEmcCalibraterPar. UInt_t R__s, R__c; if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { } HParCond::Streamer(R__b); R__b >> fMatchWindowMin; R__b >> fMatchWindowMax; if(R__v > 1){ R__b >> fAcceptWindowMin; R__b >> fAcceptWindowMax; } else { fAcceptWindowMin = -10000.F; fAcceptWindowMax = +10000.F; } R__b.CheckByteCount(R__s, R__c, HEmcCalibraterPar::IsA()); } else { R__c = R__b.WriteVersion(HEmcCalibraterPar::IsA(), kTRUE); HParCond::Streamer(R__b); R__b << fMatchWindowMin; R__b << fMatchWindowMax; R__b << fAcceptWindowMin; R__b << fAcceptWindowMax; R__b.SetByteCount(R__c, kTRUE); } }