CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

TkStripMeasurementDet Class Reference

#include <TkStripMeasurementDet.h>

Inheritance diagram for TkStripMeasurementDet:
MeasurementDet

List of all members.

Public Types

typedef
StMeasurementDetSet::BadStripBlock 
BadStripBlock
typedef
StMeasurementDetSet::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 edm::LazyGetter
< SiStripCluster >::value_ref 
SiStripRegionalClusterRef
typedef
StripClusterParameterEstimator::VLocalValues 
VLocalValues

Public Member Functions

bool accept (SiStripClusterRef &r) const
bool accept (SiStripRegionalClusterRef &r) const
std::vector< BadStripBlock >
const & 
badStripBlocks () const
unsigned int beginClusterI () const
TransientTrackingRecHit::RecHitPointer buildRecHit (const SiStripClusterRef &, const TrajectoryStateOnSurface &ltp) const
TransientTrackingRecHit::RecHitPointer buildRecHit (const SiStripRegionalClusterRef &, const TrajectoryStateOnSurface &ltp) const
TkStripMeasurementDet::RecHitContainer buildRecHits (const SiStripClusterRef &, const TrajectoryStateOnSurface &ltp) const
TkStripMeasurementDet::RecHitContainer buildRecHits (const SiStripRegionalClusterRef &, const TrajectoryStateOnSurface &ltp) const
const detsetdetSet () const
detsetdetSet ()
unsigned int endClusterI () const
virtual std::vector
< TrajectoryMeasurement
fastMeasurements (const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &startingState, const Propagator &, const MeasurementEstimator &) const
std::vector< BadStripBlock > & getBadStripBlocks ()
bool hasAllGoodChannels () const
 does this module have at least one bad strip, APV or channel?
bool hasBadComponents (const TrajectoryStateOnSurface &tsos) const
int index () const
bool isActive () const
 Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'.
bool isEmpty () const
bool isRegional () const
bool maskBad128StripBlocks () const
unsigned int rawId () const
virtual RecHitContainer recHits (const TrajectoryStateOnSurface &) const
void set128StripStatus (bool good, int idx=-1)
 Sets the status of a block of 128 strips (or all blocks if idx=-1)
void setActive (bool active)
 Turn on/off the module for reconstruction, for the full run or lumi (using info from DB, usually). This also resets the 'setActiveThisEvent' to true.
void setActiveThisEvent (bool active)
 Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call to 'update' or 'setEmpty'.
void setEmpty ()
void setIndex (int i)
void simpleRecHits (const TrajectoryStateOnSurface &ts, std::vector< SiStripRecHit2D > &result) const
int size () 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.
const detsettheSet () const
 TkStripMeasurementDet (const GeomDet *gdet, StMeasurementDetSet &dets)
void update (std::vector< SiStripCluster >::const_iterator begin, std::vector< SiStripCluster >::const_iterator end)
void update (const detset &detSet)
virtual ~TkStripMeasurementDet ()

Private Member Functions

BadStripCuts const & badStripCuts () const
template<class ClusterRefT >
void buildSimpleRecHit (const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp, std::vector< SiStripRecHit2D > &res) const
const
StripClusterParameterEstimator
cpe () const
edm::Handle
< edmNew::DetSetVector
< SiStripCluster > > const & 
handle () const
bool hasAny128StripBad () const
bool isMasked (const SiStripCluster &cluster) const
edm::Handle< edm::LazyGetter
< SiStripCluster > > const & 
regionalHandle () const
const std::vector< bool > & skipClusters () const
StMeasurementDetSettheDets ()
StMeasurementDetSettheDets () const
int totalStrips () const

Private Attributes

int index_
StMeasurementDetSettheDets_

Detailed Description

Definition at line 22 of file TkStripMeasurementDet.h.


Member Typedef Documentation

Definition at line 125 of file TkStripMeasurementDet.h.

Definition at line 120 of file TkStripMeasurementDet.h.

