CMS 3D CMS Logo

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

#include <TkStripMeasurementDet.h>

Inheritance diagram for TkStripMeasurementDet:
MeasurementDet

Public Types

typedef
StMeasurementConditionSet::BadStripBlock 
BadStripBlock
 
typedef
StMeasurementConditionSet::BadStripCuts 
BadStripCuts
 
typedef std::vector
< SiStripCluster >
::const_iterator 
const_iterator
 
typedef edmNew::DetSet
< SiStripCluster
detset
 
typedef
StripClusterParameterEstimator::LocalValues 
LocalValues
 
typedef detset::const_iterator new_const_iterator
 
typedef SiStripRecHit2D::ClusterRef SiStripClusterRef
 
typedef
StripClusterParameterEstimator::VLocalValues 
VLocalValues
 
- Public Types inherited from MeasurementDet
typedef
TrackingRecHit::ConstRecHitContainer 
RecHitContainer
 
using SimpleHitContainer = std::vector< BaseTrackerRecHit * >
 
typedef tracking::TempMeasurements TempMeasurements
 

Public Member Functions

bool accept (SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
 
bool accept (unsigned int key, const std::vector< bool > &skipClusters) const
 
void advance (TkStripRecHitIter &hi) const
 
std::vector< BadStripBlock >
const & 
badStripBlocks () const
 
template<class ClusterRefT >
TrackingRecHit::RecHitPointer buildRecHit (const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp) const
 
template<class ClusterRefT >
void buildRecHits (const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp, const RecHitContainer &_res) const
 
const detsetdetSet (const StMeasurementDetSet &theDets) const
 
bool empty (const MeasurementTrackerEvent &data) const
 
template<class ClusterRefT >
bool filteredRecHits (const ClusterRefT &cluster, StripCPE::AlgoParam const &cpepar, const TrajectoryStateOnSurface &ltp, const MeasurementEstimator &est, const std::vector< bool > &skipClusters, RecHitContainer &result, std::vector< float > &diffs) const
 
template<class ClusterRefT >
bool filteredRecHits (const ClusterRefT &cluster, StripCPE::AlgoParam const &cpepar, const TrajectoryStateOnSurface &ltp, const MeasurementEstimator &est, const std::vector< bool > &skipClusters, std::vector< SiStripRecHit2D > &result) const
 
std::vector< BadStripBlock > & getBadStripBlocks ()
 
bool hasAllGoodChannels () const
 does this module have at least one bad strip, APV or channel? More...
 
bool hasBadComponents (const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
 
SiStripRecHit2D hit (TkStripRecHitIter const &hi) const
 
std::tuple< TkStripRecHitIter,
TkStripRecHitIter
hitRange (const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const
 
int index () const
 
bool isActive (const MeasurementTrackerEvent &data) const override
 Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'. More...
 
bool isEmpty (const StMeasurementDetSet &theDets) const
 
bool maskBad128StripBlocks () const
 
bool measurements (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const override
 
unsigned int rawId () const
 
RecHitContainer recHits (const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
 
bool recHits (SimpleHitContainer &result, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data) const override
 
bool recHits (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, RecHitContainer &result, std::vector< float > &diffs) const override
 
void set128StripStatus (bool good, int idx=-1)
 Sets the status of a block of 128 strips (or all blocks if idx=-1) More...
 
void setActiveThisEvent (StMeasurementDetSet &theDets, 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 setActiveThisPeriod (StMeasurementDetSet &theDets, bool active)
 Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). More...
 
void setEmpty (StMeasurementDetSet &theDets) const
 
void setIndex (int i)
 
void simpleRecHits (const TrajectoryStateOnSurface &ts, const MeasurementTrackerEvent &data, std::vector< SiStripRecHit2D > &result) const
 
bool simpleRecHits (const TrajectoryStateOnSurface &ts, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, std::vector< SiStripRecHit2D > &result) const
 
const StripGeomDetUnitspecificGeomDet () const
 
unsigned char subId () const
 
bool testStrips (float utraj, float uerr) const
 return true if there are 'enough' good strips in the utraj +/- 3 uerr range. More...
 
const detsettheSet (const StMeasurementDetSet &theDets) const
 
 TkStripMeasurementDet (const GeomDet *gdet, StMeasurementConditionSet &conditionSet)
 
 ~TkStripMeasurementDet () override
 
- 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
 
const Surfacesurface () const
 
virtual ~MeasurementDet ()=default
 

Private Types

using AClusters = StripClusterParameterEstimator::AClusters
 
using ALocalValues = StripClusterParameterEstimator::ALocalValues
 

Private Member Functions

BadStripCuts const & badStripCuts () const
 
void buildSimpleRecHits (AClusters const &clusters, const MeasurementTrackerEvent &data, const detset &detSet, const TrajectoryStateOnSurface &ltp, std::vector< SiStripRecHit2D > &res) const
 
StMeasurementConditionSetconditionSet ()
 
const StMeasurementConditionSetconditionSet () const
 
const StripCPEcpe () const
 
bool hasAny128StripBad () const
 
bool isMasked (const SiStripCluster &cluster) const
 
int totalStrips () const
 

Private Attributes

int index_
 
StMeasurementConditionSettheDetConditions
 

Additional Inherited Members

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

Detailed Description

Definition at line 74 of file TkStripMeasurementDet.h.

Member Typedef Documentation

Definition at line 245 of file TkStripMeasurementDet.h.

Definition at line 246 of file TkStripMeasurementDet.h.

Definition at line 237 of file TkStripMeasurementDet.h.

Definition at line 232 of file TkStripMeasurementDet.h.

Definition at line 84 of file TkStripMeasurementDet.h.

Definition at line 81 of file TkStripMeasurementDet.h.

Definition at line 76 of file TkStripMeasurementDet.h.

Definition at line 82 of file TkStripMeasurementDet.h.

Definition at line 79 of file TkStripMeasurementDet.h.

Definition at line 77 of file TkStripMeasurementDet.h.

Constructor & Destructor Documentation

TkStripMeasurementDet::~TkStripMeasurementDet ( )
inlineoverride

Definition at line 86 of file TkStripMeasurementDet.h.

86 {}
TkStripMeasurementDet::TkStripMeasurementDet ( const GeomDet gdet,
StMeasurementConditionSet conditionSet 
)

Definition at line 16 of file TkStripMeasurementDet.cc.

18  if (dynamic_cast<const StripGeomDetUnit*>(gdet) == nullptr) {
19  throw MeasurementDetException("TkStripMeasurementDet constructed with a GeomDet which is not a StripGeomDetUnit");
20  }
21 }
MeasurementDet(const GeomDet *gdet)
StMeasurementConditionSet * theDetConditions

Member Function Documentation

bool TkStripMeasurementDet::accept ( SiStripClusterRef const &  r,
const std::vector< bool > &  skipClusters 
) const
inline

Definition at line 277 of file TkStripMeasurementDet.h.

References accept(), edm::Ref< C, T, F >::key(), and HLT_FULL_cff::skipClusters.

Referenced by advance(), empty(), esMonitoring.FDJsonServer::handle_accept(), recHits(), and simpleRecHits().

277  {
278  return accept(r.key(), skipClusters);
279  }
bool accept(SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
tuple skipClusters
bool TkStripMeasurementDet::accept ( unsigned int  key,
const std::vector< bool > &  skipClusters 
) const
inline

Definition at line 281 of file TkStripMeasurementDet.h.

References LogDebug.

Referenced by esMonitoring.FDJsonServer::handle_accept().

281  {
282  if (skipClusters.empty())
283  return true;
284  if (key >= skipClusters.size()) {
285  LogDebug("TkStripMeasurementDet")
286  << key << " is larger than: " << skipClusters.size()
287  << "\n This must be a new cluster, and therefore should not be skiped most likely.";
288  return true;
289  }
290  return (not(skipClusters[key]));
291  }
tuple key
prepare the HTCondor submission files and eventually submit them
tuple skipClusters
#define LogDebug(id)
void TkStripMeasurementDet::advance ( TkStripRecHitIter hi) const

Definition at line 250 of file TkStripMeasurementDet.cc.

References accept(), TkStripRecHitIter::clusterI, TkStripRecHitIter::data, data, TkStripRecHitIter::empty(), isMasked(), and edmNew::makeRefTo().

Referenced by TkStripRecHitIter::advance().

250  {
251  while (!hi.empty()) {
252  auto ci = hi.clusterI;
253  auto const& data = *hi.data;
254  if (isMasked(*ci))
255  continue;
256  SiStripClusterRef cluster = edmNew::makeRefTo(data.stripData().handle(), ci);
257  if (accept(cluster, data.stripClustersToSkip()))
258  return;
259  ++hi.clusterI;
260  }
261 }
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 accept(SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
bool isMasked(const SiStripCluster &cluster) const
const MeasurementTrackerEvent * data
new_const_iterator clusterI
SiStripRecHit2D::ClusterRef SiStripClusterRef
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::vector<BadStripBlock> const& TkStripMeasurementDet::badStripBlocks ( ) const
inline

Definition at line 240 of file TkStripMeasurementDet.h.

Referenced by testStrips().

240 { return conditionSet().badStripBlocks(index()); }
StMeasurementConditionSet & conditionSet()
std::vector< BadStripBlock > const & badStripBlocks(int i) const
BadStripCuts const& TkStripMeasurementDet::badStripCuts ( ) const
inlineprivate

Definition at line 257 of file TkStripMeasurementDet.h.

Referenced by testStrips().

257 { return conditionSet().badStripCuts(index()); }
const BadStripCuts & badStripCuts(int i) const
StMeasurementConditionSet & conditionSet()
template<class ClusterRefT >
TrackingRecHit::RecHitPointer TkStripMeasurementDet::buildRecHit ( const ClusterRefT &  cluster,
const TrajectoryStateOnSurface ltp 
) const
inline

Definition at line 150 of file TkStripMeasurementDet.h.

References MeasurementDet::fastGeomDet().

Referenced by recHits().

150  {
151  const GeomDetUnit& gdu(specificGeomDet());
152  LocalValues lv = cpe()->localParameters(*cluster, gdu, ltp);
153  return std::make_shared<SiStripRecHit2D>(lv.first, lv.second, fastGeomDet(), cluster);
154  }
StripClusterParameterEstimator::LocalValues LocalValues
const GeomDet & fastGeomDet() const
const StripCPE * cpe() const
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:62
const StripGeomDetUnit & specificGeomDet() const
template<class ClusterRefT >
void TkStripMeasurementDet::buildRecHits ( const ClusterRefT &  cluster,
const TrajectoryStateOnSurface ltp,
const RecHitContainer _res 
) const
inline

Definition at line 157 of file TkStripMeasurementDet.h.

159  {
160  RecHitContainer res = _res;
161  const GeomDetUnit& gdu(specificGeomDet());
162  VLocalValues vlv = cpe()->localParametersV(*cluster, gdu, ltp);
163  for (VLocalValues::const_iterator it = vlv.begin(); it != vlv.end(); ++it)
164  res.push_back(std::make_shared<SiStripRecHit2D>(it->first, it->second, fastGeomDet(), cluster));
165  }
virtual VLocalValues localParametersV(const SiStripCluster &cluster, const GeomDetUnit &gd) const
StripClusterParameterEstimator::VLocalValues VLocalValues
const GeomDet & fastGeomDet() const
const StripCPE * cpe() const
const StripGeomDetUnit & specificGeomDet() const
TrackingRecHit::ConstRecHitContainer RecHitContainer
void TkStripMeasurementDet::buildSimpleRecHits ( AClusters const &  clusters,
const MeasurementTrackerEvent data,
const detset detSet,
const TrajectoryStateOnSurface ltp,
std::vector< SiStripRecHit2D > &  res 
) const
inlineprivate

Definition at line 263 of file TkStripMeasurementDet.h.

References declareDynArray, StMeasurementDetSet::handle(), mps_fire::i, TrajectoryStateOnSurface::localParameters(), edmNew::DetSet< T >::makeRefTo(), DynArray< T >::size(), and MeasurementTrackerEvent::stripData().

Referenced by simpleRecHits().

267  {
268  const GeomDetUnit& gdu(specificGeomDet());
269  declareDynArray(LocalValues, clusters.size(), alv);
270  cpe()->localParameters(clusters, alv, gdu, ltp.localParameters());
271  res.reserve(alv.size());
272  for (unsigned int i = 0; i < clusters.size(); ++i)
273  res.emplace_back(alv[i].first, alv[i].second, gdu, detSet.makeRefTo(data.stripData().handle(), clusters[i]));
274  }
const LocalTrajectoryParameters & localParameters() const
StripClusterParameterEstimator::LocalValues LocalValues
const StMeasurementDetSet & stripData() const
const StripCPE * cpe() const
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:62
const StripGeomDetUnit & specificGeomDet() const
const detset & detSet(const StMeasurementDetSet &theDets) const
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(HandleT const &handle, const_iterator ci) const
Definition: DetSetNew.h:73
StMeasurementConditionSet& TkStripMeasurementDet::conditionSet ( )
inlineprivate

Definition at line 250 of file TkStripMeasurementDet.h.

250 { return *theDetConditions; }
StMeasurementConditionSet * theDetConditions
const StMeasurementConditionSet& TkStripMeasurementDet::conditionSet ( ) const
inlineprivate

Definition at line 251 of file TkStripMeasurementDet.h.

251 { return *theDetConditions; }
StMeasurementConditionSet * theDetConditions
const StripCPE* TkStripMeasurementDet::cpe ( ) const
inlineprivate

Definition at line 253 of file TkStripMeasurementDet.h.

Referenced by hit(), recHits(), and simpleRecHits().

253 { return static_cast<const StripCPE*>(conditionSet().stripCPE()); }
StMeasurementConditionSet & conditionSet()
const StripClusterParameterEstimator * stripCPE() const
const detset& TkStripMeasurementDet::detSet ( const StMeasurementDetSet theDets) const
inline

Definition at line 102 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::detSet().

Referenced by empty(), hitRange(), recHits(), and simpleRecHits().

102 { return theDets.detSet(index()); }
const StripDetset & detSet(int i) const
bool TkStripMeasurementDet::empty ( const MeasurementTrackerEvent data) const

Definition at line 24 of file TkStripMeasurementDet.cc.

References accept(), edmNew::DetSet< T >::begin(), detSet(), StMeasurementDetSet::detSet(), edmNew::DetSet< T >::end(), StMeasurementDetSet::handle(), index(), isActive(), isEmpty(), isMasked(), edmNew::DetSet< T >::makeRefTo(), MeasurementTrackerEvent::stripClustersToSkip(), MeasurementTrackerEvent::stripData(), and UNLIKELY.

24  {
25  if UNLIKELY ((!isActive(data)) || isEmpty(data.stripData()))
26  return true;
27 
28  const detset& detSet = data.stripData().detSet(index());
29  for (auto ci = detSet.begin(); ci != detSet.end(); ++ci) {
30  if (isMasked(*ci))
31  continue;
32  SiStripClusterRef cluster = detSet.makeRefTo(data.stripData().handle(), ci);
33  if (accept(cluster, data.stripClustersToSkip()))
34  return false;
35  }
36  return true;
37 }
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
edmNew::DetSet< SiStripCluster > detset
bool accept(SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
const StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
bool isMasked(const SiStripCluster &cluster) const
for(Iditer=Id.begin();Iditer!=Id.end();Iditer++)
bool isEmpty(const StMeasurementDetSet &theDets) const
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
string end
Definition: dataset.py:937
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
#define UNLIKELY(x)
Definition: Likely.h:21
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(HandleT const &handle, const_iterator ci) const
Definition: DetSetNew.h:73
template<class ClusterRefT >
bool TkStripMeasurementDet::filteredRecHits ( const ClusterRefT &  cluster,
StripCPE::AlgoParam const &  cpepar,
const TrajectoryStateOnSurface ltp,
const MeasurementEstimator est,
const std::vector< bool > &  skipClusters,
RecHitContainer result,
std::vector< float > &  diffs 
) const
inline

Definition at line 168 of file TkStripMeasurementDet.h.

References accept(), MeasurementEstimator::estimate(), LogDebug, and MeasurementEstimator::preFilter().

Referenced by recHits(), and simpleRecHits().

174  {
175  if (isMasked(*cluster))
176  return true;
177  if (!accept(cluster, skipClusters))
178  return true;
179  if (!est.preFilter(ltp, ClusterFilterPayload(rawId(), &*cluster)))
180  return true; // avoids shadow; consistent with previous statement...
181  auto const& vl = cpe()->localParameters(*cluster, cpepar);
182  SiStripRecHit2D recHit(vl.first,
183  vl.second,
184  fastGeomDet(),
185  cluster); // FIXME add cluster count in OmniRef (and move again to multiple sub-clusters..)
186  std::pair<bool, double> diffEst = est.estimate(ltp, recHit);
187  LogDebug("TkStripMeasurementDet") << " chi2=" << diffEst.second;
188  if (diffEst.first) {
189  result.push_back(std::make_shared<SiStripRecHit2D>(recHit));
190  diffs.push_back(diffEst.second);
191  }
192  return diffEst.first;
193  }
virtual bool preFilter(const TrajectoryStateOnSurface &, OpaquePayload const &) const
bool accept(SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
bool isMasked(const SiStripCluster &cluster) const
tuple result
Definition: mps_fire.py:311
const GeomDet & fastGeomDet() const
const StripCPE * cpe() const
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:62
tuple skipClusters
unsigned int rawId() const
#define LogDebug(id)
template<class ClusterRefT >
bool TkStripMeasurementDet::filteredRecHits ( const ClusterRefT &  cluster,
StripCPE::AlgoParam const &  cpepar,
const TrajectoryStateOnSurface ltp,
const MeasurementEstimator est,
const std::vector< bool > &  skipClusters,
std::vector< SiStripRecHit2D > &  result 
) const
inline

Definition at line 196 of file TkStripMeasurementDet.h.

References accept(), MeasurementEstimator::estimate(), LogDebug, and MeasurementEstimator::preFilter().

201  {
202  if (isMasked(*cluster))
203  return true;
204  if (!accept(cluster, skipClusters))
205  return true;
206  if (!est.preFilter(ltp, ClusterFilterPayload(rawId(), &*cluster)))
207  return true; // avoids shadow; consistent with previous statement...
208  auto const& vl = cpe()->localParameters(*cluster, cpepar);
209  result.emplace_back(vl.first, vl.second, fastGeomDet(), cluster); // FIXME add cluster count in OmniRef
210  std::pair<bool, double> diffEst = est.estimate(ltp, result.back());
211  LogDebug("TkStripMeasurementDet") << " chi2=" << diffEst.second;
212  if (!diffEst.first)
213  result.pop_back();
214  return diffEst.first;
215  }
virtual bool preFilter(const TrajectoryStateOnSurface &, OpaquePayload const &) const
bool accept(SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
bool isMasked(const SiStripCluster &cluster) const
tuple result
Definition: mps_fire.py:311
const GeomDet & fastGeomDet() const
const StripCPE * cpe() const
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:62
tuple skipClusters
unsigned int rawId() const
#define LogDebug(id)
std::vector<BadStripBlock>& TkStripMeasurementDet::getBadStripBlocks ( )
inline

Definition at line 239 of file TkStripMeasurementDet.h.

239 { return conditionSet().getBadStripBlocks(index()); }
StMeasurementConditionSet & conditionSet()
std::vector< BadStripBlock > & getBadStripBlocks(int i)
bool TkStripMeasurementDet::hasAllGoodChannels ( ) const
inline

does this module have at least one bad strip, APV or channel?

Definition at line 227 of file TkStripMeasurementDet.h.

Referenced by TkGluedMeasurementDet::measurements().

227 { return (!hasAny128StripBad()) && badStripBlocks().empty(); }
std::vector< BadStripBlock > const & badStripBlocks() const
bool TkStripMeasurementDet::hasAny128StripBad ( ) const
inlineprivate

Definition at line 259 of file TkStripMeasurementDet.h.

259 { return conditionSet().hasAny128StripBad(index()); }
StMeasurementConditionSet & conditionSet()
bool hasAny128StripBad(int i) const
bool TkStripMeasurementDet::hasBadComponents ( const TrajectoryStateOnSurface tsos,
const MeasurementTrackerEvent data 
) const
inlineoverridevirtual

Implements MeasurementDet.

Definition at line 108 of file TkStripMeasurementDet.h.

108  {
109  return false;
110  }
SiStripRecHit2D TkStripMeasurementDet::hit ( TkStripRecHitIter const &  hi) const

Definition at line 263 of file TkStripMeasurementDet.cc.

References TkStripRecHitIter::clusterI, cpe(), TkStripRecHitIter::data, data, StripCPE::localParameters(), edmNew::makeRefTo(), specificGeomDet(), and TkStripRecHitIter::tsos.

Referenced by TkStripRecHitIter::buildHit(), recHits(), and simpleRecHits().

263  {
264  const GeomDetUnit& gdu(specificGeomDet());
265  auto ci = hi.clusterI;
266  auto const& data = *hi.data;
267  auto const& ltp = *hi.tsos;
268 
269  SiStripClusterRef cluster = edmNew::makeRefTo(data.stripData().handle(), ci);
270  LocalValues lv = cpe()->localParameters(*cluster, gdu, ltp);
271  return SiStripRecHit2D(lv.first, lv.second, gdu, cluster);
272 }
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)
StripClusterParameterEstimator::LocalValues LocalValues
const StripCPE * cpe() const
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:62
const StripGeomDetUnit & specificGeomDet() const
SiStripRecHit2D::ClusterRef SiStripClusterRef
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::tuple< TkStripRecHitIter, TkStripRecHitIter > TkStripMeasurementDet::hitRange ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent data 
) const

Definition at line 241 of file TkStripMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), data, detSet(), StMeasurementDetSet::detSet(), edmNew::DetSet< T >::end(), index(), isActive(), isEmpty(), and MeasurementTrackerEvent::stripData().

242  {
243  if (isEmpty(data.stripData()) || !isActive(data))
244  return std::tuple<TkStripRecHitIter, TkStripRecHitIter>();
245  const detset& detSet = data.stripData().detSet(index());
246  return std::make_tuple(TkStripRecHitIter(detSet.begin(), detSet.end(), *this, ts, data),
247  TkStripRecHitIter(detSet.end(), detSet.end(), *this, ts, data));
248 }
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const StripDetset & detSet(int i) const
edmNew::DetSet< SiStripCluster > detset
const StMeasurementDetSet & stripData() const
bool isEmpty(const StMeasurementDetSet &theDets) const
const detset & detSet(const StMeasurementDetSet &theDets) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int TkStripMeasurementDet::index ( ) const
inline
bool TkStripMeasurementDet::isActive ( const MeasurementTrackerEvent data) const
inlineoverridevirtual

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

Implements MeasurementDet.

Definition at line 105 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::isActive(), and MeasurementTrackerEvent::stripData().

Referenced by empty(), hitRange(), TkGluedMeasurementDet::measurements(), measurements(), TkGluedMeasurementDet::recHits(), recHits(), and simpleRecHits().

105 { return data.stripData().isActive(index()); }
const StMeasurementDetSet & stripData() const
bool isActive(int i) const
bool TkStripMeasurementDet::isEmpty ( const StMeasurementDetSet theDets) const
inline

Definition at line 94 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::empty().

Referenced by plotting.Plot::clone(), empty(), hitRange(), measurements(), recHits(), and simpleRecHits().

94 { return theDets.empty(index()); }
bool empty(int i) const
bool TkStripMeasurementDet::isMasked ( const SiStripCluster cluster) const
inlineprivate

Definition at line 261 of file TkStripMeasurementDet.h.

Referenced by advance(), empty(), recHits(), and simpleRecHits().

261 { return conditionSet().isMasked(index(), cluster); }
bool isMasked(int i, const SiStripCluster &cluster) const
StMeasurementConditionSet & conditionSet()
bool TkStripMeasurementDet::maskBad128StripBlocks ( ) const
inline

Definition at line 242 of file TkStripMeasurementDet.h.

242 { return conditionSet().maskBad128StripBlocks(); }
StMeasurementConditionSet & conditionSet()
bool TkStripMeasurementDet::measurements ( const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
const MeasurementTrackerEvent data,
TempMeasurements result 
) const
overridevirtual

Implements MeasurementDet.

Definition at line 178 of file TkStripMeasurementDet.cc.

References tracking::TempMeasurements::add(), tracking::TempMeasurements::distances, F(), TrajectoryStateOnSurface::hasError(), tracking::TempMeasurements::hits, isActive(), isEmpty(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LogDebug, Topology::measurementPosition(), LocalTrajectoryError::positionError(), rawId(), HI_PhotonSkim_cff::rechits, recHits(), specificGeomDet(), StripGeomDetUnit::specificTopology(), mathSSE::sqrt(), MeasurementTrackerEvent::stripData(), testStrips(), MeasurementDet::theInactiveHit, MeasurementDet::theMissingHit, and x.

181  {
182  if (!isActive(data)) {
183  LogDebug("TkStripMeasurementDet") << " found an inactive module " << rawId();
184  result.add(theInactiveHit, 0.F);
185  return true;
186  }
187 
188  if (!isEmpty(data.stripData())) {
189  LogDebug("TkStripMeasurementDet") << " found hit on this module " << rawId();
191  std::vector<float> diffs;
192  if (recHits(stateOnThisDet, est, data, result.hits, result.distances))
193  return true;
194  }
195 
196  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
197 
198  if (!stateOnThisDet.hasError()) {
199  result.add(theMissingHit, 0.F);
200  return false;
201  }
202 
203  float utraj = specificGeomDet().specificTopology().measurementPosition(stateOnThisDet.localPosition()).x();
204  float uerr = sqrt(specificGeomDet()
205  .specificTopology()
206  .measurementError(stateOnThisDet.localPosition(), stateOnThisDet.localError().positionError())
207  .uu());
208  if (testStrips(utraj, uerr)) {
209  //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, but active ";
210  result.add(theMissingHit, 0.F);
211  return false;
212  }
213 
214  //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, and inactive ";
215  result.add(theInactiveHit, 0.F);
216  return true;
217 }
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
const StMeasurementDetSet & stripData() const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
LocalError positionError() const
tuple result
Definition: mps_fire.py:311
TrackingRecHit::ConstRecHitPointer theMissingHit
T sqrt(T t)
Definition: SSEVec.h:19
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const LocalTrajectoryError & localError() const
TrackingRecHit::ConstRecHitPointer theInactiveHit
const StripGeomDetUnit & specificGeomDet() const
bool isEmpty(const StMeasurementDetSet &theDets) const
TrackingRecHit::ConstRecHitContainer RecHitContainer
bool testStrips(float utraj, float uerr) const
return true if there are &#39;enough&#39; good strips in the utraj +/- 3 uerr range.
unsigned int rawId() const
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
#define LogDebug(id)
unsigned int TkStripMeasurementDet::rawId ( ) const
inline

Definition at line 98 of file TkStripMeasurementDet.h.

Referenced by measurements(), recHits(), and simpleRecHits().

98 { return conditionSet().id(index()); }
unsigned int id(int i) const
StMeasurementConditionSet & conditionSet()
TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::recHits ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent data 
) const
overridevirtual

Implements MeasurementDet.

Definition at line 39 of file TkStripMeasurementDet.cc.

References accept(), edmNew::DetSet< T >::begin(), buildRecHit(), detSet(), StMeasurementDetSet::detSet(), edmNew::DetSet< T >::end(), StMeasurementDetSet::handle(), index(), isActive(), isEmpty(), isMasked(), edm::Ref< C, T, F >::key(), LogDebug, edmNew::DetSet< T >::makeRefTo(), rawId(), mps_fire::result, edmNew::DetSet< T >::size(), MeasurementTrackerEvent::stripClustersToSkip(), MeasurementTrackerEvent::stripData(), and UNLIKELY.

Referenced by TkGluedMeasurementDet::collectRecHits(), and measurements().

40  {
42  if UNLIKELY ((!isActive(data)) || isEmpty(data.stripData()))
43  return result;
44  const detset& detSet = data.stripData().detSet(index());
45  result.reserve(detSet.size());
46  for (new_const_iterator ci = detSet.begin(); ci != detSet.end(); ++ci) {
47  if (isMasked(*ci))
48  continue;
49  // for ( ClusterIterator ci=theClusterRange.first; ci != theClusterRange.second; ci++) {
50  SiStripClusterRef cluster = detSet.makeRefTo(data.stripData().handle(), ci);
51  if (accept(cluster, data.stripClustersToSkip()))
52  result.push_back(buildRecHit(cluster, ts));
53  else
54  LogDebug("TkStripMeasurementDet") << "skipping this str from last iteration on" << rawId()
55  << " key: " << cluster.key();
56  }
57  return result;
58 }
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
edmNew::DetSet< SiStripCluster > detset
bool accept(SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
const StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
bool isMasked(const SiStripCluster &cluster) const
tuple result
Definition: mps_fire.py:311
for(Iditer=Id.begin();Iditer!=Id.end();Iditer++)
TrackingRecHit::RecHitPointer buildRecHit(const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp) const
bool isEmpty(const StMeasurementDetSet &theDets) const
TrackingRecHit::ConstRecHitContainer RecHitContainer
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
detset::const_iterator new_const_iterator
string end
Definition: dataset.py:937
unsigned int rawId() const
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
#define UNLIKELY(x)
Definition: Likely.h:21
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(HandleT const &handle, const_iterator ci) const
Definition: DetSetNew.h:73
tuple size
Write out results.
#define LogDebug(id)
bool TkStripMeasurementDet::recHits ( SimpleHitContainer result,
const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
const MeasurementTrackerEvent data 
) const
overridevirtual

Reimplemented from MeasurementDet.

Definition at line 61 of file TkStripMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), cpe(), detSet(), StMeasurementDetSet::detSet(), edmNew::DetSet< T >::end(), filteredRecHits(), StripCPE::getAlgoParam(), h, StMeasurementDetSet::handle(), hit(), index(), isActive(), isEmpty(), TrajectoryStateOnSurface::localParameters(), TrajectoryStateOnSurface::localPosition(), edmNew::DetSet< T >::makeRefTo(), Topology::measurementPosition(), specificGeomDet(), StripGeomDetUnit::specificTopology(), MeasurementTrackerEvent::stripClustersToSkip(), MeasurementTrackerEvent::stripData(), createJobs::tmp, UNLIKELY, and x.

64  {
65  if UNLIKELY ((!isActive(data)) || isEmpty(data.stripData()))
66  return false;
67  auto oldSize = result.size();
68 
69  int utraj = specificGeomDet().specificTopology().measurementPosition(stateOnThisDet.localPosition()).x();
70  const detset& detSet = data.stripData().detSet(index());
71  auto const& cpepar = cpe()->getAlgoParam(specificGeomDet(), stateOnThisDet.localParameters());
72 
73  auto rightCluster = std::find_if(
74  detSet.begin(), detSet.end(), [utraj](const SiStripCluster& hit) { return hit.firstStrip() > utraj; });
75 
76  std::vector<SiStripRecHit2D> tmp;
77  if (rightCluster != detSet.begin()) {
78  // there are hits on the left of the utraj
79  auto leftCluster = rightCluster;
80  while (--leftCluster >= detSet.begin()) {
81  SiStripClusterRef clusterref = detSet.makeRefTo(data.stripData().handle(), leftCluster);
82  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), tmp);
83  if (!isCompatible)
84  break; // exit loop on first incompatible hit
85  for (auto&& h : tmp)
86  result.push_back(new SiStripRecHit2D(h));
87  tmp.clear();
88  }
89  }
90  for (; rightCluster != detSet.end(); rightCluster++) {
91  SiStripClusterRef clusterref = detSet.makeRefTo(data.stripData().handle(), rightCluster);
92  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), tmp);
93  if (!isCompatible)
94  break; // exit loop on first incompatible hit
95  for (auto&& h : tmp)
96  result.push_back(new SiStripRecHit2D(h));
97  tmp.clear();
98  }
99 
100  return result.size() > oldSize;
101 }
bool filteredRecHits(const ClusterRefT &cluster, StripCPE::AlgoParam const &cpepar, const TrajectoryStateOnSurface &ltp, const MeasurementEstimator &est, const std::vector< bool > &skipClusters, RecHitContainer &result, std::vector< float > &diffs) const
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
edmNew::DetSet< SiStripCluster > detset
const StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
tuple result
Definition: mps_fire.py:311
const StripCPE * cpe() const
const StripGeomDetUnit & specificGeomDet() const
bool isEmpty(const StMeasurementDetSet &theDets) const
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
iterator end()
Definition: DetSetNew.h:56
string end
Definition: dataset.py:937
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
#define UNLIKELY(x)
Definition: Likely.h:21
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(HandleT const &handle, const_iterator ci) const
Definition: DetSetNew.h:73
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
tmp
align.sh
Definition: createJobs.py:716
tuple size
Write out results.
iterator begin()
Definition: DetSetNew.h:54
bool TkStripMeasurementDet::recHits ( const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
const MeasurementTrackerEvent data,
RecHitContainer result,
std::vector< float > &  diffs 
) const
overridevirtual

Reimplemented from MeasurementDet.

Definition at line 139 of file TkStripMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), cpe(), detSet(), StMeasurementDetSet::detSet(), edmNew::DetSet< T >::end(), filteredRecHits(), StripCPE::getAlgoParam(), StMeasurementDetSet::handle(), hit(), index(), isActive(), isEmpty(), TrajectoryStateOnSurface::localParameters(), TrajectoryStateOnSurface::localPosition(), edmNew::DetSet< T >::makeRefTo(), Topology::measurementPosition(), mps_fire::result, specificGeomDet(), StripGeomDetUnit::specificTopology(), MeasurementTrackerEvent::stripClustersToSkip(), MeasurementTrackerEvent::stripData(), UNLIKELY, and x.

143  {
144  if UNLIKELY ((!isActive(data)) || isEmpty(data.stripData()))
145  return false;
146 
147  auto oldSize = result.size();
148  auto const& cpepar = cpe()->getAlgoParam(specificGeomDet(), stateOnThisDet.localParameters());
149 
150  int utraj = specificGeomDet().specificTopology().measurementPosition(stateOnThisDet.localPosition()).x();
151 
152  const detset& detSet = data.stripData().detSet(index());
153  auto rightCluster = std::find_if(
154  detSet.begin(), detSet.end(), [utraj](const SiStripCluster& hit) { return hit.firstStrip() > utraj; });
155 
156  if (rightCluster != detSet.begin()) {
157  // there are hits on the left of the utraj
158  auto leftCluster = rightCluster;
159  while (--leftCluster >= detSet.begin()) {
160  SiStripClusterRef clusterref = detSet.makeRefTo(data.stripData().handle(), leftCluster);
161  bool isCompatible =
162  filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result, diffs);
163  if (!isCompatible)
164  break; // exit loop on first incompatible hit
165  }
166  }
167  for (; rightCluster != detSet.end(); rightCluster++) {
168  SiStripClusterRef clusterref = detSet.makeRefTo(data.stripData().handle(), rightCluster);
169  bool isCompatible =
170  filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result, diffs);
171  if (!isCompatible)
172  break; // exit loop on first incompatible hit
173  }
174 
175  return result.size() > oldSize;
176 }
bool filteredRecHits(const ClusterRefT &cluster, StripCPE::AlgoParam const &cpepar, const TrajectoryStateOnSurface &ltp, const MeasurementEstimator &est, const std::vector< bool > &skipClusters, RecHitContainer &result, std::vector< float > &diffs) const
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
edmNew::DetSet< SiStripCluster > detset
const StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
tuple result
Definition: mps_fire.py:311
const StripCPE * cpe() const
const StripGeomDetUnit & specificGeomDet() const
bool isEmpty(const StMeasurementDetSet &theDets) const
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
iterator end()
Definition: DetSetNew.h:56
string end
Definition: dataset.py:937
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
#define UNLIKELY(x)
Definition: Likely.h:21
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(HandleT const &handle, const_iterator ci) const
Definition: DetSetNew.h:73
tuple size
Write out results.
iterator begin()
Definition: DetSetNew.h:54
void TkStripMeasurementDet::set128StripStatus ( bool  good,
int  idx = -1 
)
inline

