10 #include "dqm_core/LibraryManager.h"
11 #include "dqm_core/AlgorithmManager.h"
14 #include <boost/scoped_ptr.hpp>
16 #include <TCollection.h>
17 #include <TDirectory.h>
29 , m_name(
other.m_name)
31 AlgVec_t::const_iterator subAlgsEnd =
other.m_subAlgs.end();
32 AlgVec_t::const_iterator subAlgsIter =
other.m_subAlgs.begin();
33 for( ; subAlgsIter != subAlgsEnd; ++subAlgsIter ) {
34 dqm_core::Algorithm* otherSubAlg = subAlgsIter->first;
35 dqm_core::Algorithm*
alg = otherSubAlg->clone();
36 m_subAlgs.push_back( AlgVec_t::value_type(
alg, subAlgsIter->second) );
43 : m_name (compAlgConfig.GetName())
46 TIter libIter( compAlgConfig.
GetAllLib() );
47 while( (libStr =
dynamic_cast<TObjString*
>( libIter() )) != 0 ){
51 catch ( dqm_core::Exception& ex ) {
52 std::cout <<
"Can't load library " << libStr->GetString()
53 <<
" for composite algorithm " <<
m_name
54 <<
". Continuing regardless ..." << std::endl;
59 TIter algIter( compAlgConfig.
GetAllAlg() );
60 while( (algStr =
dynamic_cast<TObjString*
>( algIter() )) != 0 ){
61 dqm_core::Algorithm*
alg(0);
62 std::string
algName(algStr->GetString().Data());
66 catch( dqm_core::Exception& ex ) {
67 throw dqm_core::BadConfig( ERS_HERE,
m_name, ex.what(), ex );
79 AlgVec_t::const_iterator subAlgsEnd =
m_subAlgs.end();
80 AlgVec_t::const_iterator subAlgsIter =
m_subAlgs.begin();
81 for( ; subAlgsIter != subAlgsEnd; ++subAlgsIter ) {
82 dqm_core::Algorithm*
alg = subAlgsIter->first;
105 message +=
"Description: Builds a container for subalgorithms.\n";
106 message +=
"Parameters: none\n";
117 std::map<std::string,double>
tags;
119 AlgVec_t::const_iterator subAlgsEnd =
m_subAlgs.end();
120 AlgVec_t::const_iterator subAlgsIter =
m_subAlgs.begin();
121 for( ; subAlgsIter != subAlgsEnd; ++subAlgsIter ) {
124 dqm_core::Algorithm*
alg = subAlgsIter->first;
131 std::map<std::string,double>::const_iterator tagsEnd = subResult->tags_.end();
132 std::map<std::string,double>::const_iterator tagsIter = subResult->tags_.begin();
133 for( ; tagsIter != tagsEnd; ++tagsIter ) {
134 std::map<std::string,double>::value_type tagVal( subAlgsIter->second + std::string(
"|") + tagsIter->first, tagsIter->second );
135 tags.insert( tagVal );
160 }
catch (dqm_core::BadConfig &) { }
161 std::map< std::string,double >
pars;
162 std::map<std::string,std::string> strPars;
163 std::map<std::string,double> grthr;
164 std::map<std::string,double> rdthr;
166 std::map< std::string, double > oldpars(
config.getParameters());
167 std::map<std::string,double> oldgrthr(
config.getGreenThresholds());
168 std::map<std::string,double> oldrdthr(
config.getRedThresholds());
170 for (std::map< std::string, double >::const_iterator parVal = oldpars.begin();
171 parVal != oldpars.end(); ++parVal) {
172 std::string
parname(parVal->first);
173 std::string::size_type
pos =
parname.find(
'|');
174 if (
pos == std::string::npos) {
175 pars.insert(*parVal);
176 }
else if (
parname.substr(0,
pos) == subalg) {
177 pars.insert(std::map< std::string, double >::value_type(
parname.substr(
pos+1), parVal->second));
180 for (
auto& strPar :
config.getGenericParameters() ) {
181 std::string
parname = strPar.first;
182 auto pipeIndex =
parname.find(
'|' );
183 if ( pipeIndex == std::string::npos ) {
184 strPars.insert( strPar );
185 }
else if (
parname.substr( 0, pipeIndex ) == subalg ) {
186 strPars.emplace(
parname.substr( pipeIndex + 1 ), strPar.second );
189 for (std::map< std::string, double >::const_iterator thrVal = oldgrthr.begin();
190 thrVal != oldgrthr.end(); ++thrVal) {
191 std::string thrname(thrVal->first);
192 std::string::size_type
pos = thrname.find(
'|');
193 if (
pos == std::string::npos) {
194 grthr.insert(*thrVal);
195 }
else if (thrname.substr(0,
pos) == subalg) {
196 grthr.insert(std::map< std::string, double >::value_type(thrname.substr(
pos+1), thrVal->second));
199 for (std::map< std::string, double >::const_iterator thrVal = oldrdthr.begin();
200 thrVal != oldrdthr.end(); ++thrVal) {
201 std::string thrname(thrVal->first);
202 std::string::size_type
pos = thrname.find(
'|');
203 if (
pos == std::string::npos) {
204 rdthr.insert(*thrVal);
205 }
else if (thrname.substr(0,
pos) == subalg) {
206 rdthr.insert(std::map< std::string, double >::value_type(thrname.substr(
pos+1), thrVal->second));