Definition at line 35 of file TkStripMeasurementDet.h.

Definition at line 32 of file TkStripMeasurementDet.h.

Definition at line 25 of file TkStripMeasurementDet.h.

Definition at line 33 of file TkStripMeasurementDet.h.

typedef SiStripRecHit2D::ClusterRef TkStripMeasurementDet::SiStripClusterRef

Definition at line 28 of file TkStripMeasurementDet.h.

Definition at line 30 of file TkStripMeasurementDet.h.

Definition at line 26 of file TkStripMeasurementDet.h.


Constructor & Destructor Documentation

virtual TkStripMeasurementDet::~TkStripMeasurementDet ( ) [inline, virtual]

Definition at line 37 of file TkStripMeasurementDet.h.

{}
TkStripMeasurementDet::TkStripMeasurementDet ( const GeomDet gdet,
StMeasurementDetSet dets 
)

Definition at line 17 of file TkStripMeasurementDet.cc.

                                                : 
  MeasurementDet (gdet),theDets_(&dets), index_(-1)
  {
    if (dynamic_cast<const StripGeomDetUnit*>(gdet) == 0) {
      throw MeasurementDetException( "TkStripMeasurementDet constructed with a GeomDet which is not a StripGeomDetUnit");
    }
  }

Member Function Documentation

bool TkStripMeasurementDet::accept ( SiStripClusterRef r) const [inline]

Definition at line 174 of file TkStripMeasurementDet.h.

References relativeConstraints::empty, and skipClusters().

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

                                                  {
    if(skipClusters().empty()) return true;
    if (r.key()>=skipClusters().size()){
      edm::LogError("WrongStripMasking")<<r.key()<<" is larger than: "<<skipClusters().size()<<" no skipping done";
      return true;
    }
    return (not (skipClusters()[r.key()]));
  }
bool TkStripMeasurementDet::accept ( SiStripRegionalClusterRef r) const [inline]

Definition at line 182 of file TkStripMeasurementDet.h.

References relativeConstraints::empty, edm::Ref< C, T, F >::key(), LogDebug, and skipClusters().

                                                        {
    if(skipClusters().empty()) return true;
    if (r.key()>=skipClusters().size()){
      LogDebug("TkStripMeasurementDet")<<r.key()<<" is larger than: "<<skipClusters().size()
                                       <<"\n This must be a new cluster, and therefore should not be skiped most likely.";
      return true;
    }
    return (not (skipClusters()[r.key()]));
  }
std::vector<BadStripBlock> const& TkStripMeasurementDet::badStripBlocks ( ) const [inline]

Definition at line 128 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::badStripBlocks(), index(), and theDets().

Referenced by hasAllGoodChannels(), and testStrips().

{ return theDets().badStripBlocks(index()); }
BadStripCuts const& TkStripMeasurementDet::badStripCuts ( ) const [inline, private]

Definition at line 155 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::badStripCuts(), index(), and theDets().

Referenced by testStrips().

