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  //Offline DetSet interface
32 
33  //HLT stripByStrip interface
34  virtual bool stripByStripBegin(uint32_t id) = 0;
35 
36  virtual void addFed(sistrip::FEDZSChannelUnpacker & unpacker, uint16_t ipair, std::vector<SiStripCluster>& out) {}
37  virtual void stripByStripAdd(uint16_t strip, uint8_t adc, std::vector<SiStripCluster>& out) {}
38  virtual void stripByStripEnd(std::vector<SiStripCluster>& out) {}
39 
40  virtual void addFed(sistrip::FEDZSChannelUnpacker & unpacker, uint16_t ipair, output_t::FastFiller & out) {}
41  virtual void stripByStripAdd(uint16_t strip, uint8_t adc, output_t::FastFiller & out) {}
43 
44 
46 
47 
48  SiStripDetCabling const * cabling() const { return theCabling;}
49  std::vector<uint32_t> const & allDetIds() const { return detIds;}
50  std::vector<const FedChannelConnection *> const & currentConnection() const { return connections[ind]; }
51 
52  protected:
53 
55 
56  uint32_t currentId() {return detId;}
57  bool setDetId(const uint32_t);
58  float noise(const uint16_t& strip) const { return SiStripNoises::getNoise( strip, noiseRange ); }
59  float gain(const uint16_t& strip) const { return SiStripGain::getStripGain( strip, gainRange ); }
60  bool bad(const uint16_t& strip) const { return qualityHandle->IsStripBad( qualityRange, strip ); }
61  bool isModuleBad(const uint32_t& id) const { return qualityHandle->IsModuleBad( id ); }
62  bool isModuleUsable(const uint32_t& id) const { return qualityHandle->IsModuleUsable( id ); }
63  bool allBadBetween(uint16_t L, const uint16_t& R) const { while( ++L < R && bad(L) ); return L == R; }
64 
66  bool _setDetId;
67 
68  private:
69 
70  template<class T> void clusterize_(const T& input, output_t& output) {
71  for(typename T::const_iterator it = input.begin(); it!=input.end(); it++) {
72  output_t::FastFiller ff(output, it->detId());
73  clusterizeDetUnit(*it, ff);
74  if(ff.empty()) ff.abort();
75  }
76  }
77 
79  struct Index {
80  unsigned short
84  };
85  std::vector<uint32_t> detIds; // from cabling (connected and not bad)
86  std::vector<std::vector<const FedChannelConnection *> > connections;
87  std::vector<Index> indices;
94  SiStripDetCabling const * theCabling = nullptr;
96  unsigned short ind=invalidI;
97 
98 };
99 #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
edm::ESHandle< SiStripNoises > noiseHandle
static std::string const input
Definition: EdmProvDump.cc:44
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)
const T & max(const T &a, const T &b)
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
PixelRecoRange< float > Range
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)
static constexpr unsigned short invalidI
float gain(const uint16_t &strip) const
std::vector< uint32_t > detIds
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:48
long double T
#define constexpr
virtual void clusterizeDetUnit(const edm::DetSet< SiStripDigi > &, output_t::FastFiller &)=0
virtual void stripByStripEnd(output_t::FastFiller &out)