CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TkPixelMeasurementDet Class Referencefinal

#include <TkPixelMeasurementDet.h>

Inheritance diagram for TkPixelMeasurementDet:
MeasurementDet

Public Types

typedef detset::const_iterator const_iterator
 
typedef edmNew::DetSet
< SiPixelCluster
detset
 
typedef
PixelClusterParameterEstimator::LocalValues 
LocalValues
 
typedef edm::Ref
< edmNew::DetSetVector
< SiPixelCluster >
, SiPixelCluster
SiPixelClusterRef
 
- Public Types inherited from MeasurementDet
typedef
TrackingRecHit::ConstRecHitContainer 
RecHitContainer
 
using SimpleHitContainer = std::vector< BaseTrackerRecHit * >
 
typedef tracking::TempMeasurements TempMeasurements
 

Public Member Functions

bool accept (SiPixelClusterRefNew &r, const std::vector< bool > skipClusters) const
 
TrackingRecHit::RecHitPointer buildRecHit (const SiPixelClusterRef &cluster, const LocalTrajectoryParameters &ltp) const
 
void clearBadRocPositions ()
 Clear the list of bad ROCs. More...
 
bool hasBadComponents (const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &dat) const
 
int index () const
 
bool isActive (const MeasurementTrackerEvent &data) const
 Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'. More...
 
bool isEmpty (const PxMeasurementDetSet &data) const
 
virtual bool measurements (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &dat, TempMeasurements &result) const
 
virtual RecHitContainer recHits (const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &dat) const
 
virtual bool recHits (SimpleHitContainer &result, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data) const
 
void setActive (bool active)
 Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). More...
 
void setActiveThisEvent (PxMeasurementDetSet &data, bool active) const
 Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call to 'update' or 'setEmpty'. More...
 
void setBadRocPositions (std::vector< LocalPoint > &positions)
 Sets the list of bad ROCs, identified by the positions of their centers in the local coordinate frame. More...
 
void setEmpty (PxMeasurementDetSet &data)
 
void setIndex (int i)
 
const PixelGeomDetUnitspecificGeomDet () const
 
 TkPixelMeasurementDet (const GeomDet *gdet, PxMeasurementConditionSet &conditionSet)
 
void update (PxMeasurementDetSet &data, const detset &detSet)
 
virtual ~TkPixelMeasurementDet ()
 
- Public Member Functions inherited from MeasurementDet
const GeomDetfastGeomDet () const
 
std::vector
< TrajectoryMeasurement
fastMeasurements (const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &est, const MeasurementTrackerEvent &data) const
 
virtual const GeomDetgeomDet () const
 
 MeasurementDet (const GeomDet *gdet)
 
const Surface::PositionTypeposition () const
 
virtual bool recHits (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data, RecHitContainer &result, std::vector< float > &) const
 
const Surfacesurface () const
 

Private Member Functions

PxMeasurementConditionSetconditionSet ()
 
const PxMeasurementConditionSetconditionSet () const
 
const
PixelClusterParameterEstimator
cpe () const
 

Private Attributes

std::vector< LocalPointbadRocPositions_
 
unsigned int id_
 
int index_
 
PxMeasurementConditionSettheDetConditions
 

Additional Inherited Members

- Protected Attributes inherited from MeasurementDet
TrackingRecHit::ConstRecHitPointer theInactiveHit
 
TrackingRecHit::ConstRecHitPointer theMissingHit
 

Detailed Description

Definition at line 17 of file TkPixelMeasurementDet.h.

Member Typedef Documentation

Definition at line 23 of file TkPixelMeasurementDet.h.

Definition at line 22 of file TkPixelMeasurementDet.h.

Definition at line 24 of file TkPixelMeasurementDet.h.

Definition at line 20 of file TkPixelMeasurementDet.h.

Constructor & Destructor Documentation

TkPixelMeasurementDet::TkPixelMeasurementDet ( const GeomDet gdet,
PxMeasurementConditionSet conditionSet 
)

Definition at line 17 of file TkPixelMeasurementDet.cc.

18  :
19  MeasurementDet (gdet),
20  theDetConditions(&conditions)
21  {
22  if ( dynamic_cast<const PixelGeomDetUnit*>(gdet) == 0) {
23  throw MeasurementDetException( "TkPixelMeasurementDet constructed with a GeomDet which is not a PixelGeomDetUnit");
24  }
25  }
MeasurementDet(const GeomDet *gdet)
PxMeasurementConditionSet * theDetConditions
virtual TkPixelMeasurementDet::~TkPixelMeasurementDet ( )
inlinevirtual

