const WindowsManager* AnalysisManager::getWindowsManager(void) { std::stringstream ss; ss << findAnalysis("Windows"); if(analyses_.find(findAnalysis("Windows")) != analyses_.end()) return (WindowsManager*)analyses_[findAnalysis("Windows")].second; // Windows should be always Number 0 FATAL("Windows Manager doesn't exist!",ACRed); return 0; }
void AnalysisManager::setCutsFormula(std::string analysisName,std::map<std::string,std::string> cutsList) { int pos = findAnalysis(analysisName); if(pos >= 0) { std::vector<TTree*> treesVector; for(std::map<std::string, TTree*>::iterator it=treeFilesList_.begin(); it!=treeFilesList_.end(); it++) treesVector.push_back(it->second); analyses_[pos].second->setCutsFormula(cutsList,treesVector); } }
void AnalysisManager::removeAnalysis(std::string analysisName) { int pos = findAnalysis(analysisName); if(pos >= 0) { delete analyses_[pos].second; analyses_.erase(pos); for(std::vector<std::string>::iterator it=analysesOrder_.begin(); it!=analysesOrder_.end(); it++) if(*it == analysisName) { analysesOrder_.erase(it); break; } } }
std::string AnalysisManager::getPriorityFromUi (std::string analysisName, int newPriority) { int tmp = findAnalysis(analysisName); if (tmp == newPriority) return ""; // if nothing changed Analysis * temp = analyses_[newPriority].second; std::string replaced = analyses_[newPriority].first; analyses_[newPriority] = analyses_[tmp]; analyses_[tmp].second = temp; analyses_[tmp].first = replaced; delete temp; return "Switch between " + analysisName + " and " + replaced + " done!"; }
/* The function reorders (prioritizes) the registered analysis to the netlist object. In fact it chains the analyses to be executed in a certain order. */ void net::orderAnalysis (void) { analysis * parent, * child; analysis * dc = findAnalysis (ANALYSIS_DC); int dcApplied = 0; do { // get second order sweep if ((parent = findSecondOrder ()) != NULL) { child = getChildAnalysis (parent); removeAnalysis (child); // apply sub-analysis to each parent analysis if any if (actions != nullptr) { for (auto *a: *actions) { const char * cn = getChild (a); if (cn != NULL && !strcmp (cn, child->getName ())) { a->addAnalysis (child); // apply DC analysis if necessary if (child->getType () != ANALYSIS_DC && child->getType () != ANALYSIS_SWEEP && dc != NULL) { if (!dcApplied) removeAnalysis (dc); a->addAnalysis (dc); dcApplied++; } } } } // sort the sub-analysis of each parent for (auto *a: *actions) { sortChildAnalyses (a); } } } while (parent != NULL); // sort the parent analyses parent = new analysis (); parent->setAnalysis (actions); sortChildAnalyses (parent); actions = new ptrlist<analysis> (*(parent->getAnalysis ())); delete parent; }
// Returns the child analysis of the given parent if possible. analysis * net::getChildAnalysis (analysis * parent) { return findAnalysis (getChild (parent)); }