//*-- Author : RafaƂ Lalik //*-- Created : 01.06.2016 //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // HFRpcTaskSet // // This class contains the tasks for the Forward Detector // ///////////////////////////////////////////////////////////// #include "hfrpctaskset.h" #include "haddef.h" #include "hades.h" #include "hdebug.h" #include "hfrpccalibrater.h" #include "hfrpcclusterfinder.h" #include "hfrpcdigitizer.h" #include "hfrpchitfinder.h" #include #include #include ClassImp(HFRpcTaskSet); HFRpcTaskSet::HFRpcTaskSet() : HTaskSet() { // Default constructor doCal = kFALSE; doClusF = kFALSE; doHitF = kFALSE; } HFRpcTaskSet::HFRpcTaskSet(const Text_t name[], const Text_t title[]) : HTaskSet(name, title) { // Constructor doCal = kFALSE; doClusF = kFALSE; doHitF = kFALSE; } void HFRpcTaskSet::parseArguments(TString s) { // parses arguments (straw, rpc) 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 if (argument.CompareTo("clusf") == 0) { doCal = kTRUE; doClusF = kTRUE; } else if (argument.CompareTo("hitf") == 0) { doCal = kTRUE; doClusF = kTRUE; doHitF = kTRUE; } else { Error("parseArguments()", "Unknown option = %s", argument.Data()); } } delete myiter; myarguments->Delete(); delete myarguments; } } HTask *HFRpcTaskSet::make(const Char_t *select, const Option_t *option) { // Returns a pointer to the FRpc task or taskset specified by 'select' // OPTIONS: see parseArguments() HTaskSet *tasks = new HTaskSet("FRpc", "List of FRpc 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 HFRpcDigitizer("frpc.digi", "frpc.digi")); } if (sel.CompareTo(real) == 0 || gHades->getEmbeddingMode() > 0) { if (doCal) tasks->add(new HFRpcCalibrater("frpc.cal", "frpc.cal")); } if (doClusF) tasks->add(new HFRpcClusterFinder("frpc.clusf", "frpc.clusf")); if (doHitF) tasks->add(new HFRpcHitFinder("frpc.hitf", "frpc.hitf")); return tasks; }