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 Attributes
TkPixelMeasurementDet Class Reference

#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
TransientTrackingRecHit::ConstRecHitContainer 
RecHitContainer
 
typedef tracking::TempMeasurements TempMeasurements
 

Public Member Functions

bool accept (SiPixelClusterRefNew &r) const
 
TransientTrackingRecHit::RecHitPointer buildRecHit (const SiPixelClusterRef &cluster, const LocalTrajectoryParameters &ltp) const
 
void clearBadRocPositions ()
 Clear the list of bad ROCs. More...
 
bool hasBadComponents (const TrajectoryStateOnSurface &tsos) const
 
bool isActive () const
 Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'. More...
 
virtual bool measurements (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
 
virtual RecHitContainer recHits (const TrajectoryStateOnSurface &) const
 
void setActive (bool active)
 Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). This also resets the 'setActiveThisEvent' to true. More...
 
void setActiveThisEvent (bool active)
 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 setClusterToSkip (const std::vector< bool > *skip)
 
void setEmpty ()
 
const PixelGeomDetUnitspecificGeomDet () const
 
 TkPixelMeasurementDet (const GeomDet *gdet, const PixelClusterParameterEstimator *cpe)
 
void update (const detset &detSet, const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > &h, unsigned int id)
 
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
 
virtual const GeomDetgeomDet () const
 
 MeasurementDet (const GeomDet *gdet)
 
const Surface::PositionTypeposition () const
 
virtual bool recHits (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, RecHitContainer &result, std::vector< float > &) const
 
const Surfacesurface () const
 

Private Attributes

bool activeThisEvent_
 
bool activeThisPeriod_
 
std::vector< LocalPointbadRocPositions_
 
detset detSet_
 
bool empty
 
edm::Handle
< edmNew::DetSetVector
< SiPixelCluster > > 
handle_
 
unsigned int id_
 
const std::vector< bool > * skipClusters_
 
const
PixelClusterParameterEstimator
theCPE
 

Detailed Description

Definition at line 15 of file TkPixelMeasurementDet.h.

Member Typedef Documentation

Definition at line 21 of file TkPixelMeasurementDet.h.

Definition at line 20 of file TkPixelMeasurementDet.h.

Definition at line 22 of file TkPixelMeasurementDet.h.

Definition at line 18 of file TkPixelMeasurementDet.h.

Constructor & Destructor Documentation

TkPixelMeasurementDet::TkPixelMeasurementDet ( const GeomDet gdet,
const PixelClusterParameterEstimator cpe 
)

Definition at line 17 of file TkPixelMeasurementDet.cc.

18  :
19  MeasurementDet (gdet),
20  theCPE(cpe),
21  skipClusters_(0),
22  empty(true),
24  {
25  if ( dynamic_cast<const PixelGeomDetUnit*>(gdet) == 0) {
26  throw MeasurementDetException( "TkPixelMeasurementDet constructed with a GeomDet which is not a PixelGeomDetUnit");
27  }
28  }
MeasurementDet(const GeomDet *gdet)
const std::vector< bool > * skipClusters_
const PixelClusterParameterEstimator * theCPE
virtual TkPixelMeasurementDet::~TkPixelMeasurementDet ( )
inlinevirtual

Definition at line 39 of file TkPixelMeasurementDet.h.

39 { }

Member Function Documentation

bool TkPixelMeasurementDet::accept ( SiPixelClusterRefNew r) const
inline

Definition at line 82 of file TkPixelMeasurementDet.h.

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

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

82  {
83 
84  if(0==skipClusters_ || skipClusters_->empty()) return true;
85  if (r.key()>=skipClusters_->size()){
86  edm::LogError("IndexMisMatch")<<r.key()<<" is larger than: "<<skipClusters_->size()<<" no skipping done";
87  return true;
88  }
89  return not (*skipClusters_)[r.key()];
90  }
const std::vector< bool > * skipClusters_
key_type key() const
Accessor for product key.
Definition: Ref.h:266
TransientTrackingRecHit::RecHitPointer TkPixelMeasurementDet::buildRecHit ( const SiPixelClusterRef cluster,
const LocalTrajectoryParameters ltp 
) const

Definition at line 59 of file TkPixelMeasurementDet.cc.

References newFWLiteAna::build, MeasurementDet::fastGeomDet(), ClusterParameterEstimator< T >::localParameters(), specificGeomDet(), and theCPE.

Referenced by recHits().