{ return theDets().badStripCuts(index());}
unsigned int TkStripMeasurementDet::beginClusterI ( ) const [inline]
TransientTrackingRecHit::RecHitPointer TkStripMeasurementDet::buildRecHit ( const SiStripClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const

Definition at line 189 of file TkStripMeasurementDet.cc.

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

Referenced by recHits().

{
  const GeomDetUnit& gdu( specificGeomDet());
  LocalValues lv = cpe()->localParameters( *cluster, gdu, ltp);
  return TSiStripRecHit2DLocalPos::build( lv.first, lv.second, &fastGeomDet(), cluster, cpe());
}
TransientTrackingRecHit::RecHitPointer TkStripMeasurementDet::buildRecHit ( const SiStripRegionalClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const
TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::buildRecHits ( const SiStripClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const

Definition at line 209 of file TkStripMeasurementDet.cc.

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

Referenced by fastMeasurements().

{
  const GeomDetUnit& gdu( specificGeomDet());
  VLocalValues vlv = cpe()->localParametersV( *cluster, gdu, ltp);
  RecHitContainer res;
  for(VLocalValues::const_iterator it=vlv.begin();it!=vlv.end();++it){
    res.push_back(TSiStripRecHit2DLocalPos::build( it->first, it->second, &fastGeomDet(), cluster, cpe()));
  }
  return res; 
}
TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::buildRecHits ( const SiStripRegionalClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const

Definition at line 223 of file TkStripMeasurementDet.cc.

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

{
  const GeomDetUnit& gdu( specificGeomDet());
  VLocalValues vlv = cpe()->localParametersV( *cluster, gdu, ltp);
  RecHitContainer res;
  for(VLocalValues::const_iterator it=vlv.begin();it!=vlv.end();++it){
    res.push_back(TSiStripRecHit2DLocalPos::build( it->first, it->second, &fastGeomDet(), cluster, cpe()));
  }
  return res; 
}
template<class ClusterRefT >
void TkStripMeasurementDet::buildSimpleRecHit ( const ClusterRefT &  cluster,
const TrajectoryStateOnSurface ltp,
std::vector< SiStripRecHit2D > &  res 
) const [private]

Definition at line 270 of file TkStripMeasurementDet.cc.

References cpe(), ClusterParameterEstimator< T >::localParametersV(), rawId(), and specificGeomDet().

Referenced by simpleRecHits().

{
  const GeomDetUnit& gdu( specificGeomDet());
  VLocalValues vlv = cpe()->localParametersV( *cluster, gdu, ltp);
  for(VLocalValues::const_iterator it=vlv.begin();it!=vlv.end();++it){
    res.push_back(SiStripRecHit2D( it->first, it->second, rawId(), cluster));
  }
}
const StripClusterParameterEstimator* TkStripMeasurementDet::cpe ( ) const [inline, private]

Definition at line 147 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::stripCPE(), and theDets().

Referenced by buildRecHit(), buildRecHits(), and buildSimpleRecHit().

{ return  theDets().stripCPE(); }
const detset& TkStripMeasurementDet::detSet ( ) const [inline]

Definition at line 64 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::detSet(), index(), and theDets().

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

{return theDets().detSet(index());}
detset& TkStripMeasurementDet::detSet ( ) [inline]

Definition at line 65 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::detSet(), index(), and theDets().

{ return theDets().detSet(index());}
unsigned int TkStripMeasurementDet::endClusterI ( ) const [inline]
std::vector< TrajectoryMeasurement > TkStripMeasurementDet::fastMeasurements ( const TrajectoryStateOnSurface stateOnThisDet,
const TrajectoryStateOnSurface startingState,
const Propagator ,
const MeasurementEstimator  
) const [virtual]

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

Implements MeasurementDet.

Definition at line 30 of file TkStripMeasurementDet.cc.

References accept(), begin, beginClusterI(), newFWLiteAna::build, buildRecHits(), detSet(), edmNew::DetSet< T >::end(), end, endClusterI(), MeasurementEstimator::estimate(), F(), MeasurementDet::fastGeomDet(), MeasurementDet::geomDet(), handle(), TrajectoryStateOnSurface::hasError(), TrackingRecHit::inactive, isActive(), isEmpty(), isMasked(), isRegional(), edm::Ref< C, T, F >::key(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LogDebug, edm::makeRefTo(), edm::makeRefToLazyGetter(), Topology::measurementPosition(), TrackingRecHit::missing, LocalTrajectoryError::positionError(), rawId(), recHits(), regionalHandle(), query::result, size(), python::multivaluedict::sort(), specificGeomDet(), StripGeomDetUnit::specificTopology(), mathSSE::sqrt(), testStrips(), and x.

{ 
  std::vector<TrajectoryMeasurement> result;

  if (!isActive()) {
    LogDebug("TkStripMeasurementDet")<<" found an inactive module "<<rawId();
    result.push_back( TrajectoryMeasurement( stateOnThisDet, 
                InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::inactive), 
                0.F));
    return result;
  }
 
  float utraj =  specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
  float uerr;
  //  if (theClusterRange.first == theClusterRange.second) { // empty
  if (isEmpty()){
    LogDebug("TkStripMeasurementDet") << " DetID " << rawId() << " empty ";
    if (stateOnThisDet.hasError()){
    uerr= sqrt(specificGeomDet().specificTopology().measurementError(stateOnThisDet.localPosition(),stateOnThisDet.localError().positionError()).uu());
     if (testStrips(utraj,uerr)) {
        result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&fastGeomDet(), TrackingRecHit::missing), 0.F));
     } else { 
        result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&fastGeomDet(), TrackingRecHit::inactive), 0.F));
     }
    }else{
      result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&fastGeomDet(), TrackingRecHit::missing), 0.F));
    }
    return result;
  }
  
  if(!isRegional()){//old implemetation with DetSet
    auto rightCluster = 
      std::find_if( detSet().begin(), detSet().end(), StripClusterAboveU( utraj)); //FIXME
    
    if ( rightCluster != detSet().begin()) {
      // there are hits on the left of the utraj
      new_const_iterator leftCluster = rightCluster;
      while ( --leftCluster >=  detSet().begin()) {
        if (isMasked(*leftCluster)) continue;
        SiStripClusterRef clusterref = edmNew::makeRefTo( handle(), leftCluster ); 
        if (accept(clusterref)){
          RecHitContainer recHits = buildRecHits(clusterref,stateOnThisDet); 
          bool isCompatible(false);
          for(RecHitContainer::const_iterator recHit=recHits.begin();recHit!=recHits.end();++recHit){     
            std::pair<bool,double> diffEst = est.estimate(stateOnThisDet, **recHit);
            if ( diffEst.first ) {
              result.push_back( TrajectoryMeasurement( stateOnThisDet, *recHit, 
                                                       diffEst.second));
              isCompatible = true;
            }
          }
          if(!isCompatible) break; // exit loop on first incompatible hit
        }
        else LogDebug("TkStripMeasurementDet")<<"skipping this str from last iteration on"<<rawId()<<" key: "<<clusterref.key();
      }
    }
    

    for ( ; rightCluster != detSet().end(); rightCluster++) {
      if (isMasked(*rightCluster)) continue;
      SiStripClusterRef clusterref = edmNew::makeRefTo( handle(), rightCluster ); 
      if (accept(clusterref)){
        RecHitContainer recHits = buildRecHits(clusterref,stateOnThisDet); 
        bool isCompatible(false);
        for(RecHitContainer::const_iterator recHit=recHits.begin();recHit!=recHits.end();++recHit){       
          std::pair<bool,double> diffEst = est.estimate(stateOnThisDet, **recHit);
          if ( diffEst.first ) {
            result.push_back( TrajectoryMeasurement( stateOnThisDet, *recHit, 
                                                     diffEst.second));
            isCompatible = true;
          }
        }
        if(!isCompatible) break; // exit loop on first incompatible hit
      }
      else LogDebug("TkStripMeasurementDet")<<"skipping this str from last iteration on" << rawId()<<" key: "<<clusterref.key();
    }
  }// end block with DetSet
  else{
    LogDebug("TkStripMeasurementDet")<<" finding left/ right";
    result.reserve(size());
    unsigned int rightCluster = beginClusterI();
    for (; rightCluster!= endClusterI();++rightCluster){
      SiStripRegionalClusterRef clusterref = edm::makeRefToLazyGetter(regionalHandle(),rightCluster);
      if (clusterref->barycenter() > utraj) break;
    }
    
    unsigned int leftCluster = 1;
    for (unsigned int iReadBackWard=1; iReadBackWard<=(rightCluster-beginClusterI()) ; ++iReadBackWard){
      leftCluster=rightCluster-iReadBackWard;
      SiStripRegionalClusterRef clusterref = edm::makeRefToLazyGetter(regionalHandle(),leftCluster);
      if (isMasked(*clusterref)) continue;
      if (accept(clusterref)){
        RecHitContainer recHits = buildRecHits(clusterref,stateOnThisDet); 
        bool isCompatible(false);
        for(RecHitContainer::const_iterator recHit=recHits.begin();recHit!=recHits.end();++recHit){       
          std::pair<bool,double> diffEst = est.estimate(stateOnThisDet, **recHit);
          if ( diffEst.first ) {
            result.push_back( TrajectoryMeasurement( stateOnThisDet, *recHit, 
                                                     diffEst.second));
            isCompatible = true;
          }
        }
        if(!isCompatible) break; // exit loop on first incompatible hit
      }
      else LogDebug("TkStripMeasurementDet")<<"skipping this reg str from last iteration on"<<rawId()<<" key: "<<clusterref.key();
    }
    
    
    for ( ; rightCluster != endClusterI(); ++rightCluster) {
      SiStripRegionalClusterRef clusterref = edm::makeRefToLazyGetter(regionalHandle(),rightCluster);
      if (isMasked(*clusterref)) continue;
      if (accept(clusterref)){
        RecHitContainer recHits = buildRecHits(clusterref,stateOnThisDet); 
        bool isCompatible(false);
        for(RecHitContainer::const_iterator recHit=recHits.begin();recHit!=recHits.end();++recHit){       
          std::pair<bool,double> diffEst = est.estimate(stateOnThisDet, **recHit);
          if ( diffEst.first ) {
            result.push_back( TrajectoryMeasurement( stateOnThisDet, *recHit, 
                                                     diffEst.second));
            isCompatible = true;
          }
        }
        if(!isCompatible) break; // exit loop on first incompatible hit
      }
      else LogDebug("TkStripMeasurementDet")<<"skipping this reg str from last iteration on"<<rawId()<<" key: "<<clusterref.key();
    }
  }
  

  if ( result.empty()) {
    // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
    if (stateOnThisDet.hasError()){
    uerr= sqrt(specificGeomDet().specificTopology().measurementError(stateOnThisDet.localPosition(),stateOnThisDet.localError().positionError()).uu());
     if (testStrips(utraj,uerr)) {
       //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, but active ";
       result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&fastGeomDet(), TrackingRecHit::missing), 0.F));
     } else { 
       //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, and inactive ";
       result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&fastGeomDet(), TrackingRecHit::inactive), 0.F));
     }
    }else{
      result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&fastGeomDet(), TrackingRecHit::missing), 0.F));
    }
  }
  else {
    //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " full: " << (result.size()) << " compatible hits";
    // sort results according to estimator value
    if ( result.size() > 1) {
      std::sort( result.begin(), result.end(), TrajMeasLessEstim());
    }
  }
  return result;
}
std::vector<BadStripBlock>& TkStripMeasurementDet::getBadStripBlocks ( ) [inline]
edm::Handle<edmNew::DetSetVector<SiStripCluster> > const& TkStripMeasurementDet::handle ( ) const [inline, private]

