CMS 3D CMS Logo

List of all members | Private Member Functions
CmsTrackerOTLayerBuilder Class Reference

#include <CmsTrackerOTLayerBuilder.h>

Inheritance diagram for CmsTrackerOTLayerBuilder:
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 contructs TIB/TOB layers

Definition at line 10 of file CmsTrackerOTLayerBuilder.h.

Member Function Documentation

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

Implements CmsTrackerLevelBuilder.

Definition at line 14 of file CmsTrackerOTLayerBuilder.cc.

References GeometricDet::addComponent(), CmsTrackerLevelBuilder::build(), ExtractStringFromDDD::getString(), GeometricDet::ladder, LogTrace, GeometricDet::panel, CmsTrackerLevelBuilder::theCmsTrackerStringToEnum, and CmsTrackerStringToEnum::type().

14  {
15 
16  LogTrace("DetConstruction") << " CmsTrackerOTLayerBuilder::buildComponent ";
17  CmsTrackerLadderBuilder theCmsTrackerLadderBuilder;
18  CmsTrackerOTRingBuilder theCmsTrackerOTRingBuilder;
19 
23  theCmsTrackerLadderBuilder.build(fv,subdet,s);
24  break;
26  theCmsTrackerOTRingBuilder.build( fv, subdet, s );
27  break;
28  default:
29  edm::LogError("CmsTrackerOTLayerBuilder")<<" ERROR - I was expecting a ladder or a panel, I got a "<<ExtractStringFromDDD::getString(s,&fv);
30  }
31  g->addComponent(subdet);
32 
33 }
void addComponent(GeometricDet *)
void build(DDFilteredView &, GeometricDet *, std::string) override
static std::string getString(std::string const &, DDFilteredView *)
#define LogTrace(id)
GeometricDet::GeometricEnumType type(std::string const &) const
CmsTrackerStringToEnum theCmsTrackerStringToEnum
void CmsTrackerOTLayerBuilder::sortNS ( DDFilteredView fv,
GeometricDet det 
)
overrideprivatevirtual

Reimplemented from CmsTrackerLevelBuilder.

Definition at line 35 of file CmsTrackerOTLayerBuilder.cc.

References GeometricDet::addComponents(), GeometricDet::clearComponents(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::component(), GeometricDet::components(), CmsTrackerLevelBuilder::getPhi(), mps_fire::i, CmsTrackerLevelBuilder::isLessZ(), GeometricDet::ladder, LogTrace, GeometricDet::panel, relativeConstraints::ring, mathSSE::sqrt(), groupFilesInBlocks::temp, and trackerStablePhiSort().

35  {
36 
38 
39  //order ladder and rings together
43  rods.clear();
44  ringsNeg.clear();
45  ringsPos.clear();
46 
47  for(uint32_t i=0; i<comp.size();i++){
48  auto component = det->component(i);
49  if(component->type()== GeometricDet::ladder){
50  rods.emplace_back(component);
51  } else if(component->type()== GeometricDet::panel){
52  if(component->translation().z() < 0.){
53  ringsNeg.emplace_back(component);
54  } else if (component->translation().z() > 0.) {
55  ringsPos.emplace_back(component);
56  }
57  } else {
58  edm::LogError("CmsTrackerOTLayerBuilder")<<"ERROR - wrong SubDet to sort..... "<<det->components().front()->type();
59  }
60  }
61 
62  // negative rings
63  if(!ringsNeg.empty()){
64  std::sort(ringsNeg.begin(),ringsNeg.end(),isLessZ);
65  uint32_t totalringsNeg = ringsNeg.size();
66 
67  LogTrace("DetConstruction") << " Neg rings ordered by z: ";
68  for ( uint32_t ring = 0; ring < totalringsNeg; ring++) {
69  uint32_t temp = ring+1;
70  temp|=(1<<8);
71  ringsNeg[ring]->setGeographicalID(temp);
72  LogTrace("BuildingTrackerDetId") << "\t\t\t DetId >> " << temp << "(r: " << sqrt(ringsNeg[ring]->translation().Perp2()) << ", phi: " << ringsNeg[ring]->phi() << ", z: " << ringsNeg[ring]->translation().z() << ")";
73  }
74  }
75 
76  // rods
77  if(!rods.empty()){
78  trackerStablePhiSort(rods.begin(), rods.end(), getPhi);
79  uint32_t totalrods = rods.size();
80 
81  LogTrace("DetConstruction") << " Rods ordered by phi: ";
82  for ( uint32_t rod = 0; rod < totalrods; rod++) {
83  uint32_t temp = rod+1;
84  temp|=(3<<8);
85  rods[rod]->setGeographicalID(DetId(temp));
86  LogTrace("BuildingTrackerDetId") << "\t\t\t DetId >> " << temp << "(r: " << sqrt(rods[rod]->translation().Perp2()) << ", phi: " << rods[rod]->phi() << ", z: " << rods[rod]->translation().z() << ")";
87  }
88  }
89 
90  // positive rings
91  if(!ringsPos.empty()){
92  std::sort(ringsPos.begin(),ringsPos.end(),isLessZ);
93  uint32_t totalringsPos = ringsPos.size();
94 
95 
96  LogTrace("DetConstruction") << " Pos rings ordered by z: ";
97  for ( uint32_t ring = 0; ring < totalringsPos; ring++) {
98  uint32_t temp = ring+1;
99  temp|=(2<<8);
100  ringsPos[ring]->setGeographicalID(temp);
101  LogTrace("BuildingTrackerDetId") << "\t\t\t DetId >> " << temp << "(r: " << sqrt(ringsPos[ring]->translation().Perp2()) << ", phi: " << ringsPos[ring]->phi() << ", z: " << ringsPos[ring]->translation().z() << ")";
102  }
103  }
104 
105  det->clearComponents();
106  det->addComponents(ringsNeg);
107  det->addComponents(rods);
108  det->addComponents(ringsPos);
109 
110 }
static bool isLessZ(const GeometricDet *a, const GeometricDet *b)
static double getPhi(const GeometricDet *a)
void clearComponents()
Definition: GeometricDet.h:98
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:37
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:176
T sqrt(T t)
Definition: SSEVec.h:18
GeometricDet * component(size_t index)
Definition: GeometricDet.h:114
void trackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
#define LogTrace(id)
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
Definition: DetId.h:18
void addComponents(GeometricDetContainer const &cont)