56{
57
58 dqm_core::Result *newresult = new dqm_core::Result();
59
60 std::multimap<std::string,TObject*>
inputs;
61 dqm_algorithms::tools::SimpleAlgorithmConfig algConfig;
62
63 dqm_core::Result * overWriteResult = 0;
64
65
66 for (dqm_core::ParametersMap::const_iterator iter=map.begin();iter!=map.end();++iter){
67
68
69 if (
iter->second->getWeight() == 0 ) {
70 ERS_DEBUG(2,
"Skip result (weight 0): "<<
iter->first);
71 continue;
72 }
73 TObject* inputobject =
iter->second->getResult().get()->getObject();
74 if (inputobject == 0) {
75
76
77 newresult->status_ = lastResult.status_;
78 return newresult;
79 }
80 else {
81
82 std::string role;
83 for (std::map<std::string,double>::const_iterator tagIter=
iter->second->getResult().get()->tags_.begin();
84 tagIter !=
iter->second->getResult().get()->tags_.end(); ++tagIter ) {
85 std::string
tag = tagIter->first;
86 size_t stringPos{};
87 if ( stringPos =
tag.find(confParamRoleStr); stringPos != std::string::npos) {
88 stringPos += confParamRoleStr.length();
89 role =
tag.substr(stringPos);
90 break;
91 }
92 }
93
94 if(role.size() != 0) {
95 inputs.insert(std::pair<std::string,TObject*>(role,inputobject));
96 }
97 }
98 }
99
101 newresult->status_ = lastResult.status_;
102 return newresult;
103 }
104
105
106
107
108 std::map<std::string,double > paramVecMap;
109 for (dqm_core::ParametersMap::const_reverse_iterator rIter=map.rbegin() ; rIter!=map.rend();++rIter) {
110 if( rIter->second->getResult().get()->tags_.empty() ){
111 continue;
112 }
113 for (std::map<std::string,double>::const_iterator tagIter=rIter->second->getResult().get()->tags_.begin();
114 tagIter != rIter->second->getResult().get()->tags_.end(); ++tagIter ) {
115 std::string
tag = tagIter->first;
116 size_t stringPos;
117 if (
tag.find(confParamRoleStr) != std::string::npos ){
118
119 continue;
120 }
121 std::string tagType = "ConfParameter--OverWrite";
122 if (
tag.find(tagType) != std::string::npos ){
123
124 overWriteResult = rIter->second->getResult().get();
125
126
127 continue;
128 }
129 tagType = "ConfParameter--";
130 if ( (stringPos =
tag.find(tagType)) != std::string::npos ){
131
132 stringPos += tagType.length();
134 continue;
135 }
136 tagType = "GThreshold--";
137 if ( (stringPos =
tag.find(tagType)) != std::string::npos ){
138
139 stringPos += tagType.length();
141 continue;
142 }
143 tagType = "RThreshold--";
144 if ( (stringPos =
tag.find(tagType)) != std::string::npos ){
145
146 stringPos += tagType.length();
148 continue;
149 }
150 if (
tag.find(
"ConfParameter[") != std::string::npos ){
151 std::cerr<< "MULTIOPTION PARAMETERS NO LONGER SUPPORTED; IGNORING" << std::endl;
152
153
154
155 }
156 }
157 break;
158 }
159
160
161 for ( std::map<std::string,double>::const_iterator pvIter=paramVecMap.begin(); pvIter!=paramVecMap.end();++pvIter){
162 algConfig.
addParameter( pvIter->first, pvIter->second );
163 }
164
165 delete newresult;
166 newresult =
execute(name,inputs,algConfig);
167
168
169 if ((overWriteResult != 0) && (newresult->getObject() != 0) ) {
170
171
172 overWriteResult->status_ = newresult->status_;
173 overWriteResult->tags_ = newresult->tags_;
174
175 TObject* overWriteObject = overWriteResult->getObject();
176 if ( (!overWriteObject->IsA()->InheritsFrom("TH1")) || (!newresult->getObject()->IsA()->InheritsFrom("TH1")) ) {
177
178 }
179 else {
180
181 TH1* hOverW = static_cast<TH1*> (overWriteObject);
182 TH1* hResult = static_cast<TH1*> (newresult->getObject());
183
184 if (hOverW->GetDimension() == hResult->GetDimension()) {
185 hOverW->Reset();
186 hOverW->Add(hResult);
187 }
188 }
189 }
190
191 return newresult;
192}
dqm_core::Result * execute(const std::string &name, const dqm_core::Result &, const dqm_core::ParametersMap &)