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(std::move(*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 }
MeasurementEstimator
Definition: MeasurementEstimator.h:19
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
GeomDet
Definition: GeomDet.h:27
GeomDetCompatibilityChecker
Definition: GeomDetCompatibilityChecker.h:12
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
DetGroupMerger.h
GeomDetCompatibilityChecker::isCompatible
static std::pair< bool, TrajectoryStateOnSurface > isCompatible(const GeomDet *theDet, const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est)
Definition: GeomDetCompatibilityChecker.cc:58
GeometricSearchDet::groupedCompatibleDetsV
virtual void groupedCompatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
Definition: GeometricSearchDet.cc:28
CompatibleDetToGroupAdder::add
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
Definition: CompatibleDetToGroupAdder.cc:7
edm::LogError
Definition: MessageLogger.h:183
GeometricSearchDet::compatibleDetsV
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
Definition: GeometricSearchDet.cc:9
GeomDetCompatibilityChecker.h
CompatibleDetToGroupAdder.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
GeometricSearchDet::hasGroups
bool hasGroups() const
Definition: GeometricSearchDet.h:99
DetGroup
Definition: DetGroup.h:41
mps_fire.result
result
Definition: mps_fire.py:303
GeometricSearchDet
Definition: GeometricSearchDet.h:17
DetGroupMerger::addSameLevel
static void addSameLevel(std::vector< DetGroup > &&gvec, std::vector< DetGroup > &result)
Definition: DetGroupMerger.cc:47