CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
CompositeTECPetal Class Referencefinal

#include <CompositeTECPetal.h>

Inheritance diagram for CompositeTECPetal:
GeometricSearchDet

Classes

struct  WedgePar
 

Public Member Functions

 __attribute__ ((cold))
 
const std::vector< const
GeomDet * > & 
basicComponents () const override
 
std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const override __attribute__((cold))
 
const std::vector< const
GeometricSearchDet * > & 
components () const override __attribute__((cold))
 Returns basic components, if any. More...
 
void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
 
virtual const BoundDiskSectorspecificSurface () const final
 
const BoundSurfacesurface () const final
 The surface of the GeometricSearchDet. More...
 
 ~CompositeTECPetal () override __attribute__((cold))
 
- Public Member Functions inherited from GeometricSearchDet
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
 GeometricSearchDet (bool doHaveGroups)
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
bool hasGroups () const
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Private Member Functions

bool addClosest (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
 
SubLayerCrossings computeCrossings (const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
 
int findBin (float R, int layer) const
 
WedgePar const & findPar (int index, int diskSectorType) const
 
void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const __attribute__((hot))
 
const std::vector< const
TECWedge * > & 
subLayer (int ind) const
 

Static Private Member Functions

static float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) __attribute__((hot))
 

Private Attributes

std::vector< float > theBackBoundaries
 
std::vector< const TECWedge * > theBackComps
 
std::vector< WedgePartheBackPars
 
ReferenceCountingPointer
< BoundDiskSector
theBackSector
 
std::vector< const GeomDet * > theBasicComps
 
std::vector< const
GeometricSearchDet * > 
theComps
 
ReferenceCountingPointer
< BoundDiskSector
theDiskSector
 
std::vector< float > theFrontBoundaries
 
std::vector< const TECWedge * > theFrontComps
 
std::vector< WedgePartheFrontPars
 
ReferenceCountingPointer
< BoundDiskSector
theFrontSector
 

Additional Inherited Members

- Public Types inherited from GeometricSearchDet
typedef std::pair< const
GeomDet
*, TrajectoryStateOnSurface
DetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 
- Protected Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A concrete implementation for TEC petals

Definition at line 18 of file CompositeTECPetal.h.

Constructor & Destructor Documentation

CompositeTECPetal::~CompositeTECPetal ( )
override

Definition at line 121 of file CompositeTECPetal.cc.

References mps_fire::i, and theComps.

121  {
122  vector<const GeometricSearchDet*>::const_iterator i;
123  for (i = theComps.begin(); i != theComps.end(); i++) {
124  delete *i;
125  }
126 }
std::vector< const GeometricSearchDet * > theComps

Member Function Documentation

CompositeTECPetal::__attribute__ ( (cold)  )
bool CompositeTECPetal::addClosest ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
std::vector< DetGroup > &  result 
) const
private

Definition at line 217 of file CompositeTECPetal.cc.

References CompatibleDetToGroupAdder::add(), SubLayerCrossing::closestDetIndex(), LogDebug, subLayer(), and SubLayerCrossing::subLayerIndex().

Referenced by groupedCompatibleDetsV().

221  {
222  auto det = subLayer(crossing.subLayerIndex())[crossing.closestDetIndex()];
223 
224  LogDebug("TkDetLayers") << "in TECPetal, adding Wedge at r,z,phi: (" << det->position().perp() << ","
225  << det->position().z() << "," << det->position().phi() << ")";
226  LogDebug("TkDetLayers") << "wedge comps size: " << det->basicComponents().size();
227 
228  return CompatibleDetToGroupAdder::add(*det, tsos, prop, est, result);
229 }
int closestDetIndex() const
tuple result
Definition: mps_fire.py:311
int subLayerIndex() const
const std::vector< const TECWedge * > & subLayer(int ind) const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
#define LogDebug(id)
const std::vector<const GeomDet*>& CompositeTECPetal::basicComponents ( ) const
inlineoverridevirtual

Implements GeometricSearchDet.

Definition at line 35 of file CompositeTECPetal.h.

References theBasicComps.

35 { return theBasicComps; }
std::vector< const GeomDet * > theBasicComps
pair< bool, TrajectoryStateOnSurface > CompositeTECPetal::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const
overridevirtual

tests the geometrical compatibility of the Det with the predicted state. The FreeTrajectoryState argument is propagated to the Det surface using the Propagator argument. The resulting TrajectoryStateOnSurface is tested for compatibility with the surface bounds. If compatible, a std::pair< true, propagatedState> is returned. If the propagation fails, or if the state is not compatible, a std::pair< false, propagatedState> is returned.