61 {
62  const GeomDetUnit& gdu( specificGeomDet());
63  LocalValues lv = theCPE->localParameters( * cluster, gdu, ltp );
64  return TSiPixelRecHit::build( lv.first, lv.second, &fastGeomDet(), cluster, theCPE);
65 }
const GeomDet & fastGeomDet() const
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
PixelClusterParameterEstimator::LocalValues LocalValues
const PixelGeomDetUnit & specificGeomDet() const
const PixelClusterParameterEstimator * theCPE
void TkPixelMeasurementDet::clearBadRocPositions ( )
inline

Clear the list of bad ROCs.

Definition at line 68 of file TkPixelMeasurementDet.h.

References badRocPositions_.

68 { badRocPositions_.clear(); }
std::vector< LocalPoint > badRocPositions_
bool TkPixelMeasurementDet::hasBadComponents ( const TrajectoryStateOnSurface tsos) const
virtual

Implements MeasurementDet.

Definition at line 100 of file TkPixelMeasurementDet.cc.

References 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().

100  {
101  if (badRocPositions_.empty()) return false;
102  LocalPoint lp = tsos.localPosition();
104  double dx = 3*std::sqrt(le.xx()) + theRocWidth, dy = 3*std::sqrt(le.yy()) + theRocHeight;
105  for (std::vector<LocalPoint>::const_iterator it = badRocPositions_.begin(), ed = badRocPositions_.end(); it != ed; ++it) {
106  if ( (std::abs(it->x() - lp.x()) < dx) &&
107  (std::abs(it->y() - lp.y()) < dy) ) return true;
108  }
109  return false;
110 }
float xx() const
Definition: LocalError.h:24
std::vector< LocalPoint > badRocPositions_
T y() const
Definition: PV3DBase.h:63
#define abs(x)
Definition: mlp_lapack.h:159
LocalError positionError() const
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:48
const LocalTrajectoryError & localError() const
T x() const
Definition: PV3DBase.h:62
bool TkPixelMeasurementDet::isActive ( ) const
inlinevirtual

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

Implements MeasurementDet.

Definition at line 61 of file TkPixelMeasurementDet.h.

References activeThisEvent_, and activeThisPeriod_.

Referenced by measurements(), and recHits().

bool TkPixelMeasurementDet::measurements ( const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
TempMeasurements result 
) const
virtual

Implements MeasurementDet.

Definition at line 30 of file TkPixelMeasurementDet.cc.

References tracking::TempMeasurements::add(), newFWLiteAna::build, MeasurementEstimator::estimate(), F(), MeasurementDet::fastGeomDet(), MeasurementDet::geomDet(), hasBadComponents(), TrackingRecHit::inactive, isActive(), TrackingRecHit::missing, recHits(), and tracking::TempMeasurements::size().

32  {
33 
34  if (!isActive()) {
36  return true;
37  }
38 
39  auto oldSize = result.size();
40  MeasurementDet::RecHitContainer && allHits = recHits(stateOnThisDet);
41  for (auto && hit : allHits) {
42  std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, *hit);
43  if ( diffEst.first)
44  result.add(std::move(hit), diffEst.second);
45  }
46 
47  if (result.size()>oldSize) return true;
48 
49  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
50  bool inac = hasBadComponents(stateOnThisDet);
53  return inac;
54 
55 }
type
Definition: HCALResponse.h:21
bool isActive() const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
virtual const GeomDet & geomDet() const
const GeomDet & fastGeomDet() const
tuple result
Definition: query.py:137
bool hasBadComponents(const TrajectoryStateOnSurface &tsos) const
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &) const
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
TkPixelMeasurementDet::RecHitContainer TkPixelMeasurementDet::recHits ( const TrajectoryStateOnSurface ts) const
virtual

Implements MeasurementDet.

Definition at line 68 of file TkPixelMeasurementDet.cc.

References begin, edmNew::DetSet< T >::begin(), buildRecHit(), detSet_, empty, edmNew::DetSet< T >::end(), MeasurementDet::fastGeomDet(), GeomDet::geographicalId(), handle_, getHLTprescales::index, isActive(), TrajectoryStateOnSurface::localParameters(), LogDebug, edmNew::makeRefTo(), or, DetId::rawId(), query::result, edmNew::DetSet< T >::size(), and skipClusters_.

Referenced by measurements().

