test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private 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
 
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
 Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'. More...
 
bool isEmpty (const StMeasurementDetSet &theDets) const
 
bool maskBad128StripBlocks () const
 
virtual bool measurements (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const
 
unsigned int rawId () const
 
virtual RecHitContainer recHits (const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const
 
virtual bool recHits (SimpleHitContainer &result, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data) const
 
virtual bool recHits (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, RecHitContainer &result, std::vector< float > &diffs) const
 
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)
 
virtual ~TkStripMeasurementDet ()
 
- 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
 

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

virtual TkStripMeasurementDet::~TkStripMeasurementDet ( )
inlinevirtual

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) == 0) {
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)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
void TkStripMeasurementDet::advance ( TkStripRecHitIter hi) const

Definition at line 240 of file TkStripMeasurementDet.cc.

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

Referenced by TkStripRecHitIter::advance().

240  {
241  while (!hi.empty()) {
242  auto ci = hi.clusterI;
243  auto const & data = *hi.data;
244  if (isMasked(*ci)) continue;
245  SiStripClusterRef cluster = edmNew::makeRefTo( data.stripData().handle(), ci );
246  if (accept(cluster, data.stripClustersToSkip())) return;
247  ++hi.clusterI;
248  }
249 }
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 cmsHarvester::index.

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 cmsHarvester::index.

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
const GeomDet & fastGeomDet() const
const StripCPE * cpe() const
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:65
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
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(), 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  }
int i
Definition: DBlmapReader.cc:9
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:65
const StripGeomDetUnit & specificGeomDet() const
const detset & detSet(const StMeasurementDetSet &theDets) const
#define declareDynArray(T, n, x)
Definition: DynArray.h:58
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.

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(), and cmsHarvester::index.

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 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:37
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
string const
Definition: compareJSON.py:14
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:30
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
for(const auto &isodef:isoDefs)
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(), and MeasurementEstimator::preFilter().

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
bool isMasked(const SiStripCluster &cluster) const
tuple result
Definition: mps_fire.py:84
const GeomDet & fastGeomDet() const
const StripCPE * cpe() const
def move
Definition: eostools.py:510
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
StripClusterParameterEstimator::LocalValues localParameters(const SiStripCluster &cl, const GeomDetUnit &) const override
Definition: StripCPE.cc:65
unsigned int rawId() const
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
bool isMasked(const SiStripCluster &cluster) const
tuple result
Definition: mps_fire.py:84
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:65
unsigned int rawId() const
std::vector<BadStripBlock>& TkStripMeasurementDet::getBadStripBlocks ( )
inline

Definition at line 233 of file TkStripMeasurementDet.h.

References cmsHarvester::index.

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 cmsHarvester::index.

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

Implements MeasurementDet.

Definition at line 123 of file TkStripMeasurementDet.h.

123 {return false;}
SiStripRecHit2D TkStripMeasurementDet::hit ( TkStripRecHitIter const &  hi) const

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

251  {
252  const GeomDetUnit& gdu( specificGeomDet());
253  auto ci = hi.clusterI;
254  auto const & data = *hi.data;
255  auto const & ltp = *hi.tsos;
256 
257  SiStripClusterRef cluster = edmNew::makeRefTo( data.stripData().handle(), ci );
258  LocalValues lv = cpe()->localParameters( *cluster, gdu, ltp);
259  return SiStripRecHit2D(lv.first,lv.second, gdu, cluster);
260 }
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:65
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 231 of file TkStripMeasurementDet.cc.

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

232 {
233  if (isEmpty(data.stripData()) || !isActive(data)) return std::tuple<TkStripRecHitIter,TkStripRecHitIter>();
234  const detset & detSet = data.stripData().detSet(index());
235  return std::make_tuple(TkStripRecHitIter(detSet.begin(),detSet.end(),*this,ts,data),
236  TkStripRecHitIter(detSet.end(),detSet.end(),*this,ts,data)
237  );
238 }
const StripDetset & detSet(int i) const
edmNew::DetSet< SiStripCluster > detset
const StMeasurementDetSet & stripData() const
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
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
inlinevirtual

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

Implements MeasurementDet.

Definition at line 120 of file TkStripMeasurementDet.h.

References cmsHarvester::index, 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(), and cmsHarvester::index.

Referenced by 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 cmsHarvester::index.

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.

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

Implements MeasurementDet.

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

