CMS 3D CMS Logo

Classes | 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.

Classes

struct  BadStripBlock
struct  BadStripCuts

Public Types

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

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
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
bool isActive () const
 Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'.
bool isEmpty ()
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 setBadStripCuts (BadStripCuts cuts)
void setEmpty ()
void setMaskBad128StripBlocks (bool maskThem)
void simpleRecHits (const TrajectoryStateOnSurface &ts, std::vector< SiStripRecHit2D > &result) const
int size ()
const StripGeomDetUnitspecificGeomDet () const
bool testStrips (float utraj, float uerr) const
 return true if there are 'enough' good strips in the utraj +/- 3 uerr range.
const detsettheSet ()
 TkStripMeasurementDet (const GeomDet *gdet, const StripClusterParameterEstimator *cpe, bool regional)
void update (std::vector< SiStripCluster >::const_iterator begin, std::vector< SiStripCluster >::const_iterator end, const edm::Handle< edm::LazyGetter< SiStripCluster > > h, unsigned int id)
void update (const detset &detSet, const edm::Handle< edmNew::DetSetVector< SiStripCluster > > h, unsigned int id)
virtual ~TkStripMeasurementDet ()

Private Member Functions

template<class ClusterRefT >
void buildSimpleRecHit (const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp, std::vector< SiStripRecHit2D > &res) const
bool isMasked (const SiStripCluster &cluster) const

Private Attributes

bool activeThisEvent_
bool activeThisPeriod_
bool bad128Strip_ [6]
std::vector< BadStripBlockbadStripBlocks_
BadStripCuts badStripCuts_
std::vector< SiStripCluster >
::const_iterator 
beginCluster
detset detSet_
bool empty
std::vector< SiStripCluster >
::const_iterator 
endCluster
edm::Handle
< edmNew::DetSetVector
< SiStripCluster > > 
handle_
bool hasAny128StripBad_
unsigned int id_
bool isRegional
bool maskBad128StripBlocks_
edm::Handle< edm::LazyGetter
< SiStripCluster > > 
regionalHandle_
const
StripClusterParameterEstimator
theCPE
const StripGeomDetUnittheStripGDU
int totalStrips_

Detailed Description

Definition at line 21 of file TkStripMeasurementDet.h.


Member Typedef Documentation

Definition at line 36 of file TkStripMeasurementDet.h.

Definition at line 33 of file TkStripMeasurementDet.h.

Definition at line 26 of file TkStripMeasurementDet.h.

Definition at line 34 of file TkStripMeasurementDet.h.

Definition at line 29 of file TkStripMeasurementDet.h.

Definition at line 31 of file TkStripMeasurementDet.h.

Definition at line 27 of file TkStripMeasurementDet.h.


Constructor & Destructor Documentation

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

Definition at line 38 of file TkStripMeasurementDet.h.

{}
TkStripMeasurementDet::TkStripMeasurementDet ( const GeomDet gdet,
const StripClusterParameterEstimator cpe,
bool  regional 
)

Definition at line 17 of file TkStripMeasurementDet.cc.

References GeomDet::geographicalId(), id_, StripTopology::nstrips(), DetId::rawId(), specificGeomDet(), StripGeomDetUnit::specificTopology(), theStripGDU, and totalStrips_.

                                                             : 
    MeasurementDet (gdet),
    isRegional(regional),
    empty(true),
    activeThisEvent_(true), activeThisPeriod_(true),
    theCPE(cpe)
  {
    theStripGDU = dynamic_cast<const StripGeomDetUnit*>(gdet);
    if (theStripGDU == 0) {
      throw MeasurementDetException( "TkStripMeasurementDet constructed with a GeomDet which is not a StripGeomDetUnit");
    }

    //intialize the detId !
    id_ = gdet->geographicalId().rawId();
    //initalize the total number of strips
    totalStrips_ =  specificGeomDet().specificTopology().nstrips();
  }

Member Function Documentation

