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 162 of file DDCheck.cc.

References DDCheckAll(), and mps_fire::result.

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

Definition at line 180 of file DDCheck.cc.

References DDCheckAll(), and mps_fire::result.

181 {
182  bool result = false;
183  os << "DDCore: start comprehensive checking" << std::endl;
184  // DDCompactView cpv; // THE one and only (prototype restriction) CompactView
185  DDExpandedView exv(cpv);
186  result |= DDCheckAll(cpv,os);
187 
188  // done
189  os << "DDCore: end of comprehensive checking" << std::endl;
190 
191  if (result) { // at least one error found
192  edm::LogError("DDCheck") << std::endl << "DDD:DDCore:DDCheck: found inconsistency problems!" << std::endl;
193  }
194 
195  return result;
196 }
bool DDCheckAll(const DDCompactView &cpv, std::ostream &os)
Definition: DDCheck.cc:121
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.emplace_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:6
static value_type & instance()
bool DDCheckMaterial(DDMaterial &mip, std::pair< std::string, DDName > &result, int rlevel=0)