CMS 3D CMS Logo

List of all members | Private Member Functions | Static Private Member Functions
CmsTrackerPhase1DiskBuilder Class Reference

#include <CmsTrackerPhase1DiskBuilder.h>

Inheritance diagram for CmsTrackerPhase1DiskBuilder:
CmsTrackerLevelBuilder CmsTrackerAbstractConstruction

Private Member Functions

void buildComponent (DDFilteredView &, GeometricDet *, std::string) override
 
void PhiPosNegSplit_innerOuter (std::vector< GeometricDet const * >::iterator begin, std::vector< GeometricDet const * >::iterator end)
 
void sortNS (DDFilteredView &, GeometricDet *) override
 

Static Private Member Functions

static bool PhiSort (const GeometricDet *Panel1, const GeometricDet *Panel2)
 

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 CmsTrackerPhase1DiskBuilder.h.

Member Function Documentation

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

Implements CmsTrackerLevelBuilder.

Definition at line 74 of file CmsTrackerPhase1DiskBuilder.cc.

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

75 {
76  CmsTrackerPanelBuilder theCmsTrackerPanelBuilder;
78 
80  {
82  theCmsTrackerPanelBuilder.build( fv, subdet, s );
83  break;
84  default:
85  edm::LogError( "CmsTrackerPhase1DiskBuilder" ) << " ERROR - I was expecting a Panel, I got a " << ExtractStringFromDDD::getString( s, &fv );
86  }
87  g->addComponent( subdet );
88 }
static std::string getString(std::string const &, DDFilteredView *)
void addComponent(GeometricDet *)
void build(DDFilteredView &, GeometricDet *, std::string) override
GeometricDet::GeometricEnumType type(std::string const &) const
CmsTrackerStringToEnum theCmsTrackerStringToEnum
void CmsTrackerPhase1DiskBuilder::PhiPosNegSplit_innerOuter ( std::vector< GeometricDet const * >::iterator  begin,
std::vector< GeometricDet const * >::iterator  end 
)
private

Definition at line 21 of file CmsTrackerPhase1DiskBuilder.cc.

References begin, popcon2dropbox::copy(), end, SiStripPI::max, min(), and svgfig::rotate().

23 {
24  // first sort in phi, lowest first (-pi to +pi)
25  std::sort( begin, end, PhiSort );
26 
27  // now put positive phi (in order) ahead of negative phi as in std geometry
28  std::vector<const GeometricDet*> theCompsPosNeg;
29  theCompsPosNeg.empty();
30  theCompsPosNeg.clear();
31  // also find the average radius (used to split inner and outer disk panels)
32  double theRmin = (**begin).rho();
33  double theRmax = theRmin;
34  for(vector<const GeometricDet*>::const_iterator it=begin;
35  it!=end;it++){
36  if((**it).phi() >= 0) theCompsPosNeg.emplace_back(*it);
37  theRmin = std::min( theRmin, (**it).rho());
38  theRmax = std::max( theRmax, (**it).rho());
39  }
40  for(vector<const GeometricDet*>::const_iterator it=begin;
41  it!=end;it++){
42  if((**it).phi() < 0) theCompsPosNeg.emplace_back(*it);
43  }
44 
45  // now put inner disk panels first
46  // double radius_split = 0.5 * (theRmin + theRmax);
47  // force the split radius to be 100 mm to be able to deal with disks with only outer ring
48  double radius_split = 100.;
49  std::vector<const GeometricDet*> theCompsInnerOuter;
50  theCompsInnerOuter.empty();
51  theCompsInnerOuter.clear();
52  unsigned int num_inner = 0;
53  for(vector<const GeometricDet*>::const_iterator it=theCompsPosNeg.begin();
54  it!=theCompsPosNeg.end();it++){
55  if((**it).rho() <= radius_split) {
56  theCompsInnerOuter.emplace_back(*it);
57  num_inner++;
58  }
59  }
60 
61  for(vector<const GeometricDet*>::const_iterator it=theCompsPosNeg.begin();
62  it!=theCompsPosNeg.end();it++){
63  if((**it).rho() > radius_split) theCompsInnerOuter.emplace_back(*it);
64  }
65  // std::cout << "num of inner = " << num_inner << " with radius less than " << radius_split << std::endl;
66  // now shift outer by one
67 
68  std::rotate(theCompsInnerOuter.begin()+num_inner,theCompsInnerOuter.end()-1,theCompsInnerOuter.end());
69  std::rotate(theCompsInnerOuter.begin(),theCompsInnerOuter.begin()+num_inner-1,theCompsInnerOuter.begin()+num_inner);
70  std::copy(theCompsInnerOuter.begin(), theCompsInnerOuter.end(), begin);
71 }
def copy(args, dbName)
#define end
Definition: vmac.h:39
T min(T a, T b)
Definition: MathUtil.h:58
static bool PhiSort(const GeometricDet *Panel1, const GeometricDet *Panel2)
#define begin
Definition: vmac.h:32
def rotate(angle, cx=0, cy=0)
Definition: svgfig.py:704
bool CmsTrackerPhase1DiskBuilder::PhiSort ( const GeometricDet Panel1,
const GeometricDet Panel2 
)
staticprivate

