CMS 3D CMS Logo

Functions
DDCheck.h File Reference
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include "DetectorDescription/Core/interface/DDCompactView.h"
#include "DetectorDescription/Core/interface/DDName.h"

Go to the source code of this file.

Functions

bool DDCheck (std::ostream &)
 
bool DDCheck (const DDCompactView &cpv, std::ostream &)
 
bool DDCheckMaterials (std::ostream &, std::vector< std::pair< std::string, DDName > > *=0)
 Checks all registered materials and sends a report /p os. More...
 

Function Documentation

bool DDCheck ( std::ostream &  )

Definition at line 163 of file DDCheck.cc.

References DDCheckAll(), and mps_fire::result.

164 {
165  bool result = false;
166  os << "DDCore: start comprehensive checking" << std::endl;
167  DDCompactView cpv; // THE one and only (prototype restriction) CompactView
168  DDExpandedView exv(cpv);
169  result |= DDCheckAll(cpv,os);
170 
171  // done
172  os << "DDCore: end of comprehensive checking" << std::endl;
173 
174  if (result) { // at least one error found
175  edm::LogError("DDCheck") << std::endl << "DDD:DDCore:DDCheck: found inconsistency problems!" << std::endl;
176  }
177 
178  return result;
179 }
type of data representation of DDCompactView
Definition: DDCompactView.h:90
bool DDCheckAll(const DDCompactView &cpv, std::ostream &os)
Definition: DDCheck.cc:122
Provides an exploded view of the detector (tree-view)
bool DDCheck ( const DDCompactView cpv,
std::ostream &   
)

Definition at line 181 of file DDCheck.cc.

References DDCheckAll(), and mps_fire::result.

182 {
183  bool result = false;
184  os << "DDCore: start comprehensive checking" << std::endl;
185  // DDCompactView cpv; // THE one and only (prototype restriction) CompactView
186  DDExpandedView exv(cpv);
187  result |= DDCheckAll(cpv,os);
188 
189  // done
190  os << "DDCore: end of comprehensive checking" << std::endl;
191 
192  if (result) { // at least one error found
193  edm::LogError("DDCheck") << std::endl << "DDD:DDCore:DDCheck: found inconsistency problems!" << std::endl;
194  }
195 
196  return result;
197 }
bool DDCheckAll(const DDCompactView &cpv, std::ostream &os)
Definition: DDCheck.cc:122
Provides an exploded view of the detector (tree-view)
bool DDCheckMaterials ( std::ostream &  ,
std::vector< std::pair< std::string, DDName > > *  = 0 
)

Checks all registered materials and sends a report /p os.

Definition at line 96 of file DDCheckMaterials.cc.

References DDCheckMaterial(), relativeConstraints::error, benchmark_cfg::errors, mps_fire::i, DDI::Singleton< I >::instance(), RazorAnalyzer::mr, mps_fire::result, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CompareDDCompactViews::beginRun(), and DDErrorDetection::ma().

97 {
98  bool result = false;
99  std::vector<std::pair<std::string,DDName> > errors;
100 
102 
103  for( const auto& i : mr ) {
104  std::pair<std::string,DDName> error("","");
105  DDMaterial tmat(i.first);
106 
107  if (DDCheckMaterial(tmat,error)) {
108  errors.push_back(error);
109  }
110  }
111 
112  std::string s(" ");
113  os << "[DDCore:Report] Materials " << std::endl;
114  os << s << mr.size() << " Materials declared" << std::endl;
115  os << s << "detected errors:" << errors.size() << std::endl;
116  for( auto j : errors ) {
117  os << std::endl << s << j.second << " " << j.first << std::endl;
118  result = true;
119  }
120  if(res) *res = errors;
121  return result;
122 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
Definition: Electron.h:4
static value_type & instance()
bool DDCheckMaterial(DDMaterial &mip, std::pair< std::string, DDName > &result, int rlevel=0)