Implements GeometricSearchDet.

Definition at line 128 of file CompositeTECPetal.cc.

130  {
131  edm::LogError("TkDetLayers") << "temporary dummy implementation of CompositeTECPetal::compatible()!!";
132  return pair<bool, TrajectoryStateOnSurface>();
133 }
Log< level::Error, false > LogError
const std::vector<const GeometricSearchDet*>& CompositeTECPetal::components ( ) const
inlineoverridevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 37 of file CompositeTECPetal.h.

References theComps.

37 { return theComps; }
std::vector< const GeometricSearchDet * > theComps
SubLayerCrossings CompositeTECPetal::computeCrossings ( const TrajectoryStateOnSurface tsos,
PropagationDirection  propDir 
) const
private

Definition at line 174 of file CompositeTECPetal.cc.

References funct::abs(), findBin(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), LogDebug, HelixForwardPlaneCrossing::pathLength(), HelixForwardPlaneCrossing::position(), rho, theBackPars, theBackSector, theFrontPars, theFrontSector, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

175  {
176  HelixPlaneCrossing::PositionType startPos(startingState.globalPosition());
177  HelixPlaneCrossing::DirectionType startDir(startingState.globalMomentum());
178 
179  auto rho = startingState.transverseCurvature();
180 
181  HelixForwardPlaneCrossing crossing(startPos, startDir, rho, propDir);
182 
183  pair<bool, double> frontPath = crossing.pathLength(*theFrontSector);
184  if (!frontPath.first)
185  return SubLayerCrossings();
186 
187  pair<bool, double> backPath = crossing.pathLength(*theBackSector);
188  if (!backPath.first)
189  return SubLayerCrossings();
190 
191  GlobalPoint gFrontPoint(crossing.position(frontPath.second));
192  GlobalPoint gBackPoint(crossing.position(backPath.second));
193 
194  LogDebug("TkDetLayers") << "in TECPetal,front crossing : r,z,phi: (" << gFrontPoint.perp() << "," << gFrontPoint.z()
195  << "," << gFrontPoint.phi() << ")";
196 
197  LogDebug("TkDetLayers") << "in TECPetal,back crossing r,z,phi: (" << gBackPoint.perp() << "," << gBackPoint.z() << ","
198  << gBackPoint.phi() << ")";
199 
200  int frontIndex = findBin(gFrontPoint.perp(), 0);
201  SubLayerCrossing frontSLC(0, frontIndex, gFrontPoint);
202 
203  int backIndex = findBin(gBackPoint.perp(), 1);
204  SubLayerCrossing backSLC(1, backIndex, gBackPoint);
205 
206  auto frontDist = std::abs(theFrontPars[frontIndex].theR - gFrontPoint.perp());
207  auto backDist = std::abs(theBackPars[backIndex].theR - gBackPoint.perp());
208 
209  // 0ss: frontDisk has index=0, backDisk has index=1
210  if (frontDist < backDist) {
211  return SubLayerCrossings(frontSLC, backSLC, 0);
212  } else {
213  return SubLayerCrossings(backSLC, frontSLC, 1);
214  }
215 }
int findBin(float R, int layer) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ReferenceCountingPointer< BoundDiskSector > theFrontSector
ReferenceCountingPointer< BoundDiskSector > theBackSector
std::vector< WedgePar > theBackPars
std::vector< WedgePar > theFrontPars
#define LogDebug(id)
float CompositeTECPetal::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
)
staticprivate

Definition at line 282 of file CompositeTECPetal.cc.

References MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), and y.

Referenced by groupedCompatibleDetsV().

284  {
285  return est.maximalLocalDisplacement(tsos, det->surface()).y();
286 }
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
int CompositeTECPetal::findBin ( float  R,
int  layer 
) const
private

Definition at line 288 of file CompositeTECPetal.cc.

References theBackBoundaries, and theFrontBoundaries.

Referenced by computeCrossings().

288  {
289  return details::findBin(diskSectorType == 0 ? theFrontBoundaries : theBackBoundaries, R);
290 }
std::vector< float > theFrontBoundaries
std::vector< float > theBackBoundaries
WedgePar const& CompositeTECPetal::findPar ( int  index,
int  diskSectorType 
) const
inlineprivate

Definition at line 76 of file CompositeTECPetal.h.

References theBackPars, and theFrontPars.

Referenced by searchNeighbors().

