69 {
70 MsgStream log( messageService(), name() );
71
72 std::string SubAlg_type, SubAlg_name, SubAlg_param, SubAlg_NameParam,AlgNameFromConfig ;
73 Algorithm* pAlg;
74 Algorithm* bAlg;
75
76
77 log<< MSG::DEBUG <<
"Sequence " << sequence->
getSeqID()
78 <<
" has " << sequence->
algoNum() <<
" algorithms " << endreq;
79
80 std::vector<Algorithm*> helpAlgVec;
81 std::vector<std::string>::iterator algI = sequence->
algoVector().begin();
82
83 for ( ; algI != sequence->
algoVector().end(); algI++){
84 std::string alg_def = *algI;
85 log << MSG::DEBUG << "algorithm : " << alg_def << endreq;
87 findParamSet(SubAlg_NameParam,AlgNameFromConfig,SubAlg_param);
88 SubAlg_name=AlgNameFromConfig+"_"+SubAlg_param;
89
90
92 if(!subAlgExist) {
93 StatusCode sc = createSubAlgorithm(SubAlg_type, SubAlg_name, pAlg);
94 if(sc.isFailure() ) {
95 log << MSG::FATAL << alg_def <<" sub-algorithm create failed!" << endreq;
96 return sc;
97 }
98 log << MSG::DEBUG << "created " << SubAlg_type << "/" << SubAlg_name << endreq;
99 bAlg = dynamic_cast<Algorithm*>(pAlg);
100 bAlg->initialize();
101 bAlg->beginRun();
102 StringProperty paramSet("ParamSetFile", SubAlg_param);
103 bAlg->setProperty(paramSet);
104
105 helpAlgVec.push_back(bAlg);
106 } else {
108 bAlg = dynamic_cast<Algorithm*>(pAlg);
109
110 StringProperty paramSet("ParamSetFile",SubAlg_param);
111 bAlg->setProperty(paramSet);
112 helpAlgVec.push_back(bAlg);
113 }
114 }
115 m_AlgMap[sequence->
getSeqID()] = helpAlgVec;
116
117 log << MSG::INFO << "Initialization of "<< name() << " completed successfully" << endreq;
118 return StatusCode::SUCCESS;
119}
void findParamSet(const std::string &property, std::string &SubAlg_name, std::string &SubAlg_param)
void findAlgTypeName(const std::string &property, std::string &SubAlg_type, std::string &SubAlg_NameParam)
int algoNum() const
Retrieve number of algorithms.
const std::string & getSeqID() const
std::vector< std::string > & algoVector()
Retrieve algorithm vector reference.
Algorithm * existingAlg(std::string)
bool doesExistAlready(std::string)