CMS 3D CMS Logo

List of all members | Private Member Functions
CmsTrackerWheelBuilder Class Reference

#include <CmsTrackerWheelBuilder.h>

Inheritance diagram for CmsTrackerWheelBuilder:
CmsTrackerLevelBuilder CmsTrackerAbstractConstruction

Private Member Functions

void buildComponent (DDFilteredView &, GeometricDet *, std::string) override
 
void sortNS (DDFilteredView &, GeometricDet *) override
 

Additional Inherited Members

- Public Member Functions inherited from CmsTrackerLevelBuilder
void build (DDFilteredView &, GeometricDet *, std::string) override
 
 ~CmsTrackerLevelBuilder () override
 
- Public Member Functions inherited from CmsTrackerAbstractConstruction
virtual ~CmsTrackerAbstractConstruction ()=default
 
- Static Public Member Functions inherited from CmsTrackerLevelBuilder
static double getPhi (const GeometricDet *a)
 
static double getPhiGluedModule (const GeometricDet *a)
 
static double getPhiGluedModuleMirror (const GeometricDet *a)
 
static double getPhiMirror (const GeometricDet *a)
 
static double getPhiModule (const GeometricDet *a)
 
static double getPhiModuleMirror (const GeometricDet *a)
 
static bool isLessModZ (const GeometricDet *a, const GeometricDet *b)
 
static bool isLessR (const GeometricDet *a, const GeometricDet *b)
 
static bool isLessRModule (const GeometricDet *a, const GeometricDet *b)
 
static bool isLessZ (const GeometricDet *a, const GeometricDet *b)
 
static bool phiSortNP (const GeometricDet *a, const GeometricDet *b)
 
static bool subDetByType (const GeometricDet *a, const GeometricDet *b)
 
- Protected Attributes inherited from CmsTrackerLevelBuilder
CmsTrackerStringToEnum theCmsTrackerStringToEnum
 

Detailed Description

Class which builds TEC wheels

Definition at line 11 of file CmsTrackerWheelBuilder.h.

Member Function Documentation

void CmsTrackerWheelBuilder::buildComponent ( DDFilteredView fv,
GeometricDet g,
std::string  s 
)
overrideprivatevirtual

Implements CmsTrackerLevelBuilder.

Definition at line 14 of file CmsTrackerWheelBuilder.cc.

References GeometricDet::addComponent(), CmsTrackerLevelBuilder::build(), ExtractStringFromDDD::getString(), GeometricDet::petal, GeometricDet::ring, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum, and CmsTrackerStringToEnum::type().

14  {
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 }
void addComponent(GeometricDet *)
void build(DDFilteredView &, GeometricDet *, std::string) override
static std::string getString(std::string const &, DDFilteredView *)
GeometricDet::GeometricEnumType type(std::string const &) const
CmsTrackerStringToEnum theCmsTrackerStringToEnum
void CmsTrackerWheelBuilder::sortNS ( DDFilteredView fv,
GeometricDet det 
)
overrideprivatevirtual

Reimplemented from CmsTrackerLevelBuilder.

Definition at line 32 of file CmsTrackerWheelBuilder.cc.

References funct::abs(), GeometricDet::addComponents(), GeometricDet::clearComponents(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::component(), GeometricDet::components(), CmsTrackerLevelBuilder::getPhiModule(), mps_fire::i, CmsTrackerLevelBuilder::isLessRModule(), GeometricDet::petal, GeometricDet::setGeographicalID(), groupFilesInBlocks::temp, trackerStablePhiSort(), GeometricDet::translation(), and z.

32  {
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 }
void clearComponents()
Definition: GeometricDet.h:98
void setGeographicalID(DetId id)
Definition: GeometricDet.h:82
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:37
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
Definition: DetId.h:18
void addComponents(GeometricDetContainer const &cont)