//*-- Author : RafaƂ Lalik //*-- Created : 01.06.2016 //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // HStsTaskSet // // This class contains the tasks for the Forward Detector // ///////////////////////////////////////////////////////////// #include "hststaskset.h" #include "haddef.h" #include "hades.h" #include "hdebug.h" #include "hstscalibrater.h" #include "hstsdigitizer.h" #include "hststrb3unpacker.h" #include #include #include ClassImp(HStsTaskSet); HStsTaskSet::HStsTaskSet() : HTaskSet() { // Default constructor doCal = kFALSE; } HStsTaskSet::HStsTaskSet(const Text_t name[], const Text_t title[]) : HTaskSet(name, title) { // Constructor doCal = kFALSE; } void HStsTaskSet::parseArguments(TString s) { // parses arguments (sts) to the make tasks function s.ToLower(); s.ReplaceAll(" ", ""); Ssiz_t len = s.Length(); if (len != 0) { TObjArray *myarguments = s.Tokenize(","); TObjString *stemp = 0; TString argument; TIterator *myiter = myarguments->MakeIterator(); // go over list of arguments and compare the known keys while ((stemp = (TObjString *)myiter->Next()) != 0) { argument = stemp->GetString(); Info("parseArguments()", "option: %s", argument.Data()); if (argument.CompareTo("cal") == 0) { doCal = kTRUE; } else { Error("parseArguments()", "Unknown option = %s", argument.Data()); } } delete myiter; myarguments->Delete(); delete myarguments; } } HTask *HStsTaskSet::make(const Char_t *select, const Option_t *option) { // Returns a pointer to the Sts task or taskset specified by 'select' // OPTIONS: see parseArguments() HTaskSet *tasks = new HTaskSet("Sts", "List of Sts tasks"); TString simulation = "simulation"; TString real = "real"; TString sel = select; TString opt = option; sel.ToLower(); opt.ToLower(); parseArguments(opt); if (sel.CompareTo(simulation) == 0 || gHades->getEmbeddingMode() > 0) { if (doCal) tasks->add(new HStsDigitizer("sts.digi", "sts.digi")); } if (sel.CompareTo(real) == 0 || gHades->getEmbeddingMode() > 0) { if (doCal) tasks->add(new HStsCalibrater("sts.cal", "sts.cal")); } return tasks; }