CMS 3D CMS Logo

List of all members | Private Member Functions
CmsTrackerDiskBuilder Class Reference

#include <CmsTrackerDiskBuilder.h>

Inheritance diagram for CmsTrackerDiskBuilder:
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 PixelForward/Disk.

Definition at line 11 of file CmsTrackerDiskBuilder.h.

Member Function Documentation

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

Implements CmsTrackerLevelBuilder.

Definition at line 16 of file CmsTrackerDiskBuilder.cc.

References GeometricDet::addComponent(), CmsTrackerLevelBuilder::build(), ExtractStringFromDDD::getString(), and GeometricDet::panel.

17 {
18  CmsTrackerPanelBuilder theCmsTrackerPanelBuilder;
20 
22  {
24  theCmsTrackerPanelBuilder.build( fv, subdet, s );
25  break;
26  default:
27  edm::LogError( "CmsTrackerDiskBuilder" ) << " ERROR - I was expecting a Panel, 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 CmsTrackerDiskBuilder::sortNS ( DDFilteredView fv,
GeometricDet det 
)
overrideprivatevirtual

Reimplemented from CmsTrackerLevelBuilder.

Definition at line 33 of file CmsTrackerDiskBuilder.cc.

References funct::abs(), GeometricDet::addComponents(), GeometricDet::clearComponents(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::component(), GeometricDet::components(), GeometricDet::panel, groupFilesInBlocks::temp, and trackerStablePhiSort().

34 {
35 
36 
38 
39  switch( det->components().front()->type())
40  {
42  trackerStablePhiSort( comp.begin(), comp.end(), getPhi);
43  break;
44  default:
45  edm::LogError( "CmsTrackerDiskBuilder" ) << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
46  }
47 
48  GeometricDet::GeometricDetContainer zminpanels; // Here z refers abs(z);
49  GeometricDet::GeometricDetContainer zmaxpanels; // So, zmin panel is always closer to ip.
50 
51  uint32_t totalblade = comp.size()/2;
52  // std::cout << "pixel_disk " << pixel_disk << endl;
53 
54  zminpanels.reserve( totalblade );
55  zmaxpanels.reserve( totalblade );
56  for( uint32_t j = 0; j < totalblade; j++ )
57  {
58  if( std::abs( comp[2*j]->translation().z()) > std::abs( comp[ 2*j +1 ]->translation().z()))
59  {
60  zmaxpanels.emplace_back( det->component(2*j) );
61  zminpanels.emplace_back( det->component(2*j+1) );
62 
63  }
64  else if( std::abs( comp[2*j]->translation().z()) < std::abs( comp[ 2*j +1 ]->translation().z()))
65  {
66  zmaxpanels.emplace_back( det->component(2*j+1) );
67  zminpanels.emplace_back( det->component(2*j) );
68  }
69  else
70  {
71  edm::LogWarning( "CmsTrackerDiskBuilder" ) << "WARNING - The Z of both panels are equal! ";
72  }
73  }
74 
75  for( uint32_t fn = 0; fn < zminpanels.size(); fn++ )
76  {
77  uint32_t blade = fn + 1;
78  uint32_t panel = 1;
79  uint32_t temp = ( blade << 2 ) | panel;
80  zminpanels[fn]->setGeographicalID( temp );
81  }
82 
83  for( uint32_t bn = 0; bn < zmaxpanels.size(); bn++)
84  {
85  uint32_t blade = bn + 1;
86  uint32_t panel = 2;
87  uint32_t temp = ( blade << 2) | panel;
88  zmaxpanels[bn]->setGeographicalID( temp );
89  }
90 
91  det->clearComponents();
92  det->addComponents( zminpanels );
93  det->addComponents( zmaxpanels );
94 
95 }
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
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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
void addComponents(GeometricDetContainer const &cont)