Definition at line 37 of file TkPixelMeasurementDet.h.

37 { }

Member Function Documentation

bool TkPixelMeasurementDet::accept ( SiPixelClusterRefNew r,
const std::vector< bool >  skipClusters 
) const
inline

Definition at line 91 of file TkPixelMeasurementDet.h.

References edm::Ref< C, T, F >::key().

Referenced by Vispa.Gui.BoxContentDialog.BoxContentDialog::apply(), and Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::apply().

91  {
92 
93  if(skipClusters.empty()) return true;
94  if (r.key()>=skipClusters.size()){
95  edm::LogError("IndexMisMatch")<<r.key()<<" is larger than: "<<skipClusters.size()<<" no skipping done";
96  return true;
97  }
98  return not skipClusters[r.key()];
99  }
key_type key() const
Accessor for product key.
Definition: Ref.h:266
TrackingRecHit::RecHitPointer TkPixelMeasurementDet::buildRecHit ( const SiPixelClusterRef cluster,
const LocalTrajectoryParameters ltp 
) const

Definition at line 55 of file TkPixelMeasurementDet.cc.

References cpe(), MeasurementDet::fastGeomDet(), PixelClusterParameterEstimator::getParameters(), and specificGeomDet().

Referenced by recHits().

57 {
58  const GeomDetUnit& gdu( specificGeomDet());
59 
60  auto && params = cpe()->getParameters( * cluster, gdu, ltp );
61  return std::make_shared<SiPixelRecHit>( std::get<0>(params), std::get<1>(params), std::get<2>(params), fastGeomDet(), cluster);
62 }
const PixelClusterParameterEstimator * cpe() const
virtual ReturnType getParameters(const SiPixelCluster &cl, const GeomDetUnit &det) const =0
const GeomDet & fastGeomDet() const
const PixelGeomDetUnit & specificGeomDet() const
void TkPixelMeasurementDet::clearBadRocPositions ( )
inline

Clear the list of bad ROCs.

Definition at line 73 of file TkPixelMeasurementDet.h.

73 { badRocPositions_.clear(); }
std::vector< LocalPoint > badRocPositions_
PxMeasurementConditionSet& TkPixelMeasurementDet::conditionSet ( )
inlineprivate

Definition at line 84 of file TkPixelMeasurementDet.h.

84 { return *theDetConditions; }
PxMeasurementConditionSet * theDetConditions
const PxMeasurementConditionSet& TkPixelMeasurementDet::conditionSet ( ) const
inlineprivate

Definition at line 85 of file TkPixelMeasurementDet.h.

85 { return *theDetConditions; }
PxMeasurementConditionSet * theDetConditions
const PixelClusterParameterEstimator* TkPixelMeasurementDet::cpe ( ) const
inlineprivate

Definition at line 87 of file TkPixelMeasurementDet.h.

Referenced by buildRecHit().

87 { return conditionSet().pixelCPE(); }
PxMeasurementConditionSet & conditionSet()
const PixelClusterParameterEstimator * pixelCPE() const
bool TkPixelMeasurementDet::hasBadComponents ( const TrajectoryStateOnSurface tsos,
const MeasurementTrackerEvent dat 
) const
virtual

Implements MeasurementDet.

Definition at line 98 of file TkPixelMeasurementDet.cc.

References funct::abs(), badRocPositions_, asciidump::le, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LocalTrajectoryError::positionError(), mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Referenced by measurements().

98  {
99  if (badRocPositions_.empty()) return false;
100  LocalPoint lp = tsos.localPosition();
102  double dx = 3*std::sqrt(le.xx()) + theRocWidth, dy = 3*std::sqrt(le.yy()) + theRocHeight;
103  for (std::vector<LocalPoint>::const_iterator it = badRocPositions_.begin(), ed = badRocPositions_.end(); it != ed; ++it) {
104  if ( (std::abs(it->x() - lp.x()) < dx) &&
105  (std::abs(it->y() - lp.y()) < dy) ) return true;
106  }
107  return false;
108 }
float xx() const
Definition: LocalError.h:24
std::vector< LocalPoint > badRocPositions_
T y() const
Definition: PV3DBase.h:63
LocalError positionError() const
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const LocalTrajectoryError & localError() const
T x() const
Definition: PV3DBase.h:62
int TkPixelMeasurementDet::index ( ) const
inline

