CMS 3D CMS Logo

CompatibleDetToGroupAdder.cc
Go to the documentation of this file.
3 #include "DetGroupMerger.h"
4 
5 using namespace std;
6 
8  const TrajectoryStateOnSurface& tsos,
9  const Propagator& prop,
10  const MeasurementEstimator& est,
11  vector<DetGroup>& result) {
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(*i);
37  }
38  return true;
39 }
40 
42 // #include "TkGeomDetCompatibilityChecker.h"
43 
45  const TrajectoryStateOnSurface& tsos,
46  const Propagator& prop,
47  const MeasurementEstimator& est,
48  vector<DetGroup>& result) {
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 void addSameLevel(std::vector< DetGroup > &&gvec, std::vector< DetGroup > &result)
static std::pair< bool, TrajectoryStateOnSurface > isCompatible(const GeomDet *theDet, const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est)
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
virtual void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
tmp
align.sh
Definition: createJobs.py:716
def move(src, dest)
Definition: eostools.py:511