CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CmsTrackerDiskBuilder.cc
Go to the documentation of this file.
9 #include <vector>
10 #include <algorithm>
11 
12 using namespace std;
13 
14 void
16 {
17  CmsTrackerPanelBuilder theCmsTrackerPanelBuilder;
18  GeometricDet * subdet = new GeometricDet( &fv, theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString( s, &fv )));
19 
20  switch( theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString( s, &fv )))
21  {
23  theCmsTrackerPanelBuilder.build( fv, subdet, s );
24  break;
25  default:
26  edm::LogError( "CmsTrackerDiskBuilder" ) << " ERROR - I was expecting a Panel, I got a " << ExtractStringFromDDD::getString( s, &fv );
27  }
28  g->addComponent( subdet );
29 }
30 
31 void
33 {
34 
35 
37 
38  switch( det->components().front()->type())
39  {
41  TrackerStablePhiSort( comp.begin(), comp.end(), ExtractPhi());
42  break;
43  default:
44  edm::LogError( "CmsTrackerDiskBuilder" ) << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
45  }
46 
47  GeometricDet::GeometricDetContainer zminpanels; // Here z refers abs(z);
48  GeometricDet::GeometricDetContainer zmaxpanels; // So, zmin panel is always closer to ip.
49 
50  uint32_t totalblade = comp.size()/2;
51  // std::cout << "pixel_disk " << pixel_disk << endl;
52 
53  zminpanels.reserve( totalblade );
54  zmaxpanels.reserve( totalblade );
55  for( uint32_t j = 0; j < totalblade; j++ )
56  {
57  if( fabs( comp[2*j]->translation().z()) > fabs( comp[ 2*j +1 ]->translation().z()))
58  {
59  zmaxpanels.push_back( det->component(2*j) );
60  zminpanels.push_back( det->component(2*j+1) );
61 
62  }
63  else if( fabs( comp[2*j]->translation().z()) < fabs( comp[ 2*j +1 ]->translation().z()))
64  {
65  zmaxpanels.push_back( det->component(2*j+1) );
66  zminpanels.push_back( det->component(2*j) );
67  }
68  else
69  {
70  edm::LogWarning( "CmsTrackerDiskBuilder" ) << "WARNING - The Z of both panels are equal! ";
71  }
72  }
73 
74  for( uint32_t fn = 0; fn < zminpanels.size(); fn++ )
75  {
76  uint32_t blade = fn + 1;
77  uint32_t panel = 1;
78  uint32_t temp = ( blade << 2 ) | panel;
79  zminpanels[fn]->setGeographicalID( temp );
80  }
81 
82  for( uint32_t bn = 0; bn < zmaxpanels.size(); bn++)
83  {
84  uint32_t blade = bn + 1;
85  uint32_t panel = 2;
86  uint32_t temp = ( blade << 2) | panel;
87  zmaxpanels[bn]->setGeographicalID( temp );
88  }
89 
90  det->clearComponents();
91  det->addComponents( zminpanels );
92  det->addComponents( zmaxpanels );
93 
94 }
95 
static std::string getString(std::string const &, DDFilteredView *)
virtual void sortNS(DDFilteredView &, GeometricDet *)
void addComponent(GeometricDet *)
void clearComponents()
Definition: GeometricDet.h:96
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:37
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:174
virtual void build(DDFilteredView &, GeometricDet *, std::string)
void TrackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
virtual void buildComponent(DDFilteredView &, GeometricDet *, std::string)
int j
Definition: DBlmapReader.cc:9
GeometricDet * component(size_t index)
Definition: GeometricDet.h:112
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
void addComponents(GeometricDetContainer const &cont)