CMS 3D CMS Logo

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< SiStripClusterdetset
 
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, TkStripRecHitIterhitRange (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< TrajectoryMeasurementfastMeasurements (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 86 of file TkStripMeasurementDet.h.

Member Typedef Documentation

Definition at line 239 of file TkStripMeasurementDet.h.

Definition at line 240 of file TkStripMeasurementDet.h.

Definition at line 231 of file TkStripMeasurementDet.h.

Definition at line 226 of file TkStripMeasurementDet.h.

Definition at line 97 of file TkStripMeasurementDet.h.

Definition at line 94 of file TkStripMeasurementDet.h.

Definition at line 89 of file TkStripMeasurementDet.h.

Definition at line 95 of file TkStripMeasurementDet.h.

Definition at line 92 of file TkStripMeasurementDet.h.

Definition at line 90 of file TkStripMeasurementDet.h.

Constructor & Destructor Documentation

TkStripMeasurementDet::~TkStripMeasurementDet ( )
inlineoverride

Definition at line 99 of file TkStripMeasurementDet.h.

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

Definition at line 16 of file TkStripMeasurementDet.cc.

16  :
17  MeasurementDet (gdet), index_(-1), theDetConditions(&conditions)
18  {
19  if (dynamic_cast<const StripGeomDetUnit*>(gdet) == nullptr) {
20  throw MeasurementDetException( "TkStripMeasurementDet constructed with a GeomDet which is not a StripGeomDetUnit");
21  }
22  }
MeasurementDet(const GeomDet *gdet)
StMeasurementConditionSet * theDetConditions

Member Function Documentation

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

Definition at line 286 of file TkStripMeasurementDet.h.

References LogDebug.

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

286  {
287  if(skipClusters.empty()) return true;
288  if (key>=skipClusters.size()){
289  LogDebug("TkStripMeasurementDet")<<key<<" is larger than: "<<skipClusters.size()
290  <<"\n This must be a new cluster, and therefore should not be skiped most likely.";
291  return true;
292  }
293  return (not (skipClusters[key]));
294  }
#define LogDebug(id)
void TkStripMeasurementDet::advance ( TkStripRecHitIter hi) const

Definition at line 242 of file TkStripMeasurementDet.cc.

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

242  {
243  while (!hi.empty()) {
244  auto ci = hi.clusterI;
245  auto const & data = *hi.data;
246  if (isMasked(*ci)) continue;
247  SiStripClusterRef cluster = edmNew::makeRefTo( data.stripData().handle(), ci );
248  if (accept(cluster, data.stripClustersToSkip())) return;
249  ++hi.clusterI;
250  }
251 }
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:82
std::vector<BadStripBlock> const& TkStripMeasurementDet::badStripBlocks ( ) const
inline

Definition at line 234 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::badStripBlocks().

Referenced by testStrips().

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

Definition at line 252 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::badStripCuts().

Referenced by testStrips().

252 { 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 156 of file TkStripMeasurementDet.h.

References MeasurementDet::fastGeomDet().

Referenced by recHits().

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

Definition at line 165 of file TkStripMeasurementDet.h.

165  {
166  RecHitContainer res = _res;
167  const GeomDetUnit& gdu( specificGeomDet());
168  VLocalValues vlv = cpe()->localParametersV( *cluster, gdu, ltp);
169  for(VLocalValues::const_iterator it=vlv.begin();it!=vlv.end();++it)
170  res.push_back(std::make_shared<SiStripRecHit2D>( it->first, it->second, fastGeomDet(), cluster));
171  }
virtual VLocalValues localParametersV(const SiStripCluster &cluster, const GeomDetUnit &gd) const
StripClusterParameterEstimator::VLocalValues VLocalValues
Definition: Electron.h:6
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 262 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().

265  {
266  const GeomDetUnit& gdu( specificGeomDet());
268  cpe()->localParameters(clusters, alv, gdu, ltp.localParameters());
269  res.reserve(alv.size());
270  for (unsigned int i=0; i< clusters.size(); ++i)
271  res.emplace_back( alv[i].first, alv[i].second, gdu, detSet.makeRefTo( data.stripData().handle(), clusters[i]) );
272 
273  }
const LocalTrajectoryParameters & localParameters() const
StripClusterParameterEstimator::LocalValues LocalValues
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:65
const StMeasurementDetSet & stripData() const
Definition: Electron.h:6
const StripCPE * cpe() const
const StripGeomDetUnit & specificGeomDet() const
const detset & detSet(const StMeasurementDetSet &theDets) const
#define declareDynArray(T, n, x)
Definition: DynArray.h:59
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:95
StMeasurementConditionSet& TkStripMeasurementDet::conditionSet ( )
inlineprivate

Definition at line 245 of file TkStripMeasurementDet.h.

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

Definition at line 246 of file TkStripMeasurementDet.h.

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

Definition at line 248 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::stripCPE().

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

248 { 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 116 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::detSet().

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

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

Definition at line 26 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.

26  {
27  if unlikely( (!isActive(data)) || isEmpty(data.stripData())) return true;
28 
29  const detset & detSet = data.stripData().detSet(index());
30  for ( auto ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
31  if (isMasked(*ci)) continue;
32  SiStripClusterRef cluster = detSet.makeRefTo( data.stripData().handle(), ci);
33  if (accept(cluster, data.stripClustersToSkip()))
34  return false;
35  }
36  return true;
37 }
edmNew::DetSet< SiStripCluster > detset
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
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
#define unlikely(x)
#define end
Definition: vmac.h:39
bool isEmpty(const StMeasurementDetSet &theDets) const
return(e1-e2)*(e1-e2)+dp *dp
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
#define begin
Definition: vmac.h:32
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:95
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 175 of file TkStripMeasurementDet.h.

References accept(), MeasurementEstimator::estimate(), LogDebug, eostools::move(), MeasurementEstimator::preFilter(), and rpcPointValidation_cfi::recHit.

Referenced by recHits(), and simpleRecHits().

177  {
178  if (isMasked(*cluster)) return true;
179  if (!accept(cluster, skipClusters)) return true;
180  if (!est.preFilter(ltp, ClusterFilterPayload(rawId(),&*cluster) )) return true; // avoids shadow; consistent with previous statement...
181  auto const & vl = cpe()->localParameters( *cluster, cpepar);
182  SiStripRecHit2D recHit(vl.first, vl.second, fastGeomDet(), cluster); // FIXME add cluster count in OmniRef (and move again to multiple sub-clusters..)
183  std::pair<bool,double> diffEst = est.estimate(ltp, recHit);
184  LogDebug("TkStripMeasurementDet")<<" chi2=" << diffEst.second;
185  if ( diffEst.first ) {
186  result.push_back(std::move(std::make_shared<SiStripRecHit2D>(recHit)));
187  diffs.push_back(diffEst.second);
188  }
189  return diffEst.first;
190  }
#define LogDebug(id)
virtual bool preFilter(const TrajectoryStateOnSurface &, OpaquePayload const &) const
bool accept(SiStripClusterRef const &r, const std::vector< bool > &skipClusters) const
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:65
bool isMasked(const SiStripCluster &cluster) const
const GeomDet & fastGeomDet() const
const StripCPE * cpe() const
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
unsigned int rawId() const
def move(src, dest)
Definition: eostools.py:510
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 194 of file TkStripMeasurementDet.h.

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

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

Definition at line 233 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::getBadStripBlocks().

233 { 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 219 of file TkStripMeasurementDet.h.

Referenced by TkGluedMeasurementDet::measurements().

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

Definition at line 254 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::hasAny128StripBad().

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

Definition at line 253 of file TkStripMeasurementDet.cc.

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

Referenced by recHits(), and simpleRecHits().

253  {
254  const GeomDetUnit& gdu( specificGeomDet());
255  auto ci = hi.clusterI;
256  auto const & data = *hi.data;
257  auto const & ltp = *hi.tsos;
258 
259  SiStripClusterRef cluster = edmNew::makeRefTo( data.stripData().handle(), ci );
260  LocalValues lv = cpe()->localParameters( *cluster, gdu, ltp);
261  return SiStripRecHit2D(lv.first,lv.second, gdu, cluster);
262 }
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
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:65
const StripCPE * cpe() const
const StripGeomDetUnit & specificGeomDet() const
SiStripRecHit2D::ClusterRef SiStripClusterRef
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::tuple< TkStripRecHitIter, TkStripRecHitIter > TkStripMeasurementDet::hitRange ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent data 
) const

Definition at line 233 of file TkStripMeasurementDet.cc.

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

234 {
235  if (isEmpty(data.stripData()) || !isActive(data)) return std::tuple<TkStripRecHitIter,TkStripRecHitIter>();
236  const detset & detSet = data.stripData().detSet(index());
237  return std::make_tuple(TkStripRecHitIter(detSet.begin(),detSet.end(),*this,ts,data),
238  TkStripRecHitIter(detSet.end(),detSet.end(),*this,ts,data)
239  );
240 }
const StripDetset & detSet(int i) const
edmNew::DetSet< SiStripCluster > detset
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 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:82
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 120 of file TkStripMeasurementDet.h.

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

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

120 { 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 107 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::empty().

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

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

Definition at line 257 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::isMasked().

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

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

Definition at line 236 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::maskBad128StripBlocks().

236 { 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 167 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(), TrackInfoProducer_cfi::rechits, recHits(), specificGeomDet(), StripGeomDetUnit::specificTopology(), mathSSE::sqrt(), MeasurementTrackerEvent::stripData(), testStrips(), MeasurementDet::theInactiveHit, MeasurementDet::theMissingHit, and x.

169  {
170 
171  if (!isActive(data)) {
172  LogDebug("TkStripMeasurementDet")<<" found an inactive module "<<rawId();
173  result.add(theInactiveHit, 0.F);
174  return true;
175  }
176 
177  if (!isEmpty(data.stripData())){
178  LogDebug("TkStripMeasurementDet")<<" found hit on this module "<<rawId();
180  std::vector<float> diffs;
181  if (recHits(stateOnThisDet,est,data,result.hits,result.distances)) return true;
182  }
183 
184 
185  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
186 
187  if (!stateOnThisDet.hasError()) {
188  result.add(theMissingHit, 0.F);
189  return false;
190  }
191 
192  float utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
193  float uerr= sqrt(specificGeomDet().specificTopology().measurementError(stateOnThisDet.localPosition(),stateOnThisDet.localError().positionError()).uu());
194  if (testStrips(utraj,uerr)) {
195  //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, but active ";
196  result.add(theMissingHit, 0.F);
197  return false;
198  }
199 
200  //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, and inactive ";
201  result.add(theInactiveHit, 0.F);
202  return true;
203 
204 }
#define LogDebug(id)
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 StMeasurementDetSet & stripData() const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
LocalError positionError() const
TrackingRecHit::ConstRecHitPointer theMissingHit
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
T sqrt(T t)
Definition: SSEVec.h:18
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:281
unsigned int TkStripMeasurementDet::rawId ( ) const
inline

Definition at line 111 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::id().

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

111 { 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 41 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().

42 {
44  if unlikely( (!isActive(data)) || isEmpty(data.stripData())) return result;
45  const detset & detSet = data.stripData().detSet(index());
46  result.reserve(detSet.size());
47  for ( new_const_iterator ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
48  if (isMasked(*ci)) 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 LogDebug("TkStripMeasurementDet")<<"skipping this str from last iteration on"<<rawId()<<" key: "<<cluster.key();
54  }
55  return result;
56 
57 }
#define LogDebug(id)
size
Write out results.
edmNew::DetSet< SiStripCluster > detset
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
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
#define unlikely(x)
#define end
Definition: vmac.h:39
TrackingRecHit::RecHitPointer buildRecHit(const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp) const
bool isEmpty(const StMeasurementDetSet &theDets) const
return(e1-e2)*(e1-e2)+dp *dp
TrackingRecHit::ConstRecHitContainer RecHitContainer
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
#define begin
Definition: vmac.h:32
detset::const_iterator new_const_iterator
unsigned int rawId() const
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:95
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(), StMeasurementDetSet::handle(), hit(), index(), isActive(), isEmpty(), TrajectoryStateOnSurface::localParameters(), TrajectoryStateOnSurface::localPosition(), edmNew::DetSet< T >::makeRefTo(), Topology::measurementPosition(), eostools::move(), specificGeomDet(), StripGeomDetUnit::specificTopology(), MeasurementTrackerEvent::stripClustersToSkip(), MeasurementTrackerEvent::stripData(), tmp, unlikely, and x.

63  {
64  if unlikely( (!isActive(data)) || isEmpty(data.stripData())) return false;
65  auto oldSize = result.size();
66 
67  int utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
68  const detset & detSet = data.stripData().detSet(index());
69  auto const & cpepar = cpe()->getAlgoParam(specificGeomDet(),stateOnThisDet.localParameters());
70 
71  auto rightCluster =
72  std::find_if( detSet.begin(), detSet.end(), [utraj](const SiStripCluster& hit) { return hit.firstStrip() > utraj; });
73 
74 
75  std::vector<SiStripRecHit2D> tmp;
76  if ( rightCluster != detSet.begin()) {
77  // there are hits on the left of the utraj
78  auto leftCluster = rightCluster;
79  while ( --leftCluster >= detSet.begin()) {
80  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), leftCluster);
81  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), tmp);
82  if(!isCompatible) break; // exit loop on first incompatible hit
83  for (auto && h: tmp) result.push_back(new SiStripRecHit2D(std::move(h)));
84  tmp.clear();
85  }
86  }
87  for ( ; rightCluster != detSet.end(); rightCluster++) {
88  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), rightCluster);
89  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), tmp);
90  if(!isCompatible) break; // exit loop on first incompatible hit
91  for (auto && h: tmp) result.push_back(new SiStripRecHit2D(std::move(h)));
92  tmp.clear();
93  }
94 
95  return result.size()>oldSize;
96 }
size
Write out results.
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
edmNew::DetSet< SiStripCluster > detset
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 StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
#define unlikely(x)
const StripCPE * cpe() const
#define end
Definition: vmac.h:39
const StripGeomDetUnit & specificGeomDet() const
bool isEmpty(const StMeasurementDetSet &theDets) const
return(e1-e2)*(e1-e2)+dp *dp
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
#define begin
Definition: vmac.h:32
iterator end()
Definition: DetSetNew.h:70
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:95
def move(src, dest)
Definition: eostools.py:510
iterator begin()
Definition: DetSetNew.h:67
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 136 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.

