CMS 3D CMS Logo

List of all members | Private Member Functions
CmsTrackerWheelBuilder< FilteredView > Class Template Reference

#include <CmsTrackerWheelBuilder.h>

Inheritance diagram for CmsTrackerWheelBuilder< FilteredView >:
CmsTrackerLevelBuilder< FilteredView > CmsTrackerAbstractConstruction< FilteredView >

Private Member Functions

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

Additional Inherited Members

- Public Member Functions inherited from CmsTrackerLevelBuilder< FilteredView >
void build (FilteredView &, GeometricDet *, const std::string &) override
 
template<>
void build (DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
template<>
void build (cms::DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
 ~CmsTrackerLevelBuilder () override
 
- Public Member Functions inherited from CmsTrackerAbstractConstruction< FilteredView >
virtual ~CmsTrackerAbstractConstruction ()=default
 
- Protected Attributes inherited from CmsTrackerLevelBuilder< FilteredView >
CmsTrackerStringToEnum theCmsTrackerStringToEnum
 

Detailed Description

template<class FilteredView>
class CmsTrackerWheelBuilder< FilteredView >

Class which builds TEC wheels

Definition at line 12 of file CmsTrackerWheelBuilder.h.

Member Function Documentation

◆ buildComponent()

template<class FilteredView >
void CmsTrackerWheelBuilder< FilteredView >::buildComponent ( FilteredView &  fv,
GeometricDet g,
const std::string &  s 
)
overrideprivatevirtual

Implements CmsTrackerLevelBuilder< FilteredView >.

Definition at line 16 of file CmsTrackerWheelBuilder.cc.

References CmsTrackerLevelBuilder< FilteredView >::build(), g, ExtractStringFromDDD< FilteredView >::getString(), GeometricDet::petal, GeometricDet::ring, and alignCSCRings::s.

16  {
17  CmsTrackerRingBuilder<FilteredView> theCmsTrackerRingBuilder;
18  CmsTrackerPetalBuilder<FilteredView> theCmsTrackerPetalBuilder;
19 
20  GeometricDet* subdet = new GeometricDet(&fv,
25  case GeometricDet::ring:
26  theCmsTrackerRingBuilder.build(fv, subdet, s);
27  break;
29  theCmsTrackerPetalBuilder.build(fv, subdet, s);
30  break;
31  default:
32  edm::LogError("CmsTrackerWheelBuilder") << " ERROR - I was expecting a Ring or Petal, I got a "
34  }
35  g->addComponent(subdet);
36 }
static std::string getString(const std::string &, FilteredView *)
Log< level::Error, false > LogError
void build(FilteredView &, GeometricDet *, const std::string &) override
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

◆ sortNS()

template<class FilteredView >
void CmsTrackerWheelBuilder< FilteredView >::sortNS ( FilteredView &  fv,
GeometricDet det 
)
overrideprivatevirtual

Reimplemented from CmsTrackerLevelBuilder< FilteredView >.

Definition at line 39 of file CmsTrackerWheelBuilder.cc.

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

39  {
41 
42  if (!comp.empty()) {
43  if (comp.front()->type() == GeometricDet::petal) {
46  compfw.clear();
47  compbw.clear();
48  for (uint32_t i = 0; i < comp.size(); i++) {
49  if (std::abs(comp[i]->translation().z()) < std::abs(det->translation().z())) {
50  compfw.emplace_back(det->component(i));
51  } else {
52  compbw.emplace_back(det->component(i));
53  }
54  }
55 
58 
59  //
60  // TEC
61  // Wheel Part: 3 bits [back:1 front:2]
62  // Petal Number: 4 bits [1,...,8]
63  //
64  for (uint32_t i = 0; i < compbw.size(); i++) {
65  uint32_t temp = i + 1;
66  temp |= (1 << 4);
67  compbw[i]->setGeographicalID(DetId(temp));
68  }
69  for (uint32_t i = 0; i < compfw.size(); i++) {
70  uint32_t temp = i + 1;
71  temp |= (2 << 4);
72  compfw[i]->setGeographicalID(DetId(temp));
73  }
74 
75  det->clearComponents();
76  det->addComponents(compfw);
77  det->addComponents(compbw);
78 
79  } else {
80  std::stable_sort(comp.begin(), comp.end(), CmsTrackerLevelBuilderHelper::isLessRModule);
81 
82  // TID
83  // Disk Number: 2 bits [1,2,3]
84  for (uint32_t i = 0; i < comp.size(); i++) {
85  det->component(i)->setGeographicalID(DetId(i + 1));
86  }
87  }
88  } else {
89  edm::LogError("CmsTrackerWheelBuilder") << "Where are the Petals or Rings?";
90  }
91 }
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:35
void clearComponents()
Definition: GeometricDet.h:165
void setGeographicalID(DetId id)
Definition: GeometricDet.h:100
Log< level::Error, false > LogError
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:154
const Translation & translation() const
Definition: GeometricDet.h:103
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GeometricDet * component(size_t index)
Definition: GeometricDet.h:150
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:34
void trackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
static double getPhiModule(const GeometricDet *a)
Definition: DetId.h:17
void addComponents(GeometricDetContainer const &cont)
static bool isLessRModule(const GeometricDet *a, const GeometricDet *b)