23 if (not theComponents) {
24 std::unique_ptr<std::vector<const GeometricSearchDet*>>
temp(
new std::vector<const GeometricSearchDet*>() );
26 for (
auto c: theComps) temp->push_back(
c);
27 std::vector<const GeometricSearchDet*>* expected =
nullptr;
28 if(theComponents.compare_exchange_strong(expected,temp.get())) {
33 return *theComponents;
40 float ringMinZ =
std::abs( ringDisk.position().z()) - ringDisk.bounds().thickness()/2.;
41 float ringMaxZ =
std::abs( ringDisk.position().z()) + ringDisk.bounds().thickness()/2.;
42 ringPars[
i].thetaRingMin = ringDisk.innerRadius()/ ringMaxZ;
43 ringPars[
i].thetaRingMax = ringDisk.outerRadius()/ ringMinZ;
44 ringPars[
i].theRingR=( ringDisk.innerRadius() +
45 ringDisk.outerRadius())/2.;
52 theComponents{
nullptr}
58 setSurface( computeDisk( rings ) );
63 theBasicComps.insert(theBasicComps.end(),
64 (*rings[
i]).basicComponents().begin(),
65 (*rings[
i]).basicComponents().end());
69 LogDebug(
"TkDetLayers") <<
"==== DEBUG Phase2OTEndcapLayer =====" ;
70 LogDebug(
"TkDetLayers") <<
"r,zed pos , thickness, innerR, outerR: "
73 << this->specificSurface().bounds().thickness() <<
" , "
74 << this->specificSurface().innerRadius() <<
" , "
75 << this->specificSurface().outerRadius() ;
82 float theRmin = rings.front()->specificSurface().innerRadius();
83 float theRmax = rings.front()->specificSurface().outerRadius();
84 float theZmin = rings.front()->position().z() -
85 rings.front()->surface().bounds().thickness()/2;
86 float theZmax = rings.front()->position().z() +
87 rings.front()->surface().bounds().thickness()/2;
89 for (vector<const Phase2OTEndcapRing*>::const_iterator
i = rings.begin();
i != rings.end();
i++) {
90 float rmin = (**i).specificSurface().innerRadius();
91 float rmax = (**i).specificSurface().outerRadius();
92 float zmin = (**i).position().z() - (**i).surface().bounds().thickness()/2.;
93 float zmax = (**i).position().z() + (**i).surface().bounds().thickness()/2.;
94 theRmin =
min( theRmin, rmin);
95 theRmax =
max( theRmax, rmax);
96 theZmin =
min( theZmin, zmin);
97 theZmax =
max( theZmax, zmax);
100 float zPos = (theZmax+theZmin)/2.;
105 theZmin-zPos, theZmax-zPos));
122 std::vector<DetGroup> &
result)
const
125 if ( ringIndices[0]==-1 || ringIndices[1] ==-1 || ringIndices[2] == -1 ) {
126 edm::LogError(
"TkDetLayers") <<
"TkRingedForwardLayer::groupedCompatibleDets : error in CrossingProximity";
131 #ifdef __INTEL_COMPILER
132 const int ringOrder[
NOTECRINGS]{0,1,0,1,0,1,0,1,0,1,0,1,0,1,0};
134 constexpr int ringOrder[
NOTECRINGS]{0,1,0,1,0,1,0,1,0,1,0,1,0,1,0};
136 auto index = [&ringIndices,& ringOrder](
int i) {
return ringOrder[ringIndices[
i]];};
138 std::vector<DetGroup> closestResult;
141 if ( closestResult.empty() ){
147 float rWindow =
computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
151 bool ring1ok = ringIndices[1] != -1 &&
overlapInR(closestGel.trajectoryState(),ringIndices[1],rWindow);
152 bool ring2ok = ringIndices[2] != -1 &&
overlapInR(closestGel.trajectoryState(),ringIndices[2],rWindow);
170 << ringIndices[0] <<
" "
171 << ringIndices[1] <<
" "
172 << ringIndices[2] <<
" in one plane. Only the first two will be considered";
178 std::vector<DetGroup> ring1res;
183 std::vector<DetGroup> ring2res;
189 result.swap(closestResult);
195 std::vector<DetGroup> ring2res;
200 std::vector<DetGroup> ring1res;
206 result.swap(closestResult);
211 std::vector<DetGroup> ring12res;
213 std::vector<DetGroup> ring1res;
215 ring12res.swap(ring1res);
218 std::vector<DetGroup> ring2res;
222 if(!ring12res.empty()) {
227 result.swap(closestResult);
249 Crossing myXing( startPos, startDir,
rho, propDir );
256 pair<bool,double> pathlen = myXing.pathLength( theRing);
257 if ( pathlen.first ) {
258 ringCrossings[
i] =
GlobalPoint( myXing.position(pathlen.second ));
286 return maxDistance.
y();
292 std::array<int,3> theBins={{-1,-1,-1}};
295 float rDiff0 =
std::abs( ringCrossing[0].
perp() - initialR);
301 if ( testDiff<rDiff0 ) {
305 theBins[2] = theBins[1];
306 theBins[1] = theBins[0];
310 if ( rDiff1 < 0 || testDiff<rDiff1 ) {
313 theBins[2] = theBins[1];
317 if ( rDiff2 < 0 || testDiff<rDiff2 ) {
~Phase2OTEndcapLayer() __attribute__((cold))
TkRotation< Scalar > RotationType
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
Vector2DBase< float, LocalTag > Local2DVector
virtual PropagationDirection propagationDirection() const final
const Plane & surface() const
The nominal surface of the GeomDet.
Point3DBase< Scalar, GlobalTag > PositionType
bool overlapInR(const TrajectoryStateOnSurface &tsos, int i, double ymax) const __attribute__((hot))
BoundDisk * computeDisk(const std::vector< const Phase2OTEndcapRing * > &rings) const __attribute__((cold))
static void addSameLevel(std::vector< DetGroup > &&gvec, std::vector< DetGroup > &result)
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
void fillRingPars(int i) __attribute__((cold))
Abs< T >::type abs(const T &t)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
Phase2OTEndcapLayer(std::vector< const Phase2OTEndcapRing * > &rings) __attribute__((cold))
std::array< int, 3 > ringIndicesByCrossingProximity(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
std::atomic< std::vector< const GeometricSearchDet * > * > theComponents
T perp() const
Magnitude of transverse component.
GlobalVector globalMomentum() const
static int position[264][3]
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const __attribute__((hot))
virtual const std::vector< const GeometricSearchDet * > & components() const __attribute__((cold))
std::array< int, 3 > findThreeClosest(const GlobalPoint[15]) const __attribute__((hot))
const Phase2OTEndcapRing * theComps[15]
double transverseCurvature() const
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))