CMS 3D CMS Logo

CmsTrackerDebugNavigator.cc
Go to the documentation of this file.
5 
7 
8 CmsTrackerDebugNavigator::CmsTrackerDebugNavigator ( const std::vector<GeometricDetExtra>& gdes ) {
9  std::vector<GeometricDetExtra>::const_iterator gdeiEnd(gdes.end());
10  std::vector<GeometricDetExtra>::const_iterator gdei(gdes.begin());
11  for (; gdei != gdeiEnd; ++gdei) {
12  const GeometricDetExtra* gdeaddr = &(*gdei);
13  _helperMap[gdei->geographicalId().rawId()] = gdeaddr;
14  }
15 }
16 
17 void CmsTrackerDebugNavigator::dump(const GeometricDet& in, const std::vector<GeometricDetExtra>& gdes){
18  edm::LogInfo("CmsTrackerDebugNavigator")<<" CmsTrackerDebugNavigator - Starting debug";
19  for (int k=0; k<20; k++) numinstances[k]=0;
20  iterate(in,0, gdes);
21 
22  for (int k=0; k<20; k++){
23  edm::LogInfo("CmsTrackerDebugNavigator")<<" CmsTrackerDebugNavigator has found "<<numinstances[k]<<" GeometricDets at level "<<k;
24  }
25 }
26 
27 void CmsTrackerDebugNavigator::iterate(const GeometricDet& in, int level, const std::vector<GeometricDetExtra>& gdes){
29  for (unsigned int k=0; k<in.components().size(); k++){
30  std::string spaces = "";
31  for(unsigned int i=0; (int)i<=level; i++) spaces+=" ";
32  const GeometricDetExtra* extra = _helperMap[in.components()[k]->geographicalId().rawId()];
33  edm::LogInfo("CmsTrackerDebugNavigator") << level << spaces
34  << "### VOLUME " << in.components()[k]->name().name()
35  << " of type " << in.components()[k]->type()
36  << " copy number " << extra->copyno()
37  << " positioned in " << in.name().name()
38  << " global position of centre " << in.components()[k]->translation()
39  // << " rotation matrix " << in.components()[k]->rotation()
40  << " volume = " << extra->volume() << " cm3"
41  << " density = " << extra->density() << " g/cm3"
42  << " weight " << extra->weight() << " g"
43  << std::endl;
44  iterate(*((in.components())[k]),level+1, gdes);
45  }
46  return;
47 }
void dump(const GeometricDet &, const std::vector< GeometricDetExtra > &)
double weight() const
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
DDName const & name() const
Definition: GeometricDet.h:146
CmsTrackerDebugNavigator(const std::vector< GeometricDetExtra > &)
double density() const
int k[5][pyjets_maxn]
double volume() const
void iterate(const GeometricDet &, int, const std::vector< GeometricDetExtra > &)
std::map< uint32_t, const GeometricDetExtra * > _helperMap
const std::string & name() const
Returns the name.
Definition: DDName.cc:88