Sets the status of a block of 128 strips (or all blocks if idx=-1)

Definition at line 230 of file TkStripMeasurementDet.h.

StMeasurementConditionSet & conditionSet()
auto const good
min quality of good
void set128StripStatus(int i, bool good, int idx=-1)
void TkStripMeasurementDet::setActiveThisEvent ( StMeasurementDetSet theDets,
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 222 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::setActiveThisEvent().

222  {
223  theDets.setActiveThisEvent(index(), active);
224  }
void setActiveThisEvent(int i, bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
void TkStripMeasurementDet::setActiveThisPeriod ( StMeasurementDetSet theDets,
bool  active 
)
inline

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

Definition at line 218 of file TkStripMeasurementDet.h.

218 { conditionSet().setActive(index(), active); }
StMeasurementConditionSet & 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 TkStripMeasurementDet::setEmpty ( StMeasurementDetSet theDets) const
inline

Definition at line 92 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::setEmpty().

92 { theDets.setEmpty(index()); }
void TkStripMeasurementDet::setIndex ( int  i)
inline

Definition at line 90 of file TkStripMeasurementDet.h.

References mps_fire::i.

void TkStripMeasurementDet::simpleRecHits ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent data,
std::vector< SiStripRecHit2D > &  result 
) const

Definition at line 219 of file TkStripMeasurementDet.cc.

References accept(), cms::cuda::assert(), buildSimpleRecHits(), HLT_FULL_cff::clusters, detSet(), StMeasurementDetSet::detSet(), index(), isActive(), isEmpty(), isMasked(), LogDebug, rawId(), edmNew::DetSet< T >::size(), MeasurementTrackerEvent::stripClustersToSkip(), MeasurementTrackerEvent::stripData(), and unInitDynArray.

Referenced by TkGluedMeasurementDet::collectRecHits().

221  {
222  if (isEmpty(data.stripData()) || !isActive(data))
223  return;
224 
225  const detset& detSet = data.stripData().detSet(index());
227  assert(clusters.empty());
228  for (auto const& ci : detSet) {
229  if (isMasked(ci))
230  continue;
231  if (accept(detSet.makeKeyOf(&ci), data.stripClustersToSkip()))
232  clusters.push_back(&ci);
233  else
234  LogDebug("TkStripMeasurementDet") << "skipping this str from last iteration on" << rawId()
235  << " key: " << detSet.makeKeyOf(&ci);
236  }
237  if (!clusters.empty())
238  buildSimpleRecHits(clusters, data, detSet, ts, result);
239 }
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const StripDetset & detSet(int i) const
edmNew::DetSet< SiStripCluster > detset
bool accept(SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
const StMeasurementDetSet & stripData() const
assert(be >=bs)
const std::vector< bool > & stripClustersToSkip() const
bool isMasked(const SiStripCluster &cluster) const
tuple result
Definition: mps_fire.py:311
#define unInitDynArray(T, n, x)
Definition: DynArray.h:88
T value_type
Definition: DynArray.h:12
bool isEmpty(const StMeasurementDetSet &theDets) const
const detset & detSet(const StMeasurementDetSet &theDets) const
unsigned int rawId() const
void buildSimpleRecHits(AClusters const &clusters, const MeasurementTrackerEvent &data, const detset &detSet, const TrajectoryStateOnSurface &ltp, std::vector< SiStripRecHit2D > &res) const
#define LogDebug(id)
bool TkStripMeasurementDet::simpleRecHits ( const TrajectoryStateOnSurface ts,
const MeasurementEstimator est,
const MeasurementTrackerEvent data,
std::vector< SiStripRecHit2D > &  result 
) const

Definition at line 103 of file TkStripMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), cpe(), detSet(), StMeasurementDetSet::detSet(), edmNew::DetSet< T >::end(), filteredRecHits(), StripCPE::getAlgoParam(), StMeasurementDetSet::handle(), hit(), index(), isActive(), isEmpty(), TrajectoryStateOnSurface::localParameters(), TrajectoryStateOnSurface::localPosition(), edmNew::DetSet< T >::makeRefTo(), Topology::measurementPosition(), mps_fire::result, specificGeomDet(), StripGeomDetUnit::specificTopology(), MeasurementTrackerEvent::stripClustersToSkip(), MeasurementTrackerEvent::stripData(), UNLIKELY, and x.

106  {
107  if UNLIKELY ((!isActive(data)) || isEmpty(data.stripData()))
108  return false;
109 
110  auto oldSize = result.size();
111 
112  int utraj = specificGeomDet().specificTopology().measurementPosition(stateOnThisDet.localPosition()).x();
113  const detset& detSet = data.stripData().detSet(index());
114  auto const& cpepar = cpe()->getAlgoParam(specificGeomDet(), stateOnThisDet.localParameters());
115 
116  auto rightCluster = std::find_if(
117  detSet.begin(), detSet.end(), [utraj](const SiStripCluster& hit) { return hit.firstStrip() > utraj; });
118 
119  if (rightCluster != detSet.begin()) {
120  // there are hits on the left of the utraj
121  auto leftCluster = rightCluster;
122  while (--leftCluster >= detSet.begin()) {
123  SiStripClusterRef clusterref = detSet.makeRefTo(data.stripData().handle(), leftCluster);
124  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result);
125  if (!isCompatible)
126  break; // exit loop on first incompatible hit
127  }
128  }
129  for (; rightCluster != detSet.end(); rightCluster++) {
130  SiStripClusterRef clusterref = detSet.makeRefTo(data.stripData().handle(), rightCluster);
131  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result);
132  if (!isCompatible)
133  break; // exit loop on first incompatible hit
134  }
135 
136  return result.size() > oldSize;
137 }
bool filteredRecHits(const ClusterRefT &cluster, StripCPE::AlgoParam const &cpepar, const TrajectoryStateOnSurface &ltp, const MeasurementEstimator &est, const std::vector< bool > &skipClusters, RecHitContainer &result, std::vector< float > &diffs) const
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
edmNew::DetSet< SiStripCluster > detset
const StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
tuple result
Definition: mps_fire.py:311
const StripCPE * cpe() const
const StripGeomDetUnit & specificGeomDet() const
bool isEmpty(const StMeasurementDetSet &theDets) const
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
iterator end()
Definition: DetSetNew.h:56
string end
Definition: dataset.py:937
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
#define UNLIKELY(x)
Definition: Likely.h:21
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(HandleT const &handle, const_iterator ci) const
Definition: DetSetNew.h:73
tuple size
Write out results.
iterator begin()
Definition: DetSetNew.h:54
const StripGeomDetUnit& TkStripMeasurementDet::specificGeomDet ( ) const
inline
unsigned char TkStripMeasurementDet::subId ( ) const
inline