Definition at line 144 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::handle(), and theDets().

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

{ return theDets().handle();}
bool TkStripMeasurementDet::hasAllGoodChannels ( ) const [inline]

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

Definition at line 113 of file TkStripMeasurementDet.h.

References badStripBlocks(), and hasAny128StripBad().

Referenced by TkGluedMeasurementDet::fastMeasurements().

{ return (!hasAny128StripBad()) && badStripBlocks().empty(); }
bool TkStripMeasurementDet::hasAny128StripBad ( ) const [inline, private]

Definition at line 157 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::hasAny128StripBad(), index(), and theDets().

Referenced by hasAllGoodChannels().

{ return  theDets().hasAny128StripBad(index()); } 
bool TkStripMeasurementDet::hasBadComponents ( const TrajectoryStateOnSurface tsos) const [inline, virtual]

Implements MeasurementDet.

Definition at line 76 of file TkStripMeasurementDet.h.

{return false;}
int TkStripMeasurementDet::index ( ) const [inline]
bool TkStripMeasurementDet::isActive ( ) const [inline, virtual]

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

Implements MeasurementDet.

Definition at line 73 of file TkStripMeasurementDet.h.

References index(), StMeasurementDetSet::isActive(), and theDets().

Referenced by fastMeasurements(), TkGluedMeasurementDet::fastMeasurements(), TkGluedMeasurementDet::isActive(), recHits(), and simpleRecHits().