69 {
71  if (empty == true ) return result;
72  if (isActive() == false) return result;
73  const SiPixelCluster* begin=0;
74  if(0!=handle_->data().size()) {
75  begin = &(handle_->data().front());
76  }
77  result.reserve(detSet_.size());
78  for ( const_iterator ci = detSet_.begin(); ci != detSet_.end(); ++ ci ) {
79 
80  if (ci < begin){
81  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch.";
82  return result;
83  }
84  unsigned int index = ci-begin;
85  if (skipClusters_!=0 && skipClusters_->size()!=0 && index>=skipClusters_->size()){
86  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch. i.e "<<index<<" >= "<<skipClusters_->size();
87  return result;
88  }
89  if(0==skipClusters_ or skipClusters_->empty() or (not (*skipClusters_)[index]) ) {
91  result.push_back( buildRecHit( cluster, ts.localParameters() ) );
92  }else{
93  LogDebug("TkPixelMeasurementDet")<<"skipping this cluster from last iteration on "<<fastGeomDet().geographicalId().rawId()<<" key: "<<index;
94  }
95  }
96  return result;
97 }
#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)
bool isActive() const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
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
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
const std::vector< bool > * skipClusters_
const GeomDet & fastGeomDet() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
tuple result
Definition: query.py:137
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
detset::const_iterator const_iterator
edm::Handle< edmNew::DetSetVector< SiPixelCluster > > handle_
TransientTrackingRecHit::RecHitPointer buildRecHit(const SiPixelClusterRef &cluster, const LocalTrajectoryParameters &ltp) const
Pixel cluster – collection of neighboring pixels above threshold.
#define begin
Definition: vmac.h:31
iterator end()
Definition: DetSetNew.h:59
size_type size() const
Definition: DetSetNew.h:75
iterator begin()
Definition: DetSetNew.h:56
void TkPixelMeasurementDet::setActive ( bool  active)
inline

Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). This also resets the 'setActiveThisEvent' to true.

Definition at line 56 of file TkPixelMeasurementDet.h.

References activeThisEvent_, activeThisPeriod_, and empty.

void TkPixelMeasurementDet::setActiveThisEvent ( bool  active)
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 59 of file TkPixelMeasurementDet.h.

References activeThisEvent_, and empty.

59 { activeThisEvent_ = active; if (!active) empty = true; }
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 66 of file TkPixelMeasurementDet.h.

References badRocPositions_.

66 { badRocPositions_.swap(positions); }
std::vector< LocalPoint > badRocPositions_
void TkPixelMeasurementDet::setClusterToSkip ( const std::vector< bool > *  skip)
inline

Definition at line 92 of file TkPixelMeasurementDet.h.

References createPayload::skip, and skipClusters_.

Referenced by MeasurementTrackerImpl::addPixelDet().

92  {
94  }
const std::vector< bool > * skipClusters_
void TkPixelMeasurementDet::setEmpty ( )
inline

Definition at line 37 of file TkPixelMeasurementDet.h.

References activeThisEvent_, and empty.

const PixelGeomDetUnit& TkPixelMeasurementDet::specificGeomDet ( ) const
inline

Definition at line 48 of file TkPixelMeasurementDet.h.

References MeasurementDet::fastGeomDet().

Referenced by buildRecHit().

48 {return static_cast<PixelGeomDetUnit const &>(fastGeomDet());}
const GeomDet & fastGeomDet() const
void TkPixelMeasurementDet::update ( const detset detSet,
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > &  h,
unsigned int  id 
)
inline

Definition at line 27 of file TkPixelMeasurementDet.h.

References activeThisEvent_, detSet_, empty, h, handle_, and id_.

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  detSet_ = detSet;
31  handle_ = h;
32  id_ = id;
33  empty = false;
34  activeThisEvent_ = true;
35  }
edm::Handle< edmNew::DetSetVector< SiPixelCluster > > handle_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

Member Data Documentation

bool TkPixelMeasurementDet::activeThisEvent_
private

Definition at line 78 of file TkPixelMeasurementDet.h.

Referenced by isActive(), setActive(), setActiveThisEvent(), setEmpty(), and update().

bool TkPixelMeasurementDet::activeThisPeriod_
private

Definition at line 78 of file TkPixelMeasurementDet.h.

Referenced by isActive(), and setActive().

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

Definition at line 73 of file TkPixelMeasurementDet.h.

Referenced by recHits(), and update().

bool TkPixelMeasurementDet::empty
private
edm::Handle<edmNew::DetSetVector<SiPixelCluster> > TkPixelMeasurementDet::handle_
private

Definition at line 72 of file TkPixelMeasurementDet.h.

Referenced by recHits(), and update().

unsigned int TkPixelMeasurementDet::id_
private

Definition at line 76 of file TkPixelMeasurementDet.h.

Referenced by update().

const std::vector<bool>* TkPixelMeasurementDet::skipClusters_
private

Definition at line 75 of file TkPixelMeasurementDet.h.

Referenced by accept(), recHits(), and setClusterToSkip().

const PixelClusterParameterEstimator* TkPixelMeasurementDet::theCPE
private

Definition at line 71 of file TkPixelMeasurementDet.h.

Referenced by buildRecHit().