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"
#include <map>

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 query::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 
169  // result |= DDCheckMaterials(os);
170  //DDCheckLP(exv.logicalPart(),os);
171  result |= DDCheckAll(cpv,os);
172 
173  // done
174  os << "DDCore: end of comprehensive checking" << std::endl;
175 
176  if (result) { // at least one error found
177  edm::LogError("DDCheck") << std::endl << "DDD:DDCore:DDCheck: found inconsistency problems!" << std::endl;
178 // edm::LogError("DDCheck") << "To continue press 'y' ... " << std::endl;
179 // char c;
180 // cin >> c;
181 // if (c != 'y') {
182 // edm::LogError("DDCheck") << " terminating ..." << std::endl; exit(1);
183 // (Mike Case) should we throw instead? OR is an if (DDCheck) the best way?
184 // throw(DDException(std::string("DDD:DDCore:DDCheck: found inconsistency problems!"));
185  }
186 
187  return result;
188 }
type of data representation of DDCompactView
Definition: DDCompactView.h:77
tuple result
Definition: query.py:137
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 190 of file DDCheck.cc.

References DDCheckAll(), and query::result.

191 {
192  bool result = false;
193  os << "DDCore: start comprehensive checking" << std::endl;
194  // DDCompactView cpv; // THE one and only (prototype restriction) CompactView
195  DDExpandedView exv(cpv);
196 
197  // result |= DDCheckMaterials(os);
198  //DDCheckLP(exv.logicalPart(),os);
199  result |= DDCheckAll(cpv,os);
200 
201  // done
202  os << "DDCore: end of comprehensive checking" << std::endl;
203 
204  if (result) { // at least one error found
205  edm::LogError("DDCheck") << std::endl << "DDD:DDCore:DDCheck: found inconsistency problems!" << std::endl;
206 // edm::LogError("DDCheck") << "To continue press 'y' ... " << std::endl;
207 // char c;
208 // cin >> c;
209 // if (c != 'y') {
210 // edm::LogError("DDCheck") << " terminating ..." << std::endl; exit(1);
211 // (Mike Case) should we throw instead? OR is an if (DDCheck) the best way?
212 // throw(DDException(std::string("DDD:DDCore:DDCheck: found inconsistency problems!"));
213  }
214 
215  return result;
216 }
tuple result
Definition: query.py:137
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 92 of file DDCheckMaterials.cc.

References DDCheckMaterial(), relativeConstraints::error, benchmark_cfg::errors, i, instance, j, query::result, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DDErrorDetection::ma().

93 {
94  bool result = false;
95  std::vector<std::pair<std::string,DDName> > errors;
96 
97 
98  //DDMaterialReg::instance_t& mr = DDMaterialReg::instance();
99  //DDMaterialReg::instance_t::iterator i = mr.begin();
102  RegT::value_type::iterator i = mr.begin();
103  //edm::LogError("DDCheckMaterials") << " material checking, registry access, exiting! " << std::endl; exit(1);
104  for(; i != mr.end(); ++i) {
105  std::pair<std::string,DDName> error("","");
106  DDMaterial tmat(i->first);
107  //exit(1);
108  if (DDCheckMaterial(tmat,error)) {
109  errors.push_back(error);
110  }
111  }
112 
113  std::string s(" ");
114  os << "[DDCore:Report] Materials " << std::endl;
115  os << s << mr.size() << " Materials declared" << std::endl;
116  os << s << "detected errors:" << errors.size() << std::endl;
117  std::vector<std::pair<std::string,DDName> >::iterator j = errors.begin();
118  for (;j!=errors.end();++j) {
119  os << std::endl << s << j->second << " " << j->first << std::endl;
120  result = true;
121  }
122  if(res) *res = errors;
123  return result;
124 }
Definition: DDBase.h:14
int i
Definition: DBlmapReader.cc:9
static PFTauRenderPlugin instance
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:41
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
Container::value_type value_type
bool DDCheckMaterial(DDMaterial &mip, std::pair< std::string, DDName > &result, int rlevel=0)