TransientTrackingRecHit::RecHitPointer TkStripMeasurementDet::buildRecHit ( const SiStripClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const

Definition at line 192 of file TkStripMeasurementDet.cc.

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

Referenced by recHits().

{
  const GeomDetUnit& gdu( specificGeomDet());
  LocalValues lv = theCPE->localParameters( *cluster, gdu, ltp);
  return TSiStripRecHit2DLocalPos::build( lv.first, lv.second, &geomDet(), cluster, theCPE);
}
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 212 of file TkStripMeasurementDet.cc.

References TSiStripRecHit2DLocalPos::build(), MeasurementDet::geomDet(), ClusterParameterEstimator< T >::localParametersV(), specificGeomDet(), and theCPE.

Referenced by fastMeasurements().

{
  const GeomDetUnit& gdu( specificGeomDet());
  VLocalValues vlv = theCPE->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, &geomDet(), cluster, theCPE));
  }
  return res; 
}
TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::buildRecHits ( const SiStripRegionalClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const

Definition at line 226 of file TkStripMeasurementDet.cc.

References TSiStripRecHit2DLocalPos::build(), MeasurementDet::geomDet(), ClusterParameterEstimator< T >::localParametersV(), specificGeomDet(), and theCPE.

{
  const GeomDetUnit& gdu( specificGeomDet());
  VLocalValues vlv = theCPE->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, &geomDet(), cluster, theCPE));
  }
  return res; 
}
template<class ClusterRefT >
void TkStripMeasurementDet::buildSimpleRecHit ( const ClusterRefT &  cluster,
const TrajectoryStateOnSurface ltp,
std::vector< SiStripRecHit2D > &  res 
) const [private]

Definition at line 269 of file TkStripMeasurementDet.cc.

References MeasurementDet::geomDet(), ClusterParameterEstimator< T >::localParametersV(), specificGeomDet(), and theCPE.

Referenced by simpleRecHits().

{
  const GeomDetUnit& gdu( specificGeomDet());
  VLocalValues vlv = theCPE->localParametersV( *cluster, gdu, ltp);
  for(VLocalValues::const_iterator it=vlv.begin();it!=vlv.end();++it){
    res.push_back(SiStripRecHit2D( it->first, it->second, geomDet().geographicalId(), cluster));
  }
}
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 39 of file TkStripMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), beginCluster, InvalidTransientRecHit::build(), buildRecHits(), detSet_, empty, edmNew::DetSet< T >::end(), endCluster, MeasurementEstimator::estimate(), MeasurementDet::geomDet(), handle_, TrajectoryStateOnSurface::hasError(), TrackingRecHit::inactive, isActive(), isMasked(), isRegional, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), edm::makeRefTo(), edm::makeRefToLazyGetter(), Topology::measurementError(), Topology::measurementPosition(), TrackingRecHit::missing, LocalTrajectoryError::positionError(), recHits(), regionalHandle_, query::result, python::multivaluedict::sort(), StripGeomDetUnit::specificTopology(), mathSSE::sqrt(), testStrips(), theStripGDU, and ExpressReco_HICollisions_FallBack::x.