167  {
168 
169  if (!isActive(data)) {
170  LogDebug("TkStripMeasurementDet")<<" found an inactive module "<<rawId();
171  result.add(theInactiveHit, 0.F);
172  return true;
173  }
174 
175  if (!isEmpty(data.stripData())){
176  LogDebug("TkStripMeasurementDet")<<" found hit on this module "<<rawId();
178  std::vector<float> diffs;
179  if (recHits(stateOnThisDet,est,data,result.hits,result.distances)) return true;
180  }
181 
182 
183  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
184 
185  if (!stateOnThisDet.hasError()) {
186  result.add(theMissingHit, 0.F);
187  return false;
188  }
189 
190  float utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
191  float uerr= sqrt(specificGeomDet().specificTopology().measurementError(stateOnThisDet.localPosition(),stateOnThisDet.localError().positionError()).uu());
192  if (testStrips(utraj,uerr)) {
193  //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, but active ";
194  result.add(theMissingHit, 0.F);
195  return false;
196  }
197 
198  //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, and inactive ";
199  result.add(theInactiveHit, 0.F);
200  return true;
201 
202 }
#define LogDebug(id)
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:84
TrackingRecHit::ConstRecHitPointer theMissingHit
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const
T sqrt(T t)
Definition: SSEVec.h:18
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const LocalTrajectoryError & localError() const
TrackingRecHit::ConstRecHitPointer theInactiveHit
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
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 cmsHarvester::index.

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
virtual

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)
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:84
#define unlikely(x)
#define end
Definition: vmac.h:37
TrackingRecHit::RecHitPointer buildRecHit(const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp) const
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
string const
Definition: compareJSON.py:14
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:30
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
for(const auto &isodef:isoDefs)
tuple size
Write out results.
bool TkStripMeasurementDet::recHits ( SimpleHitContainer result,
const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
const MeasurementTrackerEvent data 
) const
virtual

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(), 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))); tmp.clear();
84  }
85  }
86  for ( ; rightCluster != detSet.end(); rightCluster++) {
87  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), rightCluster);
88  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), tmp);
89  if(!isCompatible) break; // exit loop on first incompatible hit
90  for (auto && h: tmp) result.push_back(new SiStripRecHit2D(std::move(h))); tmp.clear();
91  }
92 
93  return result.size()>oldSize;
94 }
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
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
edmNew::DetSet< SiStripCluster > detset
const StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
tuple result
Definition: mps_fire.py:84
#define unlikely(x)
const StripCPE * cpe() const
def move
Definition: eostools.py:510
#define end
Definition: vmac.h:37
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const StripGeomDetUnit & specificGeomDet() const
string const
Definition: compareJSON.py:14
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:30
iterator end()
Definition: DetSetNew.h:70
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
volatile std::atomic< bool > shutdown_flag false
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
tuple size
Write out results.
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
virtual

Reimplemented from MeasurementDet.

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

135  {
136  if unlikely( (!isActive(data)) || isEmpty(data.stripData())) return false;
137 
138  auto oldSize = result.size();
139  auto const & cpepar = cpe()->getAlgoParam(specificGeomDet(),stateOnThisDet.localParameters());
140 
141  int utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
142 
143  const detset & detSet = data.stripData().detSet(index());
144  auto rightCluster =
145  std::find_if( detSet.begin(), detSet.end(), [utraj](const SiStripCluster& hit) { return hit.firstStrip() > utraj; });
146 
147  if ( rightCluster != detSet.begin()) {
148  // there are hits on the left of the utraj
149  auto leftCluster = rightCluster;
150  while ( --leftCluster >= detSet.begin()) {
151  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), leftCluster);
152  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result, diffs);
153  if(!isCompatible) break; // exit loop on first incompatible hit
154  }
155  }
156  for ( ; rightCluster != detSet.end(); rightCluster++) {
157  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), rightCluster);
158  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result,diffs);
159  if(!isCompatible) break; // exit loop on first incompatible hit
160  }
161 
162  return result.size()>oldSize;
163 }
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
const StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
tuple result
Definition: mps_fire.py:84
#define unlikely(x)
const StripCPE * cpe() const
#define end
Definition: vmac.h:37
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const StripGeomDetUnit & specificGeomDet() const
string const
Definition: compareJSON.py:14
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:30
iterator end()
Definition: DetSetNew.h:70
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
volatile std::atomic< bool > shutdown_flag false
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
tuple size
Write out results.
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 customizeTrackingMonitorSeedNumber::idx, and cmsHarvester::index.

222  {
224  }
StMeasurementConditionSet & conditionSet()
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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 cmsHarvester::index, and 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 cmsHarvester::index.

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 cmsHarvester::index, and StMeasurementDetSet::setEmpty().

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

Definition at line 103 of file TkStripMeasurementDet.h.

References i.

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

Definition at line 211 of file TkStripMeasurementDet.cc.

References accept(), assert(), buildSimpleRecHits(), HLT_25ns10e33_v2_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().

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

101  {
102  if unlikely( (!isActive(data)) || isEmpty(data.stripData())) return false;
103 
104  auto oldSize = result.size();
105 
106  int utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
107  const detset & detSet = data.stripData().detSet(index());
108  auto const & cpepar = cpe()->getAlgoParam(specificGeomDet(),stateOnThisDet.localParameters());
109 
110  auto rightCluster =
111  std::find_if( detSet.begin(), detSet.end(), [utraj](const SiStripCluster& hit) { return hit.firstStrip() > utraj; });
112 
113  if ( rightCluster != detSet.begin()) {
114  // there are hits on the left of the utraj
115  auto leftCluster = rightCluster;
116  while ( --leftCluster >= detSet.begin()) {
117  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), leftCluster);
118  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result);
119  if(!isCompatible) break; // exit loop on first incompatible hit
120  }
121  }
122  for ( ; rightCluster != detSet.end(); rightCluster++) {
123  SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), rightCluster);
124  bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result);
125  if(!isCompatible) break; // exit loop on first incompatible hit
126  }
127 
128  return result.size()>oldSize;
129 }
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
const StMeasurementDetSet & stripData() const
const std::vector< bool > & stripClustersToSkip() const
tuple result
Definition: mps_fire.py:84
#define unlikely(x)
const StripCPE * cpe() const
#define end
Definition: vmac.h:37
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const StripGeomDetUnit & specificGeomDet() const
string const
Definition: compareJSON.py:14
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:30
iterator end()
Definition: DetSetNew.h:70
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
volatile std::atomic< bool > shutdown_flag false
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
tuple size
Write out results.
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 cmsHarvester::index.

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 263 of file TkStripMeasurementDet.cc.

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

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

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

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 cmsHarvester::index.

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.