137  {
138  if unlikely( (!isActive(data)) || isEmpty(data.stripData())) return false;
139 
140  auto oldSize = result.size();
141  auto const & cpepar = cpe()->getAlgoParam(specificGeomDet(),stateOnThisDet.localParameters());
142 
143  int utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
144 
145  const detset & detSet = data.stripData().detSet(index());
146  auto rightCluster =
147  std::find_if( detSet.begin(), detSet.end(), [utraj](const SiStripCluster& hit) { return hit.firstStrip() > utraj; });
148 
149  if ( rightCluster != detSet.begin()) {
150  // there are hits on the left of the utraj
151  auto leftCluster = rightCluster;
152  while ( --leftCluster >= detSet.begin()) {
153  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), leftCluster);
154  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result, diffs);
155  if(!isCompatible) break; // exit loop on first incompatible hit
156  }
157  }
158  for ( ; rightCluster != detSet.end(); rightCluster++) {
159  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), rightCluster);
160  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result,diffs);
161  if(!isCompatible) break; // exit loop on first incompatible hit
162  }
163 
164  return result.size()>oldSize;
165 }
size
Write out results.
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
edmNew::DetSet< SiStripCluster > detset
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 StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
#define unlikely(x)
const StripCPE * cpe() const
#define end
Definition: vmac.h:39
const StripGeomDetUnit & specificGeomDet() const
bool isEmpty(const StMeasurementDetSet &theDets) const
return(e1-e2)*(e1-e2)+dp *dp
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
#define begin
Definition: vmac.h:32
iterator end()
Definition: DetSetNew.h:70
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:95
iterator begin()
Definition: DetSetNew.h:67
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 222 of file TkStripMeasurementDet.h.