{ return theDets().isActive(index()); }
bool TkStripMeasurementDet::isEmpty ( void  ) const [inline]

Definition at line 55 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::empty(), index(), and theDets().

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

{return theDets().empty(index());}
bool TkStripMeasurementDet::isMasked ( const SiStripCluster cluster) const [inline, private]

Definition at line 162 of file TkStripMeasurementDet.h.

References index(), StMeasurementDetSet::isMasked(), and theDets().

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

                                                            {
    return theDets().isMasked(index(), cluster);
  }
bool TkStripMeasurementDet::isRegional ( ) const [inline]

Definition at line 51 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::isRegional(), and theDets().

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

{ return theDets().isRegional();}
bool TkStripMeasurementDet::maskBad128StripBlocks ( ) const [inline]
unsigned int TkStripMeasurementDet::rawId ( ) const [inline]
TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::recHits ( const TrajectoryStateOnSurface ts) const [virtual]

Implements MeasurementDet.

Definition at line 238 of file TkStripMeasurementDet.cc.

References accept(), begin, beginClusterI(), buildRecHit(), detSet(), edmNew::DetSet< T >::end(), endClusterI(), handle(), isActive(), isEmpty(), isMasked(), isRegional(), edm::Ref< C, T, F >::key(), LogDebug, edm::makeRefTo(), edm::makeRefToLazyGetter(), rawId(), regionalHandle(), query::result, and size().

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

