CMS 3D CMS Logo

CmsTrackerWheelBuilder.cc
Go to the documentation of this file.
10 
11 #include <vector>
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.empty()){
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(std::abs(comp[i]->translation().z())<std::abs(det->translation().z())){
43  compfw.emplace_back(det->component(i));
44  }else{
45  compbw.emplace_back(det->component(i));
46  }
47  }
48 
49  trackerStablePhiSort(compfw.begin(), compfw.end(), getPhiModule);
50  trackerStablePhiSort(compbw.begin(), compbw.end(), getPhiModule);
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(),isLessRModule);
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 build(DDFilteredView &, GeometricDet *, std::string) override
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
void buildComponent(DDFilteredView &, GeometricDet *, std::string) override
static double getPhiModule(const GeometricDet *a)
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
static bool isLessRModule(const GeometricDet *a, const GeometricDet *b)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DDTranslation const & translation() const
Definition: GeometricDet.h:125
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 sortNS(DDFilteredView &, GeometricDet *) override
Definition: DetId.h:18
void addComponents(GeometricDetContainer const &cont)
GeometricDet::GeometricEnumType type(std::string const &) const
CmsTrackerStringToEnum theCmsTrackerStringToEnum