Definition at line 75 of file TkPixelMeasurementDet.h.

Referenced by BeautifulSoup.PageElement::_invert(), and recHits().

75 { return index_; }
bool TkPixelMeasurementDet::isActive ( const MeasurementTrackerEvent data) const
inlinevirtual

Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'.

Implements MeasurementDet.

Definition at line 66 of file TkPixelMeasurementDet.h.

References cmsHarvester::index, PxMeasurementDetSet::isActive(), and MeasurementTrackerEvent::pixelData().

Referenced by measurements(), and recHits().

66 { return data.pixelData().isActive(index()); }
const PxMeasurementDetSet & pixelData() const
bool isActive(int i) const
bool TkPixelMeasurementDet::isEmpty ( const PxMeasurementDetSet data) const
inline

Definition at line 35 of file TkPixelMeasurementDet.h.

References PxMeasurementDetSet::empty(), and cmsHarvester::index.

Referenced by recHits().

35 {return data.empty(index());}
bool empty(int i) const
bool TkPixelMeasurementDet::measurements ( const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
const MeasurementTrackerEvent dat,
TempMeasurements result 
) const
virtual

Implements MeasurementDet.

Definition at line 27 of file TkPixelMeasurementDet.cc.

References tracking::TempMeasurements::add(), MeasurementEstimator::estimate(), F(), hasBadComponents(), isActive(), recHits(), tracking::TempMeasurements::size(), MeasurementDet::theInactiveHit, and MeasurementDet::theMissingHit.

29  {
30 
31  if (!isActive(data)) {
32  result.add(theInactiveHit, 0.F);
33  return true;
34  }
35 
36  auto oldSize = result.size();
37  MeasurementDet::RecHitContainer && allHits = recHits(stateOnThisDet, data);
38  for (auto && hit : allHits) {
39  std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, *hit);
40  if ( diffEst.first)
41  result.add(std::move(hit), diffEst.second);
42  }
43 
44  if (result.size()>oldSize) return true;
45 
46  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
47  bool inac = hasBadComponents(stateOnThisDet, data);
48  result.add(inac ? theInactiveHit : theMissingHit, 0.F);
49  return inac;
50 
51 }
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &dat) const
TrackingRecHit::ConstRecHitPointer theMissingHit
tuple result
Definition: query.py:137
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &dat) const
TrackingRecHit::ConstRecHitPointer theInactiveHit
TrackingRecHit::ConstRecHitContainer RecHitContainer
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
TkPixelMeasurementDet::RecHitContainer TkPixelMeasurementDet::recHits ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent dat 
) const
virtual

Implements MeasurementDet.

Definition at line 65 of file TkPixelMeasurementDet.cc.

References begin, edmNew::DetSet< T >::begin(), buildRecHit(), edmNew::DetSetVector< T >::data(), PxMeasurementDetSet::detSet(), edmNew::DetSet< T >::end(), MeasurementDet::fastGeomDet(), GeomDet::geographicalId(), PxMeasurementDetSet::handle(), index(), isActive(), isEmpty(), TrajectoryStateOnSurface::localParameters(), LogDebug, edmNew::makeRefTo(), or, MeasurementTrackerEvent::pixelClustersToSkip(), MeasurementTrackerEvent::pixelData(), DetId::rawId(), query::result, edmNew::DetSet< T >::size(), and SiPixelCluster::size().

Referenced by measurements().