76  {
77  return (diskSectorType == 0) ? theFrontPars[index] : theBackPars[index];
78  }
std::vector< WedgePar > theBackPars
std::vector< WedgePar > theFrontPars
void CompositeTECPetal::groupedCompatibleDetsV ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const
overridevirtual

Reimplemented from GeometricSearchDet.

Definition at line 135 of file CompositeTECPetal.cc.

References addClosest(), SubLayerCrossings::closest(), SubLayerCrossings::closestIndex(), computeCrossings(), computeWindowSize(), LayerCrossingSide::endcapSide(), SubLayerCrossings::isValid(), LogDebug, eostools::move(), DetGroupMerger::orderAndMergeTwoLevels(), SubLayerCrossings::other(), Propagator::propagationDirection(), searchNeighbors(), and svgfig::window().

138  {
139  vector<DetGroup> closestResult;
140  SubLayerCrossings crossings;
141  crossings = computeCrossings(tsos, prop.propagationDirection());
142  if (!crossings.isValid())
143  return;
144 
145  addClosest(tsos, prop, est, crossings.closest(), closestResult);
146  LogDebug("TkDetLayers") << "in TECPetal, closestResult.size(): " << closestResult.size();
147 
148  if (closestResult.empty()) {
149  vector<DetGroup> nextResult;
150  addClosest(tsos, prop, est, crossings.other(), nextResult);
151  LogDebug("TkDetLayers") << "in TECPetal, nextResult.size(): " << nextResult.size();
152  if (nextResult.empty())
153  return;
154 
155  DetGroupElement nextGel(nextResult.front().front());
156  int crossingSide = LayerCrossingSide::endcapSide(nextGel.trajectoryState(), prop);
158  std::move(closestResult), std::move(nextResult), result, crossings.closestIndex(), crossingSide);
159  } else {
160  DetGroupElement closestGel(closestResult.front().front());
161  float window = computeWindowSize(closestGel.det(), closestGel.trajectoryState(), est);
162 
163  searchNeighbors(tsos, prop, est, crossings.closest(), window, closestResult, false);
164 
165  vector<DetGroup> nextResult;
166  searchNeighbors(tsos, prop, est, crossings.other(), window, nextResult, true);
167 
168  int crossingSide = LayerCrossingSide::endcapSide(closestGel.trajectoryState(), prop);
170  std::move(closestResult), std::move(nextResult), result, crossings.closestIndex(), crossingSide);
171  }
172 }
def window
Definition: svgfig.py:643
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
int closestIndex() const
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const __attribute__((hot))
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
tuple result
Definition: mps_fire.py:311
def move
Definition: eostools.py:511
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
static float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) __attribute__((hot))
const SubLayerCrossing & other() const
const SubLayerCrossing & closest() const
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
#define LogDebug(id)
void CompositeTECPetal::searchNeighbors ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
float  window,
std::vector< DetGroup > &  result,
bool  checkClosest 
) const
private

Definition at line 231 of file CompositeTECPetal.cc.

References PVValHelper::add(), SubLayerCrossing::closestDetIndex(), findPar(), muon::overlap(), PV3DBase< T, PVType, FrameType >::perp2(), SubLayerCrossing::position(), subLayer(), SubLayerCrossing::subLayerIndex(), theBackComps, and theFrontComps.

Referenced by groupedCompatibleDetsV().

