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

◆ add() [1/2]

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.

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 }

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

Referenced by counter.Counter::register().

◆ add() [2/2]

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.

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(*i);
37  }
38  return true;
39 }

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

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

mps_fire.i
i
Definition: mps_fire.py:428
GeomDetCompatibilityChecker
Definition: GeomDetCompatibilityChecker.h:12
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
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
GeometricSearchDet::compatibleDetsV
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
Definition: GeometricSearchDet.cc:9
eostools.move
def move(src, dest)
Definition: eostools.py:511
GeometricSearchDet::hasGroups
bool hasGroups() const
Definition: GeometricSearchDet.h:99
DetGroup
Definition: DetGroup.h:41
mps_fire.result
result
Definition: mps_fire.py:311
DetGroupMerger::addSameLevel
static void addSameLevel(std::vector< DetGroup > &&gvec, std::vector< DetGroup > &result)
Definition: DetGroupMerger.cc:47
edm::Log
Definition: MessageLogger.h:70