CMS 3D CMS Logo

CmsTrackerWheelBuilder.cc
Go to the documentation of this file.
10 #include<vector>
11 
12 #include <bitset>
13 
15  CmsTrackerRingBuilder theCmsTrackerRingBuilder ;
16  CmsTrackerPetalBuilder theCmsTrackerPetalBuilder ;
17 
20  case GeometricDet::ring:
21  theCmsTrackerRingBuilder.build(fv,subdet,s);
22  break;
24  theCmsTrackerPetalBuilder.build(fv,subdet,s);
25  break;
26  default:
27  edm::LogError("CmsTrackerWheelBuilder")<<" ERROR - I was expecting a Ring or Petal, I got a "<<ExtractStringFromDDD::getString(s,&fv);
28  }
29  g->addComponent(subdet);
30 }
31 
34 
35  if(comp.size()){
36  if(comp.front()->type()==GeometricDet::petal){
39  compfw.clear();
40  compbw.clear();
41  for(uint32_t i=0; i<comp.size();i++){
42  if(fabs(comp[i]->translation().z())<fabs(det->translation().z())){
43  compfw.push_back(det->component(i));
44  }else{
45  compbw.push_back(det->component(i));
46  }
47  }
48 
49  TrackerStablePhiSort(compfw.begin(), compfw.end(), ExtractPhiModule());
50  TrackerStablePhiSort(compbw.begin(), compbw.end(), ExtractPhiModule());
51 
52  //
53  // TEC
54  // Wheel Part: 3 bits [back:1 front:2]
55  // Petal Number: 4 bits [1,...,8]
56  //
57  for(uint32_t i=0; i<compbw.size(); i++){
58  uint32_t temp = i+1;
59  temp|=(1<<4);
60  compbw[i]->setGeographicalID(DetId(temp));
61  }
62  for(uint32_t i=0; i<compfw.size(); i++){
63  uint32_t temp = i+1;
64  temp|=(2<<4);
65  compfw[i]->setGeographicalID(DetId(temp));
66  }
67 
68  det->clearComponents();
69  det->addComponents(compfw);
70  det->addComponents(compbw);
71 
72  }else{
73  std::stable_sort(comp.begin(),comp.end(),LessR_module());
74 
75  // TID
76  // Disk Number: 2 bits [1,2,3]
77  for(uint32_t i=0; i<comp.size(); i++){
78  det->component(i)->setGeographicalID(DetId(i+1));
79  }
80  }
81  }else{
82  edm::LogError("CmsTrackerWheelBuilder")<<"Where are the Petals or Rings?";
83  }
84 
85 }
86 
87 
88 
89 
static std::string getString(std::string const &, DDFilteredView *)
void addComponent(GeometricDet *)
void clearComponents()
Definition: GeometricDet.h:98
void setGeographicalID(DetId id)
Definition: GeometricDet.h:82
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
virtual void build(DDFilteredView &, GeometricDet *, std::string)
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
Definition: DetId.h:18
virtual void sortNS(DDFilteredView &, GeometricDet *)
virtual void buildComponent(DDFilteredView &, GeometricDet *, std::string)
void addComponents(GeometricDetContainer const &cont)
GeometricDet::GeometricEnumType type(std::string const &) const
CmsTrackerStringToEnum theCmsTrackerStringToEnum