{ 
  std::vector<TrajectoryMeasurement> result;

  if (isActive() == false) {
    result.push_back( TrajectoryMeasurement( stateOnThisDet, 
                InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::inactive), 
                0.F));
    //    LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " inactive";
    return result;
  }
 
  float utraj =  theStripGDU->specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
  float uerr;
  //  if (theClusterRange.first == theClusterRange.second) { // empty
  if (empty  == true){
    //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty ";
    if (stateOnThisDet.hasError()){
    uerr= sqrt(theStripGDU->specificTopology().measurementError(stateOnThisDet.localPosition(),stateOnThisDet.localError().positionError()).uu());
     if (testStrips(utraj,uerr)) {
        result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::missing), 0.F));
     } else { 
        result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::inactive), 0.F));
     }
    }else{
      result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::missing), 0.F));
    }
    return result;
  }
  
  if(!isRegional){//old implemetation with DetSet
    new_const_iterator 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 ); 
        //TransientTrackingRecHit::RecHitPointer recHit = buildRecHit(clusterref, 
        //                                                          stateOnThisDet);
        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
      }
    }
    
    for ( ; rightCluster != detSet_.end(); rightCluster++) {
      if (isMasked(*rightCluster)) continue;
      SiStripClusterRef clusterref = edmNew::makeRefTo( handle_, rightCluster ); 
      //TransientTrackingRecHit::RecHitPointer recHit = buildRecHit( clusterref, 
      //                                                                   stateOnThisDet);
      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
    }
  }// end block with DetSet
  else{
    const_iterator rightCluster = 
      std::find_if( beginCluster, endCluster, StripClusterAboveU( utraj));

    if ( rightCluster != beginCluster) {
      // there are hits on the left of the utraj
      const_iterator leftCluster = rightCluster;
      while ( --leftCluster >=  beginCluster) {
        if (isMasked(*leftCluster)) continue;
        //      TransientTrackingRecHit* recHit = buildRecHit( *leftCluster, 
        //std::cout << "=====making ref in fastMeas left " << std::endl;
        SiStripRegionalClusterRef clusterref = edm::makeRefToLazyGetter(regionalHandle_,leftCluster-regionalHandle_->begin_record());
        //TransientTrackingRecHit::RecHitPointer recHit = buildRecHit(clusterref, 
        //                                                          stateOnThisDet);
        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
      }
    }
    
    for ( ; rightCluster != endCluster; rightCluster++) {
      if (isMasked(*rightCluster)) continue;
      //std::cout << "=====making ref in fastMeas rigth " << std::endl;
      SiStripRegionalClusterRef clusterref = edm::makeRefToLazyGetter(regionalHandle_,rightCluster-regionalHandle_->begin_record());
      //TransientTrackingRecHit::RecHitPointer recHit = buildRecHit( clusterref, 
      //                                                                   stateOnThisDet);
      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
    }
  }


  if ( result.empty()) {
    // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
    if (stateOnThisDet.hasError()){
    uerr= sqrt(theStripGDU->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(&geomDet(), TrackingRecHit::missing), 0.F));
     } else { 
       //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, and inactive ";
       result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::inactive), 0.F));
     }
    }else{
      result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::missing), 0.F));
    }
  }
  else {
    //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " full: " << (result.size()) << " compatible hits";
    // sort results according to estimator value
    if ( result.size() > 1) {
      sort( result.begin(), result.end(), TrajMeasLessEstim());
    }
  }
  return result;
}
std::vector<BadStripBlock>& TkStripMeasurementDet::getBadStripBlocks ( ) [inline]

Definition at line 139 of file TkStripMeasurementDet.h.

References badStripBlocks_.

{ return badStripBlocks_; }
bool TkStripMeasurementDet::hasAllGoodChannels ( ) const [inline]

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

Definition at line 116 of file TkStripMeasurementDet.h.

References badStripBlocks_, and hasAny128StripBad_.

Referenced by TkGluedMeasurementDet::fastMeasurements().

{ return !hasAny128StripBad_ && badStripBlocks_.empty(); }
bool TkStripMeasurementDet::hasBadComponents ( const TrajectoryStateOnSurface tsos) const [inline, virtual]

Implements MeasurementDet.

Definition at line 70 of file TkStripMeasurementDet.h.

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

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

Implements MeasurementDet.

Definition at line 67 of file TkStripMeasurementDet.h.

References activeThisEvent_, and activeThisPeriod_.

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

bool TkStripMeasurementDet::isEmpty ( void  ) [inline]

Definition at line 100 of file TkStripMeasurementDet.h.

References empty.

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

Definition at line 176 of file TkStripMeasurementDet.h.