Definition at line 15 of file CmsTrackerPhase1DiskBuilder.cc.

References GeometricDet::phi().

16 {
17  return( Panel1->phi() < Panel2->phi());
18 }
double phi() const
Definition: GeometricDet.h:129
void CmsTrackerPhase1DiskBuilder::sortNS ( DDFilteredView fv,
GeometricDet det 
)
overrideprivatevirtual

Reimplemented from CmsTrackerLevelBuilder.

Definition at line 91 of file CmsTrackerPhase1DiskBuilder.cc.

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

92 {
93 
94 
96 
97  switch( det->components().front()->type())
98  {
100  PhiPosNegSplit_innerOuter( comp.begin(), comp.end());
101  break;
102  default:
103  edm::LogError( "CmsTrackerPhase1DiskBuilder" ) << "ERROR - wrong SubDet to sort..... " << det->components().front()->type();
104  }
105 
106  GeometricDet::GeometricDetContainer zminpanels; // Here z refers abs(z);
107  GeometricDet::GeometricDetContainer zmaxpanels; // So, zmin panel is always closer to ip.
108 
109  uint32_t totalblade = comp.size()/2;
110  // std::cout << "pixel_disk " << pixel_disk << endl;
111 
112  zminpanels.reserve( totalblade );
113  zmaxpanels.reserve( totalblade );
114  for( uint32_t j = 0; j < totalblade; j++ )
115  {
116  if( std::abs( comp[2*j]->translation().z()) > std::abs( comp[ 2*j +1 ]->translation().z()))
117  {
118  zmaxpanels.emplace_back( det->component(2*j) );
119  zminpanels.emplace_back( det->component(2*j+1) );
120 
121  }
122  else if( std::abs( comp[2*j]->translation().z()) < std::abs( comp[ 2*j +1 ]->translation().z()))
123  {
124  zmaxpanels.emplace_back( det->component(2*j+1) );
125  zminpanels.emplace_back( det->component(2*j) );
126  }
127  else
128  {
129  edm::LogWarning( "CmsTrackerPhase1DiskBuilder" ) << "WARNING - The Z of both panels are equal! ";
130  }
131  }
132 
133  for( uint32_t fn = 0; fn < zminpanels.size(); fn++ )
134  {
135  uint32_t blade = fn + 1;
136  uint32_t panel = 2; // though being zmin, it is actually the one facing away the ip
137  uint32_t temp = ( blade << 2 ) | panel;
138  zminpanels[fn]->setGeographicalID( temp );
139  }
140 
141  for( uint32_t bn = 0; bn < zmaxpanels.size(); bn++)
142  {
143  uint32_t blade = bn + 1;
144  uint32_t panel = 1; // though being zmax, it is the one facing the ip
145  uint32_t temp = ( blade << 2) | panel;
146  zmaxpanels[bn]->setGeographicalID( temp );
147  }
148 
149  det->clearComponents();
150  det->addComponents( zminpanels );
151  det->addComponents( zmaxpanels );
152 
153 }
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
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:36
void addComponents(GeometricDetContainer const &cont)
void PhiPosNegSplit_innerOuter(std::vector< GeometricDet const * >::iterator begin, std::vector< GeometricDet const * >::iterator end)