References training_settings::idx, and StMeasurementConditionSet::set128StripStatus().

222  {
224  }
StMeasurementConditionSet & conditionSet()
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 216 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::setActiveThisEvent().

216 { theDets.setActiveThisEvent(index(),active); }
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 212 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::setActive().

212 { 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 105 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::setEmpty().

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

Definition at line 103 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 213 of file TkStripMeasurementDet.cc.

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

Referenced by TkGluedMeasurementDet::collectRecHits().

214 {
215  if (isEmpty(data.stripData()) || !isActive(data)) return;
216 
217  const detset & detSet = data.stripData().detSet(index());
219  assert(clusters.empty());
220  for (auto const & ci : detSet) {
221  if (isMasked(ci)) continue;
222  if (accept(detSet.makeKeyOf(&ci), data.stripClustersToSkip()))
223  clusters.push_back(&ci);
224  else LogDebug("TkStripMeasurementDet")<<"skipping this str from last iteration on"<<rawId()<<" key: "<<detSet.makeKeyOf(&ci);
225  }
226  if (!clusters.empty()) buildSimpleRecHits(clusters, data, detSet, ts,result);
227 
228 }
#define LogDebug(id)
const StripDetset & detSet(int i) const
edmNew::DetSet< SiStripCluster > detset
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
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
#define unInitDynArray(T, n, x)
Definition: DynArray.h:58
T value_type
Definition: DynArray.h:11
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
bool TkStripMeasurementDet::simpleRecHits ( const TrajectoryStateOnSurface ts,
const MeasurementEstimator est,
const MeasurementTrackerEvent data,
std::vector< SiStripRecHit2D > &  result 
) const

Definition at line 101 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.

103  {
104  if unlikely( (!isActive(data)) || isEmpty(data.stripData())) return false;
105 
106  auto oldSize = result.size();
107 
108  int utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
109  const detset & detSet = data.stripData().detSet(index());
110  auto const & cpepar = cpe()->getAlgoParam(specificGeomDet(),stateOnThisDet.localParameters());
111 
112  auto rightCluster =
113  std::find_if( detSet.begin(), detSet.end(), [utraj](const SiStripCluster& hit) { return hit.firstStrip() > utraj; });
114 
115  if ( rightCluster != detSet.begin()) {
116  // there are hits on the left of the utraj
117  auto leftCluster = rightCluster;
118  while ( --leftCluster >= detSet.begin()) {
119  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), leftCluster);
120  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result);
121  if(!isCompatible) break; // exit loop on first incompatible hit
122  }
123  }
124  for ( ; rightCluster != detSet.end(); rightCluster++) {
125  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), rightCluster);
126  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result);
127  if(!isCompatible) break; // exit loop on first incompatible hit
128  }
129 
130  return result.size()>oldSize;
131 }
size
Write out results.
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
edmNew::DetSet< SiStripCluster > detset
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 StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
#define unlikely(x)
const StripCPE * cpe() const
#define end
Definition: vmac.h:39
const StripGeomDetUnit & specificGeomDet() const
bool isEmpty(const StMeasurementDetSet &theDets) const
return(e1-e2)*(e1-e2)+dp *dp
SiStripRecHit2D::ClusterRef SiStripClusterRef
const detset & detSet(const StMeasurementDetSet &theDets) const
#define begin
Definition: vmac.h:32
iterator end()
Definition: DetSetNew.h:70
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:95
iterator begin()
Definition: DetSetNew.h:67
const StripGeomDetUnit& TkStripMeasurementDet::specificGeomDet ( ) const
inline

Definition at line 151 of file TkStripMeasurementDet.h.

References MeasurementDet::fastGeomDet().

Referenced by hit(), measurements(), recHits(), simpleRecHits(), and TkGluedMeasurementDet::testStrips().

151 {return static_cast<StripGeomDetUnit const &>(fastGeomDet());}
const GeomDet & fastGeomDet() const
unsigned char TkStripMeasurementDet::subId ( ) const
inline

Definition at line 112 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::subId().

112 { 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 265 of file TkStripMeasurementDet.cc.

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

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

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

Definition at line 115 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::detSet().

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

Definition at line 251 of file TkStripMeasurementDet.h.

References StMeasurementConditionSet::totalStrips().

Referenced by testStrips().

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

Member Data Documentation

int TkStripMeasurementDet::index_
private

Definition at line 243 of file TkStripMeasurementDet.h.

StMeasurementConditionSet* TkStripMeasurementDet::theDetConditions
private

Definition at line 244 of file TkStripMeasurementDet.h.