{
  RecHitContainer result;
  if (isEmpty() == true) return result;
  if (isActive() == false) return result; // GIO

  if(!isRegional()){//old implemetation with DetSet
    result.reserve(detSet().size());
    for ( new_const_iterator ci = detSet().begin(); ci != detSet().end(); ++ ci ) {
      if (isMasked(*ci)) continue;
      // for ( ClusterIterator ci=theClusterRange.first; ci != theClusterRange.second; ci++) {
      SiStripClusterRef  cluster = edmNew::makeRefTo( handle(), ci ); 
      if (accept(cluster))
        result.push_back( buildRecHit( cluster, ts));
      else LogDebug("TkStripMeasurementDet")<<"skipping this str from last iteration on"<<rawId()<<" key: "<<cluster.key();
    }
  }else{
    result.reserve(size());
    for (unsigned int ci = beginClusterI() ; ci!= endClusterI();++ci){
      SiStripRegionalClusterRef clusterRef = edm::makeRefToLazyGetter(regionalHandle(),ci);
      if (isMasked(*clusterRef)) continue;
      if (accept(clusterRef))
        result.push_back( buildRecHit( clusterRef, ts));
      else LogDebug("TkStripMeasurementDet")<<"skipping this reg str from last iteration on"<<rawId()<<" key: "<<clusterRef.key();
      }
  }
  return result;

}
edm::Handle<edm::LazyGetter<SiStripCluster> > const& TkStripMeasurementDet::regionalHandle ( ) const [inline, private]

Definition at line 145 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::regionalHandle(), and theDets().

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

{ return theDets().regionalHandle();}
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 116 of file TkStripMeasurementDet.h.

