CMS 3D CMS Logo

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

#include <CmsTrackerPhase2TPDiskBuilder.h>

Inheritance diagram for CmsTrackerPhase2TPDiskBuilder:
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 CmsTrackerPhase2TPDiskBuilder.h.

Member Function Documentation

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

Implements CmsTrackerLevelBuilder.

Definition at line 69 of file CmsTrackerPhase2TPDiskBuilder.cc.

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

70 {
71  CmsTrackerPanelBuilder theCmsTrackerPanelBuilder;
73 
75  {
77  theCmsTrackerPanelBuilder.build( fv, subdet, s );
78  break;
79  default:
80  edm::LogError( "CmsTrackerPhase2TPDiskBuilder" ) << " ERROR - I was expecting a Panel, I got a " << ExtractStringFromDDD::getString( s, &fv );
81  }
82  g->addComponent( subdet );
83 }
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 CmsTrackerPhase2TPDiskBuilder::PhiPosNegSplit_innerOuter ( std::vector< GeometricDet const * >::iterator  begin,
std::vector< GeometricDet const * >::iterator  end 
)
private

Definition at line 21 of file CmsTrackerPhase2TPDiskBuilder.cc.

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

23 {
24  // first sort in phi, lowest first (-pi to +pi)
26 
27  // now put positive phi (in order) ahead of negative phi as in std geometry
28  std::vector<const GeometricDet*> theCompsPosNeg;
29  // also find the average radius (used to split inner and outer disk panels)
30  double theRmin = (**begin).rho();
31  double theRmax = theRmin;
32  for(vector<const GeometricDet*>::const_iterator it=begin;
33  it!=end;it++){
34  if((**it).phi() >= 0) theCompsPosNeg.emplace_back(*it);
35  theRmin = std::min( theRmin, (**it).rho());
36  theRmax = std::max( theRmax, (**it).rho());
37  }
38  for(vector<const GeometricDet*>::const_iterator it=begin;
39  it!=end;it++){
40  if((**it).phi() < 0) theCompsPosNeg.emplace_back(*it);
41  }
42 
43  // now put inner disk panels first
44  // double radius_split = 0.5 * (theRmin + theRmax);
45  // force the split radius to be 100 mm to be able to deal with disks with only outer ring
46  double radius_split = 100.;
47  std::vector<const GeometricDet*> theCompsInnerOuter;
48  unsigned int num_inner = 0;
49  for(vector<const GeometricDet*>::const_iterator it=theCompsPosNeg.begin();
50  it!=theCompsPosNeg.end();it++){
51  if((**it).rho() <= radius_split) {
52  theCompsInnerOuter.emplace_back(*it);
53  num_inner++;
54  }
55  }
56 
57  for(vector<const GeometricDet*>::const_iterator it=theCompsPosNeg.begin();
58  it!=theCompsPosNeg.end();it++){
59  if((**it).rho() > radius_split) theCompsInnerOuter.emplace_back(*it);
60  }
61  // std::cout << "num of inner = " << num_inner << " with radius less than " << radius_split << std::endl;
62  // now shift outer by one
63 
64  std::rotate(theCompsInnerOuter.begin()+num_inner,theCompsInnerOuter.begin()+num_inner+1,theCompsInnerOuter.end());
65  std::copy(theCompsInnerOuter.begin(), theCompsInnerOuter.end(), begin);
66 }
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:705
bool CmsTrackerPhase2TPDiskBuilder::PhiSort ( const GeometricDet Panel1,
const GeometricDet Panel2 
)
staticprivate

Definition at line 15 of file CmsTrackerPhase2TPDiskBuilder.cc.

References GeometricDet::phi().

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

Reimplemented from CmsTrackerLevelBuilder.

Definition at line 86 of file CmsTrackerPhase2TPDiskBuilder.cc.

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

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