CMS 3D CMS Logo

CmsTrackerRingBuilder.cc
Go to the documentation of this file.
9 #include <vector>
10 
11 #include <bitset>
12 
14  CmsDetConstruction theCmsDetConstruction;
15  theCmsDetConstruction.buildComponent(fv,g,s);
16 }
17 
20  fv.firstChild();
23 
24 
25  switch(comp.front()->type()) {
26 
28  TrackerStablePhiSort(comp.begin(), comp.end(), ExtractPhiGluedModule());
29  break;
31  TrackerStablePhiSort(comp.begin(), comp.end(), ExtractPhi());
32  break;
33  default:
34  edm::LogError("CmsTrackerRingBuilder")<<"ERROR - wrong SubDet to sort..... "<<det->components().front()->type();
35  }
36 
37  static std::string const part("TkDDDStructure");
38  static std::string const TECGluedDet("TECGluedDet");
39  static std::string const TECDet("TECDet");
40 
42 
43  // TEC
44  // Module Number: 3 bits [1,...,5 at most]
45  if(pname== TECGluedDet || pname == TECDet){
46 
47  // TEC-
48  if( det->translation().z() < 0 && pname == TECDet) {
49  TrackerStablePhiSort(comp.begin(), comp.end(), ExtractPhiMirror());
50  }
51 
52  if( det->translation().z() < 0 && pname == TECGluedDet) {
53  TrackerStablePhiSort(comp.begin(), comp.end(), ExtractPhiGluedModuleMirror());
54  }
55 
56  for(uint32_t i=0; i<comp.size();i++)
57  det->component(i)->setGeographicalID(i+1);
58 
59  } else {
60  // TID
61  // Ring Side: 2 bits [back:1 front:2]
62  // Module Number: 5 bits [1,...,20 at most]
63  //
64  for(uint32_t i=0; i<comp.size();i++){
65  if(fabs(comp[i]->translation().z())<fabs(det->translation().z())){
66  compfw.push_back(det->component(i));
67  } else {
68  compbw.push_back(det->component(i));
69  }
70  }
71 
72  for(uint32_t i=0; i<compbw.size();i++){
73  uint32_t temp = i+1;
74  temp |=(1<<5);
75  compbw[i]->setGeographicalID(temp);
76  }
77 
78  for(uint32_t i=0; i<compfw.size();i++){
79  uint32_t temp = i+1;
80  temp |=(2<<5);
81  compfw[i]->setGeographicalID(temp);
82  }
83 
84  det->clearComponents();
85  det->addComponents(compfw);
86  det->addComponents(compbw);
87 
88  }
89 
90  fv.parent();
91 
92 }
93 
94 
95 
96 
97 
static std::string getString(std::string const &, DDFilteredView *)
bool parent()
set the current node to the parent node ...
void clearComponents()
Definition: GeometricDet.h:98
void setGeographicalID(DetId id)
Definition: GeometricDet.h:82
void buildComponent(DDFilteredView &, GeometricDet *, std::string)
virtual void sortNS(DDFilteredView &, GeometricDet *)
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
virtual void buildComponent(DDFilteredView &, GeometricDet *, std::string)
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
void TrackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
DDTranslation const & translation() const
Definition: GeometricDet.h:125
GeometricDet * component(size_t index)
Definition: GeometricDet.h:114
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
part
Definition: HCALResponse.h:20
void addComponents(GeometricDetContainer const &cont)
bool firstChild()
set the current node to the first child ...