Definition at line 99 of file TkStripMeasurementDet.h.

99 { return conditionSet().subId(index()); }
StMeasurementConditionSet & conditionSet()
unsigned char subId(int i) const
bool TkStripMeasurementDet::testStrips ( float  utraj,
float  uerr 
) const

return true if there are 'enough' good strips in the utraj +/- 3 uerr range.

Definition at line 274 of file TkStripMeasurementDet.cc.

References badStripBlocks(), badStripCuts(), dataset::end, validate-o2o-wbm::f, SiStripPI::max, StMeasurementConditionSet::BadStripCuts::maxBad, StMeasurementConditionSet::BadStripCuts::maxConsecutiveBad, min(), convertSQLiteXML::ok, command_line::start, and totalStrips().

Referenced by measurements(), and TkGluedMeasurementDet::testStrips().

274  {
275  int16_t start = (int16_t)std::max<float>(utraj - 3.f * uerr, 0);
276  int16_t end = (int16_t)std::min<float>(utraj + 3.f * uerr, totalStrips());
277 
278  if (start >= end) { // which means either end <=0 or start >= totalStrips_
279  /* LogDebug("TkStripMeasurementDet") << "Testing module " << id_ <<","<<
280  " U = " << utraj << " +/- " << uerr <<
281  "; Range [" << (utraj - 3*uerr) << ", " << (utraj + 3*uerr) << "] " <<
282  ": YOU'RE COMPLETELY OFF THE MODULE."; */
283  //return false;
284  return true; // Wolfgang thinks this way is better
285  // and solves some problems with grouped ckf
286  }
287 
288  typedef std::vector<BadStripBlock>::const_iterator BSBIT;
289 
290  int16_t bad = 0, largestBadBlock = 0;
291  for (BSBIT bsbc = badStripBlocks().begin(), bsbe = badStripBlocks().end(); bsbc != bsbe; ++bsbc) {
292  if (bsbc->last < start)
293  continue;
294  if (bsbc->first > end)
295  break;
296  int16_t thisBad = std::min(bsbc->last, end) - std::max(bsbc->first, start);
297  if (thisBad > largestBadBlock)
298  largestBadBlock = thisBad;
299  bad += thisBad;
300  }
301 
302  bool ok = (bad < (end - start)) && (uint16_t(bad) <= badStripCuts().maxBad) &&
303  (uint16_t(largestBadBlock) <= badStripCuts().maxConsecutiveBad);
304 
305  // if (bad) {
306  // edm::LogWarning("TkStripMeasurementDet") << "Testing module " << id_ <<" (subdet: "<< SiStripDetId(id_).subdetId() << ")" <<
307  // " U = " << utraj << " +/- " << uerr <<
308  // "; Range [" << (utraj - 3*uerr) << ", " << (utraj + 3*uerr) << "] " <<
309  // "= [" << start << "," << end << "]" <<
310  // " total strips:" << (end-start) << ", good:" << (end-start-bad) << ", bad:" << bad << ", largestBadBlock: " << largestBadBlock <<
311  // ". " << (ok ? "OK" : "NO");
312  // }
313  return ok;
314 }
BadStripCuts const & badStripCuts() const
std::vector< BadStripBlock > const & badStripBlocks() const
T min(T a, T b)
Definition: MathUtil.h:58
string end
Definition: dataset.py:937
const detset& TkStripMeasurementDet::theSet ( const StMeasurementDetSet theDets) const
inline

Definition at line 101 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::detSet().

101 { return theDets.detSet(index()); }
const StripDetset & detSet(int i) const
int TkStripMeasurementDet::totalStrips ( ) const
inlineprivate

Definition at line 256 of file TkStripMeasurementDet.h.

Referenced by testStrips().

256 { return conditionSet().totalStrips(index()); }
StMeasurementConditionSet & conditionSet()

Member Data Documentation

int TkStripMeasurementDet::index_
private

Definition at line 248 of file TkStripMeasurementDet.h.

StMeasurementConditionSet* TkStripMeasurementDet::theDetConditions
private

Definition at line 249 of file TkStripMeasurementDet.h.