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 15 of file CmsTrackerOTLayerBuilder.cc.

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

15  {
16 
17  LogTrace("DetConstruction") << " CmsTrackerOTLayerBuilder::buildComponent ";
18  CmsTrackerLadderBuilder theCmsTrackerLadderBuilder;
19  CmsTrackerOTRingBuilder theCmsTrackerOTRingBuilder;
20 
24  theCmsTrackerLadderBuilder.build(fv,subdet,s);
25  break;
27  theCmsTrackerOTRingBuilder.build( fv, subdet, s );
28  break;
29  default:
30  edm::LogError("CmsTrackerOTLayerBuilder")<<" ERROR - I was expecting a ladder or a panel, I got a "<<ExtractStringFromDDD::getString(s,&fv);
31  }
32  g->addComponent(subdet);
33 
34 }
static std::string getString(std::string const &, DDFilteredView *)
void addComponent(GeometricDet *)
void build(DDFilteredView &, GeometricDet *, std::string) override
#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 36 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().

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