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 93 of file DDCheckMaterials.cc.

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

Referenced by DDErrorDetection::ma().

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