CMS 3D CMS Logo

CmsTrackerDiskBuilder.cc
Go to the documentation of this file.
9 
10 #include <vector>
11 #include <algorithm>
12 
13 using namespace std;
14 
15 void
17 {
18  CmsTrackerPanelBuilder theCmsTrackerPanelBuilder;
19  GeometricDet * subdet = new GeometricDet( &fv, theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString( s, &fv )));
20 
21  switch( theCmsTrackerStringToEnum.type( ExtractStringFromDDD::getString( s, &fv )))
22  {
24  theCmsTrackerPanelBuilder.build( fv, subdet, s );
25  break;
26  default:
27  edm::LogError( "CmsTrackerDiskBuilder" ) << " ERROR - I was expecting a Panel, I got a " << ExtractStringFromDDD::getString( s, &fv );
28  }
29  g->addComponent( subdet );
30 }
31 
32 void
34 {
35 
36 
38 
39  switch( det->components().front()->type())
40  {
42  trackerStablePhiSort( comp.begin(), comp.end(), getPhi);
43  break;
44  default:
45  edm::LogError( "CmsTrackerDiskBuilder" ) << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
46  }
47 
48  GeometricDet::GeometricDetContainer zminpanels; // Here z refers abs(z);
49  GeometricDet::GeometricDetContainer zmaxpanels; // So, zmin panel is always closer to ip.
50 
51  uint32_t totalblade = comp.size()/2;
52  // std::cout << "pixel_disk " << pixel_disk << endl;
53 
54  zminpanels.reserve( totalblade );
55  zmaxpanels.reserve( totalblade );
56  for( uint32_t j = 0; j < totalblade; j++ )
57  {
58  if( std::abs( comp[2*j]->translation().z()) > std::abs( comp[ 2*j +1 ]->translation().z()))
59  {
60  zmaxpanels.emplace_back( det->component(2*j) );
61  zminpanels.emplace_back( det->component(2*j+1) );
62 
63  }
64  else if( std::abs( comp[2*j]->translation().z()) < std::abs( comp[ 2*j +1 ]->translation().z()))
65  {
66  zmaxpanels.emplace_back( det->component(2*j+1) );
67  zminpanels.emplace_back( det->component(2*j) );
68  }
69  else
70  {
71  edm::LogWarning( "CmsTrackerDiskBuilder" ) << "WARNING - The Z of both panels are equal! ";
72  }
73  }
74 
75  for( uint32_t fn = 0; fn < zminpanels.size(); fn++ )
76  {
77  uint32_t blade = fn + 1;
78  uint32_t panel = 1;
79  uint32_t temp = ( blade << 2 ) | panel;
80  zminpanels[fn]->setGeographicalID( temp );
81  }
82 
83  for( uint32_t bn = 0; bn < zmaxpanels.size(); bn++)
84  {
85  uint32_t blade = bn + 1;
86  uint32_t panel = 2;
87  uint32_t temp = ( blade << 2) | panel;
88  zmaxpanels[bn]->setGeographicalID( temp );
89  }
90 
91  det->clearComponents();
92  det->addComponents( zminpanels );
93  det->addComponents( zmaxpanels );
94 
95 }
96 
void sortNS(DDFilteredView &, GeometricDet *) override
void buildComponent(DDFilteredView &, GeometricDet *, std::string) override
void addComponent(GeometricDet *)
void build(DDFilteredView &, GeometricDet *, std::string) override
void clearComponents()
Definition: GeometricDet.h:98
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:176
static std::string getString(std::string const &, DDFilteredView *)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GeometricDet * component(size_t index)
Definition: GeometricDet.h:114
void trackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
void addComponents(GeometricDetContainer const &cont)