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 
11 
13 
14  CmsTrackerPanelBuilder theCmsTrackerPanelBuilder;
16 
19  theCmsTrackerPanelBuilder.build(fv,subdet,s);
20  break;
21  default:
22  edm::LogError("CmsTrackerDiskBuilder")<<" ERROR - I was expecting a Panel, I got a "<<ExtractStringFromDDD::getString(s,&fv);
23  }
24  g->addComponent(subdet);
25 }
26 
28 
30 
31  switch(det->components().front()->type()){
33  TrackerStablePhiSort(comp.begin(),comp.end(), ExtractPhi());
34  break;
35  default:
36  edm::LogError("CmsTrackerDiskBuilder")<<"ERROR - wrong SubDet to sort..... "<<det->components().front()->type();
37  }
38 
39  GeometricDet::GeometricDetContainer zminpanels; // Here z refers abs(z);
40  GeometricDet::GeometricDetContainer zmaxpanels; // So, zmin panel is always closer to ip.
41 
42  uint32_t totalblade = comp.size()/2;
43  if ( totalblade != 24 )
44  edm::LogError("CmsTrackerDiskBuilder")<<"ERROR, The Total Number of Blade in one disk is "<<totalblade;
45 
46  zminpanels.reserve(totalblade);
47  zmaxpanels.reserve(totalblade);
48  for( uint32_t j=0; j<totalblade ;j++)
49  {
50  if ( fabs( comp[2*j]->translation().z() ) > fabs( comp[ 2*j +1 ]->translation().z() ) ) {
51  zmaxpanels.push_back(comp[2*j] );
52  zminpanels.push_back(comp[2*j+1]);
53 
54  }else if ( fabs( comp[2*j]->translation().z() ) < fabs( comp[ 2*j +1 ]->translation().z() ) ) {
55  zmaxpanels.push_back(comp[2*j+1] );
56  zminpanels.push_back(comp[2*j]);
57 
58  }else {
59  edm::LogWarning("CmsTrackerDiskBuilder")<<"WARNING - The Z of both panels are equal! ";
60  }
61 
62  }
63 
64  for ( uint32_t fn=0; fn< zminpanels.size(); fn++) {
65  uint32_t blade = fn+1;
66  uint32_t panel = 1;
67  uint32_t temp = (blade<<2) | panel;
68  zminpanels[fn]->setGeographicalID(temp);
69  }
70 
71  for (uint32_t bn=0; bn< zmaxpanels.size(); bn++) {
72  uint32_t blade = bn+1;
73  uint32_t panel = 2;
74  uint32_t temp = (blade<<2) | panel;
75  zmaxpanels[bn]->setGeographicalID(temp);
76  }
77 
78  det->clearComponents();
79 
80  det->addComponents(zminpanels);
81  det->addComponents(zmaxpanels);
82 }
static std::string getString(std::string const &, DDFilteredView *)
virtual void sortNS(DDFilteredView &, GeometricDet *)
void addComponent(GeometricDet *)
void clearComponents()
Definition: GeometricDet.h:89
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
double double double z
std::vector< GeometricDet const * > GeometricDetContainer
Definition: GeometricDet.h:36
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
GeometricDetContainer & components()
Definition: GeometricDet.h:163
void addComponents(GeometricDetContainer const &cont)
GeometricDet::GeometricEnumType type(std::string const &) const
CmsTrackerStringToEnum theCmsTrackerStringToEnum