CMS 3D CMS Logo

List of all members | Private Member Functions | Static Private Member Functions
CmsTrackerPhase2TPDiskBuilder< FilteredView > Class Template Reference

#include <CmsTrackerPhase2TPDiskBuilder.h>

Inheritance diagram for CmsTrackerPhase2TPDiskBuilder< FilteredView >:
CmsTrackerLevelBuilder< FilteredView > CmsTrackerAbstractConstruction< FilteredView >

Private Member Functions

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

Static Private Member Functions

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

Additional Inherited Members

- Public Member Functions inherited from CmsTrackerLevelBuilder< FilteredView >
template<>
void build (cms::DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
template<>
void build (DDFilteredView &fv, GeometricDet *tracker, const std::string &attribute)
 
void build (FilteredView &, GeometricDet *, const std::string &) override
 
 ~CmsTrackerLevelBuilder () override
 
- Public Member Functions inherited from CmsTrackerAbstractConstruction< FilteredView >
virtual ~CmsTrackerAbstractConstruction ()=default
 
- Protected Attributes inherited from CmsTrackerLevelBuilder< FilteredView >
CmsTrackerStringToEnum theCmsTrackerStringToEnum
 

Detailed Description

template<class FilteredView>
class CmsTrackerPhase2TPDiskBuilder< FilteredView >

Class which contructs PixelForward/Disk.

Definition at line 12 of file CmsTrackerPhase2TPDiskBuilder.h.

Member Function Documentation

◆ buildComponent()

template<class FilteredView >
void CmsTrackerPhase2TPDiskBuilder< FilteredView >::buildComponent ( FilteredView &  fv,
GeometricDet g,
const std::string &  s 
)
overrideprivatevirtual

Implements CmsTrackerLevelBuilder< FilteredView >.

Definition at line 67 of file CmsTrackerPhase2TPDiskBuilder.cc.

69  {
70  CmsTrackerPanelBuilder<FilteredView> theCmsTrackerPanelBuilder;
71  GeometricDet* subdet = new GeometricDet(&fv,
74 
78  theCmsTrackerPanelBuilder.build(fv, subdet, s);
79  break;
80  default:
81  edm::LogError("CmsTrackerPhase2TPDiskBuilder")
82  << " ERROR - I was expecting a Panel, I got a " << ExtractStringFromDDD<FilteredView>::getString(s, &fv);
83  }
84  g->addComponent(subdet);
85 }

References CmsTrackerLevelBuilder< FilteredView >::build(), g, ExtractStringFromDDD< FilteredView >::getString(), GeometricDet::panel, and alignCSCRings::s.

◆ PhiPosNegSplit_innerOuter()

template<class FilteredView >
void CmsTrackerPhase2TPDiskBuilder< FilteredView >::PhiPosNegSplit_innerOuter ( std::vector< GeometricDet const * >::iterator  begin,
std::vector< GeometricDet const * >::iterator  end 
)
private

Definition at line 20 of file CmsTrackerPhase2TPDiskBuilder.cc.

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

References filterCSVwithJSON::copy, mps_fire::end, SiStripPI::max, min(), and svgfig::rotate().

◆ PhiSort()

template<class FilteredView >
bool CmsTrackerPhase2TPDiskBuilder< FilteredView >::PhiSort ( const GeometricDet Panel1,
const GeometricDet Panel2 
)
staticprivate

Definition at line 15 of file CmsTrackerPhase2TPDiskBuilder.cc.

15  {
16  return (Panel1->phi() < Panel2->phi());
17 }

References GeometricDet::phi().

◆ sortNS()

template<class FilteredView >
void CmsTrackerPhase2TPDiskBuilder< FilteredView >::sortNS ( FilteredView &  fv,
GeometricDet det 
)
overrideprivatevirtual

Reimplemented from CmsTrackerLevelBuilder< FilteredView >.

Definition at line 88 of file CmsTrackerPhase2TPDiskBuilder.cc.

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

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

GeometricDet::phi
double phi() const
Definition: GeometricDet.h:102
ExtractStringFromDDD::getString
static std::string getString(const std::string &, FilteredView *)
CmsTrackerLevelBuilder
Definition: CmsTrackerLevelBuilder.h:31
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
min
T min(T a, T b)
Definition: MathUtil.h:58
GeometricDet::components
ConstGeometricDetContainer & components()
Definition: GeometricDet.h:149
CmsTrackerPhase2TPDiskBuilder::PhiSort
static bool PhiSort(const GeometricDet *Panel1, const GeometricDet *Panel2)
Definition: CmsTrackerPhase2TPDiskBuilder.cc:15
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
ExtractStringFromDDD
Definition: ExtractStringFromDDD.h:12
svgfig.rotate
def rotate(angle, cx=0, cy=0)
Definition: svgfig.py:705
CmsTrackerPanelBuilder
Definition: CmsTrackerPanelBuilder.h:12
alignCSCRings.s
s
Definition: alignCSCRings.py:92
mps_fire.end
end
Definition: mps_fire.py:242
DDAxes::z
GeometricDet
Definition: GeometricDet.h:31
CmsTrackerLevelBuilder::build
void build(FilteredView &, GeometricDet *, const std::string &) override
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
GeometricDet::addComponents
void addComponents(GeometricDetContainer const &cont)
Definition: GeometricDet.cc:240
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
GeometricDet::panel
Definition: GeometricDet.h:67
GeometricDet::component
GeometricDet * component(size_t index)
Definition: GeometricDet.h:145
GeometricDet::ConstGeometricDetContainer
std::vector< GeometricDet const * > ConstGeometricDetContainer
Definition: GeometricDet.h:34
personalPlayback.fn
fn
Definition: personalPlayback.py:515
GeometricDet::GeometricDetContainer
std::vector< GeometricDet * > GeometricDetContainer
Definition: GeometricDet.h:35
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
GeometricDet::clearComponents
void clearComponents()
Definition: GeometricDet.h:160
CmsTrackerPhase2TPDiskBuilder::PhiPosNegSplit_innerOuter
void PhiPosNegSplit_innerOuter(std::vector< GeometricDet const * >::iterator begin, std::vector< GeometricDet const * >::iterator end)
Definition: CmsTrackerPhase2TPDiskBuilder.cc:20
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4