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

Detailed Description

Definition at line 12 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, and tmp.

Referenced by CompositeTECWedge::addClosest(), TECLayer::addClosest(), TIBLayer::addClosest(), CompositeTECPetal::addClosest(), TOBLayer::addClosest(), TOBRod::addClosest(), TIDRing::addClosest(), PixelBlade::addClosest(), PixelBarrelLayer::addClosest(), and PixelBarrelLayer::searchNeighbors().

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( *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: query.py:137
virtual bool hasGroups() const =0
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
static void addSameLevel(const std::vector< DetGroup > &gvec, std::vector< DetGroup > &result)
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().

47  {
48  //TkGeomDetCompatibilityChecker theCompatibilityChecker;
49  GeomDetCompatibilityChecker theCompatibilityChecker;
50  pair<bool, TrajectoryStateOnSurface> compat = theCompatibilityChecker.isCompatible( &det,tsos, prop, est);
51 
52  if (!compat.first) return false;
53 
54  DetGroupElement ge( &det, compat.second);
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 
63  result.front().push_back(ge);
64  return true;
65 }
static std::pair< bool, TrajectoryStateOnSurface > isCompatible(const GeomDet *theDet, const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est)
tuple result
Definition: query.py:137