CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StripClusterizerAlgorithm.h
Go to the documentation of this file.
1 #ifndef RecoLocalTracker_StripClusterizerAlgorithm_h
2 #define RecoLocalTracker_StripClusterizerAlgorithm_h
3 
4 namespace edm{class EventSetup;}
5 class SiStripDigi;
14 #include <limits>
15 
16 
18 
20 
21  public:
22 
24  virtual void initialize(const edm::EventSetup&);
25 
26 
27  //Offline DetSet interface
33 
34  //HLT stripByStrip interface
35  virtual bool stripByStripBegin(uint32_t id) = 0;
36 
37  virtual void addFed(sistrip::FEDZSChannelUnpacker & unpacker, uint16_t ipair, std::vector<SiStripCluster>& out) {}
38  virtual void stripByStripAdd(uint16_t strip, uint8_t adc, std::vector<SiStripCluster>& out) {}
39  virtual void stripByStripEnd(std::vector<SiStripCluster>& out) {}
40 
41  virtual void addFed(sistrip::FEDZSChannelUnpacker & unpacker, uint16_t ipair, output_t::FastFiller & out) {}
42  virtual void stripByStripAdd(uint16_t strip, uint8_t adc, output_t::FastFiller & out) {}
44 
45  virtual void cleanState(){}
46 
48 
49 
50  SiStripDetCabling const * cabling() const { return theCabling;}
51  std::vector<uint32_t> const & allDetIds() const { return detIds;}
52  std::vector<const FedChannelConnection *> const & currentConnection() const { return connections[ind]; }
53 
54  protected:
55 
57 
58  uint32_t currentId() {return detId;}
59  bool setDetId(const uint32_t);
60  float noise(const uint16_t& strip) const { return SiStripNoises::getNoise( strip, noiseRange ); }
61  float gain(const uint16_t& strip) const { return SiStripGain::getStripGain( strip, gainRange ); }
62  bool bad(const uint16_t& strip) const { return qualityHandle->IsStripBad( qualityRange, strip ); }
63  bool isModuleBad(const uint32_t& id) const { return qualityHandle->IsModuleBad( id ); }
64  bool isModuleUsable(const uint32_t& id) const { return qualityHandle->IsModuleUsable( id ); }
65  bool allBadBetween(uint16_t L, const uint16_t& R) const { while( ++L < R && bad(L) ); return L == R; }
66 
68  bool _setDetId;
69 
70  private:
71 
72  template<class T> void clusterize_(const T& input, output_t& output) {
73  for(typename T::const_iterator it = input.begin(); it!=input.end(); it++) {
74  output_t::FastFiller ff(output, it->detId());
75  clusterizeDetUnit(*it, ff);
76  if(ff.empty()) ff.abort();
77  }
78  }
79 
81  struct Index {
82  unsigned short
86  };
87  std::vector<uint32_t> detIds; // from cabling (connected and not bad)
88  std::vector<std::vector<const FedChannelConnection *> > connections;
89  std::vector<Index> indices;
96  SiStripDetCabling const * theCabling = nullptr;
98  unsigned short ind=invalidI;
99 
100 };
101 #endif
int adc(sample_type sample)
get the ADC sample (12 bits)
virtual void stripByStripAdd(uint16_t strip, uint8_t adc, output_t::FastFiller &out)
edm::ESHandle< SiStripQuality > qualityHandle
void clusterize_(const T &input, output_t &output)
bool bad(const uint16_t &strip) const
std::vector< uint32_t > const & allDetIds() const
edm::ESHandle< SiStripGain > gainHandle
SiStripQuality::Range qualityRange
virtual void addFed(sistrip::FEDZSChannelUnpacker &unpacker, uint16_t ipair, std::vector< SiStripCluster > &out)
bool isModuleBad(const uint32_t &id) const
float noise(const uint16_t &strip) const
#define constexpr
edm::ESHandle< SiStripNoises > noiseHandle
static std::string const input
Definition: EdmProvDump.cc:43
virtual void stripByStripEnd(std::vector< SiStripCluster > &out)
virtual bool stripByStripBegin(uint32_t id)=0
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:74
virtual void addFed(sistrip::FEDZSChannelUnpacker &unpacker, uint16_t ipair, output_t::FastFiller &out)
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:68
Class containning control, module, detector and connection information, at the level of a FED channel...
std::vector< std::vector< const FedChannelConnection * > > connections
std::pair< ContainerIterator, ContainerIterator > Range
edmNew::DetSetVector< SiStripCluster > output_t
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
SiStripDetCabling const * theCabling
tuple out
Definition: dbtoconf.py:99
bool isModuleUsable(const uint32_t &id) const
std::vector< const FedChannelConnection * > const & currentConnection() const
virtual void initialize(const edm::EventSetup &)
bool allBadBetween(uint16_t L, const uint16_t &R) const
SiStripDetCabling const * cabling() const
void clusterize(const edm::DetSetVector< SiStripDigi > &, output_t &)
virtual void stripByStripAdd(uint16_t strip, uint8_t adc, std::vector< SiStripCluster > &out)
std::pair< ContainerIterator, ContainerIterator > Range
float gain(const uint16_t &strip) const
std::vector< uint32_t > detIds
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:48
long double T
virtual void clusterizeDetUnit(const edm::DetSet< SiStripDigi > &, output_t::FastFiller &)=0
virtual void stripByStripEnd(output_t::FastFiller &out)