CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
DDCheck.h File Reference
#include <iostream>
#include <vector>
#include "DetectorDescription/Core/interface/DDName.h"
#include "DetectorDescription/Core/interface/DDCompactView.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 156 of file DDCheck.cc.

References DDCheckAll(), and mps_fire::result.

157 {
158  bool result = false;
159  os << "DDCore: start comprehensive checking" << std::endl;
160  DDCompactView cpv; // THE one and only (prototype restriction) CompactView
161  DDExpandedView exv(cpv);
162  result |= DDCheckAll(cpv,os);
163 
164  // done
165  os << "DDCore: end of comprehensive checking" << std::endl;
166 
167  if (result) { // at least one error found
168  edm::LogError("DDCheck") << std::endl << "DDD:DDCore:DDCheck: found inconsistency problems!" << std::endl;
169  }
170 
171  return result;
172 }
type of data representation of DDCompactView
Definition: DDCompactView.h:77
tuple result
Definition: mps_fire.py:84
bool DDCheckAll(const DDCompactView &cpv, std::ostream &os)
Definition: DDCheck.cc:115
Provides an exploded view of the detector (tree-view)
bool DDCheck ( const DDCompactView cpv,
std::ostream &   
)

Definition at line 174 of file DDCheck.cc.

References DDCheckAll(), and mps_fire::result.

175 {
176  bool result = false;
177  os << "DDCore: start comprehensive checking" << std::endl;
178  // DDCompactView cpv; // THE one and only (prototype restriction) CompactView
179  DDExpandedView exv(cpv);
180  result |= DDCheckAll(cpv,os);
181 
182  // done
183  os << "DDCore: end of comprehensive checking" << std::endl;
184 
185  if (result) { // at least one error found
186  edm::LogError("DDCheck") << std::endl << "DDD:DDCore:DDCheck: found inconsistency problems!" << std::endl;
187  }
188 
189  return result;
190 }
tuple result
Definition: mps_fire.py:84
bool DDCheckAll(const DDCompactView &cpv, std::ostream &os)
Definition: DDCheck.cc:115
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 86 of file DDCheckMaterials.cc.

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

Referenced by DDErrorDetection::ma().

87 {
88  bool result = false;
89  std::vector<std::pair<std::string,DDName> > errors;
90 
92 
93  for( const auto& i : mr ) {
94  std::pair<std::string,DDName> error("","");
95  DDMaterial tmat(i.first);
96 
97  if (DDCheckMaterial(tmat,error)) {
98  errors.push_back(error);
99  }
100  }
101 
102  std::string s(" ");
103  os << "[DDCore:Report] Materials " << std::endl;
104  os << s << mr.size() << " Materials declared" << std::endl;
105  os << s << "detected errors:" << errors.size() << std::endl;
106  for( auto j : errors ) {
107  os << std::endl << s << j.second << " " << j.first << std::endl;
108  result = true;
109  }
110  if(res) *res = errors;
111  return result;
112 }
int i
Definition: DBlmapReader.cc:9
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
tuple result
Definition: mps_fire.py:84
static value_type & instance()
int j
Definition: DBlmapReader.cc:9
bool DDCheckMaterial(DDMaterial &mip, std::pair< std::string, DDName > &result, int rlevel=0)