CMS 3D CMS Logo

CmsMTDDebugNavigator.cc
Go to the documentation of this file.
5 
7 
8 CmsMTDDebugNavigator::CmsMTDDebugNavigator ( const std::vector<GeometricTimingDetExtra>& gdes ) {
9  for( const auto& gdei : gdes ) {
10  const GeometricTimingDetExtra* gdeaddr = &gdei;
11  _helperMap[gdei.geographicalId().rawId()] = gdeaddr;
12  }
13 }
14 
15 void CmsMTDDebugNavigator::dump(const GeometricTimingDet& in, const std::vector<GeometricTimingDetExtra>& gdes){
16  edm::LogInfo("CmsMTDDebugNavigator")<<" CmsMTDDebugNavigator - Starting debug";
17  for (int k=0; k<20; k++) numinstances[k]=0;
18  iterate(in,0, gdes);
19 
20  for (int k=0; k<20; k++){
21  edm::LogInfo("CmsMTDDebugNavigator")<<" CmsMTDDebugNavigator has found "<<numinstances[k]<<" GeometricTimingDets at level "<<k;
22  }
23 }
24 
25 void CmsMTDDebugNavigator::iterate(const GeometricTimingDet& in, int level, const std::vector<GeometricTimingDetExtra>& gdes){
27  std::string spaces(' ',level*2);
28  for (unsigned int k=0; k<in.components().size(); k++){
29  const GeometricTimingDetExtra* extra = _helperMap[in.components()[k]->geographicalId().rawId()];
30  edm::LogInfo("CmsMTDDebugNavigator") << level << spaces
31  << "### VOLUME " << in.components()[k]->name().name()
32  << " of type " << in.components()[k]->type()
33  << " copy number " << extra->copyno()
34  << " positioned in " << in.name().name()
35  << " global position of centre " << in.components()[k]->translation()
36  << " volume = " << extra->volume() << " cm3"
37  << " density = " << extra->density() << " g/cm3"
38  << " weight " << extra->weight() << " g"
39  << std::endl;
40  iterate(*((in.components())[k]),level+1, gdes);
41  }
42  return;
43 }
std::map< uint32_t, const GeometricTimingDetExtra * > _helperMap
void dump(const GeometricTimingDet &, const std::vector< GeometricTimingDetExtra > &)
ConstGeometricTimingDetContainer & components()
CmsMTDDebugNavigator(const std::vector< GeometricTimingDetExtra > &)
int k[5][pyjets_maxn]
void iterate(const GeometricTimingDet &, int, const std::vector< GeometricTimingDetExtra > &)
DDName const & name() const
const std::string & name() const
Returns the name.
Definition: DDName.cc:53