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
 

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...
 
virtual std::vector
< TrajectoryMeasurement
fastMeasurements (const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &startingState, const Propagator &, const MeasurementEstimator &) const
 
bool hasBadComponents (const TrajectoryStateOnSurface &tsos) const
 
bool isActive () const
 Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'. More...
 
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
 
virtual const GeomDetgeomDet () const
 
 MeasurementDet (const GeomDet *gdet)
 
const Surface::PositionTypeposition () const
 
const BoundSurfacesurface () 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 83 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().

83  {
84 
85  if(0==skipClusters_ || skipClusters_->empty()) return true;
86  if (r.key()>=skipClusters_->size()){
87  edm::LogError("IndexMisMatch")<<r.key()<<" is larger than: "<<skipClusters_->size()<<" no skipping done";
88  return true;
89  }
90  return not (*skipClusters_)[r.key()];
91  }
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 71 of file TkPixelMeasurementDet.cc.

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

Referenced by recHits().

73 {
74  const GeomDetUnit& gdu( specificGeomDet());
75  LocalValues lv = theCPE->localParameters( * cluster, gdu, ltp );
76  return TSiPixelRecHit::build( lv.first, lv.second, &fastGeomDet(), cluster, theCPE);
77 }
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 69 of file TkPixelMeasurementDet.h.

References badRocPositions_.

69 { badRocPositions_.clear(); }
std::vector< LocalPoint > badRocPositions_
std::vector< TrajectoryMeasurement > TkPixelMeasurementDet::fastMeasurements ( const TrajectoryStateOnSurface stateOnThisDet,
const TrajectoryStateOnSurface startingState,
const Propagator ,
const MeasurementEstimator  
) const
virtual

faster version in case the TrajectoryState on the surface of the Det is already available. The first TrajectoryStateOnSurface is on the surface of this Det, and the second TrajectoryStateOnSurface is the statrting state, usually not on the surface of this Det. The stateOnThisDet should the result of
prop.propagate( startingState, this->surface())

Implements MeasurementDet.

Definition at line 31 of file TkPixelMeasurementDet.cc.

References newFWLiteAna::build, MeasurementEstimator::estimate(), F(), MeasurementDet::fastGeomDet(), hasBadComponents(), TrackingRecHit::inactive, isActive(), TrackingRecHit::missing, recHits(), query::result, and python.multivaluedict::sort().

35 {
36  std::vector<TrajectoryMeasurement> result;
37 
38  if (isActive() == false) {
39  result.push_back( TrajectoryMeasurement( stateOnThisDet,
41  0.F));
42  return result;
43  }
44 
45  MeasurementDet::RecHitContainer allHits = recHits( stateOnThisDet);
46  for (RecHitContainer::const_iterator ihit=allHits.begin();
47  ihit != allHits.end(); ihit++) {
48  std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, **ihit);
49  if ( diffEst.first) {
50  result.push_back( TrajectoryMeasurement( stateOnThisDet, *ihit,
51  diffEst.second));
52  }
53  //RC else delete *ihit; // we own allHits and have to delete the ones we don't return
54  }
55  if ( result.empty()) {
56  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
58  result.push_back( TrajectoryMeasurement( stateOnThisDet,
60  }
61  else {
62  // sort results according to estimator value
63  if ( result.size() > 1) {
64  sort( result.begin(), result.end(), TrajMeasLessEstim());
65  }
66  }
67  return result;
68 }
type
Definition: HCALResponse.h:22
bool isActive() const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
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
bool TkPixelMeasurementDet::hasBadComponents ( const TrajectoryStateOnSurface tsos) const
virtual

Implements MeasurementDet.

Definition at line 112 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 fastMeasurements().

112  {
113  if (badRocPositions_.empty()) return false;
114  LocalPoint lp = tsos.localPosition();
116  double dx = 3*std::sqrt(le.xx()) + theRocWidth, dy = 3*std::sqrt(le.yy()) + theRocHeight;
117  for (std::vector<LocalPoint>::const_iterator it = badRocPositions_.begin(), ed = badRocPositions_.end(); it != ed; ++it) {
118  if ( (std::abs(it->x() - lp.x()) < dx) &&
119  (std::abs(it->y() - lp.y()) < dy) ) return true;
120  }
121  return false;
122 }
float xx() const
Definition: LocalError.h:24
std::vector< LocalPoint > badRocPositions_
T y() const
Definition: PV3DBase.h:62
#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:46
const LocalTrajectoryError & localError() const
T x() const
Definition: PV3DBase.h:61
bool TkPixelMeasurementDet::isActive ( ) const
inlinevirtual

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

Implements MeasurementDet.

Definition at line 62 of file TkPixelMeasurementDet.h.

References activeThisEvent_, and activeThisPeriod_.

Referenced by fastMeasurements(), and recHits().

TkPixelMeasurementDet::RecHitContainer TkPixelMeasurementDet::recHits ( const TrajectoryStateOnSurface ts) const
virtual

Implements MeasurementDet.

Definition at line 80 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 fastMeasurements().

81 {
83  if (empty == true ) return result;
84  if (isActive() == false) return result;
85  const SiPixelCluster* begin=0;
86  if(0!=handle_->data().size()) {
87  begin = &(handle_->data().front());
88  }
89  result.reserve(detSet_.size());
90  for ( const_iterator ci = detSet_.begin(); ci != detSet_.end(); ++ ci ) {
91 
92  if (ci < begin){
93  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch.";
94  return result;
95  }
96  unsigned int index = ci-begin;
97  if (skipClusters_!=0 && skipClusters_->size()!=0 && index>=skipClusters_->size()){
98  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch. i.e "<<index<<" >= "<<skipClusters_->size();
99  return result;
100  }
101  if(0==skipClusters_ or skipClusters_->empty() or (not (*skipClusters_)[index]) ) {
103  result.push_back( buildRecHit( cluster, ts.localParameters() ) );
104  }else{
105  LogDebug("TkPixelMeasurementDet")<<"skipping this cluster from last iteration on "<<fastGeomDet().geographicalId().rawId()<<" key: "<<index;
106  }
107  }
108  return result;
109 }
#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 57 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 60 of file TkPixelMeasurementDet.h.

References activeThisEvent_, and empty.

60 { 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 67 of file TkPixelMeasurementDet.h.

References badRocPositions_.

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

Definition at line 93 of file TkPixelMeasurementDet.h.

References createPayload::skip, and skipClusters_.

Referenced by MeasurementTrackerImpl::addPixelDet().

93  {
95  }
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 49 of file TkPixelMeasurementDet.h.

References MeasurementDet::fastGeomDet().

Referenced by buildRecHit().

49 {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_, errorMatrix2Lands_multiChannel::id, 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 79 of file TkPixelMeasurementDet.h.

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

bool TkPixelMeasurementDet::activeThisPeriod_
private

Definition at line 79 of file TkPixelMeasurementDet.h.

Referenced by isActive(), and setActive().

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

Definition at line 74 of file TkPixelMeasurementDet.h.

Referenced by recHits(), and update().

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

Definition at line 73 of file TkPixelMeasurementDet.h.

Referenced by recHits(), and update().

unsigned int TkPixelMeasurementDet::id_
private

Definition at line 77 of file TkPixelMeasurementDet.h.

Referenced by update().

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

Definition at line 76 of file TkPixelMeasurementDet.h.

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

const PixelClusterParameterEstimator* TkPixelMeasurementDet::theCPE
private

Definition at line 72 of file TkPixelMeasurementDet.h.

Referenced by buildRecHit().