References UserOptions_cff::idx, index(), StMeasurementDetSet::set128StripStatus(), and theDets().

void TkStripMeasurementDet::setActive ( bool  active) [inline]

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

Definition at line 107 of file TkStripMeasurementDet.h.

References index(), StMeasurementDetSet::setActive(), and theDets().

{ theDets().setActive(index(),active);}
void TkStripMeasurementDet::setActiveThisEvent ( bool  active) [inline]

Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call to 'update' or 'setEmpty'.

Definition at line 110 of file TkStripMeasurementDet.h.

References index(), StMeasurementDetSet::setActiveThisEvent(), and theDets().

Referenced by OnDemandMeasurementTracker::assign().

{  theDets().setActiveThisEvent(index(),active); }
void TkStripMeasurementDet::setEmpty ( ) [inline]
void TkStripMeasurementDet::setIndex ( int  i) [inline]

Definition at line 42 of file TkStripMeasurementDet.h.

References i, and index_.

{ index_=i;}
void TkStripMeasurementDet::simpleRecHits ( const TrajectoryStateOnSurface ts,
std::vector< SiStripRecHit2D > &  result 
) const

Definition at line 283 of file TkStripMeasurementDet.cc.

References accept(), begin, beginClusterI(), buildSimpleRecHit(), detSet(), edmNew::DetSet< T >::end(), endClusterI(), handle(), isActive(), isEmpty(), isMasked(), isRegional(), edm::Ref< C, T, F >::key(), LogDebug, edm::makeRefTo(), edm::makeRefToLazyGetter(), rawId(), regionalHandle(), and size().

Referenced by TkGluedMeasurementDet::collectRecHits().

{
  if (isEmpty() || !isActive()) return;

  if(!isRegional()){//old implemetation with DetSet
    result.reserve(detSet().size());
    for ( new_const_iterator ci = detSet().begin(); ci != detSet().end(); ++ ci ) {
      if (isMasked(*ci)) continue;
      // for ( ClusterIterator ci=theClusterRange.first; ci != theClusterRange.second; ci++) {
      SiStripClusterRef  cluster = edmNew::makeRefTo( handle(), ci ); 
      if (accept(cluster))
        buildSimpleRecHit( cluster, ts,result);
      else LogDebug("TkStripMeasurementDet")<<"skipping this str from last iteration on"<<rawId()<<" key: "<<cluster.key();
    }
  }else{
    result.reserve(size());
    for (unsigned int ci = beginClusterI() ; ci!= endClusterI();++ci){
      SiStripRegionalClusterRef clusterRef = edm::makeRefToLazyGetter(regionalHandle(),ci);
      if (isMasked(*clusterRef)) continue;
      if (accept(clusterRef))
        buildSimpleRecHit( clusterRef, ts,result);
      else LogDebug("TkStripMeasurementDet")<<"skipping this reg str from last iteration on"<<rawId()<<" key: "<<clusterRef.key();
    }
  }
}
int TkStripMeasurementDet::size ( void  ) const [inline]

Definition at line 69 of file TkStripMeasurementDet.h.

References beginClusterI(), and endClusterI().

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

{return endClusterI() - beginClusterI() ; }
const std::vector<bool>& TkStripMeasurementDet::skipClusters ( ) const [inline, private]

Definition at line 150 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::clusterToSkip(), and theDets().

Referenced by accept().

{  return  theDets().clusterToSkip();}
const StripGeomDetUnit& TkStripMeasurementDet::specificGeomDet ( ) const [inline]
unsigned char TkStripMeasurementDet::subId ( ) const [inline]

Definition at line 60 of file TkStripMeasurementDet.h.

References index(), StMeasurementDetSet::subId(), and theDets().

{ return theDets().subId(index());}
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 312 of file TkStripMeasurementDet.cc.

