CMS 3D CMS Logo

List of all members | Private Member Functions
CmsTrackerRingBuilder Class Reference

#include <CmsTrackerRingBuilder.h>

Inheritance diagram for CmsTrackerRingBuilder:
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 constructs TID/TEC rings

Definition at line 10 of file CmsTrackerRingBuilder.h.

Member Function Documentation

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

Implements CmsTrackerLevelBuilder.

Definition at line 13 of file CmsTrackerRingBuilder.cc.

References CmsDetConstruction::buildComponent().

13  {
14  CmsDetConstruction theCmsDetConstruction;
15  theCmsDetConstruction.buildComponent(fv,g,s);
16 }
void buildComponent(DDFilteredView &, GeometricDet *, std::string) override
void CmsTrackerRingBuilder::sortNS ( DDFilteredView fv,
GeometricDet det 
)
overrideprivatevirtual

Reimplemented from CmsTrackerLevelBuilder.

Definition at line 18 of file CmsTrackerRingBuilder.cc.

References funct::abs(), GeometricDet::addComponents(), GeometricDet::clearComponents(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::component(), GeometricDet::components(), GeometricDet::DetUnit, DDFilteredView::firstChild(), CmsTrackerLevelBuilder::getPhi(), CmsTrackerLevelBuilder::getPhiGluedModule(), CmsTrackerLevelBuilder::getPhiGluedModuleMirror(), CmsTrackerLevelBuilder::getPhiMirror(), ExtractStringFromDDD::getString(), mps_fire::i, GeometricDet::mergedDet, DDFilteredView::parent(), BPhysicsValidation_cfi::pname, GeometricDet::setGeographicalID(), AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, TrackerStablePhiSort(), GeometricDet::translation(), and z.

18  {
20  fv.firstChild();
23 
24 
25  switch(comp.front()->type()) {
26 
28  TrackerStablePhiSort(comp.begin(), comp.end(), std::function<double(const GeometricDet*)>(getPhiGluedModule));
29  break;
31  TrackerStablePhiSort(comp.begin(), comp.end(), std::function<double(const GeometricDet*)>(getPhi));
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(), std::function<double(const GeometricDet*)>(getPhiMirror));
50  }
51 
52  if( det->translation().z() < 0 && pname == TECGluedDet) {
53  TrackerStablePhiSort(comp.begin(), comp.end(), std::function<double(const GeometricDet*)>(getPhiGluedModuleMirror));
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(std::abs(comp[i]->translation().z())<std::abs(det->translation().z())){
66  compfw.emplace_back(det->component(i));
67  } else {
68  compbw.emplace_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 }
static std::string getString(std::string const &, DDFilteredView *)
bool parent()
set the current node to the parent node ...
static double getPhiMirror(const GeometricDet *a)
static double getPhi(const GeometricDet *a)
void clearComponents()
Definition: GeometricDet.h:98
void setGeographicalID(DetId id)
Definition: GeometricDet.h:82
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:37
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
void TrackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
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
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
static double getPhiGluedModuleMirror(const GeometricDet *a)
part
Definition: HCALResponse.h:20
void addComponents(GeometricDetContainer const &cont)
static double getPhiGluedModule(const GeometricDet *a)
bool firstChild()
set the current node to the first child ...