237  {
238  const GlobalPoint& gCrossingPos = crossing.position();
239 
240  int closestIndex = crossing.closestDetIndex();
241  int negStartIndex = closestIndex - 1;
242  int posStartIndex = closestIndex + 1;
243 
244  float detR = findPar(closestIndex, crossing.subLayerIndex()).theR;
245 
246  if (checkClosest) { // must decide if the closest is on the neg or pos side
247  if (gCrossingPos.perp2() < detR * detR) {
248  posStartIndex = closestIndex;
249  } else {
250  negStartIndex = closestIndex;
251  }
252  }
253 
254  const std::vector<const TECWedge*>& sLayer = subLayer(crossing.subLayerIndex());
255 
256  //const BinFinderType& binFinder = (crossing.subLayerIndex()==0 ? theFrontBinFinder : theBackBinFinder);
257  int theSize = crossing.subLayerIndex() == 0 ? theFrontComps.size() : theBackComps.size();
258 
259  typedef CompatibleDetToGroupAdder Adder;
260  for (int idet = negStartIndex; idet >= 0; idet--) {
261  //if(idet<0 || idet>= theSize) {edm::LogInfo(TkDetLayers) << "===== error! gone out vector bounds.idet: " << idet ;exit;}
262  const GeometricSearchDet& neighborWedge = *sLayer[idet];
263  WedgePar const& wpar = findPar(idet, crossing.subLayerIndex());
264  if (!details::overlap(gCrossingPos, wpar, window))
265  break; // --- to check
266  if (!Adder::add(neighborWedge, tsos, prop, est, result))
267  break;
268  // maybe also add shallow crossing angle test here???
269  }
270  for (int idet = posStartIndex; idet < theSize; idet++) {
271  //if(idet<0 || idet>= theSize) {edm::LogInfo(TkDetLayers) << "===== error! gone out vector bounds.idet: " << idet ;exit;}
272  const GeometricSearchDet& neighborWedge = *sLayer[idet];
273  WedgePar const& wpar = findPar(idet, crossing.subLayerIndex());
274  if (!details::overlap(gCrossingPos, wpar, window))
275  break; // ---- to check
276  if (!Adder::add(neighborWedge, tsos, prop, est, result))
277  break;
278  // maybe also add shallow crossing angle test here???
279  }
280 }
def window
Definition: svgfig.py:643
WedgePar const & findPar(int index, int diskSectorType) const
int closestDetIndex() const
T perp2() const
Definition: PV3DBase.h:68
tuple result
Definition: mps_fire.py:311
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
const GlobalPoint & position() const
int subLayerIndex() const
const std::vector< const TECWedge * > & subLayer(int ind) const
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
std::vector< const TECWedge * > theFrontComps
std::vector< const TECWedge * > theBackComps
virtual const BoundDiskSector& CompositeTECPetal::specificSurface ( ) const
inlinefinalvirtual

Definition at line 32 of file CompositeTECPetal.h.

References theDiskSector.

32 { return *theDiskSector; }
ReferenceCountingPointer< BoundDiskSector > theDiskSector
const std::vector<const TECWedge*>& CompositeTECPetal::subLayer ( int  ind) const
inlineprivate

Definition at line 80 of file CompositeTECPetal.h.

References theBackComps, and theFrontComps.

Referenced by addClosest(), and searchNeighbors().

80  {
81  return (ind == 0 ? theFrontComps : theBackComps);
82  }
std::vector< const TECWedge * > theFrontComps
std::vector< const TECWedge * > theBackComps
const BoundSurface& CompositeTECPetal::surface ( ) const
inlinefinalvirtual

The surface of the GeometricSearchDet.

Implements GeometricSearchDet.

Definition at line 30 of file CompositeTECPetal.h.

References theDiskSector.

30 { return *theDiskSector; }
ReferenceCountingPointer< BoundDiskSector > theDiskSector

Member Data Documentation

std::vector<float> CompositeTECPetal::theBackBoundaries
private

Definition at line 92 of file CompositeTECPetal.h.

Referenced by findBin().

std::vector<const TECWedge*> CompositeTECPetal::theBackComps
private

Definition at line 89 of file CompositeTECPetal.h.

Referenced by searchNeighbors(), and subLayer().

std::vector<WedgePar> CompositeTECPetal::theBackPars
private

Definition at line 94 of file CompositeTECPetal.h.

Referenced by computeCrossings(), and findPar().

ReferenceCountingPointer<BoundDiskSector> CompositeTECPetal::theBackSector
private

Definition at line 97 of file CompositeTECPetal.h.

Referenced by computeCrossings().

std::vector<const GeomDet*> CompositeTECPetal::theBasicComps
private

Definition at line 85 of file CompositeTECPetal.h.

Referenced by basicComponents().

std::vector<const GeometricSearchDet*> CompositeTECPetal::theComps
private

Definition at line 86 of file CompositeTECPetal.h.

Referenced by components(), and ~CompositeTECPetal().

ReferenceCountingPointer<BoundDiskSector> CompositeTECPetal::theDiskSector
private

Definition at line 50 of file CompositeTECPetal.h.

Referenced by specificSurface(), and surface().

std::vector<float> CompositeTECPetal::theFrontBoundaries
private

Definition at line 91 of file CompositeTECPetal.h.

Referenced by findBin().

std::vector<const TECWedge*> CompositeTECPetal::theFrontComps
private

Definition at line 88 of file CompositeTECPetal.h.

Referenced by searchNeighbors(), and subLayer().

std::vector<WedgePar> CompositeTECPetal::theFrontPars
private

Definition at line 93 of file CompositeTECPetal.h.

Referenced by computeCrossings(), and findPar().

ReferenceCountingPointer<BoundDiskSector> CompositeTECPetal::theFrontSector
private

Definition at line 96 of file CompositeTECPetal.h.

Referenced by computeCrossings().