CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TkStripMeasurementDet.h
Go to the documentation of this file.
1 #ifndef TkStripMeasurementDet_H
2 #define TkStripMeasurementDet_H
3 
5 #include "TkMeasurementDetSet.h"
17 
19 
21 
23 public:
24 
27 
29 
31 
34 
35  typedef std::vector<SiStripCluster>::const_iterator const_iterator;
36 
38 
40 
41 
42  void setIndex(int i) { index_=i;}
43 
44  void update( const detset &detSet ) {
45  theDets().update(index(),detSet);
46  }
47  void update( std::vector<SiStripCluster>::const_iterator begin ,std::vector<SiStripCluster>::const_iterator end ) {
48  theDets().update(index(), begin, end);
49  }
50 
51  bool isRegional() const { return theDets().isRegional();}
52 
53  void setEmpty(){ theDets().setEmpty(index()); }
54 
55  bool isEmpty() const {return theDets().empty(index());}
56 
57  int index() const { return index_;}
58 
59  unsigned int rawId() const { return theDets().id(index()); }
60  unsigned char subId() const { return theDets().subId(index());}
61 
62 
63  const detset & theSet() const {return theDets().detSet(index());}
64  const detset & detSet() const {return theDets().detSet(index());}
65  detset & detSet() { return theDets().detSet(index());}
66  unsigned int beginClusterI() const {return theDets().beginClusterI(index());}
67  unsigned int endClusterI() const {return theDets().endClusterI(index());}
68 
69  int size() const {return endClusterI() - beginClusterI() ; }
70 
71 
73  bool isActive() const { return theDets().isActive(index()); }
74 
75  //TO BE IMPLEMENTED
76  bool hasBadComponents( const TrajectoryStateOnSurface &tsos ) const {return false;}
77 
78 
79 
80  virtual RecHitContainer recHits( const TrajectoryStateOnSurface&) const;
81  void simpleRecHits( const TrajectoryStateOnSurface& ts, std::vector<SiStripRecHit2D> &result) const ;
82 
83  virtual std::vector<TrajectoryMeasurement>
84  fastMeasurements( const TrajectoryStateOnSurface& stateOnThisDet,
85  const TrajectoryStateOnSurface& startingState,
86  const Propagator&,
87  const MeasurementEstimator&) const;
88 
89  const StripGeomDetUnit& specificGeomDet() const {return static_cast<StripGeomDetUnit const &>(fastGeomDet());}
90 
92  buildRecHit( const SiStripClusterRef&, const TrajectoryStateOnSurface& ltp) const;
93 
96 
97 
99  buildRecHits( const SiStripClusterRef&, const TrajectoryStateOnSurface& ltp) const;
100 
103 
104 
107  void setActive(bool active) { theDets().setActive(index(),active);}
110  void setActiveThisEvent(bool active) { theDets().setActiveThisEvent(index(),active); }
111 
113  bool hasAllGoodChannels() const { return (!hasAny128StripBad()) && badStripBlocks().empty(); }
114 
116  void set128StripStatus(bool good, int idx=-1) {
117  theDets().set128StripStatus(index(),good,idx);
118  }
119 
121 
123  bool testStrips(float utraj, float uerr) const;
124 
126 
127  std::vector<BadStripBlock> & getBadStripBlocks() { return theDets().getBadStripBlocks(index()); }
128  std::vector<BadStripBlock> const & badStripBlocks() const { return theDets().badStripBlocks(index()); }
129 
131 
132 
133 
134 private:
135 
137  StMeasurementDetSet & theDets() const { return *theDets_;}
138 
140  int index_;
141 
142 
143 
146 
147  const StripClusterParameterEstimator* cpe() const { return theDets().stripCPE(); }
148 
149 
150  const std::vector<bool> & skipClusters() const { return theDets().clusterToSkip();}
151 
152  // --- regional unpacking
153 
154  int totalStrips() const { return theDets().totalStrips(index()); }
155  BadStripCuts const & badStripCuts() const { return theDets().badStripCuts(index());}
156 
157  bool hasAny128StripBad() const { return theDets().hasAny128StripBad(index()); }
158 
159 
160 
161 
162  inline bool isMasked(const SiStripCluster &cluster) const {
163  return theDets().isMasked(index(), cluster);
164  }
165 
166  template<class ClusterRefT>
167  void buildSimpleRecHit( const ClusterRefT& cluster,
168  const TrajectoryStateOnSurface& ltp,
169  std::vector<SiStripRecHit2D>& res) const;
170 
171 
172 
173 public:
174  inline bool accept(SiStripClusterRef & r) const {
175  if(skipClusters().empty()) return true;
176  if (r.key()>=skipClusters().size()){
177  edm::LogError("WrongStripMasking")<<r.key()<<" is larger than: "<<skipClusters().size()<<" no skipping done";
178  return true;
179  }
180  return (not (skipClusters()[r.key()]));
181  }
182  inline bool accept(SiStripRegionalClusterRef &r) const{
183  if(skipClusters().empty()) return true;
184  if (r.key()>=skipClusters().size()){
185  LogDebug("TkStripMeasurementDet")<<r.key()<<" is larger than: "<<skipClusters().size()
186  <<"\n This must be a new cluster, and therefore should not be skiped most likely.";
187  return true;
188  }
189  return (not (skipClusters()[r.key()]));
190  }
191 
192 };
193 
194 #endif
#define LogDebug(id)
StMeasurementDetSet::BadStripCuts BadStripCuts
void update(const detset &detSet)
int i
Definition: DBlmapReader.cc:9
TkStripMeasurementDet(const GeomDet *gdet, StMeasurementDetSet &dets)
const std::vector< bool > & skipClusters() const
StripDetset & detSet(int i)
void buildSimpleRecHit(const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp, std::vector< SiStripRecHit2D > &res) const
edmNew::DetSet< SiStripCluster > detset
edm::Handle< edmNew::DetSetVector< SiStripCluster > > const & handle() const
StripClusterParameterEstimator::VLocalValues VLocalValues
unsigned char subId() const
StripClusterParameterEstimator::LocalValues LocalValues
bool accept(SiStripRegionalClusterRef &r) const
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
std::vector< BadStripBlock > & getBadStripBlocks(int i)
edm::Handle< edm::LazyGetter< SiStripCluster > > & regionalHandle()
void update(int i, const StripDetset &detSet)
std::vector< bool > & clusterToSkip() const
bool isMasked(int i, const SiStripCluster &cluster) const
BadStripCuts const & badStripCuts() const
data_type const * const_iterator
Definition: DetSetNew.h:25
StMeasurementDetSet * theDets_
StMeasurementDetSet & theDets()
StMeasurementDetSet::BadStripBlock BadStripBlock
void set128StripStatus(int i, bool good, int idx=-1)
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &) const
TransientTrackingRecHit::RecHitPointer buildRecHit(const SiStripClusterRef &, const TrajectoryStateOnSurface &ltp) const
std::pair< LocalPoint, LocalError > LocalValues
bool isMasked(const SiStripCluster &cluster) const
const StripClusterParameterEstimator * stripCPE() const
unsigned int id(int i) const
const GeomDet & fastGeomDet() const
unsigned int beginClusterI() const
edm::Handle< edm::LazyGetter< SiStripCluster > > const & regionalHandle() const
unsigned int endClusterI() const
virtual std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &startingState, const Propagator &, const MeasurementEstimator &) const
void setActiveThisEvent(int i, bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
unsigned int endClusterI(int i) const
std::vector< BadStripBlock > const & badStripBlocks() const
tuple result
Definition: query.py:137
unsigned int beginClusterI(int i) const
const detset & theSet() const
TkStripMeasurementDet::RecHitContainer buildRecHits(const SiStripClusterRef &, const TrajectoryStateOnSurface &ltp) const
#define end
Definition: vmac.h:38
void update(std::vector< SiStripCluster >::const_iterator begin, std::vector< SiStripCluster >::const_iterator end)
bool hasAllGoodChannels() const
does this module have at least one bad strip, APV or channel?
bool accept(SiStripClusterRef &r) const
edm::LazyGetter< SiStripCluster >::value_ref SiStripRegionalClusterRef
std::vector< SiStripCluster >::const_iterator const_iterator
void setActiveThisEvent(bool active)
Turn on/off the module for reconstruction for one events. This per-event flag is cleared by any call ...
std::vector< BadStripBlock > & getBadStripBlocks()
void set128StripStatus(bool good, int idx=-1)
Sets the status of a block of 128 strips (or all blocks if idx=-1)
bool maskBad128StripBlocks() const
unsigned char subId(int i) const
key_type key() const
Accessor for product key.
Definition: Ref.h:266
const StripGeomDetUnit & specificGeomDet() const
const detset & detSet() const
bool isActive(int i) const
int totalStrips(int i) const
const StripClusterParameterEstimator * cpe() const
std::vector< BadStripBlock > const & badStripBlocks(int i) const
bool empty(int i) const
void setActive(int i, bool active)
Turn on/off the module for reconstruction, for the full run or lumi (using info from DB...
SiStripRecHit2D::ClusterRef SiStripClusterRef
#define begin
Definition: vmac.h:31
void setActive(bool active)
Turn on/off the module for reconstruction, for the full run or lumi (using info from DB...
void simpleRecHits(const TrajectoryStateOnSurface &ts, std::vector< SiStripRecHit2D > &result) const
detset::const_iterator new_const_iterator
bool testStrips(float utraj, float uerr) const
return true if there are &#39;enough&#39; good strips in the utraj +/- 3 uerr range.
bool isActive() const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
unsigned int rawId() const
StMeasurementDetSet & theDets() const
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
BadStripCuts & badStripCuts(int i)
bool hasAny128StripBad(int i) const
bool hasBadComponents(const TrajectoryStateOnSurface &tsos) const