CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ThreeThresholdAlgorithm.h
Go to the documentation of this file.
1 #ifndef RecoLocalTracker_SiStripClusterizer_ThreeThresholdAlgorithm_h
2 #define RecoLocalTracker_SiStripClusterizer_ThreeThresholdAlgorithm_h
5 
7 
9 
10  public:
11 
14 
15  bool stripByStripBegin(uint32_t id);
16 
17  // LazyGetter interface
18  void stripByStripAdd(uint16_t strip, uint8_t adc, std::vector<SiStripCluster>& out);
19  void stripByStripEnd(std::vector<SiStripCluster>& out);
20  void addFed(sistrip::FEDZSChannelUnpacker & unpacker, uint16_t ipair, std::vector<SiStripCluster>& out) {
21  while (unpacker.hasData()) {
22  stripByStripAdd(unpacker.sampleNumber()+ipair*256,unpacker.adc(),out);
23  unpacker++;
24  }
25  }
26 
27  // detset interface
28  void addFed(sistrip::FEDZSChannelUnpacker & unpacker, uint16_t ipair, output_t::FastFiller & out) override {
29  while (unpacker.hasData()) {
30  stripByStripAdd(unpacker.sampleNumber()+ipair*256,unpacker.adc(),out);
31  unpacker++;
32  }
33  }
34 
35  void stripByStripAdd(uint16_t strip, uint8_t adc, output_t::FastFiller & out) override {
36  if(candidateEnded(strip)) endCandidate(out);
37  addToCandidate(strip,adc);
38  }
39 
41 
42 
43 
44  private:
45 
46  template<class T> void clusterizeDetUnit_(const T&, output_t::FastFiller&);
47  ThreeThresholdAlgorithm(float, float, float, unsigned, unsigned, unsigned, std::string qualityLabel,
48  bool setDetId, bool removeApvShots=false);
49 
50  //state of the candidate cluster
51  std::vector<uint8_t> ADCs;
52  uint16_t lastStrip;
53  float noiseSquared;
55 
56  //constant methods with state information
57  uint16_t firstStrip() const {return lastStrip - ADCs.size() + 1;}
58  bool candidateEnded(const uint16_t&) const;
59  bool candidateAccepted() const;
60 
61  //state modification methods
62  template<class T> void endCandidate(T&);
63  void clearCandidate() { candidateLacksSeed = true; noiseSquared = 0; ADCs.clear();}
64  void addToCandidate(const SiStripDigi& digi) { addToCandidate(digi.strip(),digi.adc());}
65  void addToCandidate(uint16_t strip, uint8_t adc);
66  void appendBadNeighbors();
67  void applyGains();
68 
72 
74 };
75 
76 #endif
int adc(sample_type sample)
get the ADC sample (12 bits)
void stripByStripEnd(output_t::FastFiller &out) override
void addFed(sistrip::FEDZSChannelUnpacker &unpacker, uint16_t ipair, std::vector< SiStripCluster > &out)
void addToCandidate(const SiStripDigi &digi)
bool candidateEnded(const uint16_t &) const
void stripByStripAdd(uint16_t strip, uint8_t adc, std::vector< SiStripCluster > &out)
SiStripApvShotCleaner ApvCleaner
const uint16_t & strip() const
Definition: SiStripDigi.h:40
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
ThreeThresholdAlgorithm(float, float, float, unsigned, unsigned, unsigned, std::string qualityLabel, bool setDetId, bool removeApvShots=false)
tuple out
Definition: dbtoconf.py:99
void stripByStripAdd(uint16_t strip, uint8_t adc, output_t::FastFiller &out) override
std::vector< uint8_t > ADCs
void stripByStripEnd(std::vector< SiStripCluster > &out)
void clusterizeDetUnit(const edm::DetSet< SiStripDigi > &, output_t::FastFiller &)
void addFed(sistrip::FEDZSChannelUnpacker &unpacker, uint16_t ipair, output_t::FastFiller &out) override
void clusterizeDetUnit_(const T &, output_t::FastFiller &)
const uint16_t & adc() const
Definition: SiStripDigi.h:41
long double T