66 {
68  if (isEmpty(data.pixelData())== true ) return result;
69  if (isActive(data) == false) return result;
70  const SiPixelCluster* begin=0;
71  if (0 != data.pixelData().handle()->data().size()) {
72  begin = &(data.pixelData().handle()->data().front());
73  }
74  const detset & detSet = data.pixelData().detSet(index());
75  result.reserve(detSet.size());
76  for ( const_iterator ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
77 
78  if (ci < begin){
79  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch.";
80  return result;
81  }
82  unsigned int index = ci-begin;
83  if (!data.pixelClustersToSkip().empty() && index>=data.pixelClustersToSkip().size()){
84  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch. i.e "<<index<<" >= "<<data.pixelClustersToSkip().size();
85  return result;
86  }
87  if(data.pixelClustersToSkip().empty() or (not data.pixelClustersToSkip()[index]) ) {
88  SiPixelClusterRef cluster = edmNew::makeRefTo( data.pixelData().handle(), ci );
89  result.push_back( buildRecHit( cluster, ts.localParameters() ) );
90  }else{
91  LogDebug("TkPixelMeasurementDet")<<"skipping this cluster from last iteration on "<<fastGeomDet().geographicalId().rawId()<<" key: "<<index;
92  }
93  }
94  return result;
95 }
#define LogDebug(id)
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const LocalTrajectoryParameters & localParameters() const
TrackingRecHit::RecHitPointer buildRecHit(const SiPixelClusterRef &cluster, const LocalTrajectoryParameters &ltp) const
const GeomDet & fastGeomDet() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
tuple result
Definition: query.py:137
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
detset::const_iterator const_iterator
TrackingRecHit::ConstRecHitContainer RecHitContainer
Pixel cluster – collection of neighboring pixels above threshold.
#define begin
Definition: vmac.h:30
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edmNew::DetSet< SiPixelCluster > detset
bool isEmpty(const PxMeasurementDetSet &data) const
virtual bool TkPixelMeasurementDet::recHits ( SimpleHitContainer result,
const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator ,
const MeasurementTrackerEvent data 
) const
inlinevirtual

Reimplemented from MeasurementDet.

Definition at line 42 of file TkPixelMeasurementDet.h.

43  {
44  assert("not implemented for Pixel yet"==nullptr);
45  }
void TkPixelMeasurementDet::setActive ( bool  active)
inline

Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually).

Definition at line 61 of file TkPixelMeasurementDet.h.

References cmsHarvester::index.

61 { conditionSet().setActive(index(), active); }
PxMeasurementConditionSet & conditionSet()
void setActive(int i, bool active)
Turn on/off the module for reconstruction, for the full run or lumi (using info from DB...
void TkPixelMeasurementDet::setActiveThisEvent ( PxMeasurementDetSet data,
bool  active 
) const
inline

Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call to 'update' or 'setEmpty'.

Definition at line 64 of file TkPixelMeasurementDet.h.

References cmsHarvester::index, and PxMeasurementDetSet::setActiveThisEvent().

64 { data.setActiveThisEvent(index(), active); }
void setActiveThisEvent(bool active)
void TkPixelMeasurementDet::setBadRocPositions ( std::vector< LocalPoint > &  positions)
inline

Sets the list of bad ROCs, identified by the positions of their centers in the local coordinate frame.

Definition at line 71 of file TkPixelMeasurementDet.h.

71 { badRocPositions_.swap(positions); }
std::vector< LocalPoint > badRocPositions_
void TkPixelMeasurementDet::setEmpty ( PxMeasurementDetSet data)
inline

Definition at line 34 of file TkPixelMeasurementDet.h.

References cmsHarvester::index, and PxMeasurementDetSet::setEmpty().

34 { data.setEmpty(index()); }
void TkPixelMeasurementDet::setIndex ( int  i)
inline

Definition at line 76 of file TkPixelMeasurementDet.h.

References i.

76 { index_ = i; }
int i
Definition: DBlmapReader.cc:9
const PixelGeomDetUnit& TkPixelMeasurementDet::specificGeomDet ( ) const
inline

Definition at line 54 of file TkPixelMeasurementDet.h.

References MeasurementDet::fastGeomDet().

Referenced by buildRecHit().

54 {return static_cast<PixelGeomDetUnit const &>(fastGeomDet());}
const GeomDet & fastGeomDet() const
void TkPixelMeasurementDet::update ( PxMeasurementDetSet data,
const detset detSet 
)
inline

Definition at line 29 of file TkPixelMeasurementDet.h.

References cmsHarvester::index, PxMeasurementDetSet::setActiveThisEvent(), and PxMeasurementDetSet::update().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

29  {
30  data.update(index(), detSet);
31  data.setActiveThisEvent(index(), true);
32  }
void update(int i, const PixelDetSet &detSet)
void setActiveThisEvent(bool active)

Member Data Documentation

std::vector< LocalPoint > TkPixelMeasurementDet::badRocPositions_
private

Definition at line 80 of file TkPixelMeasurementDet.h.

Referenced by hasBadComponents().

unsigned int TkPixelMeasurementDet::id_
private

Definition at line 79 of file TkPixelMeasurementDet.h.

int TkPixelMeasurementDet::index_
private

Definition at line 82 of file TkPixelMeasurementDet.h.

PxMeasurementConditionSet* TkPixelMeasurementDet::theDetConditions
private

Definition at line 83 of file TkPixelMeasurementDet.h.