CMS 3D CMS Logo

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 
16 
17  Det stripByStripBegin(uint32_t id) const override;
18 
19  // LazyGetter interface
20  void stripByStripAdd(State & state, uint16_t strip, uint8_t adc, std::vector<SiStripCluster>& out) const override;
21  void stripByStripEnd(State & state, std::vector<SiStripCluster>& out) const override;
22 
23  void addFed(State & state, sistrip::FEDZSChannelUnpacker & unpacker, uint16_t ipair, std::vector<SiStripCluster>& out) const {
24  while (unpacker.hasData()) {
25  stripByStripAdd(state,unpacker.sampleNumber()+ipair*256,unpacker.adc(),out);
26  unpacker++;
27  }
28  }
29 
30  // detset interface
31  void addFed(State & state, sistrip::FEDZSChannelUnpacker & unpacker, uint16_t ipair, output_t::TSFastFiller & out) const override {
32  while (unpacker.hasData()) {
33  stripByStripAdd(state, unpacker.sampleNumber()+ipair*256,unpacker.adc(),out);
34  unpacker++;
35  }
36  }
37 
38  void stripByStripAdd(State & state, uint16_t strip, uint8_t adc, output_t::TSFastFiller & out) const override {
39  if(candidateEnded(state, strip)) endCandidate(state, out);
40  addToCandidate(state, strip,adc);
41  }
42 
43  void stripByStripEnd(State & state, output_t::TSFastFiller & out) const override { endCandidate(state,out);}
44 
45 
46  private:
47 
48  template<class T> void clusterizeDetUnit_(const T&, output_t::TSFastFiller&) const;
49 
50  ThreeThresholdAlgorithm(float, float, float, unsigned, unsigned, unsigned, std::string qualityLabel,
51  bool removeApvShots, float minGoodCharge);
52 
53 
54  //constant methods with state information
55  uint16_t firstStrip(State const & state) const {return state.lastStrip - state.ADCs.size() + 1;}
56  bool candidateEnded(State const & state, const uint16_t&) const;
57  bool candidateAccepted(State const & state) const;
58 
59  //state modification methods
60  template<class T> void endCandidate(State & state, T&) const;
61  void clearCandidate(State & state) const { state.candidateLacksSeed = true; state.noiseSquared = 0; state.ADCs.clear();}
62  void addToCandidate(State & state, const SiStripDigi& digi) const { addToCandidate(state, digi.strip(),digi.adc());}
63  void addToCandidate(State & state, uint16_t strip, uint8_t adc) const;
64  void appendBadNeighbors(State & state) const;
65  void applyGains(State & state) const;
66 
71 
72 };
73 
74 #endif
int adc(sample_type sample)
get the ADC sample (12 bits)
ThreeThresholdAlgorithm(float, float, float, unsigned, unsigned, unsigned, std::string qualityLabel, bool removeApvShots, float minGoodCharge)
void addFed(State &state, sistrip::FEDZSChannelUnpacker &unpacker, uint16_t ipair, std::vector< SiStripCluster > &out) const
void clusterizeDetUnit(const edm::DetSet< SiStripDigi > &, output_t::TSFastFiller &) const override
GeometricSearchDet Det
Definition: DetBelowR.h:8
bool candidateAccepted(State const &state) const
Det stripByStripBegin(uint32_t id) const override
void endCandidate(State &state, T &) const
void clearCandidate(State &state) const
void appendBadNeighbors(State &state) const
void stripByStripEnd(State &state, std::vector< SiStripCluster > &out) const override
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
bool candidateEnded(State const &state, const uint16_t &) const
void addToCandidate(State &state, const SiStripDigi &digi) const
void stripByStripAdd(State &state, uint16_t strip, uint8_t adc, output_t::TSFastFiller &out) const override
void stripByStripAdd(State &state, uint16_t strip, uint8_t adc, std::vector< SiStripCluster > &out) const override
void applyGains(State &state) const
State
Definition: hltDiff.cc:288
void stripByStripEnd(State &state, output_t::TSFastFiller &out) const override
const uint16_t & adc() const
Definition: SiStripDigi.h:41
long double T
uint16_t firstStrip(State const &state) const
void addFed(State &state, sistrip::FEDZSChannelUnpacker &unpacker, uint16_t ipair, output_t::TSFastFiller &out) const override
void clusterizeDetUnit_(const T &, output_t::TSFastFiller &) const