CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 14 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 9 of file CompatibleDetToGroupAdder.cc.

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

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

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

Definition at line 43 of file CompatibleDetToGroupAdder.cc.

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

Referenced by counter.Counter::register().

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