test
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  void cleanState() override {clearCandidate();}
43 
44 
45  private:
46 
47  template<class T> void clusterizeDetUnit_(const T&, output_t::FastFiller&);
48  ThreeThresholdAlgorithm(float, float, float, unsigned, unsigned, unsigned, std::string qualityLabel,
49  bool setDetId, bool removeApvShots, float minGoodCharge);
50 
51  //state of the candidate cluster
52  std::vector<uint8_t> ADCs;
53  uint16_t lastStrip;
54  float noiseSquared;
56 
57  //constant methods with state information
58  uint16_t firstStrip() const {return lastStrip - ADCs.size() + 1;}
59  bool candidateEnded(const uint16_t&) const;
60  bool candidateAccepted() const;
61 
62  //state modification methods
63  template<class T> void endCandidate(T&);
64  void clearCandidate() { candidateLacksSeed = true; noiseSquared = 0; ADCs.clear();}
65  void addToCandidate(const SiStripDigi& digi) { addToCandidate(digi.strip(),digi.adc());}
66  void addToCandidate(uint16_t strip, uint8_t adc);
67  void appendBadNeighbors();
68  void applyGains();
69 
74 
76 };
77 
78 #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
ThreeThresholdAlgorithm(float, float, float, unsigned, unsigned, unsigned, std::string qualityLabel, bool setDetId, bool removeApvShots, float minGoodCharge)
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
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