References SiStripCluster::amplitudes(), bad128Strip_, SiStripCluster::barycenter(), and SiStripCluster::firstStrip().

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

                                                            {
      if ( bad128Strip_[cluster.firstStrip() >> 7] ) {
          if ( bad128Strip_[(cluster.firstStrip()+cluster.amplitudes().size())  >> 7] ||
               bad128Strip_[static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7] ) {
              return true;
          }
      } else {
          if ( bad128Strip_[(cluster.firstStrip()+cluster.amplitudes().size())  >> 7] &&
               bad128Strip_[static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7] ) {
              return true;
          }
      }
      return false;
  }
unsigned int TkStripMeasurementDet::rawId ( ) const [inline]

Definition at line 102 of file TkStripMeasurementDet.h.

References id_.

{ return id_; }
TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::recHits ( const TrajectoryStateOnSurface ts) const [virtual]

Implements MeasurementDet.

Definition at line 241 of file TkStripMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), beginCluster, buildRecHit(), detSet_, empty, edmNew::DetSet< T >::end(), endCluster, handle_, isActive(), isMasked(), isRegional, edm::makeRefTo(), edm::makeRefToLazyGetter(), regionalHandle_, query::result, and edmNew::DetSet< T >::size().

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

{
  RecHitContainer result;
  if (empty == 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 ); 
      result.push_back( buildRecHit( cluster, ts));
    }
  }else{
    result.reserve(endCluster - beginCluster);
    for (const_iterator ci = beginCluster ; ci != endCluster; ci++) {      
      if (isMasked(*ci)) continue;
      SiStripRegionalClusterRef clusterRef = edm::makeRefToLazyGetter(regionalHandle_,ci-regionalHandle_->begin_record());     
      result.push_back( buildRecHit( clusterRef, ts));
    }
  }
  return result;

}
void TkStripMeasurementDet::set128StripStatus ( bool  good,
int  idx = -1 
)

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

Definition at line 306 of file TkStripMeasurementDet.cc.

References bad128Strip_, hasAny128StripBad_, and i.

                                                           { 
   if (idx == -1) {
       std::fill(bad128Strip_, bad128Strip_+6, !good);
       hasAny128StripBad_ = !good;
   } else {
       bad128Strip_[idx] = !good;
       if (good == false) {
            hasAny128StripBad_ = false;
       } else { // this should not happen, as usually you turn on all fibers
                // and then turn off the bad ones, and not vice-versa,
                // so I don't care if it's not optimized
            hasAny128StripBad_ = true;
            for (int i = 0; i < (totalStrips_ >> 7); i++) {
                if (bad128Strip_[i] == false) hasAny128StripBad_ = false;
            }
       }    
   }
    
}
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 110 of file TkStripMeasurementDet.h.

References activeThisEvent_, activeThisPeriod_, and empty.

{ activeThisPeriod_ = active; activeThisEvent_ = true; if (!active) empty = true; }
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 113 of file TkStripMeasurementDet.h.

References activeThisEvent_, and empty.

{ activeThisEvent_ = active;  if (!active) empty = true; }
void TkStripMeasurementDet::setBadStripCuts ( BadStripCuts  cuts) [inline]

Definition at line 132 of file TkStripMeasurementDet.h.

References badStripCuts_.

{ badStripCuts_ = cuts; }
void TkStripMeasurementDet::setEmpty ( ) [inline]

Definition at line 73 of file TkStripMeasurementDet.h.

References activeThisEvent_, and empty.

Referenced by OnDemandMeasurementTracker::assign().

{empty = true; activeThisEvent_ = true; }
void TkStripMeasurementDet::setMaskBad128StripBlocks ( bool  maskThem) [inline]

Definition at line 141 of file TkStripMeasurementDet.h.

References maskBad128StripBlocks_.

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

Definition at line 282 of file TkStripMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), beginCluster, buildSimpleRecHit(), detSet_, empty, edmNew::DetSet< T >::end(), endCluster, handle_, isActive(), isMasked(), isRegional, edm::makeRefTo(), edm::makeRefToLazyGetter(), regionalHandle_, and edmNew::DetSet< T >::size().

