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 
16 
18 
20 
22 public:
23 
24  // typedef SiStripClusterCollection::Range ClusterRange;
25  // typedef SiStripClusterCollection::ContainerIterator ClusterIterator;
28 
30 
32 
35 
36  typedef std::vector<SiStripCluster>::const_iterator const_iterator;
37 
39 
40  TkStripMeasurementDet( const GeomDet* gdet,
42  bool regional);
43 
44  void update( const detset &detSet,
46  unsigned int id ) {
47  detSet_ = detSet;
48  handle_ = h;
49  id_ = id;
50  empty = false;
51  isRegional = false;
52  }
53 
54  void update( std::vector<SiStripCluster>::const_iterator begin ,std::vector<SiStripCluster>::const_iterator end,
56  unsigned int id ) {
58  endCluster = end;
60  id_ = id;
61  empty = false;
62  activeThisEvent_ = true;
63  isRegional = true;
64  }
65 
67  bool isActive() const { return activeThisEvent_ && activeThisPeriod_; }
68 
69  //TO BE IMPLEMENTED
70  bool hasBadComponents( const TrajectoryStateOnSurface &tsos ) const {return false;}
71 
72 
73  void setEmpty(){empty = true; activeThisEvent_ = true; }
74 
75  virtual RecHitContainer recHits( const TrajectoryStateOnSurface&) const;
76  void simpleRecHits( const TrajectoryStateOnSurface& ts, std::vector<SiStripRecHit2D> &result) const ;
77 
78  virtual std::vector<TrajectoryMeasurement>
79  fastMeasurements( const TrajectoryStateOnSurface& stateOnThisDet,
80  const TrajectoryStateOnSurface& startingState,
81  const Propagator&,
82  const MeasurementEstimator&) const;
83 
84  const StripGeomDetUnit& specificGeomDet() const {return *theStripGDU;}
85 
87  buildRecHit( const SiStripClusterRef&, const TrajectoryStateOnSurface& ltp) const;
88 
91 
92 
94  buildRecHits( const SiStripClusterRef&, const TrajectoryStateOnSurface& ltp) const;
95 
98 
99 
100  bool isEmpty() {return empty;}
101 
102  unsigned int rawId() const { return id_; }
103 
104 
105  const detset& theSet() {return detSet_;}
106  int size() {return endCluster - beginCluster ; }
107 
110  void setActive(bool active) { activeThisPeriod_ = active; activeThisEvent_ = true; if (!active) empty = true; }
113  void setActiveThisEvent(bool active) { activeThisEvent_ = active; if (!active) empty = true; }
114 
116  bool hasAllGoodChannels() const { return !hasAny128StripBad_ && badStripBlocks_.empty(); }
117 
119  void set128StripStatus(bool good, int idx=-1);
120 
121  struct BadStripCuts {
124  maxBad(pset.getParameter<uint32_t>("maxBad")),
125  maxConsecutiveBad(pset.getParameter<uint32_t>("maxConsecutiveBad")) {}
127  };
128 
130  bool testStrips(float utraj, float uerr) const;
131 
133 
134  struct BadStripBlock {
135  short first;
136  short last;
137  BadStripBlock(const SiStripBadStrip::data &data) : first(data.firstStrip), last(data.firstStrip+data.range-1) { }
138  };
139  std::vector<BadStripBlock> &getBadStripBlocks() { return badStripBlocks_; }
140 
141  void setMaskBad128StripBlocks(bool maskThem) { maskBad128StripBlocks_ = maskThem; }
142 
143 private:
144 
146 
147  bool empty;
148 
150 
151  unsigned int id_;
152 
155 
156 
159 
160 
161 
162  bool bad128Strip_[6];
164 
165  std::vector<BadStripBlock> badStripBlocks_;
168 
169 
170  // --- regional unpacking
172  std::vector<SiStripCluster>::const_iterator beginCluster;
173  std::vector<SiStripCluster>::const_iterator endCluster;
174  // regional unpacking ---
175 
176  inline bool isMasked(const SiStripCluster &cluster) const {
177  if ( bad128Strip_[cluster.firstStrip() >> 7] ) {
178  if ( bad128Strip_[(cluster.firstStrip()+cluster.amplitudes().size()) >> 7] ||
179  bad128Strip_[static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7] ) {
180  return true;
181  }
182  } else {
183  if ( bad128Strip_[(cluster.firstStrip()+cluster.amplitudes().size()) >> 7] &&
184  bad128Strip_[static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7] ) {
185  return true;
186  }
187  }
188  return false;
189  }
190 
191  template<class ClusterRefT>
192  void buildSimpleRecHit( const ClusterRefT& cluster,
193  const TrajectoryStateOnSurface& ltp,
194  std::vector<SiStripRecHit2D>& res) const;
195 
196 };
197 
198 #endif
void buildSimpleRecHit(const ClusterRefT &cluster, const TrajectoryStateOnSurface &ltp, std::vector< SiStripRecHit2D > &res) const
const StripClusterParameterEstimator * theCPE
edmNew::DetSet< SiStripCluster > detset
StripClusterParameterEstimator::VLocalValues VLocalValues
StripClusterParameterEstimator::LocalValues LocalValues
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
BadStripCuts(const edm::ParameterSet &pset)
uint16_t firstStrip() const
data_type const * const_iterator
Definition: DetSetNew.h:25
void update(std::vector< SiStripCluster >::const_iterator begin, std::vector< SiStripCluster >::const_iterator end, const edm::Handle< edm::LazyGetter< SiStripCluster > > h, unsigned int id)
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &) const
TransientTrackingRecHit::RecHitPointer buildRecHit(const SiStripClusterRef &, const TrajectoryStateOnSurface &ltp) const
std::pair< LocalPoint, LocalError > LocalValues
std::vector< SiStripCluster >::const_iterator beginCluster
bool isMasked(const SiStripCluster &cluster) const
std::vector< SiStripCluster >::const_iterator endCluster
virtual std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &startingState, const Propagator &, const MeasurementEstimator &) const
BadStripBlock(const SiStripBadStrip::data &data)
tuple result
Definition: query.py:137
void setBadStripCuts(BadStripCuts cuts)
TkStripMeasurementDet::RecHitContainer buildRecHits(const SiStripClusterRef &, const TrajectoryStateOnSurface &ltp) const
float barycenter() const
tuple pset
Definition: CrabTask.py:85
#define end
Definition: vmac.h:38
bool hasAllGoodChannels() const
does this module have at least one bad strip, APV or channel?
edm::LazyGetter< SiStripCluster >::value_ref SiStripRegionalClusterRef
TkStripMeasurementDet(const GeomDet *gdet, const StripClusterParameterEstimator *cpe, bool regional)
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 update(const detset &detSet, const edm::Handle< edmNew::DetSetVector< SiStripCluster > > h, unsigned int id)
void set128StripStatus(bool good, int idx=-1)
Sets the status of a block of 128 strips (or all blocks if idx=-1)
std::vector< BadStripBlock > badStripBlocks_
void setMaskBad128StripBlocks(bool maskThem)
edm::Handle< edmNew::DetSetVector< SiStripCluster > > handle_
const StripGeomDetUnit & specificGeomDet() const
const StripGeomDetUnit * theStripGDU
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
edm::Handle< edm::LazyGetter< SiStripCluster > > regionalHandle_
const std::vector< uint8_t > & amplitudes() const
bool hasBadComponents(const TrajectoryStateOnSurface &tsos) const