CMS 3D CMS Logo

List of all members | Static Public Member Functions
CompatibleDetToGroupAdder Class Reference

#include <CompatibleDetToGroupAdder.h>

Static Public Member Functions

static bool add (const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
 
static bool add (const GeomDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
 

Detailed Description

Definition at line 13 of file CompatibleDetToGroupAdder.h.

Member Function Documentation

bool CompatibleDetToGroupAdder::add ( const GeometricSearchDet det,
const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
)
static

Checks the det for compatibility with the tsos propagated by prop and according to est; if the det is compatible, it is added to result and the method returns true, if not result is not modified and the method returns false. The method for chacking for compatibility used depends on the det: if the det hasGroups, then groupedCompatibleDets() is used, otherwise compatible() is used.

Definition at line 7 of file CompatibleDetToGroupAdder.cc.

References DetGroupMerger::addSameLevel(), GeometricSearchDet::compatibleDetsV(), GeometricSearchDet::groupedCompatibleDetsV(), GeometricSearchDet::hasGroups(), mps_fire::i, eostools::move(), and createJobs::tmp.

Referenced by CompositeTECWedge::addClosest(), TECLayer::addClosest(), TOBRod::addClosest(), TIDRing::addClosest(), TBLayer::addClosest(), PixelBlade::addClosest(), Phase2EndcapRing::addClosest(), Phase2OTBarrelRod::addClosest(), Phase1PixelBlade::addClosest(), CompositeTECPetal::addClosest(), and counter.Counter::register().

11  {
12  if (det.hasGroups()) {
13  vector<DetGroup> tmp;
14  det.groupedCompatibleDetsV(tsos, prop, est, tmp);
15  if (tmp.empty())
16  return false;
17 
18  if (result.empty())
19  result.swap(tmp);
20  else
22  } else {
23  vector<GeometricSearchDet::DetWithState> compatDets;
24  det.compatibleDetsV(tsos, prop, est, compatDets);
25  if (compatDets.empty())
26  return false;
27 
28  if (result.empty())
29  result.push_back(DetGroup(0, 1)); // empty group for insertion
30 
31  if (result.size() != 1)
32  edm::LogError("TkDetLayers")
33  << "CompatibleDetToGroupAdder: det is not grouped but result has more than one group!";
34  result.front().reserve(result.front().size() + compatDets.size());
35  for (vector<GeometricSearchDet::DetWithState>::const_iterator i = compatDets.begin(); i != compatDets.end(); i++)
36  result.front().push_back(std::move(*i));
37  }
38  return true;
39 }
virtual void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
static void addSameLevel(std::vector< DetGroup > &&gvec, std::vector< DetGroup > &result)
tmp
align.sh
Definition: createJobs.py:716
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
def move(src, dest)
Definition: eostools.py:511
bool CompatibleDetToGroupAdder::add ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
)
static

Definition at line 44 of file CompatibleDetToGroupAdder.cc.

References GeomDetCompatibilityChecker::isCompatible(), and eostools::move().

Referenced by counter.Counter::register().

48  {
49  //TkGeomDetCompatibilityChecker theCompatibilityChecker;
50  GeomDetCompatibilityChecker theCompatibilityChecker;
51  auto&& compat = theCompatibilityChecker.isCompatible(&det, tsos, prop, est);
52 
53  if (!compat.first)
54  return false;
55 
56  if (result.empty())
57  result.push_back(DetGroup(0, 1)); // empty group for ge insertion
58 
59  if (result.size() != 1)
60  edm::LogError("TkDetLayers") << "CompatibleDetToGroupAdder: det is not grouped but result has more than one group!";
61 
62  result.front().emplace_back(&det, std::move(compat.second));
63  return true;
64 }
static std::pair< bool, TrajectoryStateOnSurface > isCompatible(const GeomDet *theDet, const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est)
def move(src, dest)
Definition: eostools.py:511