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

bool accept (SiStripClusterRef &r) const
bool accept (SiStripRegionalClusterRef &r) 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
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)
template<typename IT >
void setClusterToSkip (IT begin, IT end)
void setEmpty ()
void setMaskBad128StripBlocks (bool maskThem)
template<typename IT >
void setRegionalClustersToSkip (IT begin, IT end)
void simpleRecHits (const TrajectoryStateOnSurface &ts, std::vector< SiStripRecHit2D > &result) const
int size () const
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 unset ()
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_
unsigned int beginClusterI_
detset detSet_
bool empty
unsigned int endClusterI_
edm::Handle
< edmNew::DetSetVector
< SiStripCluster > > 
handle_
bool hasAny128StripBad_
unsigned int id_
bool isRegional
bool maskBad128StripBlocks_
edm::Handle< edm::LazyGetter
< SiStripCluster > > 
regionalHandle_
std::set< SiStripClusterRefskipClusters_
std::set
< SiStripRegionalClusterRef
skipRegClusters_
const
StripClusterParameterEstimator
theCPE
const StripGeomDetUnittheStripGDU
int totalStrips_

Detailed Description

Definition at line 21 of file TkStripMeasurementDet.h.


Member Typedef Documentation

Definition at line 34 of file TkStripMeasurementDet.h.

Definition at line 31 of file TkStripMeasurementDet.h.

Definition at line 24 of file TkStripMeasurementDet.h.

Definition at line 32 of file TkStripMeasurementDet.h.

Definition at line 27 of file TkStripMeasurementDet.h.

Definition at line 29 of file TkStripMeasurementDet.h.

Definition at line 25 of file TkStripMeasurementDet.h.


Constructor & Destructor Documentation

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

Definition at line 36 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

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

Definition at line 198 of file TkStripMeasurementDet.h.

References skipClusters_.

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

                                                  {
    return (skipClusters_.find(r) == skipClusters_.end());
  }
bool TkStripMeasurementDet::accept ( SiStripRegionalClusterRef r) const [inline]

Definition at line 201 of file TkStripMeasurementDet.h.

References skipRegClusters_.

                                                        {
    return (skipRegClusters_.find(r) == skipRegClusters_.end());
  }
TransientTrackingRecHit::RecHitPointer TkStripMeasurementDet::buildRecHit ( const SiStripRegionalClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const
TransientTrackingRecHit::RecHitPointer TkStripMeasurementDet::buildRecHit ( const SiStripClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const

Definition at line 197 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);
}
TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::buildRecHits ( const SiStripRegionalClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const

Definition at line 231 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; 
}
TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::buildRecHits ( const SiStripClusterRef cluster,
const TrajectoryStateOnSurface ltp 
) const

Definition at line 217 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; 
}
template<class ClusterRefT >
void TkStripMeasurementDet::buildSimpleRecHit ( const ClusterRefT &  cluster,
const TrajectoryStateOnSurface ltp,
std::vector< SiStripRecHit2D > &  res 
) const [private]

Definition at line 278 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 accept(), edmNew::DetSet< T >::begin(), beginClusterI_, InvalidTransientRecHit::build(), buildRecHits(), detSet_, empty, edmNew::DetSet< T >::end(), endClusterI_, MeasurementEstimator::estimate(), GeomDet::geographicalId(), MeasurementDet::geomDet(), handle_, TrajectoryStateOnSurface::hasError(), id_, TrackingRecHit::inactive, isActive(), isMasked(), isRegional, edm::Ref< C, T, F >::key(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LogDebug, edm::makeRefTo(), edm::makeRefToLazyGetter(), Topology::measurementError(), Topology::measurementPosition(), TrackingRecHit::missing, LocalTrajectoryError::positionError(), DetId::rawId(), recHits(), regionalHandle_, query::result, size(), python::multivaluedict::sort(), StripGeomDetUnit::specificTopology(), mathSSE::sqrt(), testStrips(), theStripGDU, and x.

{ 
  std::vector<TrajectoryMeasurement> result;

  if (isActive() == false) {
    LogDebug("TkStripMeasurementDet")<<" found an inactive module "<<id_;
    result.push_back( TrajectoryMeasurement( stateOnThisDet, 
                InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::inactive), 
                0.F));
    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 ); 
        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"<<geomDet().geographicalId().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"<<geomDet().geographicalId().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"<<geomDet().geographicalId().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"<<geomDet().geographicalId().rawId()<<" key: "<<clusterref.key();
    }
  }


  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 137 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 114 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 68 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 65 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 98 of file TkStripMeasurementDet.h.

References empty.

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

Definition at line 173 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 100 of file TkStripMeasurementDet.h.

References id_.

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

Implements MeasurementDet.

Definition at line 246 of file TkStripMeasurementDet.cc.

References accept(), edmNew::DetSet< T >::begin(), beginClusterI_, buildRecHit(), detSet_, empty, edmNew::DetSet< T >::end(), endClusterI_, GeomDet::geographicalId(), MeasurementDet::geomDet(), handle_, isActive(), isMasked(), isRegional, edm::Ref< C, T, F >::key(), LogDebug, edm::makeRefTo(), edm::makeRefToLazyGetter(), DetId::rawId(), regionalHandle_, query::result, edmNew::DetSet< T >::size(), and 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 ); 
      if (accept(cluster))
        result.push_back( buildRecHit( cluster, ts));
      else LogDebug("TkStripMeasurementDet")<<"skipping this str from last iteration on"<<geomDet().geographicalId().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"<<geomDet().geographicalId().rawId()<<" key: "<<clusterRef.key();
      }
  }
  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 319 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 108 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 111 of file TkStripMeasurementDet.h.