References cond::ecalcond::bad(), badStripBlocks(), badStripCuts(), end, f, max(), StMeasurementDetSet::BadStripCuts::maxBad, StMeasurementDetSet::BadStripCuts::maxConsecutiveBad, min, convertSQLiteXML::ok, dqm_diff::start, and totalStrips().

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

                                                               {
    int16_t start = (int16_t) std::max<float>(utraj - 3.f*uerr, 0);
    int16_t end   = (int16_t) std::min<float>(utraj + 3.f*uerr, totalStrips());

    if (start >= end) { // which means either end <=0 or start >= totalStrips_
        /* LogDebug("TkStripMeasurementDet") << "Testing module " << id_ <<","<<
            " U = " << utraj << " +/- " << uerr << 
            "; Range [" << (utraj - 3*uerr) << ", " << (utraj + 3*uerr) << "] " << 
            ": YOU'RE COMPLETELY OFF THE MODULE."; */
        //return false; 
        return true;  // Wolfgang thinks this way is better
                      // and solves some problems with grouped ckf
    } 

    typedef std::vector<BadStripBlock>::const_iterator BSBIT;

    int16_t bad = 0, largestBadBlock = 0;
    for (BSBIT bsbc = badStripBlocks().begin(), bsbe = badStripBlocks().end(); bsbc != bsbe; ++bsbc) {
        if (bsbc->last  < start) continue;
        if (bsbc->first > end)   break;
        int16_t thisBad = std::min(bsbc->last, end) - std::max(bsbc->first, start);
        if (thisBad > largestBadBlock) largestBadBlock = thisBad;
        bad += thisBad;
    }

    bool ok = (bad < (end-start)) && 
      (uint16_t(bad) <= badStripCuts().maxBad) && 
      (uint16_t(largestBadBlock) <= badStripCuts().maxConsecutiveBad);

//    if (bad) {   
//       edm::LogWarning("TkStripMeasurementDet") << "Testing module " << id_ <<" (subdet: "<< SiStripDetId(id_).subdetId() << ")" <<
//            " U = " << utraj << " +/- " << uerr << 
//            "; Range [" << (utraj - 3*uerr) << ", " << (utraj + 3*uerr) << "] " << 
//            "= [" << start << "," << end << "]" <<
//            " total strips:" << (end-start) << ", good:" << (end-start-bad) << ", bad:" << bad << ", largestBadBlock: " << largestBadBlock << 
//            ". " << (ok ? "OK" : "NO"); 
//    }
    return ok;
}
StMeasurementDetSet& TkStripMeasurementDet::theDets ( ) const [inline, private]

Definition at line 137 of file TkStripMeasurementDet.h.

References theDets_.

{ return *theDets_;}
StMeasurementDetSet& TkStripMeasurementDet::theDets ( ) [inline, private]
const detset& TkStripMeasurementDet::theSet ( ) const [inline]

Definition at line 63 of file TkStripMeasurementDet.h.

References StMeasurementDetSet::detSet(), index(), and theDets().

{return theDets().detSet(index());}
int TkStripMeasurementDet::totalStrips ( ) const [inline, private]

Definition at line 154 of file TkStripMeasurementDet.h.

References index(), theDets(), and StMeasurementDetSet::totalStrips().

Referenced by testStrips().

{ return theDets().totalStrips(index()); }
void TkStripMeasurementDet::update ( const detset detSet) [inline]
void TkStripMeasurementDet::update ( std::vector< SiStripCluster >::const_iterator  begin,
std::vector< SiStripCluster >::const_iterator  end 
) [inline]

Definition at line 47 of file TkStripMeasurementDet.h.

References index(), theDets(), and StMeasurementDetSet::update().

                                                                                                            { 
    theDets().update(index(), begin, end);
  }

Member Data Documentation

Definition at line 140 of file TkStripMeasurementDet.h.

Referenced by index(), and setIndex().

Definition at line 139 of file TkStripMeasurementDet.h.

Referenced by theDets().