CMS 3D CMS Logo

Phase2EndcapLayer.cc
Go to the documentation of this file.
1 #include "Phase2EndcapLayer.h"
2 
4 
6 
9 
10 #include <array>
11 #include "DetGroupMerger.h"
12 
13 using namespace std;
14 
16 
17 //hopefully is never called!
18 const std::vector<const GeometricSearchDet*>& Phase2EndcapLayer::components() const {
19  if (not theComponents) {
20  auto temp = std::make_unique<std::vector<const GeometricSearchDet*>>();
21  temp->reserve(15); // This number is just an upper bound
22  for (auto c : theComps)
23  temp->push_back(c);
24  std::vector<const GeometricSearchDet*>* expected = nullptr;
25  if (theComponents.compare_exchange_strong(expected, temp.get())) {
26  //this thread set the value
27  temp.release();
28  }
29  }
30  return *theComponents;
31 }
32 
34  const BoundDisk& ringDisk = static_cast<const BoundDisk&>(theComps[i]->surface());
35  ringPars.push_back(tkDetUtil::fillRingParametersFromDisk(ringDisk));
36 }
37 
38 Phase2EndcapLayer::Phase2EndcapLayer(vector<const Phase2EndcapRing*>& rings, const bool isOT)
39  : RingedForwardLayer(true), isOuterTracker(isOT), theComponents{nullptr} {
40  //They should be already R-ordered. TO BE CHECKED!!
41  //sort( theRings.begin(), theRings.end(), DetLessR());
42 
43  theRingSize = rings.size();
44  LogDebug("TkDetLayers") << "Number of rings in Phase2 OT EC layer is " << theRingSize << std::endl;
45  setSurface(computeDisk(rings));
46 
47  for (unsigned int i = 0; i != rings.size(); ++i) {
48  theComps.push_back(rings[i]);
49  fillRingPars(i);
50  theBasicComps.insert(
51  theBasicComps.end(), (*rings[i]).basicComponents().begin(), (*rings[i]).basicComponents().end());
52  }
53 
54  LogDebug("TkDetLayers") << "==== DEBUG Phase2EndcapLayer =====";
55  LogDebug("TkDetLayers") << "r,zed pos , thickness, innerR, outerR: " << this->position().perp() << " , "
56  << this->position().z() << " , " << this->specificSurface().bounds().thickness() << " , "
57  << this->specificSurface().innerRadius() << " , " << this->specificSurface().outerRadius();
58 }
59 
60 BoundDisk* Phase2EndcapLayer::computeDisk(const vector<const Phase2EndcapRing*>& rings) const {
61  return tkDetUtil::computeDisk(rings);
62 }
63 
65  for (auto c : theComps)
66  delete c;
67 
68  delete theComponents.load();
69 }
70 
72  const Propagator& prop,
73  const MeasurementEstimator& est,
74  std::vector<DetGroup>& result) const {
76 }
77 
79  const TrajectoryStateOnSurface& tsos,
80  const MeasurementEstimator& est) const {
81  return tkDetUtil::computeYdirWindowSize(det, tsos, est);
82 }
83 
85  int index,
86  double ymax,
87  std::vector<tkDetUtil::RingPar> ringParams) const {
88  return tkDetUtil::overlapInR(tsos, index, ymax, ringParams);
89 }
bool isOuterTracker(GeomDetEnumerators::SubDetector m)
std::vector< const Phase2EndcapRing * > theComps
bool overlapInR(const TrajectoryStateOnSurface &tsos, int index, double ymax, const std::vector< RingPar > &ringParams)
Definition: TkDetUtil.cc:112
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result, const int ringSize, const std::vector< const T *> &diskComponents, const std::vector< RingPar > &ringParams)
Definition: TkDetUtil.h:100
void fillRingPars(int i) __attribute__((cold))
Phase2EndcapLayer(std::vector< const Phase2EndcapRing *> &rings, const bool isOT) __attribute__((cold))
bool overlapInR(const TrajectoryStateOnSurface &tsos, int i, double ymax, std::vector< tkDetUtil::RingPar > ringParams) const __attribute__((hot))
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const __attribute__((hot))
std::atomic< std::vector< const GeometricSearchDet * > * > theComponents
~Phase2EndcapLayer() override __attribute__((cold))
float computeYdirWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
Definition: TkDetUtil.cc:71
RingPar fillRingParametersFromDisk(const BoundDisk &ringDisk)
Definition: TkDetUtil.cc:124
GeometricSearchDet::DetWithState DetWithState
BoundDisk * computeDisk(const std::vector< const T *> &structures)
Definition: TkDetUtil.h:236
BoundDisk * computeDisk(const std::vector< const Phase2EndcapRing *> &rings) const __attribute__((cold))
static int position[264][3]
Definition: ReadPGInfo.cc:289
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const std::vector< const GeometricSearchDet * > & components() const override __attribute__((cold))
std::vector< tkDetUtil::RingPar > ringPars
#define LogDebug(id)