Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:10

0001 #ifndef RecoLocalTracker_SiStripClusterizer_ThreeThresholdAlgorithm_h
0002 #define RecoLocalTracker_SiStripClusterizer_ThreeThresholdAlgorithm_h
0003 #include "RecoLocalTracker/SiStripClusterizer/interface/StripClusterizerAlgorithm.h"
0004 #include "RecoLocalTracker/SiStripClusterizer/interface/SiStripApvShotCleaner.h"
0005 
0006 class ThreeThresholdAlgorithm final : public StripClusterizerAlgorithm {
0007   friend class StripClusterizerAlgorithmFactory;
0008 
0009 public:
0010   using State = StripClusterizerAlgorithm::State;
0011   using Det = StripClusterizerAlgorithm::Det;
0012   void clusterizeDetUnit(const edm::DetSet<SiStripDigi>&, output_t::TSFastFiller&) const override;
0013   void clusterizeDetUnit(const edmNew::DetSet<SiStripDigi>&, output_t::TSFastFiller&) const override;
0014 
0015   // LazyGetter interface
0016   void stripByStripAdd(State& state, uint16_t strip, uint8_t adc, std::vector<SiStripCluster>& out) const override;
0017   void stripByStripEnd(State& state, std::vector<SiStripCluster>& out) const override;
0018 
0019   void stripByStripAdd(State& state, uint16_t strip, uint8_t adc, output_t::TSFastFiller& out) const override {
0020     if (candidateEnded(state, strip))
0021       endCandidate(state, out);
0022     addToCandidate(state, strip, adc);
0023   }
0024 
0025   void stripByStripEnd(State& state, output_t::TSFastFiller& out) const override { endCandidate(state, out); }
0026 
0027 private:
0028   template <class T>
0029   void clusterizeDetUnit_(const T&, output_t::TSFastFiller&) const;
0030 
0031   ThreeThresholdAlgorithm(const edm::ESGetToken<SiStripClusterizerConditions, SiStripClusterizerConditionsRcd>&,
0032                           float,
0033                           float,
0034                           float,
0035                           unsigned,
0036                           unsigned,
0037                           unsigned,
0038                           bool removeApvShots,
0039                           float minGoodCharge);
0040 
0041   //constant methods with state information
0042   uint16_t firstStrip(State const& state) const { return state.lastStrip - state.ADCs.size() + 1; }
0043   bool candidateEnded(State const& state, const uint16_t&) const;
0044   bool candidateAccepted(State const& state) const;
0045 
0046   //state modification methods
0047   template <class T>
0048   void endCandidate(State& state, T&) const;
0049   void clearCandidate(State& state) const {
0050     state.candidateLacksSeed = true;
0051     state.noiseSquared = 0;
0052     state.ADCs.clear();
0053   }
0054   void addToCandidate(State& state, const SiStripDigi& digi) const { addToCandidate(state, digi.strip(), digi.adc()); }
0055   void addToCandidate(State& state, uint16_t strip, uint8_t adc) const;
0056   void appendBadNeighbors(State& state) const;
0057   void applyGains(State& state) const;
0058 
0059   float ChannelThreshold, SeedThreshold, ClusterThresholdSquared;
0060   uint8_t MaxSequentialHoles, MaxSequentialBad, MaxAdjacentBad;
0061   bool RemoveApvShots;
0062   float minGoodCharge;
0063 };
0064 
0065 #endif