CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OldThreeThresholdAlgorithm.h
Go to the documentation of this file.
1 #ifndef RECOLOCALTRACKER_SISTRIPCLUSTERIZER_THREETHRESHOLDSTRIPCLUSTERIZER_H
2 #define RECOLOCALTRACKER_SISTRIPCLUSTERIZER_THREETHRESHOLDSTRIPCLUSTERIZER_H
3 
4 //Data Formats
10 
19 
20 #include <vector>
21 #include <algorithm>
22 #include <cmath>
23 #include <string>
24 
27 
29 
31 
32  public:
33 
34  // void setSiStripNoiseService( SiStripNoiseService* in ){ SiStripNoiseService_=in;}
37 
38  void initialize(const edm::EventSetup&);
39 
40  bool stripByStripBegin(uint32_t id) {return false;}
41  void stripByStripAdd(uint16_t strip, uint16_t adc, std::vector<SiStripCluster>& out) {}
42  void stripByStripEnd(std::vector<SiStripCluster>& out) {}
43 
47 
48  private:
49 
50  OldThreeThresholdAlgorithm(float strip_thr, float seed_thr,float clust_thr, int max_holes,std::string qualityLabel,bool setDetId) :
51  theChannelThreshold(strip_thr),
52  theSeedThreshold(seed_thr),
53  theClusterThreshold(clust_thr),
54  max_holes_(max_holes),
55  qualityLabel_(qualityLabel){
57 
58  // SiStripNoiseService* SiStripNoiseService_;
59  template<typename InputDetSet>
61 
66  std::string qualityLabel_;
67 
71 
72  std::vector<SiStripDigi> cluster_digis_; // so it's not recreated for each det for each event!
73 };
74 
75 class AboveSeed {
76  public:
77 
78 
79  // AboveSeed(float aseed,SiStripNoiseService* noise,const uint32_t& detID) : seed(aseed), noise_(noise),detID_(detID) {};
80 
81  AboveSeed(float aseed, const edm::ESHandle<SiStripNoises> & noiseHandle, const SiStripNoises::Range & noiseRange, const edm::ESHandle<SiStripQuality> & qualityHandle, const SiStripQuality::Range & qualityRange)
82  : seed(aseed), noise_(noiseHandle), noiseRange_(noiseRange),quality_(qualityHandle), qualityRange_(qualityRange)
83  {};
84  //,detID_(detID) {};
85 
86  inline bool operator()(const SiStripDigi& digi) {
87  return (
88  !quality_->IsStripBad(qualityRange_,digi.strip())
89  &&
90  digi.adc() >= seed * noise_->getNoise(digi.strip(), noiseRange_)
91  );
92  }
93  private:
94  float seed;
99 };
100 
101 #endif
int adc(sample_type sample)
get the ADC sample (12 bits)
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
void stripByStripEnd(std::vector< SiStripCluster > &out)
void initialize(const edm::EventSetup &)
void clusterizeDetUnit_(const InputDetSet &digis, edmNew::DetSetVector< SiStripCluster >::FastFiller &output)
void stripByStripAdd(uint16_t strip, uint16_t adc, std::vector< SiStripCluster > &out)
edm::ESHandle< SiStripGain > gainHandle_
OldThreeThresholdAlgorithm(float strip_thr, float seed_thr, float clust_thr, int max_holes, std::string qualityLabel, bool setDetId)
std::vector< SiStripDigi > cluster_digis_
edm::ESHandle< SiStripNoises > noiseHandle_
const SiStripQuality::Range & qualityRange_
bool operator()(const SiStripDigi &digi)
const uint16_t & strip() const
Definition: SiStripDigi.h:40
const edm::ESHandle< SiStripNoises > & noise_
AboveSeed(float aseed, const edm::ESHandle< SiStripNoises > &noiseHandle, const SiStripNoises::Range &noiseRange, const edm::ESHandle< SiStripQuality > &qualityHandle, const SiStripQuality::Range &qualityRange)
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
virtual void setDetId(const uint32_t)
edm::ESHandle< SiStripQuality > qualityHandle_
const edm::ESHandle< SiStripQuality > & quality_
void clusterizeDetUnit(const edm::DetSet< SiStripDigi > &digis, edmNew::DetSetVector< SiStripCluster >::FastFiller &output)
std::pair< ContainerIterator, ContainerIterator > Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:41
const uint16_t & adc() const
Definition: SiStripDigi.h:41
const SiStripNoises::Range & noiseRange_