Referenced by TkGluedMeasurementDet::collectRecHits().

{
  if (empty || !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 ); 
      buildSimpleRecHit( cluster, ts,result);
    }
  }else{
    result.reserve(endCluster - beginCluster);
    for (const_iterator ci = beginCluster ; ci != endCluster; ci++) {      
      if (isMasked(*ci)) continue;
      SiStripRegionalClusterRef clusterRef = edm::makeRefToLazyGetter(regionalHandle_,ci-regionalHandle_->begin_record());     
      buildSimpleRecHit( clusterRef, ts,result);
    }
  }
}
int TkStripMeasurementDet::size ( void  ) [inline]

Definition at line 106 of file TkStripMeasurementDet.h.

References beginCluster, and endCluster.

{return endCluster - beginCluster ; }
const StripGeomDetUnit& TkStripMeasurementDet::specificGeomDet ( ) const [inline]
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 327 of file TkStripMeasurementDet.cc.

References cond::ecalcond::bad(), badStripBlocks_, badStripCuts_, end, max(), TkStripMeasurementDet::BadStripCuts::maxBad, TkStripMeasurementDet::BadStripCuts::maxConsecutiveBad, min, convertSQLiteXML::ok, and totalStrips_.

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

                                                               {
    int16_t start = (int16_t) std::max<float>(utraj - 3*uerr, 0);
    int16_t end   = (int16_t) std::min<float>(utraj + 3*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;
    BSBIT bsbc = badStripBlocks_.begin(), bsbe = badStripBlocks_.end();

    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;
}
const detset& TkStripMeasurementDet::theSet ( ) [inline]

Definition at line 105 of file TkStripMeasurementDet.h.

References detSet_.

{return detSet_;}
void TkStripMeasurementDet::update ( const detset detSet,
const edm::Handle< edmNew::DetSetVector< SiStripCluster > >  h,
unsigned int  id 
) [inline]
void TkStripMeasurementDet::update ( std::vector< SiStripCluster >::const_iterator  begin,
std::vector< SiStripCluster >::const_iterator  end,
const edm::Handle< edm::LazyGetter< SiStripCluster > >  h,
unsigned int  id 
) [inline]

Member Data Documentation

Definition at line 149 of file TkStripMeasurementDet.h.

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

Definition at line 149 of file TkStripMeasurementDet.h.

Referenced by isActive(), and setActive().

Definition at line 162 of file TkStripMeasurementDet.h.

Referenced by isMasked(), and set128StripStatus().

Definition at line 165 of file TkStripMeasurementDet.h.

Referenced by getBadStripBlocks(), hasAllGoodChannels(), and testStrips().

Definition at line 167 of file TkStripMeasurementDet.h.

Referenced by setBadStripCuts(), and testStrips().

Definition at line 172 of file TkStripMeasurementDet.h.

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

Definition at line 153 of file TkStripMeasurementDet.h.

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

Definition at line 173 of file TkStripMeasurementDet.h.

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

Definition at line 154 of file TkStripMeasurementDet.h.

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

Definition at line 163 of file TkStripMeasurementDet.h.

Referenced by hasAllGoodChannels(), and set128StripStatus().

unsigned int TkStripMeasurementDet::id_ [private]

Definition at line 151 of file TkStripMeasurementDet.h.

Referenced by rawId(), TkStripMeasurementDet(), and update().

Definition at line 145 of file TkStripMeasurementDet.h.

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

Definition at line 163 of file TkStripMeasurementDet.h.

Referenced by setMaskBad128StripBlocks().

Definition at line 171 of file TkStripMeasurementDet.h.

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

Definition at line 158 of file TkStripMeasurementDet.h.

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

Definition at line 166 of file TkStripMeasurementDet.h.

Referenced by testStrips(), and TkStripMeasurementDet().