References activeThisEvent_, and empty.

Referenced by OnDemandMeasurementTracker::assign().

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

Definition at line 130 of file TkStripMeasurementDet.h.

References badStripCuts_, and hpstanc_transforms::cuts.

template<typename IT >
void TkStripMeasurementDet::setClusterToSkip ( IT  begin,
IT  end 
) [inline]

Definition at line 210 of file TkStripMeasurementDet.h.

References skipClusters_.

                                           {
    skipClusters_.clear();
    skipClusters_.insert(begin,end);
  }
void TkStripMeasurementDet::setEmpty ( ) [inline]

Definition at line 71 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 139 of file TkStripMeasurementDet.h.

References maskBad128StripBlocks_.

{ maskBad128StripBlocks_ = maskThem; }
template<typename IT >
void TkStripMeasurementDet::setRegionalClustersToSkip ( IT  begin,
IT  end 
) [inline]
void TkStripMeasurementDet::simpleRecHits ( const TrajectoryStateOnSurface ts,
std::vector< SiStripRecHit2D > &  result 
) const

Definition at line 291 of file TkStripMeasurementDet.cc.

References accept(), edmNew::DetSet< T >::begin(), beginClusterI_, buildSimpleRecHit(), detSet_, empty, edmNew::DetSet< T >::end(), endClusterI_, GeomDet::geographicalId(), MeasurementDet::geomDet(), handle_, isActive(), isMasked(), isRegional, edm::Ref< C, T, F >::key(), LogDebug, edm::makeRefTo(), edm::makeRefToLazyGetter(), DetId::rawId(), regionalHandle_, edmNew::DetSet< T >::size(), and 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 ); 
      if (accept(cluster))
        buildSimpleRecHit( cluster, ts,result);
      else LogDebug("TkStripMeasurementDet")<<"skipping this str from last iteration on"<<geomDet().geographicalId().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"<<geomDet().geographicalId().rawId()<<" key: "<<clusterRef.key();
    }
  }
}
int TkStripMeasurementDet::size ( void  ) const [inline]

Definition at line 104 of file TkStripMeasurementDet.h.

References beginClusterI_, and endClusterI_.

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

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 340 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;

    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 103 of file TkStripMeasurementDet.h.

References detSet_.

{return detSet_;}
void TkStripMeasurementDet::unset ( ) [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]

Definition at line 52 of file TkStripMeasurementDet.h.

References activeThisEvent_, beginClusterI_, empty, endClusterI_, h, id_, isRegional, and regionalHandle_.

                                 { 
    regionalHandle_ = h;
    beginClusterI_ = begin - regionalHandle_->begin_record();
    endClusterI_ = end - regionalHandle_->begin_record();
    id_ = id;
    empty = false;
    activeThisEvent_ = true;
    isRegional = true;
  }
void TkStripMeasurementDet::update ( const detset detSet,
const edm::Handle< edmNew::DetSetVector< SiStripCluster > >  h,
unsigned int  id 
) [inline]

Definition at line 42 of file TkStripMeasurementDet.h.

References detSet_, empty, h, handle_, id_, and isRegional.

Referenced by OnDemandMeasurementTracker::assign(), and MeasurementTrackerImpl::updateStrips().

                                 { 
    detSet_ = detSet; 
    handle_ = h;
    id_ = id;
    empty = false;
    isRegional = false;
  }

Member Data Documentation

Definition at line 147 of file TkStripMeasurementDet.h.

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

Definition at line 147 of file TkStripMeasurementDet.h.

Referenced by isActive(), and setActive().

Definition at line 160 of file TkStripMeasurementDet.h.

Referenced by isMasked(), and set128StripStatus().

Definition at line 163 of file TkStripMeasurementDet.h.

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

Definition at line 165 of file TkStripMeasurementDet.h.

Referenced by setBadStripCuts(), and testStrips().

unsigned int TkStripMeasurementDet::beginClusterI_ [private]

Definition at line 170 of file TkStripMeasurementDet.h.

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

Definition at line 151 of file TkStripMeasurementDet.h.

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

unsigned int TkStripMeasurementDet::endClusterI_ [private]

Definition at line 171 of file TkStripMeasurementDet.h.

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

Definition at line 152 of file TkStripMeasurementDet.h.

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

Definition at line 161 of file TkStripMeasurementDet.h.

Referenced by hasAllGoodChannels(), and set128StripStatus().

unsigned int TkStripMeasurementDet::id_ [private]

Definition at line 149 of file TkStripMeasurementDet.h.

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

Definition at line 143 of file TkStripMeasurementDet.h.

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

Definition at line 161 of file TkStripMeasurementDet.h.

Referenced by setMaskBad128StripBlocks().

Definition at line 169 of file TkStripMeasurementDet.h.

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

Definition at line 194 of file TkStripMeasurementDet.h.

Referenced by accept(), setClusterToSkip(), and unset().

Definition at line 195 of file TkStripMeasurementDet.h.

Referenced by accept(), setRegionalClustersToSkip(), and unset().

Definition at line 156 of file TkStripMeasurementDet.h.

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

Definition at line 164 of file TkStripMeasurementDet.h.

Referenced by testStrips(), and TkStripMeasurementDet().